#include "precomp.h"
#include <debug.h>
Go to the source code of this file.
|
static VOID | UpdateServiceStatus (_In_ DWORD dwState, _In_ DWORD dwCheckPoint) |
|
static DWORD WINAPI | ServiceControlHandler (DWORD dwControl, DWORD dwEventType, LPVOID lpEventData, LPVOID lpContext) |
|
static DWORD | GetBooleanRegValue (IN HKEY hKey, IN PCWSTR lpSubKey, IN PCWSTR lpValue, OUT PBOOL pValue) |
|
BOOL | GetSuppressNewUIValue (VOID) |
|
VOID WINAPI | ServiceMain (DWORD argc, LPTSTR *argv) |
|
static DWORD | InitializePnPManager (VOID) |
|
BOOL WINAPI | DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) |
|
◆ NDEBUG
◆ DllMain()
Definition at line 344 of file umpnpmgr.c.
347{
348 switch (fdwReason)
349 {
353 break;
354
356 break;
357 }
358
360}
#define DLL_PROCESS_ATTACH
#define DLL_PROCESS_DETACH
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
static DWORD InitializePnPManager(VOID)
◆ GetBooleanRegValue()
Definition at line 128 of file umpnpmgr.c.
133{
137
138
140
142 lpSubKey,
143 0,
145 &hSubKey);
147 {
148 DPRINT(
"GetBooleanRegValue(): RegOpenKeyExW() has failed to open '%S' key! (Error: %lu)\n",
149 lpSubKey, dwError);
150 return dwError;
151 }
152
154 lpValue,
155 0,
156 &dwType,
158 &cbData);
160 {
161 DPRINT(
"GetBooleanRegValue(): RegQueryValueExW() has failed to query '%S' value! (Error: %lu)\n",
162 lpValue, dwError);
164 }
166 {
167 DPRINT(
"GetBooleanRegValue(): The value is not of REG_DWORD type!\n");
169 }
170
171
173
176
177 return dwError;
178}
#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)
static const WCHAR Cleanup[]
static HANDLE ULONG_PTR dwData
Referenced by GetSuppressNewUIValue(), and InitializePnPManager().
◆ GetSuppressNewUIValue()
Definition at line 181 of file umpnpmgr.c.
182{
184
185
186
187
188
190 L"Software\\Policies\\Microsoft\\Windows\\DeviceInstall\\Settings",
192 &bSuppressNewHWUI);
193 if (bSuppressNewHWUI)
194 DPRINT(
"GetSuppressNewUIValue(): newdev.dll's wizard UI won't be shown!\n");
195
196 return bSuppressNewHWUI;
197}
static DWORD GetBooleanRegValue(IN HKEY hKey, IN PCWSTR lpSubKey, IN PCWSTR lpValue, OUT PBOOL pValue)
#define HKEY_LOCAL_MACHINE
Referenced by IsUISuppressionAllowed().
◆ InitializePnPManager()
Definition at line 258 of file umpnpmgr.c.
259{
262
263 DPRINT(
"UMPNPMGR: InitializePnPManager() started\n");
264
265
267
270 {
272 DPRINT1(
"Could not create the Install Event! (Error %lu)\n", dwError);
273 return dwError;
274 }
275
279 L"Global\\PnP_No_Pending_Install_Events");
281 {
283 DPRINT1(
"Could not create the Pending-Install Event! (Error %lu)\n", dwError);
284 return dwError;
285 }
286
287
288
289
290
293 {
295 DPRINT1(
"Could not create the List Event! (Error %lu)\n", dwError);
296 return dwError;
297 }
298
301 {
303 DPRINT1(
"Could not create the List Mutex! (Error %lu)\n", dwError);
304 return dwError;
305 }
307
308
310 L"System\\CurrentControlSet\\Services\\PlugPlay\\Parameters",
314 DPRINT(
"UMPNPMGR: newdev.dll's wizard UI won't be shown!\n");
315
317 L"System\\CurrentControlSet\\Enum",
318 0,
322 {
323 DPRINT1(
"Could not open the Enum Key! (Error %lu)\n", dwError);
324 return dwError;
325 }
326
328 L"System\\CurrentControlSet\\Control\\Class",
329 0,
333 {
334 DPRINT1(
"Could not open the Class Key! (Error %lu)\n", dwError);
335 return dwError;
336 }
337
338 DPRINT(
"UMPNPMGR: InitializePnPManager() done\n");
339
340 return 0;
341}
static BOOL SetupIsActive(VOID)
HANDLE hDeviceInstallListNotEmpty
HANDLE hDeviceInstallListMutex
HANDLE hNoPendingInstalls
LIST_ENTRY DeviceInstallListHead
#define InitializeListHead(ListHead)
#define SE_ASSIGNPRIMARYTOKEN_PRIVILEGE
NTSYSAPI NTSTATUS NTAPI RtlAdjustPrivilege(_In_ ULONG Privilege, _In_ BOOLEAN NewValue, _In_ BOOLEAN ForThread, _Out_ PBOOLEAN OldValue)
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)
DWORD WINAPI GetLastError(void)
Referenced by DllMain().
◆ ServiceControlHandler()
Definition at line 80 of file umpnpmgr.c.
84{
85 DPRINT1(
"ServiceControlHandler() called\n");
86
87 switch (dwControl)
88 {
90 DPRINT1(
" SERVICE_CONTROL_STOP received\n");
92
96
98 DPRINT1(
" SERVICE_CONTROL_PAUSE received\n");
101
103 DPRINT1(
" SERVICE_CONTROL_CONTINUE received\n");
106
108 DPRINT1(
" SERVICE_CONTROL_INTERROGATE received\n");
112
114 DPRINT1(
" SERVICE_CONTROL_SHUTDOWN received\n");
116
120
121 default :
122 DPRINT1(
" Control %lu received\n", dwControl);
124 }
125}
#define ERROR_CALL_NOT_IMPLEMENTED
RPC_STATUS WINAPI RpcMgmtStopServerListening(RPC_BINDING_HANDLE Binding)
BOOL WINAPI SetServiceStatus(SERVICE_STATUS_HANDLE hServiceStatus, LPSERVICE_STATUS lpServiceStatus)
static VOID UpdateServiceStatus(_In_ DWORD dwState, _In_ DWORD dwCheckPoint)
static SERVICE_STATUS_HANDLE ServiceStatusHandle
static SERVICE_STATUS ServiceStatus
#define SERVICE_STOP_PENDING
#define SERVICE_CONTROL_SHUTDOWN
#define SERVICE_CONTROL_CONTINUE
#define SERVICE_CONTROL_STOP
#define SERVICE_CONTROL_PAUSE
#define SERVICE_CONTROL_INTERROGATE
Referenced by ServiceMain().
◆ ServiceMain()
Definition at line 200 of file umpnpmgr.c.
201{
204
207
208 DPRINT(
"ServiceMain() called\n");
209
214 {
216 return;
217 }
218
220
222 0,
225 0,
229
231
233 0,
236 0,
240
242
244 0,
247 0,
251
253
254 DPRINT(
"ServiceMain() done\n");
255}
DWORD WINAPI PnpEventThread(_In_ LPVOID lpParameter)
DWORD WINAPI DeviceInstallThread(LPVOID lpParameter)
DWORD WINAPI RpcServerThread(LPVOID lpParameter)
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)
#define UNREFERENCED_PARAMETER(P)
SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandlerExW(LPCWSTR lpServiceName, LPHANDLER_FUNCTION_EX lpHandlerProc, LPVOID lpContext)
static WCHAR ServiceName[]
static DWORD WINAPI ServiceControlHandler(DWORD dwControl, DWORD dwEventType, LPVOID lpEventData, LPVOID lpContext)
#define SERVICE_START_PENDING
◆ UpdateServiceStatus()
Definition at line 51 of file umpnpmgr.c.
54{
60
63 else
65
71 else
73
76}
DWORD dwServiceSpecificExitCode
#define SERVICE_ACCEPT_SHUTDOWN
#define SERVICE_PAUSE_PENDING
#define SERVICE_CONTINUE_PENDING
#define SERVICE_WIN32_OWN_PROCESS
Referenced by ServiceControlHandler(), and ServiceMain().
◆ g_IsUISuppressed
◆ hClassKey
Definition at line 45 of file umpnpmgr.c.
Referenced by EditTypeDlg_ReadClass(), EditTypeDlg_WriteClass(), InitializePnPManager(), PNP_DeleteClassKey(), PNP_EnumerateSubKeys(), PNP_GetClassInstance(), PNP_GetClassRegProp(), PNP_SetClassRegProp(), PrintAdapterDescription(), SETUP_CreateClassKey(), SETUP_GetIconIndex(), SETUPDI_CreateDrvKey(), SetupDiBuildClassInfoListExW(), and SetupDiClassGuidsFromNameExW().
◆ hEnumKey
Definition at line 44 of file umpnpmgr.c.
Referenced by CreateDeviceInstance(), GenerateDeviceID(), GetAllInstanceList(), GetAllInstanceListSize(), GetBootResourceList(), GetDeviceInstanceList(), GetDeviceInstanceListSize(), GetEnumeratorInstanceList(), GetEnumeratorInstanceListSize(), GetEnumOptions(), GetServiceInstanceList(), GetServiceInstanceListSize(), InitializePnPManager(), InstallDevice(), PNP_AddID(), PNP_CreateDevInst(), PNP_CreateKey(), PNP_EnumerateSubKeys(), PNP_GetCustomDevProp(), PNP_GetDeviceRegProp(), PNP_SetDeviceRegProp(), PNP_ValidateDeviceInstance(), SETUP_CreateInterfaceList(), and SetupDeviceInstance().
◆ ServiceName
WCHAR ServiceName[] = L"PlugPlay" |
|
static |
◆ ServiceStatus
◆ ServiceStatusHandle