2003-06-21 04:07:10 +02:00
|
|
|
/*
|
|
|
|
* Kernel32 undocumented and private functions definition
|
|
|
|
*
|
|
|
|
* Copyright 2003 Eric Pouech
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __WINE_KERNEL_PRIVATE_H
|
|
|
|
#define __WINE_KERNEL_PRIVATE_H
|
|
|
|
|
2005-05-16 16:45:18 +02:00
|
|
|
#include "wine/winbase16.h"
|
|
|
|
#include "thread.h"
|
|
|
|
|
2004-03-11 23:46:27 +01:00
|
|
|
HANDLE WINAPI OpenConsoleW(LPCWSTR, DWORD, BOOL, DWORD);
|
2003-06-21 04:07:10 +02:00
|
|
|
BOOL WINAPI VerifyConsoleIoHandle(HANDLE);
|
|
|
|
HANDLE WINAPI DuplicateConsoleHandle(HANDLE, DWORD, BOOL, DWORD);
|
|
|
|
BOOL WINAPI CloseConsoleHandle(HANDLE handle);
|
|
|
|
HANDLE WINAPI GetConsoleInputWaitHandle(void);
|
|
|
|
|
|
|
|
static inline BOOL is_console_handle(HANDLE h)
|
|
|
|
{
|
|
|
|
return h != INVALID_HANDLE_VALUE && ((DWORD)h & 3) == 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* map a real wineserver handle onto a kernel32 console handle */
|
|
|
|
static inline HANDLE console_handle_map(HANDLE h)
|
|
|
|
{
|
|
|
|
return h != INVALID_HANDLE_VALUE ? (HANDLE)((DWORD)h ^ 3) : INVALID_HANDLE_VALUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* map a kernel32 console handle onto a real wineserver handle */
|
|
|
|
static inline HANDLE console_handle_unmap(HANDLE h)
|
|
|
|
{
|
|
|
|
return h != INVALID_HANDLE_VALUE ? (HANDLE)((DWORD)h ^ 3) : INVALID_HANDLE_VALUE;
|
|
|
|
}
|
|
|
|
|
2005-05-16 16:45:18 +02:00
|
|
|
#define CURRENT_STACK16 ((STACK16FRAME*)MapSL((SEGPTR)NtCurrentTeb()->WOW32Reserved))
|
|
|
|
#define CURRENT_DS (CURRENT_STACK16->ds)
|
|
|
|
|
|
|
|
/* push bytes on the 16-bit stack of a thread; return a segptr to the first pushed byte */
|
|
|
|
static inline SEGPTR stack16_push( int size )
|
|
|
|
{
|
|
|
|
STACK16FRAME *frame = CURRENT_STACK16;
|
|
|
|
memmove( (char*)frame - size, frame, sizeof(*frame) );
|
|
|
|
NtCurrentTeb()->WOW32Reserved = (char *)NtCurrentTeb()->WOW32Reserved - size;
|
|
|
|
return (SEGPTR)((char *)NtCurrentTeb()->WOW32Reserved + sizeof(*frame));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* pop bytes from the 16-bit stack of a thread */
|
|
|
|
static inline void stack16_pop( int size )
|
|
|
|
{
|
|
|
|
STACK16FRAME *frame = CURRENT_STACK16;
|
|
|
|
memmove( (char*)frame + size, frame, sizeof(*frame) );
|
|
|
|
NtCurrentTeb()->WOW32Reserved = (char *)NtCurrentTeb()->WOW32Reserved + size;
|
|
|
|
}
|
|
|
|
|
2004-02-12 01:00:55 +01:00
|
|
|
extern HMODULE kernel32_handle;
|
|
|
|
|
2003-06-24 04:32:01 +02:00
|
|
|
/* Size of per-process table of DOS handles */
|
|
|
|
#define DOS_TABLE_SIZE 256
|
|
|
|
extern HANDLE dos_handles[DOS_TABLE_SIZE];
|
|
|
|
|
2004-05-14 23:43:18 +02:00
|
|
|
extern const WCHAR *DIR_Windows;
|
|
|
|
extern const WCHAR *DIR_System;
|
2004-05-13 22:21:25 +02:00
|
|
|
|
2004-01-07 05:50:11 +01:00
|
|
|
extern void PTHREAD_Init(void);
|
2003-08-25 02:56:37 +02:00
|
|
|
extern BOOL WOWTHUNK_Init(void);
|
|
|
|
|
2003-09-18 06:39:13 +02:00
|
|
|
extern VOID SYSLEVEL_CheckNotLevel( INT level );
|
|
|
|
|
2004-05-01 07:25:07 +02:00
|
|
|
extern void FILE_SetDosError(void);
|
2004-05-13 22:21:25 +02:00
|
|
|
extern WCHAR *FILE_name_AtoW( LPCSTR name, BOOL alloc );
|
|
|
|
extern DWORD FILE_name_WtoA( LPCWSTR src, INT srclen, LPSTR dest, INT destlen );
|
2004-05-01 07:25:07 +02:00
|
|
|
|
2003-11-14 22:08:39 +01:00
|
|
|
extern DWORD INSTR_EmulateInstruction( EXCEPTION_RECORD *rec, CONTEXT86 *context );
|
|
|
|
extern void INSTR_CallBuiltinHandler( CONTEXT86 *context, BYTE intnum );
|
2003-11-13 22:04:01 +01:00
|
|
|
|
2004-03-26 00:41:04 +01:00
|
|
|
extern WCHAR *MODULE_get_dll_load_path( LPCWSTR module );
|
|
|
|
|
2003-12-01 23:47:28 +01:00
|
|
|
extern BOOL NLS_IsUnicodeOnlyLcid(LCID);
|
|
|
|
|
2003-11-18 01:16:25 +01:00
|
|
|
extern WORD SELECTOR_AllocBlock( const void *base, DWORD size, unsigned char flags );
|
|
|
|
extern WORD SELECTOR_ReallocBlock( WORD sel, const void *base, DWORD size );
|
|
|
|
extern void SELECTOR_FreeBlock( WORD sel );
|
|
|
|
#define IS_SELECTOR_32BIT(sel) \
|
|
|
|
(wine_ldt_is_system(sel) || (wine_ldt_copy.flags[LOWORD(sel) >> 3] & WINE_LDT_FLAGS_32BIT))
|
|
|
|
|
2004-05-01 07:25:07 +02:00
|
|
|
extern HANDLE VXD_Open( LPCWSTR filename, DWORD access, LPSECURITY_ATTRIBUTES sa );
|
|
|
|
|
2003-11-13 22:04:01 +01:00
|
|
|
/* this structure is always located at offset 0 of the DGROUP segment */
|
|
|
|
#include "pshpack1.h"
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
WORD null; /* Always 0 */
|
|
|
|
DWORD old_ss_sp; /* Stack pointer; used by SwitchTaskTo() */
|
|
|
|
WORD heap; /* Pointer to the local heap information (if any) */
|
|
|
|
WORD atomtable; /* Pointer to the local atom table (if any) */
|
|
|
|
WORD stacktop; /* Top of the stack */
|
|
|
|
WORD stackmin; /* Lowest stack address used so far */
|
|
|
|
WORD stackbottom; /* Bottom of the stack */
|
|
|
|
} INSTANCEDATA;
|
|
|
|
#include "poppack.h"
|
2005-05-10 17:22:09 +02:00
|
|
|
extern WORD DOSMEM_0000H;
|
|
|
|
extern WORD DOSMEM_BiosDataSeg;
|
|
|
|
extern WORD DOSMEM_BiosSysSeg;
|
|
|
|
|
|
|
|
/* msdos/dosmem.c */
|
|
|
|
extern BOOL DOSMEM_Init(void);
|
|
|
|
extern WORD DOSMEM_AllocSelector(WORD);
|
|
|
|
extern LPVOID DOSMEM_MapRealToLinear(DWORD); /* real-mode to linear */
|
|
|
|
extern LPVOID DOSMEM_MapDosToLinear(UINT); /* linear DOS to Wine */
|
|
|
|
extern UINT DOSMEM_MapLinearToDos(LPVOID); /* linear Wine to DOS */
|
|
|
|
extern void load_winedos(void);
|
|
|
|
|
|
|
|
extern struct winedos_exports
|
|
|
|
{
|
|
|
|
/* for global16.c */
|
|
|
|
void* (*AllocDosBlock)(UINT size, UINT16* pseg);
|
|
|
|
BOOL (*FreeDosBlock)(void* ptr);
|
|
|
|
UINT (*ResizeDosBlock)(void *ptr, UINT size, BOOL exact);
|
|
|
|
/* for instr.c */
|
|
|
|
void (WINAPI *EmulateInterruptPM)( CONTEXT86 *context, BYTE intnum );
|
|
|
|
void (WINAPI *CallBuiltinHandler)( CONTEXT86 *context, BYTE intnum );
|
|
|
|
DWORD (WINAPI *inport)( int port, int size );
|
|
|
|
void (WINAPI *outport)( int port, int size, DWORD val );
|
|
|
|
void (* BiosTick)(WORD timer);
|
|
|
|
} winedos;
|
2003-11-13 22:04:01 +01:00
|
|
|
|
2003-06-21 04:07:10 +02:00
|
|
|
#endif
|