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..9418546b0a5170361697c0a6194a21c49b2a7dba 100644 |
--- a/chrome_elf/create_file/chrome_create_file.cc |
+++ b/chrome_elf/create_file/chrome_create_file.cc |
@@ -43,6 +43,9 @@ PathIsPrefixFunction g_path_is_prefix_func; |
PathFindFileName g_path_find_filename_func; |
SHGetFolderPathFunction g_get_folder_func; |
+// Record the number of calls we've redirected so far. |
+int g_redirect_count = 0; |
+ |
// Populates the g_*_func pointers to functions which will be used in |
// ShouldBypass(). Chrome_elf cannot have a load-time dependency on shell32 or |
// shlwapi as this would induce a load-time dependency on user32.dll. Instead, |
@@ -92,6 +95,7 @@ HANDLE WINAPI CreateFileWRedirect( |
DWORD flags_and_attributes, |
HANDLE template_file) { |
if (ShouldBypass(file_name)) { |
+ g_redirect_count++; |
gab
2014/02/19 15:43:40
nit: pre-increment
Cait (Slow)
2014/02/19 16:28:06
Done.
|
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, |