Author: hpoussin
Date: Sat Dec 6 06:54:24 2008
New Revision: 37894
URL:
http://svn.reactos.org/svn/reactos?rev=37894&view=rev
Log:
Fix a race condition between umpnpmgr service and CMP_WaitNoPendingInstallEvents API.
Modified:
trunk/reactos/base/services/umpnpmgr/umpnpmgr.c
Modified: trunk/reactos/base/services/umpnpmgr/umpnpmgr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/umpnpmgr/ump…
==============================================================================
--- trunk/reactos/base/services/umpnpmgr/umpnpmgr.c [iso-8859-1] (original)
+++ trunk/reactos/base/services/umpnpmgr/umpnpmgr.c [iso-8859-1] Sat Dec 6 06:54:24 2008
@@ -2221,11 +2221,6 @@
DPRINT("ServiceMain() called\n");
- hNoPendingInstalls = CreateEventW(NULL,
- TRUE,
- FALSE,
-
L"Global\\PnP_No_Pending_Install_Events");
-
hThread = CreateThread(NULL,
0,
PnpEventThread,
@@ -2283,6 +2278,17 @@
return dwError;
}
+ hNoPendingInstalls = CreateEventW(NULL,
+ TRUE,
+ FALSE,
+
L"Global\\PnP_No_Pending_Install_Events");
+ if (hNoPendingInstalls == NULL)
+ {
+ dwError = GetLastError();
+ DPRINT1("Could not create the Event! (Error %lu)\n", dwError);
+ return dwError;
+ }
+
#ifdef HAVE_SLIST_ENTRY_IMPLEMENTED
InitializeSListHead(&DeviceInstallListHead);
#else