Sha256: 8d7381b25b98af2a35627994442d515cdcc53f7b0f193ad56a7ce352fba08745
Contents?: true
Size: 749 Bytes
Versions: 22
Compression:
Stored size: 749 Bytes
Contents
#include <windows.h> #include <string> using namespace std; BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { // Append .so parent folder to PATH to make extensions (e.g. FMOD.dll) loadable. if (fdwReason == DLL_PROCESS_ATTACH) { TCHAR buffer[MAX_PATH+1]; if (GetModuleFileName(hinstDLL, buffer, MAX_PATH+1)) { // Make last backslash a \0 (get parent directory) TCHAR* ptr = buffer; while (*ptr) ++ptr; while (*ptr != '\\' && *ptr != '/') if (ptr < buffer) return TRUE; else --ptr; *ptr = 0; wstring oldPath = _wgetenv(L"PATH"); wstring envString = L"PATH=" + oldPath + L';' + buffer; _wputenv(envString.c_str()); } } return TRUE; }
Version data entries
22 entries across 22 versions & 1 rubygems