shlwapi: Avoid FALSE:TRUE conditional expressions.
This commit is contained in:
parent
915e12e59f
commit
8d24dd49ee
|
@ -1714,7 +1714,7 @@ BOOL WINAPI PathFileExistsA(LPCSTR lpszPath)
|
|||
iPrevErrMode = SetErrorMode(SEM_FAILCRITICALERRORS);
|
||||
dwAttr = GetFileAttributesA(lpszPath);
|
||||
SetErrorMode(iPrevErrMode);
|
||||
return dwAttr == INVALID_FILE_ATTRIBUTES ? FALSE : TRUE;
|
||||
return dwAttr != INVALID_FILE_ATTRIBUTES;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
|
@ -1735,7 +1735,7 @@ BOOL WINAPI PathFileExistsW(LPCWSTR lpszPath)
|
|||
iPrevErrMode = SetErrorMode(SEM_FAILCRITICALERRORS);
|
||||
dwAttr = GetFileAttributesW(lpszPath);
|
||||
SetErrorMode(iPrevErrMode);
|
||||
return dwAttr == INVALID_FILE_ATTRIBUTES ? FALSE : TRUE;
|
||||
return dwAttr != INVALID_FILE_ATTRIBUTES;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
|
|
|
@ -1890,17 +1890,14 @@ DWORD WINAPI SHGetValueGoodBootW(HKEY hkey, LPCWSTR pSubKey, LPCWSTR pValue,
|
|||
*/
|
||||
BOOL WINAPI RegisterMIMETypeForExtensionA(LPCSTR lpszSubKey, LPCSTR lpszValue)
|
||||
{
|
||||
DWORD dwRet;
|
||||
|
||||
if (!lpszValue)
|
||||
{
|
||||
WARN("Invalid lpszValue would crash under Win32!\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
dwRet = SHSetValueA(HKEY_CLASSES_ROOT, lpszSubKey, lpszContentTypeA,
|
||||
return !SHSetValueA(HKEY_CLASSES_ROOT, lpszSubKey, lpszContentTypeA,
|
||||
REG_SZ, lpszValue, strlen(lpszValue));
|
||||
return dwRet ? FALSE : TRUE;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
|
@ -1910,17 +1907,14 @@ BOOL WINAPI RegisterMIMETypeForExtensionA(LPCSTR lpszSubKey, LPCSTR lpszValue)
|
|||
*/
|
||||
BOOL WINAPI RegisterMIMETypeForExtensionW(LPCWSTR lpszSubKey, LPCWSTR lpszValue)
|
||||
{
|
||||
DWORD dwRet;
|
||||
|
||||
if (!lpszValue)
|
||||
{
|
||||
WARN("Invalid lpszValue would crash under Win32!\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
dwRet = SHSetValueW(HKEY_CLASSES_ROOT, lpszSubKey, lpszContentTypeW,
|
||||
return !SHSetValueW(HKEY_CLASSES_ROOT, lpszSubKey, lpszContentTypeW,
|
||||
REG_SZ, lpszValue, strlenW(lpszValue));
|
||||
return dwRet ? FALSE : TRUE;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
|
@ -1937,8 +1931,7 @@ BOOL WINAPI RegisterMIMETypeForExtensionW(LPCWSTR lpszSubKey, LPCWSTR lpszValue)
|
|||
*/
|
||||
BOOL WINAPI UnregisterMIMETypeForExtensionA(LPCSTR lpszSubKey)
|
||||
{
|
||||
HRESULT ret = SHDeleteValueA(HKEY_CLASSES_ROOT, lpszSubKey, lpszContentTypeA);
|
||||
return ret ? FALSE : TRUE;
|
||||
return !SHDeleteValueA(HKEY_CLASSES_ROOT, lpszSubKey, lpszContentTypeA);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
|
@ -1948,8 +1941,7 @@ BOOL WINAPI UnregisterMIMETypeForExtensionA(LPCSTR lpszSubKey)
|
|||
*/
|
||||
BOOL WINAPI UnregisterMIMETypeForExtensionW(LPCWSTR lpszSubKey)
|
||||
{
|
||||
HRESULT ret = SHDeleteValueW(HKEY_CLASSES_ROOT, lpszSubKey, lpszContentTypeW);
|
||||
return ret ? FALSE : TRUE;
|
||||
return !SHDeleteValueW(HKEY_CLASSES_ROOT, lpszSubKey, lpszContentTypeW);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
|
|
|
@ -365,7 +365,7 @@ BOOL WINAPI SHCreateThread(LPTHREAD_START_ROUTINE pfnThreadProc, VOID *pData,
|
|||
ti.pfnThreadProc = pfnThreadProc;
|
||||
ti.pfnCallback = pfnCallback;
|
||||
ti.pData = pData;
|
||||
ti.bInitCom = dwFlags & CTF_COINIT ? TRUE : FALSE;
|
||||
ti.bInitCom = (dwFlags & CTF_COINIT) != 0;
|
||||
ti.hEvent = CreateEventW(NULL,FALSE,FALSE,NULL);
|
||||
|
||||
/* Hold references to the current thread and IE process, if desired */
|
||||
|
|
Loading…
Reference in New Issue