Changeset 37384 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/xpdm
- Timestamp:
- Jun 8, 2011 3:09:14 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/xpdm/VBoxDispDriver.cpp
r37335 r37384 135 135 { 136 136 ULONG cnt=0; 137 137 138 138 while (*pwcs!=*L"") 139 139 { … … 181 181 memset(_font.lfFaceName, 0, sizeof(_font.lfFaceName)); \ 182 182 memcpy(_font.lfFaceName, _name, sizeof(_name)); \ 183 } while (0) 183 } while (0) 184 184 185 185 static int VBoxDispInitDevice(PVBOXDISPDEV pDev, DEVMODEW *pdm, GDIINFO *pGdiInfo, DEVINFO *pDevInfo) … … 286 286 pGdiInfo->ulNumPalReg = (pDev->mode.ulBitsPerPel==8) ? (1<<pDev->mode.ulBitsPerPel) : 0; 287 287 288 /* @todo: might want to implement IOCTL_VIDEO_QUERY_COLOR_CAPABILITIES in miniport driver 288 /* @todo: might want to implement IOCTL_VIDEO_QUERY_COLOR_CAPABILITIES in miniport driver 289 289 * and query host for this info there 290 290 */ … … 343 343 pDevInfo->flGraphicsCaps |= GCAPS_DIRECTDRAW; 344 344 #endif 345 VBOXDISPMAKELOGFONTW(pDevInfo->lfDefaultFont, 345 VBOXDISPMAKELOGFONTW(pDevInfo->lfDefaultFont, 346 346 16, 7, FW_BOLD, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, VARIABLE_PITCH, L"System"); 347 347 … … 383 383 384 384 LOGF_LEAVE(); 385 return rc; 385 return rc; 386 386 } 387 387 … … 442 442 } 443 443 444 /* Returns video modes supported by our device/driver 444 /* Returns video modes supported by our device/driver 445 445 * Note: If we fail here we'd be asked to enter 800x600@4bpp mode later in VBoxDispDrvEnablePDEV. 446 446 */ … … 492 492 * Returns pointer to our driver private info structure which would be passed by GDI to our other callbacks. 493 493 */ 494 DHPDEV APIENTRY 494 DHPDEV APIENTRY 495 495 VBoxDispDrvEnablePDEV(DEVMODEW *pdm, LPWSTR pwszLogAddress, ULONG cPat, HSURF *phsurfPatterns, 496 496 ULONG cjCaps, ULONG *pdevcaps, … … 671 671 size.cy = pDev->mode.ulHeight; 672 672 673 pDev->surface.hBitmap = EngCreateBitmap(size, pDev->mode.lScanlineStride, iFormat, 673 pDev->surface.hBitmap = EngCreateBitmap(size, pDev->mode.lScanlineStride, iFormat, 674 674 pDev->mode.lScanlineStride>0 ? BMF_TOPDOWN:0, 675 675 pDev->memInfo.FrameBufferBase); … … 938 938 LOGF(("VBOXESC_SETVISIBLEREGION")); 939 939 LPRGNDATA lpRgnData = (LPRGNDATA)pvIn; 940 941 if (cjIn >= sizeof(RGNDATAHEADER) 940 DWORD cRects; 941 942 if ( cjIn >= sizeof(RGNDATAHEADER) 942 943 && pvIn 943 944 && lpRgnData->rdh.dwSize == sizeof(RGNDATAHEADER) 944 945 && lpRgnData->rdh.iType == RDH_RECTANGLES 945 && cjIn == ((uint64_t)lpRgnData->rdh.nCount) * sizeof(RECT) + sizeof(RGNDATAHEADER)) 946 { 946 && (cRects = lpRgnData->rdh.nCount) <= _1M 947 && cjIn == cRects * (uint64_t)sizeof(RECT) + sizeof(RGNDATAHEADER)) 948 { 949 /** @todo this whole conversion thing could maybe be skipped 950 * since RTRECT matches the RECT layout. */ 951 #if 0 952 AssertCompile(sizeof(RTRECT) == sizeof(RECT)); 953 AssertCompileMembersSameSizeAndOffset(RTRECT, xLeft, RECT, left); 954 AssertCompileMembersSameSizeAndOffset(RTRECT, xBottom, RECT, bottom); 955 AssertCompileMembersSameSizeAndOffset(RTRECT, xRight, RECT, right); 956 AssertCompileMembersSameSizeAndOffset(RTRECT, xTop, RECT, top); 957 958 rc = VBoxDispMPSetVisibleRegion(pDev->hDriver, (PRTRECT)&lpRgnData->Buffer[0], cRects); 959 VBOX_WARNRC(rc); 960 #else 947 961 DWORD i; 948 962 PRTRECT pRTRect; … … 950 964 RECT *pRect = (RECT *)&lpRgnData->Buffer; 951 965 952 pRTRect = (PRTRECT) EngAllocMem(0, lpRgnData->rdh.nCount*sizeof(RTRECT), MEM_ALLOC_TAG);966 pRTRect = (PRTRECT) EngAllocMem(0, cRects*sizeof(RTRECT), MEM_ALLOC_TAG); 953 967 if (!pRTRect) 954 968 { 955 WARN(("failed to allocate %d bytes", lpRgnData->rdh.nCount*sizeof(RTRECT)));969 WARN(("failed to allocate %d bytes", cRects*sizeof(RTRECT))); 956 970 break; 957 971 } 958 972 959 for (i =0; i<lpRgnData->rdh.nCount; ++i)973 for (i = 0; i < cRects; ++i) 960 974 { 961 975 LOG(("New visible rectangle (%d,%d) (%d,%d)", … … 967 981 } 968 982 969 rc = VBoxDispMPSetVisibleRegion(pDev->hDriver, pRTRect, lpRgnData->rdh.nCount);983 rc = VBoxDispMPSetVisibleRegion(pDev->hDriver, pRTRect, cRects); 970 984 VBOX_WARNRC(rc); 971 985 972 986 EngFreeMem(pRTRect); 973 987 988 #endif 974 989 if (RT_SUCCESS(rc)) 975 990 { … … 983 998 { 984 999 WARN(("check failed rdh.dwSize=%x iType=%d size=%d expected size=%d", 985 lpRgnData->rdh.dwSize, lpRgnData->rdh.iType, cjIn, 1000 lpRgnData->rdh.dwSize, lpRgnData->rdh.iType, cjIn, 986 1001 lpRgnData->rdh.nCount * sizeof(RECT) + sizeof(RGNDATAHEADER))); 987 1002 }
Note:
See TracChangeset
for help on using the changeset viewer.