shlwapi: Properly handle ParseURL errors in UrlGetPart[AW].
This commit is contained in:
parent
87118d00fe
commit
a34ed0f6ee
|
@ -2141,6 +2141,7 @@ HRESULT WINAPI UrlGetPartW(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut,
|
||||||
BOOL WINAPI PathIsURLA(LPCSTR lpstrPath)
|
BOOL WINAPI PathIsURLA(LPCSTR lpstrPath)
|
||||||
{
|
{
|
||||||
PARSEDURLA base;
|
PARSEDURLA base;
|
||||||
|
HRESULT hres;
|
||||||
|
|
||||||
TRACE("%s\n", debugstr_a(lpstrPath));
|
TRACE("%s\n", debugstr_a(lpstrPath));
|
||||||
|
|
||||||
|
@ -2148,8 +2149,8 @@ BOOL WINAPI PathIsURLA(LPCSTR lpstrPath)
|
||||||
|
|
||||||
/* get protocol */
|
/* get protocol */
|
||||||
base.cbSize = sizeof(base);
|
base.cbSize = sizeof(base);
|
||||||
ParseURLA(lpstrPath, &base);
|
hres = ParseURLA(lpstrPath, &base);
|
||||||
return (base.nScheme != URL_SCHEME_INVALID);
|
return hres == S_OK && (base.nScheme != URL_SCHEME_INVALID);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
|
@ -2160,6 +2161,7 @@ BOOL WINAPI PathIsURLA(LPCSTR lpstrPath)
|
||||||
BOOL WINAPI PathIsURLW(LPCWSTR lpstrPath)
|
BOOL WINAPI PathIsURLW(LPCWSTR lpstrPath)
|
||||||
{
|
{
|
||||||
PARSEDURLW base;
|
PARSEDURLW base;
|
||||||
|
HRESULT hres;
|
||||||
|
|
||||||
TRACE("%s\n", debugstr_w(lpstrPath));
|
TRACE("%s\n", debugstr_w(lpstrPath));
|
||||||
|
|
||||||
|
@ -2167,8 +2169,8 @@ BOOL WINAPI PathIsURLW(LPCWSTR lpstrPath)
|
||||||
|
|
||||||
/* get protocol */
|
/* get protocol */
|
||||||
base.cbSize = sizeof(base);
|
base.cbSize = sizeof(base);
|
||||||
ParseURLW(lpstrPath, &base);
|
hres = ParseURLW(lpstrPath, &base);
|
||||||
return (base.nScheme != URL_SCHEME_INVALID);
|
return hres == S_OK && (base.nScheme != URL_SCHEME_INVALID);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
|
|
Loading…
Reference in New Issue