ReactOS  0.4.14-dev-384-g5b37caa
precomp.h File Reference
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <winreg.h>
#include <winsvc.h>
#include <winuser.h>
#include <dbt.h>
#include <stdio.h>
#include <cmfuncs.h>
#include <rtlfuncs.h>
#include <setypes.h>
#include <umpnpmgr/sysguid.h>
#include <cfgmgr32.h>
#include <regstr.h>
#include <userenv.h>
#include <shlwapi.h>
#include <pnp_s.h>
Include dependency graph for precomp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  DeviceInstallParams
 

Macros

#define WIN32_NO_STATUS
 
#define _INC_WINDOWS
 
#define COM_NO_WINDOWS_H
 

Functions

BOOL SetupIsActive (VOID)
 
FORCEINLINE BOOL IsUISuppressionAllowed (VOID)
 
DWORD WINAPI DeviceInstallThread (LPVOID lpParameter)
 
DWORD WINAPI RpcServerThread (LPVOID lpParameter)
 
BOOL GetSuppressNewUIValue (VOID)
 

Variables

HANDLE hUserToken
 
HANDLE hInstallEvent
 
HANDLE hNoPendingInstalls
 
SLIST_HEADER DeviceInstallListHead
 
HANDLE hDeviceInstallListNotEmpty
 
HKEY hEnumKey
 
HKEY hClassKey
 
BOOL g_IsUISuppressed
 

Macro Definition Documentation

◆ _INC_WINDOWS

#define _INC_WINDOWS

Definition at line 15 of file precomp.h.

◆ COM_NO_WINDOWS_H

#define COM_NO_WINDOWS_H

Definition at line 16 of file precomp.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 14 of file precomp.h.

Function Documentation

◆ DeviceInstallThread()

DWORD WINAPI DeviceInstallThread ( LPVOID  lpParameter)

Definition at line 355 of file install.c.

356 {
357  PSLIST_ENTRY ListEntry;
358  DeviceInstallParams* Params;
359  BOOL showWizard;
360 
362 
364 
365  showWizard = !SetupIsActive() && !IsConsoleBoot();
366 
367  while (TRUE)
368  {
370 
371  if (ListEntry == NULL)
372  {
375  }
376  else
377  {
379  Params = CONTAINING_RECORD(ListEntry, DeviceInstallParams, ListEntry);
380  InstallDevice(Params->DeviceIds, showWizard && !IsUISuppressionAllowed());
381  HeapFree(GetProcessHeap(), 0, Params);
382  }
383  }
384 
385  return 0;
386 }
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
HANDLE hInstallEvent
Definition: install.c:40
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
static BOOL InstallDevice(PCWSTR DeviceInstance, BOOL ShowWizard)
Definition: install.c:50
SLIST_HEADER DeviceInstallListHead
Definition: install.c:43
FORCEINLINE BOOL IsUISuppressionAllowed(VOID)
Definition: install.c:345
PSLIST_ENTRY WINAPI InterlockedPopEntrySList(PSLIST_HEADER ListHead)
Definition: interlocked.c:55
static BOOL IsConsoleBoot(VOID)
Definition: install.c:300
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
WCHAR DeviceIds[1]
Definition: precomp.h:39
HANDLE hNoPendingInstalls
Definition: install.c:41
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define GetProcessHeap()
Definition: compat.h:403
BOOL SetupIsActive(VOID)
Definition: install.c:269
#define PSLIST_ENTRY
Definition: rtltypes.h:130
LPVOID lpParameter
Definition: kernel32.h:241
HANDLE hDeviceInstallListNotEmpty
Definition: install.c:44
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
Definition: synch.c:714
#define INFINITE
Definition: serial.h:102
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by ServiceMain().

◆ GetSuppressNewUIValue()

BOOL GetSuppressNewUIValue ( VOID  )

Definition at line 325 of file umpnpmgr.c.

326 {
327  BOOL bSuppressNewHWUI = FALSE;
328 
329  /*
330  * Query the SuppressNewHWUI policy registry value. Don't cache it
331  * as we want to update our behaviour in consequence.
332  */
334  L"Software\\Policies\\Microsoft\\Windows\\DeviceInstall\\Settings",
335  L"SuppressNewHWUI",
336  &bSuppressNewHWUI);
337  if (bSuppressNewHWUI)
338  DPRINT("GetSuppressNewUIValue(): newdev.dll's wizard UI won't be shown!\n");
339 
340  return bSuppressNewHWUI;
341 }
unsigned int BOOL
Definition: ntddk_ex.h:94
void DPRINT(...)
Definition: polytest.cpp:61
static const WCHAR L[]
Definition: oid.c:1250
static DWORD GetBooleanRegValue(IN HKEY hKey, IN PCWSTR lpSubKey, IN PCWSTR lpValue, OUT PBOOL pValue)
Definition: umpnpmgr.c:272
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by IsUISuppressionAllowed().

◆ IsUISuppressionAllowed()

FORCEINLINE BOOL IsUISuppressionAllowed ( VOID  )

Definition at line 345 of file install.c.

346 {
347  /* Display the newdev.dll wizard UI only if it's allowed */
349 }
BOOL g_IsUISuppressed
Definition: umpnpmgr.c:46
BOOL GetSuppressNewUIValue(VOID)
Definition: umpnpmgr.c:325

Referenced by DeviceInstallThread().

◆ RpcServerThread()

DWORD WINAPI RpcServerThread ( LPVOID  lpParameter)

Definition at line 45 of file rpcserver.c.

