- Timestamp:
- Aug 24, 2007 12:42:00 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp
r4150 r4342 1276 1276 } 1277 1277 1278 case IOCTL_VIDEO_SHARE_VIDEO_MEMORY: 1279 { 1280 PVIDEO_SHARE_MEMORY pShareMemory; 1281 PVIDEO_SHARE_MEMORY_INFORMATION pShareMemoryInformation; 1282 PHYSICAL_ADDRESS shareAddress; 1283 PVOID virtualAddress; 1284 ULONG sharedViewSize; 1285 ULONG inIoSpace = 0; 1286 VP_STATUS status; 1287 1288 dprintf(("IOCTL_VIDEO_SHARE_VIDEO_MEMORY\n")); 1289 1290 if ( (RequestPacket->OutputBufferLength < sizeof(VIDEO_SHARE_MEMORY_INFORMATION)) 1291 || (RequestPacket->InputBufferLength < sizeof(VIDEO_MEMORY)) ) { 1292 1293 dprintf(("IOCTL_VIDEO_SHARE_VIDEO_MEMORY: ERROR_INSUFFICIENT_BUFFER\n")); 1294 RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER; 1295 Result = FALSE; 1296 break; 1297 } 1298 1299 pShareMemory = (PVIDEO_SHARE_MEMORY)RequestPacket->InputBuffer; 1300 1301 if ( (pShareMemory->ViewOffset > pDevExt->ulFrameBufferSize) 1302 || ((pShareMemory->ViewOffset + pShareMemory->ViewSize) > pDevExt->ulFrameBufferSize) ) { 1303 1304 dprintf(("IOCTL_VIDEO_SHARE_VIDEO_MEMORY - ERROR_INVALID_PARAMETER\n")); 1305 RequestPacket->StatusBlock->Status = ERROR_INVALID_PARAMETER; 1306 Result = FALSE; 1307 break; 1308 } 1309 1310 RequestPacket->StatusBlock->Information = sizeof(VIDEO_SHARE_MEMORY_INFORMATION); 1311 1312 virtualAddress = pShareMemory->ProcessHandle; 1313 sharedViewSize = pShareMemory->ViewSize; 1314 1315 shareAddress.QuadPart = VBE_DISPI_LFB_PHYSICAL_ADDRESS + pDevExt->ulFrameBufferOffset; 1316 1317 status = !!VideoPortMapMemory(HwDeviceExtension, shareAddress, &sharedViewSize, &inIoSpace, &virtualAddress); 1318 if (status != NO_ERROR) 1319 dprintf(("VideoPortMapMemory failed with %x\n", status)); 1320 Result = (status == NO_ERROR); 1321 1322 pShareMemoryInformation = (PVIDEO_SHARE_MEMORY_INFORMATION)RequestPacket->OutputBuffer; 1323 pShareMemoryInformation->SharedViewOffset = pShareMemory->ViewOffset; 1324 pShareMemoryInformation->VirtualAddress = virtualAddress; 1325 pShareMemoryInformation->SharedViewSize = sharedViewSize; 1326 break; 1327 } 1328 1329 case IOCTL_VIDEO_UNSHARE_VIDEO_MEMORY: 1330 { 1331 PVIDEO_SHARE_MEMORY pShareMemory; 1332 VP_STATUS status; 1333 1334 dprintf(("IOCTL_VIDEO_UNSHARE_VIDEO_MEMORY\n")); 1335 1336 if (RequestPacket->InputBufferLength < sizeof(VIDEO_SHARE_MEMORY)) 1337 { 1338 RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER; 1339 Result = FALSE; 1340 break; 1341 } 1342 1343 pShareMemory = (PVIDEO_SHARE_MEMORY)RequestPacket->InputBuffer; 1344 1345 status = VideoPortUnmapMemory(HwDeviceExtension, pShareMemory->RequestedVirtualAddress, pShareMemory->ProcessHandle); 1346 if (status != NO_ERROR) 1347 dprintf(("VideoPortUnmapMemory failed with %x\n", status)); 1348 Result = (status == NO_ERROR); 1349 break; 1350 } 1351 1278 1352 /* 1279 1353 * The display driver asks us how many video modes we support … … 1856 1930 StatusBlock->Information = sizeof(VIDEO_MEMORY_INFORMATION); 1857 1931 1932 /* Save the new framebuffer size */ 1933 DeviceExtension->ulFrameBufferSize = MapInformation->FrameBufferLength; 1858 1934 return TRUE; 1859 1935 }
Note:
See TracChangeset
for help on using the changeset viewer.