3 * Copyright (C) 2002 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.
21 * COPYRIGHT: See COPYING in the top level directory
22 * PROJECT: ReactOS kernel
23 * FILE: ntoskrnl/ps/win32.c
24 * PURPOSE: win32k support
25 * PROGRAMMER: Eric Kohl (ekohl@rz-online.de)
30 /* INCLUDES ****************************************************************/
32 #include <ddk/ntddk.h>
33 #include <internal/ps.h>
34 #include <napi/win32.h>
36 /* TYPES *******************************************************************/
38 /* GLOBALS ******************************************************************/
40 static ULONG PspWin32ProcessSize = 0;
41 static ULONG PspWin32ThreadSize = 0;
43 /* FUNCTIONS ***************************************************************/
46 PsGetWin32Thread(VOID)
48 return(PsGetCurrentThread()->Win32Thread);
52 PsCreateWin32Thread(PETHREAD Thread)
54 if (Thread->Win32Thread != NULL)
55 return(STATUS_SUCCESS);
57 Thread->Win32Thread = ExAllocatePool(NonPagedPool,
59 if (Thread->Win32Thread == NULL)
60 return(STATUS_NO_MEMORY);
62 RtlZeroMemory(Thread->Win32Thread,
65 return(STATUS_SUCCESS);
69 PsGetWin32Process(VOID)
71 return(PsGetCurrentProcess()->Win32Process);
75 PsCreateWin32Process(PEPROCESS Process)
77 if (Process->Win32Process != NULL)
78 return(STATUS_SUCCESS);
80 Process->Win32Process = ExAllocatePool(NonPagedPool,
82 if (Process->Win32Process == NULL)
83 return(STATUS_NO_MEMORY);
85 RtlZeroMemory(Process->Win32Process,
88 return(STATUS_SUCCESS);
93 PsEstablishWin32Callouts(PVOID Param1,
100 PspWin32ProcessSize = W32ProcessSize;
101 PspWin32ThreadSize = W32ThreadSize;