3 * Copyright (C) 1998, 1999, 2000, 2001 ReactOS Team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 /* $Id: process.c,v 1.14 2002/09/08 10:23:25 chorns Exp $
21 * COPYRIGHT: See COPYING in the top level directory
22 * PROJECT: ReactOS kernel
23 * FILE: ntoskrnl/io/process.c
24 * PURPOSE: Process functions that, bizarrely, are in the iomgr
25 * PROGRAMMER: David Welch (welch@mcmail.com)
30 /* INCLUDES *****************************************************************/
32 #include <ddk/ntddk.h>
33 #include <internal/ps.h>
35 #include <internal/debug.h>
37 /* FUNCTIONS *****************************************************************/
40 IoGetInitialStack(VOID
)
42 return(PsGetCurrentThread()->Tcb
.InitialStack
);
47 IoGetStackLimits(OUT PULONG LowLimit
,
50 *LowLimit
= (ULONG
)NtCurrentTeb()->Tib
.StackLimit
;
51 *HighLimit
= (ULONG
)NtCurrentTeb()->Tib
.StackBase
;
56 IoThreadToProcess(IN PETHREAD Thread
)
58 return(Thread
->ThreadsProcess
);
63 IoGetRequestorProcess(IN PIRP Irp
)
65 return(Irp
->Tail
.Overlay
.Thread
->ThreadsProcess
);
69 /**********************************************************************
71 * IoSetThreadHardErrorMode@4
75 * TRUE : enable hard errors processing;
76 * FALSE: do NOT process hard errors.
79 * Previous value for the current thread's hard errors
82 BOOLEAN STDCALL EXPORTED
83 IoSetThreadHardErrorMode(IN BOOLEAN HardErrorEnabled
)
85 BOOLEAN PreviousHEM
= NtCurrentTeb()->HardErrorDisabled
;
87 NtCurrentTeb()->HardErrorDisabled
= ((TRUE
== HardErrorEnabled
) ? FALSE
: TRUE
);
89 return((TRUE
== PreviousHEM
) ? FALSE
: TRUE
);