mirror of
https://github.com/reactos/reactos.git
synced 2025-05-08 11:24:14 +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
|
static
|
||||||
CreateDeviceInstance(LPWSTR pszDeviceID)
|
CONFIGRET
|
||||||
|
CreateDeviceInstance(
|
||||||
|
_In_ LPWSTR pszDeviceID,
|
||||||
|
_In_ BOOL bPhantomDevice)
|
||||||
{
|
{
|
||||||
WCHAR szEnumerator[MAX_DEVICE_ID_LEN];
|
WCHAR szEnumerator[MAX_DEVICE_ID_LEN];
|
||||||
WCHAR szDevice[MAX_DEVICE_ID_LEN];
|
WCHAR szDevice[MAX_DEVICE_ID_LEN];
|
||||||
|
@ -2962,6 +2965,17 @@ CreateDeviceInstance(LPWSTR pszDeviceID)
|
||||||
return CR_REGISTRY_ERROR;
|
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 */
|
/* Create the 'Control' sub key */
|
||||||
lError = RegCreateKeyExW(hKeyInstance,
|
lError = RegCreateKeyExW(hKeyInstance,
|
||||||
L"Control",
|
L"Control",
|
||||||
|
@ -3061,8 +3075,16 @@ PNP_CreateDevInst(
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create the device instance */
|
if (ulFlags & CM_CREATE_DEVNODE_PHANTOM)
|
||||||
ret = CreateDeviceInstance(pszDeviceID);
|
{
|
||||||
|
/* 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);
|
DPRINT("PNP_CreateDevInst() done (returns %lx)\n", ret);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue