VirtualBox

Changeset 53833 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Jan 15, 2015 8:01:33 PM (10 years ago)
Author:
vboxsync
Message:

Runtime: looks like the 32-bit compiler does something silly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/win/path-win.cpp

    r53825 r53833  
    165165
    166166    RTUTF16 wszPath[RTPATH_MAX];
     167    bool    fValidFolderPath = false;
     168
     169    /*
     170     * Try with Windows XP+ functionality first.
     171     */
     172    RTLDRMOD hShell32;
     173    int rc = RTLdrLoadSystem("Shell32.dll", true /*fNoUnload*/, &hShell32);
     174    if (RT_SUCCESS(rc))
     175    {
     176        PFNSHGETFOLDERPATHW pfnSHGetFolderPathW;
     177        rc = RTLdrGetSymbol(hShell32, "SHGetFolderPathW", (void**)&pfnSHGetFolderPathW);
     178        if (RT_SUCCESS(rc))
     179        {
     180            HRESULT hrc = pfnSHGetFolderPathW(0, CSIDL_PROFILE, NULL, SHGFP_TYPE_CURRENT, wszPath);
     181            fValidFolderPath = (hrc == S_OK);
     182        }
     183        RTLdrClose(hShell32);
     184    }
     185
    167186    DWORD   dwAttr;
    168     bool    fValidFolderPath = false;
    169 
    170     /*
    171      * Try with Windows XP+ functionality first.
    172      */
    173     {
    174         RTLDRMOD hShell32;
    175         int rc = RTLdrLoadSystem("Shell32.dll", true /*fNoUnload*/, &hShell32);
    176         if (RT_SUCCESS(rc))
    177         {
    178             PFNSHGETFOLDERPATHW pfnSHGetFolderPathW;
    179             rc = RTLdrGetSymbol(hShell32, "SHGetFolderPathW", (void**)&pfnSHGetFolderPathW);
    180             if (RT_SUCCESS(rc))
    181             {
    182                 HRESULT hrc = pfnSHGetFolderPathW(0, CSIDL_PROFILE, NULL, SHGFP_TYPE_CURRENT, wszPath);
    183                 fValidFolderPath = (hrc == S_OK);
    184             }
    185             RTLdrClose(hShell32);
    186         }
    187     }
    188 
    189187    if (    !fValidFolderPath
    190188        ||  (dwAttr = GetFileAttributesW(&wszPath[0])) == INVALID_FILE_ATTRIBUTES
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette