ReactOS 0.4.16-dev-852-gcfcc8d8
argv_data.cpp
Go to the documentation of this file.
1//
2// argv_data.cpp
3//
4// Copyright (c) Microsoft Corporation. All rights reserved.
5//
6// This file defines the global data that stores the command line with which the
7// program was executed, along with the parsed arguments (if the arguments were
8// parsed), and the accessors for the global data.
9//
10#include <corecrt_internal.h>
11
12
13
14extern "C" {
15
16
17// Note: In general, either the narrow or wide string variables will be set,
18// but not both. These get initialized by the CRT startup sequence before any
19// user code is executed. There are cases where any or all of the pointers may
20// be null during execution. Do not assume that they are non-null.
21
22int __argc = 0; // The number of arguments in __argv or __wargv
23char** __argv = nullptr; // The arguments as narrow strings
24wchar_t** __wargv = nullptr; // The arguments as wide strings
25char* _pgmptr = nullptr; // The name of the program as a narrow string
26wchar_t* _wpgmptr = nullptr; // The name of the program as a wide string
27char* _acmdln = nullptr; // The raw command line as a narrow string
28wchar_t* _wcmdln = nullptr; // The raw command line as a wide string
29
31
32int* __cdecl __p___argc() { return &__argc; }
33char*** __cdecl __p___argv() { return &__argv; }
34wchar_t*** __cdecl __p___wargv() { return &__wargv; }
35char** __cdecl __p__pgmptr() { return &_pgmptr; }
36wchar_t** __cdecl __p__wpgmptr() { return &_wpgmptr; }
37char** __cdecl __p__acmdln() { return &_acmdln; }
38wchar_t** __cdecl __p__wcmdln() { return &_wcmdln; }
39
41{
44
46 return 0;
47}
48
50{
53 *result = _pgmptr;
54 return 0;
55}
56
58
59
60
62{
65 return true;
66}
67
68bool __cdecl __acrt_uninitialize_command_line(bool const /* terminating */)
69{
70 return true;
71}
72
73
74
75} // extern "C"
#define EINVAL
Definition: acclib.h:90
#define __cdecl
Definition: accygwin.h:79
wchar_t ***__cdecl __p___wargv()
Definition: argv_data.cpp:34
wchar_t * _wpgmptr
Definition: argv_data.cpp:26
char * _acmdln
Definition: argv_data.cpp:27
_END_SECURE_CRT_DEPRECATION_DISABLE bool __cdecl __acrt_initialize_command_line()
Definition: argv_data.cpp:61
errno_t __cdecl _get_wpgmptr(wchar_t **const result)
Definition: argv_data.cpp:40
char ** __argv
Definition: argv_data.cpp:23
int __argc
Definition: argv_data.cpp:22
wchar_t * _wcmdln
Definition: argv_data.cpp:28
char **__cdecl __p__acmdln()
Definition: argv_data.cpp:37
bool __cdecl __acrt_uninitialize_command_line(bool const)
Definition: argv_data.cpp:68
char * _pgmptr
Definition: argv_data.cpp:25
_BEGIN_SECURE_CRT_DEPRECATION_DISABLE int *__cdecl __p___argc()
Definition: argv_data.cpp:32
errno_t __cdecl _get_pgmptr(char **const result)
Definition: argv_data.cpp:49
char **__cdecl __p__pgmptr()
Definition: argv_data.cpp:35
wchar_t **__cdecl __p__wcmdln()
Definition: argv_data.cpp:38
wchar_t ** __wargv
Definition: argv_data.cpp:24
char ***__cdecl __p___argv()
Definition: argv_data.cpp:33
wchar_t **__cdecl __p__wpgmptr()
Definition: argv_data.cpp:36
LPSTR WINAPI GetCommandLineA(VOID)
Definition: proc.c:2009
LPWSTR WINAPI GetCommandLineW(VOID)
Definition: proc.c:2019
GLuint64EXT * result
Definition: glext.h:11304
#define _BEGIN_SECURE_CRT_DEPRECATION_DISABLE
#define _VALIDATE_RETURN_ERRCODE(expr, errorcode)
#define _END_SECURE_CRT_DEPRECATION_DISABLE
int errno_t
Definition: corecrt.h:615