Commit 28f7e461 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

shlwapi: Fix PathIsContentTypeA implementation.

parent 232255f3
...@@ -2027,22 +2027,18 @@ BOOL WINAPI PathIsSameRootW(LPCWSTR lpszPath1, LPCWSTR lpszPath2) ...@@ -2027,22 +2027,18 @@ BOOL WINAPI PathIsSameRootW(LPCWSTR lpszPath1, LPCWSTR lpszPath2)
* a content type is registered, it is compared (case insensitively) to * a content type is registered, it is compared (case insensitively) to
* lpszContentType. Only if this matches does the function succeed. * lpszContentType. Only if this matches does the function succeed.
*/ */
BOOL WINAPI PathIsContentTypeA(LPCSTR lpszPath, LPCSTR lpszContentType) BOOL WINAPI PathIsContentTypeA(LPCSTR path, LPCSTR content_type)
{ {
LPCSTR szExt; char buf[MAX_PATH];
DWORD dwDummy; DWORD size = sizeof(buf);
char szBuff[MAX_PATH]; LPCSTR ext;
TRACE("(%s,%s)\n", debugstr_a(lpszPath), debugstr_a(lpszContentType)); TRACE("(%s,%s)\n", debugstr_a(path), debugstr_a(content_type));
if (lpszPath && (szExt = PathFindExtensionA(lpszPath)) && *szExt && if(!path) return FALSE;
!SHGetValueA(HKEY_CLASSES_ROOT, szExt, "Content Type", if(!(ext = PathFindExtensionA(path)) || !*ext) return FALSE;
REG_NONE, szBuff, &dwDummy) && if(SHGetValueA(HKEY_CLASSES_ROOT, ext, "Content Type", NULL, buf, &size)) return FALSE;
!strcasecmp(lpszContentType, szBuff)) return !lstrcmpiA(content_type, buf);
{
return TRUE;
}
return FALSE;
} }
/************************************************************************* /*************************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment