DllMain() seems unused in ntoskrnl.exe

Francois Gouget fgouget at free.fr
Wed Jun 13 12:46:47 CDT 2012


The DllMain() function in ntoskrnl.exe appears to be unused: making 
it static causes a compiler warning to that effect and removing it 
entirely does not cause a compilation failure. Should it be removed or 
is there a build issue with ntoskrnl.exe?


diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
index 2b84297..ffeb2f8 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
@@ -1711,30 +1711,6 @@ VOID WINAPI IoInitializeRemoveLockEx(PIO_REMOVE_LOCK lock, ULONG tag,
 }
 
 /*****************************************************
- *           DllMain
- */
-BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
-{
-    static void *handler;
-    LARGE_INTEGER count;
-
-    switch(reason)
-    {
-    case DLL_PROCESS_ATTACH:
-        DisableThreadLibraryCalls( inst );
-#ifdef __i386__
-        handler = RtlAddVectoredExceptionHandler( TRUE, vectored_handler );
-#endif
-        KeQueryTickCount( &count );  /* initialize the global KeTickCount */
-        break;
-    case DLL_PROCESS_DETACH:
-        RtlRemoveVectoredExceptionHandler( handler );
-        break;
-    }
-    return TRUE;
-}
-
-/*****************************************************
  *           Ke386IoSetAccessProcess  (NTOSKRNL.EXE.@)
  */
 BOOLEAN WINAPI Ke386IoSetAccessProcess(PEPROCESS *process, ULONG flag)


-- 
Francois Gouget <fgouget at free.fr>              http://fgouget.free.fr/
       Be careful of reading health books, you might die of a misprint.
                                 -- Mark Twain




More information about the wine-devel mailing list