From 65de799958bb9d07c124333a8d0bf7e0cc4ed5a0 Mon Sep 17 00:00:00 2001 From: Rob Shearman Date: Tue, 30 Sep 2008 13:54:57 +0100 Subject: [PATCH] comcat: Fix mixing of HRESULT and LSTATUS types in COMCAT_CLSID_IEnumGUID_Next, COMCAT_IEnumCATEGORYINFO_Next and COMCAT_CATID_IEnumGUID_Next. (Found by PreFast.) --- dlls/comcat/information.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/dlls/comcat/information.c b/dlls/comcat/information.c index cd5a9ea9dd9..d2d4df8adac 100644 --- a/dlls/comcat/information.c +++ b/dlls/comcat/information.c @@ -373,7 +373,8 @@ static HRESULT WINAPI COMCAT_IEnumCATEGORYINFO_Next( if (This == NULL || rgelt == NULL) return E_POINTER; if (This->key) while (fetched < celt) { - HRESULT res; + LSTATUS res; + HRESULT hr; WCHAR catid[39]; DWORD cName = 39; HKEY subkey; @@ -383,16 +384,16 @@ static HRESULT WINAPI COMCAT_IEnumCATEGORYINFO_Next( if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA) break; ++(This->next_index); - res = CLSIDFromString(catid, &rgelt->catid); - if (FAILED(res)) continue; + hr = CLSIDFromString(catid, &rgelt->catid); + if (FAILED(hr)) continue; res = RegOpenKeyExW(This->key, catid, 0, KEY_READ, &subkey); if (res != ERROR_SUCCESS) continue; - res = COMCAT_GetCategoryDesc(subkey, This->lcid, - rgelt->szDescription, 128); + hr = COMCAT_GetCategoryDesc(subkey, This->lcid, + rgelt->szDescription, 128); RegCloseKey(subkey); - if (FAILED(res)) continue; + if (FAILED(hr)) continue; rgelt->lcid = This->lcid; ++fetched; @@ -677,7 +678,8 @@ static HRESULT WINAPI COMCAT_CLSID_IEnumGUID_Next( if (This == NULL || rgelt == NULL) return E_POINTER; if (This->key) while (fetched < celt) { - HRESULT res; + LSTATUS res; + HRESULT hr; WCHAR clsid[39]; DWORD cName = 39; HKEY subkey; @@ -687,15 +689,15 @@ static HRESULT WINAPI COMCAT_CLSID_IEnumGUID_Next( if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA) break; ++(This->next_index); - res = CLSIDFromString(clsid, rgelt); - if (FAILED(res)) continue; + hr = CLSIDFromString(clsid, rgelt); + if (FAILED(hr)) continue; res = RegOpenKeyExW(This->key, clsid, 0, KEY_READ, &subkey); if (res != ERROR_SUCCESS) continue; - res = COMCAT_IsClassOfCategories(subkey, This->categories); + hr = COMCAT_IsClassOfCategories(subkey, This->categories); RegCloseKey(subkey); - if (res != S_OK) continue; + if (hr != S_OK) continue; ++fetched; ++rgelt; @@ -868,7 +870,8 @@ static HRESULT WINAPI COMCAT_CATID_IEnumGUID_Next( if (This == NULL || rgelt == NULL) return E_POINTER; if (This->key) while (fetched < celt) { - HRESULT res; + LSTATUS res; + HRESULT hr; WCHAR catid[39]; DWORD cName = 39; @@ -877,8 +880,8 @@ static HRESULT WINAPI COMCAT_CATID_IEnumGUID_Next( if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA) break; ++(This->next_index); - res = CLSIDFromString(catid, rgelt); - if (FAILED(res)) continue; + hr = CLSIDFromString(catid, rgelt); + if (FAILED(hr)) continue; ++fetched; ++rgelt; -- 2.11.4.GIT