mirror of
git://source.winehq.org/git/wine.git
synced 2024-07-21 14:34:10 +00:00
shlwapi: Implement PathCreateFromUrlAlloc().
This commit is contained in:
parent
49d8b4c039
commit
58c77f6156
|
@ -3419,6 +3419,26 @@ HRESULT WINAPI PathCreateFromUrlW(LPCWSTR pszUrl, LPWSTR pszPath,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
* PathCreateFromUrlAlloc [SHLWAPI.@]
|
||||||
|
*/
|
||||||
|
HRESULT WINAPI PathCreateFromUrlAlloc(LPCWSTR pszUrl, LPWSTR *pszPath,
|
||||||
|
DWORD dwReserved)
|
||||||
|
{
|
||||||
|
WCHAR pathW[MAX_PATH];
|
||||||
|
DWORD size;
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
|
size = MAX_PATH;
|
||||||
|
hr = PathCreateFromUrlW(pszUrl, pathW, &size, dwReserved);
|
||||||
|
if (SUCCEEDED(hr))
|
||||||
|
{
|
||||||
|
/* Yes, this is supposed to crash if pszPath is NULL */
|
||||||
|
*pszPath = StrDupW(pathW);
|
||||||
|
}
|
||||||
|
return hr;
|
||||||
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* PathRelativePathToA [SHLWAPI.@]
|
* PathRelativePathToA [SHLWAPI.@]
|
||||||
*
|
*
|
||||||
|
|
|
@ -586,6 +586,7 @@
|
||||||
@ stdcall PathCompactPathW(long wstr long)
|
@ stdcall PathCompactPathW(long wstr long)
|
||||||
@ stdcall PathCreateFromUrlA(str ptr ptr long)
|
@ stdcall PathCreateFromUrlA(str ptr ptr long)
|
||||||
@ stdcall PathCreateFromUrlW(wstr ptr ptr long)
|
@ stdcall PathCreateFromUrlW(wstr ptr ptr long)
|
||||||
|
@ stdcall PathCreateFromUrlAlloc(wstr ptr long)
|
||||||
@ stdcall PathFileExistsA (str)
|
@ stdcall PathFileExistsA (str)
|
||||||
@ stdcall PathFileExistsW (wstr)
|
@ stdcall PathFileExistsW (wstr)
|
||||||
@ stdcall PathFindExtensionA (str)
|
@ stdcall PathFindExtensionA (str)
|
||||||
|
|
|
@ -32,6 +32,7 @@ static HRESULT (WINAPI *pPathIsValidCharW)(WCHAR,DWORD);
|
||||||
static LPWSTR (WINAPI *pPathCombineW)(LPWSTR, LPCWSTR, LPCWSTR);
|
static LPWSTR (WINAPI *pPathCombineW)(LPWSTR, LPCWSTR, LPCWSTR);
|
||||||
static HRESULT (WINAPI *pPathCreateFromUrlA)(LPCSTR, LPSTR, LPDWORD, DWORD);
|
static HRESULT (WINAPI *pPathCreateFromUrlA)(LPCSTR, LPSTR, LPDWORD, DWORD);
|
||||||
static HRESULT (WINAPI *pPathCreateFromUrlW)(LPCWSTR, LPWSTR, LPDWORD, DWORD);
|
static HRESULT (WINAPI *pPathCreateFromUrlW)(LPCWSTR, LPWSTR, LPDWORD, DWORD);
|
||||||
|
static HRESULT (WINAPI *pPathCreateFromUrlAlloc)(LPCWSTR, LPWSTR*, DWORD);
|
||||||
static BOOL (WINAPI *pPathAppendA)(LPSTR, LPCSTR);
|
static BOOL (WINAPI *pPathAppendA)(LPSTR, LPCSTR);
|
||||||
|
|
||||||
/* ################ */
|
/* ################ */
|
||||||
|
@ -326,6 +327,18 @@ static void test_PathCreateFromUrl(void)
|
||||||
FreeWideString(pathW);
|
FreeWideString(pathW);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pPathCreateFromUrlAlloc)
|
||||||
|
{
|
||||||
|
static const WCHAR fileW[] = {'f','i','l','e',':','/','/','f','o','o',0};
|
||||||
|
static const WCHAR fooW[] = {'\\','\\','f','o','o',0};
|
||||||
|
|
||||||
|
pathW = NULL;
|
||||||
|
ret = pPathCreateFromUrlAlloc(fileW, &pathW, 0);
|
||||||
|
ok(ret == S_OK, "got 0x%08x expected S_OK\n", ret);
|
||||||
|
ok(lstrcmpiW(pathW, fooW) == 0, "got %s expected %s\n", wine_dbgstr_w(pathW), wine_dbgstr_w(fooW));
|
||||||
|
HeapFree(GetProcessHeap(), 0, pathW);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1453,6 +1466,7 @@ START_TEST(path)
|
||||||
|
|
||||||
pPathCreateFromUrlA = (void*)GetProcAddress(hShlwapi, "PathCreateFromUrlA");
|
pPathCreateFromUrlA = (void*)GetProcAddress(hShlwapi, "PathCreateFromUrlA");
|
||||||
pPathCreateFromUrlW = (void*)GetProcAddress(hShlwapi, "PathCreateFromUrlW");
|
pPathCreateFromUrlW = (void*)GetProcAddress(hShlwapi, "PathCreateFromUrlW");
|
||||||
|
pPathCreateFromUrlAlloc = (void*)GetProcAddress(hShlwapi, "PathCreateFromUrlAlloc");
|
||||||
pPathCombineW = (void*)GetProcAddress(hShlwapi, "PathCombineW");
|
pPathCombineW = (void*)GetProcAddress(hShlwapi, "PathCombineW");
|
||||||
pPathIsValidCharA = (void*)GetProcAddress(hShlwapi, (LPSTR)455);
|
pPathIsValidCharA = (void*)GetProcAddress(hShlwapi, (LPSTR)455);
|
||||||
pPathIsValidCharW = (void*)GetProcAddress(hShlwapi, (LPSTR)456);
|
pPathIsValidCharW = (void*)GetProcAddress(hShlwapi, (LPSTR)456);
|
||||||
|
|
|
@ -372,16 +372,18 @@ int WINAPI PathCommonPrefixA(LPCSTR,LPCSTR,LPSTR);
|
||||||
int WINAPI PathCommonPrefixW(LPCWSTR,LPCWSTR,LPWSTR);
|
int WINAPI PathCommonPrefixW(LPCWSTR,LPCWSTR,LPWSTR);
|
||||||
#define PathCommonPrefix WINELIB_NAME_AW(PathCommonPrefix)
|
#define PathCommonPrefix WINELIB_NAME_AW(PathCommonPrefix)
|
||||||
|
|
||||||
HRESULT WINAPI PathCreateFromUrlA(LPCSTR pszUrl, LPSTR pszPath, LPDWORD pcchPath, DWORD dwReserved);
|
HRESULT WINAPI PathCreateFromUrlA(LPCSTR,LPSTR,LPDWORD,DWORD);
|
||||||
HRESULT WINAPI PathCreateFromUrlW(LPCWSTR pszUrl, LPWSTR pszPath, LPDWORD pcchPath, DWORD dwReserved);
|
HRESULT WINAPI PathCreateFromUrlW(LPCWSTR,LPWSTR,LPDWORD,DWORD);
|
||||||
#define PathCreateFromUrl WINELIB_NAME_AW(PathCreateFromUrl)
|
#define PathCreateFromUrl WINELIB_NAME_AW(PathCreateFromUrl)
|
||||||
|
|
||||||
|
HRESULT WINAPI PathCreateFromUrlAlloc(LPCWSTR,LPWSTR*,DWORD);
|
||||||
|
|
||||||
BOOL WINAPI PathFileExistsA(LPCSTR);
|
BOOL WINAPI PathFileExistsA(LPCSTR);
|
||||||
BOOL WINAPI PathFileExistsW(LPCWSTR);
|
BOOL WINAPI PathFileExistsW(LPCWSTR);
|
||||||
#define PathFileExists WINELIB_NAME_AW(PathFileExists)
|
#define PathFileExists WINELIB_NAME_AW(PathFileExists)
|
||||||
|
|
||||||
BOOL WINAPI PathFileExistsAndAttributesA(LPCSTR lpszPath, DWORD *dwAttr);
|
BOOL WINAPI PathFileExistsAndAttributesA(LPCSTR,DWORD*);
|
||||||
BOOL WINAPI PathFileExistsAndAttributesW(LPCWSTR lpszPath, DWORD *dwAttr);
|
BOOL WINAPI PathFileExistsAndAttributesW(LPCWSTR,DWORD*);
|
||||||
#define PathFileExistsAndAttributes WINELIB_NAME_AW(PathFileExistsAndAttributes)
|
#define PathFileExistsAndAttributes WINELIB_NAME_AW(PathFileExistsAndAttributes)
|
||||||
|
|
||||||
LPSTR WINAPI PathFindExtensionA(LPCSTR);
|
LPSTR WINAPI PathFindExtensionA(LPCSTR);
|
||||||
|
|
Loading…
Reference in a new issue