https://git.reactos.org/?p=reactos.git;a=commitdiff;h=61012eb544ebb12ffe878…
commit 61012eb544ebb12ffe878376af8c700ed6577cf0
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Fri Jun 9 23:17:13 2023 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Wed Jun 14 12:10:55 2023 +0200
[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!
---
win32ss/drivers/miniport/xboxvmp/xboxvmp.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/win32ss/drivers/miniport/xboxvmp/xboxvmp.c
b/win32ss/drivers/miniport/xboxvmp/xboxvmp.c
index 3ead664dda1..5cf76e08b12 100644
--- a/win32ss/drivers/miniport/xboxvmp/xboxvmp.c
+++ b/win32ss/drivers/miniport/xboxvmp/xboxvmp.c
@@ -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;