Page 1 of 1

Read PCI Device Vendor ID

Posted: Thu Apr 11, 2019 7:30 am
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..

Re: Read PCI Device Vendor ID

Posted: Thu Apr 11, 2019 9:31 am
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.

Re: Read PCI Device Vendor ID

Posted: Fri Apr 12, 2019 2:40 am
by joechen882000
Get it ! thank your quick reply !

Re: Read PCI Device Vendor ID

Posted: Thu Dec 10, 2020 7:09 pm
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).

Re: Read PCI Device Vendor ID

Posted: Thu Dec 10, 2020 7:57 pm
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