Use a macro to check the HRESULT

Authored by vonreth on Jun 4 2019, 7:09 AM.