ReactOS
0.4.15-dev-1647-g91fceab
wmain.c
Go to the documentation of this file.
1
/*
2
* Entry point for programs that use wmain()
3
*/
4
#include <stdio.h>
5
#include <stdarg.h>
6
7
#include <
windef.h
>
8
#include <
winbase.h
>
9
10
int
wmain
(
int
argc
,
wchar_t
*
argv
[]);
11
12
wchar_t
*
13
a2w
(
char
*
a
,
wchar_t
*
w
)
14
{
15
wchar_t
* ww =
w
;
16
while
(*
a
) *
w
++ = (
wchar_t
) *
a
++;
17
*
w
= 0;
18
return
ww;
19
}
20
21
wchar_t
*
22
fgetws
(
wchar_t
*
buf
,
int
bufsize
,
FILE
*
file
)
23
{
24
char
* abuf =
GlobalAlloc
(
bufsize
,0);
25
if
(!
buf
)
return
NULL
;
26
fgets
(abuf,
bufsize
,
file
);
27
a2w
(abuf,
buf
);
28
GlobalFree
(abuf);
29
return
buf
;
30
}
31
32
int
main
(
int
argc
,
char
*
argv
[])
33
{
34
wchar_t
** wargv;
35
int
i
;
36
int
ec;
37
38
wargv = (
wchar_t
**)
GlobalAlloc
(
39
sizeof
(
void
*) *
argc
,
40
0
41
);
42
for
(
i
=0;
i
<
argc
;++
i
)
43
{
44
wargv[
i
] = (
wchar_t
*)
GlobalAlloc
(
45
sizeof
(
wchar_t
) * (1+
lstrlenA
(
argv
[
i
])),
46
0
47
);
48
a2w
(
argv
[
i
],wargv[
i
]);
49
}
50
wargv[
i
] =
NULL
;
51
ec =
wmain
(
argc
,wargv);
52
for
(
i
=0;wargv[
i
];++
i
)
GlobalFree
(wargv[
i
]);
53
return
ec;
54
}
argc
static int argc
Definition:
ServiceArgs.c:12
GlobalAlloc
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition:
heapmem.c:368
w
GLubyte GLubyte GLubyte GLubyte w
Definition:
glext.h:6102
winbase.h
bufsize
GLenum GLuint GLsizei bufsize
Definition:
glext.h:7473
argv
#define argv
Definition:
mplay32.c:18
buf
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition:
glext.h:7751
wmain
int wmain(int argc, wchar_t *argv[])
Definition:
netstat.c:618
main
int main(int argc, char *argv[])
Definition:
wmain.c:32
_iobuf
Definition:
mbstring.h:19
GlobalFree
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition:
heapmem.c:611
windef.h
fgets
_Check_return_opt_ _CRTIMP char *__cdecl fgets(_Out_writes_z_(_MaxCount) char *_Buf, _In_ int _MaxCount, _Inout_ FILE *_File)
lstrlenA
int WINAPI lstrlenA(LPCSTR lpString)
Definition:
lstring.c:145
i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition:
glfuncs.h:248
NULL
#define NULL
Definition:
types.h:112
fgetws
wchar_t * fgetws(wchar_t *buf, int bufsize, FILE *file)
Definition:
wmain.c:22
wchar_t
#define wchar_t
Definition:
wchar.h:102
a
GLboolean GLboolean GLboolean GLboolean a
Definition:
glext.h:6204
file
Definition:
fci.c:126
a2w
wchar_t * a2w(char *a, wchar_t *w)
Definition:
wmain.c:13
modules
rosapps
applications
sysutils
wmain.c
Generated on Wed Jan 27 2021 06:06:20 for ReactOS by
1.8.15