ReactOS
0.4.16-dev-109-gf4cb10f
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
NULL
#define NULL
Definition:
types.h:112
main
int main()
Definition:
test.c:6
buf
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition:
glext.h:7751
bufsize
GLenum GLuint GLsizei bufsize
Definition:
glext.h:7473
a
GLboolean GLboolean GLboolean GLboolean a
Definition:
glext.h:6204
w
GLubyte GLubyte GLubyte GLubyte w
Definition:
glext.h:6102
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
GlobalFree
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition:
heapmem.c:611
GlobalAlloc
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition:
heapmem.c:368
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
argv
#define argv
Definition:
mplay32.c:18
wmain
int wmain()
Definition:
rdesktop-core-tester.cpp:552
_iobuf
Definition:
mbstring.h:19
file
Definition:
fci.c:127
wchar_t
#define wchar_t
Definition:
wchar.h:102
winbase.h
windef.h
a2w
wchar_t * a2w(char *a, wchar_t *w)
Definition:
wmain.c:13
fgetws
wchar_t * fgetws(wchar_t *buf, int bufsize, FILE *file)
Definition:
wmain.c:22
modules
rosapps
applications
sysutils
wmain.c
Generated on Wed Oct 9 2024 06:12:30 for ReactOS by
1.9.6