| 85 | } |
| 86 | |
| 87 | BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) |
| 88 | { |
| 89 | if (DetourIsHelperProcess()) |
| 90 | return TRUE; |
| 91 | |
| 92 | #if defined(_WIN64) |
| 93 | const char* pBitDepth = "64"; |
| 94 | #else |
| 95 | const char* pBitDepth = "32"; |
| 96 | #endif |
| 97 | switch (ul_reason_for_call) |
| 98 | { |
| 99 | case DLL_PROCESS_ATTACH: |
| 100 | revModule = (HMODULE)hModule; |
| 101 | GetModuleFileName(revModule, revModuleName, MAX_PATH); |
| 102 | swprintf(ovrModuleName, MAX_PATH, L"LibOVRRT%hs_%d.dll", pBitDepth, OVR_MAJOR_VERSION); |
| 103 | |
| 104 | DetourRestoreAfterWith(); |
| 105 | AttachDetours(); |
| 106 | break; |
| 107 | case DLL_PROCESS_DETACH: |
| 108 | DetachDetours(); |
| 109 | break; |
| 110 | default: |
| 111 | break; |
| 112 | } |
| 113 | return TRUE; |
| 114 | } |
nothing calls this directly
no test coverage detected