89 DPRINT1(
"ServiceControlHandler() called\n");
94 DPRINT1(
" SERVICE_CONTROL_STOP received\n");
102 DPRINT1(
" SERVICE_CONTROL_PAUSE received\n");
107 DPRINT1(
" SERVICE_CONTROL_CONTINUE received\n");
112 DPRINT1(
" SERVICE_CONTROL_INTERROGATE received\n");
118 DPRINT1(
" SERVICE_CONTROL_SHUTDOWN received\n");
126 DPRINT1(
" Control %lu received\n", dwControl);
152 DPRINT(
"GetBooleanRegValue(): RegOpenKeyExW() has failed to open '%S' key! (Error: %lu)\n",
165 DPRINT(
"GetBooleanRegValue(): RegQueryValueExW() has failed to query '%S' value! (Error: %lu)\n",
171 DPRINT(
"GetBooleanRegValue(): The value is not of REG_DWORD type!\n");
194 L"Software\\Policies\\Microsoft\\Windows\\DeviceInstall\\Settings",
197 if (bSuppressNewHWUI)
198 DPRINT(
"GetSuppressNewUIValue(): newdev.dll's wizard UI won't be shown!\n");
200 return bSuppressNewHWUI;
212 DPRINT(
"ServiceMain() called\n");
258 DPRINT(
"ServiceMain() done\n");
267 DPRINT(
"UMPNPMGR: InitializePnPManager() started\n");
276 DPRINT1(
"Could not create the Install Event! (Error %lu)\n", dwError);
283 L"Global\\PnP_No_Pending_Install_Events");
287 DPRINT1(
"Could not create the Pending-Install Event! (Error %lu)\n", dwError);
299 DPRINT1(
"Could not create the List Event! (Error %lu)\n", dwError);
307 DPRINT1(
"Could not create the List Mutex! (Error %lu)\n", dwError);
314 L"System\\CurrentControlSet\\Services\\PlugPlay\\Parameters",
318 DPRINT(
"UMPNPMGR: newdev.dll's wizard UI won't be shown!\n");
321 L"System\\CurrentControlSet\\Enum",
327 DPRINT1(
"Could not open the Enum Key! (Error %lu)\n", dwError);
332 L"System\\CurrentControlSet\\Control\\Class",
338 DPRINT1(
"Could not open the Class Key! (Error %lu)\n", dwError);
342 DPRINT(
"UMPNPMGR: InitializePnPManager() done\n");
static SERVICE_STATUS_HANDLE(WINAPI *pRegisterServiceCtrlHandlerExA)(LPCSTR
static BOOL SetupIsActive(VOID)
DWORD WINAPI PnpEventThread(_In_ LPVOID lpParameter)
HANDLE hDeviceInstallListNotEmpty
DWORD WINAPI DeviceInstallThread(LPVOID lpParameter)
HANDLE hDeviceInstallListMutex
HANDLE hNoPendingInstalls
LIST_ENTRY DeviceInstallListHead
DWORD WINAPI RpcServerThread(LPVOID lpParameter)
#define RegCloseKey(hKey)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
#define ERROR_CALL_NOT_IMPLEMENTED
#define DLL_PROCESS_ATTACH
#define DLL_PROCESS_DETACH
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
static const WCHAR Cleanup[]
#define InitializeListHead(ListHead)
static IN DWORD IN LPVOID lpvReserved
#define SE_ASSIGNPRIMARYTOKEN_PRIVILEGE
static HANDLE ULONG_PTR dwData
NTSYSAPI NTSTATUS NTAPI RtlAdjustPrivilege(_In_ ULONG Privilege, _In_ BOOLEAN NewValue, _In_ BOOLEAN ForThread, _Out_ PBOOLEAN OldValue)
#define UNREFERENCED_PARAMETER(P)
RPC_STATUS WINAPI RpcMgmtStopServerListening(RPC_BINDING_HANDLE Binding)
SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandlerExW(LPCWSTR lpServiceName, LPHANDLER_FUNCTION_EX lpHandlerProc, LPVOID lpContext)
BOOL WINAPI SetServiceStatus(SERVICE_STATUS_HANDLE hServiceStatus, LPSERVICE_STATUS lpServiceStatus)
DWORD dwServiceSpecificExitCode
HANDLE WINAPI DECLSPEC_HOTPATCH CreateMutexW(IN LPSECURITY_ATTRIBUTES lpMutexAttributes OPTIONAL, IN BOOL bInitialOwner, IN LPCWSTR lpName OPTIONAL)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
static WCHAR ServiceName[]
static VOID UpdateServiceStatus(_In_ DWORD dwState, _In_ DWORD dwCheckPoint)
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
BOOL GetSuppressNewUIValue(VOID)
static DWORD WINAPI ServiceControlHandler(DWORD dwControl, DWORD dwEventType, LPVOID lpEventData, LPVOID lpContext)
static SERVICE_STATUS_HANDLE ServiceStatusHandle
static DWORD InitializePnPManager(VOID)
VOID WINAPI ServiceMain(DWORD argc, LPTSTR *argv)
static DWORD GetBooleanRegValue(IN HKEY hKey, IN PCWSTR lpSubKey, IN PCWSTR lpValue, OUT PBOOL pValue)
static SERVICE_STATUS ServiceStatus
DWORD WINAPI GetLastError(void)
#define HKEY_LOCAL_MACHINE
#define SERVICE_STOP_PENDING
#define SERVICE_CONTROL_SHUTDOWN
#define SERVICE_START_PENDING
#define SERVICE_CONTROL_CONTINUE
#define SERVICE_CONTROL_STOP
#define SERVICE_ACCEPT_SHUTDOWN
#define SERVICE_PAUSE_PENDING
#define SERVICE_CONTROL_PAUSE
#define SERVICE_CONTROL_INTERROGATE
#define SERVICE_CONTINUE_PENDING
#define SERVICE_WIN32_OWN_PROCESS