Skip to content

Commit 480ba2a

Browse files
committed
implement pcicfg device availability check for msr.sys
Change-Id: Ic1bd010ff9ed5a21ad1d813aa84b3d964754c030
1 parent 90cb946 commit 480ba2a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/pci.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,11 @@ bool PciHandle::exists(uint32 groupnr_, uint32 bus_, uint32 device_, uint32 func
6767
HANDLE tempHandle = openMSRDriver();
6868
if (tempHandle != INVALID_HANDLE_VALUE)
6969
{
70-
// TODO: check device availability
71-
7270
CloseHandle(tempHandle);
73-
return true;
71+
72+
PciHandle tempHandle(groupnr_, bus_, device_, function_);
73+
uint32 value = 0;
74+
return tempHandle.read32(0, &value) == sizeof(uint32);
7475
}
7576

7677
if (groupnr_ != 0)

0 commit comments

Comments
 (0)