Artifact 34ddc3a78f9452b88e9fef8c49f93b9f0cf378b1:
- File
src/win32/directx/dxerr8.d
-
2015-05-05 06:49:05
- part of checkin
[9b639cf2d6]
on branch trunk
- Working version for update to 2.067.
The problem was __gshared. Replacing it with TLS fixed the issue. Remaining problem is that "hack.d"'s CloseHandle hack is not working anymore.
(user: kinaba) [annotate]
-
2015-05-05 06:49:05
- part of checkin
[9b639cf2d6]
on branch trunk
- Working version for update to 2.067.
0000: 2f 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a /*************** 0010: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a **************** 0020: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a **************** 0030: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a **************** 0040: 2a 2a 2a 2a 2a 2a 2a 2a 5c 0d 0a 2a 20 20 20 20 ********\..* 0050: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0060: 20 20 20 20 20 20 20 20 20 20 20 20 64 78 65 72 dxer 0070: 72 38 2e 64 20 20 20 20 20 20 20 20 20 20 20 20 r8.d 0080: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0090: 20 20 20 2a 0d 0a 2a 20 20 20 20 20 20 20 20 20 *..* 00a0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 00b0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 00c0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 00d0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2a 0d *. 00e0: 0a 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .* 00f0: 20 20 20 20 20 20 20 20 20 57 69 6e 64 6f 77 73 Windows 0100: 20 41 50 49 20 68 65 61 64 65 72 20 6d 6f 64 75 API header modu 0110: 6c 65 20 20 20 20 20 20 20 20 20 20 20 20 20 20 le 0120: 20 20 20 20 20 20 20 20 20 2a 0d 0a 2a 20 20 20 *..* 0130: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0140: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0150: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0160: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0170: 20 20 20 20 2a 0d 0a 2a 20 20 20 20 20 20 20 20 *..* 0180: 20 20 20 20 20 20 20 20 20 54 72 61 6e 73 6c 61 Transla 0190: 74 65 64 20 66 72 6f 6d 20 4d 69 6e 47 57 20 57 ted from MinGW W 01a0: 69 6e 64 6f 77 73 20 68 65 61 64 65 72 73 20 20 indows headers 01b0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2a * 01c0: 0d 0a 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 ..* 01d0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 01e0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 01f0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0200: 20 20 20 20 20 20 20 20 20 20 2a 0d 0a 2a 20 20 *..* 0210: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0220: 20 20 20 20 20 50 6c 61 63 65 64 20 69 6e 74 6f Placed into 0230: 20 70 75 62 6c 69 63 20 64 6f 6d 61 69 6e 20 20 public domain 0240: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0250: 20 20 20 20 20 2a 0d 0a 5c 2a 2a 2a 2a 2a 2a 2a *..\******* 0260: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a **************** 0270: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a **************** 0280: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a **************** 0290: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a **************** 02a0: 2f 0d 0a 6d 6f 64 75 6c 65 20 77 69 6e 33 32 2e /..module win32. 02b0: 64 69 72 65 63 74 78 2e 64 78 65 72 72 38 3b 0d directx.dxerr8;. 02c0: 0a 0d 0a 2f 2a 0d 0a 09 64 78 65 72 72 38 2e 64 .../*...dxerr8.d 02d0: 20 2d 20 48 65 61 64 65 72 20 66 69 6c 65 20 66 - Header file f 02e0: 6f 72 20 74 68 65 20 44 69 72 65 63 74 58 20 38 or the DirectX 8 02f0: 20 45 72 72 6f 72 20 41 50 49 0d 0a 0d 0a 09 57 Error API.....W 0300: 72 69 74 74 65 6e 20 62 79 20 46 69 6c 69 70 20 ritten by Filip 0310: 4e 61 76 61 72 61 20 3c 78 6e 61 76 61 72 61 40 Navara <xnavara@ 0320: 76 6f 6c 6e 79 2e 63 7a 3e 0d 0a 09 50 6f 72 74 volny.cz>...Port 0330: 65 64 20 74 6f 20 44 20 62 79 20 4a 61 6d 65 73 ed to D by James 0340: 20 50 65 6c 63 69 73 20 3c 6a 70 65 6c 63 69 73 Pelcis <jpelcis 0350: 40 67 6d 61 69 6c 2e 63 6f 6d 3e 0d 0a 0d 0a 09 @gmail.com>..... 0360: 54 68 69 73 20 6c 69 62 72 61 72 79 20 69 73 20 This library is 0370: 64 69 73 74 72 69 62 75 74 65 64 20 69 6e 20 74 distributed in t 0380: 68 65 20 68 6f 70 65 20 74 68 61 74 20 69 74 20 he hope that it 0390: 77 69 6c 6c 20 62 65 20 75 73 65 66 75 6c 2c 0d will be useful,. 03a0: 0a 09 62 75 74 20 57 49 54 48 4f 55 54 20 41 4e ..but WITHOUT AN 03b0: 59 20 57 41 52 52 41 4e 54 59 3b 20 77 69 74 68 Y WARRANTY; with 03c0: 6f 75 74 20 65 76 65 6e 20 74 68 65 20 69 6d 70 out even the imp 03d0: 6c 69 65 64 20 77 61 72 72 61 6e 74 79 20 6f 66 lied warranty of 03e0: 0d 0a 09 4d 45 52 43 48 41 4e 54 41 42 49 4c 49 ...MERCHANTABILI 03f0: 54 59 20 6f 72 20 46 49 54 4e 45 53 53 20 46 4f TY or FITNESS FO 0400: 52 20 41 20 50 41 52 54 49 43 55 4c 41 52 20 50 R A PARTICULAR P 0410: 55 52 50 4f 53 45 2e 0d 0a 2a 2f 0d 0a 0d 0a 70 URPOSE...*/....p 0420: 72 69 76 61 74 65 20 69 6d 70 6f 72 74 20 77 69 rivate import wi 0430: 6e 33 32 2e 77 69 6e 64 65 66 3b 0d 0a 0d 0a 65 n32.windef;....e 0440: 78 74 65 72 6e 20 28 57 69 6e 64 6f 77 73 29 20 xtern (Windows) 0450: 7b 0d 0a 09 63 68 61 72 2a 20 44 58 47 65 74 45 {...char* DXGetE 0460: 72 72 6f 72 53 74 72 69 6e 67 38 41 20 28 48 52 rrorString8A (HR 0470: 45 53 55 4c 54 29 3b 0d 0a 09 57 43 48 41 52 2a ESULT);...WCHAR* 0480: 20 44 58 47 65 74 45 72 72 6f 72 53 74 72 69 6e DXGetErrorStrin 0490: 67 38 57 20 28 48 52 45 53 55 4c 54 29 3b 0d 0a g8W (HRESULT);.. 04a0: 09 63 68 61 72 2a 20 44 58 47 65 74 45 72 72 6f .char* DXGetErro 04b0: 72 44 65 73 63 72 69 70 74 69 6f 6e 38 41 20 28 rDescription8A ( 04c0: 48 52 45 53 55 4c 54 29 3b 0d 0a 09 57 43 48 41 HRESULT);...WCHA 04d0: 52 2a 20 44 58 47 65 74 45 72 72 6f 72 44 65 73 R* DXGetErrorDes 04e0: 63 72 69 70 74 69 6f 6e 38 57 20 28 48 52 45 53 cription8W (HRES 04f0: 55 4c 54 29 3b 0d 0a 09 48 52 45 53 55 4c 54 20 ULT);...HRESULT 0500: 44 58 54 72 61 63 65 41 20 28 63 68 61 72 2a 2c DXTraceA (char*, 0510: 20 44 57 4f 52 44 2c 20 48 52 45 53 55 4c 54 2c DWORD, HRESULT, 0520: 20 63 68 61 72 2a 2c 20 42 4f 4f 4c 29 3b 0d 0a char*, BOOL);.. 0530: 09 48 52 45 53 55 4c 54 20 44 58 54 72 61 63 65 .HRESULT DXTrace 0540: 57 20 28 63 68 61 72 2a 2c 20 44 57 4f 52 44 2c W (char*, DWORD, 0550: 20 48 52 45 53 55 4c 54 2c 20 57 43 48 41 52 2a HRESULT, WCHAR* 0560: 2c 20 42 4f 4f 4c 29 3b 0d 0a 7d 0d 0a 0d 0a 76 , BOOL);..}....v 0570: 65 72 73 69 6f 6e 20 28 55 6e 69 63 6f 64 65 29 ersion (Unicode) 0580: 20 7b 0d 0a 09 61 6c 69 61 73 20 44 58 47 65 74 {...alias DXGet 0590: 45 72 72 6f 72 53 74 72 69 6e 67 38 57 20 44 58 ErrorString8W DX 05a0: 47 65 74 45 72 72 6f 72 53 74 72 69 6e 67 38 3b GetErrorString8; 05b0: 0d 0a 09 61 6c 69 61 73 20 44 58 47 65 74 45 72 ...alias DXGetEr 05c0: 72 6f 72 44 65 73 63 72 69 70 74 69 6f 6e 38 57 rorDescription8W 05d0: 20 44 58 47 65 74 45 72 72 6f 72 44 65 73 63 72 DXGetErrorDescr 05e0: 69 70 74 69 6f 6e 38 3b 0d 0a 09 61 6c 69 61 73 iption8;...alias 05f0: 20 44 58 54 72 61 63 65 57 20 44 58 54 72 61 63 DXTraceW DXTrac 0600: 65 3b 0d 0a 7d 20 65 6c 73 65 20 7b 0d 0a 09 61 e;..} else {...a 0610: 6c 69 61 73 20 44 58 47 65 74 45 72 72 6f 72 53 lias DXGetErrorS 0620: 74 72 69 6e 67 38 41 20 44 58 47 65 74 45 72 72 tring8A DXGetErr 0630: 6f 72 53 74 72 69 6e 67 38 3b 0d 0a 09 61 6c 69 orString8;...ali 0640: 61 73 20 44 58 47 65 74 45 72 72 6f 72 44 65 73 as DXGetErrorDes 0650: 63 72 69 70 74 69 6f 6e 38 41 20 44 58 47 65 74 cription8A DXGet 0660: 45 72 72 6f 72 44 65 73 63 72 69 70 74 69 6f 6e ErrorDescription 0670: 38 3b 0d 0a 09 61 6c 69 61 73 20 44 58 54 72 61 8;...alias DXTra 0680: 63 65 41 20 44 58 54 72 61 63 65 3b 0d 0a 7d 0d ceA DXTrace;..}. 0690: 0a 0d 0a 64 65 62 75 67 20 28 64 78 65 72 72 29 ...debug (dxerr) 06a0: 20 7b 0d 0a 09 48 52 45 53 55 4c 54 20 44 58 54 {...HRESULT DXT 06b0: 52 41 43 45 5f 4d 53 47 28 54 43 48 41 52 2a 20 RACE_MSG(TCHAR* 06c0: 73 74 72 29 20 7b 0d 0a 09 09 72 65 74 75 72 6e str) {....return 06d0: 20 44 58 54 72 61 63 65 28 5f 5f 46 49 4c 45 5f DXTrace(__FILE_ 06e0: 5f 2c 20 5f 5f 4c 49 4e 45 5f 5f 2c 20 30 2c 20 _, __LINE__, 0, 06f0: 73 74 72 2c 20 46 41 4c 53 45 29 3b 0d 0a 09 7d str, FALSE);...} 0700: 0d 0a 0d 0a 09 48 52 45 53 55 4c 54 20 44 58 54 .....HRESULT DXT 0710: 52 41 43 45 5f 45 52 52 28 54 43 48 41 52 2a 20 RACE_ERR(TCHAR* 0720: 73 74 72 2c 20 48 52 45 53 55 4c 54 20 68 72 29 str, HRESULT hr) 0730: 20 7b 0d 0a 09 09 72 65 74 75 72 6e 20 44 58 54 {....return DXT 0740: 72 61 63 65 28 5f 5f 46 49 4c 45 5f 5f 2c 20 5f race(__FILE__, _ 0750: 5f 4c 49 4e 45 5f 5f 2c 20 68 72 2c 20 73 74 72 _LINE__, hr, str 0760: 2c 20 54 52 55 45 29 3b 0d 0a 09 7d 0d 0a 0d 0a , TRUE);...}.... 0770: 09 48 52 45 53 55 4c 54 20 44 58 54 52 41 43 45 .HRESULT DXTRACE 0780: 5f 45 52 52 5f 4e 4f 4d 53 47 42 4f 58 20 28 57 _ERR_NOMSGBOX (W 0790: 43 48 41 52 2a 20 73 74 72 2c 20 48 52 45 53 55 CHAR* str, HRESU 07a0: 4c 54 20 68 72 29 20 7b 0d 0a 09 09 72 65 74 75 LT hr) {....retu 07b0: 72 6e 20 44 58 54 72 61 63 65 28 5f 5f 46 49 4c rn DXTrace(__FIL 07c0: 45 5f 5f 2c 20 5f 5f 4c 49 4e 45 5f 5f 2c 20 68 E__, __LINE__, h 07d0: 72 2c 20 73 74 72 2c 20 46 41 4c 53 45 29 3b 0d r, str, FALSE);. 07e0: 0a 09 7d 0d 0a 7d 20 65 6c 73 65 20 7b 0d 0a 09 ..}..} else {... 07f0: 48 52 45 53 55 4c 54 20 44 58 54 52 41 43 45 5f HRESULT DXTRACE_ 0800: 4d 53 47 28 54 43 48 41 52 2a 20 73 74 72 29 20 MSG(TCHAR* str) 0810: 7b 0d 0a 09 09 72 65 74 75 72 6e 20 30 3b 0d 0a {....return 0;.. 0820: 09 7d 0d 0a 0d 0a 09 48 52 45 53 55 4c 54 20 44 .}.....HRESULT D 0830: 58 54 52 41 43 45 5f 45 52 52 28 54 43 48 41 52 XTRACE_ERR(TCHAR 0840: 2a 20 73 74 72 2c 20 48 52 45 53 55 4c 54 20 68 * str, HRESULT h 0850: 72 29 20 7b 0d 0a 09 09 72 65 74 75 72 6e 20 68 r) {....return h 0860: 72 3b 0d 0a 09 7d 0d 0a 0d 0a 09 48 52 45 53 55 r;...}.....HRESU 0870: 4c 54 20 44 58 54 52 41 43 45 5f 45 52 52 5f 4e LT DXTRACE_ERR_N 0880: 4f 4d 53 47 42 4f 58 28 54 43 48 41 52 2a 20 73 OMSGBOX(TCHAR* s 0890: 74 72 2c 20 48 52 45 53 55 4c 54 20 68 72 29 20 tr, HRESULT hr) 08a0: 7b 0d 0a 09 09 72 65 74 75 72 6e 20 68 72 3b 0d {....return hr;. 08b0: 0a 09 7d 0d 0a 7d 0d 0a ..}..}..