ReactOS 0.4.16-dev-2122-g1628f5e
crt_winmain.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
Include dependency graph for crt_winmain.c:

Go to the source code of this file.

Functions

int __cdecl main (int argc, char *argv[])
 

Function Documentation

◆ main()

int __cdecl main ( int argc  ,
char argv[] 
)

Definition at line 30 of file crt_winmain.c.

31{
33 char *cmdline = GetCommandLineA();
34 int bcount = 0;
35 BOOL in_quotes = FALSE;
36
37 while (*cmdline)
38 {
39 if ((*cmdline == '\t' || *cmdline == ' ') && !in_quotes) break;
40 else if (*cmdline == '\\') bcount++;
41 else if (*cmdline == '\"')
42 {
43 if (!(bcount & 1)) in_quotes = !in_quotes;
44 bcount = 0;
45 }
46 else bcount = 0;
47 cmdline++;
48 }
49 while (*cmdline == '\t' || *cmdline == ' ') cmdline++;
50
52 if (!(info.dwFlags & STARTF_USESHOWWINDOW)) info.wShowWindow = SW_SHOWNORMAL;
53 return WinMain( GetModuleHandleA(0), 0, cmdline, info.wShowWindow );
54}
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdline, int cmdshow)
Definition: main.c:8
#define FALSE
Definition: types.h:117
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
VOID WINAPI GetStartupInfoA(IN LPSTARTUPINFOA lpStartupInfo)
Definition: proc.c:1320
LPSTR WINAPI GetCommandLineA(void)
Definition: process.c:1329
unsigned int BOOL
Definition: ntddk_ex.h:94
TCHAR * cmdline
Definition: stretchblt.cpp:32
#define STARTF_USESHOWWINDOW
Definition: winbase.h:468
#define SW_SHOWNORMAL
Definition: winuser.h:781