http://bugs.winehq.org/show_bug.cgi?id=20005
Summary: MAKE_HRESULT macro is defined wrong.. Product: Wine Version: 1.1.29 Platform: PC OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: directx-d3d AssignedTo: wine-bugs@winehq.org ReportedBy: celticht32@aol.com
#define MAKE_HRESULT(sev,fac,code) \ ((HRESULT) (((unsigned int)(sev)<<31) | ((unsigned int)(fac)<<16) | ((unsigned int)(code))) )
which is defined in include/winerror.h
should be the following :
#define MAKE_HRESULT(sev,fac,code) \ ((HRESULT) (((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code))) )
so for the following call make_hresult(1,_facwined3d,2152)
I believe the first macro translates it to :
1 | 43B | 434
not
1 | 876 | 868
according to MSDN site :
http://msdn.microsoft.com/en-us/library/ms694497(VS.85).aspx
and the C spec states the following:
The C++ spec states summit like an unsigned long must be at least 32-bits and an unsigned int must be at least 16-bits.
So I think we are dropping 16 bits when this is being used which might explain some of the test failures on some of the machines...
http://bugs.winehq.org/show_bug.cgi?id=20005
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID
--- Comment #1 from Alexandre Julliard julliard@winehq.org 2009-09-10 15:26:11 --- An int is 32-bit. The macro is fine.
http://bugs.winehq.org/show_bug.cgi?id=20005
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED Component|directx-d3d |-unknown
--- Comment #2 from Vitaliy Margolen vitaliy@kievinfo.com 2009-09-10 20:50:22 --- Agreed, closing invalid.
int is 32-bit on both 32-bit and 64-bit architectures. While long is 32-bit on x86 and 64-bit on x86-64.