windows-procmgmt-library-20070629
authorJeffrey Altman <jaltman@secure-endpoints.com>
Sat, 30 Jun 2007 00:51:36 +0000 (00:51 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Sat, 30 Jun 2007 00:51:36 +0000 (00:51 +0000)
Since the library creates its own background thread, the library must
load its own reference to itself to prevent the library from being
unloaded behind its back.

src/procmgmt/procmgmt_nt.c

index 83e9230..3b63578 100644 (file)
@@ -251,6 +251,7 @@ static DWORD WINAPI
 RemoteSignalListenerThread(LPVOID param)
 {
     HANDLE sigPipeHandle = (HANDLE) param;
+    HMODULE hLib = LoadLibrary("AFSPROCMGMT.DLL");
 
     while (1) {
        /* wait for pipe client to connect */
@@ -296,6 +297,7 @@ RemoteSignalListenerThread(LPVOID param)
     }
 
     /* never reached */
+    FreeLibrary(hLib);
     return (0);
 }