Commit c85b74d6 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

In the PSDK HRESULT_FROM_WIN32() is now an inline function, and it is…

In the PSDK HRESULT_FROM_WIN32() is now an inline function, and it is __HRESULT_FROM_WIN32() which is a macro.
parent 47b6392b
......@@ -373,9 +373,9 @@ static const struct {
{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";
......
......@@ -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 */
......
......@@ -398,10 +398,13 @@ typedef LPCSTR PCTSTR, LPCTSTR;
/* 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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment