VirtualBox

Changeset 38932 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Oct 3, 2011 11:22:39 AM (13 years ago)
Author:
vboxsync
Message:

VBoxMouse/win: simplify power handling, code formatting

Location:
trunk/src/VBox/Additions/WINNT/Mouse/NT5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Mouse/NT5/VBoxMF.h

    r38931 r38932  
    5858
    5959    IO_REMOVE_LOCK RemoveLock;
    60    
    61     DEVICE_POWER_STATE DeviceState;   /* current power state of the device */
    6260} VBOXMOUSE_DEVEXT, *PVBOXMOUSE_DEVEXT;
    6361
  • trunk/src/VBox/Additions/WINNT/Mouse/NT5/VBoxMFDriver.cpp

    r38931 r38932  
    122122    pDevExt->pdoSelf   = pDO;
    123123    pDevExt->pdoParent = pDOParent;
    124         pDevExt->DeviceState = PowerDeviceD0;
    125124
    126125    VBoxDeviceAdded(pDevExt);
     
    251250NTSTATUS VBoxIrpPower(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
    252251{
    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 
     252        PVBOXMOUSE_DEVEXT pDevExt;
     253    PAGED_CODE();
     254    LOGF_ENTER();
     255    pDevExt = (PVBOXMOUSE_DEVEXT) DeviceObject->DeviceExtension;
    279256    PoStartNextPowerIrp(Irp);
    280257    IoSkipCurrentIrpStackLocation(Irp);
    281     return PoCallDriver(devExt->pdoParent, Irp);
    282 }
     258    LOGF_LEAVE();
     259    return PoCallDriver(pDevExt->pdoParent, Irp);
     260}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette