Changeset 37384 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Jun 8, 2011 3:09:14 PM (13 years ago)
- Location:
- trunk/src/VBox/Additions
- Files:
-
- 3 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 } -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/xpdm/VBoxMPDriver.cpp
r36896 r37384 26 26 27 27 /* Resource list */ 28 VIDEO_ACCESS_RANGE VBoxLegacyVGAResourceList[] = 28 VIDEO_ACCESS_RANGE VBoxLegacyVGAResourceList[] = 29 29 { 30 30 { 0x000003B0, 0x00000000, 0x0000000C, 1, 1, 1, 0 }, /* VGA regs (0x3B0-0x3BB) */ … … 106 106 ULONG vendorId = 0x80EE; 107 107 ULONG deviceId = 0xBEEF; 108 rc = VideoPortGetAccessRanges(pExt, 0, NULL, RT_ELEMENTS(tmpRanges), tmpRanges, 108 rc = VideoPortGetAccessRanges(pExt, 0, NULL, RT_ELEMENTS(tmpRanges), tmpRanges, 109 109 &vendorId, &deviceId, &slot); 110 110 } … … 142 142 } 143 143 144 /* @todo:pretend success to make the driver work. */144 /** @todo pretend success to make the driver work. */ 145 145 rc = NO_ERROR; 146 146 … … 281 281 } 282 282 283 /* Returns count of supported video modes and structure size in bytes, 283 /* Returns count of supported video modes and structure size in bytes, 284 284 * used to allocate buffer for the following IOCTL_VIDEO_QUERY_AVAIL_MODES call. 285 285 */ … … 350 350 STARTIO_IN(VIDEO_POINTER_POSITION, pPos); 351 351 352 /* @todo:set pointer position*/352 /** @todo set pointer position*/ 353 353 bResult = VBoxMPEnablePointer(pExt, TRUE, pStatus); 354 354 break; … … 439 439 uint32_t cRects = RequestPacket->InputBufferLength/sizeof(RTRECT); 440 440 /*Sanity check*/ 441 if (RequestPacket->InputBufferLength != cRects*sizeof(RTRECT)) 441 if ( cRects > _1M 442 || RequestPacket->InputBufferLength != cRects * sizeof(RTRECT)) 442 443 { 443 444 pStatus->Status = ERROR_INSUFFICIENT_BUFFER; … … 487 488 case IOCTL_VIDEO_HGSMI_HANDLER_DISABLE: 488 489 { 489 /* @todo:not implemented */490 /** @todo not implemented */ 490 491 break; 491 492 } … … 519 520 } 520 521 521 /* Called to set out hardware into desired power state, not supported at the moment. 522 /* Called to set out hardware into desired power state, not supported at the moment. 522 523 * Required to return NO_ERROR always. 523 524 */ -
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibSeamless.cpp
r37381 r37384 147 147 int rc; 148 148 149 AssertReturn(pRects || (cRects == 0), VERR_INVALID_PARAMETER); 150 AssertReturn(sizeof(VMMDevVideoSetVisibleRegion)+(cRects-1)*sizeof(RTRECT) 151 == sizeof(VMMDevVideoSetVisibleRegion)+(uint64_t)(cRects-1)*sizeof(RTRECT), VERR_INVALID_PARAMETER); 149 AssertReturn(pRects || cRects == 0, VERR_INVALID_PARAMETER); 150 AssertMsgReturn(cRects <= _1M, ("%u\n", cRects), VERR_OUT_OF_RANGE); 152 151 153 152 rc = vbglR3GRAlloc((VMMDevRequestHeader **)&pReq, 154 153 sizeof(VMMDevVideoSetVisibleRegion) 155 + cRects * sizeof(RTRECT) - sizeof(RTRECT), 154 + cRects * sizeof(RTRECT) 155 - sizeof(RTRECT), 156 156 VMMDevReq_VideoSetVisibleRegion); 157 157 if (RT_SUCCESS(rc))
Note:
See TracChangeset
for help on using the changeset viewer.