Chromium Code Reviews| Index: chrome_elf/create_file/chrome_create_file.cc |
| diff --git a/chrome_elf/create_file/chrome_create_file.cc b/chrome_elf/create_file/chrome_create_file.cc |
| index b6744f3f34d38f5f34967bb4c3da44dc50b7e7d9..52a88f909abcb8859031bb6cf5d29031738c8ede 100644 |
| --- a/chrome_elf/create_file/chrome_create_file.cc |
| +++ b/chrome_elf/create_file/chrome_create_file.cc |
| @@ -11,6 +11,9 @@ |
| #include "chrome_elf/ntdll_cache.h" |
| #include "sandbox/win/src/nt_internals.h" |
| +// Record the number of calls we've redirected so far. |
| +int g_redirect_count = 0; |
|
robertshield
2014/02/18 23:30:21
This is only used in this file, it can be moved in
Cait (Slow)
2014/02/19 15:43:18
Done.
|
| + |
| namespace { |
| // From ShlObj.h in the Windows SDK. |
| @@ -92,6 +95,7 @@ HANDLE WINAPI CreateFileWRedirect( |
| DWORD flags_and_attributes, |
| HANDLE template_file) { |
| if (ShouldBypass(file_name)) { |
| + g_redirect_count++; |
| return CreateFileNTDLL(file_name, |
| desired_access, |
| share_mode, |
| @@ -110,6 +114,10 @@ HANDLE WINAPI CreateFileWRedirect( |
| } |
| +int GetRedirectCount() { |
| + return g_redirect_count; |
| +} |
| + |
| HANDLE CreateFileNTDLL( |
| LPCWSTR file_name, |
| DWORD desired_access, |