ReactOS  0.4.14-dev-608-gd495a4f
internal.h
Go to the documentation of this file.
1 
7 #ifndef _INC_INTERNAL
8 #define _INC_INTERNAL
9 
10 #include <crtdefs.h>
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 #include <stdarg.h>
17 #include <limits.h>
18 #include <windef.h>
19 #include <winbase.h>
20 
21 #ifdef __REACTOS__
22 #include "malloc.h"
23 struct _exception;
24 __declspec(dllimport) void __cdecl __setusermatherr(int (__cdecl *)(struct _exception *));
25 #define __mingw_fprintf fprintf
26 #define __mingw_vfprintf vfprintf
27 #endif
28 
29 #pragma pack(push,_CRT_PACKING)
30 
31 #ifndef __INTERNAL_FUNC_DEFINED
32 #define __INTERNAL_FUNC_DEFINED
33  typedef void (__cdecl *_PVFV)(void);
34  typedef int (__cdecl *_PIFV)(void);
35  typedef void (__cdecl *_PVFI)(int);
36 #endif
37 
38 #if defined (SPECIAL_CRTEXE) && (defined (_DLL) || defined (__GNUC__))
39  extern int _commode;
40 #else
41  _CRTIMP extern int _commode;
42 #endif
43 
44 #define __IOINFO_TM_ANSI 0
45 #define __IOINFO_TM_UTF8 1
46 #define __IOINFO_TM_UTF16LE 2
47 
48 #ifdef _MSC_VER
49 #pragma warning(push)
50 #pragma warning(disable:4214)
51 #pragma warning(disable:4820)
52 #endif
53 
54  typedef struct {
56  char osfile;
57  char pipech;
60  char textmode : 7;
61  char unicode : 1;
62  char pipech2[2];
63  } ioinfo;
64 
65 #ifdef _MSC_VER
66 #pragma warning(pop)
67 #endif
68 
69 #define IOINFO_ARRAY_ELTS (1 << 5)
70 
71 #define _pioinfo(i) (__pioinfo[(i) >> 5] + ((i) & (IOINFO_ARRAY_ELTS - 1)))
72 #define _osfile(i) (_pioinfo(i)->osfile)
73 #define _pipech2(i) (_pioinfo(i)->pipech2)
74 #define _textmode(i) (_pioinfo(i)->textmode)
75 #define _tm_unicode(i) (_pioinfo(i)->unicode)
76 #define _pioinfo_safe(i) ((((i) != -1) && ((i) != -2)) ? _pioinfo(i) : &__badioinfo)
77 #define _osfhnd_safe(i) (_pioinfo_safe(i)->osfhnd)
78 #define _osfile_safe(i) (_pioinfo_safe(i)->osfile)
79 #define _pipech_safe(i) (_pioinfo_safe(i)->pipech)
80 #define _pipech2_safe(i) (_pioinfo_safe(i)->pipech2)
81 #define _textmode_safe(i) (_pioinfo_safe(i)->textmode)
82 #define _tm_unicode_safe(i) (_pioinfo_safe(i)->unicode)
83 
84 #ifndef __badioinfo
86 #define __badioinfo (* __MINGW_IMP_SYMBOL(__badioinfo))
87 #endif
88 
89 #ifndef __pioinfo
90  extern ioinfo ** __MINGW_IMP_SYMBOL(__pioinfo)[];
91 #define __pioinfo (* __MINGW_IMP_SYMBOL(__pioinfo))
92 #endif
93 
94 #define _NO_CONSOLE_FILENO (intptr_t)-2
95 
96 #ifndef _FILE_DEFINED
97 #define _FILE_DEFINED
98  struct _iobuf {
99  char *_ptr;
100  int _cnt;
101  char *_base;
102  int _flag;
103  int _file;
104  int _charbuf;
105  int _bufsiz;
106  char *_tmpfname;
107  };
108  typedef struct _iobuf FILE;
109 #endif
110 
111 #if !defined (_FILEX_DEFINED) && defined (_WINDOWS_)
112 #define _FILEX_DEFINED
113  typedef struct {
114  FILE f;
116  } _FILEX;
117 #endif
118 
119  extern int _dowildcard;
120  extern int _newmode;
121 
122 #ifndef __winitenv
123 extern wchar_t *** __MINGW_IMP_SYMBOL(__winitenv);
124 #define __winitenv (* __MINGW_IMP_SYMBOL(__winitenv))
125 #endif
126 
127 #ifndef __initenv
128 extern char *** __MINGW_IMP_SYMBOL(__initenv);
129 #define __initenv (* __MINGW_IMP_SYMBOL(__initenv))
130 #endif
131 
132 #ifndef _acmdln
133 extern char ** __MINGW_IMP_SYMBOL(_acmdln);
134 #define _acmdln (* __MINGW_IMP_SYMBOL(_acmdln))
135 /* _CRTIMP extern char *_acmdln; */
136 #endif
137 
138 #ifndef _wcmdln
139 extern char ** __MINGW_IMP_SYMBOL(_wcmdln);
140 #define _wcmdln (* __MINGW_IMP_SYMBOL(_wcmdln))
141 /* __CRTIMP extern wchar_t *_wcmdln; */
142 #endif
143 
144  _CRTIMP __declspec(noreturn) void __cdecl _amsg_exit(int);
145 
146  int __CRTDECL _setargv(void);
147  int __CRTDECL __setargv(void);
148  int __CRTDECL _wsetargv(void);
149  int __CRTDECL __wsetargv(void);
150 
151  int __CRTDECL main(int _Argc, char **_Argv, char **_Env);
152  int __CRTDECL wmain(int _Argc, wchar_t **_Argv, wchar_t **_Env);
153 
154 #ifndef _STARTUP_INFO_DEFINED
155 #define _STARTUP_INFO_DEFINED
156  typedef struct {
157  int newmode;
158  } _startupinfo;
159 #endif
160 
161  _CRTIMP int __cdecl __getmainargs(int * _Argc, char *** _Argv, char ***_Env, int _DoWildCard, _startupinfo *_StartInfo);
162  _CRTIMP int __cdecl __wgetmainargs(int * _Argc, wchar_t ***_Argv, wchar_t ***_Env, int _DoWildCard, _startupinfo *_StartInfo);
163 
164 #define _CONSOLE_APP 1
165 #define _GUI_APP 2
166 
167  typedef enum __enative_startup_state {
170 
172  extern volatile void *__native_startup_lock;
173 
174  extern volatile unsigned int __native_dllmain_reason;
175  extern volatile unsigned int __native_vcclrit_reason;
176 
177  _CRTIMP void __cdecl __set_app_type (int);
178 
179  typedef LONG NTSTATUS;
180 
181 #include <crtdbg.h>
182 #include <errno.h>
183 
184  void * __cdecl _encode_pointer(void *);
185  void * __cdecl _encoded_null();
186  void * __cdecl _decode_pointer(void *);
187 
188  BOOL __cdecl _ValidateImageBase (PBYTE pImageBase);
191 
192 #ifdef __cplusplus
193 }
194 #endif
195 
196 #pragma pack(pop)
197 #endif
char * _base
Definition: mbstring.h:22
void(__cdecl * _PVFV)(void)
Definition: internal.h:33
_CRTIMP __declspec(noreturn) void __cdecl _amsg_exit(int)
Definition: thread.c:53
int lockinitflag
Definition: internal.h:58
char textmode
Definition: internal.h:60
int _cnt
Definition: mbstring.h:21
rwlock_t lock
Definition: tcpcore.h:1163
#define __cdecl
Definition: accygwin.h:79
void *__cdecl _encode_pointer(void *)
Definition: mingw_helpers.c:25
Definition: file.c:40
#define _CRTIMP
Definition: crtdefs.h:60
char osfile
Definition: internal.h:56
intptr_t osfhnd
Definition: internal.h:55
void CDECL __setusermatherr(MSVCRT_matherr_func func)
Definition: matherr.c:45
__enative_startup_state
Definition: internal.h:167
volatile __enative_startup_state __native_startup_state
Definition: natstart.c:13
char * _ptr
Definition: mbstring.h:20
char * _tmpfname
Definition: mbstring.h:27
_CRTIMP int __cdecl __wgetmainargs(int *_Argc, wchar_t ***_Argv, wchar_t ***_Env, int _DoWildCard, _startupinfo *_StartInfo)
BOOL __cdecl _IsNonwritableInCurrentImage(PBYTE pTarget)
Definition: pesect.c:175
char unicode
Definition: internal.h:61
void __cdecl _amsg_exit(int errnum)
Definition: amsg.c:47
LONG NTSTATUS
Definition: internal.h:179
char pipech
Definition: internal.h:57
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
int __CRTDECL _setargv(void)
Definition: dllargv.c:18
#define __pioinfo
Definition: internal.h:91
int __CRTDECL main(int _Argc, char **_Argv, char **_Env)
Definition: TestTimer.c:5
_CRTIMP void __cdecl __set_app_type(int)
Definition: environ.c:360
void *__cdecl _encoded_null()
int intptr_t
Definition: crtdefs.h:283
#define __initenv
Definition: internal.h:129
int _newmode
Definition: _newmode.c:7
BOOL __cdecl _ValidateImageBase(PBYTE pImageBase)
Definition: pesect.c:27
int __CRTDECL __wsetargv(void)
ioinfo ** __MINGW_IMP_SYMBOL(__badioinfo)[]
int __CRTDECL __setargv(void)
Definition: dll_argv.c:20
int _charbuf
Definition: mbstring.h:25
int _bufsiz
Definition: mbstring.h:26
int _flag
Definition: mbstring.h:23
#define __CRTDECL
Definition: crtdefs.h:155
struct __SEHPortableFrame *typedef void(__stdcall *_SEHHandler_t)(struct __SEHPortableTryLevel *)
Definition: internal.h:71
uint32_t DWORD_PTR
Definition: typedefs.h:63
PIMAGE_SECTION_HEADER __cdecl _FindPESection(PBYTE pImageBase, DWORD_PTR rva)
Definition: pesect.c:48
volatile unsigned int __native_vcclrit_reason
Definition: natstart.c:12
#define _acmdln
Definition: internal.h:134
volatile unsigned int __native_dllmain_reason
Definition: natstart.c:11
typedef int(__cdecl *_SEHFrameHandler_t)(struct _EXCEPTION_RECORD *
int(__cdecl * _PIFV)(void)
Definition: internal.h:34
CRITICAL_SECTION lock
Definition: internal.h:59
#define f
Definition: ke_i.h:83
int __CRTDECL _wsetargv(void)
void(__cdecl * _PVFI)(int)
Definition: internal.h:35
#define _wcmdln
Definition: internal.h:140
int __CRTDECL wmain(int _Argc, wchar_t **_Argv, wchar_t **_Env)
_CRTIMP int __cdecl __getmainargs(int *_Argc, char ***_Argv, char ***_Env, int _DoWildCard, _startupinfo *_StartInfo)
int _file
Definition: mbstring.h:24
int _dowildcard
Definition: wildcard.c:32
#define __badioinfo
Definition: internal.h:86
_CRTIMP int _commode
Definition: environ.c:31
void *__cdecl _decode_pointer(void *)
Definition: mingw_helpers.c:19
BYTE * PBYTE
Definition: pedump.c:66
#define __winitenv
Definition: internal.h:124
volatile void * __native_startup_lock
Definition: natstart.c:14