mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
Clean up attach hack a little bit, it's still a hack though
svn path=/trunk/; revision=6852
This commit is contained in:
parent
14f190d1d4
commit
883794822c
1 changed files with 16 additions and 8 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $Id: videoprt.c,v 1.13 2003/11/30 19:15:21 gvg Exp $
|
||||
/* $Id: videoprt.c,v 1.14 2003/12/03 16:57:22 gvg Exp $
|
||||
*
|
||||
* VideoPort driver
|
||||
* Written by Rex Jolliff
|
||||
|
@ -694,7 +694,7 @@ VideoPortInitialize(IN PVOID Context1,
|
|||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int dummy;
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
|
@ -705,17 +705,22 @@ VideoPortInt10(IN PVOID HwDeviceExtension,
|
|||
KV86M_REGISTERS Regs;
|
||||
NTSTATUS Status;
|
||||
PEPROCESS CallingProcess;
|
||||
PEPROCESS OldProcess;
|
||||
PETHREAD CurrentThread;
|
||||
PEPROCESS PrevAttachedProcess;
|
||||
|
||||
DPRINT("VideoPortInt10\n");
|
||||
|
||||
CallingProcess = PsGetCurrentProcess();
|
||||
if (CallingProcess != Csrss)
|
||||
{
|
||||
CurrentThread = PsGetCurrentThread();
|
||||
OldProcess = CurrentThread->OldProcess;
|
||||
CurrentThread->OldProcess = NULL;
|
||||
if (NULL != PsGetCurrentThread()->OldProcess)
|
||||
{
|
||||
PrevAttachedProcess = CallingProcess;
|
||||
KeDetachProcess();
|
||||
}
|
||||
else
|
||||
{
|
||||
PrevAttachedProcess = NULL;
|
||||
}
|
||||
KeAttachProcess(Csrss);
|
||||
}
|
||||
|
||||
|
@ -732,7 +737,10 @@ VideoPortInt10(IN PVOID HwDeviceExtension,
|
|||
if (CallingProcess != Csrss)
|
||||
{
|
||||
KeDetachProcess();
|
||||
CurrentThread->OldProcess = OldProcess;
|
||||
if (NULL != PrevAttachedProcess)
|
||||
{
|
||||
KeAttachProcess(PrevAttachedProcess);
|
||||
}
|
||||
}
|
||||
|
||||
return(Status);
|
||||
|
|
Loading…
Reference in a new issue