Skip to content

Commit

Permalink
[UMPNPMGR] Partially implement ReenumerateDeviceInstance which is nee…
Browse files Browse the repository at this point in the history
…ded by the Lenovo T400 network driver installer
  • Loading branch information
EricKohl committed Aug 12, 2018
1 parent a91df23 commit 9d26058
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 5 deletions.
36 changes: 31 additions & 5 deletions base/services/umpnpmgr/umpnpmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}


Expand Down Expand Up @@ -2004,7 +2029,8 @@ PNP_DeviceInstanceAction(
break;

case PNP_DEVINST_REENUMERATE:
ret = ReenumerateDeviceInstance(pszDeviceInstance1);
ret = ReenumerateDeviceInstance(pszDeviceInstance1,
ulFlags);
break;

default:
Expand Down
7 changes: 7 additions & 0 deletions sdk/include/ndk/cmtypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit 9d26058

Please sign in to comment.