Module: wine Branch: master Commit: 23cfbe2ec8bd33a027d80e64a6d87b4aa85dd563 URL: http://source.winehq.org/git/wine.git/?a=commit;h=23cfbe2ec8bd33a027d80e64a6...
Author: Misha Koshelev mk144210@bcm.edu Date: Mon May 14 12:16:07 2007 -0500
msi: automation: Simplify counting products/related products.
---
dlls/msi/automation.c | 16 ++++------------ 1 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/dlls/msi/automation.c b/dlls/msi/automation.c index c6088de..1030f96 100644 --- a/dlls/msi/automation.c +++ b/dlls/msi/automation.c @@ -1367,12 +1367,8 @@ static HRESULT WINAPI InstallerImpl_Invoke( WCHAR szProductBuf[GUID_SIZE];
/* Find number of products */ - do { - ret = MsiEnumProductsW(idx, szProductBuf); - if (ret == ERROR_SUCCESS) idx++; - } while (ret == ERROR_SUCCESS && ret != ERROR_NO_MORE_ITEMS); - - if (ret != ERROR_SUCCESS && ret != ERROR_NO_MORE_ITEMS) + while ((ret = MsiEnumProductsW(idx, szProductBuf)) == ERROR_SUCCESS) idx++; + if (ret != ERROR_NO_MORE_ITEMS) { ERR("MsiEnumProducts returned %d\n", ret); return DISP_E_EXCEPTION; @@ -1415,12 +1411,8 @@ static HRESULT WINAPI InstallerImpl_Invoke( if (FAILED(hr)) return hr;
/* Find number of related products */ - do { - ret = MsiEnumRelatedProductsW(V_BSTR(&varg0), 0, idx, szProductBuf); - if (ret == ERROR_SUCCESS) idx++; - } while (ret == ERROR_SUCCESS); - - if (ret != ERROR_SUCCESS && ret != ERROR_NO_MORE_ITEMS) + while ((ret = MsiEnumRelatedProductsW(V_BSTR(&varg0), 0, idx, szProductBuf)) == ERROR_SUCCESS) idx++; + if (ret != ERROR_NO_MORE_ITEMS) { VariantClear(&varg0); ERR("MsiEnumRelatedProducts returned %d\n", ret);