Home | Info | Community | Development | myReactOS | Contact Us
Definition at line 826 of file plugplay.c.
Referenced by EnableDeviceInstance(), EventThread(), PNP_GetDepth(), PNP_GetDeviceRegProp(), PNP_GetDeviceStatus(), PNP_GetRelatedDeviceInstance(), PnpEventThread(), and ResetDevice().
{ DPRINT("NtPlugPlayControl(%lu %p %lu) called\n", PlugPlayControlClass, Buffer, BufferLength); /* Function can only be called from user-mode */ if (KeGetPreviousMode() == KernelMode) { DPRINT1("NtGetPlugPlayEvent cannot be called from kernel mode!\n"); return STATUS_ACCESS_DENIED; } /* Check for Tcb privilege */ if (!SeSinglePrivilegeCheck(SeTcbPrivilege, UserMode)) { DPRINT1("NtGetPlugPlayEvent: Caller does not hold the SeTcbPrivilege privilege!\n"); return STATUS_PRIVILEGE_NOT_HELD; } /* Probe the buffer */ _SEH2_TRY { ProbeForWrite(Buffer, BufferLength, sizeof(ULONG)); } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { _SEH2_YIELD(return _SEH2_GetExceptionCode()); } _SEH2_END; switch (PlugPlayControlClass) { case PlugPlayControlUserResponse: if (Buffer || BufferLength != 0) return STATUS_INVALID_PARAMETER; return IopRemovePlugPlayEvent(); case PlugPlayControlProperty: if (!Buffer || BufferLength < sizeof(PLUGPLAY_CONTROL_PROPERTY_DATA)) return STATUS_INVALID_PARAMETER; return IopGetDeviceProperty((PPLUGPLAY_CONTROL_PROPERTY_DATA)Buffer); case PlugPlayControlGetRelatedDevice: if (!Buffer || BufferLength < sizeof(PLUGPLAY_CONTROL_RELATED_DEVICE_DATA)) return STATUS_INVALID_PARAMETER; return IopGetRelatedDevice((PPLUGPLAY_CONTROL_RELATED_DEVICE_DATA)Buffer); case PlugPlayControlDeviceStatus: if (!Buffer || BufferLength < sizeof(PLUGPLAY_CONTROL_STATUS_DATA)) return STATUS_INVALID_PARAMETER; return IopDeviceStatus((PPLUGPLAY_CONTROL_STATUS_DATA)Buffer); case PlugPlayControlGetDeviceDepth: if (!Buffer || BufferLength < sizeof(PLUGPLAY_CONTROL_DEPTH_DATA)) return STATUS_INVALID_PARAMETER; return IopGetDeviceDepth((PPLUGPLAY_CONTROL_DEPTH_DATA)Buffer); case PlugPlayControlResetDevice: if (!Buffer || BufferLength < sizeof(PLUGPLAY_CONTROL_RESET_DEVICE_DATA)) return STATUS_INVALID_PARAMETER; return IopResetDevice((PPLUGPLAY_CONTROL_RESET_DEVICE_DATA)Buffer); default: return STATUS_NOT_IMPLEMENTED; } return STATUS_NOT_IMPLEMENTED; }