Allocate the TEB and signal stack separately from the main stack.
[wine/gsoc_dplay.git] / dlls / ntdll / ntdll_misc.h
blob73e830bdaba1c61c16d734a8e1fb8ba2e578d7d8
1 /*
2 * Copyright 2000 Juergen Schmied
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef __WINE_NTDLL_MISC_H
20 #define __WINE_NTDLL_MISC_H
22 #include <stdarg.h>
24 #include "windef.h"
25 #include "winbase.h"
26 #include "winnt.h"
27 #include "winreg.h"
28 #include "ntstatus.h"
29 #include "winternl.h"
30 #include "module.h"
31 #include "thread.h"
32 #include "wine/server.h"
34 /* The per-thread signal stack size */
35 #ifdef __i386__
36 #define SIGNAL_STACK_SIZE 4096
37 #else
38 #define SIGNAL_STACK_SIZE 0 /* we don't need a signal stack on non-i386 */
39 #endif
41 /* debug helper */
42 extern LPCSTR debugstr_us( const UNICODE_STRING *str );
43 extern void dump_ObjectAttributes (const OBJECT_ATTRIBUTES *ObjectAttributes);
45 extern void NTDLL_get_server_timeout( abs_time_t *when, const LARGE_INTEGER *timeout );
46 extern NTSTATUS NTDLL_wait_for_multiple_objects( UINT count, const HANDLE *handles, UINT flags,
47 const LARGE_INTEGER *timeout );
49 /* init routines */
50 extern void wine_server_init_process(void);
51 extern void wine_server_init_thread(void);
52 extern void thread_init(void);
54 /* module handling */
55 extern BOOL MODULE_GetSystemDirectory( UNICODE_STRING *sysdir );
56 extern void RELAY_InitDebugLists(void);
57 extern FARPROC RELAY_GetProcAddress( HMODULE module, IMAGE_EXPORT_DIRECTORY *exports,
58 DWORD exp_size, FARPROC proc, const WCHAR *user );
59 extern FARPROC SNOOP_GetProcAddress( HMODULE hmod, IMAGE_EXPORT_DIRECTORY *exports, DWORD exp_size,
60 FARPROC origfun, DWORD ordinal );
61 extern void RELAY_SetupDLL( HMODULE hmod );
62 extern void SNOOP_SetupDLL( HMODULE hmod );
64 static inline HANDLE ntdll_get_process_heap(void)
66 return NtCurrentTeb()->Peb->ProcessHeap;
68 /* redefine these to make sure we don't reference kernel symbols */
69 #define GetProcessHeap() (NtCurrentTeb()->Peb->ProcessHeap)
70 #define GetCurrentProcessId() ((DWORD)NtCurrentTeb()->ClientId.UniqueProcess)
71 #define GetCurrentThreadId() ((DWORD)NtCurrentTeb()->ClientId.UniqueThread)
73 static inline RTL_USER_PROCESS_PARAMETERS* ntdll_get_process_pmts(void)
75 return NtCurrentTeb()->Peb->ProcessParameters;
78 /* hack: upcall to kernel */
79 extern HANDLE (WINAPI *pCreateFileW)( LPCWSTR filename, DWORD access, DWORD sharing,
80 LPSECURITY_ATTRIBUTES sa, DWORD creation,
81 DWORD attributes, HANDLE template );
83 /* Device IO */
84 /* ntdll/cdrom.c.c */
85 extern NTSTATUS CDROM_DeviceIoControl(DWORD clientID, HANDLE hDevice,
86 HANDLE hEvent, PIO_APC_ROUTINE UserApcRoutine,
87 PVOID UserApcContext,
88 PIO_STATUS_BLOCK piosb,
89 ULONG IoControlCode,
90 LPVOID lpInBuffer, DWORD nInBufferSize,
91 LPVOID lpOutBuffer, DWORD nOutBufferSize);
93 #endif