Assorted spelling fixes.
[wine] / dlls / kernel / kernel_private.h
1 /*
2  * Kernel32 undocumented and private functions definition
3  *
4  * Copyright 2003 Eric Pouech
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #ifndef __WINE_KERNEL_PRIVATE_H
22 #define __WINE_KERNEL_PRIVATE_H
23
24 HANDLE  WINAPI OpenConsoleW(LPCWSTR, DWORD, BOOL, DWORD);
25 BOOL    WINAPI VerifyConsoleIoHandle(HANDLE);
26 HANDLE  WINAPI DuplicateConsoleHandle(HANDLE, DWORD, BOOL, DWORD);
27 BOOL    WINAPI CloseConsoleHandle(HANDLE handle);
28 HANDLE  WINAPI GetConsoleInputWaitHandle(void);
29
30 static inline BOOL is_console_handle(HANDLE h)
31 {
32     return h != INVALID_HANDLE_VALUE && ((DWORD)h & 3) == 3;
33 }
34
35 /* map a real wineserver handle onto a kernel32 console handle */
36 static inline HANDLE console_handle_map(HANDLE h)
37 {
38     return h != INVALID_HANDLE_VALUE ? (HANDLE)((DWORD)h ^ 3) : INVALID_HANDLE_VALUE;
39 }
40
41 /* map a kernel32 console handle onto a real wineserver handle */
42 static inline HANDLE console_handle_unmap(HANDLE h)
43 {
44     return h != INVALID_HANDLE_VALUE ? (HANDLE)((DWORD)h ^ 3) : INVALID_HANDLE_VALUE;
45 }
46
47 extern HMODULE kernel32_handle;
48
49 /* Size of per-process table of DOS handles */
50 #define DOS_TABLE_SIZE 256
51 extern HANDLE dos_handles[DOS_TABLE_SIZE];
52
53 extern const WCHAR *DIR_Windows;
54 extern const WCHAR *DIR_System;
55
56 extern void PTHREAD_Init(void);
57 extern BOOL WOWTHUNK_Init(void);
58
59 extern VOID SYSLEVEL_CheckNotLevel( INT level );
60
61 extern void FILE_SetDosError(void);
62 extern WCHAR *FILE_name_AtoW( LPCSTR name, BOOL alloc );
63 extern DWORD FILE_name_WtoA( LPCWSTR src, INT srclen, LPSTR dest, INT destlen );
64
65 extern DWORD INSTR_EmulateInstruction( EXCEPTION_RECORD *rec, CONTEXT86 *context );
66 extern void INSTR_CallBuiltinHandler( CONTEXT86 *context, BYTE intnum );
67
68 extern WCHAR *MODULE_get_dll_load_path( LPCWSTR module );
69
70 extern BOOL NLS_IsUnicodeOnlyLcid(LCID);
71
72 extern WORD SELECTOR_AllocBlock( const void *base, DWORD size, unsigned char flags );
73 extern WORD SELECTOR_ReallocBlock( WORD sel, const void *base, DWORD size );
74 extern void SELECTOR_FreeBlock( WORD sel );
75 #define IS_SELECTOR_32BIT(sel) \
76    (wine_ldt_is_system(sel) || (wine_ldt_copy.flags[LOWORD(sel) >> 3] & WINE_LDT_FLAGS_32BIT))
77
78 extern HANDLE VXD_Open( LPCWSTR filename, DWORD access, LPSECURITY_ATTRIBUTES sa );
79
80 /* this structure is always located at offset 0 of the DGROUP segment */
81 #include "pshpack1.h"
82 typedef struct
83 {
84     WORD null;        /* Always 0 */
85     DWORD old_ss_sp;  /* Stack pointer; used by SwitchTaskTo() */
86     WORD heap;        /* Pointer to the local heap information (if any) */
87     WORD atomtable;   /* Pointer to the local atom table (if any) */
88     WORD stacktop;    /* Top of the stack */
89     WORD stackmin;    /* Lowest stack address used so far */
90     WORD stackbottom; /* Bottom of the stack */
91 } INSTANCEDATA;
92 #include "poppack.h"
93
94 #endif