ReactOS 0.4.16-dev-2534-gdcd45a5
crtdata.c File Reference
#include <apitest.h>
#include <apitest_guard.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <locale.h>
#include <mbctype.h>
Include dependency graph for crtdata.c:

Go to the source code of this file.

Macros

#define WIN32_NO_STATUS
 
#define test_is_local_symbol(addr, is)   ok_int(IsLocalSymbol(addr), (is))
 

Functions

int IsLocalSymbol (void *Address)
 
int *__cdeclp__daylight (void)
 
long *__cdeclp__dstbias (void)
 
 errno_t (__cdecl *p_get_fmode)(int *_PMode)
 
 int (__cdecl *p_get_pgmptr)(char **p)
 
void Test___argc (void)
 
void Test___argv (void)
 
void Test___badioinfo (void)
 
void Test___initenv (void)
 
void Test___lc_codepage (void)
 
void Test___lc_collate_cp (void)
 
void Test___lc_handle (void)
 
void Test___mb_cur_max (void)
 
void Test___pioinfo (void)
 
void Test___setlc_active (void)
 
void Test___unguarded_readlc_active (void)
 
void Test___wargv (void)
 
void Test___winitenv (void)
 
void Test__acmdln (void)
 
void Test__aexit_rtn (void)
 
void Test__commode (void)
 
void Test__ctype (void)
 
void Test__wctype (void)
 
void Test__daylight (void)
 
void Test__dstbias (void)
 
void Test__environ (void)
 
void Test__fileinfo (void)
 
void Test__fmode (void)
 
void Test__iob (void)
 
void Test__mbcasemap (void)
 
void Test__mbctype (void)
 
void Test__osplatform (void)
 
void Test__osver (void)
 
void Test__pgmptr (void)
 
void Test__sys_errlist (void)
 
void Test__sys_nerr (void)
 
void Test__timezone (void)
 
void Test__tzname (void)
 
void Test__wcmdln (void)
 
void Test__wenviron (void)
 
void Test__winmajor (void)
 
void Test__winminor (void)
 
void Test__winver (void)
 
void Test__wpgmptr (void)
 
 START_TEST (crtdata)
 

Variables

static OSVERSIONINFOW s_osvi
 
char __ImageBase
 
static voids_ImageEnd
 

Macro Definition Documentation

◆ test_is_local_symbol

#define test_is_local_symbol (   addr,
  is 
)    ok_int(IsLocalSymbol(addr), (is))

Definition at line 42 of file crtdata.c.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 11 of file crtdata.c.

Function Documentation

◆ errno_t()

errno_t ( __cdecl p_get_fmode)

◆ int()

int ( __cdecl p_get_pgmptr)

◆ IsLocalSymbol()

int IsLocalSymbol ( void Address)

Definition at line 22 of file crtdata.c.

23{
24 return ((Address >= (void*)&__ImageBase) && (Address <= s_ImageEnd));
25}
char __ImageBase
static void * s_ImageEnd
Definition: crtdata.c:20
static WCHAR Address[46]
Definition: ping.c:68

◆ p__daylight()

int *__cdecl * p__daylight ( void  )

Referenced by START_TEST(), and Test__daylight().

◆ p__dstbias()

long *__cdecl * p__dstbias ( void  )

Referenced by START_TEST(), and Test__dstbias().

◆ START_TEST()

START_TEST ( crtdata  )

Definition at line 645 of file crtdata.c.

646{
647 /* Initialize image size */
649 PIMAGE_NT_HEADERS ntHeaders = (PIMAGE_NT_HEADERS)((PUCHAR)dosHeader + dosHeader->e_lfanew);
650 s_ImageEnd = (PUCHAR)dosHeader + ntHeaders->OptionalHeader.SizeOfImage;
651
652 /* initialize version info */
655
656 HMODULE hmsvcrt = GetModuleHandleA("msvcrt.dll");
657 p__daylight = (void*)GetProcAddress(hmsvcrt, "__daylight");
658 p__dstbias = (void*)GetProcAddress(hmsvcrt, "__dstbias");
659 p_get_fmode = (void*)GetProcAddress(hmsvcrt, "_get_fmode");
660 p_get_osplatform = (void*)GetProcAddress(hmsvcrt, "_get_osplatform");
661 p_get_pgmptr = (void*)GetProcAddress(hmsvcrt, "_get_pgmptr");
662 p_get_wpgmptr = (void*)GetProcAddress(hmsvcrt, "_get_wpgmptr");
663 p_get_winver = (void*)GetProcAddress(hmsvcrt, "_get_winver");
664 p_get_winmajor = (void*)GetProcAddress(hmsvcrt, "_get_winmajor");
665 p_get_winminor = (void*)GetProcAddress(hmsvcrt, "_get_winminor");
666 p_get_environ = (void*)GetProcAddress(hmsvcrt, "_get_environ");
667 p_get_wenviron = (void*)GetProcAddress(hmsvcrt, "_get_wenviron");
668
669 if (s_osvi.dwMajorVersion >= 6)
670 {
671 ok(p__daylight != NULL, "__daylight is NULL\n");
672 ok(p__dstbias != NULL, "__dstbias is NULL\n");
673 ok(p_get_fmode != NULL, "_get_fmode is NULL\n");
674 ok(p_get_osplatform != NULL, "_get_osplatform is NULL\n");
675 ok(p_get_pgmptr != NULL, "_get_pgmptr is NULL\n");
676 ok(p_get_wpgmptr != NULL, "_get_wpgmptr is NULL\n");
677 ok(p_get_winver != NULL, "_get_winver is NULL\n");
678 ok(p_get_winmajor != NULL, "_get_winmajor is NULL\n");
679 ok(p_get_winminor != NULL, "_get_winminor is NULL\n");
680 ok(p_get_environ != NULL, "_get_environ is NULL\n");
681 ok(p_get_wenviron != NULL, "_get_wenviron is NULL\n");
682 }
683
684 Test___argc();
685 Test___argv();
687#ifndef _M_ARM
691#endif
695#ifndef _M_ARM
698#endif
699 Test___wargv();
700#ifndef _M_ARM
702#endif
703 Test__acmdln();
704#ifdef _M_IX86
705 Test__adjust_fdiv();
706#endif
709 Test__ctype();
711#ifndef _M_ARM
715#endif
716 Test__fmode();
717 Test__iob();
720#ifndef _M_ARM
722#endif
723 Test__osver();
724 Test__pgmptr();
728 Test__tzname();
729 Test__wcmdln();
730 Test__wctype();
731#ifndef _M_ARM
733#endif
736#ifndef _M_ARM
737 Test__winver();
738#endif
740}
#define ok(value,...)
Definition: atltest.h:57
void Test__tzname(void)
Definition: crtdata.c:525
void Test__winminor(void)
Definition: crtdata.c:590
void Test__osplatform(void)
Definition: crtdata.c:448
void Test__osver(void)
Definition: crtdata.c:460
int *__cdecl * p__daylight(void)
void Test__dstbias(void)
Definition: crtdata.c:324
void Test__acmdln(void)
Definition: crtdata.c:212
void Test__mbcasemap(void)
Definition: crtdata.c:419
void Test__fileinfo(void)
Definition: crtdata.c:361
void Test___argc(void)
Definition: crtdata.c:47
void Test__sys_errlist(void)
Definition: crtdata.c:489
void Test__winver(void)
Definition: crtdata.c:606
void Test__wpgmptr(void)
Definition: crtdata.c:622
void Test___wargv(void)
Definition: crtdata.c:187
void Test__daylight(void)
Definition: crtdata.c:304
void Test___initenv(void)
Definition: crtdata.c:79
void Test__wenviron(void)
Definition: crtdata.c:552
void Test__mbctype(void)
Definition: crtdata.c:433
void Test___winitenv(void)
Definition: crtdata.c:201
void Test__fmode(void)
Definition: crtdata.c:373
void Test__ctype(void)
Definition: crtdata.c:259
void Test___setlc_active(void)
Definition: crtdata.c:164
long *__cdecl * p__dstbias(void)
static OSVERSIONINFOW s_osvi
Definition: crtdata.c:18
void Test__sys_nerr(void)
Definition: crtdata.c:500
void Test__pgmptr(void)
Definition: crtdata.c:470
void Test___argv(void)
Definition: crtdata.c:59
void Test__aexit_rtn(void)
Definition: crtdata.c:230
void Test__environ(void)
Definition: crtdata.c:342
void Test___pioinfo(void)
Definition: crtdata.c:158
void Test__wcmdln(void)
Definition: crtdata.c:542
void Test__commode(void)
Definition: crtdata.c:245
void Test__iob(void)
Definition: crtdata.c:399
void Test___mb_cur_max(void)
Definition: crtdata.c:123
void Test__timezone(void)
Definition: crtdata.c:510
void Test__winmajor(void)
Definition: crtdata.c:575
void Test___lc_handle(void)
Definition: crtdata.c:112
void Test__wctype(void)
Definition: crtdata.c:286
void Test___unguarded_readlc_active(void)
Definition: crtdata.c:176
void Test___lc_collate_cp(void)
Definition: crtdata.c:100
void Test___badioinfo(void)
Definition: crtdata.c:71
void Test___lc_codepage(void)
Definition: crtdata.c:90
#define NULL
Definition: types.h:112
#define GetProcAddress(x, y)
Definition: compat.h:753
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
BOOL WINAPI GetVersionExW(IN LPOSVERSIONINFOW lpVersionInformation)
Definition: version.c:37
PIMAGE_NT_HEADERS32 PIMAGE_NT_HEADERS
Definition: ntddk_ex.h:187
struct _IMAGE_DOS_HEADER * PIMAGE_DOS_HEADER
IMAGE_OPTIONAL_HEADER32 OptionalHeader
Definition: ntddk_ex.h:184
ULONG dwOSVersionInfoSize
Definition: rtltypes.h:246
ULONG dwMajorVersion
Definition: rtltypes.h:247
unsigned char * PUCHAR
Definition: typedefs.h:53

◆ Test___argc()

void Test___argc ( void  )

Definition at line 47 of file crtdata.c.

48{
49 void* p = &__argc;
51
52 #undef __argc
53 ok_ptr(&__argc, p);
54#ifdef _M_IX86
56#endif
57}
#define ok_ptr(expression, result)
Definition: atltest.h:108
#define test_is_local_symbol(addr, is)
Definition: crtdata.c:42
#define FALSE
Definition: types.h:117
int *CDECL __p___argc(void)
Definition: data.c:227
GLfloat GLfloat p
Definition: glext.h:8902
#define __argc
Definition: stdlib.h:1153

Referenced by START_TEST().

◆ Test___argv()

void Test___argv ( void  )

Definition at line 59 of file crtdata.c.

60{
61 void* p = &__argv;
63
64 #undef __argv
65 ok_ptr(&__argv, p);
66#ifdef _M_IX86
68#endif
69}
char ***CDECL __p___argv(void)
Definition: data.c:329
#define __argv
Definition: stdlib.h:1154

Referenced by START_TEST().

◆ Test___badioinfo()

void Test___badioinfo ( void  )

Definition at line 71 of file crtdata.c.

72{
73 typedef struct _ioinfo ioinfo;
74 _CRTIMP extern ioinfo* __badioinfo[];
75 ok(__badioinfo[0] != NULL, "__badioinfo is NULL\n");
76}
_CRTIMP ioinfo * __badioinfo[]
Definition: ioinit.cpp:17
Definition: file.c:128
#define _CRTIMP
Definition: vcruntime.h:54

Referenced by START_TEST().

◆ Test___initenv()

void Test___initenv ( void  )

Definition at line 79 of file crtdata.c.

80{
81 _CRTIMP extern char** __initenv;
82 ok(__initenv != NULL, "__initenv is NULL\n");
83 ok(*__initenv != NULL, "*__initenv is NULL\n");
84#ifdef _M_IX86
85 _CRTIMP char*** __p___initenv(void);
87#endif
88}
char ** __initenv
char ***CDECL __p___initenv(void)
Definition: data.c:355

Referenced by START_TEST().

◆ Test___lc_codepage()

void Test___lc_codepage ( void  )

Definition at line 90 of file crtdata.c.

91{
92 _CRTIMP extern unsigned int __lc_codepage;
93 ok_int(__lc_codepage, 0);
95 __lc_codepage++;
97 __lc_codepage--;
98}
#define ok_int(expression, result)
Definition: atltest.h:134
_ACRTIMP unsigned int __cdecl ___lc_codepage_func(void)
Definition: locale.c:1047

Referenced by START_TEST().

◆ Test___lc_collate_cp()

void Test___lc_collate_cp ( void  )

Definition at line 100 of file crtdata.c.

