mirror of
https://github.com/reactos/reactos.git
synced 2025-05-06 18:31:26 +00:00
[UMPNPMGR] PNP_CreateDevInst: Support the creation of phantom devices
This commit is contained in:
parent
aa80cfb46e
commit
8897a890c9
1 changed files with 26 additions and 4 deletions
|
@ -2877,8 +2877,11 @@ done:
|
|||
}
|
||||
|
||||
|
||||
static CONFIGRET
|
||||
CreateDeviceInstance(LPWSTR pszDeviceID)
|
||||
static
|
||||
CONFIGRET
|
||||
CreateDeviceInstance(
|
||||
_In_ LPWSTR pszDeviceID,
|
||||
_In_ BOOL bPhantomDevice)
|
||||
{
|
||||
WCHAR szEnumerator[MAX_DEVICE_ID_LEN];
|
||||
WCHAR szDevice[MAX_DEVICE_ID_LEN];
|
||||
|
@ -2962,6 +2965,17 @@ CreateDeviceInstance(LPWSTR pszDeviceID)
|
|||
return CR_REGISTRY_ERROR;
|
||||
}
|
||||
|
||||
if (bPhantomDevice)
|
||||
{
|
||||
DWORD dwPhantomValue = 1;
|
||||
RegSetValueExW(hKeyInstance,
|
||||
L"Phantom",
|
||||
0,
|
||||
REG_DWORD,
|
||||
(PBYTE)&dwPhantomValue,
|
||||
sizeof(dwPhantomValue));
|
||||
}
|
||||
|
||||
/* Create the 'Control' sub key */
|
||||
lError = RegCreateKeyExW(hKeyInstance,
|
||||
L"Control",
|
||||
|
@ -3061,8 +3075,16 @@ PNP_CreateDevInst(
|
|||
return ret;
|
||||
}
|
||||
|
||||
/* Create the device instance */
|
||||
ret = CreateDeviceInstance(pszDeviceID);
|
||||
if (ulFlags & CM_CREATE_DEVNODE_PHANTOM)
|
||||
{
|
||||
/* Create the phantom device instance */
|
||||
ret = CreateDeviceInstance(pszDeviceID, TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Create the device instance */
|
||||
ret = CreateDeviceInstance(pszDeviceID, FALSE);
|
||||
}
|
||||
|
||||
DPRINT("PNP_CreateDevInst() done (returns %lx)\n", ret);
|
||||
|
||||
|
|
Loading…
Reference in a new issue