Bug 848020 - Do we really have to poison NtFlushBuffersFile? r=BenWa.
authorRafael Ávila de Espíndola <respindola@mozilla.org>
Thu, 07 Mar 2013 15:28:05 -0500
changeset 124143 fe8a8cad48a4a236a52a1bcff1d22f3b7023b3e8
parent 124142 fed3eba78414639f448d9e1c02a60983f2c2daf1
child 124144 035af5615fb44a2b4a4d066072564d5893fcdd06
push id24408
push userryanvm@gmail.com
push dateFri, 08 Mar 2013 04:58:11 +0000
treeherdermozilla-central@cb432984d5ce [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBenWa
bugs848020
milestone22.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 848020 - Do we really have to poison NtFlushBuffersFile? r=BenWa.
xpcom/build/mozPoisonWriteWin.cpp
--- a/xpcom/build/mozPoisonWriteWin.cpp
+++ b/xpcom/build/mozPoisonWriteWin.cpp
@@ -19,26 +19,16 @@ intptr_t FileDescriptorToID(int aFd) {
   return _get_osfhandle(aFd);
 }
 
 static WindowsDllInterceptor sNtDllInterceptor;
 
 void AbortOnBadWrite(HANDLE);
 bool ValidWriteAssert(bool ok);
 
-typedef NTSTATUS (WINAPI* FlushBuffersFile_fn)(HANDLE, PIO_STATUS_BLOCK);
-FlushBuffersFile_fn gOriginalFlushBuffersFile;
-
-NTSTATUS WINAPI
-patched_FlushBuffersFile(HANDLE aFileHandle, PIO_STATUS_BLOCK aIoStatusBlock)
-{
-  AbortOnBadWrite(aFileHandle);
-  return gOriginalFlushBuffersFile(aFileHandle, aIoStatusBlock);
-}
-
 typedef NTSTATUS (WINAPI* WriteFile_fn)(HANDLE, HANDLE, PIO_APC_ROUTINE,
                                         void*, PIO_STATUS_BLOCK,
                                         const void*, ULONG, PLARGE_INTEGER,
                                         PULONG);
 WriteFile_fn gOriginalWriteFile;
 
 static NTSTATUS WINAPI
 patched_WriteFile(HANDLE aFile, HANDLE aEvent, PIO_APC_ROUTINE aApc,
@@ -88,14 +78,13 @@ void PoisonWrite() {
   if (WritesArePoisoned)
     return;
   WritesArePoisoned = true;
 
   if (!PoisonWriteEnabled())
     return;
 
   sNtDllInterceptor.Init("ntdll.dll");
-  sNtDllInterceptor.AddHook("NtFlushBuffersFile", reinterpret_cast<intptr_t>(patched_FlushBuffersFile), reinterpret_cast<void**>(&gOriginalFlushBuffersFile));
   sNtDllInterceptor.AddHook("NtWriteFile", reinterpret_cast<intptr_t>(patched_WriteFile), reinterpret_cast<void**>(&gOriginalWriteFile));
   sNtDllInterceptor.AddHook("NtWriteFileGather", reinterpret_cast<intptr_t>(patched_WriteFileGather), reinterpret_cast<void**>(&gOriginalWriteFileGather));
 }
 }