101{
102 _CRTIMP extern int __lc_collate_cp;
103 test_is_local_symbol(&__lc_collate_cp, FALSE);
104 ok_int(__lc_collate_cp, 0);
106 __lc_collate_cp++;
108 __lc_collate_cp--;
109}
int CDECL ___lc_collate_cp_func(void)
Definition: locale.c:1055

Referenced by START_TEST().

◆ Test___lc_handle()

void Test___lc_handle ( void  )

Definition at line 112 of file crtdata.c.

113{
114 _CRTIMP int __lc_handle;
115 ok_int(__lc_handle, 0);
118 __lc_handle++;
120 __lc_handle--;
121}
LCID *CDECL ___lc_handle_func(void)
Definition: locale.c:1029

Referenced by START_TEST().

◆ Test___mb_cur_max()

void Test___mb_cur_max ( void  )

Definition at line 123 of file crtdata.c.

124{
125 void* p = &__mb_cur_max;
128
129 #undef __mb_cur_max
130 _CRTIMP extern int __mb_cur_max;
132
134#ifdef _M_IX86
135 _CRTIMP int* __p___mb_cur_max(void);
137#endif
138 __mb_cur_max++;
139 if (s_osvi.dwMajorVersion >= 6)
140 {
142#ifdef _M_IX86
144#endif
145 }
146 else
147 {
149#ifdef _M_IX86
150 todo_ros ok_ptr(__p___mb_cur_max(), p); // wine code handles it like on Vista+
152#endif
153 }
154
155 __mb_cur_max--;
156}
#define __mb_cur_max
Definition: stdlib.h:126
int *CDECL __p___mb_cur_max(void)
Definition: mbcs.c:189
#define todo_ros
Definition: minitest.h:74
#define ___mb_cur_max_func()
Definition: ctype.h:636

Referenced by START_TEST().

◆ Test___pioinfo()

void Test___pioinfo ( void  )

Definition at line 158 of file crtdata.c.

159{
160
161}

Referenced by START_TEST().

◆ Test___setlc_active()

void Test___setlc_active ( void  )

Definition at line 164 of file crtdata.c.

165{
166 _CRTIMP extern unsigned int __setlc_active;
167 ok_int(__setlc_active, 0);
168
169 _CRTIMP unsigned int ___setlc_active_func(void);
170 ok_int(___setlc_active_func(), __setlc_active);
171 __setlc_active++;
172 ok_int(___setlc_active_func(), __setlc_active);
173 __setlc_active--;
174}
unsigned int CDECL ___setlc_active_func(void)
Definition: data.c:394

Referenced by START_TEST().

◆ Test___unguarded_readlc_active()

void Test___unguarded_readlc_active ( void  )

Definition at line 176 of file crtdata.c.

177{
178 _CRTIMP extern unsigned int __unguarded_readlc_active;
179 void* p = &__unguarded_readlc_active;
180 ok_int(__unguarded_readlc_active, 0);
181
184}
unsigned int *CDECL ___unguarded_readlc_active_add_func(void)
Definition: data.c:386

Referenced by START_TEST().

◆ Test___wargv()

void Test___wargv ( void  )

Definition at line 187 of file crtdata.c.

188{
189 void* p = &__wargv;
191
192 #undef __wargv
193 _CRTIMP extern wchar_t ** __wargv;
194 ok_ptr(&__wargv, p);
195#ifdef _M_IX86
196 ok_ptr(__p___wargv(), p);
197#endif
198}
wchar_t ***CDECL __p___wargv(void)
Definition: data.c:334
#define __wargv
Definition: stdlib.h:1155

Referenced by START_TEST().

◆ Test___winitenv()

void Test___winitenv ( void  )

Definition at line 201 of file crtdata.c.

202{
203 _CRTIMP extern wchar_t** __winitenv;
204 ok(__winitenv == NULL, "__winitenv is not NULL\n");
205#ifdef _M_IX86
206 _CRTIMP wchar_t*** __p___winitenv(void);
208#endif
209}
wchar_t ** __winitenv
wchar_t ***CDECL __p___winitenv(void)
Definition: data.c:360

Referenced by START_TEST().

◆ Test__acmdln()

void Test__acmdln ( void  )

Definition at line 212 of file crtdata.c.

213{
214 _CRTIMP extern char* _acmdln;
215 ok(_acmdln != NULL, "__winitenv is NULL\n");
216#ifdef _M_IX86
217 _CRTIMP char** __p__acmdln(void);
219#endif
220}
char **CDECL __p__acmdln(void)
Definition: data.c:319
#define _acmdln

Referenced by START_TEST().

◆ Test__aexit_rtn()

void Test__aexit_rtn ( void  )

Definition at line 230 of file crtdata.c.

231{
232 typedef void (*_exit_t)(int exitcode);
233 _CRTIMP extern _exit_t _aexit_rtn;
234 // On Vista and Win 7 the pointer is encoded
235 if ((GetNTVersion() >= 0x600) && (GetNTVersion() <= 0x601))
236 {
237 ok_ptr(_aexit_rtn, EncodePointer(_exit));
238 }
239 else
240 {
241 ok_ptr(_aexit_rtn, _exit);
242 }
243}
#define GetNTVersion()
Definition: apitest.h:17
void CDECL _exit(int exitcode)
Definition: exit.c:187
PVOID WINAPI EncodePointer(PVOID)

Referenced by START_TEST().

◆ Test__commode()

void Test__commode ( void  )

Definition at line 245 of file crtdata.c.

246{
247 void* p = &_commode;
249 ok_int(_commode, 0);
250
251 #undef _commode
252 _CRTIMP extern int _commode;
253 ok_ptr(&_commode, p);
254#ifdef _M_IX86
256#endif
257}
unsigned int *CDECL __p__commode(void)
Definition: data.c:232
_CRTIMP int _commode
Definition: ncommode.cpp:13

Referenced by START_TEST().

◆ Test__ctype()

void Test__ctype ( void  )

Definition at line 259 of file crtdata.c.

260{
261 _CRTIMP extern const unsigned short _ctype[];
262 ok_int(_ctype[0], 0);
264
265 #undef _pctype
266 _CRTIMP extern const unsigned short* _pctype;
267 ok(_pctype != &_ctype[0], "_pwctype should not match &_wctype[0]");
268 if (s_osvi.dwMajorVersion >= 6)
269 {
270 ok(_pctype != &_ctype[1], "_pwctype should not match &_wctype[1]");
271 }
272 else
273 {
274 ok(_pctype == &_ctype[1], "_pwctype should match &_wctype[1]");
275 }
276
277 ok(__pctype_func() != _ctype, "__pctype_func() should not match _ctype\n");
280#ifdef _M_IX86
281 _CRTIMP const unsigned short** __cdecl __p__pctype(void);
283#endif
284}
unsigned short **CDECL __p__pctype(void)
Definition: ctype.c:133
#define __cdecl
Definition: corecrt.h:121
#define _CONTROL
#define __pctype_func()
Definition: wctype.h:34
#define _pctype
Definition: wctype.h:43
const unsigned short _ctype[]
Definition: ctype.c:36

Referenced by START_TEST().

◆ Test__daylight()

void Test__daylight ( void  )

Definition at line 304 of file crtdata.c.

305{
306 void* p = &_daylight;
308
309 #undef _daylight
310 _CRTIMP extern int _daylight;
311 ok_ptr(&_daylight, p);
312
313#ifdef _M_IX86
314 _CRTIMP void* __p__daylight(void);
316#endif
317 if (p__daylight != NULL)
318 {
320 }
321}
int *CDECL __p__daylight(void)
Definition: time.c:808
#define _daylight
Definition: time.h:70

Referenced by START_TEST().

◆ Test__dstbias()

void Test__dstbias ( void  )

Definition at line 324 of file crtdata.c.

325{
326 void* p = &_dstbias;
328
329 #undef _dstbias
330 _CRTIMP extern long _dstbias;
331 ok_ptr(&_dstbias, p);
332#ifdef _M_IX86
333 _CRTIMP long* __cdecl __p__dstbias(void);
335#endif
336 if (p__dstbias != NULL)
337 {
339 }
340}
__msvcrt_long *CDECL __p__dstbias(void)
Definition: time.c:816
#define _dstbias
Definition: time.h:76

Referenced by START_TEST().

◆ Test__environ()

void Test__environ ( void  )

Definition at line 342 of file crtdata.c.

343{
344 void* p = &_environ;
345 ok(_environ != NULL, "_environ == NULL\n");
346
347 #undef _environ
348 _CRTIMP extern char** _environ;
349 ok_ptr(&_environ, p);
350#ifdef _M_IX86
352#endif
353 if (p_get_environ != NULL)
354 {
355 char** result_environ;
356 ok_int(p_get_environ(&result_environ), 0);
357 ok_ptr(result_environ, _environ);
358 }
359}
char ***CDECL __p__environ(void)
Definition: data.c:339
#define _environ
Definition: stdlib.h:1171

Referenced by START_TEST().

◆ Test__fileinfo()

void Test__fileinfo ( void  )

Definition at line 361 of file crtdata.c.

362{
363 _CRTIMP extern int _fileinfo;
364 ok_int(_fileinfo, -1);
365
366#ifdef _M_IX86
367 _CRTIMP int* __p__fileinfo();
369#endif
370}
int _fileinfo
Definition: misc.c:26
int * __p__fileinfo(void)
Definition: misc.c:33

Referenced by START_TEST().

◆ Test__fmode()

void Test__fmode ( void  )

Definition at line 373 of file crtdata.c.

374{
375 void* p = &_fmode;
377 ok_int(_fmode, 0);
378
379 #undef _fmode
380 _CRTIMP extern int _fmode;
381 ok_ptr(&_fmode, p);
382
383#ifdef _M_IX86
385 ok_ptr(__p__fmode(), p);
386#endif
387
388 if (p_get_fmode != NULL)
389 {
390 _fmode = 1234;
391
392 int mode;
393 ok_int(p_get_fmode(&mode), 0);
395 _fmode = 0;
396 }
397}
int *CDECL __p__fmode(void)
Definition: data.c:269
GLenum mode
Definition: glext.h:6217
#define _fmode
Definition: stdlib.h:255

Referenced by START_TEST().

◆ Test__iob()

void Test__iob ( void  )

Definition at line 399 of file crtdata.c.

400{
401 void* p = &_iob;
403 ok_ptr(&_iob[0], stdin);
404 ok_ptr(&_iob[1], stdout);
405 ok_ptr(&_iob[2], stderr);
406
407 #undef _iob
408 _CRTIMP extern FILE _iob[];
409 ok_ptr(&_iob, p);
410
412
413#ifdef _M_IX86
414 _CRTIMP int* __cdecl __p__iob();
415 ok_ptr(__p__iob(), p);
416#endif
417}
FILE *CDECL __iob_func(void)
Definition: file.c:972
#define stdout
#define stderr
#define stdin
#define _iob
Definition: stdio.h:63

Referenced by START_TEST().

◆ Test__mbcasemap()

void Test__mbcasemap ( void  )

Definition at line 419 of file crtdata.c.

420{
421 void* p = &_mbcasemap;
422 ok_int(_mbcasemap[0], 0);
423
424 #undef _mbcasemap
426
427#ifdef _M_IX86
428 _CRTIMP unsigned char* __cdecl __p__mbcasemap();
430#endif
431}
unsigned char * __p__mbcasemap(void)
Definition: misc.c:28
#define _mbcasemap
Definition: mbctype.h:34

Referenced by START_TEST().

◆ Test__mbctype()

void Test__mbctype ( void  )

Definition at line 433 of file crtdata.c.

434{
435 void* p = &_mbctype;
436 ok_int(_mbctype[0], 0);
437
438 #undef _mbctype
439 ok_ptr(&_mbctype, p);
440
441#ifdef _M_IX86
442 _CRTIMP unsigned char* __cdecl __p__mbctype();
443 todo_ros ok_ptr(__p__mbctype(), &_mbctype); // wine implements thiss like on Vista
444#endif
445}
unsigned char *CDECL __p__mbctype(void)
Definition: mbcs.c:181
#define _mbctype
Definition: mbctype.h:33

Referenced by START_TEST().

◆ Test__osplatform()

void Test__osplatform ( void  )

Definition at line 448 of file crtdata.c.

449{
451 if (p_get_osplatform != NULL)
452 {
453 unsigned int result_osplatform;
454 ok_int(p_get_osplatform(&result_osplatform), 0);
455 ok_int(result_osplatform, _osplatform);
456 }
457}
_CRTIMP unsigned int _osplatform
ULONG dwPlatformId
Definition: rtltypes.h:250

Referenced by START_TEST().

◆ Test__osver()

void Test__osver ( void  )

