mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 12:24:21 +00:00
Fixed little bug.
svn path=/trunk/; revision=648
This commit is contained in:
parent
af1ff6be3b
commit
242138f832
1 changed files with 20 additions and 14 deletions
|
@ -197,13 +197,15 @@ DPRINT("Checkpoint\n");
|
||||||
|
|
||||||
/* Begin of test code */
|
/* Begin of test code */
|
||||||
|
|
||||||
HANDLE LocalThreadHandle;
|
HANDLE LocalThreadHandle;
|
||||||
CLIENT_ID LocalClientId;
|
CLIENT_ID LocalClientId;
|
||||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
INITIAL_TEB InitialTeb;
|
INITIAL_TEB InitialTeb;
|
||||||
CONTEXT ThreadContext;
|
CONTEXT ThreadContext;
|
||||||
PVOID BaseAddress;
|
PVOID BaseAddress;
|
||||||
NTSTATUS Status;
|
ULONG LocalStackCommit;
|
||||||
|
ULONG LocalStackReserve;
|
||||||
|
NTSTATUS Status;
|
||||||
|
|
||||||
ObjectAttributes.Length = sizeof(OBJECT_ATTRIBUTES);
|
ObjectAttributes.Length = sizeof(OBJECT_ATTRIBUTES);
|
||||||
ObjectAttributes.RootDirectory = NULL;
|
ObjectAttributes.RootDirectory = NULL;
|
||||||
|
@ -214,14 +216,16 @@ DPRINT("Checkpoint\n");
|
||||||
ObjectAttributes.SecurityQualityOfService = NULL;
|
ObjectAttributes.SecurityQualityOfService = NULL;
|
||||||
|
|
||||||
|
|
||||||
if (*StackCommit < 4096)
|
if ((StackCommit != NULL) && (*StackCommit > 4096))
|
||||||
*StackCommit = 4096;
|
LocalStackCommit = *StackCommit;
|
||||||
|
else
|
||||||
|
LocalStackCommit = 4096;
|
||||||
|
|
||||||
BaseAddress = 0;
|
BaseAddress = 0;
|
||||||
ZwAllocateVirtualMemory(ProcessHandle,
|
ZwAllocateVirtualMemory(ProcessHandle,
|
||||||
&BaseAddress,
|
&BaseAddress,
|
||||||
0,
|
0,
|
||||||
StackCommit,
|
&LocalStackCommit,
|
||||||
MEM_COMMIT,
|
MEM_COMMIT,
|
||||||
PAGE_READWRITE);
|
PAGE_READWRITE);
|
||||||
|
|
||||||
|
@ -234,7 +238,7 @@ DPRINT("Checkpoint\n");
|
||||||
ThreadContext.SegDs = USER_DS;
|
ThreadContext.SegDs = USER_DS;
|
||||||
ThreadContext.SegCs = USER_CS;
|
ThreadContext.SegCs = USER_CS;
|
||||||
ThreadContext.SegSs = USER_DS;
|
ThreadContext.SegSs = USER_DS;
|
||||||
ThreadContext.Esp = (ULONG)(BaseAddress + *StackCommit);
|
ThreadContext.Esp = (ULONG)(BaseAddress + LocalStackCommit);
|
||||||
ThreadContext.EFlags = (1<<1) + (1<<9);
|
ThreadContext.EFlags = (1<<1) + (1<<9);
|
||||||
|
|
||||||
|
|
||||||
|
@ -247,13 +251,15 @@ DPRINT("Checkpoint\n");
|
||||||
&InitialTeb,
|
&InitialTeb,
|
||||||
CreateSuspended);
|
CreateSuspended);
|
||||||
|
|
||||||
// if ( lpThreadId != NULL )
|
|
||||||
// memcpy(lpThreadId, &ClientId.UniqueThread,sizeof(ULONG));
|
|
||||||
|
|
||||||
/* End of test code */
|
/* End of test code */
|
||||||
|
|
||||||
DPRINT("Checkpoint\n");
|
DPRINT("Checkpoint\n");
|
||||||
|
|
||||||
|
|
||||||
|
if (StackCommit)
|
||||||
|
*StackCommit = LocalStackCommit;
|
||||||
|
|
||||||
|
|
||||||
/* return thread handle */
|
/* return thread handle */
|
||||||
if (ThreadHandle)
|
if (ThreadHandle)
|
||||||
*ThreadHandle = LocalThreadHandle;
|
*ThreadHandle = LocalThreadHandle;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue