Skip to content

Commit

Permalink
Update DevMon.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
KelvinMsft authored Sep 15, 2019
1 parent 96f398a commit b7e3131
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions DeviceMon/DevMon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,14 +283,16 @@ extern "C"

NTSTATUS DmDisableDeviceMonitor(
_In_ EptData* ept_data)
{
{
ULONG BarWidthIndex = 0;
NTSTATUS status = STATUS_SUCCESS;
EptCommonEntry* Entry = nullptr;
for (int i = 0; i < sizeof(g_MonitorDeviceList) / sizeof(PCIMONITORCFG); i++)
EptCommonEntry* Entry = nullptr;

for (int i = 0; i < sizeof(g_MonitorDeviceList) / sizeof(PCIMONITORCFG); i++)
{
for (int j = 0; j < g_MonitorDeviceList[i].BarCount; j++)
for (int j = 0; j < g_MonitorDeviceList[i].BarCount; j++, BarWidthIndex++ )
{
Entry = DmGetBarEptEntry(&g_MonitorDeviceList[i], j, ept_data);
Entry = DmGetBarEptEntry(&g_MonitorDeviceList[i], j, BarWidthIndex, ept_data);
if (!Entry)
{
HYPERPLATFORM_LOG_DEBUG("- [PCI] PCIBAR ept Entry Not Found \r\n");
Expand All @@ -303,6 +305,13 @@ extern "C"
Entry->fields.read_access = true;
Entry->fields.write_access = true;
Entry->fields.execute_access = true;

if (g_MonitorDeviceList[i].BarAddressWidth[BarWidthIndex] & PCI_BAR_64BIT)
{
//Lower - Upper by default.
j++;
}

}
}
return status;
Expand Down

0 comments on commit b7e3131

Please sign in to comment.