Changeset 32930 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Oct 5, 2010 8:12:46 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 66416
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp
r32904 r32930 7381 7381 VOID vboxVDbgDoMpPrint(const PVBOXWDDMDISP_DEVICE pDevice, LPCSTR szString) 7382 7382 { 7383 uint32_t cbString = strlen(szString) + 1;7383 uint32_t cbString = (uint32_t)strlen(szString) + 1; 7384 7384 uint32_t cbCmd = RT_OFFSETOF(VBOXDISPIFESCAPE_DBGPRINT, aStringBuf[cbString]); 7385 7385 PVBOXDISPIFESCAPE_DBGPRINT pCmd = (PVBOXDISPIFESCAPE_DBGPRINT)RTMemAllocZ(cbCmd); -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoMisc.cpp
r32889 r32930 511 511 const WCHAR* pKeyPrefix; 512 512 UINT cbKeyPrefix; 513 UNICODE_STRING* pVGuid = vboxWddmVGuidGet(pDevExt); 514 Assert(pVGuid); 515 if (!pVGuid) 516 return STATUS_UNSUCCESSFUL; 517 513 518 winVersion_t ver = vboxQueryWinVersion(); 514 519 if (ver == WINVISTA) … … 524 529 } 525 530 526 ULONG cbResult = cbKeyPrefix + p DevExt->VideoGuid.Length + 2 + 8; // L"\\" + "XXXX"531 ULONG cbResult = cbKeyPrefix + pVGuid->Length + 2 + 8; // L"\\" + "XXXX" 527 532 if (cbBuf >= cbResult) 528 533 { 529 534 wcscpy(pBuf, pKeyPrefix); 530 535 pSuffix = pBuf + (cbKeyPrefix-2)/2; 531 memcpy(pSuffix, p DevExt->VideoGuid.Buffer, pDevExt->VideoGuid.Length);532 pSuffix += p DevExt->VideoGuid.Length/2;536 memcpy(pSuffix, pVGuid->Buffer, pVGuid->Length); 537 pSuffix += pVGuid->Length/2; 533 538 pSuffix[0] = L'\\'; 534 539 pSuffix += 1; … … 757 762 sizeof(val)); 758 763 } 764 765 UNICODE_STRING* vboxWddmVGuidGet(PDEVICE_EXTENSION pDevExt) 766 { 767 if (pDevExt->VideoGuid.Buffer) 768 return &pDevExt->VideoGuid; 769 770 Assert(KeGetCurrentIrql() == PASSIVE_LEVEL); 771 WCHAR VideoGuidBuf[512]; 772 ULONG cbVideoGuidBuf = sizeof (VideoGuidBuf); 773 NTSTATUS Status = vboxWddmRegQueryVideoGuidString(cbVideoGuidBuf, VideoGuidBuf, &cbVideoGuidBuf); 774 Assert(Status == STATUS_SUCCESS); 775 if (Status == STATUS_SUCCESS) 776 { 777 PWCHAR pBuf = (PWCHAR)vboxWddmMemAllocZero(cbVideoGuidBuf); 778 Assert(pBuf); 779 if (pBuf) 780 { 781 memcpy(pBuf, VideoGuidBuf, cbVideoGuidBuf); 782 RtlInitUnicodeString(&pDevExt->VideoGuid, pBuf); 783 return &pDevExt->VideoGuid; 784 } 785 } 786 787 return NULL; 788 } 789 790 VOID vboxWddmVGuidFree(PDEVICE_EXTENSION pDevExt) 791 { 792 if (pDevExt->VideoGuid.Buffer) 793 { 794 vboxWddmMemFree(pDevExt->VideoGuid.Buffer); 795 pDevExt->VideoGuid.Buffer = NULL; 796 } 797 } -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoMisc.h
r32823 r32930 93 93 NTSTATUS vboxWddmRegQueryValueDword(IN HANDLE hKey, IN PWCHAR pName, OUT PDWORD pDword); 94 94 NTSTATUS vboxWddmRegSetValueDword(IN HANDLE hKey, IN PWCHAR pName, OUT DWORD val); 95 96 UNICODE_STRING* vboxWddmVGuidGet(PDEVICE_EXTENSION pDevExt); 97 VOID vboxWddmVGuidFree(PDEVICE_EXTENSION pDevExt); 98 95 99 #endif /* #ifndef ___VBoxVideoMisc_h__ */ -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
r32915 r32930 475 475 PWCHAR pName = (PWCHAR)(((uint8_t*)pDevExt) + VBOXWDDM_ROUNDBOUND(sizeof (DEVICE_EXTENSION), 8)); 476 476 RtlInitUnicodeString(&pDevExt->RegKeyName, pName); 477 pName += (pDevExt->RegKeyName.Length + 2)/2;478 RtlInitUnicodeString(&pDevExt->VideoGuid, pName);479 477 #ifdef VBOXWDDM_RENDER_FROM_SHADOW 480 478 for (int i = 0; i < RT_ELEMENTS(pDevExt->aSources); ++i) … … 512 510 if (Status == STATUS_SUCCESS) 513 511 { 514 WCHAR VideoGuidBuf[512]; 515 ULONG cbVideoGuidBuf = sizeof (VideoGuidBuf); 516 517 Status = vboxWddmRegQueryVideoGuidString(cbVideoGuidBuf, VideoGuidBuf, &cbVideoGuidBuf); 518 Assert(Status == STATUS_SUCCESS); 519 if (Status == STATUS_SUCCESS) 520 { 521 pDevExt = (PDEVICE_EXTENSION)vboxWddmMemAllocZero(VBOXWDDM_ROUNDBOUND(sizeof (DEVICE_EXTENSION), 8) + cbRegKeyBuf + cbVideoGuidBuf); 522 if (pDevExt) 523 { 524 PWCHAR pName = (PWCHAR)(((uint8_t*)pDevExt) + VBOXWDDM_ROUNDBOUND(sizeof (DEVICE_EXTENSION), 8)); 525 memcpy(pName, RegKeyBuf, cbRegKeyBuf); 526 pName += cbRegKeyBuf/2; 527 memcpy(pName, VideoGuidBuf, cbVideoGuidBuf); 528 vboxWddmDevExtZeroinit(pDevExt, PhysicalDeviceObject); 529 *MiniportDeviceContext = pDevExt; 530 } 531 else 532 { 533 Status = STATUS_NO_MEMORY; 534 drprintf(("VBoxVideoWddm: ERROR, failed to create context\n")); 535 } 512 pDevExt = (PDEVICE_EXTENSION)vboxWddmMemAllocZero(VBOXWDDM_ROUNDBOUND(sizeof (DEVICE_EXTENSION), 8) + cbRegKeyBuf); 513 if (pDevExt) 514 { 515 PWCHAR pName = (PWCHAR)(((uint8_t*)pDevExt) + VBOXWDDM_ROUNDBOUND(sizeof (DEVICE_EXTENSION), 8)); 516 memcpy(pName, RegKeyBuf, cbRegKeyBuf); 517 vboxWddmDevExtZeroinit(pDevExt, PhysicalDeviceObject); 518 *MiniportDeviceContext = pDevExt; 519 } 520 else 521 { 522 Status = STATUS_NO_MEMORY; 523 drprintf(("VBoxVideoWddm: ERROR, failed to create context\n")); 536 524 } 537 525 } … … 567 555 { 568 556 PDEVICE_EXTENSION pContext = (PDEVICE_EXTENSION)MiniportDeviceContext; 557 558 vboxWddmVGuidGet(pContext); 569 559 570 560 /* Save DeviceHandle and function pointers supplied by the DXGKRNL_INTERFACE structure passed to DxgkInterface. */ … … 665 655 { 666 656 VbglTerminate(); 657 658 vboxWddmVGuidFree(pDevExt); 667 659 668 660 /* revert back to the state we were right after the DxgkDdiAddDevice */ … … 3438 3430 PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)hAdapter; 3439 3431 Assert((UINT)pDevExt->u.primary.cDisplays > pSetVidPnSourceAddress->VidPnSourceId); 3432 3433 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[pSetVidPnSourceAddress->VidPnSourceId]; 3434 Status= vboxWddmDisplaySettingsQueryPos(pDevExt, pSetVidPnSourceAddress->VidPnSourceId, &pSource->VScreenPos); 3435 Assert(Status == STATUS_SUCCESS); 3436 Status = STATUS_SUCCESS; 3437 3440 3438 if ((UINT)pDevExt->u.primary.cDisplays > pSetVidPnSourceAddress->VidPnSourceId) 3441 3439 { 3442 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[pSetVidPnSourceAddress->VidPnSourceId];3443 3440 PVBOXWDDM_ALLOCATION pAllocation; 3444 3441 Assert(pSetVidPnSourceAddress->hAllocation); … … 3463 3460 Assert(pAllocation->enmType == VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE 3464 3461 || pAllocation->enmType == VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC); 3462 3465 3463 if ( 3466 3464 #ifdef VBOXWDDM_RENDER_FROM_SHADOW … … 3473 3471 /* to ensure the resize request gets issued in case we exit a full-screen D3D mode */ 3474 3472 pSource->offVram = VBOXVIDEOOFFSET_VOID; 3475 #endif 3476 Status= vboxWddmDisplaySettingsQueryPos(pDevExt, pSetVidPnSourceAddress->VidPnSourceId, &pSource->VScreenPos); 3477 Assert(Status == STATUS_SUCCESS); 3473 #else 3478 3474 /* should not generally happen, but still inform host*/ 3479 3475 Status = vboxWddmGhDisplaySetInfo(pDevExt, pSource, pSetVidPnSourceAddress->VidPnSourceId); … … 3481 3477 if (Status != STATUS_SUCCESS) 3482 3478 drprintf((__FUNCTION__": vboxWddmGhDisplaySetInfo failed, Status (0x%x)\n", Status)); 3479 #endif 3483 3480 } 3484 3481 } … … 3517 3514 PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)hAdapter; 3518 3515 Assert((UINT)pDevExt->u.primary.cDisplays > pSetVidPnSourceVisibility->VidPnSourceId); 3516 3517 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[pSetVidPnSourceVisibility->VidPnSourceId]; 3518 Status= vboxWddmDisplaySettingsQueryPos(pDevExt, pSetVidPnSourceVisibility->VidPnSourceId, &pSource->VScreenPos); 3519 Assert(Status == STATUS_SUCCESS); 3520 Status = STATUS_SUCCESS; 3521 3519 3522 if ((UINT)pDevExt->u.primary.cDisplays > pSetVidPnSourceVisibility->VidPnSourceId) 3520 3523 { 3521 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[pSetVidPnSourceVisibility->VidPnSourceId];3522 3524 PVBOXWDDM_ALLOCATION pAllocation = pSource->pPrimaryAllocation; 3523 3525 if (pAllocation) … … 3541 3543 /* to ensure the resize request gets issued in case we exit a full-screen D3D mode */ 3542 3544 pSource->offVram = VBOXVIDEOOFFSET_VOID; 3543 #endif 3544 Status= vboxWddmDisplaySettingsQueryPos(pDevExt, pSetVidPnSourceVisibility->VidPnSourceId, &pSource->VScreenPos); 3545 Assert(Status == STATUS_SUCCESS); 3545 #else 3546 3546 Status = vboxWddmGhDisplaySetInfo(pDevExt, pSource, pSetVidPnSourceVisibility->VidPnSourceId); 3547 3547 Assert(Status == STATUS_SUCCESS); 3548 3548 if (Status != STATUS_SUCCESS) 3549 3549 drprintf((__FUNCTION__": vboxWddmGhDisplaySetInfo failed, Status (0x%x)\n", Status)); 3550 #endif 3550 3551 } 3551 3552 } … … 4717 4718 { 4718 4719 pDevExt->aSources[i].offVram = VBOXVIDEOOFFSET_VOID; 4719 Status= vboxWddmDisplaySettingsQueryPos(pDevExt, i, &pDevExt->aSources[i].VScreenPos);4720 Assert( Status == STATUS_SUCCESS);4720 NTSTATUS tmpStatus= vboxWddmDisplaySettingsQueryPos(pDevExt, i, &pDevExt->aSources[i].VScreenPos); 4721 Assert(tmpStatus == STATUS_SUCCESS); 4721 4722 } 4722 4723 }
Note:
See TracChangeset
for help on using the changeset viewer.