55{
60 HANDLE CurrentDirectoryHandle;
63
64 DPRINT (
"RtlCreateProcessParameters\n");
65
67
71
73 {
80 CurrentDirectoryHandle =
NtCurrentPeb()->ProcessParameters->CurrentDirectory.Handle;
81 ConsoleHandle =
NtCurrentPeb()->ProcessParameters->ConsoleHandle;
82 ConsoleFlags =
NtCurrentPeb()->ProcessParameters->ConsoleFlags;
83 }
84 else
85 {
90 CurrentDirectoryHandle =
NULL;
92 ConsoleFlags = 0;
93 }
94
95 if (CommandLine ==
NULL)
96 CommandLine = &EmptyString;
97 if (WindowTitle ==
NULL)
98 WindowTitle = &EmptyString;
99 if (DesktopInfo ==
NULL)
100 DesktopInfo = &EmptyString;
101 if (ShellInfo ==
NULL)
102 ShellInfo = &EmptyString;
103 if (RuntimeData ==
NULL)
104 RuntimeData = &EmptyString;
105
106
108
109
111
112
120
121
123 if (!Param)
124 {
127 }
128
129 DPRINT (
"Process parameters allocated\n");
130
138
140
141
143 &Param->CurrentDirectory.DosPath,
146
147
148 if (Param->CurrentDirectory.DosPath.Length > 0)
149 {
150 Length = Param->CurrentDirectory.DosPath.Length /
sizeof(
WCHAR);
151 if (Param->CurrentDirectory.DosPath.Buffer[
Length-1] !=
L'\\')
152 {
153 Param->CurrentDirectory.DosPath.Buffer[
Length] =
L'\\';
154 Param->CurrentDirectory.DosPath.Buffer[
Length + 1] = 0;
155 Param->CurrentDirectory.DosPath.Length +=
sizeof(
WCHAR);
156 }
157 }
158
159
161 &Param->DllPath,
163 0);
164
165
167 &Param->ImagePathName,
168 ImagePathName,
170
171
173 &Param->CommandLine,
174 CommandLine,
176
177
179 &Param->WindowTitle,
180 WindowTitle,
181 0);
182
183
185 &Param->DesktopInfo,
186 DesktopInfo,
187 0);
188
189
191 &Param->ShellInfo,
192 ShellInfo,
193 0);
194
195
197 &Param->RuntimeData,
198 RuntimeData,
199 0);
200
202 *ProcessParameters = Param;
204
206}
WCHAR CurrentDirectory[1024]
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
struct _RTL_USER_PROCESS_PARAMETERS RTL_USER_PROCESS_PARAMETERS
KPROCESSOR_MODE NTAPI RtlpGetMode(VOID)
NTSYSAPI void WINAPI RtlReleasePebLock(void)
NTSYSAPI void WINAPI RtlAcquirePebLock(void)
PVOID PVOID PWCHAR PVOID Environment
static const char const char * DllPath
#define RTL_USER_PROCESS_PARAMETERS_NORMALIZED
_In_ ULONG _In_ ULONG _In_ ULONG Length
static __inline VOID RtlpCopyParameterString(PWCHAR *Ptr, PUNICODE_STRING Destination, PUNICODE_STRING Source, USHORT Size)
PRTL_USER_PROCESS_PARAMETERS NTAPI RtlDeNormalizeProcessParams(PRTL_USER_PROCESS_PARAMETERS Params)
#define STATUS_INSUFFICIENT_RESOURCES