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

HRESULT WINAPI UrlCanonicalizeA ( LPCSTR  pszUrl,
LPSTR  pszCanonicalized,
LPDWORD  pcchCanonicalized,
DWORD  dwFlags 
)

Definition at line 232 of file url.c.

Referenced by InternetCanonicalizeUrlA().

{
    LPWSTR url, canonical;
    HRESULT ret;
    DWORD   len;

    TRACE("(%s, %p, %p, 0x%08x) *pcchCanonicalized: %d\n", debugstr_a(pszUrl), pszCanonicalized,
        pcchCanonicalized, dwFlags, pcchCanonicalized ? *pcchCanonicalized : -1);

    if(!pszUrl || !pszCanonicalized || !pcchCanonicalized || !*pcchCanonicalized)
    return E_INVALIDARG;

    len = strlen(pszUrl)+1;
    url = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
    canonical = HeapAlloc(GetProcessHeap(), 0, *pcchCanonicalized*sizeof(WCHAR));
    if(!url || !canonical) {
        HeapFree(GetProcessHeap(), 0, url);
        HeapFree(GetProcessHeap(), 0, canonical);
        return E_OUTOFMEMORY;
    }

    MultiByteToWideChar(0, 0, pszUrl, -1, url, len);

    ret = UrlCanonicalizeW(url, canonical, pcchCanonicalized, dwFlags);
    if(ret == S_OK)
        WideCharToMultiByte(0, 0, canonical, -1, pszCanonicalized,
                *pcchCanonicalized+1, 0, 0);

    HeapFree(GetProcessHeap(), 0, canonical);
    return ret;
}

Generated on Sat May 26 2012 05:17:49 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.