[XBOXVMP] Fix in VideoPortGetAccessRanges call: missing Slot parameter.

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!
This commit is contained in:
Hermès Bélusca-Maïto 2023-06-09 23:17:13 +02:00
parent bfd42c67a1
commit 61012eb544
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0

View file

@ -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;