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:
Rob Shearman 2008-08-17 18:31:57 +01:00 committed by Alexandre Julliard
parent 03a25b487f
commit 9dd75ea093
3 changed files with 9 additions and 7 deletions

View File

@ -422,11 +422,11 @@ HRESULT WINAPI RegisterDefaultAcceptHeaders(LPBC lpBC, IUnknown *lpUnknown)
pIEnumFormatEtc = NULL; pIEnumFormatEtc = NULL;
hRet = IUnknown_QueryInterface(pIUnknown, &IID_IEnumFORMATETC, hRet = IUnknown_QueryInterface(pIUnknown, &IID_IEnumFORMATETC,
(PVOID)&pIEnumFormatEtc); (PVOID)&pIEnumFormatEtc);
if (!hRet && pIEnumFormatEtc) if (hRet == S_OK && pIEnumFormatEtc)
{ {
/* Clone and register the enumerator */ /* Clone and register the enumerator */
hRet = IEnumFORMATETC_Clone(pIEnumFormatEtc, &pClone); hRet = IEnumFORMATETC_Clone(pIEnumFormatEtc, &pClone);
if (!hRet && pClone) if (hRet == S_OK && pClone)
{ {
RegisterFormatEnumerator(lpBC, pClone, 0); RegisterFormatEnumerator(lpBC, pClone, 0);
@ -1462,7 +1462,7 @@ HRESULT WINAPI IUnknown_QueryService(IUnknown* lpUnknown, REFGUID sid, REFIID ri
hRet = IUnknown_QueryInterface(lpUnknown, &IID_IServiceProvider, hRet = IUnknown_QueryInterface(lpUnknown, &IID_IServiceProvider,
(LPVOID*)&pService); (LPVOID*)&pService);
if (!hRet && pService) if (hRet == S_OK && pService)
{ {
TRACE("QueryInterface returned (IServiceProvider*)%p\n", pService); TRACE("QueryInterface returned (IServiceProvider*)%p\n", pService);

View File

@ -2511,8 +2511,9 @@ INT WINAPI SHUnicodeToAnsiCP(UINT CodePage, LPCWSTR lpSrcStr, LPSTR lpDstStr,
DWORD dwMode = 0; DWORD dwMode = 0;
INT nWideCharCount = len - 1; INT nWideCharCount = len - 1;
if (!ConvertINetUnicodeToMultiByte(&dwMode, CodePage, lpSrcStr, &nWideCharCount, lpDstStr, if (ConvertINetUnicodeToMultiByte(&dwMode, CodePage, lpSrcStr,
lpiLen)) &nWideCharCount, lpDstStr,
lpiLen) == S_OK)
return 0; return 0;
if (nWideCharCount < len - 1) if (nWideCharCount < len - 1)
@ -2523,7 +2524,8 @@ INT WINAPI SHUnicodeToAnsiCP(UINT CodePage, LPCWSTR lpSrcStr, LPSTR lpDstStr,
*lpiLen = 0; *lpiLen = 0;
if (ConvertINetUnicodeToMultiByte(&dwMode, CodePage, lpSrcStr, &len, mem, lpiLen)) if (ConvertINetUnicodeToMultiByte(&dwMode, CodePage, lpSrcStr, &len,
mem, lpiLen) != S_OK)
{ {
SHTruncateString(mem, *lpiLen); SHTruncateString(mem, *lpiLen);
lstrcpynA(lpDstStr, mem, *lpiLen + 1); lstrcpynA(lpDstStr, mem, *lpiLen + 1);

View File

@ -2077,7 +2077,7 @@ HRESULT WINAPI UrlGetPartW(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut,
debugstr_w(pszIn), pszOut, pcchOut, *pcchOut, dwPart, dwFlags); debugstr_w(pszIn), pszOut, pcchOut, *pcchOut, dwPart, dwFlags);
ret = URL_ParseUrl(pszIn, &pl); ret = URL_ParseUrl(pszIn, &pl);
if (!ret) { if (ret == S_OK) {
schaddr = pl.pScheme; schaddr = pl.pScheme;
schsize = pl.szScheme; schsize = pl.szScheme;