shlwapi: Fix testing of HRESULT types with not operator instead of comparing against S_OK.
This makes it more obvious what the code is doing.
This commit is contained in:
parent
03a25b487f
commit
9dd75ea093
|
@ -422,11 +422,11 @@ HRESULT WINAPI RegisterDefaultAcceptHeaders(LPBC lpBC, IUnknown *lpUnknown)
|
|||
pIEnumFormatEtc = NULL;
|
||||
hRet = IUnknown_QueryInterface(pIUnknown, &IID_IEnumFORMATETC,
|
||||
(PVOID)&pIEnumFormatEtc);
|
||||
if (!hRet && pIEnumFormatEtc)
|
||||
if (hRet == S_OK && pIEnumFormatEtc)
|
||||
{
|
||||
/* Clone and register the enumerator */
|
||||
hRet = IEnumFORMATETC_Clone(pIEnumFormatEtc, &pClone);
|
||||
if (!hRet && pClone)
|
||||
if (hRet == S_OK && pClone)
|
||||
{
|
||||
RegisterFormatEnumerator(lpBC, pClone, 0);
|
||||
|
||||
|
@ -1462,7 +1462,7 @@ HRESULT WINAPI IUnknown_QueryService(IUnknown* lpUnknown, REFGUID sid, REFIID ri
|
|||
hRet = IUnknown_QueryInterface(lpUnknown, &IID_IServiceProvider,
|
||||
(LPVOID*)&pService);
|
||||
|
||||
if (!hRet && pService)
|
||||
if (hRet == S_OK && pService)
|
||||
{
|
||||
TRACE("QueryInterface returned (IServiceProvider*)%p\n", pService);
|
||||
|
||||
|
|
|
@ -2511,8 +2511,9 @@ INT WINAPI SHUnicodeToAnsiCP(UINT CodePage, LPCWSTR lpSrcStr, LPSTR lpDstStr,
|
|||
DWORD dwMode = 0;
|
||||
INT nWideCharCount = len - 1;
|
||||
|
||||
if (!ConvertINetUnicodeToMultiByte(&dwMode, CodePage, lpSrcStr, &nWideCharCount, lpDstStr,
|
||||
lpiLen))
|
||||
if (ConvertINetUnicodeToMultiByte(&dwMode, CodePage, lpSrcStr,
|
||||
&nWideCharCount, lpDstStr,
|
||||
lpiLen) == S_OK)
|
||||
return 0;
|
||||
|
||||
if (nWideCharCount < len - 1)
|
||||
|
@ -2523,7 +2524,8 @@ INT WINAPI SHUnicodeToAnsiCP(UINT CodePage, LPCWSTR lpSrcStr, LPSTR lpDstStr,
|
|||
|
||||
*lpiLen = 0;
|
||||
|
||||
if (ConvertINetUnicodeToMultiByte(&dwMode, CodePage, lpSrcStr, &len, mem, lpiLen))
|
||||
if (ConvertINetUnicodeToMultiByte(&dwMode, CodePage, lpSrcStr, &len,
|
||||
mem, lpiLen) != S_OK)
|
||||
{
|
||||
SHTruncateString(mem, *lpiLen);
|
||||
lstrcpynA(lpDstStr, mem, *lpiLen + 1);
|
||||
|
|
|
@ -2077,7 +2077,7 @@ HRESULT WINAPI UrlGetPartW(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut,
|
|||
debugstr_w(pszIn), pszOut, pcchOut, *pcchOut, dwPart, dwFlags);
|
||||
|
||||
ret = URL_ParseUrl(pszIn, &pl);
|
||||
if (!ret) {
|
||||
if (ret == S_OK) {
|
||||
schaddr = pl.pScheme;
|
||||
schsize = pl.szScheme;
|
||||
|
||||
|
|
Loading…
Reference in New Issue