Changeset 44988 in vbox for trunk/src/VBox/Additions/common/VBoxGuest
- Timestamp:
- Mar 11, 2013 2:34:08 PM (12 years ago)
- Location:
- trunk/src/VBox/Additions/common/VBoxGuest
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win-legacy.cpp
r44983 r44988 25 25 #include <VBox/version.h> 26 26 #include <VBox/VBoxGuestLib.h> 27 #include <iprt/string.h> 27 28 28 29 … … 79 80 RtlInitUnicodeString(&szDevName, VBOXGUEST_DEVICE_NAME_NT); 80 81 PDEVICE_OBJECT pDeviceObject = NULL; 81 rc = IoCreateDevice(pDrvObj, sizeof(VBOXGUESTDEVEXT ), &szDevName, FILE_DEVICE_UNKNOWN, 0, FALSE, &pDeviceObject);82 rc = IoCreateDevice(pDrvObj, sizeof(VBOXGUESTDEVEXTWIN), &szDevName, FILE_DEVICE_UNKNOWN, 0, FALSE, &pDeviceObject); 82 83 if (NT_SUCCESS(rc)) 83 84 { … … 96 97 Log(("VBoxGuest::vbgdNt4CreateDevice: Setting up device extension ...\n")); 97 98 98 PVBOXGUESTDEVEXT pDevExt = (PVBOXGUESTDEVEXT)pDeviceObject->DeviceExtension;99 R tlZeroMemory(pDevExt, sizeof(VBOXGUESTDEVEXT));99 PVBOXGUESTDEVEXTWIN pDevExt = (PVBOXGUESTDEVEXTWIN)pDeviceObject->DeviceExtension; 100 RT_ZERO(*pDevExt); 100 101 101 102 Log(("VBoxGuest::vbgdNt4CreateDevice: Device extension created\n")); 102 103 103 104 /* Store a reference to ourself. */ 104 pDevExt-> win.s.pDeviceObject = pDeviceObject;105 pDevExt->pDeviceObject = pDeviceObject; 105 106 106 107 /* Store bus and slot number we've queried before. */ 107 pDevExt-> win.s.busNumber = uBusNumber;108 pDevExt-> win.s.slotNumber = SlotNumber.u.AsULONG;108 pDevExt->busNumber = uBusNumber; 109 pDevExt->slotNumber = SlotNumber.u.AsULONG; 109 110 110 111 #ifdef VBOX_WITH_GUEST_BUGCHECK_DETECTION -
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win-pnp.cpp
r44987 r44988 104 104 NTSTATUS vbgdNtPnP(PDEVICE_OBJECT pDevObj, PIRP pIrp) 105 105 { 106 PVBOXGUESTDEVEXT pDevExt = (PVBOXGUESTDEVEXT)pDevObj->DeviceExtension;107 PIO_STACK_LOCATION pStack = IoGetCurrentIrpStackLocation(pIrp);106 PVBOXGUESTDEVEXTWIN pDevExt = (PVBOXGUESTDEVEXTWIN)pDevObj->DeviceExtension; 107 PIO_STACK_LOCATION pStack = IoGetCurrentIrpStackLocation(pIrp); 108 108 109 109 #ifdef LOG_ENABLED … … 147 147 148 148 /* This must be handled first by the lower driver. */ 149 rc = vbgdNtSendIrpSynchronously(pDevExt-> win.s.pNextLowerDriver, pIrp, TRUE);149 rc = vbgdNtSendIrpSynchronously(pDevExt->pNextLowerDriver, pIrp, TRUE); 150 150 151 151 if ( NT_SUCCESS(rc) … … 158 158 { 159 159 Log(("VBoxGuest::vbgdNtVBoxGuestPnP: START_DEVICE: No resources, pDevExt = %p, nextLowerDriver = %p!\n", 160 pDevExt, pDevExt ? pDevExt-> win.s.pNextLowerDriver : NULL));160 pDevExt, pDevExt ? pDevExt->pNextLowerDriver : NULL)); 161 161 rc = STATUS_UNSUCCESSFUL; 162 162 } … … 182 182 183 183 /* This must be handled first by the lower driver. */ 184 rc = vbgdNtSendIrpSynchronously(pDevExt-> win.s.pNextLowerDriver, pIrp, TRUE);185 186 if (NT_SUCCESS(rc) && pDevExt-> win.s.devState == PENDINGREMOVE)184 rc = vbgdNtSendIrpSynchronously(pDevExt->pNextLowerDriver, pIrp, TRUE); 185 186 if (NT_SUCCESS(rc) && pDevExt->devState == PENDINGREMOVE) 187 187 { 188 188 /* Return to the state prior to receiving the IRP_MN_QUERY_REMOVE_DEVICE request. */ 189 pDevExt-> win.s.devState = pDevExt->win.s.prevDevState;189 pDevExt->devState = pDevExt->prevDevState; 190 190 } 191 191 … … 210 210 IoSkipCurrentIrpStackLocation(pIrp); 211 211 212 rc = IoCallDriver(pDevExt-> win.s.pNextLowerDriver, pIrp);212 rc = IoCallDriver(pDevExt->pNextLowerDriver, pIrp); 213 213 214 214 /* Do not complete the IRP. */ … … 234 234 IoSkipCurrentIrpStackLocation(pIrp); 235 235 236 rc = IoCallDriver(pDevExt-> win.s.pNextLowerDriver, pIrp);236 rc = IoCallDriver(pDevExt->pNextLowerDriver, pIrp); 237 237 Log(("VBoxGuest::vbgdNtGuestPnp: QUERY_REMOVE_DEVICE: Next lower driver replied rc = 0x%x\n", rc)); 238 238 … … 267 267 IoSkipCurrentIrpStackLocation(pIrp); 268 268 269 rc = IoCallDriver(pDevExt-> win.s.pNextLowerDriver, pIrp);269 rc = IoCallDriver(pDevExt->pNextLowerDriver, pIrp); 270 270 Log(("VBoxGuest::vbgdNtGuestPnp: REMOVE_DEVICE: Next lower driver replied rc = 0x%x\n", rc)); 271 271 272 IoDetachDevice(pDevExt-> win.s.pNextLowerDriver);272 IoDetachDevice(pDevExt->pNextLowerDriver); 273 273 274 274 Log(("VBoxGuest::vbgdNtGuestPnp: REMOVE_DEVICE: Removing device ...\n")); 275 275 276 276 /* Destroy device extension and clean up everything else. */ 277 VBoxGuestDeleteDevExt( pDevExt);277 VBoxGuestDeleteDevExt(&pDevExt->Core); 278 278 279 279 /* Remove DOS device + symbolic link. */ … … 299 299 300 300 /* This must be handled first by the lower driver. */ 301 rc = vbgdNtSendIrpSynchronously(pDevExt-> win.s.pNextLowerDriver, pIrp, TRUE);302 303 if (NT_SUCCESS(rc) && pDevExt-> win.s.devState == PENDINGSTOP)301 rc = vbgdNtSendIrpSynchronously(pDevExt->pNextLowerDriver, pIrp, TRUE); 302 303 if (NT_SUCCESS(rc) && pDevExt->devState == PENDINGSTOP) 304 304 { 305 305 /* Return to the state prior to receiving the IRP_MN_QUERY_STOP_DEVICE request. */ 306 pDevExt-> win.s.devState = pDevExt->win.s.prevDevState;306 pDevExt->devState = pDevExt->prevDevState; 307 307 } 308 308 … … 329 329 IoSkipCurrentIrpStackLocation(pIrp); 330 330 331 rc = IoCallDriver(pDevExt-> win.s.pNextLowerDriver, pIrp);331 rc = IoCallDriver(pDevExt->pNextLowerDriver, pIrp); 332 332 Log(("VBoxGuest::vbgdNtGuestPnp: QUERY_STOP_DEVICE: Next lower driver replied rc = 0x%x\n", rc)); 333 333 … … 358 358 IoSkipCurrentIrpStackLocation(pIrp); 359 359 360 rc = IoCallDriver(pDevExt-> win.s.pNextLowerDriver, pIrp);360 rc = IoCallDriver(pDevExt->pNextLowerDriver, pIrp); 361 361 Log(("VBoxGuest::vbgdNtGuestPnp: STOP_DEVICE: Next lower driver replied rc = 0x%x\n", rc)); 362 362 … … 367 367 { 368 368 IoSkipCurrentIrpStackLocation(pIrp); 369 rc = IoCallDriver(pDevExt-> win.s.pNextLowerDriver, pIrp);369 rc = IoCallDriver(pDevExt->pNextLowerDriver, pIrp); 370 370 return rc; 371 371 } … … 391 391 { 392 392 #ifdef VBOX_STRICT 393 PVBOXGUESTDEVEXT pDevExt = (PVBOXGUESTDEVEXT)pContext;394 PIO_STACK_LOCATION pIrpSp = IoGetCurrentIrpStackLocation(pIrp);393 PVBOXGUESTDEVEXTWIN pDevExt = (PVBOXGUESTDEVEXTWIN)pContext; 394 PIO_STACK_LOCATION pIrpSp = IoGetCurrentIrpStackLocation(pIrp); 395 395 396 396 Assert(pDevExt); … … 435 435 NTSTATUS vbgdNtPower(PDEVICE_OBJECT pDevObj, PIRP pIrp) 436 436 { 437 PIO_STACK_LOCATION pStack = IoGetCurrentIrpStackLocation(pIrp);438 PVBOXGUESTDEVEXT pDevExt = (PVBOXGUESTDEVEXT)pDevObj->DeviceExtension;439 POWER_STATE_TYPE enmPowerType = pStack->Parameters.Power.Type;440 POWER_STATE PowerState = pStack->Parameters.Power.State;441 POWER_ACTION enmPowerAction = pStack->Parameters.Power.ShutdownType;437 PIO_STACK_LOCATION pStack = IoGetCurrentIrpStackLocation(pIrp); 438 PVBOXGUESTDEVEXTWIN pDevExt = (PVBOXGUESTDEVEXTWIN)pDevObj->DeviceExtension; 439 POWER_STATE_TYPE enmPowerType = pStack->Parameters.Power.Type; 440 POWER_STATE PowerState = pStack->Parameters.Power.State; 441 POWER_ACTION enmPowerAction = pStack->Parameters.Power.ShutdownType; 442 442 443 443 Log(("VBoxGuest::vbgdNtGuestPower\n")); … … 463 463 { 464 464 if ( pDevExt 465 && pDevExt-> win.s.LastSystemPowerAction == PowerActionHibernate)465 && pDevExt->LastSystemPowerAction == PowerActionHibernate) 466 466 { 467 467 Log(("VBoxGuest::vbgdNtGuestPower: Returning from hibernation!\n")); 468 int rc = VBoxGuestReinitDevExtAfterHibernation( pDevExt,468 int rc = VBoxGuestReinitDevExtAfterHibernation(&pDevExt->Core, 469 469 vbgdNtVersionToOSType(g_enmVbgdNtVer)); 470 470 if (RT_FAILURE(rc)) … … 491 491 if (RT_FAILURE(vrc)) 492 492 { 493 Log(("VBoxGuest::PowerStateRequest: error communicating new power status to VMMDev. " 494 "vrc = %Rrc\n", vrc)); 493 Log(("VBoxGuest::PowerStateRequest: error communicating new power status to VMMDev. vrc = %Rrc\n", vrc)); 495 494 } 496 495 … … 511 510 Log(("VBoxGuest::vbgdNtGuestPower: Telling the VMMDev to close the VM ...\n")); 512 511 513 VMMDevPowerStateRequest *pReq = pDevExt-> win.s.pPowerStateRequest;512 VMMDevPowerStateRequest *pReq = pDevExt->pPowerStateRequest; 514 513 int vrc = VERR_NOT_IMPLEMENTED; 515 514 if (pReq) … … 540 539 */ 541 540 if (pDevExt) 542 pDevExt-> win.s.LastSystemPowerAction = enmPowerAction;541 pDevExt->LastSystemPowerAction = enmPowerAction; 543 542 544 543 break; … … 570 569 TRUE, 571 570 TRUE); 572 return PoCallDriver(pDevExt-> win.s.pNextLowerDriver, pIrp);571 return PoCallDriver(pDevExt->pNextLowerDriver, pIrp); 573 572 } 574 573 -
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win.cpp
r44985 r44988 207 207 */ 208 208 PDEVICE_OBJECT pDeviceObject = NULL; 209 PVBOXGUESTDEVEXT pDevExt = NULL;209 PVBOXGUESTDEVEXTWIN pDevExt = NULL; 210 210 UNICODE_STRING devName; 211 211 UNICODE_STRING win32Name; 212 212 RtlInitUnicodeString(&devName, VBOXGUEST_DEVICE_NAME_NT); 213 rc = IoCreateDevice(pDrvObj, sizeof(VBOXGUESTDEVEXT ), &devName, FILE_DEVICE_UNKNOWN, 0, FALSE, &pDeviceObject);213 rc = IoCreateDevice(pDrvObj, sizeof(VBOXGUESTDEVEXTWIN), &devName, FILE_DEVICE_UNKNOWN, 0, FALSE, &pDeviceObject); 214 214 if (NT_SUCCESS(rc)) 215 215 { … … 224 224 * Setup the device extension. 225 225 */ 226 pDevExt = (PVBOXGUESTDEVEXT )pDeviceObject->DeviceExtension;226 pDevExt = (PVBOXGUESTDEVEXTWIN)pDeviceObject->DeviceExtension; 227 227 RtlZeroMemory(pDevExt, sizeof(VBOXGUESTDEVEXT)); 228 228 229 KeInitializeSpinLock(&pDevExt-> win.s.MouseEventAccessLock);230 231 pDevExt-> win.s.pDeviceObject = pDeviceObject;232 pDevExt-> win.s.prevDevState = STOPPED;233 pDevExt-> win.s.devState = STOPPED;234 235 pDevExt-> win.s.pNextLowerDriver = IoAttachDeviceToDeviceStack(pDeviceObject, pDevObj);236 if (pDevExt-> win.s.pNextLowerDriver == NULL)229 KeInitializeSpinLock(&pDevExt->MouseEventAccessLock); 230 231 pDevExt->pDeviceObject = pDeviceObject; 232 pDevExt->prevDevState = STOPPED; 233 pDevExt->devState = STOPPED; 234 235 pDevExt->pNextLowerDriver = IoAttachDeviceToDeviceStack(pDeviceObject, pDevObj); 236 if (pDevExt->pNextLowerDriver == NULL) 237 237 { 238 238 Log(("VBoxGuest::vbgdNtGuestAddDevice: IoAttachDeviceToDeviceStack did not give a nextLowerDriver!\n")); … … 267 267 if (pDevExt) 268 268 { 269 if (pDevExt-> win.s.pNextLowerDriver)270 IoDetachDevice(pDevExt-> win.s.pNextLowerDriver);269 if (pDevExt->pNextLowerDriver) 270 IoDetachDevice(pDevExt->pNextLowerDriver); 271 271 } 272 272 IoDeleteSymbolicLink(&win32Name); … … 355 355 #endif 356 356 { 357 PVBOXGUESTDEVEXT pDevExt = (PVBOXGUESTDEVEXT)pDevObj->DeviceExtension;357 PVBOXGUESTDEVEXTWIN pDevExt = (PVBOXGUESTDEVEXTWIN)pDevObj->DeviceExtension; 358 358 #ifndef TARGET_NT4 359 PIO_STACK_LOCATION pStack = IoGetCurrentIrpStackLocation(pIrp);359 PIO_STACK_LOCATION pStack = IoGetCurrentIrpStackLocation(pIrp); 360 360 #endif 361 361 … … 375 375 rc = HalAssignSlotResources(pRegPath, &classNameString, 376 376 pDrvObj, pDevObj, 377 PCIBus, pDevExt-> win.s.busNumber, pDevExt->win.s.slotNumber,377 PCIBus, pDevExt->busNumber, pDevExt->slotNumber, 378 378 &pResourceList); 379 379 if (pResourceList && pResourceList->Count > 0) … … 385 385 vbgdNtShowDeviceResources(&pStack->Parameters.StartDevice.AllocatedResources->List[0].PartialResourceList); 386 386 if (NT_SUCCESS(rc)) 387 rc = vbgdNtScanPCIResourceList(pStack->Parameters.StartDevice.AllocatedResourcesTranslated, 388 pDevExt); 387 rc = vbgdNtScanPCIResourceList(pStack->Parameters.StartDevice.AllocatedResourcesTranslated, pDevExt); 389 388 #endif 390 389 if (NT_SUCCESS(rc)) … … 397 396 uint32_t cbMMIO = 0; 398 397 rc = vbgdNtMapVMMDevMemory(pDevExt, 399 pDevExt-> win.s.vmmDevPhysMemoryAddress,400 pDevExt-> win.s.vmmDevPhysMemoryLength,398 pDevExt->vmmDevPhysMemoryAddress, 399 pDevExt->vmmDevPhysMemoryLength, 401 400 &pvMMIOBase, 402 401 &cbMMIO); 403 402 if (NT_SUCCESS(rc)) 404 403 { 405 pDevExt-> pVMMDevMemory = (VMMDevMemory *)pvMMIOBase;404 pDevExt->Core.pVMMDevMemory = (VMMDevMemory *)pvMMIOBase; 406 405 407 406 Log(("VBoxGuest::vbgdNtInit: pvMMIOBase = 0x%p, pDevExt = 0x%p, pDevExt->pVMMDevMemory = 0x%p\n", 408 407 pvMMIOBase, pDevExt, pDevExt ? pDevExt->pVMMDevMemory : NULL)); 409 408 410 int vrc = VBoxGuestInitDevExt( pDevExt,411 pDevExt-> IOPortBase,409 int vrc = VBoxGuestInitDevExt(&pDevExt->Core, 410 pDevExt->Core.IOPortBase, 412 411 pvMMIOBase, cbMMIO, 413 412 vbgdNtVersionToOSType(g_enmVbgdNtVer), … … 425 424 if (NT_SUCCESS(rc)) 426 425 { 427 int vrc = VbglGRAlloc((VMMDevRequestHeader **)&pDevExt-> win.s.pPowerStateRequest,428 sizeof 426 int vrc = VbglGRAlloc((VMMDevRequestHeader **)&pDevExt->pPowerStateRequest, 427 sizeof(VMMDevPowerStateRequest), VMMDevReq_SetPowerStatus); 429 428 if (RT_FAILURE(vrc)) 430 429 { … … 441 440 Log(("VBoxGuest::vbgdNtInit: Initializing DPC/ISR ...\n")); 442 441 443 IoInitializeDpcRequest(pDevExt-> win.s.pDeviceObject, vbgdNtDpcHandler);442 IoInitializeDpcRequest(pDevExt->pDeviceObject, vbgdNtDpcHandler); 444 443 #ifdef TARGET_NT4 445 444 ULONG uInterruptVector; … … 447 446 /* Get an interrupt vector. */ 448 447 /* Only proceed if the device provides an interrupt. */ 449 if ( pDevExt-> win.s.interruptLevel450 || pDevExt-> win.s.interruptVector)448 if ( pDevExt->interruptLevel 449 || pDevExt->interruptVector) 451 450 { 452 451 Log(("VBoxGuest::vbgdNtInit: Getting interrupt vector (HAL): Bus: %u, IRQL: %u, Vector: %u\n", 453 pDevExt-> win.s.busNumber, pDevExt->win.s.interruptLevel, pDevExt->win.s.interruptVector));452 pDevExt->busNumber, pDevExt->interruptLevel, pDevExt->interruptVector)); 454 453 455 454 uInterruptVector = HalGetInterruptVector(PCIBus, 456 pDevExt-> win.s.busNumber,457 pDevExt-> win.s.interruptLevel,458 pDevExt-> win.s.interruptVector,455 pDevExt->busNumber, 456 pDevExt->interruptLevel, 457 pDevExt->interruptVector, 459 458 &irqLevel, 460 &pDevExt-> win.s.interruptAffinity);459 &pDevExt->interruptAffinity); 461 460 Log(("VBoxGuest::vbgdNtInit: HalGetInterruptVector returns vector %u\n", uInterruptVector)); 462 461 if (uInterruptVector == 0) … … 466 465 Log(("VBoxGuest::vbgdNtInit: Device does not provide an interrupt!\n")); 467 466 #endif 468 if (pDevExt-> win.s.interruptVector)467 if (pDevExt->interruptVector) 469 468 { 470 469 Log(("VBoxGuest::vbgdNtInit: Connecting interrupt ...\n")); 471 470 472 rc = IoConnectInterrupt(&pDevExt-> win.s.pInterruptObject,/* Out: interrupt object. */473 (PKSERVICE_ROUTINE)vbgdNtIsrHandler, /* Our ISR handler. */474 pDevExt, /* Device context. */475 NULL, /* Optional spinlock. */471 rc = IoConnectInterrupt(&pDevExt->pInterruptObject, /* Out: interrupt object. */ 472 (PKSERVICE_ROUTINE)vbgdNtIsrHandler, /* Our ISR handler. */ 473 pDevExt, /* Device context. */ 474 NULL, /* Optional spinlock. */ 476 475 #ifdef TARGET_NT4 477 uInterruptVector, /* Interrupt vector. */478 irqLevel, /* Interrupt level. */479 irqLevel, /* Interrupt level. */476 uInterruptVector, /* Interrupt vector. */ 477 irqLevel, /* Interrupt level. */ 478 irqLevel, /* Interrupt level. */ 480 479 #else 481 pDevExt-> win.s.interruptVector,/* Interrupt vector. */482 (KIRQL)pDevExt-> win.s.interruptLevel,/* Interrupt level. */483 (KIRQL)pDevExt-> win.s.interruptLevel,/* Interrupt level. */484 #endif 485 pDevExt-> win.s.interruptMode,/* LevelSensitive or Latched. */486 TRUE, /* Shareable interrupt. */487 pDevExt-> win.s.interruptAffinity,/* CPU affinity. */488 FALSE); /* Don't save FPU stack. */480 pDevExt->interruptVector, /* Interrupt vector. */ 481 (KIRQL)pDevExt->interruptLevel, /* Interrupt level. */ 482 (KIRQL)pDevExt->interruptLevel, /* Interrupt level. */ 483 #endif 484 pDevExt->interruptMode, /* LevelSensitive or Latched. */ 485 TRUE, /* Shareable interrupt. */ 486 pDevExt->interruptAffinity, /* CPU affinity. */ 487 FALSE); /* Don't save FPU stack. */ 489 488 if (NT_ERROR(rc)) 490 489 Log(("VBoxGuest::vbgdNtInit: Could not connect interrupt, rc = 0x%x\n", rc)); … … 497 496 #ifdef VBOX_WITH_HGCM 498 497 Log(("VBoxGuest::vbgdNtInit: Allocating kernel session data ...\n")); 499 int vrc = VBoxGuestCreateKernelSession( pDevExt, &pDevExt->win.s.pKernelSession);498 int vrc = VBoxGuestCreateKernelSession(&pDevExt->Core, &pDevExt->pKernelSession); 500 499 if (RT_FAILURE(vrc)) 501 500 { … … 511 510 if (NT_SUCCESS(rcNt)) 512 511 { 513 pDevExt-> fLoggingEnabled = ulValue >= 0xFF;514 if (pDevExt-> fLoggingEnabled)512 pDevExt->Core.fLoggingEnabled = ulValue >= 0xFF; 513 if (pDevExt->Core.fLoggingEnabled) 515 514 Log(("Logging to release log enabled (0x%x)", ulValue)); 516 515 } … … 521 520 } 522 521 else 523 { 524 pDevExt->win.s.pInterruptObject = NULL; 525 } 522 pDevExt->pInterruptObject = NULL; 526 523 527 524 Log(("VBoxGuest::vbgdNtInit: Returned with rc = 0x%x\n", rc)); … … 540 537 Log(("VBoxGuest::vbgdNtCleanup\n")); 541 538 542 PVBOXGUESTDEVEXT pDevExt = (PVBOXGUESTDEVEXT)pDevObj->DeviceExtension;539 PVBOXGUESTDEVEXTWIN pDevExt = (PVBOXGUESTDEVEXTWIN)pDevObj->DeviceExtension; 543 540 if (pDevExt) 544 541 { … … 546 543 #if 0 /* @todo: test & enable cleaning global session data */ 547 544 #ifdef VBOX_WITH_HGCM 548 if (pDevExt-> win.s.pKernelSession)549 { 550 VBoxGuestCloseSession(pDevExt, pDevExt-> win.s.pKernelSession);551 pDevExt-> win.s.pKernelSession = NULL;552 } 553 #endif 554 #endif 555 556 if (pDevExt-> win.s.pInterruptObject)557 { 558 IoDisconnectInterrupt(pDevExt-> win.s.pInterruptObject);559 pDevExt-> win.s.pInterruptObject = NULL;560 } 561 562 /* @todo: cleanup the rest stuff */545 if (pDevExt->pKernelSession) 546 { 547 VBoxGuestCloseSession(pDevExt, pDevExt->pKernelSession); 548 pDevExt->pKernelSession = NULL; 549 } 550 #endif 551 #endif 552 553 if (pDevExt->pInterruptObject) 554 { 555 IoDisconnectInterrupt(pDevExt->pInterruptObject); 556 pDevExt->pInterruptObject = NULL; 557 } 558 559 /** @todo: cleanup the rest stuff */ 563 560 564 561 … … 616 613 { 617 614 /** @todo AssertPtrReturn(pIrp); */ 618 PIO_STACK_LOCATION pStack = IoGetCurrentIrpStackLocation(pIrp);615 PIO_STACK_LOCATION pStack = IoGetCurrentIrpStackLocation(pIrp); 619 616 /** @todo AssertPtrReturn(pStack); */ 620 PFILE_OBJECT pFileObj = pStack->FileObject; 621 PVBOXGUESTDEVEXT pDevExt = (PVBOXGUESTDEVEXT)pDevObj->DeviceExtension; 622 NTSTATUS rc = STATUS_SUCCESS; 623 624 if (pDevExt->win.s.devState != WORKING) 625 { 626 Log(("VBoxGuest::vbgdNtGuestCreate: device is not working currently: %d!\n", 627 pDevExt->win.s.devState)); 617 PFILE_OBJECT pFileObj = pStack->FileObject; 618 PVBOXGUESTDEVEXTWIN pDevExt = (PVBOXGUESTDEVEXTWIN)pDevObj->DeviceExtension; 619 NTSTATUS rc = STATUS_SUCCESS; 620 621 if (pDevExt->devState != WORKING) 622 { 623 Log(("VBoxGuest::vbgdNtGuestCreate: device is not working currently: %d!\n", pDevExt->devState)); 628 624 rc = STATUS_UNSUCCESSFUL; 629 625 } … … 653 649 * exists for every R3 process. 654 650 */ 655 vrc = VBoxGuestCreateUserSession( pDevExt, &pSession);651 vrc = VBoxGuestCreateUserSession(&pDevExt->Core, &pSession); 656 652 } 657 653 else 658 654 { 659 655 /* ... otherwise we've been called from R0! */ 660 vrc = VBoxGuestCreateKernelSession( pDevExt, &pSession);656 vrc = VBoxGuestCreateKernelSession(&pDevExt->Core, &pSession); 661 657 } 662 658 if (RT_SUCCESS(vrc)) … … 684 680 static NTSTATUS vbgdNtClose(PDEVICE_OBJECT pDevObj, PIRP pIrp) 685 681 { 686 PVBOXGUESTDEVEXT pDevExt = (PVBOXGUESTDEVEXT)pDevObj->DeviceExtension;687 PIO_STACK_LOCATION pStack = IoGetCurrentIrpStackLocation(pIrp);688 PFILE_OBJECT pFileObj = pStack->FileObject;682 PVBOXGUESTDEVEXTWIN pDevExt = (PVBOXGUESTDEVEXTWIN)pDevObj->DeviceExtension; 683 PIO_STACK_LOCATION pStack = IoGetCurrentIrpStackLocation(pIrp); 684 PFILE_OBJECT pFileObj = pStack->FileObject; 689 685 690 686 Log(("VBoxGuest::vbgdNtGuestClose: pDevExt=0x%p pFileObj=0x%p FsContext=0x%p\n", … … 695 691 PVBOXGUESTSESSION pSession = (PVBOXGUESTSESSION)pFileObj->FsContext; 696 692 if (pSession) 697 VBoxGuestCloseSession( pDevExt, pSession);693 VBoxGuestCloseSession(&pDevExt->Core, pSession); 698 694 #endif 699 695 … … 716 712 { 717 713 NTSTATUS Status = STATUS_SUCCESS; 718 PVBOXGUESTDEVEXT pDevExt = (PVBOXGUESTDEVEXT)pDevObj->DeviceExtension;714 PVBOXGUESTDEVEXTWIN pDevExt = (PVBOXGUESTDEVEXTWIN)pDevObj->DeviceExtension; 719 715 PIO_STACK_LOCATION pStack = IoGetCurrentIrpStackLocation(pIrp); 720 716 unsigned int uCmd = (unsigned int)pStack->Parameters.DeviceIoControl.IoControlCode; … … 740 736 { 741 737 Log(("VBoxGuest::vbgdNtIOCtl: Using kernel session data ...\n")); 742 pSession = pDevExt-> win.s.pKernelSession;738 pSession = pDevExt->pKernelSession; 743 739 } 744 740 … … 794 790 */ 795 791 size_t cbDataReturned; 796 int vrc = VBoxGuestCommonIOCtl(uCmd, pDevExt, pSession, pBuf, cbData, &cbDataReturned);792 int vrc = VBoxGuestCommonIOCtl(uCmd, &pDevExt->Core, pSession, pBuf, cbData, &cbDataReturned); 797 793 798 794 Log(("VBoxGuest::vbgdNtGuestDeviceControl: rc=%Rrc, pBuf=0x%p, cbData=%u, cbDataReturned=%u\n", … … 851 847 { 852 848 NTSTATUS Status = STATUS_SUCCESS; 853 PVBOXGUESTDEVEXT pDevExt = (PVBOXGUESTDEVEXT)pDevObj->DeviceExtension;849 PVBOXGUESTDEVEXTWIN pDevExt = (PVBOXGUESTDEVEXTWIN)pDevObj->DeviceExtension; 854 850 PIO_STACK_LOCATION pStack = IoGetCurrentIrpStackLocation(pIrp); 855 851 unsigned int uCmd = (unsigned int)pStack->Parameters.DeviceIoControl.IoControlCode; … … 875 871 /* we need a lock here to avoid concurrency with the set event functionality */ 876 872 KIRQL OldIrql; 877 KeAcquireSpinLock(&pDevExt-> win.s.MouseEventAccessLock, &OldIrql);878 pDevExt-> MouseNotifyCallback = *pInfo;879 KeReleaseSpinLock(&pDevExt-> win.s.MouseEventAccessLock, OldIrql);873 KeAcquireSpinLock(&pDevExt->MouseEventAccessLock, &OldIrql); 874 pDevExt->Core.MouseNotifyCallback = *pInfo; 875 KeReleaseSpinLock(&pDevExt->MouseEventAccessLock, OldIrql); 880 876 881 877 Status = STATUS_SUCCESS; … … 910 906 NTSTATUS vbgdNtSystemControl(PDEVICE_OBJECT pDevObj, PIRP pIrp) 911 907 { 912 PVBOXGUESTDEVEXT pDevExt = (PVBOXGUESTDEVEXT)pDevObj->DeviceExtension;908 PVBOXGUESTDEVEXTWIN pDevExt = (PVBOXGUESTDEVEXTWIN)pDevObj->DeviceExtension; 913 909 914 910 Log(("VBoxGuest::vbgdNtGuestSystemControl\n")); … … 917 913 IoSkipCurrentIrpStackLocation(pIrp); 918 914 919 return IoCallDriver(pDevExt-> win.s.pNextLowerDriver, pIrp);915 return IoCallDriver(pDevExt->pNextLowerDriver, pIrp); 920 916 } 921 917 … … 930 926 NTSTATUS vbgdNtShutdown(PDEVICE_OBJECT pDevObj, PIRP pIrp) 931 927 { 932 PVBOXGUESTDEVEXT pDevExt = (PVBOXGUESTDEVEXT)pDevObj->DeviceExtension;928 PVBOXGUESTDEVEXTWIN pDevExt = (PVBOXGUESTDEVEXTWIN)pDevObj->DeviceExtension; 933 929 934 930 Log(("VBoxGuest::vbgdNtGuestShutdown\n")); 935 931 936 VMMDevPowerStateRequest *pReq = pDevExt-> win.s.pPowerStateRequest;932 VMMDevPowerStateRequest *pReq = pDevExt->pPowerStateRequest; 937 933 if (pReq) 938 934 { … … 980 976 void vbgdNtDpcHandler(PKDPC pDPC, PDEVICE_OBJECT pDevObj, PIRP pIrp, PVOID pContext) 981 977 { 982 PVBOXGUESTDEVEXT pDevExt = (PVBOXGUESTDEVEXT)pDevObj->DeviceExtension;978 PVBOXGUESTDEVEXTWIN pDevExt = (PVBOXGUESTDEVEXTWIN)pDevObj->DeviceExtension; 983 979 Log(("VBoxGuest::vbgdNtGuestDpcHandler: pDevExt=0x%p\n", pDevExt)); 984 980 985 981 /* test & reset the counter */ 986 if (ASMAtomicXchgU32(&pDevExt-> u32MousePosChangedSeq, 0))982 if (ASMAtomicXchgU32(&pDevExt->Core.u32MousePosChangedSeq, 0)) 987 983 { 988 984 /* we need a lock here to avoid concurrency with the set event ioctl handler thread, 989 985 * i.e. to prevent the event from destroyed while we're using it */ 990 986 Assert(KeGetCurrentIrql() == DISPATCH_LEVEL); 991 KeAcquireSpinLockAtDpcLevel(&pDevExt-> win.s.MouseEventAccessLock);992 993 if (pDevExt-> MouseNotifyCallback.pfnNotify)994 pDevExt-> MouseNotifyCallback.pfnNotify(pDevExt->MouseNotifyCallback.pvUser);995 996 KeReleaseSpinLockFromDpcLevel(&pDevExt-> win.s.MouseEventAccessLock);987 KeAcquireSpinLockAtDpcLevel(&pDevExt->MouseEventAccessLock); 988 989 if (pDevExt->Core.MouseNotifyCallback.pfnNotify) 990 pDevExt->Core.MouseNotifyCallback.pfnNotify(pDevExt->Core.MouseNotifyCallback.pvUser); 991 992 KeReleaseSpinLockFromDpcLevel(&pDevExt->MouseEventAccessLock); 997 993 } 998 994 999 995 /* Process the wake-up list we were asked by the scheduling a DPC 1000 996 * in vbgdNtIsrHandler(). */ 1001 VBoxGuestWaitDoWakeUps( pDevExt);997 VBoxGuestWaitDoWakeUps(&pDevExt->Core); 1002 998 } 1003 999 … … 1012 1008 BOOLEAN vbgdNtIsrHandler(PKINTERRUPT pInterrupt, PVOID pServiceContext) 1013 1009 { 1014 PVBOXGUESTDEVEXT pDevExt = (PVBOXGUESTDEVEXT)pServiceContext;1010 PVBOXGUESTDEVEXTWIN pDevExt = (PVBOXGUESTDEVEXTWIN)pServiceContext; 1015 1011 if (pDevExt == NULL) 1016 1012 return FALSE; … … 1020 1016 1021 1017 /* Enter the common ISR routine and do the actual work. */ 1022 BOOLEAN fIRQTaken = VBoxGuestCommonISR( pDevExt);1018 BOOLEAN fIRQTaken = VBoxGuestCommonISR(&pDevExt->Core); 1023 1019 1024 1020 /* If we need to wake up some events we do that in a DPC to make … … 1028 1024 Log(("VBoxGuest::vbgdNtGuestIsrHandler: IRQ was taken! pInterrupt = 0x%p, pDevExt = 0x%p\n", 1029 1025 pInterrupt, pDevExt)); 1030 if (ASMAtomicUoReadU32(&pDevExt-> u32MousePosChangedSeq) || !RTListIsEmpty(&pDevExt->WakeUpList))1026 if (ASMAtomicUoReadU32(&pDevExt->Core.u32MousePosChangedSeq) || !RTListIsEmpty(&pDevExt->Core.WakeUpList)) 1031 1027 { 1032 1028 Log(("VBoxGuest::vbgdNtGuestIsrHandler: Requesting DPC ...\n")); 1033 IoRequestDpc(pDevExt-> win.s.pDeviceObject, pDevExt->win.s.pCurrentIrp, NULL);1029 IoRequestDpc(pDevExt->pDeviceObject, pDevExt->pCurrentIrp, NULL); 1034 1030 } 1035 1031 } … … 1038 1034 1039 1035 1040 /* 1036 /** 1041 1037 * Overridden routine for mouse polling events. 1042 1038 * … … 1094 1090 * @param pDevExt Device extension 1095 1091 */ 1096 NTSTATUS vbgdNtScanPCIResourceList(PCM_RESOURCE_LIST pResList, PVBOXGUESTDEVEXT pDevExt)1092 NTSTATUS vbgdNtScanPCIResourceList(PCM_RESOURCE_LIST pResList, PVBOXGUESTDEVEXTWIN pDevExt) 1097 1093 { 1098 1094 /* Enumerate the resource list. */ … … 1104 1100 ULONG rangeCount = 0; 1105 1101 ULONG cMMIORange = 0; 1106 PVBOXGUESTWINBASEADDRESS pBaseAddress = pDevExt-> win.s.pciBaseAddress;1102 PVBOXGUESTWINBASEADDRESS pBaseAddress = pDevExt->pciBaseAddress; 1107 1103 for (ULONG i = 0; i < pResList->List->PartialResourceList.Count; i++) 1108 1104 { … … 1122 1118 /* Save the IO port base. */ 1123 1119 /** @todo Not so good. */ 1124 pDevExt-> IOPortBase = (RTIOPORT)pPartialData->u.Port.Start.LowPart;1120 pDevExt->Core.IOPortBase = (RTIOPORT)pPartialData->u.Port.Start.LowPart; 1125 1121 1126 1122 /* Save resource information. */ … … 1149 1145 1150 1146 /* Save information. */ 1151 pDevExt-> win.s.interruptLevel = pPartialData->u.Interrupt.Level;1152 pDevExt-> win.s.interruptVector = pPartialData->u.Interrupt.Vector;1153 pDevExt-> win.s.interruptAffinity = pPartialData->u.Interrupt.Affinity;1147 pDevExt->interruptLevel = pPartialData->u.Interrupt.Level; 1148 pDevExt->interruptVector = pPartialData->u.Interrupt.Vector; 1149 pDevExt->interruptAffinity = pPartialData->u.Interrupt.Affinity; 1154 1150 1155 1151 /* Check interrupt mode. */ 1156 1152 if (pPartialData->Flags & CM_RESOURCE_INTERRUPT_LATCHED) 1157 { 1158 pDevExt->win.s.interruptMode = Latched; 1159 } 1153 pDevExt->interruptMode = Latched; 1160 1154 else 1161 { 1162 pDevExt->win.s.interruptMode = LevelSensitive; 1163 } 1155 pDevExt->interruptMode = LevelSensitive; 1164 1156 break; 1165 1157 } … … 1181 1173 { 1182 1174 /* Save physical MMIO base + length for VMMDev. */ 1183 pDevExt-> win.s.vmmDevPhysMemoryAddress = pPartialData->u.Memory.Start;1184 pDevExt-> win.s.vmmDevPhysMemoryLength = (ULONG)pPartialData->u.Memory.Length;1175 pDevExt->vmmDevPhysMemoryAddress = pPartialData->u.Memory.Start; 1176 pDevExt->vmmDevPhysMemoryLength = (ULONG)pPartialData->u.Memory.Length; 1185 1177 1186 1178 /* Save resource information. */ … … 1216 1208 1217 1209 /* Memorize the number of resources found. */ 1218 pDevExt-> win.s.pciAddressCount = rangeCount;1210 pDevExt->pciAddressCount = rangeCount; 1219 1211 return rc; 1220 1212 } … … 1232 1224 * @param pcbMMIO Length of mapped I/O base. 1233 1225 */ 1234 NTSTATUS vbgdNtMapVMMDevMemory(PVBOXGUESTDEVEXT pDevExt, PHYSICAL_ADDRESS physicalAdr, ULONG ulLength,1226 NTSTATUS vbgdNtMapVMMDevMemory(PVBOXGUESTDEVEXTWIN pDevExt, PHYSICAL_ADDRESS physicalAdr, ULONG ulLength, 1235 1227 void **ppvMMIOBase, uint32_t *pcbMMIO) 1236 1228 { … … 1282 1274 * @param pDevExt The device extension. 1283 1275 */ 1284 void vbgdNtUnmapVMMDevMemory(PVBOXGUESTDEVEXT pDevExt)1285 { 1286 Log(("VBoxGuest::vbgdNtUnmapVMMDevMemory: pVMMDevMemory = 0x%x\n", pDevExt-> pVMMDevMemory));1287 if (pDevExt-> pVMMDevMemory)1288 { 1289 MmUnmapIoSpace((void*)pDevExt-> pVMMDevMemory, pDevExt->win.s.vmmDevPhysMemoryLength);1290 pDevExt-> pVMMDevMemory = NULL;1291 } 1292 1293 pDevExt-> win.s.vmmDevPhysMemoryAddress.QuadPart = 0;1294 pDevExt-> win.s.vmmDevPhysMemoryLength = 0;1276 void vbgdNtUnmapVMMDevMemory(PVBOXGUESTDEVEXTWIN pDevExt) 1277 { 1278 Log(("VBoxGuest::vbgdNtUnmapVMMDevMemory: pVMMDevMemory = 0x%x\n", pDevExt->Core.pVMMDevMemory)); 1279 if (pDevExt->Core.pVMMDevMemory) 1280 { 1281 MmUnmapIoSpace((void*)pDevExt->Core.pVMMDevMemory, pDevExt->vmmDevPhysMemoryLength); 1282 pDevExt->Core.pVMMDevMemory = NULL; 1283 } 1284 1285 pDevExt->vmmDevPhysMemoryAddress.QuadPart = 0; 1286 pDevExt->vmmDevPhysMemoryLength = 0; 1295 1287 } 1296 1288 … … 1365 1357 { 1366 1358 AssertPtrReturn(pu32Bits, 0); 1367 LogFlowFunc(("*pu32Bits=0x%x, u32Mask=0x%x\n", *(long *)pu32Bits, 1368 u32Mask)); 1359 LogFlowFunc(("*pu32Bits=0x%x, u32Mask=0x%x\n", *(uint32_t *)pu32Bits, u32Mask)); 1369 1360 uint32_t u32Result = 0; 1370 1361 uint32_t u32WorkingMask = u32Mask; … … 1412 1403 1413 1404 #ifdef VBOX_WITH_DPC_LATENCY_CHECKER 1414 #pragma pack(1) 1405 1406 /* 1407 * DPC latency checker. 1408 */ 1409 1410 # pragma pack(1) /** @todo r=bird: Not needed for DPCSAMPLE, screwes up member alignment in DPCDATA! */ 1415 1411 typedef struct DPCSAMPLE 1416 1412 { 1417 LARGE_INTEGER PerfDelta;1418 LARGE_INTEGER PerfCounter;1419 LARGE_INTEGER PerfFrequency;1420 uint64_t u64TSC;1413 LARGE_INTEGER PerfDelta; 1414 LARGE_INTEGER PerfCounter; 1415 LARGE_INTEGER PerfFrequency; 1416 uint64_t u64TSC; 1421 1417 } DPCSAMPLE; 1422 1418 1423 1419 typedef struct DPCDATA 1424 1420 { 1425 KDPC Dpc;1426 KTIMER Timer;1427 KSPIN_LOCK SpinLock;1428 1429 ULONG ulTimerRes;1430 1431 LARGE_INTEGER DueTime;1432 1433 BOOLEAN fFinished;1434 1435 LARGE_INTEGER PerfCounterPrev;1436 1437 int iSampleCount;1438 DPCSAMPLE aSamples[8192];1421 KDPC Dpc; 1422 KTIMER Timer; 1423 KSPIN_LOCK SpinLock; 1424 1425 ULONG ulTimerRes; 1426 1427 BOOLEAN fFinished; 1428 1429 LARGE_INTEGER DueTime; 1430 1431 LARGE_INTEGER PerfCounterPrev; 1432 1433 int cSamples; 1434 DPCSAMPLE aSamples[8192]; 1439 1435 } DPCDATA; 1440 # pragma pack(1)1441 1442 # define VBOXGUEST_DPC_TAG 'DPCS'1436 # pragma pack(1) 1437 1438 # define VBOXGUEST_DPC_TAG 'DPCS' 1443 1439 1444 1440 static VOID DPCDeferredRoutine(struct _KDPC *Dpc, … … 1451 1447 KeAcquireSpinLockAtDpcLevel(&pData->SpinLock); 1452 1448 1453 if (pData-> iSampleCount>= RT_ELEMENTS(pData->aSamples))1449 if (pData->cSamples >= RT_ELEMENTS(pData->aSamples)) 1454 1450 { 1455 1451 pData->fFinished = 1; … … 1458 1454 } 1459 1455 1460 DPCSAMPLE *pSample = &pData->aSamples[pData-> iSampleCount++];1456 DPCSAMPLE *pSample = &pData->aSamples[pData->cSamples++]; 1461 1457 1462 1458 pSample->u64TSC = ASMReadTSC(); … … 1471 1467 } 1472 1468 1473 int VBoxGuestCommonIOCtl_DPC(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession,1469 int VBoxGuestCommonIOCtl_DPC(PVBOXGUESTDEVEXTWIN pDevExt, PVBOXGUESTSESSION pSession, 1474 1470 void *pvData, size_t cbData, size_t *pcbDataReturned) 1475 1471 { 1476 int rc = VINF_SUCCESS;1477 1478 1472 /* Allocate a non paged memory for samples and related data. */ 1479 1473 DPCDATA *pData = (DPCDATA *)ExAllocatePoolWithTag(NonPagedPool, sizeof(DPCDATA), VBOXGUEST_DPC_TAG); … … 1490 1484 1491 1485 pData->fFinished = 0; 1492 pData-> iSampleCount= 0;1486 pData->cSamples = 0; 1493 1487 pData->PerfCounterPrev.QuadPart = 0; 1494 1488 … … 1510 1504 /* Log everything to the host. */ 1511 1505 RTLogBackdoorPrintf("DPC: ulTimerRes = %d\n", pData->ulTimerRes); 1512 int i; 1513 for (i = 0; i < pData->iSampleCount; i++) 1506 for (int i = 0; i < pData->cSamples; i++) 1514 1507 { 1515 1508 DPCSAMPLE *pSample = &pData->aSamples[i]; 1516 1509 1517 1510 RTLogBackdoorPrintf("[%d] pd %lld pc %lld pf %lld t %lld\n", 1518 i,1519 pSample->PerfDelta.QuadPart,1520 pSample->PerfCounter.QuadPart,1521 pSample->PerfFrequency.QuadPart,1522 pSample->u64TSC);1511 i, 1512 pSample->PerfDelta.QuadPart, 1513 pSample->PerfCounter.QuadPart, 1514 pSample->PerfFrequency.QuadPart, 1515 pSample->u64TSC); 1523 1516 } 1524 1517 1525 1518 ExFreePoolWithTag(pData, VBOXGUEST_DPC_TAG); 1526 return rc; 1527 } 1519 return VINF_SUCCESS; 1520 } 1521 1528 1522 #endif /* VBOX_WITH_DPC_LATENCY_CHECKER */ 1523 -
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win.h
r44983 r44988 37 37 #include <VBox/VMMDev.h> 38 38 #include <VBox/VBoxGuest.h> 39 #include "VBoxGuestInternal.h" 39 40 40 41 … … 71 72 typedef struct VBOXGUESTDEVEXTWIN 72 73 { 74 VBOXGUESTDEVEXT Core; 75 73 76 /** Our functional driver object. */ 74 77 PDEVICE_OBJECT pDeviceObject; … … 139 142 #define VBOXGUEST_UPDATE_DEVSTATE(a_pDevExt, a_newDevState) \ 140 143 do { \ 141 (a_pDevExt)-> win.s.prevDevState = (a_pDevExt)->win.s.devState; \142 (a_pDevExt)-> win.s.devState = (a_newDevState); \144 (a_pDevExt)->prevDevState = (a_pDevExt)->devState; \ 145 (a_pDevExt)->devState = (a_newDevState); \ 143 146 } while (0) 144 147 145 148 /** CM_RESOURCE_MEMORY_* flags which were used on XP or earlier. */ 146 149 #define VBOX_CM_PRE_VISTA_MASK (0x3f) 147 148 149 /* Include the internal header now as we've declared the internal150 structure and stuff. */151 #include "VBoxGuestInternal.h"152 150 153 151 … … 173 171 VOID vbgdNtDpcHandler(PKDPC pDPC, PDEVICE_OBJECT pDevObj, PIRP pIrp, PVOID pContext); 174 172 BOOLEAN vbgdNtIsrHandler(PKINTERRUPT interrupt, PVOID serviceContext); 175 NTSTATUS vbgdNtScanPCIResourceList(PCM_RESOURCE_LIST pResList, PVBOXGUESTDEVEXT pDevExt);176 NTSTATUS vbgdNtMapVMMDevMemory(PVBOXGUESTDEVEXT pDevExt, PHYSICAL_ADDRESS physicalAdr, ULONG ulLength,173 NTSTATUS vbgdNtScanPCIResourceList(PCM_RESOURCE_LIST pResList, PVBOXGUESTDEVEXTWIN pDevExt); 174 NTSTATUS vbgdNtMapVMMDevMemory(PVBOXGUESTDEVEXTWIN pDevExt, PHYSICAL_ADDRESS physicalAdr, ULONG ulLength, 177 175 void **ppvMMIOBase, uint32_t *pcbMMIO); 178 void vbgdNtUnmapVMMDevMemory(PVBOXGUESTDEVEXT pDevExt);176 void vbgdNtUnmapVMMDevMemory(PVBOXGUESTDEVEXTWIN pDevExt); 179 177 VBOXOSTYPE vbgdNtVersionToOSType(VBGDNTVER enmNtVer); 180 178 /** @} */ -
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp
r44130 r44988 71 71 static int VBoxGuestCommonIOCtl_SetMouseStatus(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession, uint32_t fFeatures); 72 72 73 #ifdef VBOX_WITH_DPC_LATENCY_CHECKER74 int VBoxGuestCommonIOCtl_DPC(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession,75 void *pvData, size_t cbData, size_t *pcbDataReturned);76 #endif /* VBOX_WITH_DPC_LATENCY_CHECKER */77 73 78 74 /******************************************************************************* … … 2500 2496 } 2501 2497 #ifdef VBOX_WITH_DPC_LATENCY_CHECKER 2498 /** @todo r=bird: This request doesn't vary in size?? AFAIK it doesn't have 2499 * any data associated with it... grumble. */ 2502 2500 else if (VBOXGUEST_IOCTL_STRIP_SIZE(iFunction) == VBOXGUEST_IOCTL_STRIP_SIZE(VBOXGUEST_IOCTL_DPC)) 2503 2501 { -
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuestInternal.h
r44983 r44988 181 181 /** Callback and user data for a kernel mouse handler. */ 182 182 VBoxGuestMouseSetNotifyCallback MouseNotifyCallback; 183 184 /** Windows part.185 * @todo r=bird: Entirely wrong approach. You should create186 * VBOXGUESTDEVEXTWIN as a super structure to VBOXGUESTDEVEXT. If they187 * were classes, class VBOXGUESTDEVEXTWIN : public VBOXGUESTDEVEXT ... */188 union189 {190 #ifdef ___VBoxGuest_win_h191 VBOXGUESTDEVEXTWIN s;192 #else193 uint32_t dummy;194 #endif195 } win;196 197 183 } VBOXGUESTDEVEXT; 198 184 /** Pointer to the VBoxGuest driver data. */ … … 278 264 void VBoxGuestNativeISRMousePollEvent(PVBOXGUESTDEVEXT pDevExt); 279 265 266 267 #ifdef VBOX_WITH_DPC_LATENCY_CHECKER 268 int VBoxGuestCommonIOCtl_DPC(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession, 269 void *pvData, size_t cbData, size_t *pcbDataReturned); 270 #endif 271 280 272 RT_C_DECLS_END 281 273
Note:
See TracChangeset
for help on using the changeset viewer.