1 /* $Id: cmdline.c,v 1.12 2000/06/29 23:35:26 dwelch Exp $
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS system libraries
5 * FILE: lib/kernel32/proc/proc.c
6 * PURPOSE: Process functions
7 * PROGRAMMER: Ariadne ( ariadne@xs4all.nl)
12 /* INCLUDES ****************************************************************/
14 #include <ddk/ntddk.h>
16 #include <kernel32/proc.h>
17 #include <kernel32/thread.h>
21 #include <ntdll/rtl.h>
24 #include <kernel32/kernel32.h>
27 /* GLOBALS ******************************************************************/
29 static UNICODE_STRING CommandLineStringW
;
30 static ANSI_STRING CommandLineStringA
;
32 static WCHAR CommandLineW
[MAX_PATH
];
33 static CHAR CommandLineA
[MAX_PATH
];
35 static WINBOOL bCommandLineInitialized
= FALSE
;
38 /* FUNCTIONS ****************************************************************/
41 InitCommandLines (VOID
)
43 PRTL_USER_PROCESS_PARAMETERS Params
;
44 // initialize command line buffers
46 CommandLineStringW
.Buffer
= CommandLineW
;
47 CommandLineStringW
.Length
= 0;
48 CommandLineStringW
.MaximumLength
= MAX_PATH
* sizeof(WCHAR
);
51 CommandLineStringA
.Buffer
= CommandLineA
;
52 CommandLineStringA
.Length
= 0;
53 CommandLineStringA
.MaximumLength
= MAX_PATH
;
56 Params
= NtCurrentPeb()->ProcessParameters
;
57 RtlNormalizeProcessParams (Params
);
59 RtlCopyUnicodeString (&CommandLineStringW
,
60 &(Params
->CommandLine
));
61 RtlUnicodeStringToAnsiString (&CommandLineStringA
,
65 bCommandLineInitialized
= TRUE
;
69 LPSTR STDCALL
GetCommandLineA(VOID
)
71 if (bCommandLineInitialized
== FALSE
)
76 DPRINT ("CommandLine \'%s\'\n", CommandLineA
);
81 LPWSTR STDCALL
GetCommandLineW (VOID
)
83 if (bCommandLineInitialized
== FALSE
)
88 DPRINT ("CommandLine \'%S\'\n", CommandLineW
);