Nikolay Sivov : msdmo: Fix RegOpenKeyExW() failure condition.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Dec 29 15:42:42 CST 2014
Module: wine
Branch: master
Commit: 6eab4981601408237b9eac0f3e49f33562df6a82
URL: http://source.winehq.org/git/wine.git/?a=commit;h=6eab4981601408237b9eac0f3e49f33562df6a82
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Mon Dec 29 00:22:11 2014 +0300
msdmo: Fix RegOpenKeyExW() failure condition.
Spotted by Mark Harmstone.
---
dlls/msdmo/dmoreg.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/dlls/msdmo/dmoreg.c b/dlls/msdmo/dmoreg.c
index 77ddfa6..74ab6b6 100644
--- a/dlls/msdmo/dmoreg.c
+++ b/dlls/msdmo/dmoreg.c
@@ -364,6 +364,7 @@ static HRESULT IEnumDMO_Constructor(
IEnumDMOImpl* lpedmo;
HRESULT hr = S_OK;
UINT size;
+ LONG ret;
*obj = NULL;
@@ -406,8 +407,8 @@ static HRESULT IEnumDMO_Constructor(
/* If not filtering by category enum from media objects root */
if (IsEqualGUID(guidCategory, &GUID_NULL))
{
- if (!RegOpenKeyExW(HKEY_CLASSES_ROOT, szDMORootKey, 0, KEY_READ, &lpedmo->hkey))
- hr = E_FAIL;
+ if ((ret = RegOpenKeyExW(HKEY_CLASSES_ROOT, szDMORootKey, 0, KEY_READ, &lpedmo->hkey)))
+ hr = HRESULT_FROM_WIN32(ret);
}
else
{
@@ -416,8 +417,8 @@ static HRESULT IEnumDMO_Constructor(
wsprintfW(szKey, szCat3Fmt, szDMORootKey, szDMOCategories,
GUIDToString(szguid, guidCategory));
- if (!RegOpenKeyExW(HKEY_CLASSES_ROOT, szKey, 0, KEY_READ, &lpedmo->hkey))
- hr = E_FAIL;
+ if ((ret = RegOpenKeyExW(HKEY_CLASSES_ROOT, szKey, 0, KEY_READ, &lpedmo->hkey)))
+ hr = HRESULT_FROM_WIN32(ret);
}
lerr:
More information about the wine-cvs
mailing list