Fix a race condition between umpnpmgr service and CMP_WaitNoPendingInstallEvents API.

svn path=/trunk/; revision=37894
This commit is contained in:
Hervé Poussineau 2008-12-06 12:54:24 +00:00
parent 1a716522d1
commit 2a8bf4162a

View file

@ -2221,11 +2221,6 @@ ServiceMain(DWORD argc, LPTSTR *argv)
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 @@ wmain(int argc, WCHAR *argv[])
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