mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[UMPNPMGR] Implement PNP_RegisterDriver()
This commit is contained in:
parent
696cdc635b
commit
f9160f7637
1 changed files with 42 additions and 2 deletions
|
@ -226,6 +226,36 @@ GetDeviceStatus(
|
|||
}
|
||||
|
||||
|
||||
static
|
||||
CONFIGRET
|
||||
SetDeviceStatus(
|
||||
_In_ LPWSTR pDeviceID,
|
||||
_In_ DWORD ulStatus,
|
||||
_In_ DWORD ulProblem)
|
||||
{
|
||||
PLUGPLAY_CONTROL_STATUS_DATA PlugPlayData;
|
||||
CONFIGRET ret = CR_SUCCESS;
|
||||
NTSTATUS Status;
|
||||
|
||||
DPRINT1("SetDeviceStatus(%S 0x%lx 0x%lx)\n",
|
||||
pDeviceID, ulStatus, ulProblem);
|
||||
|
||||
RtlInitUnicodeString(&PlugPlayData.DeviceInstance,
|
||||
pDeviceID);
|
||||
PlugPlayData.Operation = 1; /* Set status */
|
||||
PlugPlayData.DeviceStatus = ulStatus;
|
||||
PlugPlayData.DeviceProblem = ulProblem;
|
||||
|
||||
Status = NtPlugPlayControl(PlugPlayControlDeviceStatus,
|
||||
(PVOID)&PlugPlayData,
|
||||
sizeof(PLUGPLAY_CONTROL_STATUS_DATA));
|
||||
if (!NT_SUCCESS(Status))
|
||||
ret = NtStatusToCrError(Status);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static
|
||||
BOOL
|
||||
IsValidDeviceInstanceID(
|
||||
|
@ -3052,8 +3082,18 @@ PNP_RegisterDriver(
|
|||
LPWSTR pszDeviceID,
|
||||
DWORD ulFlags)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return CR_CALL_NOT_IMPLEMENTED;
|
||||
DPRINT("PNP_RegisterDriver(%p %S 0x%lx)\n",
|
||||
hBinding, pszDeviceID, ulFlags);
|
||||
|
||||
if (ulFlags & ~CM_REGISTER_DEVICE_DRIVER_BITS)
|
||||
return CR_INVALID_FLAG;
|
||||
|
||||
if (!IsValidDeviceInstanceID(pszDeviceID))
|
||||
return CR_INVALID_DEVINST;
|
||||
|
||||
SetDeviceStatus(pszDeviceID, 0, 0);
|
||||
|
||||
return CR_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue