Hi,
Just a few comments on an otherwise good patch:
-static BOOL URL_JustLocation(LPCWSTR str) +static BOOL WINAPI URL_JustLocation(LPCWSTR str)
...
-static LPCWSTR URL_ScanID(LPCWSTR start, LPDWORD size, WINE_URL_SCAN_TYPE type) +static LPCWSTR WINAPI URL_ScanID(LPCWSTR start, LPDWORD size, WINE_URL_SCAN_TYPE type)
Is there any reason for changing the calling convention of these two functions?
+/****************************************************************
- MLBuildResURLA [SHLWAPI.406]
- See MLBuildResURLA.
- */
+HRESULT WINAPI MLBuildResURLW(LPCWSTR lpszLibName, HMODULE hMod, DWORD dwFlags,
LPCWSTR lpszRes, LPWSTR lpszDest,
DWORD dwDestLen) +{
- static const WCHAR szRes[] = { 'r','e','s',':','/','/','\0' };
+#define szResLen (sizeof(szRes)/sizeof(WCHAR) - sizeof(WCHAR))
Should this not be #define szResLen (sizeof(szRes)/sizeof(WCHAR) - 1) ?
- HRESULT hRet = E_FAIL;
- TRACE("(%s,%p,0x%08lx,%s,%p,%ld)\n", debugstr_w(lpszLibName),
hMod, dwFlags,
debugstr_w(lpszRes), lpszDest, dwDestLen);
- if (!lpszLibName || !hMod || hMod == INVALID_HANDLE_VALUE ||
!lpszRes ||
!lpszDest || (dwFlags && dwFlags != 2))
- return E_INVALIDARG;
- if (dwDestLen >= szResLen + 1)
- {
- dwDestLen -= (szResLen + 1);
- memcpy(lpszDest, szRes, sizeof(lpszDest));
- hMod = MLLoadLibraryW(lpszLibName, hMod, dwFlags);
- if (hMod)
- {
WCHAR szBuff[MAX_PATH];
if (GetModuleFileNameW(hMod, szBuff, sizeof(szBuff)/sizeof(WCHAR)))
{
DWORD dwPathLen = strlenW(szBuff) + 1;
if (dwDestLen >= dwPathLen)
{
DWORD dwResLen;
dwDestLen -= dwPathLen;
memcpy(lpszDest + szResLen, szBuff, dwPathLen * sizeof(WCHAR));
dwResLen = strlenW(lpszRes) + 1;
if (dwDestLen >= dwResLen + 1)
{
lpszDest[szResLen + dwPathLen + dwResLen] = '/';
memcpy(lpszDest + szResLen + dwPathLen, lpszRes,
dwResLen * sizeof(WCHAR));
hRet = S_OK;
}
}
}
MLFreeLibrary(hMod);
- }
- }
- return hRet;
+}
Rob