Definition at line 460 of file crtdata.c.

461{
463
464#ifdef _M_IX86
467#endif
468}
unsigned int *CDECL __p__osver(void)
Definition: data.c:299
unsigned int _osver
ULONG dwBuildNumber
Definition: rtltypes.h:249

Referenced by START_TEST().

◆ Test__pgmptr()

void Test__pgmptr ( void  )

Definition at line 470 of file crtdata.c.

471{
472 void* p = &_pgmptr;
473 ok(_pgmptr != NULL, "_pgmptr should not be NULL\n");
474
475 #undef _pgmptr
476 _CRTIMP extern char* _pgmptr;
477 ok_ptr(&_pgmptr, p);
478#ifdef _M_IX86
480#endif
481 if (p_get_pgmptr != NULL)
482 {
483 char *result_pgmptr;
484 ok_int(p_get_pgmptr(&result_pgmptr), 0);
485 ok_ptr(result_pgmptr, _pgmptr);
486 }
487}
char **CDECL __p__pgmptr(void)
Definition: data.c:238
#define _pgmptr
Definition: stdlib.h:253

Referenced by START_TEST().

◆ Test__sys_errlist()

void Test__sys_errlist ( void  )

Definition at line 489 of file crtdata.c.

490{
491 void* p = &_sys_errlist;
493 ok_int(strcmp(_sys_errlist[42], strerror(42)), 0);
494
495 #undef _sys_errlist
496 _CRTIMP extern char* _sys_errlist[];
498}
char *CDECL strerror(int err)
Definition: errno.c:273
_ACRTIMP int __cdecl strcmp(const char *, const char *)
Definition: string.c:3319
_CRTIMP char * _sys_errlist[]
Definition: syserr.cpp:18

Referenced by START_TEST().

◆ Test__sys_nerr()

void Test__sys_nerr ( void  )

Definition at line 500 of file crtdata.c.

501{
502 void* p = &_sys_nerr;
503 ok_int(_sys_nerr, 43);
504
505 #undef _sys_nerr
506 _CRTIMP extern int _sys_nerr;
507 ok_ptr(&_sys_nerr, p);
508}
#define _sys_nerr
Definition: stdlib.h:133

Referenced by START_TEST().

◆ Test__timezone()

void Test__timezone ( void  )

Definition at line 510 of file crtdata.c.

511{
512 void* p = &_timezone;
514
515 #undef _timezone
516 _CRTIMP extern long _timezone;
517 ok_ptr(&_timezone, p);
518
519#ifdef _M_IX86
520 _CRTIMP char** __p__timezone();
522#endif
523}
__msvcrt_long *CDECL __p__timezone(void)
Definition: time.c:836
#define _timezone
Definition: time.h:82

Referenced by START_TEST().

◆ Test__tzname()

void Test__tzname ( void  )

Definition at line 525 of file crtdata.c.

526{
527 void* p = &_tzname;
529 ok(_tzname[0] != NULL, "_tzname[0] == NULL\n");
530 ok(_tzname[0] != NULL, "_tzname[0] == NULL\n");
531
532 #undef _tzname
533 _CRTIMP extern char * _tzname[2];
534 ok_ptr(_tzname, p);
535
536#ifdef _M_IX86
537 _CRTIMP char** __p__tzname();
539#endif
540}
char **CDECL __p__tzname(void)
Definition: time.c:883
#define _tzname
Definition: time.h:88

Referenced by START_TEST().

◆ Test__wcmdln()

void Test__wcmdln ( void  )

Definition at line 542 of file crtdata.c.

543{
544 _CRTIMP extern wchar_t* _wcmdln;
545#ifdef _M_IX86
546 _CRTIMP wchar_t** __p__wcmdln(void);
548#endif
549}
wchar_t **CDECL __p__wcmdln(void)
Definition: data.c:324
#define _wcmdln

Referenced by START_TEST().

◆ Test__wctype()

void Test__wctype ( void  )

Definition at line 286 of file crtdata.c.

