Changeset 62714 in vbox for trunk/src/VBox/HostDrivers/VBoxUSB/win/dev
- Timestamp:
- Jul 29, 2016 9:41:09 PM (8 years ago)
- Location:
- trunk/src/VBox/HostDrivers/VBoxUSB/win/dev
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxUSB/win/dev/VBoxUsbPnP.cpp
r62709 r62714 3 3 * USB PnP Handling 4 4 */ 5 5 6 /* 6 7 * Copyright (C) 2011-2016 Oracle Corporation … … 14 15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. 15 16 */ 17 16 18 #include "VBoxUsbCmn.h" 17 19 … … 214 216 { 215 217 PVBOXUSBDEV_EXT pDevExt = (PVBOXUSBDEV_EXT)pDeviceObject->DeviceExtension; 216 ENMVBOXUSB_PNPSTATE enmState = vboxUsbPnPStateGet(pDevExt);217 218 if (!vboxUsbDdiStateRetainIfNotRemoved(pDevExt)) 218 {219 219 return VBoxDrvToolIoComplete(pIrp, STATUS_DELETE_PENDING, 0); 220 }221 220 222 221 PIO_STACK_LOCATION pSl = IoGetCurrentIrpStackLocation(pIrp); 223 224 222 switch (pSl->MinorFunction) 225 223 { 226 224 case IRP_MN_START_DEVICE: 227 {228 225 return vboxUsbPnPMnStartDevice(pDevExt, pIrp); 229 } 226 230 227 case IRP_MN_QUERY_STOP_DEVICE: 231 {232 228 return vboxUsbPnPMnQueryStopDevice(pDevExt, pIrp); 233 } 229 234 230 case IRP_MN_STOP_DEVICE: 235 {236 231 return vboxUsbPnPMnStopDevice(pDevExt, pIrp); 237 } 232 238 233 case IRP_MN_CANCEL_STOP_DEVICE: 239 {240 234 return vboxUsbPnPMnCancelStopDevice(pDevExt, pIrp); 241 } 235 242 236 case IRP_MN_QUERY_REMOVE_DEVICE: 243 {244 237 return vboxUsbPnPMnQueryRemoveDevice(pDevExt, pIrp); 245 } 238 246 239 case IRP_MN_REMOVE_DEVICE: 247 {248 240 return vboxUsbPnPMnRemoveDevice(pDevExt, pIrp); 249 } 241 250 242 case IRP_MN_CANCEL_REMOVE_DEVICE: 251 {252 243 return vboxUsbPnPMnCancelRemoveDevice(pDevExt, pIrp); 253 } 244 254 245 case IRP_MN_SURPRISE_REMOVAL: 255 {256 246 return vboxUsbPnPMnSurpriseRemoval(pDevExt, pIrp); 257 } 247 258 248 case IRP_MN_QUERY_CAPABILITIES: 259 {260 249 return vboxUsbPnPMnQueryCapabilities(pDevExt, pIrp); 261 } 250 262 251 default: 263 {264 252 return vboxUsbPnPMnDefault(pDevExt, pIrp); 265 266 267 } 253 } 254 } 255 -
trunk/src/VBox/HostDrivers/VBoxUSB/win/dev/VBoxUsbPwr.cpp
r62709 r62714 54 54 55 55 static VOID vboxUsbPwrIoDeviceCompletion(IN PDEVICE_OBJECT pDeviceObject, 56 IN UCHAR MinorFunction, 57 IN POWER_STATE PowerState, 58 IN PVOID pvContext, 59 IN PIO_STATUS_BLOCK pIoStatus) 60 { 56 IN UCHAR MinorFunction, 57 IN POWER_STATE PowerState, 58 IN PVOID pvContext, 59 IN PIO_STATUS_BLOCK pIoStatus) 60 { 61 RT_NOREF3(pDeviceObject, MinorFunction, PowerState); 61 62 PVBOXUSB_PWRDEV_CTX pDevCtx = (PVBOXUSB_PWRDEV_CTX)pvContext; 62 63 PVBOXUSBDEV_EXT pDevExt = pDevCtx->pDevExt; … … 108 109 static NTSTATUS vboxUsbPwrIoPostSysCompletion(IN PDEVICE_OBJECT pDevObj, IN PIRP pIrp, IN PVOID pvContext) 109 110 { 111 RT_NOREF1(pDevObj); 110 112 PVBOXUSBDEV_EXT pDevExt = (PVBOXUSBDEV_EXT)pvContext; 111 113 NTSTATUS Status = pIrp->IoStatus.Status; … … 138 140 IoSetCompletionRoutine(pIrp, vboxUsbPwrIoPostSysCompletion, pDevExt, TRUE, TRUE, TRUE); 139 141 NTSTATUS Status = PoCallDriver(pDevExt->pLowerDO, pIrp); 140 Assert(NT_SUCCESS(Status)); 142 Assert(NT_SUCCESS(Status)); NOREF(Status); 141 143 return STATUS_PENDING; 142 144 } … … 144 146 static NTSTATUS vboxUsbPwrQueryPowerSys(IN PVBOXUSBDEV_EXT pDevExt, IN PIRP pIrp) 145 147 { 146 PIO_STACK_LOCATION pSl = IoGetCurrentIrpStackLocation(pIrp);147 SYSTEM_POWER_STATE enmSysPState = pSl->Parameters.Power.State.SystemState; 148 /*PIO_STACK_LOCATION pSl = IoGetCurrentIrpStackLocation(pIrp); 149 SYSTEM_POWER_STATE enmSysPState = pSl->Parameters.Power.State.SystemState;*/ 148 150 149 151 return vboxUsbPwrIoPostSys(pDevExt, pIrp); … … 152 154 static NTSTATUS vboxUsbPwrIoPostDevCompletion(IN PDEVICE_OBJECT pDevObj, IN PIRP pIrp, IN PVOID pvContext) 153 155 { 156 RT_NOREF1(pDevObj); 154 157 PVBOXUSBDEV_EXT pDevExt = (PVBOXUSBDEV_EXT)pvContext; 155 158 156 159 if (pIrp->PendingReturned) 157 {158 160 IoMarkIrpPending(pIrp); 159 }160 161 161 162 NTSTATUS Status = pIrp->IoStatus.Status; … … 167 168 { 168 169 case IRP_MN_SET_POWER: 169 {170 170 pDevExt->DdiState.PwrState.PowerState.DeviceState = pSl->Parameters.Power.State.DeviceState; 171 171 PoSetPowerState(pDevExt->pFDO, DevicePowerState, pSl->Parameters.Power.State); 172 172 break; 173 } 173 174 174 default: 175 {176 175 break; 177 }178 176 } 179 177 } … … 190 188 IoSetCompletionRoutine(pIrp, vboxUsbPwrIoPostDevCompletion, pDevExt, TRUE, TRUE, TRUE); 191 189 NTSTATUS Status = PoCallDriver(pDevExt->pLowerDO, pIrp); 192 Assert(NT_SUCCESS(Status)); 190 Assert(NT_SUCCESS(Status)); RT_NOREF_PV(Status); 193 191 return STATUS_PENDING; 194 192 } … … 271 269 { 272 270 PIO_STACK_LOCATION pSl = IoGetCurrentIrpStackLocation(pIrp); 273 274 271 switch (pSl->Parameters.Power.Type) 275 272 { 276 273 case SystemPowerState: 277 {278 274 return vboxUsbPwrQueryPowerSys(pDevExt, pIrp); 279 } 275 280 276 case DevicePowerState: 281 {282 277 return vboxUsbPwrQueryPowerDev(pDevExt, pIrp); 283 } 278 284 279 default: 285 {286 280 AssertFailed(); 287 281 return vboxUsbPwrMnDefault(pDevExt, pIrp); 288 } 289 290 } 291 return vboxUsbPwrMnDefault(pDevExt, pIrp); 282 283 } 292 284 } 293 285 294 286 static NTSTATUS vboxUsbPwrSetPowerSys(IN PVBOXUSBDEV_EXT pDevExt, IN PIRP pIrp) 295 287 { 296 PIO_STACK_LOCATION pSl = IoGetCurrentIrpStackLocation(pIrp);297 SYSTEM_POWER_STATE enmSysPState = pSl->Parameters.Power.State.SystemState; 288 /*PIO_STACK_LOCATION pSl = IoGetCurrentIrpStackLocation(pIrp); 289 SYSTEM_POWER_STATE enmSysPState = pSl->Parameters.Power.State.SystemState;*/ 298 290 299 291 return vboxUsbPwrIoPostSys(pDevExt, pIrp); … … 339 331 { 340 332 PIO_STACK_LOCATION pSl = IoGetCurrentIrpStackLocation(pIrp); 341 342 333 switch (pSl->Parameters.Power.Type) 343 334 { 344 335 case SystemPowerState: 345 {346 336 return vboxUsbPwrSetPowerSys(pDevExt, pIrp); 347 } 337 348 338 case DevicePowerState: 349 {350 339 return vboxUsbPwrSetPowerDev(pDevExt, pIrp); 351 } 340 352 341 default: 353 {354 342 AssertFailed(); 355 343 return vboxUsbPwrMnDefault(pDevExt, pIrp); 356 } 357 358 } 359 return vboxUsbPwrMnDefault(pDevExt, pIrp); 344 } 360 345 } 361 346 … … 374 359 { 375 360 case IRP_MN_POWER_SEQUENCE: 376 {377 361 return vboxUsbPwrMnPowerSequence(pDevExt, pIrp); 378 } 362 379 363 case IRP_MN_QUERY_POWER: 380 {381 364 return vboxUsbPwrMnQueryPower(pDevExt, pIrp); 382 } 365 383 366 case IRP_MN_SET_POWER: 384 {385 367 return vboxUsbPwrMnSetPower(pDevExt, pIrp); 386 } 368 387 369 case IRP_MN_WAIT_WAKE: 388 {389 370 return vboxUsbPwrMnWaitWake(pDevExt, pIrp); 390 } 371 391 372 default: 392 {393 373 // AssertFailed(); 394 374 return vboxUsbPwrMnDefault(pDevExt, pIrp); 395 }396 375 } 397 376 } … … 404 383 { 405 384 case ENMVBOXUSB_PNPSTATE_REMOVED: 406 {407 385 PoStartNextPowerIrp(pIrp); 408 386 … … 415 393 416 394 return STATUS_DELETE_PENDING; 417 } 395 418 396 case ENMVBOXUSB_PNPSTATE_START_PENDING: 419 {420 397 PoStartNextPowerIrp(pIrp); 421 398 IoSkipCurrentIrpStackLocation(pIrp); … … 424 401 425 402 return PoCallDriver(pDevExt->pLowerDO, pIrp); 426 } 403 427 404 default: 428 {429 405 return vboxUsbPwrDispatch(pDevExt, pIrp); 430 } 431 } 432 } 433 406 } 407 } 408
Note:
See TracChangeset
for help on using the changeset viewer.