MCPcopy Create free account
hub / github.com/GPUOpen-Tools/GPU-Reshape / IsBootstrapped

Function IsBootstrapped

Source/Backends/DX12/Layer/Source/DLL.cpp:49–70  ·  view source on GitHub ↗

Check if the process is already bootstrapped, the boostrapper performs its own detouring of calls \return true if bootstrapped

Source from the content-addressed store, hash-verified

47/// Check if the process is already bootstrapped, the boostrapper performs its own detouring of calls
48/// \return true if bootstrapped
49static bool IsBootstrapped() {
50 // Try the hooked GPA first
51 auto* gpaBootstrapperInfo = reinterpret_cast<PFN_D3D12_GET_GPUOPEN_BOOTSTRAPPER_INFO>(GetProcAddress((HINSTANCE)&__ImageBase, "D3D12GetGPUOpenBootstrapperInfo"));
52
53 // Otherwise, check the known bootstrapper handle
54 // SysWow64 will not get in here, so just check the 64 bit module
55 if (HMODULE bootstrapperHandle; GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, "GRS.Backends.DX12.BootstrapperX64.dll", &bootstrapperHandle) && bootstrapperHandle) {
56 gpaBootstrapperInfo = reinterpret_cast<PFN_D3D12_GET_GPUOPEN_BOOTSTRAPPER_INFO>(GetProcAddress(bootstrapperHandle, "D3D12GetGPUOpenBootstrapperInfo"));
57 }
58
59 // None found?
60 if (!gpaBootstrapperInfo) {
61 return false;
62 }
63
64 // Get info
65 D3D12GPUOpenBootstrapperInfo info{};
66 gpaBootstrapperInfo(&info);
67
68 // Version check
69 return info.version >= 1;
70}
71
72/// DLL entrypoint
73BOOL WINAPI DllMain(HINSTANCE hinst, DWORD dwReason, LPVOID reserved) {

Callers 1

DllMainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected