I need to get the path to the native (rather than the WOW) program files directory from a 32bit WOW process.
When I pass CSIDL_PROGRAM_FILES (or CSIDL_PROGRAM_FILESX86)
I appreciate all the help and, especially, the warnings in this thread. However, I really do need this path and this is how I got it in the end:
(error checking removed for clarity, use at your own risk, etc)
WCHAR szNativeProgramFilesFolder[MAX_PATH];
ExpandEnvironmentStrings(L"%ProgramW6432%",
szNativeProgramFilesFolder,
ARRAYSIZE(szNativeProgramFilesFolder);