Mercurial > hg > vampy
comparison PyPlugScanner.cpp @ 97:2f2292b029a4
Use VAMP_PATH_32 instead of VAMP_PATH when running as a 32-bit plugin on a 64-bit Windows installation
author | Chris Cannam |
---|---|
date | Wed, 16 Jan 2019 15:11:26 +0000 |
parents | a6718f9fe942 |
children | efff8e5d90a3 |
comparison
equal
deleted
inserted
replaced
96:4e5de05b6e71 | 97:2f2292b029a4 |
---|---|
323 //Return correct plugin directories as per platform | 323 //Return correct plugin directories as per platform |
324 //Code taken from vamp-sdk/PluginHostAdapter.cpp | 324 //Code taken from vamp-sdk/PluginHostAdapter.cpp |
325 std::vector<std::string> | 325 std::vector<std::string> |
326 PyPlugScanner::getAllValidPath() | 326 PyPlugScanner::getAllValidPath() |
327 { | 327 { |
328 | |
329 std::vector<std::string> path; | 328 std::vector<std::string> path; |
330 std::string envPath; | 329 std::string envPath; |
331 | 330 |
332 char *cpath = getenv("VAMP_PATH"); | 331 bool nonNative32 = false; |
332 #ifdef _WIN32 | |
333 BOOL (WINAPI *fnIsWow64Process)(HANDLE, PBOOL) = | |
334 (BOOL (WINAPI *)(HANDLE, PBOOL)) GetProcAddress | |
335 (GetModuleHandle(TEXT("kernel32")), "IsWow64Process"); | |
336 if (fnIsWow64Process) { | |
337 BOOL wow64 = FALSE; | |
338 if (fnIsWow64Process(GetCurrentProcess(), &wow64) && wow64) { | |
339 nonNative32 = true; | |
340 } | |
341 } | |
342 #endif | |
343 | |
344 char *cpath; | |
345 if (nonNative32) { | |
346 cpath = getenv("VAMP_PATH_32"); | |
347 } else { | |
348 cpath = getenv("VAMP_PATH"); | |
349 } | |
333 if (cpath) envPath = cpath; | 350 if (cpath) envPath = cpath; |
334 | 351 |
335 #ifdef _WIN32 | 352 #ifdef _WIN32 |
336 #define PATH_SEPARATOR ';' | 353 #define PATH_SEPARATOR ';' |
337 #define DEFAULT_VAMP_PATH "%ProgramFiles%\\Vamp Plugins" | 354 #define DEFAULT_VAMP_PATH "%ProgramFiles%\\Vamp Plugins" |