mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-20 13:33:02 +01:00
osinterface: use FAILED macro to check for success of CoInitializeEx / SHGetMalloc.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user