mirror of
https://github.com/reactos/reactos.git
synced 2026-06-01 17:00:51 +08:00
[UMPNPMGR] PNP_CreateDevInst: Support the creation of phantom devices
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user