Changeset 27988 in vbox
- Timestamp:
- Apr 5, 2010 6:39:38 PM (15 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp
r27984 r27988 1277 1277 { 1278 1278 VIDEO_MODE_INFORMATION *pCur = &pAllModes[i]; 1279 if (pResolution->cx == pAllModes[i PreferrableMode].VisScreenWidth1280 && pResolution->cy == pAllModes[i PreferrableMode].VisScreenHeight)1279 if (pResolution->cx == pAllModes[i].VisScreenWidth 1280 && pResolution->cy == pAllModes[i].VisScreenHeight) 1281 1281 { 1282 1282 if (pModes && cModes > cFound) 1283 {1284 1283 memcpy(&pModes[cFound], pCur, sizeof (VIDEO_MODE_INFORMATION)); 1285 ++pModes;1286 }1287 1284 else 1288 1285 Status = STATUS_BUFFER_TOO_SMALL; -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
r27984 r27988 2428 2428 bool bFreeModes = false; 2429 2429 VBoxWddmGetModesTable(pDevExt, /* PDEVICE_EXTENSION DeviceExtension */ 2430 false, /* bool bRebuildTable*/2430 true, /* bool bRebuildTable*/ 2431 2431 &pModes, /* VIDEO_MODE_INFORMATION ** ppModes*/ 2432 2432 &cModes, /* uint32_t * pcModes */ -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDisplay.cpp
r27955 r27988 214 214 /* Returns TRUE to try again. */ 215 215 static BOOL ResizeDisplayDevice( 216 #ifdef VBOXWDDM217 VBOXDISPLAYCONTEXT *pCtx, VBOXDISPLAY_DRIVER_TYPE enmType,218 #endif219 216 ULONG Id, DWORD Width, DWORD Height, DWORD BitsPerPixel 220 217 ) … … 399 396 Log(("ResizeDisplayDevice: EnumDisplaySettings last error %d\n", GetLastError ())); 400 397 } 401 402 #ifdef VBOXWDDM403 if (enmType == VBOXDISPLAY_DRIVER_TYPE_WDDM)404 vboxWddmReinitVideoModes(pCtx);405 #endif406 398 407 399 /* Assign the new rectangles to displays. */ … … 559 551 Log(("VBoxDisplayThread : Detected W2K or later.\n")); 560 552 553 #ifdef VBOXWDDM 554 if (enmDriverType == VBOXDISPLAY_DRIVER_TYPE_WDDM) 555 { 556 DWORD err = VBoxDispIfResize(&pCtx->pEnv->dispIf, 557 displayChangeRequest.display, 558 displayChangeRequest.xres, 559 displayChangeRequest.yres, 560 displayChangeRequest.bpp); 561 if (err == NO_ERROR) 562 { 563 Log(("VBoxDisplayThread : VBoxDispIfResize succeeded\n")); 564 break; 565 } 566 Log(("VBoxDisplayThread : VBoxDispIfResize failed err(%d)\n", err)); 567 } 568 #endif 561 569 /* W2K or later. */ 562 if (!ResizeDisplayDevice( 563 #ifdef VBOXWDDM 564 pCtx, enmDriverType , 565 #endif 566 displayChangeRequest.display, 570 if (!ResizeDisplayDevice(displayChangeRequest.display, 567 571 displayChangeRequest.xres, 568 572 displayChangeRequest.yres, -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxTray.cpp
r27955 r27988 628 628 } 629 629 630 static DWORD vboxDispIfSwitchToXPDM_NT4(PVBOXDISPIF pIf) 631 { 632 return NO_ERROR; 633 } 634 635 static DWORD vboxDispIfSwitchToXPDM(PVBOXDISPIF pIf) 636 { 637 DWORD err = NO_ERROR; 638 AssertBreakpoint(); 639 // OSVERSIONINFO OSinfo; 640 // OSinfo.dwOSVersionInfoSize = sizeof (OSinfo); 641 // GetVersionEx (&OSinfo); 642 // if (OSinfo.dwMajorVersion >= 5) 643 // { 644 // bool bSupported = true; 645 // *(uintptr_t *)&pIf->modeData.xpdm.pfnChangeDisplaySettingsEx = (uintptr_t)GetProcAddress(hUser, "ChangeDisplaySettingsExA"); 646 // Log((__FUNCTION__": pfnChangeDisplaySettingsEx = %p\n", pIf->modeData.xpdm.pfnChangeDisplaySettingsEx)); 647 // bSupported &= !!(pIf->modeData.xpdm.pfnChangeDisplaySettingsEx); 648 // 649 // if (!bSupported) 650 // { 651 // Log((__FUNCTION__": pfnChangeDisplaySettingsEx function pointer failed to initialize\n")); 652 // err = ERROR_NOT_SUPPORTED; 653 // } 654 // } 655 // else 656 // { 657 // Log((__FUNCTION__": can not switch to VBOXDISPIF_MODE_XPDM, because os is not >= w2k\n")); 658 // err = ERROR_NOT_SUPPORTED; 659 // } 660 661 return err; 662 } 663 664 static DWORD vboxDispIfSwitchToWDDM(PVBOXDISPIF pIf) 665 { 666 DWORD err = NO_ERROR; 667 OSVERSIONINFO OSinfo; 668 OSinfo.dwOSVersionInfoSize = sizeof (OSinfo); 669 GetVersionEx (&OSinfo); 670 if (OSinfo.dwMajorVersion >= 6) 671 { 672 /* this is vista and up */ 673 Log((__FUNCTION__": this is vista and up\n")); 674 HMODULE hGdi32 = GetModuleHandle("gdi32"); 675 if (hGdi32 != NULL) 676 { 677 bool bSupported = true; 678 pIf->modeData.wddm.pfnD3DKMTOpenAdapterFromHdc = (PFND3DKMT_OPENADAPTERFROMHDC)GetProcAddress(hGdi32, "D3DKMTOpenAdapterFromHdc"); 679 Log((__FUNCTION__"pfnD3DKMTOpenAdapterFromHdc = %p\n", pIf->modeData.wddm.pfnD3DKMTOpenAdapterFromHdc)); 680 bSupported &= !!(pIf->modeData.wddm.pfnD3DKMTOpenAdapterFromHdc); 681 682 pIf->modeData.wddm.pfnD3DKMTOpenAdapterFromGdiDisplayName = (PFND3DKMT_OPENADAPTERFROMGDIDISPLAYNAME)GetProcAddress(hGdi32, "D3DKMTOpenAdapterFromGdiDisplayName"); 683 Log((__FUNCTION__": pfnD3DKMTOpenAdapterFromGdiDisplayName = %p\n", pIf->modeData.wddm.pfnD3DKMTOpenAdapterFromGdiDisplayName)); 684 bSupported &= !!(pIf->modeData.wddm.pfnD3DKMTOpenAdapterFromGdiDisplayName); 685 686 pIf->modeData.wddm.pfnD3DKMTCloseAdapter = (PFND3DKMT_CLOSEADAPTER)GetProcAddress(hGdi32, "D3DKMTCloseAdapter"); 687 Log((__FUNCTION__": pfnD3DKMTCloseAdapter = %p\n", pIf->modeData.wddm.pfnD3DKMTCloseAdapter)); 688 bSupported &= !!(pIf->modeData.wddm.pfnD3DKMTCloseAdapter); 689 690 pIf->modeData.wddm.pfnD3DKMTEscape = (PFND3DKMT_ESCAPE)GetProcAddress(hGdi32, "D3DKMTEscape"); 691 Log((__FUNCTION__": pfnD3DKMTEscape = %p\n", pIf->modeData.wddm.pfnD3DKMTEscape)); 692 bSupported &= !!(pIf->modeData.wddm.pfnD3DKMTCloseAdapter); 693 694 pIf->modeData.wddm.pfnD3DKMTInvalidateActiveVidPn = (PFND3DKMT_INVALIDATEACTIVEVIDPN)GetProcAddress(hGdi32, "D3DKMTInvalidateActiveVidPn"); 695 Log((__FUNCTION__": pfnD3DKMTInvalidateActiveVidPn = %p\n", pIf->modeData.wddm.pfnD3DKMTInvalidateActiveVidPn)); 696 bSupported &= !!(pIf->modeData.wddm.pfnD3DKMTInvalidateActiveVidPn); 697 698 if (!bSupported) 699 { 700 Log((__FUNCTION__": one of pfnD3DKMT function pointers failed to initialize\n")); 701 err = ERROR_NOT_SUPPORTED; 702 } 703 } 704 else 705 { 706 Log((__FUNCTION__": GetModuleHandle(gdi32) failed, err(%d)\n", GetLastError())); 707 err = ERROR_NOT_SUPPORTED; 708 } 709 } 710 else 711 { 712 Log((__FUNCTION__": can not switch to VBOXDISPIF_MODE_WDDM, because os is not Vista or upper\n")); 713 err = ERROR_NOT_SUPPORTED; 714 } 715 716 return err; 717 } 718 630 719 DWORD VBoxDispIfSwitchMode(PVBOXDISPIF pIf, VBOXDISPIF_MODE enmMode, VBOXDISPIF_MODE *penmOldMode) 631 720 { … … 641 730 switch (enmMode) 642 731 { 732 case VBOXDISPIF_MODE_XPDM_NT4: 733 Log((__FUNCTION__": request to switch to VBOXDISPIF_MODE_XPDM_NT4\n")); 734 err = vboxDispIfSwitchToXPDM_NT4(pIf); 735 if (err == NO_ERROR) 736 { 737 Log((__FUNCTION__": successfully switched to XPDM_NT4 mode\n")); 738 pIf->enmMode = VBOXDISPIF_MODE_XPDM_NT4; 739 } 740 else 741 Log((__FUNCTION__": failed to switch to XPDM_NT4 mode, err (%d)\n", err)); 742 break; 643 743 case VBOXDISPIF_MODE_XPDM: 644 744 Log((__FUNCTION__": request to switch to VBOXDISPIF_MODE_XPDM\n")); 645 pIf->enmMode = VBOXDISPIF_MODE_XPDM; 745 err = vboxDispIfSwitchToXPDM(pIf); 746 if (err == NO_ERROR) 747 { 748 Log((__FUNCTION__": successfully switched to XPDM mode\n")); 749 pIf->enmMode = VBOXDISPIF_MODE_XPDM; 750 } 751 else 752 Log((__FUNCTION__": failed to switch to XPDM mode, err (%d)\n", err)); 646 753 break; 647 754 #ifdef VBOXWDDM … … 649 756 { 650 757 Log((__FUNCTION__": request to switch to VBOXDISPIF_MODE_WDDM\n")); 651 OSVERSIONINFO OSinfo; 652 OSinfo.dwOSVersionInfoSize = sizeof (OSinfo); 653 GetVersionEx (&OSinfo); 654 if (OSinfo.dwMajorVersion >= 6) 655 { 656 /* this is vista and up */ 657 Log((__FUNCTION__": this is vista and up\n")); 658 HMODULE hGdi32 = GetModuleHandle("gdi32"); 659 if (hGdi32 != NULL) 660 { 661 bool bSupported = true; 662 pIf->modeData.wddm.pfnD3DKMTOpenAdapterFromHdc = (PFND3DKMT_OPENADAPTERFROMHDC)GetProcAddress(hGdi32, "D3DKMTOpenAdapterFromHdc"); 663 Log((__FUNCTION__"pfnD3DKMTOpenAdapterFromHdc = %p\n", pIf->modeData.wddm.pfnD3DKMTOpenAdapterFromHdc)); 664 bSupported &= !!(pIf->modeData.wddm.pfnD3DKMTOpenAdapterFromHdc); 665 666 pIf->modeData.wddm.pfnD3DKMTOpenAdapterFromGdiDisplayName = (PFND3DKMT_OPENADAPTERFROMGDIDISPLAYNAME)GetProcAddress(hGdi32, "D3DKMTOpenAdapterFromGdiDisplayName"); 667 Log((__FUNCTION__": pfnD3DKMTOpenAdapterFromGdiDisplayName = %p\n", pIf->modeData.wddm.pfnD3DKMTOpenAdapterFromGdiDisplayName)); 668 bSupported &= !!(pIf->modeData.wddm.pfnD3DKMTOpenAdapterFromGdiDisplayName); 669 670 pIf->modeData.wddm.pfnD3DKMTCloseAdapter = (PFND3DKMT_CLOSEADAPTER)GetProcAddress(hGdi32, "D3DKMTCloseAdapter"); 671 Log((__FUNCTION__": pfnD3DKMTCloseAdapter = %p\n", pIf->modeData.wddm.pfnD3DKMTCloseAdapter)); 672 bSupported &= !!(pIf->modeData.wddm.pfnD3DKMTCloseAdapter); 673 674 pIf->modeData.wddm.pfnD3DKMTEscape = (PFND3DKMT_ESCAPE)GetProcAddress(hGdi32, "D3DKMTEscape"); 675 Log((__FUNCTION__": pfnD3DKMTEscape = %p\n", pIf->modeData.wddm.pfnD3DKMTEscape)); 676 bSupported &= !!(pIf->modeData.wddm.pfnD3DKMTCloseAdapter); 677 678 if (bSupported) 679 pIf->enmMode = VBOXDISPIF_MODE_WDDM; 680 else 681 { 682 Log((__FUNCTION__": one of pfnD3DKMT function pointers failed to initialize\n")); 683 err = ERROR_NOT_SUPPORTED; 684 } 685 } 686 else 687 { 688 Log((__FUNCTION__": GetModuleHandle(gdi32) failed, err(%d)\n", GetLastError())); 689 err = ERROR_NOT_SUPPORTED; 690 } 758 err = vboxDispIfSwitchToWDDM(pIf); 759 if (err == NO_ERROR) 760 { 761 Log((__FUNCTION__": successfully switched to WDDM mode\n")); 762 pIf->enmMode = VBOXDISPIF_MODE_WDDM; 691 763 } 692 764 else 693 { 694 Log((__FUNCTION__": can not switch to VBOXDISPIF_MODE_WDDM, because os is not Vista or upper\n")); 695 err = ERROR_NOT_SUPPORTED; 696 } 765 Log((__FUNCTION__": failed to switch to WDDM mode, err (%d)\n", err)); 697 766 break; 698 767 } … … 726 795 727 796 #ifdef VBOXWDDM 728 static DWORD vboxDispIfEscapeWDDM(PCVBOXDISPIF pIf, PVBOXDISPIFESCAPE pEscape, int cbData) 797 typedef DECLCALLBACK(BOOLEAN) FNVBOXDISPIFWDDM_ADAPTEROP(PCVBOXDISPIF pIf, D3DKMT_HANDLE hAdapter, LPCWSTR pDevName, PVOID pContext); 798 typedef FNVBOXDISPIFWDDM_ADAPTEROP *PFNVBOXDISPIFWDDM_ADAPTEROP; 799 static DWORD vboxDispIfWDDMAdapterOp(PCVBOXDISPIF pIf, LPCWSTR pDevName, PFNVBOXDISPIFWDDM_ADAPTEROP pfnOp, PVOID pContext) 729 800 { 730 801 D3DKMT_OPENADAPTERFROMGDIDISPLAYNAME OpenAdapterData = {0}; 731 wcscpy(OpenAdapterData.DeviceName, L"\\\\.\\DISPLAY1"); 732 802 wcsncpy(OpenAdapterData.DeviceName, pDevName, RT_ELEMENTS(OpenAdapterData.DeviceName) - 1 /* the last one is always \0 */); 733 803 DWORD err = ERROR_GEN_FAILURE; 734 804 NTSTATUS Status = pIf->modeData.wddm.pfnD3DKMTOpenAdapterFromGdiDisplayName(&OpenAdapterData); 735 805 if (!Status) 736 806 { 737 D3DKMT_ESCAPE EscapeData = {0}; 738 EscapeData.hAdapter = OpenAdapterData.hAdapter; 739 //EscapeData.hDevice = NULL; 740 EscapeData.Type = D3DKMT_ESCAPE_DRIVERPRIVATE; 741 EscapeData.Flags.HardwareAccess = 1; 742 EscapeData.pPrivateDriverData = pEscape; 743 EscapeData.PrivateDriverDataSize = VBOXDISPIFESCAPE_SIZE(cbData); 744 //EscapeData.hContext = NULL; 745 746 Status = pIf->modeData.wddm.pfnD3DKMTEscape(&EscapeData); 747 if (!Status) 807 BOOLEAN bCloseAdapter = pfnOp(pIf, OpenAdapterData.hAdapter, OpenAdapterData.DeviceName, pContext); 808 809 if (bCloseAdapter) 810 { 811 D3DKMT_CLOSEADAPTER ClosaAdapterData = {0}; 812 ClosaAdapterData.hAdapter = OpenAdapterData.hAdapter; 813 Status = pIf->modeData.wddm.pfnD3DKMTCloseAdapter(&ClosaAdapterData); 814 if (Status) 815 { 816 Log((__FUNCTION__": pfnD3DKMTCloseAdapter failed, Status (0x%x)\n", Status)); 817 /* ignore */ 818 Status = 0; 819 } 820 } 821 } 822 else 823 Log((__FUNCTION__": pfnD3DKMTOpenAdapterFromGdiDisplayName failed, Status (0x%x)\n", Status)); 824 825 return err; 826 } 827 828 typedef struct 829 { 830 NTSTATUS Status; 831 PVBOXDISPIFESCAPE pEscape; 832 int cbData; 833 } VBOXDISPIFWDDM_ESCAPEOP_CONTEXT, *PVBOXDISPIFWDDM_ESCAPEOP_CONTEXT; 834 835 DECLCALLBACK(BOOLEAN) vboxDispIfEscapeWDDMOp(PCVBOXDISPIF pIf, D3DKMT_HANDLE hAdapter, LPCWSTR pDevName, PVOID pContext) 836 { 837 PVBOXDISPIFWDDM_ESCAPEOP_CONTEXT pCtx = (PVBOXDISPIFWDDM_ESCAPEOP_CONTEXT)pContext; 838 839 D3DKMT_ESCAPE EscapeData = {0}; 840 EscapeData.hAdapter = hAdapter; 841 //EscapeData.hDevice = NULL; 842 EscapeData.Type = D3DKMT_ESCAPE_DRIVERPRIVATE; 843 EscapeData.Flags.HardwareAccess = 1; 844 EscapeData.pPrivateDriverData = pCtx->pEscape; 845 EscapeData.PrivateDriverDataSize = VBOXDISPIFESCAPE_SIZE(pCtx->cbData); 846 //EscapeData.hContext = NULL; 847 848 pCtx->Status = pIf->modeData.wddm.pfnD3DKMTEscape(&EscapeData); 849 850 return TRUE; 851 } 852 853 static DWORD vboxDispIfEscapeWDDM(PCVBOXDISPIF pIf, PVBOXDISPIFESCAPE pEscape, int cbData) 854 { 855 VBOXDISPIFWDDM_ESCAPEOP_CONTEXT Ctx = {0}; 856 Ctx.pEscape = pEscape; 857 Ctx.cbData = cbData; 858 DWORD err = vboxDispIfWDDMAdapterOp(pIf, L"\\\\.\\DISPLAY1", vboxDispIfEscapeWDDMOp, &Ctx); 859 if (err == NO_ERROR) 860 { 861 if (!Ctx.Status) 748 862 err = NO_ERROR; 749 863 else 750 864 { 751 if ( Status == 0xC00000BBL) /* not supported */865 if (Ctx.Status == 0xC00000BBL) /* not supported */ 752 866 err = ERROR_NOT_SUPPORTED; 753 Log((__FUNCTION__": pfnD3DKMTEscape failed, Status (0x%x)\n", Status)); 754 } 755 756 D3DKMT_CLOSEADAPTER ClosaAdapterData = {0}; 757 ClosaAdapterData.hAdapter = OpenAdapterData.hAdapter; 758 Status = pIf->modeData.wddm.pfnD3DKMTCloseAdapter(&ClosaAdapterData); 759 if (Status) 760 Log((__FUNCTION__": pfnD3DKMTCloseAdapter failed, Status (0x%x)\n", Status)); 867 else 868 err = ERROR_GEN_FAILURE; 869 Log((__FUNCTION__": pfnD3DKMTEscape failed, Status (0x%x)\n", Ctx.Status)); 870 } 761 871 } 762 872 else 763 Log((__FUNCTION__": pfnD3DKMTOpenAdapterFromGdiDisplayName failed, Status (0x%x)\n", Status));873 Log((__FUNCTION__": vboxDispIfWDDMAdapterOp failed, err (%d)\n", err)); 764 874 765 875 return err; 766 876 } 877 878 typedef struct 879 { 880 NTSTATUS Status; 881 VBOXWDDM_RECOMMENDVIDPN_SCREEN_INFO Info; 882 } VBOXDISPIFWDDM_RESIZEOP_CONTEXT, *PVBOXDISPIFWDDM_RESIZEOP_CONTEXT; 883 884 DECLCALLBACK(BOOLEAN) vboxDispIfResizeWDDMOp(PCVBOXDISPIF pIf, D3DKMT_HANDLE hAdapter, LPCWSTR pDevName, PVOID pContext) 885 { 886 PVBOXDISPIFWDDM_RESIZEOP_CONTEXT pCtx = (PVBOXDISPIFWDDM_RESIZEOP_CONTEXT)pContext; 887 888 D3DKMT_INVALIDATEACTIVEVIDPN IAVidPnData = {0}; 889 uint32_t cbData = VBOXWDDM_RECOMMENDVIDPN_SIZE(1); 890 PVBOXWDDM_RECOMMENDVIDPN pData = (PVBOXWDDM_RECOMMENDVIDPN)malloc(cbData); 891 if (pData) 892 { 893 memset(pData, 0, cbData); 894 pData->cScreenInfos = 1; 895 memcpy(&pData->aScreenInfos[0], &pCtx->Info, sizeof (VBOXWDDM_RECOMMENDVIDPN_SCREEN_INFO)); 896 897 IAVidPnData.hAdapter = hAdapter; 898 IAVidPnData.pPrivateDriverData = pData; 899 IAVidPnData.PrivateDriverDataSize = cbData; 900 901 pCtx->Status = pIf->modeData.wddm.pfnD3DKMTInvalidateActiveVidPn(&IAVidPnData); 902 if (pCtx->Status) 903 Log((__FUNCTION__": pfnD3DKMTInvalidateActiveVidPn failed, Status (0x%x)\n", pCtx->Status)); 904 905 free(pData); 906 } 907 else 908 { 909 Log((__FUNCTION__": malloc failed\n")); 910 pCtx->Status = -1; 911 } 912 913 return TRUE; 914 } 915 916 static DWORD vboxDispIfResizeWDDM(PCVBOXDISPIF const pIf, ULONG Id, DWORD Width, DWORD Height, DWORD BitsPerPixel) 917 { 918 VBOXDISPIFWDDM_RESIZEOP_CONTEXT Ctx = {0}; 919 Ctx.Info.Id = Id; 920 Ctx.Info.Width = Width; 921 Ctx.Info.Height = Height; 922 Ctx.Info.BitsPerPixel = BitsPerPixel; 923 DWORD err = vboxDispIfWDDMAdapterOp(pIf, L"\\\\.\\DISPLAY1", vboxDispIfResizeWDDMOp, &Ctx); 924 if (err == NO_ERROR) 925 { 926 if (!Ctx.Status) 927 err = NO_ERROR; 928 else 929 { 930 if (Ctx.Status == 0xC00000BBL) /* not supported */ 931 err = ERROR_NOT_SUPPORTED; 932 else 933 err = ERROR_GEN_FAILURE; 934 Log((__FUNCTION__": vboxDispIfResizeWDDMOp failed, Status (0x%x)\n", Ctx.Status)); 935 } 936 } 937 else 938 Log((__FUNCTION__": vboxDispIfWDDMAdapterOp failed, err (%d)\n", err)); 939 940 return err; 941 } 767 942 #endif 768 943 … … 771 946 switch (pIf->enmMode) 772 947 { 948 case VBOXDISPIF_MODE_XPDM_NT4: 773 949 case VBOXDISPIF_MODE_XPDM: 774 950 return vboxDispIfEscapeXPDM(pIf, pEscape, cbData); … … 782 958 } 783 959 } 960 961 static DWORD vboxDispIfResizeXPDM(PCVBOXDISPIF const pIf, LPCSTR lpszDeviceName, LPDEVMODE lpDevMode, LONG *pResult) 962 { 963 SetLastError(NO_ERROR); 964 *pResult = pIf->modeData.xpdm.pfnChangeDisplaySettingsEx(lpszDeviceName, 965 lpDevMode, NULL, lpDevMode ? (CDS_NORESET | CDS_UPDATEREGISTRY) : 0, NULL); 966 return GetLastError(); 967 } 968 969 DWORD VBoxDispIfResize(PCVBOXDISPIF const pIf, ULONG Id, DWORD Width, DWORD Height, DWORD BitsPerPixel) 970 { 971 switch (pIf->enmMode) 972 { 973 case VBOXDISPIF_MODE_XPDM_NT4: 974 return ERROR_NOT_SUPPORTED; 975 case VBOXDISPIF_MODE_XPDM: 976 // return vboxDispIfResizeXPDM(pIf, lpszDeviceName, lpDevMode, pResult); 977 return ERROR_NOT_SUPPORTED; 978 #ifdef VBOXWDDM 979 case VBOXDISPIF_MODE_WDDM: 980 return vboxDispIfResizeWDDM(pIf, Id, Width, Height, BitsPerPixel); 981 #endif 982 default: 983 Log((__FUNCTION__": unknown mode (%d)\n", pIf->enmMode)); 984 return ERROR_INVALID_PARAMETER; 985 } 986 } -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxTray.h
r27984 r27988 50 50 typedef enum 51 51 { 52 VBOXDISPIF_MODE_UNKNOWN = 0, 53 VBOXDISPIF_MODE_XPDM = 1 52 VBOXDISPIF_MODE_UNKNOWN = 0, 53 VBOXDISPIF_MODE_XPDM_NT4 = 1, 54 VBOXDISPIF_MODE_XPDM 54 55 #ifdef VBOXWDDM 55 , VBOXDISPIF_MODE_WDDM = 256 , VBOXDISPIF_MODE_WDDM 56 57 #endif 57 58 } VBOXDISPIF_MODE; … … 73 74 struct 74 75 { 76 LONG (WINAPI * pfnChangeDisplaySettingsEx)(LPCSTR lpszDeviceName, LPDEVMODE lpDevMode, HWND hwnd, DWORD dwflags, LPVOID lParam); 77 } xpdm; 78 79 struct 80 { 75 81 /* open adapter */ 76 82 PFND3DKMT_OPENADAPTERFROMHDC pfnD3DKMTOpenAdapterFromHdc; … … 80 86 /* escape */ 81 87 PFND3DKMT_ESCAPE pfnD3DKMTEscape; 88 /* auto resize support */ 82 89 PFND3DKMT_INVALIDATEACTIVEVIDPN pfnD3DKMTInvalidateActiveVidPn; 83 90 } wddm; … … 95 102 DWORD VBoxDispIfTerm(PVBOXDISPIF pIf); 96 103 DWORD VBoxDispIfEscape(PCVBOXDISPIF const pIf, PVBOXDISPIFESCAPE pEscape, int cbData); 104 DWORD VBoxDispIfResize(PCVBOXDISPIF const pIf, ULONG Id, DWORD Width, DWORD Height, DWORD BitsPerPixel); 97 105 98 106 /* The environment information for services. */ -
trunk/src/VBox/Additions/WINNT/include/VBoxDisplay.h
r27955 r27988 24 24 #ifdef VBOXWDDM 25 25 # define VBOXESC_REINITVIDEOMODES 0xABCD9003 26 27 typedef struct 28 { 29 ULONG Id; 30 DWORD Width; 31 DWORD Height; 32 DWORD BitsPerPixel; 33 } VBOXWDDM_RECOMMENDVIDPN_SCREEN_INFO, *PVBOXWDDM_RECOMMENDVIDPN_SCREEN_INFO; 34 35 typedef struct 36 { 37 uint32_t cScreenInfos; 38 VBOXWDDM_RECOMMENDVIDPN_SCREEN_INFO aScreenInfos[1]; 39 } VBOXWDDM_RECOMMENDVIDPN, *PVBOXWDDM_RECOMMENDVIDPN; 40 41 #define VBOXWDDM_RECOMMENDVIDPN_SIZE(_c) (RT_OFFSETOF(VBOXWDDM_RECOMMENDVIDPN, aScreenInfos[_c])) 26 42 #endif /* #ifdef VBOXWDDM */ 27 43
Note:
See TracChangeset
for help on using the changeset viewer.