Skip to content

Commit 1a867a1

Browse files
[VIDEOPRT] fix incorrect status return
IntVideoPortMapMemory incorrectly returns a successful result if it failed to map video memory. This causes a bugcheck when using Virtualbox with guest additions with more than 128mb of vram assigned. This PR fixes the crash, however the desktop does not render correctly. Using videoprt.sys from Windows XP results in the same behavior after this commit.
1 parent c7d4040 commit 1a867a1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

win32ss/drivers/videoprt/resource.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ IntVideoPortMapMemory(
382382
{
383383
WARN_(VIDEOPRT, "IntVideoPortMapPhysicalMemory() failed! (0x%x)\n", NtStatus);
384384
if (Status)
385-
*Status = NO_ERROR;
385+
*Status = ERROR_NOT_ENOUGH_MEMORY;
386386
return NULL;
387387
}
388388
INFO_(VIDEOPRT, "Mapped user address = 0x%08x\n", MappedAddress);
@@ -426,7 +426,8 @@ IntVideoPortMapMemory(
426426
}
427427

428428
if (Status)
429-
*Status = NO_ERROR;
429+
*Status = ERROR_NOT_ENOUGH_MEMORY;
430+
ERR_(VIDEOPRT, "Couldn't map video memory. IoAddress: %lx, NumberOfUchars: %lx, InIoSpace: %x\n", IoAddress.u.LowPart, NumberOfUchars, InIoSpace);
430431

431432
return NULL;
432433
}

0 commit comments

Comments
 (0)