mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 01:15:09 +00:00
[umpnpmgr]
PNP_DeviceInstanceAction: Call a separate function for each action. svn path=/trunk/; revision=44959
This commit is contained in:
parent
b473a12aff
commit
9fb7195e8e
1 changed files with 73 additions and 21 deletions
|
@ -1085,50 +1085,102 @@ DWORD PNP_CreateDevInst(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static CONFIGRET
|
||||||
|
MoveDeviceInstance(LPWSTR pszDeviceInstanceDestination,
|
||||||
|
LPWSTR pszDeviceInstanceSource)
|
||||||
|
{
|
||||||
|
DPRINT("MoveDeviceInstance: not implemented\n");
|
||||||
|
/* FIXME */
|
||||||
|
return CR_CALL_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static CONFIGRET
|
||||||
|
SetupDeviceInstance(LPWSTR pszDeviceInstance,
|
||||||
|
DWORD ulFlags)
|
||||||
|
{
|
||||||
|
DPRINT("SetupDeviceInstance: not implemented\n");
|
||||||
|
/* FIXME */
|
||||||
|
return CR_CALL_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static CONFIGRET
|
||||||
|
EnableDeviceInstance(LPWSTR pszDeviceInstance)
|
||||||
|
{
|
||||||
|
PLUGPLAY_CONTROL_RESET_DEVICE_DATA ResetDeviceData;
|
||||||
|
CONFIGRET ret = CR_SUCCESS;
|
||||||
|
NTSTATUS Status;
|
||||||
|
|
||||||
|
DPRINT("Enable device instance\n");
|
||||||
|
|
||||||
|
RtlInitUnicodeString(&ResetDeviceData.DeviceInstance, pszDeviceInstance);
|
||||||
|
Status = NtPlugPlayControl(PlugPlayControlResetDevice, &ResetDeviceData, sizeof(PLUGPLAY_CONTROL_RESET_DEVICE_DATA));
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
ret = NtStatusToCrError(Status);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static CONFIGRET
|
||||||
|
DisableDeviceInstance(LPWSTR pszDeviceInstance)
|
||||||
|
{
|
||||||
|
DPRINT("DisableDeviceInstance: not implemented\n");
|
||||||
|
/* FIXME */
|
||||||
|
return CR_CALL_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static CONFIGRET
|
||||||
|
ReenumerateDeviceInstance(LPWSTR pszDeviceInstance)
|
||||||
|
{
|
||||||
|
DPRINT("ReenumerateDeviceInstance: not implemented\n");
|
||||||
|
/* FIXME */
|
||||||
|
return CR_CALL_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Function 29 */
|
/* Function 29 */
|
||||||
DWORD PNP_DeviceInstanceAction(
|
DWORD PNP_DeviceInstanceAction(
|
||||||
handle_t hBinding,
|
handle_t hBinding,
|
||||||
DWORD ulMajorAction,
|
DWORD ulAction,
|
||||||
DWORD ulMinorAction,
|
DWORD ulFlags,
|
||||||
LPWSTR pszDeviceInstance1,
|
LPWSTR pszDeviceInstance1,
|
||||||
LPWSTR pszDeviceInstance2)
|
LPWSTR pszDeviceInstance2)
|
||||||
{
|
{
|
||||||
CONFIGRET ret = CR_SUCCESS;
|
CONFIGRET ret = CR_SUCCESS;
|
||||||
NTSTATUS Status;
|
|
||||||
|
|
||||||
UNREFERENCED_PARAMETER(hBinding);
|
UNREFERENCED_PARAMETER(hBinding);
|
||||||
UNREFERENCED_PARAMETER(ulMinorAction);
|
|
||||||
UNREFERENCED_PARAMETER(pszDeviceInstance2);
|
|
||||||
|
|
||||||
DPRINT("PNP_DeviceInstanceAction() called\n");
|
DPRINT("PNP_DeviceInstanceAction() called\n");
|
||||||
|
|
||||||
switch (ulMajorAction)
|
switch (ulAction)
|
||||||
{
|
{
|
||||||
|
case PNP_DEVINST_MOVE:
|
||||||
|
ret = MoveDeviceInstance(pszDeviceInstance1,
|
||||||
|
pszDeviceInstance2);
|
||||||
|
break;
|
||||||
|
|
||||||
case PNP_DEVINST_SETUP:
|
case PNP_DEVINST_SETUP:
|
||||||
DPRINT("Setup device instance\n");
|
ret = SetupDeviceInstance(pszDeviceInstance1,
|
||||||
/* FIXME */
|
ulFlags);
|
||||||
ret = CR_CALL_NOT_IMPLEMENTED;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PNP_DEVINST_ENABLE:
|
case PNP_DEVINST_ENABLE:
|
||||||
{
|
ret = EnableDeviceInstance(pszDeviceInstance1);
|
||||||
PLUGPLAY_CONTROL_RESET_DEVICE_DATA ResetDeviceData;
|
break;
|
||||||
DPRINT("Enable device instance\n");
|
|
||||||
RtlInitUnicodeString(&ResetDeviceData.DeviceInstance, pszDeviceInstance1);
|
case PNP_DEVINST_DISABLE:
|
||||||
Status = NtPlugPlayControl(PlugPlayControlResetDevice, &ResetDeviceData, sizeof(PLUGPLAY_CONTROL_RESET_DEVICE_DATA));
|
ret = DisableDeviceInstance(pszDeviceInstance1);
|
||||||
if (!NT_SUCCESS(Status))
|
|
||||||
ret = NtStatusToCrError(Status);
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
case PNP_DEVINST_REENUMERATE:
|
case PNP_DEVINST_REENUMERATE:
|
||||||
DPRINT("Reenumerate device instance\n");
|
ret = ReenumerateDeviceInstance(pszDeviceInstance1);
|
||||||
/* FIXME */
|
|
||||||
ret = CR_CALL_NOT_IMPLEMENTED;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
DPRINT1("Unknown function %lu\n", ulMajorAction);
|
DPRINT1("Unknown device action %lu: not implemented\n", ulAction);
|
||||||
ret = CR_CALL_NOT_IMPLEMENTED;
|
ret = CR_CALL_NOT_IMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue