ReactOS  0.4.15-dev-5463-g138eb58
compat.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <typedefs.h>
4 #include <guiddef.h>
5 #include <pecoff.h>
6 #include <wine/unicode.h>
7 
8 #include <stdio.h>
9 #include <stdlib.h>
10 #include <wchar.h>
11 #include <ctype.h>
12 #include <wctype.h>
13 
14 #define wcsnicmp strncmpiW
15 #define wcsicmp strcmpiW
16 #define wcsrchr strrchrW
17 #define wcschr strchrW
18 
19 typedef HANDLE HWND;
20 
21 #define min(x, y) (((x) < (y)) ? (x) : (y))
22 #define max(x, y) (((x) > (y)) ? (x) : (y))
23 #define _strnicmp(_String1, _String2, _MaxCount) strncasecmp(_String1, _String2, _MaxCount)
24 #define stricmp(_String1, _String2) strcasecmp(_String1, _String2)
25 
26 #ifdef __i386__
27 #define CDECL __cdecl
28 #else
29 #define CDECL
30 #endif
32 
33 // windef.h
34 #define MAX_PATH 260
35 #define CALLBACK
36 typedef int (*FARPROC)();
37 
38 // bytesex.h
39 #define SWAPD(x) x
40 #define SWAPW(x) x
41 
42 // Wine stuff
43 #define DECLSPEC_HIDDEN
44 #define WINE_DEFAULT_DEBUG_CHANNEL(x)
45 #define WINE_DECLARE_DEBUG_CHANNEL(x)
46 extern const char *wine_dbgstr_an( const char * s, int n );
47 extern const char *wine_dbgstr_wn( const WCHAR *s, int n );
48 extern const char *wine_dbg_sprintf( const char *format, ... );
49 static __inline const char *wine_dbgstr_longlong( ULONGLONG ll )
50 {
51  if (/*sizeof(ll) > sizeof(unsigned long) &&*/ ll >> 32) /* ULONGLONG is always > long in ReactOS */
52  return wine_dbg_sprintf( "%lx%08lx", (unsigned long)(ll >> 32), (unsigned long)ll );
53  else return wine_dbg_sprintf( "%lx", (unsigned long)ll );
54 }
55 static __inline const char *debugstr_an( const char * s, int n ) { return wine_dbgstr_an( s, n ); }
56 static __inline const char *debugstr_wn( const WCHAR *s, int n ) { return wine_dbgstr_wn( s, n ); }
57 static __inline const char *debugstr_a( const char *s ) { return wine_dbgstr_an( s, -1 ); }
58 static __inline const char *debugstr_w( const WCHAR *s ) { return wine_dbgstr_wn( s, -1 ); }
59 static __inline const char *wine_dbgstr_w( const WCHAR *s ){return wine_dbgstr_wn( s, -1 );}
60 /* This should never be called */
61 #define wine_get_dos_file_name(__x) (assert(0), NULL)
62 
63 #if 0
64 #define WARN(fmt, ...) fprintf(stderr, "WARN %s: " fmt, __FUNCTION__, ##__VA_ARGS__)
65 #define FIXME(fmt, ...) fprintf(stderr, "FIXME %s: " fmt, __FUNCTION__, ##__VA_ARGS__)
66 #define TRACE(fmt, ...) fprintf(stderr, "TRACE %s: " fmt, __FUNCTION__, ##__VA_ARGS__)
67 #define ERR(fmt, ...) fprintf(stderr, "ERR %s: " fmt, __FUNCTION__, ##__VA_ARGS__)
68 #else
69 #define WARN(fmt, ...)
70 #define FIXME(fmt, ...)
71 #define TRACE(fmt, ...)
72 #define ERR(fmt, ...)
73 #endif
74 
75 #define TRACE_ON(x) FALSE
76 #define TRACE_(x) TRACE
77 #define FIXME_(x) FIXME
78 const char *wine_dbg_sprintf( const char *format, ... );
79 #define CP_UNIXCP CP_ACP
80 #define __TRY if(1)
81 #define __EXCEPT_PAGE_FAULT else
82 #define __ENDTRY
83 
84 // basetsd.h
86 
87 // excpt.h
89 {
95 
96 // winerror.h
97 #define ERROR_ACCESS_DENIED 5
98 #define ERROR_INVALID_HANDLE 6
99 #define ERROR_OUTOFMEMORY 14
100 #define ERROR_NOT_SUPPORTED 50
101 #define ERROR_INVALID_PARAMETER 87
102 #define ERROR_CALL_NOT_IMPLEMENTED 120
103 #define ERROR_INVALID_NAME 123
104 #define ERROR_MOD_NOT_FOUND 126
105 #define ERROR_NO_MORE_ITEMS 259
106 #define ERROR_INVALID_ADDRESS 487
107 
108 // winnls.h
109 #define CP_ACP 0
110 #define MultiByteToWideChar __MultiByteToWideChar
111 #define WideCharToMultiByte __WideCharToMultiByte
114 
115 // #define strlenW(s) wcslen((s))
116 // #define strcpyW(d,s) wcscpy((d),(s))
117 // #define strchrW(s,c) wcschr((s),(c))
118 // #define strcatW(d,s) wcscat((d),(s))
119 // #define strncmpiW(s1,s2,n) _wcsnicmp((s1),(s2),(n))
120 // #define strcmpW(s1,s2) wcscmp((s1),(s2))
121 // #define strcmpiW(s1,s2) _wcsicmp((s1),(s2))
122 // #define tolowerW(n) towlower((n))
123 // #define toupperW(n) towupper((n))
124 
125 // winnt.h
126 # define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
127 #define IMAGE_FILE_MACHINE_ARMNT 0x1c4
128 #define IMAGE_FILE_MACHINE_POWERPC 0x1f0
129 #define IMAGE_FILE_MACHINE_ARM64 0xaa64
130 #define DLL_PROCESS_DETACH 0
131 #define DLL_PROCESS_ATTACH 1
132 #define DLL_THREAD_ATTACH 2
133 #define DLL_THREAD_DETACH 3
134 #define HEAP_ZERO_MEMORY 8
135 #define GENERIC_READ 0x80000000
136 #define FILE_SHARE_READ 0x00000001
137 #define FILE_ATTRIBUTE_NORMAL 0x00000080
138 #define PAGE_READONLY 0x0002
139 #define SECTION_MAP_READ 4
140 #define IMAGE_DEBUG_TYPE_UNKNOWN 0
141 #define IMAGE_DEBUG_TYPE_COFF 1
142 #define IMAGE_DEBUG_TYPE_CODEVIEW 2
143 #define IMAGE_DEBUG_TYPE_FPO 3
144 #define IMAGE_DEBUG_TYPE_MISC 4
145 #define IMAGE_DEBUG_TYPE_EXCEPTION 5
146 #define IMAGE_DEBUG_TYPE_FIXUP 6
147 #define IMAGE_DEBUG_TYPE_OMAP_TO_SRC 7
148 #define IMAGE_DEBUG_TYPE_OMAP_FROM_SRC 8
149 #define IMAGE_SYM_CLASS_EXTERNAL 2
150 #define IMAGE_SYM_CLASS_FILE 103
151 #define IMAGE_DIRECTORY_ENTRY_EXPORT 0
152 #define IMAGE_DIRECTORY_ENTRY_DEBUG 6
153 #define IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG 10
154 #define IMAGE_DEBUG_MISC_EXENAME 1
155 #define IMAGE_SEPARATE_DEBUG_SIGNATURE 0x4944
156 typedef struct _IMAGE_EXPORT_DIRECTORY {
169 typedef struct _IMAGE_DEBUG_MISC {
174  BYTE Data[1];
191 typedef struct _SECURITY_ATTRIBUTES {
196 typedef struct _IMAGE_DEBUG_DIRECTORY {
206 #define EXCEPTION_MAXIMUM_PARAMETERS 15
207 typedef struct _EXCEPTION_RECORD {
215 
216 #define WOW64_CONTEXT_i386 0x00010000
217 #define WOW64_CONTEXT_i486 0x00010000
218 #define WOW64_CONTEXT_CONTROL (WOW64_CONTEXT_i386 | __MSABI_LONG(0x00000001))
219 #define WOW64_CONTEXT_INTEGER (WOW64_CONTEXT_i386 | __MSABI_LONG(0x00000002))
220 #define WOW64_CONTEXT_SEGMENTS (WOW64_CONTEXT_i386 | __MSABI_LONG(0x00000004))
221 #define WOW64_CONTEXT_FLOATING_POINT (WOW64_CONTEXT_i386 | __MSABI_LONG(0x00000008))
222 #define WOW64_CONTEXT_DEBUG_REGISTERS (WOW64_CONTEXT_i386 | __MSABI_LONG(0x00000010))
223 #define WOW64_CONTEXT_EXTENDED_REGISTERS (WOW64_CONTEXT_i386 | __MSABI_LONG(0x00000020))
224 #define WOW64_CONTEXT_FULL (WOW64_CONTEXT_CONTROL | WOW64_CONTEXT_INTEGER | WOW64_CONTEXT_SEGMENTS)
225 #define WOW64_CONTEXT_ALL (WOW64_CONTEXT_CONTROL | WOW64_CONTEXT_INTEGER | \
226  WOW64_CONTEXT_SEGMENTS | WOW64_CONTEXT_FLOATING_POINT | \
227  WOW64_CONTEXT_DEBUG_REGISTERS | WOW64_CONTEXT_EXTENDED_REGISTERS)
228 
229 #define WOW64_CONTEXT_XSTATE (WOW64_CONTEXT_i386 | __MSABI_LONG(0x00000040))
230 
231 #define WOW64_CONTEXT_EXCEPTION_ACTIVE 0x08000000
232 #define WOW64_CONTEXT_SERVICE_ACTIVE 0x10000000
233 #define WOW64_CONTEXT_EXCEPTION_REQUEST 0x40000000
234 #define WOW64_CONTEXT_EXCEPTION_REPORTING 0x80000000
235 
236 #define WOW64_SIZE_OF_80387_REGISTERS 80
237 #define WOW64_MAXIMUM_SUPPORTED_EXTENSION 512
238 
240 {
251 
252 #include "pshpack4.h"
253 typedef struct _WOW64_CONTEXT
254 {
281 #include "poppack.h"
282 
283 #if defined(TARGET_i386)
284 #define SIZE_OF_80387_REGISTERS 80
285 #define CONTEXT_i386 0x10000
286 #define CONTEXT_i486 0x10000
287 #define CONTEXT_CONTROL (CONTEXT_i386|0x00000001L)
288 #define CONTEXT_INTEGER (CONTEXT_i386|0x00000002L)
289 #define CONTEXT_SEGMENTS (CONTEXT_i386|0x00000004L)
290 #define CONTEXT_FLOATING_POINT (CONTEXT_i386|0x00000008L)
291 #define CONTEXT_DEBUG_REGISTERS (CONTEXT_i386|0x00000010L)
292 #define CONTEXT_EXTENDED_REGISTERS (CONTEXT_i386|0x00000020L)
293 #define CONTEXT_FULL (CONTEXT_CONTROL|CONTEXT_INTEGER|CONTEXT_SEGMENTS)
294 #define MAXIMUM_SUPPORTED_EXTENSION 512
295 
296 #define EXCEPTION_READ_FAULT 0
297 #define EXCEPTION_WRITE_FAULT 1
298 #define EXCEPTION_EXECUTE_FAULT 8
299 
300 typedef struct _FLOATING_SAVE_AREA {
303  DWORD TagWord;
308  BYTE RegisterArea[80];
311 
312 typedef struct _CONTEXT {
314  DWORD Dr0;
315  DWORD Dr1;
316  DWORD Dr2;
317  DWORD Dr3;
318  DWORD Dr6;
319  DWORD Dr7;
321  DWORD SegGs;
322  DWORD SegFs;
323  DWORD SegEs;
324  DWORD SegDs;
325  DWORD Edi;
326  DWORD Esi;
327  DWORD Ebx;
328  DWORD Edx;
329  DWORD Ecx;
330  DWORD Eax;
331  DWORD Ebp;
332  DWORD Eip;
333  DWORD SegCs;
334  DWORD EFlags;
335  DWORD Esp;
336  DWORD SegSs;
338 } CONTEXT;
339 
340 #elif defined TARGET_amd64
341 
342 typedef struct _M128A {
343  ULONGLONG Low;
344  LONGLONG High;
345 } M128A, *PM128A;
346 
347 typedef struct _XMM_SAVE_AREA32 {
348  WORD ControlWord;
349  WORD StatusWord;
350  BYTE TagWord;
351  BYTE Reserved1;
352  WORD ErrorOpcode;
353  DWORD ErrorOffset;
354  WORD ErrorSelector;
355  WORD Reserved2;
356  DWORD DataOffset;
357  WORD DataSelector;
358  WORD Reserved3;
359  DWORD MxCsr;
360  DWORD MxCsr_Mask;
361  M128A FloatRegisters[8];
362  M128A XmmRegisters[16];
363  BYTE Reserved4[96];
365 
366 typedef struct _CONTEXT {
367  DWORD64 P1Home;
368  DWORD64 P2Home;
369  DWORD64 P3Home;
370  DWORD64 P4Home;
371  DWORD64 P5Home;
372  DWORD64 P6Home;
373 
374  /* Control flags */
376  DWORD MxCsr;
377 
378  /* Segment */
379  WORD SegCs;
380  WORD SegDs;
381  WORD SegEs;
382  WORD SegFs;
383  WORD SegGs;
384  WORD SegSs;
385  DWORD EFlags;
386 
387  /* Debug */
388  DWORD64 Dr0;
389  DWORD64 Dr1;
390  DWORD64 Dr2;
391  DWORD64 Dr3;
392  DWORD64 Dr6;
393  DWORD64 Dr7;
394 
395  /* Integer */
396  DWORD64 Rax;
397  DWORD64 Rcx;
398  DWORD64 Rdx;
399  DWORD64 Rbx;
400  DWORD64 Rsp;
401  DWORD64 Rbp;
402  DWORD64 Rsi;
403  DWORD64 Rdi;
404  DWORD64 R8;
405  DWORD64 R9;
406  DWORD64 R10;
407  DWORD64 R11;
408  DWORD64 R12;
409  DWORD64 R13;
410  DWORD64 R14;
411  DWORD64 R15;
412 
413  /* Counter */
414  DWORD64 Rip;
415 
416  /* Floating point */
417  union {
418  XMM_SAVE_AREA32 FltSave;
419  struct {
420  M128A Header[2];
421  M128A Legacy[8];
422  M128A Xmm0;
423  M128A Xmm1;
424  M128A Xmm2;
425  M128A Xmm3;
426  M128A Xmm4;
427  M128A Xmm5;
428  M128A Xmm6;
429  M128A Xmm7;
430  M128A Xmm8;
431  M128A Xmm9;
432  M128A Xmm10;
433  M128A Xmm11;
434  M128A Xmm12;
435  M128A Xmm13;
436  M128A Xmm14;
437  M128A Xmm15;
438  } DUMMYSTRUCTNAME;
439  } DUMMYUNIONNAME;
440 
441  /* Vector */
442  M128A VectorRegister[26];
443  DWORD64 VectorControl;
444 
445  /* Debug control */
446  DWORD64 DebugControl;
447  DWORD64 LastBranchToRip;
448  DWORD64 LastBranchFromRip;
449  DWORD64 LastExceptionToRip;
450  DWORD64 LastExceptionFromRip;
451 } CONTEXT;
452 
453 #elif defined TARGET_arm
454 
455 /* The following flags control the contents of the CONTEXT structure. */
456 
457 #define CONTEXT_ARM 0x0200000
458 #define CONTEXT_CONTROL (CONTEXT_ARM | 0x00000001)
459 #define CONTEXT_INTEGER (CONTEXT_ARM | 0x00000002)
460 #define CONTEXT_FLOATING_POINT (CONTEXT_ARM | 0x00000004)
461 #define CONTEXT_DEBUG_REGISTERS (CONTEXT_ARM | 0x00000008)
462 
463 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER)
464 
465 #define EXCEPTION_READ_FAULT 0
466 #define EXCEPTION_WRITE_FAULT 1
467 #define EXCEPTION_EXECUTE_FAULT 8
468 
469 typedef struct _RUNTIME_FUNCTION
470 {
471  DWORD BeginAddress;
472  union {
473  DWORD UnwindData;
474  struct {
475  DWORD Flag : 2;
476  DWORD FunctionLength : 11;
477  DWORD Ret : 2;
478  DWORD H : 1;
479  DWORD Reg : 3;
480  DWORD R : 1;
481  DWORD L : 1;
482  DWORD C : 1;
483  DWORD StackAdjust : 10;
484  } DUMMYSTRUCTNAME;
485  } DUMMYUNIONNAME;
487 
488 #define UNWIND_HISTORY_TABLE_SIZE 12
489 typedef struct _UNWIND_HISTORY_TABLE_ENTRY
490 {
491  DWORD ImageBase;
492  PRUNTIME_FUNCTION FunctionEntry;
493 } UNWIND_HISTORY_TABLE_ENTRY, *PUNWIND_HISTORY_TABLE_ENTRY;
494 
495 typedef struct _UNWIND_HISTORY_TABLE
496 {
497  DWORD Count;
498  BYTE LocalHint;
499  BYTE GlobalHint;
500  BYTE Search;
501  BYTE Once;
502  DWORD LowAddress;
504  UNWIND_HISTORY_TABLE_ENTRY Entry[UNWIND_HISTORY_TABLE_SIZE];
505 } UNWIND_HISTORY_TABLE, *PUNWIND_HISTORY_TABLE;
506 
507 typedef struct _CONTEXT {
508  /* The flags values within this flag control the contents of
509  a CONTEXT record.
510 
511  If the context record is used as an input parameter, then
512  for each portion of the context record controlled by a flag
513  whose value is set, it is assumed that that portion of the
514  context record contains valid context. If the context record
515  is being used to modify a thread's context, then only that
516  portion of the threads context will be modified.
517 
518  If the context record is used as an IN OUT parameter to capture
519  the context of a thread, then only those portions of the thread's
520  context corresponding to set flags will be returned.
521 
522  The context record is never used as an OUT only parameter. */
523 
525 
526  /* This section is specified/returned if the ContextFlags word contains
527  the flag CONTEXT_INTEGER. */
528  ULONG R0;
529  ULONG R1;
530  ULONG R2;
531  ULONG R3;
532  ULONG R4;
533  ULONG R5;
534  ULONG R6;
535  ULONG R7;
536  ULONG R8;
537  ULONG R9;
538  ULONG R10;
539  ULONG Fp;
540  ULONG Ip;
541 
542  /* These are selected by CONTEXT_CONTROL */
543  ULONG Sp;
544  ULONG Lr;
545  ULONG Pc;
546  ULONG Cpsr;
547 } CONTEXT;
548 
552 
553 #elif defined TARGET_arm64
554 
555 #define CONTEXT_ARM64 0x00400000L
556 #define CONTEXT_CONTROL (CONTEXT_ARM64 | 0x1L)
557 #define CONTEXT_INTEGER (CONTEXT_ARM64 | 0x2L)
558 #define CONTEXT_FLOATING_POINT (CONTEXT_ARM64 | 0x4L)
559 #define CONTEXT_DEBUG_REGISTERS (CONTEXT_ARM64 | 0x8L)
560 #define CONTEXT_X18 (CONTEXT_ARM64 | 0x10L)
561 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT)
562 
563 #define EXCEPTION_READ_FAULT 0
564 #define EXCEPTION_WRITE_FAULT 1
565 #define EXCEPTION_EXECUTE_FAULT 8
566 
567 typedef union NEON128 {
568  struct {
569  ULONGLONG Low;
570  LONGLONG High;
571  } DUMMYSTRUCTNAME;
572  double D[2];
573  float S[4];
574  WORD H[8];
575  BYTE B[16];
576 } NEON128, *PNEON128;
577 
578 #define ARM64_MAX_BREAKPOINTS 8
579 #define ARM64_MAX_WATCHPOINTS 2
580 
581 typedef struct _CONTEXT {
582 
583  //
584  // Control flags.
585  //
586 
588 
589  //
590  // Integer registers
591  //
592 
593  DWORD Cpsr;
594  union {
595  struct {
596  DWORD64 X0;
597  DWORD64 X1;
598  DWORD64 X2;
599  DWORD64 X3;
600  DWORD64 X4;
601  DWORD64 X5;
602  DWORD64 X6;
603  DWORD64 X7;
604  DWORD64 X8;
605  DWORD64 X9;
606  DWORD64 X10;
607  DWORD64 X11;
608  DWORD64 X12;
609  DWORD64 X13;
610  DWORD64 X14;
611  DWORD64 X15;
612  DWORD64 X16;
613  DWORD64 X17;
614  DWORD64 X18;
615  DWORD64 X19;
616  DWORD64 X20;
617  DWORD64 X21;
618  DWORD64 X22;
619  DWORD64 X23;
620  DWORD64 X24;
621  DWORD64 X25;
622  DWORD64 X26;
623  DWORD64 X27;
624  DWORD64 X28;
625  DWORD64 Fp;
626  DWORD64 Lr;
627  } DUMMYSTRUCTNAME;
628  DWORD64 X[31];
629  } DUMMYUNIONNAME;
630 
631  DWORD64 Sp;
632  DWORD64 Pc;
633 
634  //
635  // Floating Point/NEON Registers
636  //
637 
638  NEON128 V[32];
639  DWORD Fpcr;
640  DWORD Fpsr;
641 
642  //
643  // Debug registers
644  //
645 
650 
651 } _CONTEXT, *P_CONTEXT;
652 typedef _CONTEXT CONTEXT, *PCONTEXT;
653 
654 typedef struct _IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY {
655  DWORD BeginAddress;
656  union {
657  DWORD UnwindData;
658  struct {
659  DWORD Flag : 2;
660  DWORD FunctionLength : 11;
661  DWORD RegF : 3;
662  DWORD RegI : 4;
663  DWORD H : 1;
664  DWORD CR : 2;
665  DWORD FrameSize : 9;
666  } DUMMYSTRUCTNAME;
667  } DUMMYUNIONNAME;
668 } IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY, * PIMAGE_ARM64_RUNTIME_FUNCTION_ENTRY;
669 typedef struct _IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY RUNTIME_FUNCTION, *PRUNTIME_FUNCTION;
670 
671 #define UNWIND_HISTORY_TABLE_SIZE 12
672 
673 typedef struct _UNWIND_HISTORY_TABLE_ENTRY {
674  ULONG_PTR ImageBase;
675  PRUNTIME_FUNCTION FunctionEntry;
676 } UNWIND_HISTORY_TABLE_ENTRY, *PUNWIND_HISTORY_TABLE_ENTRY;
677 
678 typedef struct _UNWIND_HISTORY_TABLE {
679  DWORD Count;
680  BYTE LocalHint;
681  BYTE GlobalHint;
682  BYTE Search;
683  BYTE Once;
684  ULONG_PTR LowAddress;
686  UNWIND_HISTORY_TABLE_ENTRY Entry[UNWIND_HISTORY_TABLE_SIZE];
687 } UNWIND_HISTORY_TABLE, *PUNWIND_HISTORY_TABLE;
688 
692 
693 #else
694 
695 #error "Unknown target platform"
696 
697 #endif
698 
699 typedef CONTEXT *PCONTEXT;
700 
701 typedef
703 NTAPI
705  struct _EXCEPTION_RECORD *ExceptionRecord,
707  struct _CONTEXT *ContextRecord,
710 typedef struct _NT_TIB {
715  union {
718  } DUMMYUNIONNAME;
720  struct _NT_TIB *Self;
721 } NT_TIB,*PNT_TIB;
722 
723 // rtltypes.h
725 {
729 
730 // winbase.h
731 #define INVALID_HANDLE_VALUE (HANDLE)(-1)
732 #define INVALID_SET_FILE_POINTER ((DWORD)-1)
733 #define HeapAlloc __HeapAlloc
734 #define HeapReAlloc __HeapReAlloc
735 #define HeapFree(x,y,z) free(z)
736 #define GetProcessHeap() 1
737 #define GetProcessId(x) 8
738 #define lstrcpynW __lstrcpynW
739 #define CloseHandle __CloseHandle
740 #define CreateFileA(a,b,c,d,e,f,g) fopen(a, "rb")
741 #define CreateFileW __CreateFileW
742 #define ReadFile(a,b,c,d,e) __ReadFile
743 #define SetFilePointer __SetFilePointer
744 #define CreateFileMappingW(a,b,c,d,e,f) a
745 #define MapViewOfFile __MapViewOfFile
746 #define UnmapViewOfFile __UnmapViewOfFile
747 #define LoadLibraryW(x) 0
748 #define FreeLibrary(x) 0
749 #define lstrcpyW strcpyW // Forward this to wine unicode inline function
750 #define lstrlenW strlenW // ditto
751 #define lstrcpynA __lstrcpynA
752 #define SetLastError(x)
753 #define GetProcAddress(x,y) 0
754 #define GetEnvironmentVariableA(x, y, z) 0
755 #define GetEnvironmentVariableW(x, y, z) 0
756 #define GetCurrentDirectoryW(x, y) 0
757 #define GetFileSizeEx __GetFileSizeEx
758 #define ReadProcessMemory(a,b,c,d,e) 0
759 #define GetCurrentProcess() (HANDLE)1
760 #define IsWow64Process __IsWow64Process
761 #define FILE_BEGIN 0
762 
763 void* __HeapAlloc(int heap, int flags, size_t size);
764 void* __HeapReAlloc(int heap, DWORD d2, void *slab, SIZE_T newsize);
765 WCHAR* __lstrcpynW(WCHAR* lpString1, const WCHAR* lpString2, int iMaxLength);
767 HANDLE __CreateFileW(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile);
768 BOOL __ReadFile(HANDLE,PVOID,DWORD,PDWORD,/*LPOVERLAPPED*/ PVOID);
771 BOOL __UnmapViewOfFile(const void*);
775 #define OPEN_EXISTING 3
776 #define FILE_MAP_READ SECTION_MAP_READ
777 typedef struct _LDT_ENTRY {
780  union {
781  struct {
786  } Bytes;
787  struct {
798  } Bits;
799  } HighWord;
801 
802 // umtypes.h
803 typedef LONG KPRIORITY;
804 
805 // winternl.h
806 #define RtlImageNtHeader __RtlImageNtHeader
807 #define RtlImageRvaToVa __RtlImageRvaToVa
808 #define RtlImageRvaToSection __RtlImageRvaToSection
809 #define RtlImageDirectoryEntryToData __RtlImageDirectoryEntryToData
810 #define RtlComputeCrc32 __RtlComputeCrc32
811 
812 #ifdef _MSC_VER
813 #define RtlUlongByteSwap(_x) _byteswap_ulong((_x))
814 #else
815 #define RtlUlongByteSwap(_x) __builtin_bswap32((_x))
816 #endif
817 
822 
823 typedef struct _CLIENT_ID
824 {
828 #define GDI_BATCH_BUFFER_SIZE 0x136
829 typedef struct _GDI_TEB_BATCH
830 {
835 typedef struct _TEB
836 {
837  NT_TIB Tib; /* 000 */
839  CLIENT_ID ClientId; /* 020 */
842  PVOID Peb; /* 030 */
847  ULONG Win32ClientInfo[31]; /* 044 used for user32 private data in Wine */
848  PVOID WOW32Reserved; /* 0c0 */
849  ULONG CurrentLocale; /* 0c4 */
851  PVOID SystemReserved1[54]; /* 0cc used for kernel32 private data in Wine */
852  PVOID Spare1; /* 1a4 */
853  LONG ExceptionCode; /* 1a8 */
855  BYTE SpareBytes1[36]; /* 1ac */
856  PVOID SystemReserved2[10]; /* 1d4 used for ntdll private data in Wine */
858  ULONG gdiRgn; /* 6dc */
859  ULONG gdiPen; /* 6e0 */
860  ULONG gdiBrush; /* 6e4 */
863  ULONG GdiClientPID; /* 6f4 */
864  ULONG GdiClientTID; /* 6f8 */
866  PVOID UserReserved[5]; /* 700 */
867  PVOID glDispatchTable[280]; /* 714 */
868  ULONG glReserved1[26]; /* b74 */
869  PVOID glReserved2; /* bdc */
870  PVOID glSectionInfo; /* be0 */
871  PVOID glSection; /* be4 */
872  PVOID glTable; /* be8 */
873  PVOID glCurrentRC; /* bec */
874  PVOID glContext; /* bf0 */
876  UNICODE_STRING StaticUnicodeString; /* bf8 used by advapi32 */
877  WCHAR StaticUnicodeBuffer[261]; /* c00 used by advapi32 */
879  PVOID TlsSlots[64]; /* e10 */
880  LIST_ENTRY TlsLinks; /* f10 */
881  PVOID Vdm; /* f18 */
883  PVOID DbgSsReserved[2]; /* f20 */
885  PVOID Instrumentation[16]; /* f2c */
886  PVOID WinSockData; /* f6c */
887  ULONG GdiBatchCount; /* f70 */
888  ULONG Spare2; /* f74 */
889  ULONG Spare3; /* f78 */
890  ULONG Spare4; /* f7c */
893  PVOID Reserved5[3]; /* f88 */
895 } TEB, *PTEB;
896 
897 
898 // winver.h
899 typedef struct tagVS_FIXEDFILEINFO {
914 
915 
916 // psapi.h
917 typedef struct _MODULEINFO {
922 #define GetModuleFileNameExW(w, x, y, z) 0
923 
924 // pstypes.h
926 {
934 typedef enum _THREADINFOCLASS {
971 
972 
973 // dbghelp.h
975 #define MAX_SYM_NAME 2000
976 #define CBA_DEFERRED_SYMBOL_LOAD_START 0x00000001
977 #define CBA_DEFERRED_SYMBOL_LOAD_COMPLETE 0x00000002
978 #define CBA_DEFERRED_SYMBOL_LOAD_FAILURE 0x00000003
979 #define CBA_SYMBOLS_UNLOADED 0x00000004
980 #define CBA_DUPLICATE_SYMBOL 0x00000005
981 #define CBA_READ_MEMORY 0x00000006
982 #define CBA_DEFERRED_SYMBOL_LOAD_CANCEL 0x00000007
983 #define CBA_SET_OPTIONS 0x00000008
984 #define CBA_EVENT 0x00000010
985 #define CBA_DEFERRED_SYMBOL_LOAD_PARTIAL 0x00000020
986 #define CBA_DEBUG_INFO 0x10000000
987 #define SYMOPT_CASE_INSENSITIVE 0x00000001
988 #define SYMOPT_UNDNAME 0x00000002
989 #define SYMOPT_DEFERRED_LOADS 0x00000004
990 #define SYMOPT_LOAD_LINES 0x00000010
991 #define SYMOPT_LOAD_ANYTHING 0x00000040
992 #define SYMOPT_PUBLICS_ONLY 0x00004000
993 #define SYMOPT_NO_PUBLICS 0x00008000
994 #define SYMOPT_AUTO_PUBLICS 0x00010000
995 #define SYMFLAG_VALUEPRESENT 0x00000001
996 #define SYMFLAG_REGISTER 0x00000008
997 #define SYMFLAG_REGREL 0x00000010
998 #define SYMFLAG_FRAMEREL 0x00000020
999 #define SYMFLAG_PARAMETER 0x00000040
1000 #define SYMFLAG_LOCAL 0x00000080
1001 #define SYMFLAG_CONSTANT 0x00000100
1002 #define SYMFLAG_EXPORT 0x00000200
1003 #define SYMFLAG_FORWARDER 0x00000400
1004 #define SYMFLAG_FUNCTION 0x00000800
1005 #define SYMFLAG_VIRTUAL 0x00001000
1006 #define SYMFLAG_THUNK 0x00002000
1007 #define SYMFLAG_TLSREL 0x00004000
1008 #define SYMFLAG_SLOT 0x00008000
1009 #define SYMFLAG_ILREL 0x00010000
1010 #define SYMFLAG_METADATA 0x00020000
1011 #define SYMFLAG_CLR_TOKEN 0x00040000
1012 #define SYMFLAG_NULL 0x00080000
1013 #define SYMFLAG_FUNC_NO_RETURN 0x00100000
1014 #define SYMFLAG_SYNTHETIC_ZEROBASE 0x00200000
1015 #define SYMFLAG_PUBLIC_CODE 0x00400000
1016 #define UNDNAME_COMPLETE (0x0000)
1017 #define UNDNAME_NAME_ONLY (0x1000)
1019 {
1024 #define SYMSEARCH_GLOBALSONLY 0x04
1025 /* flags for SymLoadModuleEx */
1026 #define SLMFLAG_VIRTUAL 0x1
1027 #define SLMFLAG_NO_SYMBOLS 0x4
1029 {
1036 typedef struct _SYMBOL_INFO
1037 {
1054 typedef enum
1055 {
1056  SymNone = 0,
1066 } SYM_TYPE;
1067 typedef struct _IMAGEHLP_MODULEW64
1068 {
1093 typedef struct _IMAGEHLP_LINE64
1094 {
1101 typedef enum
1102 {
1105 /* __WINESRC__ */
1108 typedef struct _SRCCODEINFO
1109 {
1120 BOOL WINAPI SymInitialize(HANDLE hProcess, PCSTR UserSearchPath, BOOL fInvadeProcess);
1124 BOOL WINAPI SymMatchStringW(PCWSTR string, PCWSTR re, BOOL _case);
1126  PCSTR ModuleName, DWORD BaseOfDll, DWORD SizeOfDll);
1128  PMODLOAD_DATA, DWORD);
1130  PMODLOAD_DATA, DWORD);
1141 #define FindExecutableImageExW __FindExecutableImageExW
1145 {
1154 typedef enum
1155 {
1160 } ADDRESS_MODE;
1162 {
1172 typedef struct _tagADDRESS64
1173 {
1190 
1192 
1193 typedef struct _tagADDRESS
1194 {
1198 } ADDRESS, *LPADDRESS;
1199 
1200 typedef struct _IMAGEHLP_MODULE
1201 {
1213 typedef struct _IMAGEHLP_MODULEW
1214 {
1235 
1236 typedef struct _IMAGEHLP_MODULE64
1237 {
1262 typedef DWORD RVA;
1263 typedef ULONG64 RVA64;
1264 typedef enum _MINIDUMP_TYPE
1265 {
1266  MiniDumpNormal = 0x0000,
1281 } MINIDUMP_TYPE;
1283 {
1292 {
1303 {
1316 {
1320 {
1324 {
1328  union
1329  {
1335  } DUMMYUNIONNAME;
1338 {
1339  union
1340  {
1343  struct
1344  {
1347  } DUMMYSTRUCTNAME;
1348  } DUMMYUNIONNAME;
1352 {
1356 typedef struct _SYMBOL_INFOW
1357 {
1375 {
1387 typedef struct _KDHELP64
1388 {
1398 } KDHELP64, *PKDHELP64;
1399 typedef struct _STACKFRAME64
1400 {
1414 {
1443 typedef struct _SOURCEFILE
1444 {
1448 typedef struct _SOURCEFILEW
1449 {
1455 typedef struct _SRCCODEINFOW
1456 {
1467 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
1468 #define IMAGEHLP_SYMBOL IMAGEHLP_SYMBOL64
1469 #define IMAGEHLP_SYMBOLW IMAGEHLP_SYMBOLW64
1470 #define PIMAGEHLP_SYMBOL PIMAGEHLP_SYMBOL64
1471 #define PIMAGEHLP_SYMBOLW PIMAGEHLP_SYMBOLW64
1472 #else
1473 typedef struct _IMAGEHLP_SYMBOL
1474 {
1482 
1483 typedef struct _IMAGEHLP_SYMBOLW
1484 {
1492 #endif
1493 typedef struct _IMAGEHLP_SYMBOL64
1494 {
1502 typedef struct _IMAGEHLP_SYMBOLW64
1503 {
1511 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
1512 #define IMAGEHLP_LINE IMAGEHLP_LINE64
1513 #define PIMAGEHLP_LINE PIMAGEHLP_LINE64
1514 #define IMAGEHLP_LINEW IMAGEHLP_LINEW64
1515 #define PIMAGEHLP_LINEW PIMAGEHLP_LINEW64
1516 #else
1517 typedef struct _IMAGEHLP_LINE
1518 {
1525 
1526 typedef struct _IMAGEHLP_LINEW
1527 {
1534 #endif
1535 typedef struct _IMAGEHLP_LINEW64
1536 {
1543 #if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
1544 #define IMAGEHLP_DEFERRED_SYMBOL_LOAD IMAGEHLP_DEFERRED_SYMBOL_LOAD64
1545 #define PIMAGEHLP_DEFERRED_SYMBOL_LOAD PIMAGEHLP_DEFERRED_SYMBOL_LOAD64
1546 #else
1548 {
1557 #endif
1559 {
1569 typedef struct API_VERSION
1570 {
1576 
1577 // cvconst.h
1578 /* symbols & types enumeration */
1580 {
1613 };
1614 
1616 {
1618  btVoid = 1,
1619  btChar = 2,
1620  btWChar = 3,
1621  btInt = 6,
1622  btUInt = 7,
1623  btFloat = 8,
1624  btBCD = 9,
1625  btBool = 10,
1626  btLong = 13,
1627  btULong = 14,
1629  btDate = 26,
1632  btBit = 29,
1633  btBSTR = 30,
1635 };
1636 
1637 /* kind of UDT */
1639 {
1643 };
1644 
1645 /* kind of SymTagData */
1647 {
1658 };
1659 
1660 /* values for registers (on different CPUs) */
1662 {
1663  /* those values are common to all supported CPUs (and CPU independent) */
1664  CV_ALLREG_ERR = 30000,
1665  CV_ALLREG_TEB = 30001,
1674  CV_ALLREG_TID = 30010,
1675  CV_ALLREG_ENV = 30011,
1677 
1678  /* Intel x86 CPU */
1714 
1715  /* <pcode> */
1719  CV_REG_PCDR3 = 43, /* this includes PCDR4 to PCDR7 */
1720  CV_REG_CR0 = 80, /* this includes CR1 to CR4 */
1721  CV_REG_DR0 = 90, /* this includes DR1 to DR7 */
1722  /* </pcode> */
1723 
1729  CV_REG_TR = 115,
1730 
1731  CV_REG_PSEUDO1 = 116, /* this includes Pseudo02 to Pseudo09 */
1732  CV_REG_ST0 = 128, /* this includes ST1 to ST7 */
1735  CV_REG_TAG = 138,
1743  CV_REG_MM0 = 146, /* this includes MM1 to MM7 */
1744  CV_REG_XMM0 = 154, /* this includes XMM1 to XMM7 */
1746  CV_REG_XMM0L = 194, /* this includes XMM1L to XMM7L */
1747  CV_REG_XMM0H = 202, /* this includes XMM1H to XMM7H */
1768 
1769  CV_REG_YMM0 = 252, /* this includes YMM1 to YMM7 */
1770  CV_REG_YMM0H = 260, /* this includes YMM1H to YMM7H */
1771  CV_REG_YMM0I0 = 268, /* this includes YMM0I1 to YMM0I3 */
1772  CV_REG_YMM1I0 = 272, /* this includes YMM1I1 to YMM1I3 */
1773  CV_REG_YMM2I0 = 276, /* this includes YMM2I1 to YMM2I3 */
1774  CV_REG_YMM3I0 = 280, /* this includes YMM3I1 to YMM3I3 */
1775  CV_REG_YMM4I0 = 284, /* this includes YMM4I1 to YMM4I3 */
1776  CV_REG_YMM5I0 = 288, /* this includes YMM5I1 to YMM5I3 */
1777  CV_REG_YMM6I0 = 292, /* this includes YMM6I1 to YMM6I3 */
1778  CV_REG_YMM7I0 = 296, /* this includes YMM7I1 to YMM7I3 */
1779  CV_REG_YMM0F0 = 300, /* this includes YMM0F1 to YMM0F7 */
1780  CV_REG_YMM1F0 = 308, /* this includes YMM1F1 to YMM1F7 */
1781  CV_REG_YMM2F0 = 316, /* this includes YMM2F1 to YMM2F7 */
1782  CV_REG_YMM3F0 = 324, /* this includes YMM3F1 to YMM3F7 */
1783  CV_REG_YMM4F0 = 332, /* this includes YMM4F1 to YMM4F7 */
1784  CV_REG_YMM5F0 = 340, /* this includes YMM5F1 to YMM5F7 */
1785  CV_REG_YMM6F0 = 348, /* this includes YMM6F1 to YMM6F7 */
1786  CV_REG_YMM7F0 = 356, /* this includes YMM7F1 to YMM7F7 */
1787  CV_REG_YMM0D0 = 364, /* this includes YMM0D1 to YMM0D3 */
1788  CV_REG_YMM1D0 = 368, /* this includes YMM1D1 to YMM1D3 */
1789  CV_REG_YMM2D0 = 372, /* this includes YMM2D1 to YMM2D3 */
1790  CV_REG_YMM3D0 = 376, /* this includes YMM3D1 to YMM3D3 */
1791  CV_REG_YMM4D0 = 380, /* this includes YMM4D1 to YMM4D3 */
1792  CV_REG_YMM5D0 = 384, /* this includes YMM5D1 to YMM5D3 */
1793  CV_REG_YMM6D0 = 388, /* this includes YMM6D1 to YMM6D3 */
1794  CV_REG_YMM7D0 = 392, /* this includes YMM7D1 to YMM7D3 */
1795 
1796  /* Motorola 68K CPU */
1797  CV_R68_D0 = 0, /* this includes D1 to D7 too */
1798  CV_R68_A0 = 8, /* this includes A1 to A7 too */
1813  CV_R68_FP0 = 32, /* this includes FP1 to FP7 */
1833  CV_R68_BAD0 = 64, /* this includes BAD1 to BAD7 */
1834  CV_R68_BAC0 = 72, /* this includes BAC1 to BAC7 */
1835 
1836  /* MIPS 4000 CPU */
1842  CV_M4_IntA0 = 14, /* this includes IntA1 to IntA3 */
1843  CV_M4_IntT0 = 18, /* this includes IntT1 to IntT7 */
1844  CV_M4_IntS0 = 26, /* this includes IntS1 to IntS7 */
1857  CV_M4_FltF0 = 60, /* this includes FltF1 to Flt31 */
1859 
1860  /* Alpha AXP CPU */
1862  CV_ALPHA_FltF0 = 10, /* this includes FltF1 to FltF31 */
1864  CV_ALPHA_IntT0 = 43, /* this includes T1 to T7 */
1865  CV_ALPHA_IntS0 = 51, /* this includes S1 to S5 */
1867  CV_ALPHA_IntA0 = 58, /* this includes A1 to A5 */
1883 
1884  /* Motorola & IBM PowerPC CPU */
1885  CV_PPC_GPR0 = 1, /* this includes GPR1 to GPR31 */
1887  CV_PPC_CR0 = 34, /* this includes CR1 to CR7 */
1888  CV_PPC_FPR0 = 42, /* this includes FPR1 to FPR31 */
1889 
1892  CV_PPC_SR0 = 76, /* this includes SR1 to SR15 */
1894  CV_PPC_MQ = 100,
1895  CV_PPC_XER = 101,
1898  CV_PPC_LR = 108,
1899  CV_PPC_CTR = 109,
1903  CV_PPC_DAR = 119,
1904  CV_PPC_DEC = 122,
1908  CV_PPC_SPRG0 = 372, /* this includes SPRG1 to SPRG3 */
1909  CV_PPC_ASR = 280,
1910  CV_PPC_EAR = 382,
1911  CV_PPC_PVR = 287,
1928  CV_PPC_PMR0 = 1044, /* this includes PMR1 to PMR15 */
1930  CV_PPC_DCMP = 1077,
1934  CV_PPC_ICMP = 1081,
1935  CV_PPC_RPA = 1082,
1936  CV_PPC_HID0 = 1108, /* this includes HID1 to HID15 */
1937 
1938  /* Java */
1940 
1941  /* Hitachi SH3 CPU */
1943  CV_SH3_IntR0 = 10, /* this include R1 to R13 */
1965  CV_SH_FpR0 = 80, /* this includes FpR1 to FpR15 */
1966  CV_SH_XFpR0 = 96, /* this includes XFpR1 to XXFpR15 */
1967 
1968  /* ARM CPU */
1970  CV_ARM_R0 = 10, /* this includes R1 to R12 */
1978  CV_ARM_FS0 = 50, /* this includes FS1 to FS31 */
1979  CV_ARM_FPEXTRA0 = 90, /* this includes FPEXTRA1 to FPEXTRA7 */
1980  CV_ARM_WR0 = 128, /* this includes WR1 to WR15 */
1985  CV_ARM_WC4 = 148,
1986  CV_ARM_WC5 = 149,
1987  CV_ARM_WC6 = 150,
1988  CV_ARM_WC7 = 151,
1989  CV_ARM_WCGR0 = 152, /* this includes WCGR1 to WCGR3 */
1994  CV_ARM_FS32 = 200, /* this includes FS33 to FS63 */
1995  CV_ARM_ND0 = 300, /* this includes ND1 to ND31 */
1996  CV_ARM_NQ0 = 400, /* this includes NQ1 to NQ15 */
1997 
1998  /* Intel IA64 CPU */
2000  CV_IA64_Br0 = 512, /* this includes Br1 to Br7 */
2001  CV_IA64_P0 = 704, /* this includes P1 to P63 */
2003  CV_IA64_IntH0 = 832, /* this includes H1 to H15 */
2004  CV_IA64_Ip = 1016,
2006  CV_IA64_Cfm = 1018,
2007  CV_IA64_Psr = 1019,
2011  CV_IA64_IntR0 = 1024, /* this includes R1 to R127 */
2012  CV_IA64_FltF0 = 2048, /* this includes FltF1 to FltF127 */
2013  /* some IA64 registers missing */
2014 
2015  /* TriCore CPU */
2017  CV_TRI_D0 = 10, /* includes D1 to D15 */
2018  CV_TRI_A0 = 26, /* includes A1 to A15 */
2045  CV_TRI_DPRx_0 = 68, /* includes DPRx_1 to DPRx_3 */
2046  CV_TRI_CPRx_0 = 68, /* includes CPRx_1 to CPRx_3 */
2047  CV_TRI_DPMx_0 = 68, /* includes DPMx_1 to DPMx_3 */
2048  CV_TRI_CPMx_0 = 68, /* includes CPMx_1 to CPMx_3 */
2060 
2061  /* AM33 (and the likes) CPU */
2063  CV_AM33_E0 = 10, /* this includes E1 to E7 */
2064  CV_AM33_A0 = 20, /* this includes A1 to A3 */
2065  CV_AM33_D0 = 30, /* this includes D1 to D3 */
2066  CV_AM33_FS0 = 40, /* this includes FS1 to FS31 */
2078 
2079  /* Mitsubishi M32R CPU */
2081  CV_M32R_R0 = 10, /* this includes R1 to R11 */
2095 
2096  /* AMD/Intel x86_64 CPU */
2131 
2132  /* <pcode> */
2136  CV_AMD64_PCDR3 = CV_REG_PCDR3, /* this includes PCDR4 to PCDR7 */
2137  CV_AMD64_CR0 = CV_REG_CR0, /* this includes CR1 to CR4 */
2138  CV_AMD64_DR0 = CV_REG_DR0, /* this includes DR1 to DR7 */
2139  /* </pcode> */
2140 
2147 
2148  CV_AMD64_PSEUDO1 = CV_REG_PSEUDO1, /* this includes Pseudo02 to Pseudo09 */
2149  CV_AMD64_ST0 = CV_REG_ST0, /* this includes ST1 to ST7 */
2160  CV_AMD64_MM0 = CV_REG_MM0, /* this includes MM1 to MM7 */
2161  CV_AMD64_XMM0 = CV_REG_XMM0, /* this includes XMM1 to XMM7 */
2163  CV_AMD64_XMM0L = CV_REG_XMM0L, /* this includes XMM1L to XMM7L */
2164  CV_AMD64_XMM0H = CV_REG_XMM0H, /* this includes XMM1H to XMM7H */
2185 
2186  CV_AMD64_XMM8 = 252, /* this includes XMM9 to XMM15 */
2187 
2196 
2205 
2206  /* Wine extension */
2208  CV_ARM64_X0 = 10, /* this includes X0 to X30 */
2212 };
2213 
2214 typedef enum
2215 {
2221 } THUNK_ORDINAL;
2222 
2223 typedef enum CV_call_e
2224 {
2248 } CV_call_e;
2249 
2250 
2251 // wtypes.h
2252 typedef LONG SCODE;
2253 typedef double DATE;
2254 typedef unsigned short VARTYPE;
2255 typedef union tagCY {
2256  struct {
2257 #ifdef WORDS_BIGENDIAN
2258  LONG Hi;
2259  ULONG Lo;
2260 #else
2263 #endif
2264  } DUMMYSTRUCTNAME;
2266 } CY;
2267 typedef struct tagDEC {
2269  union {
2270  struct {
2273  } DUMMYSTRUCTNAME;
2275  } DUMMYUNIONNAME;
2277  union {
2278  struct {
2279 #ifdef WORDS_BIGENDIAN
2280  ULONG Mid32;
2281  ULONG Lo32;
2282 #else
2285 #endif
2286  } DUMMYSTRUCTNAME1;
2288  } DUMMYUNIONNAME1;
2289 } DECIMAL;
2290 typedef short VARIANT_BOOL;
2292 typedef WCHAR OLECHAR;
2293 typedef OLECHAR *BSTR;
2294 enum VARENUM {
2296  VT_NULL = 1,
2297  VT_I2 = 2,
2298  VT_I4 = 3,
2299  VT_R4 = 4,
2300  VT_R8 = 5,
2301  VT_CY = 6,
2302  VT_DATE = 7,
2303  VT_BSTR = 8,
2305  VT_ERROR = 10,
2306  VT_BOOL = 11,
2310  VT_I1 = 16,
2311  VT_UI1 = 17,
2312  VT_UI2 = 18,
2313  VT_UI4 = 19,
2314  VT_I8 = 20,
2315  VT_UI8 = 21,
2316  VT_INT = 22,
2317  VT_UINT = 23,
2318  VT_VOID = 24,
2320  VT_PTR = 26,
2324  VT_LPSTR = 30,
2330  VT_BLOB = 65,
2336  VT_CF = 71,
2337  VT_CLSID = 72,
2339  VT_BSTR_BLOB = 0xfff,
2340  VT_VECTOR = 0x1000,
2341  VT_ARRAY = 0x2000,
2342  VT_BYREF = 0x4000,
2343  VT_RESERVED = 0x8000,
2344  VT_ILLEGAL = 0xffff,
2346  VT_TYPEMASK = 0xfff
2347 };
2348 
2349 // oaidl.h
2350 typedef struct tagSAFEARRAYBOUND {
2353 } SAFEARRAYBOUND;
2354 typedef struct tagSAFEARRAY {
2361 } SAFEARRAY;
2363 
2364 #if (__STDC__ && !defined(_FORCENAMELESSUNION)) || defined(NONAMELESSUNION)
2365 #define __VARIANT_NAME_1 n1
2366 #define __VARIANT_NAME_2 n2
2367 #define __VARIANT_NAME_3 n3
2368 #define __VARIANT_NAME_4 brecVal
2369 #else
2370 #define __tagVARIANT
2371 #define __VARIANT_NAME_1
2372 #define __VARIANT_NAME_2
2373 #define __VARIANT_NAME_3
2374 #define __tagBRECORD
2375 #define __VARIANT_NAME_4
2376 #endif
2377 typedef struct tagVARIANT VARIANT;
2378 struct tagVARIANT {
2379  union {
2380  struct __tagVARIANT {
2385  union {
2386  signed char cVal;
2406  signed char *pcVal;
2429  struct __tagBRECORD {
2432  } __VARIANT_NAME_4;
2433  } __VARIANT_NAME_3;
2434  } __VARIANT_NAME_2;
2436  } __VARIANT_NAME_1;
2437 };
2438 
2442 
2443 // wine/windef16.h
2444 typedef DWORD SEGPTR;
2445 
2446 // wine/winbase16.h
2447 typedef struct _STACK32FRAME
2448 {
2449  DWORD restore_addr; /* 00 return address for restoring code selector */
2450  DWORD codeselector; /* 04 code selector to restore */
2451  EXCEPTION_REGISTRATION_RECORD frame; /* 08 Exception frame */
2452  SEGPTR frame16; /* 10 16-bit frame from last CallFrom16() */
2453  DWORD edi; /* 14 saved registers */
2454  DWORD esi; /* 18 */
2455  DWORD ebx; /* 1c */
2456  DWORD ebp; /* 20 saved 32-bit frame pointer */
2457  DWORD retaddr; /* 24 return address */
2458  DWORD target; /* 28 target address / CONTEXT86 pointer */
2459  DWORD nb_args; /* 2c number of 16-bit argument bytes */
2460 } STACK32FRAME;
2461 
2462 /* 16-bit stack layout after __wine_call_from_16() */
2463 typedef struct _STACK16FRAME
2464 {
2465  STACK32FRAME *frame32; /* 00 32-bit frame from last CallTo16() */
2466  DWORD edx; /* 04 saved registers */
2467  DWORD ecx; /* 08 */
2468  DWORD ebp; /* 0c */
2469  WORD ds; /* 10 */
2470  WORD es; /* 12 */
2471  WORD fs; /* 14 */
2472  WORD gs; /* 16 */
2473  DWORD callfrom_ip; /* 18 callfrom tail IP */
2474  DWORD module_cs; /* 1c module code segment */
2475  DWORD relay; /* 20 relay function address */
2476  WORD entry_ip; /* 22 entry point IP */
2477  DWORD entry_point; /* 26 API entry point to call, reused as mutex count */
2478  WORD bp; /* 2a 16-bit stack frame chain */
2479  WORD ip; /* 2c return address */
2480  WORD cs; /* 2e */
2481 } STACK16FRAME;
_THREAD_WRITE_FLAGS
Definition: compat.h:1144
struct _EXCEPTION_RECORD * PEXCEPTION_RECORD
PVOID glCurrentRC
Definition: compat.h:873
struct _THREAD_BASIC_INFORMATION THREAD_BASIC_INFORMATION
DWORD64 Address
Definition: compat.h:1496
struct API_VERSION * LPAPI_VERSION
BasicType
Definition: compat.h:1615
BOOL WINAPI SymCleanup(HANDLE hProcess)
Definition: dbghelp.c:557
signed char * PCHAR
Definition: retypes.h:7
struct _LDT_ENTRY::@346::@348 Bits
const char * wine_dbg_sprintf(const char *format,...)
Definition: compat.c:296
struct _NT_TIB * Self
Definition: compat.h:720
PVOID EnvironmentPointer
Definition: compat.h:838
WCHAR OLECHAR
Definition: compat.h:2292
WORD LimitLow
Definition: compat.h:778
ULONG64 X25
Definition: ke.h:98
union tagVARIANT::@357 __VARIANT_NAME_1
DWORD Dr7
Definition: compat.h:261
ULONG Tag
Definition: compat.h:1049
SYM_TYPE SymType
Definition: compat.h:1244
ULONG cbElements
Definition: compat.h:2357
DWORD SegEs
Definition: compat.h:265
BYTE BaseMid
Definition: compat.h:782
ULONGLONG Lo64
Definition: compat.h:2287
#define WOW64_MAXIMUM_SUPPORTED_EXTENSION
Definition: compat.h:237
const uint16_t * PCWSTR
Definition: typedefs.h:57
PVOID WOW32Reserved
Definition: compat.h:848
BOOL(CALLBACK * PENUMLOADED_MODULES_CALLBACKW64)(PCWSTR, DWORD64, ULONG, PVOID)
Definition: compat.h:1187
DWORD MaxNameLength
Definition: compat.h:1479
PVOID UserReserved[5]
Definition: compat.h:866
SYM_TYPE
Definition: compat.h:1054
struct _MINIDUMP_CALLBACK_OUTPUT::@350::@351 DUMMYSTRUCTNAME
DWORD SizeOfImage
Definition: compat.h:919
#define R(b, x)
Definition: sha2.c:134
ADDRESS_MODE Mode
Definition: compat.h:1197
static __inline const char * debugstr_w(const WCHAR *s)
Definition: compat.h:58
ULONG Win32ClientInfo[31]
Definition: compat.h:847
ULONG64 RVA64
Definition: compat.h:1263
#define WOW64_SIZE_OF_80387_REGISTERS
Definition: compat.h:236
WCHAR StaticUnicodeBuffer[261]
Definition: compat.h:877
Definition: pdh_main.c:93
PVOID Instrumentation[16]
Definition: compat.h:885
BSTR * pbstrVal
Definition: compat.h:2419
Definition: ehthrow.cxx:53
struct _IMAGEHLP_MODULEW64 IMAGEHLP_MODULEW64
struct _EXCEPTION_REGISTRATION_RECORD * Next
Definition: compat.h:726
ULONG NameLen
Definition: compat.h:1050
BYTE bVal
Definition: compat.h:2391
ULONG64 X10
Definition: ke.h:83
Definition: compat.h:2298
struct _IMAGEHLP_LINEW * PIMAGEHLP_LINEW
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
DWORD64 ModBase
Definition: compat.h:1459
DWORD64 WINAPI SymLoadModuleExW(HANDLE, HANDLE, PCWSTR, PCWSTR, DWORD64, DWORD, PMODLOAD_DATA, DWORD)
Definition: module.c:800
ULONG64 Address
Definition: compat.h:1366
ULONG Esp
Definition: nt_native.h:1479
CY * pcyVal
Definition: compat.h:2422
PVOID GdiThreadLocaleInfo
Definition: compat.h:865
PVOID IRecordInfo
Definition: compat.h:31
VOID * PIMAGEHLP_CONTEXT
Definition: compat.h:974
ULONG MaxNameLen
Definition: compat.h:1051
DWORD SizeOfStruct
Definition: compat.h:1519
struct _IMAGEHLP_LINEW IMAGEHLP_LINEW
BOOL(CALLBACK * PENUMLOADED_MODULES_CALLBACK64)(PCSTR, DWORD64, ULONG, PVOID)
Definition: compat.h:1186
KAFFINITY AffinityMask
Definition: compat.h:930
DWORD WINAPI SymLoadModule(HANDLE hProcess, HANDLE hFile, PCSTR ImageName, PCSTR ModuleName, DWORD BaseOfDll, DWORD SizeOfDll)
Definition: module.c:753
ULONG Eip
Definition: nt_native.h:1476
struct _SECURITY_ATTRIBUTES * LPSECURITY_ATTRIBUTES
BOOL(CALLBACK * PENUMDIRTREE_CALLBACKW)(PCWSTR, PVOID)
Definition: compat.h:1178
Definition: compat.h:2314
_In_ WDFIOTARGET _In_ PWDF_REQUEST_COMPLETION_PARAMS Params
Definition: wdfrequest.h:306
ULONG64 Fp
Definition: ke.h:102
struct _IMAGEHLP_MODULE * PIMAGEHLP_MODULE
WCHAR ModuleName[32]
Definition: compat.h:1076
USHORT MajorVersion
Definition: compat.h:1571
MINIDUMP_THREAD_EX_CALLBACK ThreadEx
Definition: compat.h:1331
_IRQL_requires_same_ _In_ PVOID EstablisherFrame
Definition: ntbasedef.h:653
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
EXCEPTION_DISPOSITION NTAPI EXCEPTION_ROUTINE(struct _EXCEPTION_RECORD *ExceptionRecord, PVOID EstablisherFrame, struct _CONTEXT *ContextRecord, PVOID DispatcherContext)
Definition: compat.h:704
PVOID glReserved2
Definition: compat.h:869
LIST_ENTRY TlsLinks
Definition: compat.h:880
ULONG MaxNameLen
Definition: compat.h:1371
struct _SOURCEFILE SOURCEFILE
Definition: compat.h:2310
IMAGEHLP_EXTENDED_OPTIONS
Definition: compat.h:1101
DWORD dwFileDateMS
Definition: compat.h:911
PVOID Win32ThreadInfo
Definition: compat.h:846
FLOATING_SAVE_AREA FloatSave
Definition: nt_native.h:1446
ULONG64 ModBase
Definition: compat.h:1363
DWORD WINAPI SymSetOptions(DWORD opts)
Definition: dbghelp.c:585
PVOID WINAPI SymFunctionTableAccess(HANDLE, DWORD)
Definition: module.c:1363
PVOID Key
Definition: compat.h:1111
#define ARM64_MAX_WATCHPOINTS
DWORD64 BaseOfImage
Definition: compat.h:1070
PVOID glContext
Definition: compat.h:874
M128A
Definition: ketypes.h:925
struct _IMAGEHLP_SYMBOL * PIMAGEHLP_SYMBOL
VARIANT_BOOL boolVal
Definition: compat.h:2396
Definition: compat.h:1058
DWORD LineNumber
Definition: compat.h:1539
MINIDUMP_THREAD_CALLBACK Thread
Definition: compat.h:1330
uint16_t * PWSTR
Definition: typedefs.h:56
BYTE ExtendedRegisters[WOW64_MAXIMUM_SUPPORTED_EXTENSION]
Definition: compat.h:279
USHORT * puiVal
Definition: compat.h:2407
VARIANTARG * LPVARIANTARG
Definition: compat.h:2441
PVOID CsrClientThread
Definition: compat.h:845
DWORD SizeOfStruct
Definition: compat.h:1495
struct tagVS_FIXEDFILEINFO VS_FIXEDFILEINFO
ULONG64 X9
Definition: ke.h:82
ULONG64 FuncTableEntry
Definition: compat.h:1381
struct _IMAGE_DEBUG_DIRECTORY IMAGE_DEBUG_DIRECTORY
struct _IMAGE_SEPARATE_DEBUG_HEADER * PIMAGE_SEPARATE_DEBUG_HEADER
STACK32FRAME * frame32
Definition: compat.h:2465
DWORD SizeOfStruct
Definition: compat.h:1457
unsigned char * PUCHAR
Definition: retypes.h:3
struct _EXCEPTION_REGISTRATION_RECORD EXCEPTION_REGISTRATION_RECORD
char CHAR
Definition: xmlstorage.h:175
Definition: amd64_sup.c:13
DWORD64 WINAPI SymLoadModuleEx(HANDLE, HANDLE, PCSTR, PCSTR, DWORD64, DWORD, PMODLOAD_DATA, DWORD)
Definition: module.c:763
DWORD BaseOfImage
Definition: compat.h:1216
SHORT * piVal
Definition: compat.h:2412
CHAR LoadedPdbName[256]
Definition: compat.h:1248
SAFEARRAYBOUND rgsabound[1]
Definition: compat.h:2360
ULONG Scope
Definition: compat.h:1048
struct _tagADDRESS64 ADDRESS64
ULONG Ecx
Definition: nt_native.h:1467
DWORD64 KeUserCallbackDispatcher
Definition: compat.h:1395
struct _STACKFRAME64 STACKFRAME64
WORD wReserved3
Definition: compat.h:2384
CHAR ModuleName[32]
Definition: compat.h:1245
ULONG64 X18
Definition: ke.h:91
LONG NTSTATUS
Definition: precomp.h:26
USHORT fFeatures
Definition: compat.h:2356
ULONG64 BackingStoreOffset
Definition: compat.h:1380
struct _IMAGEHLP_DEFERRED_SYMBOL_LOAD64 IMAGEHLP_DEFERRED_SYMBOL_LOAD64
WCHAR ImageName[256]
Definition: compat.h:1223
USHORT wReserved
Definition: compat.h:2268
USHORT MinorVersion
Definition: compat.h:1572
#define CALLBACK
Definition: compat.h:35
DWORD dwFileVersionLS
Definition: compat.h:903
PVOID WINAPI SymFunctionTableAccess64(HANDLE, DWORD64)
Definition: module.c:1371
struct _MINIDUMP_CALLBACK_INPUT MINIDUMP_CALLBACK_INPUT
DWORD64 Address
Definition: compat.h:1463
ULONG Flags
Definition: compat.h:1044
BOOL(CALLBACK * PSYM_ENUMLINES_CALLBACKW)(PSRCCODEINFOW, PVOID)
Definition: compat.h:1465
FLOATING_SAVE_AREA * PFLOATING_SAVE_AREA
Definition: nt_native.h:1394
ULONG Lo32
Definition: compat.h:2283
GLdouble n
Definition: glext.h:7729
HANDLE HWND
Definition: compat.h:19
ULONG R6
Definition: ke.h:261
PVOID Key
Definition: compat.h:1458
DWORD SizeOfStruct
Definition: compat.h:1485
_EXCEPTION_DISPOSITION
Definition: compat.h:88
BOOL(CALLBACK * PSYM_ENUMSYMBOLS_CALLBACK64)(PCSTR, DWORD64, ULONG, PVOID)
Definition: compat.h:1188
DWORD SizeOfStruct
Definition: compat.h:1528
DWORD ebx
Definition: compat.h:2455
ULONG R0
Definition: ke.h:255
DWORD Pres
Definition: compat.h:791
ULONG64 X22
Definition: ke.h:95
double DATE
Definition: compat.h:2253
MINIDUMP_MODULE_CALLBACK Module
Definition: compat.h:1332
PVOID ActiveRpcHandle
Definition: compat.h:840
ULONG TypeIndex
Definition: compat.h:1039
FLOAT * pfltVal
Definition: compat.h:2414
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
const char * wine_dbgstr_an(const char *s, int n)
Definition: compat.c:313
#define EXCEPTION_MAXIMUM_PARAMETERS
Definition: compat.h:206
_In_ BOOL _In_ HANDLE hProcess
Definition: mapping.h:70
Definition: strmini.h:380
PVOID(CALLBACK * PFUNCTION_TABLE_ACCESS_ROUTINE64)(HANDLE, DWORD64)
Definition: compat.h:1179
ULONG64 X28
Definition: ke.h:101
DWORD EFlags
Definition: compat.h:276
DWORD SegFs
Definition: compat.h:264
ULONG64 Address
Definition: compat.h:1046
ULONG64 X16
Definition: ke.h:89
struct tagVARIANT::@357::__tagVARIANT::@358::__tagBRECORD __VARIANT_NAME_4
DWORD64(CALLBACK * PGET_MODULE_BASE_ROUTINE64)(HANDLE, DWORD64)
Definition: compat.h:1180
DWORD BaseHi
Definition: compat.h:797
* PM128A
Definition: ketypes.h:925
struct _MINIDUMP_THREAD_CALLBACK * PMINIDUMP_THREAD_CALLBACK
ULONG SegGs
Definition: nt_native.h:1453
struct _IMAGEHLP_DEFERRED_SYMBOL_LOADW64 IMAGEHLP_DEFERRED_SYMBOL_LOADW64
DWORD LineNumber
Definition: compat.h:1521
SAFEARRAY * parray
Definition: compat.h:2403
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char const char * ModuleName
Definition: acpixf.h:1278
OLECHAR * BSTR
Definition: compat.h:2293
struct _MINIDUMP_CALLBACK_INPUT * PMINIDUMP_CALLBACK_INPUT
ULONG SegFs
Definition: nt_native.h:1454
uint16_t * PWCHAR
Definition: typedefs.h:56
Definition: movable.cpp:7
struct _STACK32FRAME STACK32FRAME
BOOL(CALLBACK * PFIND_EXE_FILE_CALLBACKW)(HANDLE, PCWSTR, PVOID)
Definition: compat.h:1140
ULONG SegDs
Definition: nt_native.h:1456
WCHAR * __lstrcpynW(WCHAR *lpString1, const WCHAR *lpString2, int iMaxLength)
struct _KDHELP64 KDHELP64
BOOLEAN NTAPI RtlDeleteFunctionTable(_In_ PRUNTIME_FUNCTION FunctionTable)
Definition: dynfntbl.c:234
SAFEARRAY ** pparray
Definition: compat.h:2426
ADDRESS64 AddrBStore
Definition: compat.h:1405
PVOID byref
Definition: compat.h:2421
char * LPSTR
Definition: xmlstorage.h:182
_IMAGEHLP_SYMBOL_TYPE_INFO
Definition: compat.h:1413
HANDLE UniqueProcess
Definition: