mirror of https://github.com/OpenRCT2/OpenRCT2.git
osinterface: use FAILED macro to check for success of CoInitializeEx / SHGetMalloc.
This commit is contained in:
parent
521e868b6f
commit
4485e3dd72
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue