*/
/* INCLUDES *****************************************************************/
+
//#define HAVE_SLIST_ENTRY_IMPLEMENTED
#define WIN32_NO_STATUS
#define _INC_WINDOWS
/* GLOBALS ******************************************************************/
-static VOID CALLBACK ServiceMain(DWORD argc, LPWSTR *argv);
static WCHAR ServiceName[] = L"PlugPlay";
-static SERVICE_TABLE_ENTRYW ServiceTable[] =
-{
- {ServiceName, ServiceMain},
- {NULL, NULL}
-};
static SERVICE_STATUS_HANDLE ServiceStatusHandle;
static SERVICE_STATUS ServiceStatus;
DPRINT("RpcServerThread() called\n");
#if 0
- /* XP-compatible protocol sequence/endpoint */
+ /* 2k/XP/2k3-compatible protocol sequence/endpoint */
Status = RpcServerUseProtseqEpW(L"ncacn_np",
20,
L"\\pipe\\ntsvcs",
DPRINT1("RpcServerUseProtseqEpW() failed (Status %lx)\n", Status);
#endif
- /* Vista-compatible protocol sequence/endpoint */
+ /* Vista/7-compatible protocol sequence/endpoint */
Status = RpcServerUseProtseqEpW(L"ncacn_np",
20,
L"\\pipe\\plugplay",
}
}
-done:;
+done:
if (ret == CR_SUCCESS)
*pulTransferLen = *pulLength;
ret = CR_REGISTRY_ERROR;
}
-done:;
+done:
if (hPropKey != NULL)
RegCloseKey(hPropKey);
}
}
-done:;
+done:
if (ret == CR_SUCCESS)
*pulTransferLen = *pulLength;
/* Function 73 */
DWORD PNP_SetActiveService(
- handle_t hBinding)
+ handle_t hBinding,
+ LPWSTR pszFilter,
+ DWORD ulFlags)
{
UNIMPLEMENTED;
return CR_CALL_NOT_IMPLEMENTED;
}
-static VOID CALLBACK
+VOID WINAPI
ServiceMain(DWORD argc, LPTSTR *argv)
{
HANDLE hThread;
DPRINT("ServiceMain() done\n");
}
-
-int
-wmain(int argc, WCHAR *argv[])
+static DWORD
+InitializePnPManager(VOID)
{
BOOLEAN OldValue;
DWORD dwError;
- UNREFERENCED_PARAMETER(argc);
- UNREFERENCED_PARAMETER(argv);
-
- DPRINT("Umpnpmgr: main() started\n");
+ DPRINT("UMPNPMGR: InitializePnPManager() started\n");
/* We need this privilege for using CreateProcessAsUserW */
RtlAdjustPrivilege(SE_ASSIGNPRIMARYTOKEN_PRIVILEGE, TRUE, FALSE, &OldValue);
- hInstallEvent = CreateEvent(NULL, TRUE, SetupIsActive()/*FALSE*/, NULL);
+ hInstallEvent = CreateEventW(NULL, TRUE, SetupIsActive()/*FALSE*/, NULL);
if (hInstallEvent == NULL)
{
dwError = GetLastError();
return dwError;
}
- hDeviceInstallListNotEmpty = CreateEvent(NULL, FALSE, FALSE, NULL);
+ hDeviceInstallListNotEmpty = CreateEventW(NULL, FALSE, FALSE, NULL);
if (hDeviceInstallListNotEmpty == NULL)
{
dwError = GetLastError();
return dwError;
}
- StartServiceCtrlDispatcher(ServiceTable);
+ DPRINT("UMPNPMGR: InitializePnPManager() done\n");
- DPRINT("Umpnpmgr: main() done\n");
+ return 0;
+}
- ExitThread(0);
+BOOL WINAPI
+DllMain(HINSTANCE hinstDLL,
+ DWORD fdwReason,
+ LPVOID lpvReserved)
+{
+ switch (fdwReason)
+ {
+ case DLL_PROCESS_ATTACH:
+ DisableThreadLibraryCalls(hinstDLL);
+ InitializePnPManager();
+ break;
- return 0;
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+
+ return TRUE;
}
/* EOF */