Skip to content

Commit

Permalink
[XBOXVMP] Fix in VideoPortGetAccessRanges call: missing Slot parameter.
Browse files Browse the repository at this point in the history
Contrary to what is (badly) written on MSDN, this parameter is
*mandatory* when the ranges looked for are on a PCI adapter.

Detected when testing with MS Windows' videoprt.sys on XBOX emulator;
thanks to Simone Lombardo for assistance!
  • Loading branch information
HBelusca committed Jun 14, 2023
1 parent bfd42c6 commit 61012eb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions win32ss/drivers/miniport/xboxvmp/xboxvmp.c
Expand Up @@ -61,18 +61,20 @@ XboxVmpFindAdapter(
OUT PUCHAR Again)
{
PXBOXVMP_DEVICE_EXTENSION XboxVmpDeviceExtension;
VIDEO_ACCESS_RANGE AccessRanges[3];
VP_STATUS Status;
VIDEO_ACCESS_RANGE AccessRanges[2];
USHORT VendorId = 0x10DE; /* NVIDIA Corporation */
USHORT DeviceId = 0x02A0; /* NV2A XGPU */
ULONG Slot = 0;

TRACE_(IHVVIDEO, "XboxVmpFindAdapter\n");

XboxVmpDeviceExtension = (PXBOXVMP_DEVICE_EXTENSION)HwDeviceExtension;

Status = VideoPortGetAccessRanges(HwDeviceExtension, 0, NULL, 3, AccessRanges,
&VendorId, &DeviceId, NULL);

VideoPortZeroMemory(&AccessRanges, sizeof(AccessRanges));
Status = VideoPortGetAccessRanges(HwDeviceExtension, 0, NULL,
RTL_NUMBER_OF(AccessRanges), AccessRanges,
&VendorId, &DeviceId, &Slot);
if (Status == NO_ERROR)
{
XboxVmpDeviceExtension->PhysControlStart = AccessRanges[0].RangeStart;
Expand Down

0 comments on commit 61012eb

Please sign in to comment.