Skip to content

Commit

Permalink
revert back to initial code
Browse files Browse the repository at this point in the history
  • Loading branch information
kernelwernel committed Oct 13, 2024
1 parent b55b3d9 commit c49aa8c
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/vmaware.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9139,10 +9139,21 @@ struct VM {
#if (!MSVC)
return false;
#else
const char* command = "wmic path win32_videocontroller get videoprocessor";
auto ptr = util::sys_result(command);

std::string result = *ptr;
std::string command = "wmic path win32_videocontroller get videoprocessor";
std::string result = "";

FILE* pipe = _popen(command.c_str(), "r");
if (!pipe) {
debug("GPU_CHIPTYPE: failed to run wmic command");
return false;
}

char buffer[128];
while (!feof(pipe)) {
if (fgets(buffer, 128, pipe) != NULL)
result += buffer;
}
_pclose(pipe);

std::transform(result.begin(), result.end(), result.begin(), ::tolower);

Expand Down

0 comments on commit c49aa8c

Please sign in to comment.