287{
288 ok_int(_wctype[0], 0);
290
291 #undef _pwctype
292 _CRTIMP extern const unsigned short* _pwctype;
293 ok_ptr(_pwctype, &_wctype[1]);
294
295 ok(__pwctype_func() != _wctype, "__pwctype_func() == _wctype\n");
298#ifdef _M_IX86
299 _CRTIMP const unsigned short** __cdecl __p__pwctype(void);
301#endif
302}
unsigned short **CDECL __p__pwctype(void)
Definition: ctype.c:149
#define __pwctype_func()
Definition: wctype.h:68
#define _wctype
Definition: wctype.h:58
#define _pwctype
Definition: wctype.h:67

Referenced by START_TEST().

◆ Test__wenviron()

void Test__wenviron ( void  )

Definition at line 552 of file crtdata.c.

553{
554 void* p = &_wenviron;
555 ok(_wenviron == NULL, "_wenviron is not NULL\n");
556
557 #undef _wenviron
558 _CRTIMP extern wchar_t** _wenviron;
559 ok_ptr(&_wenviron, p);
560#ifdef _M_IX86
562#endif
563
564#if 0 // FIXME: This returns an error / NULL on Windows 10
565 if (p_get_wenviron != NULL)
566 {
567 wchar_t** result_wenviron;
568 ok_int(p_get_wenviron(&result_wenviron), 0);
569 ok_ptr(result_wenviron, _wenviron);
570 }
571#endif
572}
wchar_t ***CDECL __p__wenviron(void)
Definition: data.c:347
#define _wenviron
Definition: stdlib.h:1172

Referenced by START_TEST().

◆ Test__winmajor()

void Test__winmajor ( void  )

Definition at line 575 of file crtdata.c.

576{
578#ifdef _M_IX86
579 _CRTIMP unsigned int* __cdecl __p__winmajor();
581#endif
582 if (p_get_winmajor != NULL)
583 {
584 unsigned int result_winmajor;
585 ok_int(p_get_winmajor(&result_winmajor), 0);
586 ok_int(result_winmajor, _winmajor);
587 }
588}
unsigned int *CDECL __p__winmajor(void)
Definition: data.c:304
unsigned int _winmajor

Referenced by START_TEST().

◆ Test__winminor()

void Test__winminor ( void  )

Definition at line 590 of file crtdata.c.

591{
593#ifdef _M_IX86
594 _CRTIMP unsigned int* __cdecl __p__winminor();
596#endif
597 if (p_get_winminor != NULL)
598 {
599 unsigned int result_winminor;
600 ok_int(p_get_winminor(&result_winminor), 0);
601 ok_int(result_winminor, _winminor);
602 }
603}
unsigned int *CDECL __p__winminor(void)
Definition: data.c:309
unsigned int _winminor
ULONG dwMinorVersion
Definition: rtltypes.h:248

Referenced by START_TEST().

◆ Test__winver()

void Test__winver ( void  )

Definition at line 606 of file crtdata.c.

607{
609#ifdef _M_IX86
610 _CRTIMP unsigned int* __cdecl __p__winver();
612#endif
613 if (p_get_winver != NULL)
614 {
615 unsigned int result_winver;
616 ok_int(p_get_winver(&result_winver), 0);
617 ok_int(result_winver, _winver);
618 }
619}
unsigned int *CDECL __p__winver(void)
Definition: data.c:314
unsigned int _winver

Referenced by START_TEST().

◆ Test__wpgmptr()

void Test__wpgmptr ( void  )

Definition at line 622 of file crtdata.c.

623{
624 void* p = _wpgmptr;
626
627 #undef _wpgmptr
628 ok_ptr(_wpgmptr, p);
629
630#ifdef _M_IX86
631 _CRTIMP wchar_t ** __cdecl __p__wpgmptr();
633#endif
634
635#if 0 // FIXME: This returns an error on Windows 10
636 if (p_get_wpgmptr != NULL)
637 {
638 wchar_t* result_wpgmptr;
639 ok_int(p_get_wpgmptr(&result_wpgmptr), 0);
640 ok_ptr(result_wpgmptr, _wpgmptr);
641 }
642#endif
643}
WCHAR **CDECL __p__wpgmptr(void)
Definition: data.c:243
#define _wpgmptr
Definition: stdlib.h:254

Referenced by START_TEST().

Variable Documentation

◆ __ImageBase

char __ImageBase
extern

Referenced by IsLocalSymbol(), and START_TEST().

◆ s_ImageEnd

void* s_ImageEnd
static

Definition at line 20 of file crtdata.c.

Referenced by IsLocalSymbol(), and START_TEST().

◆ s_osvi