ReactOS 0.4.16-dev-1946-g52006dd
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 646 of file crtdata.c.

647{
648 /* Initialize image size */
650 PIMAGE_NT_HEADERS ntHeaders = (PIMAGE_NT_HEADERS)((PUCHAR)dosHeader + dosHeader->e_lfanew);
651 s_ImageEnd = (PUCHAR)dosHeader + ntHeaders->OptionalHeader.SizeOfImage;
652
653 /* initialize version info */
656
657 HMODULE hmsvcrt = GetModuleHandleA("msvcrt.dll");
658 p__daylight = (void*)GetProcAddress(hmsvcrt, "__daylight");
659 p__dstbias = (void*)GetProcAddress(hmsvcrt, "__dstbias");
660 p_get_fmode = (void*)GetProcAddress(hmsvcrt, "_get_fmode");
661 p_get_osplatform = (void*)GetProcAddress(hmsvcrt, "_get_osplatform");
662 p_get_pgmptr = (void*)GetProcAddress(hmsvcrt, "_get_pgmptr");
663 p_get_wpgmptr = (void*)GetProcAddress(hmsvcrt, "_get_wpgmptr");
664 p_get_winver = (void*)GetProcAddress(hmsvcrt, "_get_winver");
665 p_get_winmajor = (void*)GetProcAddress(hmsvcrt, "_get_winmajor");
666 p_get_winminor = (void*)GetProcAddress(hmsvcrt, "_get_winminor");
667 p_get_environ = (void*)GetProcAddress(hmsvcrt, "_get_environ");
668 p_get_wenviron = (void*)GetProcAddress(hmsvcrt, "_get_wenviron");
669
670 if (s_osvi.dwMajorVersion >= 6)
671 {
672 ok(p__daylight != NULL, "__daylight is NULL\n");
673 ok(p__dstbias != NULL, "__dstbias is NULL\n");
674 ok(p_get_fmode != NULL, "_get_fmode is NULL\n");
675 ok(p_get_osplatform != NULL, "_get_osplatform is NULL\n");
676 ok(p_get_pgmptr != NULL, "_get_pgmptr is NULL\n");
677 ok(p_get_wpgmptr != NULL, "_get_wpgmptr is NULL\n");
678 ok(p_get_winver != NULL, "_get_winver is NULL\n");
679 ok(p_get_winmajor != NULL, "_get_winmajor is NULL\n");
680 ok(p_get_winminor != NULL, "_get_winminor is NULL\n");
681 ok(p_get_environ != NULL, "_get_environ is NULL\n");
682 ok(p_get_wenviron != NULL, "_get_wenviron is NULL\n");
683 }
684
685 Test___argc();
686 Test___argv();
688#ifndef _M_ARM
692#endif
696#ifndef _M_ARM
699#endif
700 Test___wargv();
701#ifndef _M_ARM
703#endif
704 Test__acmdln();
705#ifdef _M_IX86
706 Test__adjust_fdiv();
707#endif
710 Test__ctype();
712#ifndef _M_ARM
716#endif
717 Test__fmode();
718 Test__iob();
721#ifndef _M_ARM
723#endif
724 Test__osver();
725 Test__pgmptr();
729 Test__tzname();
730 Test__wcmdln();
731 Test__wctype();
732#ifndef _M_ARM
734#endif
737#ifndef _M_ARM
738 Test__winver();
739#endif
741}
#define ok(value,...)
Definition: atltest.h:57
void Test__tzname(void)
Definition: crtdata.c:526
void Test__winminor(void)
Definition: crtdata.c:591
void Test__osplatform(void)
Definition: crtdata.c:449
void Test__osver(void)
Definition: crtdata.c:461
int *__cdecl * p__daylight(void)
void Test__dstbias(void)
Definition: crtdata.c:325
void Test__acmdln(void)
Definition: crtdata.c:213
void Test__mbcasemap(void)
Definition: crtdata.c:420
void Test__fileinfo(void)
Definition: crtdata.c:362
void Test___argc(void)
Definition: crtdata.c:47
void Test__sys_errlist(void)
Definition: crtdata.c:490
void Test__winver(void)
Definition: crtdata.c:607
void Test__wpgmptr(void)
Definition: crtdata.c:623
void Test___wargv(void)
Definition: crtdata.c:188
void Test__daylight(void)
Definition: crtdata.c:305
void Test___initenv(void)
Definition: crtdata.c:80
void Test__wenviron(void)
Definition: crtdata.c:553
void Test__mbctype(void)
Definition: crtdata.c:434
void Test___winitenv(void)
Definition: crtdata.c:202
void Test__fmode(void)
Definition: crtdata.c:374
void Test__ctype(void)
Definition: crtdata.c:260
void Test___setlc_active(void)
Definition: crtdata.c:165
long *__cdecl * p__dstbias(void)
static OSVERSIONINFOW s_osvi
Definition: crtdata.c:18
void Test__sys_nerr(void)
Definition: crtdata.c:501
void Test__pgmptr(void)
Definition: crtdata.c:471
void Test___argv(void)
Definition: crtdata.c:59
void Test__aexit_rtn(void)
Definition: crtdata.c:231
void Test__environ(void)
Definition: crtdata.c:343
void Test___pioinfo(void)
Definition: crtdata.c:159
void Test__wcmdln(void)
Definition: crtdata.c:543
void Test__commode(void)
Definition: crtdata.c:246
void Test__iob(void)
Definition: crtdata.c:400
void Test___mb_cur_max(void)
Definition: crtdata.c:124
void Test__timezone(void)
Definition: crtdata.c:511
void Test__winmajor(void)
Definition: crtdata.c:576
void Test___lc_handle(void)
Definition: crtdata.c:113
void Test__wctype(void)
Definition: crtdata.c:287
void Test___unguarded_readlc_active(void)
Definition: crtdata.c:177
void Test___lc_collate_cp(void)
Definition: crtdata.c:101
void Test___badioinfo(void)
Definition: crtdata.c:71
void Test___lc_codepage(void)
Definition: crtdata.c:91
#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
GLfloat GLfloat p
Definition: glext.h:8902
_CRTIMP int *__cdecl __p___argc()
Definition: getargs.c:475
#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}
_CRTIMP char ***__cdecl __p___argv()
Definition: getargs.c:483
#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 != NULL, "__badioinfo is NULL\n");
76 ok(__badioinfo[0] != NULL, "__badioinfo is NULL\n");
77}
_CRTIMP ioinfo * __badioinfo[]
Definition: file.c:126
Definition: file.c:59
#define _CRTIMP
Definition: vcruntime.h:54

