mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 05:35:40 +00:00
Create a branch for Aleksandar Andrejevic for his work on NTVDM. See http://jira.reactos.org/browse/CORE-7250 for more details.
svn path=/branches/ntvdm/; revision=59241
This commit is contained in:
parent
3e3200acef
commit
4f0b8d3db0
20620 changed files with 0 additions and 1232833 deletions
183
lib/sdk/crt/include/internal/wine/cppexcept.h
Normal file
183
lib/sdk/crt/include/internal/wine/cppexcept.h
Normal file
|
@ -0,0 +1,183 @@
|
|||
/*
|
||||
* msvcrt C++ exception handling
|
||||
*
|
||||
* Copyright 2002 Alexandre Julliard
|
||||
*
|
||||
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifndef __MSVCRT_CPPEXCEPT_H
|
||||
#define __MSVCRT_CPPEXCEPT_H
|
||||
|
||||
#include <pseh/pseh2.h>
|
||||
|
||||
#define CXX_FRAME_MAGIC_VC6 0x19930520
|
||||
#define CXX_FRAME_MAGIC_VC7 0x19930521
|
||||
#define CXX_FRAME_MAGIC_VC8 0x19930522
|
||||
#define CXX_EXCEPTION 0xe06d7363
|
||||
|
||||
/* Macros to define assembler functions somewhat portably */
|
||||
|
||||
#define EH_NONCONTINUABLE 0x01
|
||||
#define EH_UNWINDING 0x02
|
||||
#define EH_EXIT_UNWIND 0x04
|
||||
#define EH_STACK_INVALID 0x08
|
||||
#define EH_NESTED_CALL 0x10
|
||||
|
||||
typedef void (*vtable_ptr)();
|
||||
|
||||
/* type_info object, see cpp.c for inplementation */
|
||||
typedef struct __type_info
|
||||
{
|
||||
const vtable_ptr *vtable;
|
||||
char *name; /* Unmangled name, allocated lazily */
|
||||
char mangled[32]; /* Variable length, but we declare it large enough for static RTTI */
|
||||
} type_info;
|
||||
|
||||
/* exception object */
|
||||
typedef struct __exception
|
||||
{
|
||||
const vtable_ptr *vtable;
|
||||
char *name; /* Name of this exception, always a new copy for each object */
|
||||
int do_free; /* Whether to free 'name' in our dtor */
|
||||
} exception;
|
||||
|
||||
/* the exception frame used by CxxFrameHandler */
|
||||
typedef struct __cxx_exception_frame
|
||||
{
|
||||
EXCEPTION_REGISTRATION_RECORD frame; /* the standard exception frame */
|
||||
int trylevel;
|
||||
DWORD ebp;
|
||||
} cxx_exception_frame;
|
||||
|
||||
/* info about a single catch {} block */
|
||||
typedef struct __catchblock_info
|
||||
{
|
||||
UINT flags; /* flags (see below) */
|
||||
const type_info *type_info; /* C++ type caught by this block */
|
||||
int offset; /* stack offset to copy exception object to */
|
||||
void (*handler)(void);/* catch block handler code */
|
||||
} catchblock_info;
|
||||
#define TYPE_FLAG_CONST 1
|
||||
#define TYPE_FLAG_VOLATILE 2
|
||||
#define TYPE_FLAG_REFERENCE 8
|
||||
|
||||
/* info about a single try {} block */
|
||||
typedef struct __tryblock_info
|
||||
{
|
||||
int start_level; /* start trylevel of that block */
|
||||
int end_level; /* end trylevel of that block */
|
||||
int catch_level; /* initial trylevel of the catch block */
|
||||
int catchblock_count; /* count of catch blocks in array */
|
||||
const catchblock_info *catchblock; /* array of catch blocks */
|
||||
} tryblock_info;
|
||||
|
||||
/* info about the unwind handler for a given trylevel */
|
||||
typedef struct __unwind_info
|
||||
{
|
||||
int prev; /* prev trylevel unwind handler, to run after this one */
|
||||
void (*handler)(void);/* unwind handler */
|
||||
} unwind_info;
|
||||
|
||||
/* descriptor of all try blocks of a given function */
|
||||
typedef struct __cxx_function_descr
|
||||
{
|
||||
UINT magic; /* must be CXX_FRAME_MAGIC */
|
||||
UINT unwind_count; /* number of unwind handlers */
|
||||
const unwind_info *unwind_table; /* array of unwind handlers */
|
||||
UINT tryblock_count; /* number of try blocks */
|
||||
const tryblock_info *tryblock; /* array of try blocks */
|
||||
UINT ipmap_count;
|
||||
const void *ipmap;
|
||||
const void *expect_list; /* expected exceptions list when magic >= VC7 */
|
||||
UINT flags; /* flags when magic >= VC8 */
|
||||
} cxx_function_descr;
|
||||
|
||||
#define FUNC_DESCR_SYNCHRONOUS 1 /* synchronous exceptions only (built with /EHs) */
|
||||
|
||||
typedef void (*cxx_copy_ctor)(void);
|
||||
|
||||
/* offsets for computing the this pointer */
|
||||
typedef struct
|
||||
{
|
||||
int this_offset; /* offset of base class this pointer from start of object */
|
||||
int vbase_descr; /* offset of virtual base class descriptor */
|
||||
int vbase_offset; /* offset of this pointer offset in virtual base class descriptor */
|
||||
} this_ptr_offsets;
|
||||
|
||||
/* complete information about a C++ type */
|
||||
typedef struct __cxx_type_info
|
||||
{
|
||||
UINT flags; /* flags (see CLASS_* flags below) */
|
||||
const type_info *type_info; /* C++ type info */
|
||||
this_ptr_offsets offsets; /* offsets for computing the this pointer */
|
||||
unsigned int size; /* object size */
|
||||
cxx_copy_ctor copy_ctor; /* copy constructor */
|
||||
} cxx_type_info;
|
||||
#define CLASS_IS_SIMPLE_TYPE 1
|
||||
#define CLASS_HAS_VIRTUAL_BASE_CLASS 4
|
||||
|
||||
/* table of C++ types that apply for a given object */
|
||||
typedef struct __cxx_type_info_table
|
||||
{
|
||||
UINT count; /* number of types */
|
||||
const cxx_type_info *info[3]; /* variable length, we declare it large enough for static RTTI */
|
||||
} cxx_type_info_table;
|
||||
|
||||
typedef DWORD (*cxx_exc_custom_handler)( PEXCEPTION_RECORD, cxx_exception_frame*,
|
||||
PCONTEXT, EXCEPTION_REGISTRATION_RECORD**,
|
||||
const cxx_function_descr*, int nested_trylevel,
|
||||
EXCEPTION_REGISTRATION_RECORD *nested_frame, DWORD unknown3 );
|
||||
|
||||
/* type information for an exception object */
|
||||
typedef struct __cxx_exception_type
|
||||
{
|
||||
UINT flags; /* TYPE_FLAG flags */
|
||||
void (*destructor)(void);/* exception object destructor */
|
||||
cxx_exc_custom_handler custom_handler; /* custom handler for this exception */
|
||||
const cxx_type_info_table *type_info_table; /* list of types for this exception object */
|
||||
} cxx_exception_type;
|
||||
|
||||
void WINAPI _CxxThrowException(exception*,const cxx_exception_type*);
|
||||
int CDECL _XcptFilter(NTSTATUS, PEXCEPTION_POINTERS);
|
||||
int CDECL __CppXcptFilter(NTSTATUS, PEXCEPTION_POINTERS);
|
||||
|
||||
static inline const char *dbgstr_type_info( const type_info *info )
|
||||
{
|
||||
if (!info) return "{}";
|
||||
return wine_dbg_sprintf( "{vtable=%p name=%s (%s)}",
|
||||
info->vtable, info->mangled, info->name ? info->name : "" );
|
||||
}
|
||||
|
||||
/* compute the this pointer for a base class of a given type */
|
||||
static inline void *get_this_pointer( const this_ptr_offsets *off, void *object )
|
||||
{
|
||||
void *this_ptr;
|
||||
int *offset_ptr;
|
||||
|
||||
if (!object) return NULL;
|
||||
this_ptr = (char *)object + off->this_offset;
|
||||
if (off->vbase_descr >= 0)
|
||||
{
|
||||
/* move this ptr to vbase descriptor */
|
||||
this_ptr = (char *)this_ptr + off->vbase_descr;
|
||||
/* and fetch additional offset from vbase descriptor */
|
||||
offset_ptr = (int *)(*(char **)this_ptr + off->vbase_offset);
|
||||
this_ptr = (char *)this_ptr + *offset_ptr;
|
||||
}
|
||||
return this_ptr;
|
||||
}
|
||||
|
||||
#endif /* __MSVCRT_CPPEXCEPT_H */
|
53
lib/sdk/crt/include/internal/wine/eh.h
Normal file
53
lib/sdk/crt/include/internal/wine/eh.h
Normal file
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* C++ exception handling facility
|
||||
*
|
||||
* Copyright 2000 Francois Gouget.
|
||||
*
|
||||
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
#ifndef __WINE_EH_H
|
||||
#define __WINE_EH_H
|
||||
#ifndef __WINE_USE_MSVCRT
|
||||
#define __WINE_USE_MSVCRT
|
||||
#endif
|
||||
|
||||
#if !defined(__cplusplus) && !defined(USE_MSVCRT_PREFIX)
|
||||
#error "eh.h is meant only for C++ applications"
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT
|
||||
# ifdef USE_MSVCRT_PREFIX
|
||||
# define MSVCRT(x) MSVCRT_##x
|
||||
# else
|
||||
# define MSVCRT(x) x
|
||||
# endif
|
||||
#endif
|
||||
|
||||
struct _EXCEPTION_POINTERS;
|
||||
|
||||
typedef void (*terminate_handler)();
|
||||
typedef void (*terminate_function)();
|
||||
typedef void (*unexpected_handler)();
|
||||
typedef void (*unexpected_function)();
|
||||
typedef void (*_se_translator_function)(unsigned int code, struct _EXCEPTION_POINTERS *info);
|
||||
|
||||
terminate_function MSVCRT(set_terminate)(terminate_function func);
|
||||
unexpected_function MSVCRT(set_unexpected)(unexpected_function func);
|
||||
_se_translator_function MSVCRT(_set_se_translator)(_se_translator_function func);
|
||||
|
||||
void MSVCRT(terminate)();
|
||||
void MSVCRT(unexpected)();
|
||||
|
||||
#endif /* __WINE_EH_H */
|
136
lib/sdk/crt/include/internal/wine/msvcrt.h
Normal file
136
lib/sdk/crt/include/internal/wine/msvcrt.h
Normal file
|
@ -0,0 +1,136 @@
|
|||
/*
|
||||
* Copyright 2001 Jon Griffiths
|
||||
* Copyright 2004 Dimitrie O. Paun
|
||||
*
|
||||
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*
|
||||
* NOTES
|
||||
* Naming conventions
|
||||
* - Symbols are prefixed with MSVCRT_ if they conflict
|
||||
* with libc symbols
|
||||
* - Internal symbols are usually prefixed by msvcrt_.
|
||||
* - Exported symbols that are not present in the public
|
||||
* headers are usually kept the same as the original.
|
||||
* Other conventions
|
||||
* - To avoid conflicts with the standard C library,
|
||||
* no msvcrt headers are included in the implementation.
|
||||
* - Instead, symbols are duplicated here, prefixed with
|
||||
* MSVCRT_, as explained above.
|
||||
* - To avoid inconsistencies, a test for each symbol is
|
||||
* added into tests/headers.c. Please always add a
|
||||
* corresponding test when you add a new symbol!
|
||||
*/
|
||||
|
||||
#ifndef __WINE_MSVCRT_H
|
||||
#define __WINE_MSVCRT_H
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <signal.h>
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
|
||||
extern unsigned int __lc_codepage;
|
||||
extern int __lc_collate_cp;
|
||||
extern int __mb_cur_max;
|
||||
extern const unsigned short _ctype [257];
|
||||
|
||||
void __cdecl _purecall(void);
|
||||
__declspec(noreturn) void __cdecl _amsg_exit(int errnum);
|
||||
|
||||
extern char **_environ;
|
||||
extern wchar_t **_wenviron;
|
||||
extern char ** SnapshotOfEnvironmentA(char **);
|
||||
extern wchar_t ** SnapshotOfEnvironmentW(wchar_t **);
|
||||
|
||||
/* Application type flags */
|
||||
#define _UNKNOWN_APP 0
|
||||
#define _CONSOLE_APP 1
|
||||
#define _GUI_APP 2
|
||||
|
||||
/* I/O Streamming flags missing from stdio.h */
|
||||
#define _IOYOURBUF 0x0100
|
||||
#define _IOAPPEND 0x0200
|
||||
#define _IOSETVBUF 0x0400
|
||||
#define _IOFEOF 0x0800
|
||||
#define _IOFLRTN 0x1000
|
||||
#define _IOCTRLZ 0x2000
|
||||
#define _IOCOMMIT 0x4000
|
||||
#define _IOFREE 0x10000
|
||||
|
||||
//wchar_t *wstrdupa(const char *);
|
||||
//
|
||||
///* FIXME: This should be declared in new.h but it's not an extern "C" so
|
||||
// * it would not be much use anyway. Even for Winelib applications.
|
||||
// */
|
||||
//int __cdecl _set_new_mode(int mode);
|
||||
//
|
||||
void* __cdecl MSVCRT_operator_new(size_t);
|
||||
void __cdecl MSVCRT_operator_delete(void*);
|
||||
typedef void* (__cdecl *malloc_func_t)(size_t);
|
||||
typedef void (__cdecl *free_func_t)(void*);
|
||||
|
||||
extern char* __cdecl __unDName(char *,const char*,int,malloc_func_t,free_func_t,unsigned short int);
|
||||
extern char* __cdecl __unDNameEx(char *,const char*,int,malloc_func_t,free_func_t,void *,unsigned short int);
|
||||
|
||||
/* Setup and teardown multi threaded locks */
|
||||
extern void msvcrt_init_mt_locks(void);
|
||||
extern void msvcrt_free_mt_locks(void);
|
||||
|
||||
extern BOOL msvcrt_init_locale(void);
|
||||
extern void msvcrt_init_math(void);
|
||||
extern void msvcrt_init_io(void);
|
||||
extern void msvcrt_free_io(void);
|
||||
extern void msvcrt_init_console(void);
|
||||
extern void msvcrt_free_console(void);
|
||||
extern void msvcrt_init_args(void);
|
||||
extern void msvcrt_free_args(void);
|
||||
extern void msvcrt_init_signals(void);
|
||||
extern void msvcrt_free_signals(void);
|
||||
|
||||
extern unsigned create_io_inherit_block(WORD*, BYTE**);
|
||||
|
||||
/* _set_abort_behavior codes */
|
||||
#define MSVCRT__WRITE_ABORT_MSG 1
|
||||
#define MSVCRT__CALL_REPORTFAULT 2
|
||||
|
||||
#define MSVCRT_LC_ALL LC_ALL
|
||||
#define MSVCRT_LC_COLLATE LC_COLLATE
|
||||
#define MSVCRT_LC_CTYPE LC_CTYPE
|
||||
#define MSVCRT_LC_MONETARY LC_MONETARY
|
||||
#define MSVCRT_LC_NUMERIC LC_NUMERIC
|
||||
#define MSVCRT_LC_TIME LC_TIME
|
||||
#define MSVCRT_LC_MIN LC_MIN
|
||||
#define MSVCRT_LC_MAX LC_MAX
|
||||
|
||||
#define MSVCRT__OUT_TO_DEFAULT 0
|
||||
#define MSVCRT__OUT_TO_STDERR 1
|
||||
#define MSVCRT__OUT_TO_MSGBOX 2
|
||||
#define MSVCRT__REPORT_ERRMODE 3
|
||||
|
||||
typedef void (*float_handler)(int, int);
|
||||
void _default_handler(int signal);
|
||||
typedef struct _sig_element
|
||||
{
|
||||
int signal;
|
||||
char *signame;
|
||||
__p_sig_fn_t handler;
|
||||
}sig_element;
|
||||
|
||||
#define MSVCRT_malloc malloc
|
||||
#define MSVCRT_free free
|
||||
char* _setlocale(int,const char*);
|
||||
NTSYSAPI VOID NTAPI RtlAssert(PVOID FailedAssertion,PVOID FileName,ULONG LineNumber,PCHAR Message);
|
||||
|
||||
#endif /* __WINE_MSVCRT_H */
|
Loading…
Add table
Add a link
Reference in a new issue