85 DPRINT1(
"ServiceControlHandler() called\n");
90 DPRINT1(
" SERVICE_CONTROL_STOP received\n");
98 DPRINT1(
" SERVICE_CONTROL_PAUSE received\n");
103 DPRINT1(
" SERVICE_CONTROL_CONTINUE received\n");
108 DPRINT1(
" SERVICE_CONTROL_INTERROGATE received\n");
114 DPRINT1(
" SERVICE_CONTROL_SHUTDOWN received\n");
122 DPRINT1(
" Control %lu received\n", dwControl);
148 DPRINT(
"GetBooleanRegValue(): RegOpenKeyExW() has failed to open '%S' key! (Error: %lu)\n",
161 DPRINT(
"GetBooleanRegValue(): RegQueryValueExW() has failed to query '%S' value! (Error: %lu)\n",
167 DPRINT(
"GetBooleanRegValue(): The value is not of REG_DWORD type!\n");
190 L"Software\\Policies\\Microsoft\\Windows\\DeviceInstall\\Settings",
193 if (bSuppressNewHWUI)
194 DPRINT(
"GetSuppressNewUIValue(): newdev.dll's wizard UI won't be shown!\n");
196 return bSuppressNewHWUI;
208 DPRINT(
"ServiceMain() called\n");
254 DPRINT(
"ServiceMain() done\n");
263 DPRINT(
"UMPNPMGR: InitializePnPManager() started\n");
272 DPRINT1(
"Could not create the Install Event! (Error %lu)\n", dwError);
279 L"Global\\PnP_No_Pending_Install_Events");
283 DPRINT1(
"Could not create the Pending-Install Event! (Error %lu)\n", dwError);
295 DPRINT1(
"Could not create the List Event! (Error %lu)\n", dwError);
303 DPRINT1(
"Could not create the List Mutex! (Error %lu)\n", dwError);
310 L"System\\CurrentControlSet\\Services\\PlugPlay\\Parameters",
314 DPRINT(
"UMPNPMGR: newdev.dll's wizard UI won't be shown!\n");
317 L"System\\CurrentControlSet\\Enum",
323 DPRINT1(
"Could not open the Enum Key! (Error %lu)\n", dwError);
328 L"System\\CurrentControlSet\\Control\\Class",
334 DPRINT1(
"Could not open the Class Key! (Error %lu)\n", dwError);
338 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