Referenced by START_TEST().

◆ Test___initenv()

void Test___initenv ( void  )

Definition at line 80 of file crtdata.c.

81{
82 _CRTIMP extern char** __initenv;
83 ok(__initenv != NULL, "__initenv is NULL\n");
84 ok(*__initenv != NULL, "*__initenv is NULL\n");
85#ifdef _M_IX86
86 _CRTIMP char*** __p___initenv(void);
88#endif
89}
char ** __initenv
Definition: environ.c:24
char *** __p___initenv(void)
Definition: environ.c:400

Referenced by START_TEST().

◆ Test___lc_codepage()

void Test___lc_codepage ( void  )

Definition at line 91 of file crtdata.c.

92{
93 _CRTIMP extern unsigned int __lc_codepage;
99}
#define ok_int(expression, result)
Definition: atltest.h:134
_CRTIMP unsigned int __cdecl ___lc_codepage_func(void)
Definition: locale.c:629
#define todo_ros
Definition: minitest.h:74
unsigned int __lc_codepage
Definition: locale.c:36

Referenced by START_TEST().

◆ Test___lc_collate_cp()

void Test___lc_collate_cp ( void  )

Definition at line 101 of file crtdata.c.

102{
103 _CRTIMP extern int __lc_collate_cp;
110}
_CRTIMP unsigned int __cdecl ___lc_collate_cp_func(void)
Definition: locale.c:637
int __lc_collate_cp

Referenced by START_TEST().

◆ Test___lc_handle()

void Test___lc_handle ( void  )

Definition at line 113 of file crtdata.c.

114{
115 _CRTIMP int __lc_handle;
116 ok_int(__lc_handle, 0);
119 __lc_handle++;
121 __lc_handle--;
122}
LCID *CDECL ___lc_handle_func(void)
Definition: locale.c:621

Referenced by START_TEST().

◆ Test___mb_cur_max()

void Test___mb_cur_max ( void  )

Definition at line 124 of file crtdata.c.

125{
126 void* p = &__mb_cur_max;
129
130 #undef __mb_cur_max
131 _CRTIMP extern int __mb_cur_max;
133
135#ifdef _M_IX86
136 _CRTIMP int* __p___mb_cur_max(void);
138#endif
139 __mb_cur_max++;
140 if (s_osvi.dwMajorVersion >= 6)
141 {
143#ifdef _M_IX86
145#endif
146 }
147 else
148 {
150#ifdef _M_IX86
151 todo_ros ok_ptr(__p___mb_cur_max(), p); // wine code handles it like on Vista+
153#endif
154 }
155
156 __mb_cur_max--;
157}
#define __mb_cur_max
Definition: ctype.h:629
#define ___mb_cur_max_func()
Definition: ctype.h:636
int *__cdecl __p___mb_cur_max(void)
Definition: environ.c:430

Referenced by START_TEST().

◆ Test___pioinfo()

void Test___pioinfo ( void  )

Definition at line 159 of file crtdata.c.

160{
161
162}

Referenced by START_TEST().

◆ Test___setlc_active()

void Test___setlc_active ( void  )

Definition at line 165 of file crtdata.c.

166{
167 _CRTIMP extern unsigned int __setlc_active;
169
170 _CRTIMP unsigned int ___setlc_active_func(void);
175}
unsigned int CDECL ___setlc_active_func(void)
Definition: locale.c:1483
unsigned int __setlc_active
Definition: environ.c:16

Referenced by START_TEST().

◆ Test___unguarded_readlc_active()

void Test___unguarded_readlc_active ( void  )

Definition at line 177 of file crtdata.c.

178{
179 _CRTIMP extern unsigned int __unguarded_readlc_active;
182
185}
unsigned int __unguarded_readlc_active
Definition: environ.c:17
unsigned int *CDECL ___unguarded_readlc_active_add_func(void)
Definition: locale.c:1492

Referenced by START_TEST().

◆ Test___wargv()

void Test___wargv ( void  )

Definition at line 188 of file crtdata.c.

189{
190 void* p = &__wargv;
192
193 #undef __wargv
194 _CRTIMP extern wchar_t ** __wargv;
195 ok_ptr(&__wargv, p);
196#ifdef _M_IX86
197 ok_ptr(__p___wargv(), p);
198#endif
199}
_CRTIMP wchar_t ***__cdecl __p___wargv()
Definition: getargs.c:491
#define __wargv
Definition: stdlib.h:1155

Referenced by START_TEST().

◆ Test___winitenv()

void Test___winitenv ( void  )

Definition at line 202 of file crtdata.c.

203{
204 _CRTIMP extern wchar_t** __winitenv;
205 todo_ros ok(__winitenv == NULL, "__winitenv is not NULL\n");
206#ifdef _M_IX86
207 _CRTIMP wchar_t*** __p___winitenv(void);
209#endif
210}
wchar_t ** __winitenv
Definition: environ.c:25
wchar_t *** __p___winitenv(void)
Definition: environ.c:408

Referenced by START_TEST().

◆ Test__acmdln()

void Test__acmdln ( void  )

Definition at line 213 of file crtdata.c.

214{
215 _CRTIMP extern char* _acmdln;
216 ok(_acmdln != NULL, "__winitenv is NULL\n");
217#ifdef _M_IX86
218 _CRTIMP char** __p__acmdln(void);
220#endif
221}
const char ** __p__acmdln(void)
Definition: environ.c:368
#define _acmdln

Referenced by START_TEST().

◆ Test__aexit_rtn()

void Test__aexit_rtn ( void  )

Definition at line 231 of file crtdata.c.

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

Referenced by START_TEST().

◆ Test__commode()

void Test__commode ( void  )

Definition at line 246 of file crtdata.c.

247{
248 void* p = &_commode;
250 ok_int(_commode, 0);
251
252 #undef _commode
253 _CRTIMP extern int _commode;
254 ok_ptr(&_commode, p);
255#ifdef _M_IX86
257#endif
258}
_CRTIMP int _commode
Definition: environ.c:31
int * __p__commode(void)
Definition: environ.c:352

Referenced by START_TEST().

◆ Test__ctype()

void Test__ctype ( void  )

Definition at line 260 of file crtdata.c.

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

Referenced by START_TEST().

◆ Test__daylight()

void Test__daylight ( void  )

Definition at line 305 of file crtdata.c.

306{
307 void* p = &_daylight;
309
310 #undef _daylight
311 _CRTIMP extern int _daylight;
312 ok_ptr(&_daylight, p);
313
314#ifdef _M_IX86
315 _CRTIMP void* __p__daylight(void);
317#endif
318 if (p__daylight != NULL)
319 {
321 }
322}
#define _daylight
Definition: time.h:70
void * __p__daylight(void)
Definition: timezone.c:37

Referenced by START_TEST().

◆ Test__dstbias()

void Test__dstbias ( void  )

Definition at line 325 of file crtdata.c.

326{
327 void* p = &_dstbias;
329
330 #undef _dstbias
331 _CRTIMP extern long _dstbias;
332 ok_ptr(&_dstbias, p);
333#ifdef _M_IX86
334 _CRTIMP long* __cdecl __p__dstbias(void);
336#endif
337 if (p__dstbias != NULL)
338 {
340 }
341}
#define _dstbias
Definition: time.h:76
long * __p__dstbias(void)
Definition: timezone.c:69

Referenced by START_TEST().

◆ Test__environ()

void Test__environ ( void  )

Definition at line 343 of file crtdata.c.

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

Referenced by START_TEST().

◆ Test__fileinfo()

void Test__fileinfo ( void  )

Definition at line 362 of file crtdata.c.

363{
364 _CRTIMP extern int _fileinfo;
365 ok_int(_fileinfo, -1);
366
367#ifdef _M_IX86
368 _CRTIMP int* __p__fileinfo();
370#endif
371}
void * __p__fileinfo()
Definition: stubs.c:17
int _fileinfo
Definition: stubs.c:14

Referenced by START_TEST().

◆ Test__fmode()

void Test__fmode ( void  )

Definition at line 374 of file crtdata.c.

375{
376 void* p = &_fmode;
378 ok_int(_fmode, 0);
379
380 #undef _fmode
381 _CRTIMP extern int _fmode;
382 ok_ptr(&_fmode, p);
383
384#ifdef _M_IX86
386 ok_ptr(__p__fmode(), p);
387#endif
388
389 if (p_get_fmode != NULL)
390 {
391 _fmode = 1234;
392
393 int mode;
394 ok_int(p_get_fmode(&mode), 0);
396 _fmode = 0;
397 }
398}
GLenum mode
Definition: glext.h:6217
unsigned int *__cdecl __p__fmode(void)
Definition: fmode.c:9
#define _fmode
Definition: stdlib.h:255

Referenced by START_TEST().

◆ Test__iob()

void Test__iob ( void  )

Definition at line 400 of file crtdata.c.

401{
402 void* p = &_iob;
404 ok_ptr(&_iob[0], stdin);
405 ok_ptr(&_iob[1], stdout);
406 ok_ptr(&_iob[2], stderr);
407
408 #undef _iob
409 _CRTIMP extern FILE _iob[];
410 ok_ptr(&_iob, p);
411
413
414#ifdef _M_IX86
415 _CRTIMP int* __cdecl __p__iob();
416 ok_ptr(__p__iob(), p);
417#endif
418}
#define stdout
Definition: stdio.h:99
#define stderr
Definition: stdio.h:100
_CRTIMP FILE *__cdecl __iob_func(void)
Definition: file.c:682
#define stdin
Definition: stdio.h:98
FILE _iob[_IOB_ENTRIES]
Definition: file.c:133

Referenced by START_TEST().

◆ Test__mbcasemap()

void Test__mbcasemap ( void  )

Definition at line 420 of file crtdata.c.

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

Referenced by START_TEST().

◆ Test__mbctype()

void Test__mbctype ( void  )

Definition at line 434 of file crtdata.c.

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

Referenced by START_TEST().

◆ Test__osplatform()

void Test__osplatform ( void  )

Definition at line 449 of file crtdata.c.

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

Referenced by START_TEST().

◆ Test__osver()

void Test__osver ( void  )

Definition at line 461 of file crtdata.c.

462{
464
465#ifdef _M_IX86
468#endif
469}
unsigned int _osver
Definition: environ.c:11
unsigned int * __p__osver(void)
Definition: environ.c:446
ULONG dwBuildNumber
Definition: rtltypes.h:249

Referenced by START_TEST().

◆ Test__pgmptr()

void Test__pgmptr ( void  )

Definition at line 471 of file crtdata.c.

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

Referenced by START_TEST().

◆ Test__sys_errlist()

void Test__sys_errlist ( void  )

Definition at line 490 of file crtdata.c.

491{
492 void* p = &_sys_errlist;
494 ok_int(strcmp(_sys_errlist[42], strerror(42)), 0);
495
496 #undef _sys_errlist
497 _CRTIMP extern char* _sys_errlist[];
499}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
const char * strerror(int err)
Definition: compat_str.c:23
_CRTIMP char * _sys_errlist[]
Definition: strerror.c:68

Referenced by START_TEST().

◆ Test__sys_nerr()

void Test__sys_nerr ( void  )

Definition at line 501 of file crtdata.c.

502{
503 void* p = &_sys_nerr;
504 ok_int(_sys_nerr, 43);
505
506 #undef _sys_nerr
507 _CRTIMP extern int _sys_nerr;
508 ok_ptr(&_sys_nerr, p);
509}
_CRTIMP int _sys_nerr
Definition: strerror.c:80

