Rob Shearman : uxtheme: SetPropW returns a BOOL not an HRESULT.
Alexandre Julliard
julliard at winehq.org
Tue Sep 30 11:16:44 CDT 2008
Module: wine
Branch: master
Commit: 739bdaeb86bf7f29ea5a13e3a79ea98008d80a3e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=739bdaeb86bf7f29ea5a13e3a79ea98008d80a3e
Author: Rob Shearman <robertshearman at gmail.com>
Date: Tue Sep 30 13:55:03 2008 +0100
uxtheme: SetPropW returns a BOOL not an HRESULT.
Therefore fix the code to handle SetPropW failing with this in mind.
(Found by PreFast.)
---
dlls/uxtheme/draw.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/dlls/uxtheme/draw.c b/dlls/uxtheme/draw.c
index 8b3b959..ff0ac9e 100644
--- a/dlls/uxtheme/draw.c
+++ b/dlls/uxtheme/draw.c
@@ -52,19 +52,18 @@ extern ATOM atDialogThemeEnabled;
HRESULT WINAPI EnableThemeDialogTexture(HWND hwnd, DWORD dwFlags)
{
static const WCHAR szTab[] = { 'T','a','b',0 };
- HRESULT hr;
+ BOOL res;
TRACE("(%p,0x%08x\n", hwnd, dwFlags);
- hr = SetPropW (hwnd, (LPCWSTR)MAKEINTATOM(atDialogThemeEnabled),
+ res = SetPropW (hwnd, (LPCWSTR)MAKEINTATOM(atDialogThemeEnabled),
(HANDLE)(dwFlags|0x80000000));
/* 0x80000000 serves as a "flags set" flag */
- if (FAILED(hr))
- return hr;
+ if (!res)
+ return HRESULT_FROM_WIN32(GetLastError());
if (dwFlags & ETDT_USETABTEXTURE)
return SetWindowTheme (hwnd, NULL, szTab);
else
return SetWindowTheme (hwnd, NULL, NULL);
- return S_OK;
}
/***********************************************************************
More information about the wine-cvs
mailing list