get rid of HRESULT in non-win32 code
drop unnecessary typedefs and defines