From 747bbec4bbfd048c1289bc65adcf1ed79829f3b6 Mon Sep 17 00:00:00 2001 From: Giannis Adamopoulos Date: Sat, 28 Mar 2015 21:11:42 +0000 Subject: [PATCH] [PSDK] - Make IsEqualGUID typesafe for c++ [SHELL32] - Properly call IsEqualIID in _ILIsControlPanel. Should fix CORE-8891. svn path=/trunk/; revision=66938 --- reactos/dll/win32/shell32/folders/CDrivesFolder.cpp | 6 +++--- reactos/include/psdk/guiddef.h | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp b/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp index c7b945c435a..e20d2e14442 100644 --- a/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp +++ b/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp @@ -332,12 +332,12 @@ HRESULT WINAPI CDrivesFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVO static BOOL _ILIsControlPanel(LPCITEMIDLIST pidl) { - IID *iid = _ILGetGUIDPointer(pidl); + GUID *guid = _ILGetGUIDPointer(pidl); TRACE("(%p)\n", pidl); - if (iid) - return IsEqualIID(iid, CLSID_ControlPanel); + if (guid) + return IsEqualIID(*guid, CLSID_ControlPanel); return FALSE; } diff --git a/reactos/include/psdk/guiddef.h b/reactos/include/psdk/guiddef.h index 22e532b7cf5..8e8b7c92e35 100644 --- a/reactos/include/psdk/guiddef.h +++ b/reactos/include/psdk/guiddef.h @@ -126,7 +126,11 @@ __inline int InlineIsEqualGUID(REFGUID rguid1, REFGUID rguid2) ((unsigned long *) &rguid1)[2] == ((unsigned long *) &rguid2)[2] && ((unsigned long *) &rguid1)[3] == ((unsigned long *) &rguid2)[3]); } -#define IsEqualGUID(rguid1, rguid2) (!memcmp(&(rguid1), &(rguid2), sizeof(GUID))) + +__inline int IsEqualGUID(REFGUID rguid1, REFGUID rguid2) +{ + return !memcmp(&rguid1, &rguid2, sizeof(GUID)); +} #else /* defined(__cplusplus) && !defined(CINTERFACE) */