Skip to content

Commit ffe31a6

Browse files
committed
[WIN32K]
- Indeed Win32kProcessCallout may be called for a process with an already created Win32 Process Info. Handle it like in trunk. Found and fixed by Kamil Hornicek. svn path=/branches/arwinss/; revision=62970
1 parent 87ad959 commit ffe31a6

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

arwinss/server/main/init.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,21 @@ Win32kProcessCallout(PEPROCESS Process,
113113
PPROCESSINFO Win32Process;
114114
NTSTATUS Status;
115115

116-
DPRINT("Enter Win32kProcessCallback\n");
117-
118116
/* Get the Win32 Process */
119117
Win32Process = PsGetProcessWin32Process(Process);
120-
DPRINT("Win32Process %p, Create %d\n", Win32Process, Create);
121-
if (Create && !Win32Process)
118+
DPRINT("Win32kProcessCallback(): Win32Process %p, Create %d\n", Win32Process, Create);
119+
if (Create)
122120
{
123121
DPRINT("Creating W32 process PID:%d at IRQ level: %lu\n", Process->UniqueProcessId, KeGetCurrentIrql());
124122

123+
/* We might be called with an already allocated win32 process */
124+
if (Win32Process)
125+
{
126+
/* There is no more to do for us (this is a success code!) */
127+
Status = STATUS_ALREADY_WIN32;
128+
return Status;
129+
}
130+
125131
/* Allocate one if needed */
126132
/* FIXME - lock the process */
127133
Win32Process = ExAllocatePoolWithTag(NonPagedPool,
@@ -189,7 +195,6 @@ Win32kProcessCallout(PEPROCESS Process,
189195
UserLeave();
190196
}
191197

192-
DPRINT("Leave Win32kProcessCallback\n");
193198
return STATUS_SUCCESS;
194199
}
195200

0 commit comments

Comments
 (0)