- Timestamp:
- Oct 3, 2011 10:59:12 AM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 74282
- Location:
- trunk/src/VBox/Additions/WINNT/Mouse/NT5
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Mouse/NT5/VBoxMF.h
r37423 r38931 58 58 59 59 IO_REMOVE_LOCK RemoveLock; 60 61 DEVICE_POWER_STATE DeviceState; /* current power state of the device */ 60 62 } VBOXMOUSE_DEVEXT, *PVBOXMOUSE_DEVEXT; 61 63 … … 72 74 NTSTATUS VBoxIrpInternalIOCTL(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp); 73 75 NTSTATUS VBoxIrpPnP(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp); 76 NTSTATUS VBoxIrpPower(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp); 74 77 75 78 /* Internal functions */ -
trunk/src/VBox/Additions/WINNT/Mouse/NT5/VBoxMFDriver.cpp
r37423 r38931 50 50 DriverObject->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] = VBoxIrpInternalIOCTL; 51 51 DriverObject->MajorFunction[IRP_MJ_PNP] = VBoxIrpPnP; 52 DriverObject->MajorFunction[IRP_MJ_POWER] = VBoxIrpPower; 52 53 53 54 NTSTATUS tmpStatus = VBoxNewProtInit(); … … 121 122 pDevExt->pdoSelf = pDO; 122 123 pDevExt->pdoParent = pDOParent; 124 pDevExt->DeviceState = PowerDeviceD0; 123 125 124 126 VBoxDeviceAdded(pDevExt); … … 238 240 } 239 241 240 if (!NT_SUCCESS(rc) )242 if (!NT_SUCCESS(rc) && rc != STATUS_NOT_SUPPORTED) 241 243 { 242 244 WARN(("rc=%#x", rc)); … … 246 248 return rc; 247 249 } 250 251 NTSTATUS VBoxIrpPower(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) 252 { 253 PIO_STACK_LOCATION irpSp; 254 PVBOXMOUSE_DEVEXT devExt; 255 POWER_STATE powerState; 256 POWER_STATE_TYPE powerType; 257 258 PAGED_CODE(); 259 260 devExt = (PVBOXMOUSE_DEVEXT) DeviceObject->DeviceExtension; 261 irpSp = IoGetCurrentIrpStackLocation(Irp); 262 263 powerType = irpSp->Parameters.Power.Type; 264 powerState = irpSp->Parameters.Power.State; 265 266 switch (irpSp->MinorFunction) { 267 case IRP_MN_SET_POWER: 268 if (powerType == DevicePowerState) { 269 devExt->DeviceState = powerState.DeviceState; 270 } 271 272 case IRP_MN_QUERY_POWER: 273 case IRP_MN_WAIT_WAKE: 274 case IRP_MN_POWER_SEQUENCE: 275 default: 276 break; 277 } 278 279 PoStartNextPowerIrp(Irp); 280 IoSkipCurrentIrpStackLocation(Irp); 281 return PoCallDriver(devExt->pdoParent, Irp); 282 }
Note:
See TracChangeset
for help on using the changeset viewer.