[umpnpmgr][ndk] Implement PNP_RequestDeviceEject() and update unknown type in PLUGPLAY_CONTROL_QUERY_REMOVE_DATA

This commit is contained in:
Eric Kohl 2019-10-15 22:40:06 +02:00
parent fb4591c48c
commit 13bb5e2317
2 changed files with 33 additions and 3 deletions

View file

@ -2972,6 +2972,7 @@ PNP_QueryRemove(
pszDeviceID);
PlugPlayData.VetoName = pszVetoName;
PlugPlayData.NameLength = ulNameLength;
// PlugPlayData.Flags =
Status = NtPlugPlayControl(PlugPlayControlQueryAndRemoveDevice,
&PlugPlayData,
@ -2994,8 +2995,37 @@ PNP_RequestDeviceEject(
DWORD ulNameLength,
DWORD ulFlags)
{
UNIMPLEMENTED;
return CR_CALL_NOT_IMPLEMENTED;
PLUGPLAY_CONTROL_QUERY_REMOVE_DATA PlugPlayData;
NTSTATUS Status;
DWORD ret = CR_SUCCESS;
DPRINT1("PNP_RequestDeviceEject(%p %S %p %p %lu 0x%lx)\n",
hBinding, pszDeviceID, pVetoType, pszVetoName,
ulNameLength, ulFlags);
if (ulFlags != 0)
return CR_INVALID_FLAG;
if (pVetoType != NULL)
*pVetoType = PNP_VetoTypeUnknown;
if (pszVetoName != NULL && ulNameLength > 0)
*pszVetoName = UNICODE_NULL;
RtlZeroMemory(&PlugPlayData, sizeof(PlugPlayData));
RtlInitUnicodeString(&PlugPlayData.DeviceInstance,
pszDeviceID);
PlugPlayData.VetoName = pszVetoName;
PlugPlayData.NameLength = ulNameLength;
// PlugPlayData.Flags =
Status = NtPlugPlayControl(PlugPlayControlQueryAndRemoveDevice,
&PlugPlayData,
sizeof(PlugPlayData));
if (!NT_SUCCESS(Status))
ret = NtStatusToCrError(Status);
return ret;
}

View file

@ -457,7 +457,7 @@ typedef struct _PLUGPLAY_CONTROL_ENUMERATE_DEVICE_DATA
typedef struct _PLUGPLAY_CONTROL_QUERY_REMOVE_DATA
{
UNICODE_STRING DeviceInstance;
ULONG Unknown2;
ULONG Flags;
PNP_VETO_TYPE VetoType;
LPWSTR VetoName;
ULONG NameLength;