[UMPNPMGR] Partially implement ReenumerateDeviceInstance which is needed by the Lenovo T400 network driver installer

This commit is contained in:
Eric Kohl 2018-08-12 22:19:05 +02:00
parent a91df23308
commit 9d26058a8e
2 changed files with 38 additions and 5 deletions

View file

@ -1959,11 +1959,36 @@ DisableDeviceInstance(LPWSTR pszDeviceInstance)
static CONFIGRET
ReenumerateDeviceInstance(LPWSTR pszDeviceInstance)
ReenumerateDeviceInstance(
_In_ LPWSTR pszDeviceInstance,
_In_ ULONG ulFlags)
{
DPRINT("ReenumerateDeviceInstance: not implemented\n");
/* FIXME */
return CR_CALL_NOT_IMPLEMENTED;
PLUGPLAY_CONTROL_ENUMERATE_DEVICE_DATA EnumerateDeviceData;
CONFIGRET ret = CR_SUCCESS;
NTSTATUS Status;
DPRINT1("ReenumerateDeviceInstance(%S 0x%08lx)\n",
pszDeviceInstance, ulFlags);
if (ulFlags & ~CM_REENUMERATE_BITS)
return CR_INVALID_FLAG;
if (ulFlags & CM_REENUMERATE_RETRY_INSTALLATION)
{
DPRINT1("CM_REENUMERATE_RETRY_INSTALLATION not implemented!\n");
}
RtlInitUnicodeString(&EnumerateDeviceData.DeviceInstance,
pszDeviceInstance);
EnumerateDeviceData.Flags = 0;
Status = NtPlugPlayControl(PlugPlayControlEnumerateDevice,
&EnumerateDeviceData,
sizeof(PLUGPLAY_CONTROL_ENUMERATE_DEVICE_DATA));
if (!NT_SUCCESS(Status))
ret = NtStatusToCrError(Status);
return ret;
}
@ -2004,7 +2029,8 @@ PNP_DeviceInstanceAction(
break;
case PNP_DEVINST_REENUMERATE:
ret = ReenumerateDeviceInstance(pszDeviceInstance1);
ret = ReenumerateDeviceInstance(pszDeviceInstance1,
ulFlags);
break;
default:

View file

@ -445,6 +445,13 @@ typedef struct _PLUGPLAY_EVENT_BLOCK
// Plug and Play Control Classes
//
// Class 0x00
typedef struct _PLUGPLAY_CONTROL_ENUMERATE_DEVICE_DATA
{
UNICODE_STRING DeviceInstance;
ULONG Flags;
} PLUGPLAY_CONTROL_ENUMERATE_DEVICE_DATA, *PPLUGPLAY_CONTROL_ENUMERATE_DEVICE_DATA;
//Class 0x09
typedef struct _PLUGPLAY_CONTROL_INTERFACE_DEVICE_LIST_DATA
{