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 »

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: 7611
Joined: Sun Apr 06, 2003 11:12 pm

Re: Read PCI Device Vendor ID

Post by phil »

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/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb 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 »

Get it ! thank your quick reply !
mon2
New User
Posts: 1
Joined: Thu Dec 10, 2020 7:01 pm

Re: Read PCI Device Vendor ID

Post by mon2 »

Hello @ joechen882000. Very interested in the same support.

Were you able to fix this issue?

Can you share the details of the fix?

Attempting to compile the source code now and facing:

Severity Code Description Project File Line Suppression State
Error MSB3073 The command "ddkbuild -WNETA64 free . -cZ" exited with code 9009. HWInterfaceDrv C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets 40

We do have the ability to sign the final driver package.

If we understand correctly, the driver as-is works as long as we do not make use of:

Read/Write ULong ?

We can spoon feed the PCI address by other means to index a few GPIO pins on NT protected operating systems (XP..Windows 10).
User avatar
phil
Site Admin
Posts: 7611
Joined: Sun Apr 06, 2003 11:12 pm

Re: Read PCI Device Vendor ID

Post by phil »

No I haven't fixed it - what bit about "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." was not clear :?

Your welcome to take it over. Last time I tried to compile it, it had to be with a very old DDK (2003?) so I have no idea if it will compile against newer DDK's.I don't have and DDK's on my dev machine these days so its not particularly easy for me to try!
If we understand correctly, the driver as-is works as long as we do not make use of:
Read/Write ULong ?
I believe this is the case - but its rather selective in what it will and wont do - and I believe MS are changing their signing requirements so when that happens the signature on this driver will not work any more. Not something I'd be comfortable on relying on these days
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
Post Reply