Skip to content

Commit 88b8727

Browse files
authored
Merge pull request #287 from jyd519/ghmain
Ghmain
2 parents 1ff1897 + ef95092 commit 88b8727

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

src/vmaware.hpp

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9664,7 +9664,23 @@ struct VM {
96649664
#else
96659665
BOOL isNativeVhdBoot = 0;
96669666

9667-
if (IsNativeVhdBoot(&isNativeVhdBoot)) {
9667+
const HMODULE hModule = GetModuleHandleA("Kernel32.dll");
9668+
if (!hModule)
9669+
return false;
9670+
9671+
const char* functionNames[] = { "IsNativeVhdBoot" };
9672+
void* functionPointers[1] = { nullptr };
9673+
9674+
util::GetFunctionAddresses(hModule, functionNames, functionPointers, 1);
9675+
9676+
typedef BOOL (WINAPI *IsNativeVhdBoot)(PBOOL NativeVhdBoot);
9677+
9678+
IsNativeVhdBoot pIsNativeVhdBoot = nullptr;
9679+
pIsNativeVhdBoot = reinterpret_cast<IsNativeVhdBoot>(functionPointers[0]);
9680+
if (!pIsNativeVhdBoot)
9681+
return false;
9682+
9683+
if ( pIsNativeVhdBoot(&isNativeVhdBoot)) {
96689684
return isNativeVhdBoot == 1;
96699685
}
96709686

@@ -10890,7 +10906,7 @@ struct VM {
1089010906
const brand_element_t &a,
1089110907
const brand_element_t &b
1089210908
) {
10893-
return a.second < b.second;
10909+
return a.second > b.second;
1089410910
});
1089510911

1089610912
std::string ret_str = brands::NULL_BRAND;

0 commit comments

Comments
 (0)