mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[NTOS] Prohibit use of MAX_PATH in the kernel. Use MAX_WIN32_PATH if you really mean it. CORE-15882
This commit is contained in:
parent
c60d25fb26
commit
60346a5732
2 changed files with 10 additions and 5 deletions
|
@ -401,7 +401,7 @@ ExpLoadInitialProcess(IN PINIT_BUFFER InitBuffer,
|
|||
ProcessInformation = &InitBuffer->ProcessInfo;
|
||||
|
||||
/* Allocate memory for the process parameters */
|
||||
Size = sizeof(*ProcessParams) + ((MAX_PATH * 6) * sizeof(WCHAR));
|
||||
Size = sizeof(*ProcessParams) + ((MAX_WIN32_PATH * 6) * sizeof(WCHAR));
|
||||
Status = ZwAllocateVirtualMemory(NtCurrentProcess(),
|
||||
(PVOID*)&ProcessParams,
|
||||
0,
|
||||
|
@ -456,7 +456,7 @@ ExpLoadInitialProcess(IN PINIT_BUFFER InitBuffer,
|
|||
/* Make a buffer for the DOS path */
|
||||
p = (PWSTR)(ProcessParams + 1);
|
||||
ProcessParams->CurrentDirectory.DosPath.Buffer = p;
|
||||
ProcessParams->CurrentDirectory.DosPath.MaximumLength = MAX_PATH *
|
||||
ProcessParams->CurrentDirectory.DosPath.MaximumLength = MAX_WIN32_PATH *
|
||||
sizeof(WCHAR);
|
||||
|
||||
/* Copy the DOS path */
|
||||
|
@ -467,7 +467,7 @@ ExpLoadInitialProcess(IN PINIT_BUFFER InitBuffer,
|
|||
p = (PWSTR)((PCHAR)ProcessParams->CurrentDirectory.DosPath.Buffer +
|
||||
ProcessParams->CurrentDirectory.DosPath.MaximumLength);
|
||||
ProcessParams->DllPath.Buffer = p;
|
||||
ProcessParams->DllPath.MaximumLength = MAX_PATH * sizeof(WCHAR);
|
||||
ProcessParams->DllPath.MaximumLength = MAX_WIN32_PATH * sizeof(WCHAR);
|
||||
|
||||
/* Copy the DLL path and append the system32 directory */
|
||||
RtlCopyUnicodeString(&ProcessParams->DllPath,
|
||||
|
@ -478,7 +478,7 @@ ExpLoadInitialProcess(IN PINIT_BUFFER InitBuffer,
|
|||
p = (PWSTR)((PCHAR)ProcessParams->DllPath.Buffer +
|
||||
ProcessParams->DllPath.MaximumLength);
|
||||
ProcessParams->ImagePathName.Buffer = p;
|
||||
ProcessParams->ImagePathName.MaximumLength = MAX_PATH * sizeof(WCHAR);
|
||||
ProcessParams->ImagePathName.MaximumLength = MAX_WIN32_PATH * sizeof(WCHAR);
|
||||
|
||||
/* Make sure the buffer is a valid string which within the given length */
|
||||
if ((NtInitialUserProcessBufferType != REG_SZ) ||
|
||||
|
@ -516,7 +516,7 @@ ExpLoadInitialProcess(IN PINIT_BUFFER InitBuffer,
|
|||
p = (PWSTR)((PCHAR)ProcessParams->ImagePathName.Buffer +
|
||||
ProcessParams->ImagePathName.MaximumLength);
|
||||
ProcessParams->CommandLine.Buffer = p;
|
||||
ProcessParams->CommandLine.MaximumLength = MAX_PATH * sizeof(WCHAR);
|
||||
ProcessParams->CommandLine.MaximumLength = MAX_WIN32_PATH * sizeof(WCHAR);
|
||||
|
||||
/* Add the image name to the command line */
|
||||
RtlAppendUnicodeToString(&ProcessParams->CommandLine,
|
||||
|
|
|
@ -103,6 +103,11 @@
|
|||
#define PtrOffset(B,O) ((ULONG)((ULONG_PTR)(O) - (ULONG_PTR)(B)))
|
||||
#endif
|
||||
|
||||
/* MAX_PATH is a Win32 concept, it doesn't belong in the kernel */
|
||||
#define MAX_WIN32_PATH 260
|
||||
C_ASSERT(MAX_WIN32_PATH == MAX_PATH);
|
||||
#undef MAX_PATH
|
||||
|
||||
//
|
||||
// Switch for enabling global page support
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue