From 4485e3dd72a29bf64555a0f54cafe960e235d2ec Mon Sep 17 00:00:00 2001 From: Patrick Wijnings Date: Fri, 13 Jun 2014 14:44:40 +0200 Subject: [PATCH] osinterface: use FAILED macro to check for success of CoInitializeEx / SHGetMalloc. --- src/osinterface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osinterface.c b/src/osinterface.c index 0843f127c5..3741f6bfd2 100644 --- a/src/osinterface.c +++ b/src/osinterface.c @@ -394,14 +394,14 @@ char* osinterface_open_directory_browser(char *title) { LPMALLOC lpMalloc; // Initialize COM - if (CoInitializeEx(0, COINIT_APARTMENTTHREADED) != S_OK) { + if (FAILED(CoInitializeEx(0, COINIT_APARTMENTTHREADED))) { MessageBox(NULL, _T("Error opening browse window"), _T("ERROR"), MB_OK); CoUninitialize(); return 0; } // Get a pointer to the shell memory allocator - if (SHGetMalloc(&lpMalloc) != S_OK) { + if (FAILED(SHGetMalloc(&lpMalloc))) { MessageBox(NULL, _T("Error opening browse window"), _T("ERROR"), MB_OK); CoUninitialize(); return 0;