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..5fed63e235f01a2b7aa5d712b378bb8059ab02be 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 if the last call to CreateFile was redirected. |
| +bool g_last_call_was_redirected = false; |
|
robertshield
2014/02/18 19:36:03
I think this should be a monotonically increasing
gab
2014/02/18 19:43:11
And if you want to go deeper, you could have a per
robertshield
2014/02/18 19:46:22
We could, but we're really interested in seeing th
Cait (Slow)
2014/02/18 23:17:18
I'll switch it to a count, when we can use to chec
|
| + |
| 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_last_call_was_redirected = true; |
| return CreateFileNTDLL(file_name, |
| desired_access, |
| share_mode, |
| @@ -110,6 +114,10 @@ HANDLE WINAPI CreateFileWRedirect( |
| } |
| +bool LastCallWasRedirected() { |
| + return g_last_call_was_redirected; |
| +} |
| + |
| HANDLE CreateFileNTDLL( |
| LPCWSTR file_name, |
| DWORD desired_access, |