In the PSDK HRESULT_FROM_WIN32() is now an inline function, and it is __HRESULT_FROM_WIN32() which is a macro.
diff --git a/include/winerror.h b/include/winerror.h
index 437cc83..6eb6822 100644
--- a/include/winerror.h
+++ b/include/winerror.h
@@ -81,8 +81,20 @@
 #define HRESULT_SEVERITY(hr)    (((hr) >> 31) & 0x1)
 #define SCODE_SEVERITY(sc)      (((sc) >> 31) & 0x1)
 
+#define __HRESULT_FROM_WIN32(x)   ((x) ? ((HRESULT) (((x) & 0x0000FFFF) | (FACILITY_WIN32 << 16) | 0x80000000)) : 0 )
+#ifndef _HRESULT_DEFINED
+#define _HRESULT_DEFINED
+# ifdef _MSC_VER
+typedef long            HRESULT;
+# else
+typedef int             HRESULT;
+# endif
+#endif
+static inline HRESULT HRESULT_FROM_WIN32(unsigned long x)
+{
+    return x ? ((HRESULT) ((x & 0x0000FFFF) | (FACILITY_WIN32 << 16) | 0x80000000)) : 0;
+}
 #define FACILITY_NT_BIT         0x10000000
-#define HRESULT_FROM_WIN32(x)   ((x) ? ((HRESULT) (((x) & 0x0000FFFF) | (FACILITY_WIN32 << 16) | 0x80000000)) : 0 )
 #define HRESULT_FROM_NT(x)      ((HRESULT) ((x) | FACILITY_NT_BIT))
 
 /* SCODE <-> HRESULT functions */