Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Resolve warnings with VS 16.8.5 and WDK 10.0.19041.685
  • Loading branch information
tandasat committed Feb 20, 2021
1 parent 61ce1f4 commit 396e49e
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions HyperPlatform/HyperPlatform.inf
Expand Up @@ -9,6 +9,7 @@ ClassGuid={78A1C341-4539-11d3-B88D-00C04FAD5171} ; TODO: edit ClassGuid
Provider=%ManufacturerName%
CatalogFile=HyperPlatform.cat
DriverVer= ; TODO: set DriverVer in stampinf property pages
PnpLockdown=1

[DestinationDirs]
DefaultDestDir = 12
Expand Down
2 changes: 1 addition & 1 deletion HyperPlatform/common.h
Expand Up @@ -90,7 +90,7 @@
#define HYPERPLATFORM_PERFORMANCE_ENABLE_PERFCOUNTER 0

/// A pool tag
static const ULONG kHyperPlatformCommonPoolTag = 'PpyH';
static constexpr ULONG kHyperPlatformCommonPoolTag = 'PpyH';

////////////////////////////////////////////////////////////////////////////////
//
Expand Down
2 changes: 1 addition & 1 deletion HyperPlatform/ept.cpp
Expand Up @@ -344,7 +344,7 @@ _Use_decl_annotations_ static memory_type EptpGetMemoryType(
UCHAR result_type = MAXUCHAR;

// Looks for MTRR that includes the specified physical_address
for (const auto mtrr_entry : g_eptp_mtrr_entries) {
for (const auto& mtrr_entry : g_eptp_mtrr_entries) {
if (!mtrr_entry.enabled) {
// Reached out the end of stored MTRRs
break;
Expand Down
4 changes: 2 additions & 2 deletions HyperPlatform/ia32_type.h
Expand Up @@ -26,12 +26,12 @@
//

/// See: OVERVIEW
static const SIZE_T kVmxMaxVmcsSize = 4096;
static constexpr SIZE_T kVmxMaxVmcsSize = 4096;

/// A majority of modern hypervisors expose their signatures through CPUID with
/// this CPUID function code to indicate their existence. HyperPlatform follows
/// this convention.
static const ULONG32 kHyperVCpuidInterface = 0x40000001;
static constexpr ULONG32 kHyperVCpuidInterface = 0x40000001;

////////////////////////////////////////////////////////////////////////////////
//
Expand Down
2 changes: 1 addition & 1 deletion HyperPlatform/kernel_stl.cpp
Expand Up @@ -28,7 +28,7 @@
//

/// A pool tag for this module
static const ULONG kKstlpPoolTag = 'LTSK';
static constexpr ULONG kKstlpPoolTag = 'LTSK';

////////////////////////////////////////////////////////////////////////////////
//
Expand Down
8 changes: 8 additions & 0 deletions HyperPlatform/vmm.cpp
Expand Up @@ -1032,13 +1032,17 @@ _Use_decl_annotations_ static void VmmpIoWrapper(bool to_memory, bool is_string,
case 1: __inbytestring(port, static_cast<UCHAR*>(address), count); break;
case 2: __inwordstring(port, static_cast<USHORT*>(address), count); break;
case 4: __indwordstring(port, static_cast<ULONG*>(address), count); break;
default: HYPERPLATFORM_COMMON_BUG_CHECK(HyperPlatformBugCheck::kUnspecified, 0, 0, 0);
/* UNREACHABLE */
}
} else {
// IN
switch (size_of_access) {
case 1: *static_cast<UCHAR*>(address) = __inbyte(port); break;
case 2: *static_cast<USHORT*>(address) = __inword(port); break;
case 4: *static_cast<ULONG*>(address) = __indword(port); break;
default: HYPERPLATFORM_COMMON_BUG_CHECK(HyperPlatformBugCheck::kUnspecified, 0, 0, 0);
/* UNREACHABLE */
}
}
} else {
Expand All @@ -1048,13 +1052,17 @@ _Use_decl_annotations_ static void VmmpIoWrapper(bool to_memory, bool is_string,
case 1: __outbytestring(port, static_cast<UCHAR*>(address), count); break;
case 2: __outwordstring(port, static_cast<USHORT*>(address), count); break;
case 4: __outdwordstring(port, static_cast<ULONG*>(address), count); break;
default: HYPERPLATFORM_COMMON_BUG_CHECK(HyperPlatformBugCheck::kUnspecified, 0, 0, 0);
/* UNREACHABLE */
}
} else {
// OUT
switch (size_of_access) {
case 1: __outbyte(port, *static_cast<UCHAR*>(address)); break;
case 2: __outword(port, *static_cast<USHORT*>(address)); break;
case 4: __outdword(port, *static_cast<ULONG*>(address)); break;
default: HYPERPLATFORM_COMMON_BUG_CHECK(HyperPlatformBugCheck::kUnspecified, 0, 0, 0);
/* UNREACHABLE */
}
}
}
Expand Down

0 comments on commit 396e49e

Please sign in to comment.