Referenced by START_TEST().

◆ Test__timezone()

void Test__timezone ( void  )

Definition at line 511 of file crtdata.c.

512{
513 void* p = &_timezone;
515
516 #undef _timezone
517 _CRTIMP extern long _timezone;
518 ok_ptr(&_timezone, p);
519
520#ifdef _M_IX86
521 _CRTIMP char** __p__timezone();
523#endif
524}
#define _timezone
Definition: time.h:82
long * __p__timezone(void)
Definition: timezone.c:53

Referenced by START_TEST().

◆ Test__tzname()

void Test__tzname ( void  )

Definition at line 526 of file crtdata.c.

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

Referenced by START_TEST().

◆ Test__wcmdln()

void Test__wcmdln ( void  )

Definition at line 543 of file crtdata.c.

544{
545 _CRTIMP extern wchar_t* _wcmdln;
546#ifdef _M_IX86
547 _CRTIMP wchar_t** __p__wcmdln(void);
549#endif
550}
const wchar_t ** __p__wcmdln(void)
Definition: environ.c:376
#define _wcmdln

Referenced by START_TEST().

◆ Test__wctype()

void Test__wctype ( void  )

Definition at line 287 of file crtdata.c.

288{
289 ok_int(_wctype[0], 0);
291
292 #undef _pwctype
293 _CRTIMP extern const unsigned short* _pwctype;
294 ok_ptr(_pwctype, &_wctype[1]);
295
296 ok(__pwctype_func() != _wctype, "__pwctype_func() == _wctype\n");
299#ifdef _M_IX86
300 _CRTIMP const unsigned short** __cdecl __p__pwctype(void);
302#endif
303}
const unsigned short ** __p__pwctype(void)
Definition: ctype.c:564
#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 553 of file crtdata.c.

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

Referenced by START_TEST().

◆ Test__winmajor()

void Test__winmajor ( void  )

Definition at line 576 of file crtdata.c.

577{
579#ifdef _M_IX86
580 _CRTIMP unsigned int* __cdecl __p__winmajor();
582#endif
583 if (p_get_winmajor != NULL)
584 {
585 unsigned int result_winmajor;
586 ok_int(p_get_winmajor(&result_winmajor), 0);
587 ok_int(result_winmajor, _winmajor);
588 }
589}
unsigned int _winmajor
Definition: environ.c:13
unsigned int * __p__winmajor(void)
Definition: environ.c:500

Referenced by START_TEST().

◆ Test__winminor()

void Test__winminor ( void  )

Definition at line 591 of file crtdata.c.

592{
594#ifdef _M_IX86
595 _CRTIMP unsigned int* __cdecl __p__winminor();
597#endif
598 if (p_get_winminor != NULL)
599 {
600 unsigned int result_winminor;
601 ok_int(p_get_winminor(&result_winminor), 0);
602 ok_int(result_winminor, _winminor);
603 }
604}
unsigned int _winminor
Definition: environ.c:12
unsigned int * __p__winminor(void)
Definition: environ.c:508
ULONG dwMinorVersion
Definition: rtltypes.h:248

Referenced by START_TEST().

◆ Test__winver()

void Test__winver ( void  )

Definition at line 607 of file crtdata.c.

608{
610#ifdef _M_IX86
611 _CRTIMP unsigned int* __cdecl __p__winver();
613#endif
614 if (p_get_winver != NULL)
615 {
616 unsigned int result_winver;
617 ok_int(p_get_winver(&result_winver), 0);
618 ok_int(result_winver, _winver);
619 }
620}
unsigned int _winver
Definition: environ.c:14
unsigned int * __p__winver(void)
Definition: environ.c:516

Referenced by START_TEST().

◆ Test__wpgmptr()

void Test__wpgmptr ( void  )

Definition at line 623 of file crtdata.c.

624{
625 void* p = _wpgmptr;
627
628 #undef _wpgmptr
629 ok_ptr(_wpgmptr, p);
630
631#ifdef _M_IX86
632 _CRTIMP wchar_t ** __cdecl __p__wpgmptr();
634#endif
635
636#if 0 // FIXME: This returns an error on Windows 10
637 if (p_get_wpgmptr != NULL)
638 {
639 wchar_t* result_wpgmptr;
640 ok_int(p_get_wpgmptr(&result_wpgmptr), 0);
641 ok_ptr(result_wpgmptr, _wpgmptr);
642 }
643#endif
644}
_CRTIMP wchar_t **__cdecl __p__wpgmptr()
Definition: environ.c:477
#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