ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

Definition at line 90 of file fusion.c.

Referenced by enumerate_gac().

{
    WCHAR path[MAX_PATH];
    WCHAR windir[MAX_PATH];
    WCHAR version[MAX_PATH];
    DWORD len;
    HRESULT hr = S_OK;

    static const WCHAR backslash[] = {'\\',0};
    static const WCHAR assembly[] = {'a','s','s','e','m','b','l','y',0};
    static const WCHAR gac[] = {'G','A','C',0};
    static const WCHAR nativeimg[] = {
        'N','a','t','i','v','e','I','m','a','g','e','s','_',0};
#ifdef _WIN64
    static const WCHAR zapfmt[] = {'%','s','\\','%','s','\\','%','s','%','s','_','6','4',0};
#else
    static const WCHAR zapfmt[] = {'%','s','\\','%','s','\\','%','s','%','s','_','3','2',0};
#endif

    TRACE("(%08x, %p, %p)\n", dwCacheFlags, pwzCachePath, pcchPath);

    if (!pcchPath)
        return E_INVALIDARG;

    GetWindowsDirectoryW(windir, MAX_PATH);
    lstrcpyW(path, windir);
    lstrcatW(path, backslash);
    lstrcatW(path, assembly);

    switch (dwCacheFlags)
    {
        case ASM_CACHE_ZAP:
        {
            hr = get_corversion(version, MAX_PATH);
            if (FAILED(hr))
                return hr;

            sprintfW(path, zapfmt, windir, assembly, nativeimg, version);
            break;
        }

        case ASM_CACHE_GAC:
        {
            lstrcatW(path, backslash);
            lstrcatW(path, gac);
            break;
        }

        case ASM_CACHE_DOWNLOAD:
        {
            FIXME("Download cache not implemented\n");
            return E_FAIL;
        }

        case ASM_CACHE_ROOT:
            break; /* already set */

        default:
            return E_INVALIDARG;
    }

    len = lstrlenW(path) + 1;
    if (*pcchPath <= len || !pwzCachePath)
        hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
    else if (pwzCachePath)
        lstrcpyW(pwzCachePath, path);

    *pcchPath = len;

    return hr;
}

Generated on Fri May 25 2012 05:39:06 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.