46 {
48  BOOLEAN RegisteredProtSeq = FALSE;
49 
51 
52  DPRINT("RpcServerThread() called\n");
53 
54 #if 0
55  /* 2k/XP/2k3-compatible protocol sequence/endpoint */
56  Status = RpcServerUseProtseqEpW(L"ncacn_np",
57  20,
58  L"\\pipe\\ntsvcs",
59  NULL); // Security descriptor
60  if (Status == RPC_S_OK)
61  RegisteredProtSeq = TRUE;
62  else
63  DPRINT1("RpcServerUseProtseqEpW() failed (Status %lx)\n", Status);
64 #endif
65 
66  /* Vista/7-compatible protocol sequence/endpoint */
67  Status = RpcServerUseProtseqEpW(L"ncacn_np",
68  20,
69  L"\\pipe\\plugplay",
70  NULL); // Security descriptor
71  if (Status == RPC_S_OK)
72  RegisteredProtSeq = TRUE;
73  else
74  DPRINT1("RpcServerUseProtseqEpW() failed (Status %lx)\n", Status);
75 
76  /* Make sure there's a usable endpoint */
77  if (RegisteredProtSeq == FALSE)
78  return 0;
79 
80  Status = RpcServerRegisterIf(pnp_v1_0_s_ifspec,
81  NULL,
82  NULL);
83  if (Status != RPC_S_OK)
84  {
85  DPRINT1("RpcServerRegisterIf() failed (Status %lx)\n", Status);
86  return 0;
87  }
88 
90  20,
91  FALSE);
92  if (Status != RPC_S_OK)
93  {
94  DPRINT1("RpcServerListen() failed (Status %lx)\n", Status);
95  return 0;
96  }
97 
98  /* ROS HACK (this should never happen...) */
99  DPRINT1("*** Other devices won't be installed correctly. If something\n");
100  DPRINT1("*** doesn't work, try to reboot to get a new chance.\n");
101 
102  DPRINT("RpcServerThread() done\n");
103 
104  return 0;
105 }
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
long RPC_STATUS
Definition: rpc.h:52
RPC_STATUS WINAPI RpcServerListen(UINT MinimumCallThreads, UINT MaxCalls, UINT DontWait)
Definition: rpc_server.c:1527
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
RPC_STATUS WINAPI RpcServerRegisterIf(RPC_IF_HANDLE IfSpec, UUID *MgrTypeUuid, RPC_MGR_EPV *MgrEpv)
Definition: rpc_server.c:1123
static const WCHAR L[]
Definition: oid.c:1250
LPVOID lpParameter
Definition: kernel32.h:241
Status
Definition: gdiplustypes.h:24
RPC_STATUS WINAPI RpcServerUseProtseqEpW(RPC_WSTR Protseq, UINT MaxCalls, RPC_WSTR Endpoint, LPVOID SecurityDescriptor)
Definition: rpc_server.c:934
#define DPRINT1
Definition: precomp.h:8
#define RPC_S_OK
Definition: rpcnterr.h:22

Referenced by ServiceMain().

◆ SetupIsActive()

BOOL SetupIsActive ( VOID  )

Definition at line 269 of file install.c.

270 {
271  HKEY hKey = NULL;
272  DWORD regType, active, size;
273  LONG rc;
274  BOOL ret = FALSE;
275 
276  rc = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SYSTEM\\Setup", 0, KEY_QUERY_VALUE, &hKey);
277  if (rc != ERROR_SUCCESS)
278  goto cleanup;
279 
280  size = sizeof(DWORD);
281  rc = RegQueryValueExW(hKey, L"SystemSetupInProgress", NULL, &regType, (LPBYTE)&active, &size);
282  if (rc != ERROR_SUCCESS)
283  goto cleanup;
284  if (regType != REG_DWORD || size != sizeof(DWORD))
285  goto cleanup;
286 
287  ret = (active != 0);
288 
289 cleanup:
290  if (hKey != NULL)
291  RegCloseKey(hKey);
292 
293  DPRINT("System setup in progress? %S\n", ret ? L"YES" : L"NO");
294 
295  return ret;
296 }
static HANDLE DWORD
Definition: install.c:28
DWORD size
Definition: install.c:3631
#define ERROR_SUCCESS
Definition: deptool.c:10
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
GLsizeiptr size
Definition: glext.h:5919
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
static const WCHAR L[]
Definition: oid.c:1250
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
char * cleanup(char *str)
Definition: wpickclick.c:99
#define REG_DWORD
Definition: sdbapi.c:596
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by DeviceInstallThread().

Variable Documentation

◆ DeviceInstallListHead

SLIST_HEADER DeviceInstallListHead

Definition at line 43 of file install.c.

Referenced by DeviceInstallThread(), InitializePnPManager(), and PnpEventThread().

◆ g_IsUISuppressed

BOOL g_IsUISuppressed

Definition at line 46 of file umpnpmgr.c.

Referenced by InitializePnPManager(), and IsUISuppressionAllowed().

◆ hClassKey

◆ hDeviceInstallListNotEmpty

HANDLE hDeviceInstallListNotEmpty

Definition at line 44 of file install.c.

Referenced by DeviceInstallThread(), InitializePnPManager(), and PnpEventThread().

◆ hEnumKey

◆ hInstallEvent

◆ hNoPendingInstalls

HANDLE hNoPendingInstalls

Definition at line 41 of file install.c.

Referenced by DeviceInstallThread(), and InitializePnPManager().

◆ hUserToken