If using the default values, also set dwType to REG_SZ as our default
[wine] / dlls / ntdll / ntdll_misc.h
1 /*
2  * Copyright 2000 Juergen Schmied
3  *
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.
8  *
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.
13  *
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
17  */
18
19 #ifndef __WINE_NTDLL_MISC_H
20 #define __WINE_NTDLL_MISC_H
21
22 #include <stdarg.h>
23
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 "thread.h"
31 #include "wine/server.h"
32
33 /* The per-thread signal stack size */
34 #ifdef __i386__
35 #define SIGNAL_STACK_SIZE  4096
36 #else
37 #define SIGNAL_STACK_SIZE  0  /* we don't need a signal stack on non-i386 */
38 #endif
39
40 /* debug helper */
41 extern LPCSTR debugstr_us( const UNICODE_STRING *str );
42 extern void dump_ObjectAttributes (const OBJECT_ATTRIBUTES *ObjectAttributes);
43
44 extern void NTDLL_get_server_timeout( abs_time_t *when, const LARGE_INTEGER *timeout );
45 extern NTSTATUS NTDLL_wait_for_multiple_objects( UINT count, const HANDLE *handles, UINT flags,
46                                                  const LARGE_INTEGER *timeout );
47
48 /* init routines */
49 extern BOOL SIGNAL_Init(void);
50 extern void thread_init(void);
51
52 /* server support */
53 extern void server_init_process(void);
54 extern void server_init_thread( int unix_pid, int unix_tid );
55 extern void DECLSPEC_NORETURN server_protocol_error( const char *err, ... );
56 extern void DECLSPEC_NORETURN server_protocol_perror( const char *err );
57 extern void DECLSPEC_NORETURN server_abort_thread( int status );
58
59 /* module handling */
60 extern BOOL MODULE_GetSystemDirectory( UNICODE_STRING *sysdir );
61 extern void RELAY_InitDebugLists(void);
62 extern FARPROC RELAY_GetProcAddress( HMODULE module, IMAGE_EXPORT_DIRECTORY *exports,
63                                      DWORD exp_size, FARPROC proc, const WCHAR *user );
64 extern FARPROC SNOOP_GetProcAddress( HMODULE hmod, IMAGE_EXPORT_DIRECTORY *exports, DWORD exp_size,
65                                      FARPROC origfun, DWORD ordinal );
66 extern void RELAY_SetupDLL( HMODULE hmod );
67 extern void SNOOP_SetupDLL( HMODULE hmod );
68
69 static inline HANDLE ntdll_get_process_heap(void)
70 {
71     return NtCurrentTeb()->Peb->ProcessHeap;
72 }
73 /* redefine these to make sure we don't reference kernel symbols */
74 #define GetProcessHeap()       (NtCurrentTeb()->Peb->ProcessHeap)
75 #define GetCurrentProcessId()  ((DWORD)NtCurrentTeb()->ClientId.UniqueProcess)
76 #define GetCurrentThreadId()   ((DWORD)NtCurrentTeb()->ClientId.UniqueThread)
77
78 static inline RTL_USER_PROCESS_PARAMETERS* ntdll_get_process_pmts(void)
79 {
80     return NtCurrentTeb()->Peb->ProcessParameters;
81 }
82
83 /* hack: upcall to kernel */
84 extern HANDLE (WINAPI *pCreateFileW)( LPCWSTR filename, DWORD access, DWORD sharing,
85                                       LPSECURITY_ATTRIBUTES sa, DWORD creation,
86                                       DWORD attributes, HANDLE template );
87
88 /* Device IO */
89 /* ntdll/cdrom.c.c */
90 extern NTSTATUS CDROM_DeviceIoControl(DWORD clientID, HANDLE hDevice, 
91                                       HANDLE hEvent, PIO_APC_ROUTINE UserApcRoutine,
92                                       PVOID UserApcContext, 
93                                       PIO_STATUS_BLOCK piosb, 
94                                       ULONG IoControlCode,
95                                       LPVOID lpInBuffer, DWORD nInBufferSize,
96                                       LPVOID lpOutBuffer, DWORD nOutBufferSize);
97
98 #endif