Read PCI Device Vendor ID

My x64 port of InpOut32
Post Reply
joechen882000
New User
Posts: 2
Joined: Thu Apr 11, 2019 7:20 am

Read PCI Device Vendor ID

Post by joechen882000 » Thu Apr 11, 2019 7:30 am

I try to use InpOut32 to read the PCI Vendor ID but can't get correct data throught inpOut32.dll
My code please refer below(C#) , Read the RTC Port is ok , But Read/Write the PCI config register get nothing ....

uint Bus_No = 0, Dev = 0, Func1 = 0, VID, DID, count = 0;
uint Val = 0x80000000 + (Bus_No << 16) + (Dev << 11) + ( Func1 << 8 ) ;
uint Rt_Val;
if (IsInpOutDriverOpen_x64() == 1)
{
/* Read PCI Register */
DlPortWritePortUlong_x64(0x0cf8, Val);
Rt_Val = DlPortReadPortUlong_x64(0x0cfc);
Console.WriteLine(Rt_Val.ToString("x")); /* Get 0 */

/* Read RTC Time */
Out32_x64(0x70, 0x00);
uint sec = Inp32_x64(0x71);
Out32_x64(0x70, 0x02);
uint min = Inp32_x64(0x71);
Out32_x64(0x70, 0x04);
uint hour = Inp32_x64(0x71);

Console.WriteLine(hour.ToString("x")+":"+min.ToString("x")+":"+sec.ToString("x"));
}

====Test environment=====
Windows 7 X64 / Win10 X64
Visual Studio Community 2017
My Own Program is 64bit .

====Program exec result===
80000000
0 ->Should read 0x16048086
14:32:23



Thanks you..

User avatar
phil
Site Admin
Posts: 5958
Joined: Sun Apr 06, 2003 11:12 pm

Re: Read PCI Device Vendor ID

Post by phil » Thu Apr 11, 2019 9:31 am

I think there is a bug in the Read/Write ULong code in the driver. There was some discussion about it here several years ago
It cant be fixed by me (as I no longer am able to sign drivers).

InpOut32 is stale now, it hasn't had any work done on it since I was no longer able to sign the drivers - there is no point.
If someone is able to sign drivers, they would be welcome to take on the code (its all there) and update it, hopefully fixing the bugs. But there is very little need/use of this type of driver these days so I expect it will just fizzle out. Much like the original author of InpOut32 who seems to have just disappeared.
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9, Logitech MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, Intel i5-9600k, Asus Z390-ROG, 16GB DDR4,
nVidia GeForce GTX 970, Evo 970 500Gb NVME, 2x2TB WD Black (RAID1)

joechen882000
New User
Posts: 2
Joined: Thu Apr 11, 2019 7:20 am

Re: Read PCI Device Vendor ID

Post by joechen882000 » Fri Apr 12, 2019 2:40 am

Get it ! thank your quick reply !

Post Reply