Changeset 70284 in vbox for trunk/src/VBox/Additions/common
- Timestamp:
- Dec 21, 2017 2:36:05 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win.cpp
r70282 r70284 58 58 59 59 60 #define VBOXGUEST_UPDATE_DEVSTATE(a_pDevExt, a_enmNewDevState) \61 do { \62 (a_pDevExt)->enmPrevDevState = (a_pDevExt)->enmDevState; \63 (a_pDevExt)->enmDevState = (a_enmNewDevState); \64 } while (0)65 66 67 60 /********************************************************************************************************************************* 68 61 * Structures and Typedefs * … … 73 66 typedef enum VGDRVNTDEVSTATE 74 67 { 68 /** @name Stable states 69 * @{ */ 70 VGDRVNTDEVSTATE_REMOVED = 0, 75 71 VGDRVNTDEVSTATE_STOPPED, 76 VGDRVNTDEVSTATE_WORKING, 72 VGDRVNTDEVSTATE_OPERATIONAL, 73 /** @} */ 74 75 /** @name Transitional states 76 * @{ */ 77 77 VGDRVNTDEVSTATE_PENDINGSTOP, 78 78 VGDRVNTDEVSTATE_PENDINGREMOVE, 79 VGDRVNTDEVSTATE_SURPRISEREMOVED ,80 VGDRVNTDEVSTATE_REMOVED79 VGDRVNTDEVSTATE_SURPRISEREMOVED 80 /** @} */ 81 81 } VGDRVNTDEVSTATE; 82 82 … … 124 124 /** Device state. */ 125 125 VGDRVNTDEVSTATE volatile enmDevState; 126 /** The previous device state. */126 /** The previous stable device state. */ 127 127 VGDRVNTDEVSTATE enmPrevDevState; 128 128 … … 840 840 /* Ready to rumble! */ 841 841 LogRelFunc(("Device is ready!\n")); 842 VBOXGUEST_UPDATE_DEVSTATE(pDevExt, VGDRVNTDEVSTATE_WORKING); 842 pDevExt->enmDevState = VGDRVNTDEVSTATE_OPERATIONAL; 843 pDevExt->enmPrevDevState = VGDRVNTDEVSTATE_OPERATIONAL; 843 844 return STATUS_SUCCESS; 844 845 } 846 845 847 pDevExt->pInterruptObject = NULL; 846 848 … … 1278 1280 { 1279 1281 rc = vgdrvNtSetupDevice(pDevExt, pDevObj, pIrp, NULL, NULL); 1280 if (!NT_SUCCESS(rc)) 1282 if (NT_SUCCESS(rc)) 1283 Log(("vgdrvNtNt5PlusPnP: START_DEVICE: success\n")); 1284 else 1281 1285 Log(("vgdrvNtNt5PlusPnP: START_DEVICE: vgdrvNtSetupDevice failed: %#x\n", rc)); 1282 1286 } … … 1313 1317 if (NT_SUCCESS(rc)) 1314 1318 { 1315 VBOXGUEST_UPDATE_DEVSTATE(pDevExt, VGDRVNTDEVSTATE_PENDINGREMOVE);1319 pDevExt->enmDevState = VGDRVNTDEVSTATE_PENDINGREMOVE; 1316 1320 1317 1321 /* This IRP passed down to lower driver. */ … … 1366 1370 { 1367 1371 Log(("vgdrvNtNt5PlusPnP: IRP_MN_SURPRISE_REMOVAL\n")); 1368 VBOXGUEST_UPDATE_DEVSTATE(pDevExt, VGDRVNTDEVSTATE_SURPRISEREMOVED);1372 pDevExt->enmDevState = VGDRVNTDEVSTATE_SURPRISEREMOVED; 1369 1373 LogRel(("VBoxGuest: unexpected device removal\n")); 1370 1374 … … 1385 1389 { 1386 1390 Log(("vgdrvNtNt5PlusPnP: REMOVE_DEVICE\n")); 1387 VBOXGUEST_UPDATE_DEVSTATE(pDevExt, VGDRVNTDEVSTATE_REMOVED);1391 pDevExt->enmDevState = VGDRVNTDEVSTATE_REMOVED; 1388 1392 1389 1393 /* … … 1425 1429 { 1426 1430 Log(("vgdrvNtNt5PlusPnP: QUERY_STOP_DEVICE\n")); 1427 VGDRVNTDEVSTATE const enmOldState = pDevExt->enmDevState;1428 1431 rc = vgdrvNtCheckIdle(pDevExt, "QUERY_STOP_DEVICE"); 1429 1432 if (NT_SUCCESS(rc)) 1430 1433 { 1431 VBOXGUEST_UPDATE_DEVSTATE(pDevExt, VGDRVNTDEVSTATE_PENDINGSTOP); 1434 pDevExt->enmPrevDevState = pDevExt->enmDevState; 1435 pDevExt->enmDevState = VGDRVNTDEVSTATE_PENDINGSTOP; 1432 1436 1433 1437 /* This IRP passed down to lower driver. */ … … 1482 1486 { 1483 1487 Log(("vgdrvNtNt5PlusPnP: STOP_DEVICE\n")); 1484 VBOXGUEST_UPDATE_DEVSTATE(pDevExt, VGDRVNTDEVSTATE_STOPPED);1488 pDevExt->enmDevState = VGDRVNTDEVSTATE_STOPPED; 1485 1489 1486 1490 /* … … 1843 1847 * Check the device state. 1844 1848 */ 1845 if (pDevExt->enmDevState != VGDRVNTDEVSTATE_ WORKING)1849 if (pDevExt->enmDevState != VGDRVNTDEVSTATE_OPERATIONAL) 1846 1850 { 1847 1851 LogFlow(("vgdrvNtCreate: Failed. Device is not in 'working' state: %d\n", pDevExt->enmDevState));
Note:
See TracChangeset
for help on using the changeset viewer.