mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-08-09 20:24:14 +00:00
[host] initial NvFBC implementation
This commit is contained in:
41
host/Util.h
Normal file
41
host/Util.h
Normal file
@@ -0,0 +1,41 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
|
||||
#include "common\debug.h"
|
||||
|
||||
static class Util
|
||||
{
|
||||
public:
|
||||
static std::string GetSystemRoot()
|
||||
{
|
||||
std::string defaultPath;
|
||||
|
||||
size_t pathSize;
|
||||
char *libPath;
|
||||
|
||||
if (_dupenv_s(&libPath, &pathSize, "SystemRoot") != 0)
|
||||
{
|
||||
DEBUG_ERROR("Unable to get the SystemRoot environment variable");
|
||||
return defaultPath;
|
||||
}
|
||||
|
||||
if (!pathSize)
|
||||
{
|
||||
DEBUG_ERROR("The SystemRoot environment variable is not set");
|
||||
return defaultPath;
|
||||
}
|
||||
#ifdef _WIN64
|
||||
defaultPath = std::string(libPath) + "\\System32";
|
||||
#else
|
||||
if (IsWow64())
|
||||
{
|
||||
defaultPath = std::string(libPath) + "\\Syswow64";
|
||||
}
|
||||
else
|
||||
{
|
||||
defaultPath = std::string(libPath) + "\\System32";
|
||||
}
|
||||
#endif
|
||||
return defaultPath;
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user