mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Hack around attaching a process to an already attached thread
svn path=/trunk/; revision=6828
This commit is contained in:
parent
d6b77edb3c
commit
6cbc61a453
2 changed files with 11 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
|||
# $Id: Makefile,v 1.2 2003/11/05 22:31:50 gvg Exp $
|
||||
# $Id: Makefile,v 1.3 2003/11/30 19:15:21 gvg Exp $
|
||||
|
||||
PATH_TO_TOP = ../../..
|
||||
|
||||
|
@ -6,7 +6,7 @@ TARGET_TYPE = export_driver
|
|||
|
||||
TARGET_NAME = videoprt
|
||||
|
||||
TARGET_CFLAGS += -Wall -Werror
|
||||
TARGET_CFLAGS += -Wall -Werror -I$(PATH_TO_TOP)/ntoskrnl/include
|
||||
|
||||
TARGET_OBJECTS = videoprt.o
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: videoprt.c,v 1.12 2003/11/05 22:31:50 gvg Exp $
|
||||
/* $Id: videoprt.c,v 1.13 2003/11/30 19:15:21 gvg Exp $
|
||||
*
|
||||
* VideoPort driver
|
||||
* Written by Rex Jolliff
|
||||
|
@ -9,7 +9,8 @@
|
|||
#include <roskrnl.h>
|
||||
#include <ddk/ntddvid.h>
|
||||
|
||||
#include "../../../ntoskrnl/include/internal/v86m.h"
|
||||
#include "internal/v86m.h"
|
||||
#include "internal/ps.h"
|
||||
|
||||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
@ -704,12 +705,17 @@ VideoPortInt10(IN PVOID HwDeviceExtension,
|
|||
KV86M_REGISTERS Regs;
|
||||
NTSTATUS Status;
|
||||
PEPROCESS CallingProcess;
|
||||
PEPROCESS OldProcess;
|
||||
PETHREAD CurrentThread;
|
||||
|
||||
DPRINT("VideoPortInt10\n");
|
||||
|
||||
CallingProcess = PsGetCurrentProcess();
|
||||
if (CallingProcess != Csrss)
|
||||
{
|
||||
CurrentThread = PsGetCurrentThread();
|
||||
OldProcess = CurrentThread->OldProcess;
|
||||
CurrentThread->OldProcess = NULL;
|
||||
KeAttachProcess(Csrss);
|
||||
}
|
||||
|
||||
|
@ -726,6 +732,7 @@ VideoPortInt10(IN PVOID HwDeviceExtension,
|
|||
if (CallingProcess != Csrss)
|
||||
{
|
||||
KeDetachProcess();
|
||||
CurrentThread->OldProcess = OldProcess;
|
||||
}
|
||||
|
||||
return(Status);
|
||||
|
|
Loading…
Reference in a new issue