I read this page and the MSDN article and changed my CSIDL_PROGRAM_FILES entries to CSIDL_PROGRAM_FILESx86, however, unfortunatly, after deployment I found out that this did not work on windows xp 32-bits. I tested it with two DLLs, dynamically loaded SHELL32 and SHFOLDER, and called SHGetFolderPathA - with this syntax:
dynamic_SHGetFolderPath(0, CSIDL_PROGRAM_FILESX86, 0, SHGFP_TYPE_CURRENT, szSpecialDir);
it returned an error with both dlls, on SHELL32, GetLastError() returned 0xB7 (file already exists); on SHFOLDER, GetLastError() returned 0x0583 (missing class).
If I just change CSIDL_PROGRAM_FILESX86 to CSIDL_PROGRAM_FILES both calls works fine.
Guess my solution will be to call the function with the appropriated value given the OS bit count (32/64).
Any insights would be appreciated,
Thanks