In the PSDK HRESULT_FROM_WIN32() is now an inline function, and it is __HRESULT_FROM_WIN32() which is a macro.
diff --git a/dlls/urlmon/tests/misc.c b/dlls/urlmon/tests/misc.c
index 67e0d3d..375875b 100644
--- a/dlls/urlmon/tests/misc.c
+++ b/dlls/urlmon/tests/misc.c
@@ -373,9 +373,9 @@
     {url2, mimeTextHtml, S_OK},
     {url3, mimeTextHtml, S_OK},
     {url4, NULL, E_FAIL},
-    {url5, NULL, HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)},
+    {url5, NULL, __HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)},
     {url6, NULL, E_FAIL},
-    {url7, NULL, HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)}
+    {url7, NULL, __HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)}
 };
 
 static BYTE data1[] = "test data\n";
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 */
diff --git a/include/winnt.h b/include/winnt.h
index 04f5cf6..71dbf6d 100644
--- a/include/winnt.h
+++ b/include/winnt.h
@@ -398,10 +398,13 @@
 
 /* Misc common WIN32 types */
 typedef char            CCHAR;
-typedef LONG            HRESULT;
 typedef DWORD           LCID,       *PLCID;
 typedef WORD            LANGID;
 typedef DWORD		EXECUTION_STATE;
+#ifndef _HRESULT_DEFINED
+#define _HRESULT_DEFINED
+typedef LONG            HRESULT;
+#endif
 
 /* Handle type */