mirror of
https://github.com/reactos/reactos.git
synced 2024-10-23 14:36:11 +00:00
Add missing constants in winnt.h
Fix svn properties svn path=/trunk/; revision=29975
This commit is contained in:
parent
fba0d4a997
commit
6d815bb00a
1
reactos/include/reactos/wine/guiddef.h
Normal file
1
reactos/include/reactos/wine/guiddef.h
Normal file
|
@ -0,0 +1 @@
|
|||
#include "../../psdk/guiddef.h"
|
|
@ -1,95 +1,95 @@
|
|||
/*
|
||||
* Copyright (C) 2004 Mike McCormack
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
import "oaidl.idl";
|
||||
|
||||
typedef struct _ITS_Control_Data
|
||||
{
|
||||
UINT cdwControlData;
|
||||
UINT adwControlData[1];
|
||||
|
||||
} ITS_Control_Data, *PITS_Control_Data;
|
||||
|
||||
typedef enum ECompactionLev {
|
||||
COMPACT_DATA = 0,
|
||||
COMPACT_DATA_AND_PATH
|
||||
} ECompactionLev;
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(88cc31de-27ab-11d0-9df9-00a0c922e6ec),
|
||||
pointer_default(unique)
|
||||
]
|
||||
interface IITStorage : IUnknown
|
||||
{
|
||||
HRESULT StgCreateDocfile(
|
||||
[in] const WCHAR * pwcsName,
|
||||
[in] DWORD grfMode,
|
||||
[in] DWORD reserved,
|
||||
[out] IStorage ** ppstgOpen);
|
||||
|
||||
HRESULT StgCreateDocfileOnILockBytes(
|
||||
[in] ILockBytes * plkbyt,
|
||||
[in] DWORD grfMode,
|
||||
[in] DWORD reserved,
|
||||
[out] IStorage ** ppstgOpen);
|
||||
|
||||
|
||||
HRESULT StgIsStorageFile(
|
||||
[in] const WCHAR * pwcsName);
|
||||
|
||||
HRESULT StgIsStorageILockBytes(
|
||||
[in] ILockBytes * plkbyt);
|
||||
|
||||
HRESULT StgOpenStorage(
|
||||
[in] const WCHAR * pwcsName,
|
||||
[in] IStorage * pstgPriority,
|
||||
[in] DWORD grfMode,
|
||||
[in] SNB snbExclude,
|
||||
[in] DWORD reserved,
|
||||
[out] IStorage ** ppstgOpen);
|
||||
|
||||
HRESULT StgOpenStorageOnILockBytes(
|
||||
[in] ILockBytes * plkbyt,
|
||||
[in] IStorage * pStgPriority,
|
||||
[in] DWORD grfMode,
|
||||
[in] SNB snbExclude,
|
||||
[in] DWORD reserved,
|
||||
[out] IStorage ** ppstgOpen);
|
||||
|
||||
HRESULT StgSetTimes(
|
||||
[in] WCHAR const * lpszName,
|
||||
[in] FILETIME const * pctime,
|
||||
[in] FILETIME const * patime,
|
||||
[in] FILETIME const * pmtime);
|
||||
|
||||
HRESULT SetControlData(
|
||||
[in] PITS_Control_Data pControlData);
|
||||
|
||||
HRESULT DefaultControlData(
|
||||
[out] PITS_Control_Data * ppControlData);
|
||||
|
||||
HRESULT Compact(
|
||||
[in] const WCHAR * pwcsName,
|
||||
[in] ECompactionLev iLev);
|
||||
}
|
||||
|
||||
cpp_quote("DEFINE_GUID(CLSID_ITStorage,0x5d02926a,0x212e,0x11d0,0x9d,0xf9,0x00,0xa0,0xc9,0x22,0xe6,0xec);")
|
||||
cpp_quote("DEFINE_GUID(CLSID_MSFSStore,0xd54eee56,0xaaab,0x11d0,0x9e,0x1d,0x00,0xa0,0xc9,0x22,0xe6,0xec);")
|
||||
cpp_quote("DEFINE_GUID(CLSID_MSITStore,0x9d148290,0xb9c8,0x11d0,0xa4,0xcc,0x00,0x00,0xf8,0x01,0x49,0xf6);")
|
||||
cpp_quote("DEFINE_GUID(CLSID_ITSProtocol,0x9d148291,0xb9c8,0x11d0,0xa4,0xcc,0x00,0x00,0xf8,0x01,0x49,0xf6);")
|
||||
/*
|
||||
* Copyright (C) 2004 Mike McCormack
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
import "oaidl.idl";
|
||||
|
||||
typedef struct _ITS_Control_Data
|
||||
{
|
||||
UINT cdwControlData;
|
||||
UINT adwControlData[1];
|
||||
|
||||
} ITS_Control_Data, *PITS_Control_Data;
|
||||
|
||||
typedef enum ECompactionLev {
|
||||
COMPACT_DATA = 0,
|
||||
COMPACT_DATA_AND_PATH
|
||||
} ECompactionLev;
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(88cc31de-27ab-11d0-9df9-00a0c922e6ec),
|
||||
pointer_default(unique)
|
||||
]
|
||||
interface IITStorage : IUnknown
|
||||
{
|
||||
HRESULT StgCreateDocfile(
|
||||
[in] const WCHAR * pwcsName,
|
||||
[in] DWORD grfMode,
|
||||
[in] DWORD reserved,
|
||||
[out] IStorage ** ppstgOpen);
|
||||
|
||||
HRESULT StgCreateDocfileOnILockBytes(
|
||||
[in] ILockBytes * plkbyt,
|
||||
[in] DWORD grfMode,
|
||||
[in] DWORD reserved,
|
||||
[out] IStorage ** ppstgOpen);
|
||||
|
||||
|
||||
HRESULT StgIsStorageFile(
|
||||
[in] const WCHAR * pwcsName);
|
||||
|
||||
HRESULT StgIsStorageILockBytes(
|
||||
[in] ILockBytes * plkbyt);
|
||||
|
||||
HRESULT StgOpenStorage(
|
||||
[in] const WCHAR * pwcsName,
|
||||
[in] IStorage * pstgPriority,
|
||||
[in] DWORD grfMode,
|
||||
[in] SNB snbExclude,
|
||||
[in] DWORD reserved,
|
||||
[out] IStorage ** ppstgOpen);
|
||||
|
||||
HRESULT StgOpenStorageOnILockBytes(
|
||||
[in] ILockBytes * plkbyt,
|
||||
[in] IStorage * pStgPriority,
|
||||
[in] DWORD grfMode,
|
||||
[in] SNB snbExclude,
|
||||
[in] DWORD reserved,
|
||||
[out] IStorage ** ppstgOpen);
|
||||
|
||||
HRESULT StgSetTimes(
|
||||
[in] WCHAR const * lpszName,
|
||||
[in] FILETIME const * pctime,
|
||||
[in] FILETIME const * patime,
|
||||
[in] FILETIME const * pmtime);
|
||||
|
||||
HRESULT SetControlData(
|
||||
[in] PITS_Control_Data pControlData);
|
||||
|
||||
HRESULT DefaultControlData(
|
||||
[out] PITS_Control_Data * ppControlData);
|
||||
|
||||
HRESULT Compact(
|
||||
[in] const WCHAR * pwcsName,
|
||||
[in] ECompactionLev iLev);
|
||||
}
|
||||
|
||||
cpp_quote("DEFINE_GUID(CLSID_ITStorage,0x5d02926a,0x212e,0x11d0,0x9d,0xf9,0x00,0xa0,0xc9,0x22,0xe6,0xec);")
|
||||
cpp_quote("DEFINE_GUID(CLSID_MSFSStore,0xd54eee56,0xaaab,0x11d0,0x9e,0x1d,0x00,0xa0,0xc9,0x22,0xe6,0xec);")
|
||||
cpp_quote("DEFINE_GUID(CLSID_MSITStore,0x9d148290,0xb9c8,0x11d0,0xa4,0xcc,0x00,0x00,0xf8,0x01,0x49,0xf6);")
|
||||
cpp_quote("DEFINE_GUID(CLSID_ITSProtocol,0x9d148291,0xb9c8,0x11d0,0xa4,0xcc,0x00,0x00,0xf8,0x01,0x49,0xf6);")
|
||||
|
|
|
@ -1,210 +1,210 @@
|
|||
/*
|
||||
* Definitions for the Wine library
|
||||
*
|
||||
* Copyright 2000 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __WINE_WINE_LIBRARY_H
|
||||
#define __WINE_WINE_LIBRARY_H
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <windef.h>
|
||||
#include <winbase.h>
|
||||
|
||||
/* configuration */
|
||||
|
||||
extern const char *wine_get_config_dir(void);
|
||||
extern const char *wine_get_server_dir(void);
|
||||
extern const char *wine_get_user_name(void);
|
||||
extern void wine_init_argv0_path( const char *argv0 );
|
||||
extern void wine_exec_wine_binary( const char *name, char **argv, char **envp, int use_preloader );
|
||||
|
||||
/* dll loading */
|
||||
|
||||
typedef void (*load_dll_callback_t)( void *, const char * );
|
||||
|
||||
extern void *wine_dlopen( const char *filename, int flag, char *error, int errorsize );
|
||||
extern void *wine_dlsym( void *handle, const char *symbol, char *error, int errorsize );
|
||||
extern int wine_dlclose( void *handle, char *error, int errorsize );
|
||||
extern void wine_dll_set_callback( load_dll_callback_t load );
|
||||
extern void *wine_dll_load( const char *filename, char *error, int errorsize, int *file_exists );
|
||||
extern void *wine_dll_load_main_exe( const char *name, char *error, int errorsize,
|
||||
int test_only, int *file_exists );
|
||||
extern void wine_dll_unload( void *handle );
|
||||
extern int wine_dll_get_owner( const char *name, char *buffer, int size, int *file_exists );
|
||||
|
||||
extern int __wine_main_argc;
|
||||
extern char **__wine_main_argv;
|
||||
extern WCHAR **__wine_main_wargv;
|
||||
extern char **__wine_main_environ;
|
||||
extern void wine_init( int argc, char *argv[], char *error, int error_size );
|
||||
|
||||
/* debugging */
|
||||
|
||||
extern const char * (*__wine_dbgstr_an)( const char * s, int n );
|
||||
extern const char * (*__wine_dbgstr_wn)( const WCHAR *s, int n );
|
||||
extern const char * (*__wine_dbg_vsprintf)( const char *format, va_list args );
|
||||
extern int (*__wine_dbg_vprintf)( const char *format, va_list args );
|
||||
extern int (*__wine_dbg_vlog)( unsigned int cls, const char *channel,
|
||||
const char *function, const char *format, va_list args );
|
||||
|
||||
extern void wine_dbg_add_option( const char *name, unsigned char set, unsigned char clear );
|
||||
extern int wine_dbg_parse_options( const char *str );
|
||||
|
||||
/* portability */
|
||||
|
||||
extern void DECLSPEC_NORETURN wine_switch_to_stack( void (*func)(void *), void *arg, void *stack );
|
||||
extern void wine_set_pe_load_area( void *base, size_t size );
|
||||
extern void wine_free_pe_load_area(void);
|
||||
|
||||
/* memory mappings */
|
||||
|
||||
extern void *wine_anon_mmap( void *start, size_t size, int prot, int flags );
|
||||
extern void wine_mmap_add_reserved_area( void *addr, size_t size );
|
||||
extern void wine_mmap_remove_reserved_area( void *addr, size_t size, int unmap );
|
||||
extern int wine_mmap_is_in_reserved_area( void *addr, size_t size );
|
||||
|
||||
/* LDT management */
|
||||
|
||||
extern void wine_ldt_init_locking( void (*lock_func)(void), void (*unlock_func)(void) );
|
||||
extern void wine_ldt_get_entry( unsigned short sel, LDT_ENTRY *entry );
|
||||
extern int wine_ldt_set_entry( unsigned short sel, const LDT_ENTRY *entry );
|
||||
extern int wine_ldt_is_system( unsigned short sel );
|
||||
extern void *wine_ldt_get_ptr( unsigned short sel, unsigned int offset );
|
||||
extern unsigned short wine_ldt_alloc_entries( int count );
|
||||
extern unsigned short wine_ldt_realloc_entries( unsigned short sel, int oldcount, int newcount );
|
||||
extern void wine_ldt_free_entries( unsigned short sel, int count );
|
||||
#ifdef __i386__
|
||||
extern unsigned short wine_ldt_alloc_fs(void);
|
||||
extern void wine_ldt_init_fs( unsigned short sel, const LDT_ENTRY *entry );
|
||||
extern void wine_ldt_free_fs( unsigned short sel );
|
||||
#else /* __i386__ */
|
||||
static inline unsigned short wine_ldt_alloc_fs(void) { return 0x0b; /* pseudo GDT selector */ }
|
||||
static inline void wine_ldt_init_fs( unsigned short sel, const LDT_ENTRY *entry ) { }
|
||||
static inline void wine_ldt_free_fs( unsigned short sel ) { }
|
||||
#endif /* __i386__ */
|
||||
|
||||
|
||||
/* the local copy of the LDT */
|
||||
#ifdef __CYGWIN__
|
||||
# ifdef WINE_EXPORT_LDT_COPY
|
||||
# define WINE_LDT_EXTERN __declspec(dllexport)
|
||||
# else
|
||||
# define WINE_LDT_EXTERN __declspec(dllimport)
|
||||
# endif
|
||||
#else
|
||||
# define WINE_LDT_EXTERN extern
|
||||
#endif
|
||||
|
||||
WINE_LDT_EXTERN struct __wine_ldt_copy
|
||||
{
|
||||
void *base[8192]; /* base address or 0 if entry is free */
|
||||
unsigned long limit[8192]; /* limit in bytes or 0 if entry is free */
|
||||
unsigned char flags[8192]; /* flags (defined below) */
|
||||
} wine_ldt_copy;
|
||||
|
||||
#define WINE_LDT_FLAGS_DATA 0x13 /* Data segment */
|
||||
#define WINE_LDT_FLAGS_STACK 0x17 /* Stack segment */
|
||||
#define WINE_LDT_FLAGS_CODE 0x1b /* Code segment */
|
||||
#define WINE_LDT_FLAGS_TYPE_MASK 0x1f /* Mask for segment type */
|
||||
#define WINE_LDT_FLAGS_32BIT 0x40 /* Segment is 32-bit (code or stack) */
|
||||
#define WINE_LDT_FLAGS_ALLOCATED 0x80 /* Segment is allocated (no longer free) */
|
||||
|
||||
/* helper functions to manipulate the LDT_ENTRY structure */
|
||||
inline static void wine_ldt_set_base( LDT_ENTRY *ent, const void *base )
|
||||
{
|
||||
ent->BaseLow = (WORD)(unsigned long)base;
|
||||
ent->HighWord.Bits.BaseMid = (BYTE)((unsigned long)base >> 16);
|
||||
ent->HighWord.Bits.BaseHi = (BYTE)((unsigned long)base >> 24);
|
||||
}
|
||||
inline static void wine_ldt_set_limit( LDT_ENTRY *ent, unsigned int limit )
|
||||
{
|
||||
if ((ent->HighWord.Bits.Granularity = (limit >= 0x100000))) limit >>= 12;
|
||||
ent->LimitLow = (WORD)limit;
|
||||
ent->HighWord.Bits.LimitHi = (limit >> 16);
|
||||
}
|
||||
inline static void *wine_ldt_get_base( const LDT_ENTRY *ent )
|
||||
{
|
||||
return (void *)(ent->BaseLow |
|
||||
(unsigned long)ent->HighWord.Bits.BaseMid << 16 |
|
||||
(unsigned long)ent->HighWord.Bits.BaseHi << 24);
|
||||
}
|
||||
inline static unsigned int wine_ldt_get_limit( const LDT_ENTRY *ent )
|
||||
{
|
||||
unsigned int limit = ent->LimitLow | (ent->HighWord.Bits.LimitHi << 16);
|
||||
if (ent->HighWord.Bits.Granularity) limit = (limit << 12) | 0xfff;
|
||||
return limit;
|
||||
}
|
||||
inline static void wine_ldt_set_flags( LDT_ENTRY *ent, unsigned char flags )
|
||||
{
|
||||
ent->HighWord.Bits.Dpl = 3;
|
||||
ent->HighWord.Bits.Pres = 1;
|
||||
ent->HighWord.Bits.Type = flags;
|
||||
ent->HighWord.Bits.Sys = 0;
|
||||
ent->HighWord.Bits.Reserved_0 = 0;
|
||||
ent->HighWord.Bits.Default_Big = (flags & WINE_LDT_FLAGS_32BIT) != 0;
|
||||
}
|
||||
inline static unsigned char wine_ldt_get_flags( const LDT_ENTRY *ent )
|
||||
{
|
||||
unsigned char ret = ent->HighWord.Bits.Type;
|
||||
if (ent->HighWord.Bits.Default_Big) ret |= WINE_LDT_FLAGS_32BIT;
|
||||
return ret;
|
||||
}
|
||||
inline static int wine_ldt_is_empty( const LDT_ENTRY *ent )
|
||||
{
|
||||
const DWORD *dw = (const DWORD *)ent;
|
||||
return (dw[0] | dw[1]) == 0;
|
||||
}
|
||||
|
||||
/* segment register access */
|
||||
|
||||
#ifdef __i386__
|
||||
# ifdef __GNUC__
|
||||
# define __DEFINE_GET_SEG(seg) \
|
||||
extern inline unsigned short wine_get_##seg(void) \
|
||||
{ unsigned short res; __asm__("movw %%" #seg ",%w0" : "=r"(res)); return res; }
|
||||
# define __DEFINE_SET_SEG(seg) \
|
||||
extern inline void wine_set_##seg(int val) { __asm__("movw %w0,%%" #seg : : "r" (val)); }
|
||||
# elif defined(_MSC_VER)
|
||||
# define __DEFINE_GET_SEG(seg) \
|
||||
extern inline unsigned short wine_get_##seg(void) \
|
||||
{ unsigned short res; __asm { mov res, seg } return res; }
|
||||
# define __DEFINE_SET_SEG(seg) \
|
||||
extern inline void wine_set_##seg(unsigned short val) { __asm { mov seg, val } }
|
||||
# else /* __GNUC__ || _MSC_VER */
|
||||
# define __DEFINE_GET_SEG(seg) extern unsigned short wine_get_##seg(void);
|
||||
# define __DEFINE_SET_SEG(seg) extern void wine_set_##seg(unsigned int);
|
||||
# endif /* __GNUC__ || _MSC_VER */
|
||||
#else /* __i386__ */
|
||||
# define __DEFINE_GET_SEG(seg) inline static unsigned short wine_get_##seg(void) { return 0; }
|
||||
# define __DEFINE_SET_SEG(seg) inline static void wine_set_##seg(int val) { /* nothing */ }
|
||||
#endif /* __i386__ */
|
||||
|
||||
__DEFINE_GET_SEG(cs)
|
||||
__DEFINE_GET_SEG(ds)
|
||||
__DEFINE_GET_SEG(es)
|
||||
__DEFINE_GET_SEG(fs)
|
||||
__DEFINE_GET_SEG(gs)
|
||||
__DEFINE_GET_SEG(ss)
|
||||
__DEFINE_SET_SEG(fs)
|
||||
__DEFINE_SET_SEG(gs)
|
||||
#undef __DEFINE_GET_SEG
|
||||
#undef __DEFINE_SET_SEG
|
||||
|
||||
#endif /* __WINE_WINE_LIBRARY_H */
|
||||
/*
|
||||
* Definitions for the Wine library
|
||||
*
|
||||
* Copyright 2000 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __WINE_WINE_LIBRARY_H
|
||||
#define __WINE_WINE_LIBRARY_H
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <windef.h>
|
||||
#include <winbase.h>
|
||||
|
||||
/* configuration */
|
||||
|
||||
extern const char *wine_get_config_dir(void);
|
||||
extern const char *wine_get_server_dir(void);
|
||||
extern const char *wine_get_user_name(void);
|
||||
extern void wine_init_argv0_path( const char *argv0 );
|
||||
extern void wine_exec_wine_binary( const char *name, char **argv, char **envp, int use_preloader );
|
||||
|
||||
/* dll loading */
|
||||
|
||||
typedef void (*load_dll_callback_t)( void *, const char * );
|
||||
|
||||
extern void *wine_dlopen( const char *filename, int flag, char *error, int errorsize );
|
||||
extern void *wine_dlsym( void *handle, const char *symbol, char *error, int errorsize );
|
||||
extern int wine_dlclose( void *handle, char *error, int errorsize );
|
||||
extern void wine_dll_set_callback( load_dll_callback_t load );
|
||||
extern void *wine_dll_load( const char *filename, char *error, int errorsize, int *file_exists );
|
||||
extern void *wine_dll_load_main_exe( const char *name, char *error, int errorsize,
|
||||
int test_only, int *file_exists );
|
||||
extern void wine_dll_unload( void *handle );
|
||||
extern int wine_dll_get_owner( const char *name, char *buffer, int size, int *file_exists );
|
||||
|
||||
extern int __wine_main_argc;
|
||||
extern char **__wine_main_argv;
|
||||
extern WCHAR **__wine_main_wargv;
|
||||
extern char **__wine_main_environ;
|
||||
extern void wine_init( int argc, char *argv[], char *error, int error_size );
|
||||
|
||||
/* debugging */
|
||||
|
||||
extern const char * (*__wine_dbgstr_an)( const char * s, int n );
|
||||
extern const char * (*__wine_dbgstr_wn)( const WCHAR *s, int n );
|
||||
extern const char * (*__wine_dbg_vsprintf)( const char *format, va_list args );
|
||||
extern int (*__wine_dbg_vprintf)( const char *format, va_list args );
|
||||
extern int (*__wine_dbg_vlog)( unsigned int cls, const char *channel,
|
||||
const char *function, const char *format, va_list args );
|
||||
|
||||
extern void wine_dbg_add_option( const char *name, unsigned char set, unsigned char clear );
|
||||
extern int wine_dbg_parse_options( const char *str );
|
||||
|
||||
/* portability */
|
||||
|
||||
extern void DECLSPEC_NORETURN wine_switch_to_stack( void (*func)(void *), void *arg, void *stack );
|
||||
extern void wine_set_pe_load_area( void *base, size_t size );
|
||||
extern void wine_free_pe_load_area(void);
|
||||
|
||||
/* memory mappings */
|
||||
|
||||
extern void *wine_anon_mmap( void *start, size_t size, int prot, int flags );
|
||||
extern void wine_mmap_add_reserved_area( void *addr, size_t size );
|
||||
extern void wine_mmap_remove_reserved_area( void *addr, size_t size, int unmap );
|
||||
extern int wine_mmap_is_in_reserved_area( void *addr, size_t size );
|
||||
|
||||
/* LDT management */
|
||||
|
||||
extern void wine_ldt_init_locking( void (*lock_func)(void), void (*unlock_func)(void) );
|
||||
extern void wine_ldt_get_entry( unsigned short sel, LDT_ENTRY *entry );
|
||||
extern int wine_ldt_set_entry( unsigned short sel, const LDT_ENTRY *entry );
|
||||
extern int wine_ldt_is_system( unsigned short sel );
|
||||
extern void *wine_ldt_get_ptr( unsigned short sel, unsigned int offset );
|
||||
extern unsigned short wine_ldt_alloc_entries( int count );
|
||||
extern unsigned short wine_ldt_realloc_entries( unsigned short sel, int oldcount, int newcount );
|
||||
extern void wine_ldt_free_entries( unsigned short sel, int count );
|
||||
#ifdef __i386__
|
||||
extern unsigned short wine_ldt_alloc_fs(void);
|
||||
extern void wine_ldt_init_fs( unsigned short sel, const LDT_ENTRY *entry );
|
||||
extern void wine_ldt_free_fs( unsigned short sel );
|
||||
#else /* __i386__ */
|
||||
static inline unsigned short wine_ldt_alloc_fs(void) { return 0x0b; /* pseudo GDT selector */ }
|
||||
static inline void wine_ldt_init_fs( unsigned short sel, const LDT_ENTRY *entry ) { }
|
||||
static inline void wine_ldt_free_fs( unsigned short sel ) { }
|
||||
#endif /* __i386__ */
|
||||
|
||||
|
||||
/* the local copy of the LDT */
|
||||
#ifdef __CYGWIN__
|
||||
# ifdef WINE_EXPORT_LDT_COPY
|
||||
# define WINE_LDT_EXTERN __declspec(dllexport)
|
||||
# else
|
||||
# define WINE_LDT_EXTERN __declspec(dllimport)
|
||||
# endif
|
||||
#else
|
||||
# define WINE_LDT_EXTERN extern
|
||||
#endif
|
||||
|
||||
WINE_LDT_EXTERN struct __wine_ldt_copy
|
||||
{
|
||||
void *base[8192]; /* base address or 0 if entry is free */
|
||||
unsigned long limit[8192]; /* limit in bytes or 0 if entry is free */
|
||||
unsigned char flags[8192]; /* flags (defined below) */
|
||||
} wine_ldt_copy;
|
||||
|
||||
#define WINE_LDT_FLAGS_DATA 0x13 /* Data segment */
|
||||
#define WINE_LDT_FLAGS_STACK 0x17 /* Stack segment */
|
||||
#define WINE_LDT_FLAGS_CODE 0x1b /* Code segment */
|
||||
#define WINE_LDT_FLAGS_TYPE_MASK 0x1f /* Mask for segment type */
|
||||
#define WINE_LDT_FLAGS_32BIT 0x40 /* Segment is 32-bit (code or stack) */
|
||||
#define WINE_LDT_FLAGS_ALLOCATED 0x80 /* Segment is allocated (no longer free) */
|
||||
|
||||
/* helper functions to manipulate the LDT_ENTRY structure */
|
||||
inline static void wine_ldt_set_base( LDT_ENTRY *ent, const void *base )
|
||||
{
|
||||
ent->BaseLow = (WORD)(unsigned long)base;
|
||||
ent->HighWord.Bits.BaseMid = (BYTE)((unsigned long)base >> 16);
|
||||
ent->HighWord.Bits.BaseHi = (BYTE)((unsigned long)base >> 24);
|
||||
}
|
||||
inline static void wine_ldt_set_limit( LDT_ENTRY *ent, unsigned int limit )
|
||||
{
|
||||
if ((ent->HighWord.Bits.Granularity = (limit >= 0x100000))) limit >>= 12;
|
||||
ent->LimitLow = (WORD)limit;
|
||||
ent->HighWord.Bits.LimitHi = (limit >> 16);
|
||||
}
|
||||
inline static void *wine_ldt_get_base( const LDT_ENTRY *ent )
|
||||
{
|
||||
return (void *)(ent->BaseLow |
|
||||
(unsigned long)ent->HighWord.Bits.BaseMid << 16 |
|
||||
(unsigned long)ent->HighWord.Bits.BaseHi << 24);
|
||||
}
|
||||
inline static unsigned int wine_ldt_get_limit( const LDT_ENTRY *ent )
|
||||
{
|
||||
unsigned int limit = ent->LimitLow | (ent->HighWord.Bits.LimitHi << 16);
|
||||
if (ent->HighWord.Bits.Granularity) limit = (limit << 12) | 0xfff;
|
||||
return limit;
|
||||
}
|
||||
inline static void wine_ldt_set_flags( LDT_ENTRY *ent, unsigned char flags )
|
||||
{
|
||||
ent->HighWord.Bits.Dpl = 3;
|
||||
ent->HighWord.Bits.Pres = 1;
|
||||
ent->HighWord.Bits.Type = flags;
|
||||
ent->HighWord.Bits.Sys = 0;
|
||||
ent->HighWord.Bits.Reserved_0 = 0;
|
||||
ent->HighWord.Bits.Default_Big = (flags & WINE_LDT_FLAGS_32BIT) != 0;
|
||||
}
|
||||
inline static unsigned char wine_ldt_get_flags( const LDT_ENTRY *ent )
|
||||
{
|
||||
unsigned char ret = ent->HighWord.Bits.Type;
|
||||
if (ent->HighWord.Bits.Default_Big) ret |= WINE_LDT_FLAGS_32BIT;
|
||||
return ret;
|
||||
}
|
||||
inline static int wine_ldt_is_empty( const LDT_ENTRY *ent )
|
||||
{
|
||||
const DWORD *dw = (const DWORD *)ent;
|
||||
return (dw[0] | dw[1]) == 0;
|
||||
}
|
||||
|
||||
/* segment register access */
|
||||
|
||||
#ifdef __i386__
|
||||
# ifdef __GNUC__
|
||||
# define __DEFINE_GET_SEG(seg) \
|
||||
extern inline unsigned short wine_get_##seg(void) \
|
||||
{ unsigned short res; __asm__("movw %%" #seg ",%w0" : "=r"(res)); return res; }
|
||||
# define __DEFINE_SET_SEG(seg) \
|
||||
extern inline void wine_set_##seg(int val) { __asm__("movw %w0,%%" #seg : : "r" (val)); }
|
||||
# elif defined(_MSC_VER)
|
||||
# define __DEFINE_GET_SEG(seg) \
|
||||
extern inline unsigned short wine_get_##seg(void) \
|
||||
{ unsigned short res; __asm { mov res, seg } return res; }
|
||||
# define __DEFINE_SET_SEG(seg) \
|
||||
extern inline void wine_set_##seg(unsigned short val) { __asm { mov seg, val } }
|
||||
# else /* __GNUC__ || _MSC_VER */
|
||||
# define __DEFINE_GET_SEG(seg) extern unsigned short wine_get_##seg(void);
|
||||
# define __DEFINE_SET_SEG(seg) extern void wine_set_##seg(unsigned int);
|
||||
# endif /* __GNUC__ || _MSC_VER */
|
||||
#else /* __i386__ */
|
||||
# define __DEFINE_GET_SEG(seg) inline static unsigned short wine_get_##seg(void) { return 0; }
|
||||
# define __DEFINE_SET_SEG(seg) inline static void wine_set_##seg(int val) { /* nothing */ }
|
||||
#endif /* __i386__ */
|
||||
|
||||
__DEFINE_GET_SEG(cs)
|
||||
__DEFINE_GET_SEG(ds)
|
||||
__DEFINE_GET_SEG(es)
|
||||
__DEFINE_GET_SEG(fs)
|
||||
__DEFINE_GET_SEG(gs)
|
||||
__DEFINE_GET_SEG(ss)
|
||||
__DEFINE_SET_SEG(fs)
|
||||
__DEFINE_SET_SEG(gs)
|
||||
#undef __DEFINE_GET_SEG
|
||||
#undef __DEFINE_SET_SEG
|
||||
|
||||
#endif /* __WINE_WINE_LIBRARY_H */
|
||||
|
|
|
@ -1,3 +1 @@
|
|||
#include "../../psdk/windef.h"
|
||||
|
||||
|
||||
#include "../../psdk/windef.h"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id$
|
||||
/* $Id: winnetwk.h 20909 2006-01-15 22:25:16Z gvg $
|
||||
*
|
||||
* Compatibility header
|
||||
*
|
||||
|
|
|
@ -22,12 +22,10 @@
|
|||
#define __WINE_WINNT_H
|
||||
|
||||
#include_next <winnt.h>
|
||||
#include <w32api.h>
|
||||
#include <stddef.h>
|
||||
|
||||
/* non standard; keep the number high enough (but < 0xff) */
|
||||
#define LANG_ESPERANTO 0x8f
|
||||
#define LANG_WALON 0x90
|
||||
#define LANG_ESPERANTO 0x8f
|
||||
#define LANG_WALON 0x90
|
||||
#define LANG_CORNISH 0x91
|
||||
#define LANG_WELSH 0x92
|
||||
#define LANG_BRETON 0x93
|
||||
|
@ -35,12 +33,12 @@
|
|||
/* FIXME: these are not in the Windows header */
|
||||
#define LANG_GAELIC 0x94
|
||||
#define LANG_MALTESE 0x3a
|
||||
#define LANG_RHAETO_ROMANCE 0x17
|
||||
#define LANG_ROMANSH 0x17
|
||||
#define LANG_SAAMI 0x3b
|
||||
#define LANG_SORBIAN 0x2e
|
||||
#define LANG_LOWER_SORBIAN 0x2e
|
||||
#define LANG_UPPER_SORBIAN 0x2e
|
||||
#define LANG_SUTU 0x30
|
||||
#define LANG_TAJIK 0x28
|
||||
#define LANG_TSONGA 0x31
|
||||
#define LANG_TSWANA 0x32
|
||||
#define LANG_VENDA 0x33
|
||||
|
|
|
@ -1,110 +1,110 @@
|
|||
/*
|
||||
* Copyright (C) the Wine project
|
||||
*
|
||||
* 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 __WINE_WINE_WINSOCK16_H
|
||||
#define __WINE_WINE_WINSOCK16_H
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <windef.h>
|
||||
#include <winbase.h>
|
||||
#include <pshpack1.h>
|
||||
|
||||
typedef UINT16 SOCKET16;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UINT16 fd_count; /* how many are SET? */
|
||||
SOCKET16 fd_array[WS_FD_SETSIZE]; /* an array of SOCKETs */
|
||||
} ws_fd_set16;
|
||||
|
||||
/* ws_hostent16, ws_protoent16, ws_servent16, ws_netent16
|
||||
* are 1-byte aligned here ! */
|
||||
typedef struct ws_hostent16
|
||||
{
|
||||
SEGPTR h_name; /* official name of host */
|
||||
SEGPTR h_aliases; /* alias list */
|
||||
INT16 h_addrtype; /* host address type */
|
||||
INT16 h_length; /* length of address */
|
||||
SEGPTR h_addr_list; /* list of addresses from name server */
|
||||
} _ws_hostent16;
|
||||
|
||||
typedef struct ws_protoent16
|
||||
{
|
||||
SEGPTR p_name; /* official protocol name */
|
||||
SEGPTR p_aliases; /* alias list */
|
||||
INT16 p_proto; /* protocol # */
|
||||
} _ws_protoent16;
|
||||
|
||||
typedef struct ws_servent16
|
||||
{
|
||||
SEGPTR s_name; /* official service name */
|
||||
SEGPTR s_aliases; /* alias list */
|
||||
INT16 s_port; /* port # */
|
||||
SEGPTR s_proto; /* protocol to use */
|
||||
} _ws_servent16;
|
||||
|
||||
typedef struct ws_netent16
|
||||
{
|
||||
SEGPTR n_name; /* official name of net */
|
||||
SEGPTR n_aliases; /* alias list */
|
||||
INT16 n_addrtype; /* net address type */
|
||||
INT n_net; /* network # */
|
||||
} _ws_netent16;
|
||||
|
||||
typedef struct WSAData16
|
||||
{
|
||||
WORD wVersion;
|
||||
WORD wHighVersion;
|
||||
char szDescription[WSADESCRIPTION_LEN+1];
|
||||
char szSystemStatus[WSASYS_STATUS_LEN+1];
|
||||
WORD iMaxSockets;
|
||||
WORD iMaxUdpDg;
|
||||
SEGPTR lpVendorInfo;
|
||||
} WSADATA16, *LPWSADATA16;
|
||||
|
||||
#include <poppack.h>
|
||||
|
||||
#define WS_FD_CLR16(fd, set) __WS_FD_CLR((fd),(set), ws_fd_set16)
|
||||
#define WS_FD_SET16(fd, set) __WS_FD_SET1((fd),(set), ws_fd_set16)
|
||||
#define WS_FD_ZERO16(set) (((ws_fd_set16*)(set))->fd_count=0)
|
||||
#define WS_FD_ISSET16(fd, set) __WSAFDIsSet16((SOCKET16)(fd), (ws_fd_set16*)(set))
|
||||
|
||||
#define INVALID_SOCKET16 ((SOCKET16)(~0))
|
||||
|
||||
INT16 WINAPI __WSAFDIsSet16( SOCKET16, ws_fd_set16 * );
|
||||
INT16 WINAPI WSAStartup16(UINT16 wVersionRequired, LPWSADATA16 lpWSAData);
|
||||
void WINAPI WSASetLastError16(INT16 iError);
|
||||
INT16 WINAPI WSAUnhookBlockingHook16(void);
|
||||
FARPROC16 WINAPI WSASetBlockingHook16(FARPROC16 lpBlockFunc);
|
||||
HANDLE16 WINAPI WSAAsyncGetServByName16(HWND16 hWnd, UINT16 wMsg, LPCSTR name, LPCSTR proto,
|
||||
SEGPTR buf, INT16 buflen);
|
||||
HANDLE16 WINAPI WSAAsyncGetServByPort16(HWND16 hWnd, UINT16 wMsg, INT16 port,
|
||||
LPCSTR proto, SEGPTR buf, INT16 buflen);
|
||||
HANDLE16 WINAPI WSAAsyncGetProtoByName16(HWND16 hWnd, UINT16 wMsg,
|
||||
LPCSTR name, SEGPTR buf, INT16 buflen);
|
||||
HANDLE16 WINAPI WSAAsyncGetProtoByNumber16(HWND16 hWnd, UINT16 wMsg,
|
||||
INT16 number, SEGPTR buf, INT16 buflen);
|
||||
HANDLE16 WINAPI WSAAsyncGetHostByName16(HWND16 hWnd, UINT16 wMsg,
|
||||
LPCSTR name, SEGPTR buf, INT16 buflen);
|
||||
HANDLE16 WINAPI WSAAsyncGetHostByAddr16(HWND16 hWnd, UINT16 wMsg, LPCSTR addr,
|
||||
INT16 len, INT16 type, SEGPTR buf, INT16 buflen);
|
||||
INT16 WINAPI WSACancelAsyncRequest16(HANDLE16 hAsyncTaskHandle);
|
||||
INT16 WINAPI WSAAsyncSelect16(SOCKET16 s, HWND16 hWnd, UINT16 wMsg, LONG lEvent);
|
||||
INT16 WINAPI WSARecvEx16(SOCKET16 s, char *buf, INT16 len, INT16 *flags);
|
||||
|
||||
#endif /* __WINE_WINE_WINSOCK16_H */
|
||||
/*
|
||||
* Copyright (C) the Wine project
|
||||
*
|
||||
* 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 __WINE_WINE_WINSOCK16_H
|
||||
#define __WINE_WINE_WINSOCK16_H
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <windef.h>
|
||||
#include <winbase.h>
|
||||
#include <pshpack1.h>
|
||||
|
||||
typedef UINT16 SOCKET16;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UINT16 fd_count; /* how many are SET? */
|
||||
SOCKET16 fd_array[WS_FD_SETSIZE]; /* an array of SOCKETs */
|
||||
} ws_fd_set16;
|
||||
|
||||
/* ws_hostent16, ws_protoent16, ws_servent16, ws_netent16
|
||||
* are 1-byte aligned here ! */
|
||||
typedef struct ws_hostent16
|
||||
{
|
||||
SEGPTR h_name; /* official name of host */
|
||||
SEGPTR h_aliases; /* alias list */
|
||||
INT16 h_addrtype; /* host address type */
|
||||
INT16 h_length; /* length of address */
|
||||
SEGPTR h_addr_list; /* list of addresses from name server */
|
||||
} _ws_hostent16;
|
||||
|
||||
typedef struct ws_protoent16
|
||||
{
|
||||
SEGPTR p_name; /* official protocol name */
|
||||
SEGPTR p_aliases; /* alias list */
|
||||
INT16 p_proto; /* protocol # */
|
||||
} _ws_protoent16;
|
||||
|
||||
typedef struct ws_servent16
|
||||
{
|
||||
SEGPTR s_name; /* official service name */
|
||||
SEGPTR s_aliases; /* alias list */
|
||||
INT16 s_port; /* port # */
|
||||
SEGPTR s_proto; /* protocol to use */
|
||||
} _ws_servent16;
|
||||
|
||||
typedef struct ws_netent16
|
||||
{
|
||||
SEGPTR n_name; /* official name of net */
|
||||
SEGPTR n_aliases; /* alias list */
|
||||
INT16 n_addrtype; /* net address type */
|
||||
INT n_net; /* network # */
|
||||
} _ws_netent16;
|
||||
|
||||
typedef struct WSAData16
|
||||
{
|
||||
WORD wVersion;
|
||||
WORD wHighVersion;
|
||||
char szDescription[WSADESCRIPTION_LEN+1];
|
||||
char szSystemStatus[WSASYS_STATUS_LEN+1];
|
||||
WORD iMaxSockets;
|
||||
WORD iMaxUdpDg;
|
||||
SEGPTR lpVendorInfo;
|
||||
} WSADATA16, *LPWSADATA16;
|
||||
|
||||
#include <poppack.h>
|
||||
|
||||
#define WS_FD_CLR16(fd, set) __WS_FD_CLR((fd),(set), ws_fd_set16)
|
||||
#define WS_FD_SET16(fd, set) __WS_FD_SET1((fd),(set), ws_fd_set16)
|
||||
#define WS_FD_ZERO16(set) (((ws_fd_set16*)(set))->fd_count=0)
|
||||
#define WS_FD_ISSET16(fd, set) __WSAFDIsSet16((SOCKET16)(fd), (ws_fd_set16*)(set))
|
||||
|
||||
#define INVALID_SOCKET16 ((SOCKET16)(~0))
|
||||
|
||||
INT16 WINAPI __WSAFDIsSet16( SOCKET16, ws_fd_set16 * );
|
||||
INT16 WINAPI WSAStartup16(UINT16 wVersionRequired, LPWSADATA16 lpWSAData);
|
||||
void WINAPI WSASetLastError16(INT16 iError);
|
||||
INT16 WINAPI WSAUnhookBlockingHook16(void);
|
||||
FARPROC16 WINAPI WSASetBlockingHook16(FARPROC16 lpBlockFunc);
|
||||
HANDLE16 WINAPI WSAAsyncGetServByName16(HWND16 hWnd, UINT16 wMsg, LPCSTR name, LPCSTR proto,
|
||||
SEGPTR buf, INT16 buflen);
|
||||
HANDLE16 WINAPI WSAAsyncGetServByPort16(HWND16 hWnd, UINT16 wMsg, INT16 port,
|
||||
LPCSTR proto, SEGPTR buf, INT16 buflen);
|
||||
HANDLE16 WINAPI WSAAsyncGetProtoByName16(HWND16 hWnd, UINT16 wMsg,
|
||||
LPCSTR name, SEGPTR buf, INT16 buflen);
|
||||
HANDLE16 WINAPI WSAAsyncGetProtoByNumber16(HWND16 hWnd, UINT16 wMsg,
|
||||
INT16 number, SEGPTR buf, INT16 buflen);
|
||||
HANDLE16 WINAPI WSAAsyncGetHostByName16(HWND16 hWnd, UINT16 wMsg,
|
||||
LPCSTR name, SEGPTR buf, INT16 buflen);
|
||||
HANDLE16 WINAPI WSAAsyncGetHostByAddr16(HWND16 hWnd, UINT16 wMsg, LPCSTR addr,
|
||||
INT16 len, INT16 type, SEGPTR buf, INT16 buflen);
|
||||
INT16 WINAPI WSACancelAsyncRequest16(HANDLE16 hAsyncTaskHandle);
|
||||
INT16 WINAPI WSAAsyncSelect16(SOCKET16 s, HWND16 hWnd, UINT16 wMsg, LONG lEvent);
|
||||
INT16 WINAPI WSARecvEx16(SOCKET16 s, char *buf, INT16 len, INT16 *flags);
|
||||
|
||||
#endif /* __WINE_WINE_WINSOCK16_H */
|
||||
|
|
Loading…
Reference in a new issue