wine/include/ldt.h
Alexandre Julliard 03468f7d4b Release 980215
Sun Feb 15 12:02:59 1998  Alexandre Julliard  <julliard@lrc.epfl.ch>

	* [graphics/x11drv/*.c] [objects/*.c]
	A few X11 critical section optimizations, mostly with XGet/PutPixel.

	* [scheduler/sysdeps.c] [misc/main.c]
	Make sure X11 critical section is available before any Xlib call.

	* [if1632/relay.c] [tools/build.c]
	Yet another attempt at fixing Catch/Throw.

	* [loader/pe_image.c]
	Fixed broken PE DLL loading.

	* [include/winnt.h] [scheduler/handle.c] [scheduler/*.c]
	Implemented handle access rights.
	Added Get/SetHandleInformation.

Sun Feb 15 09:45:23 1997  Andreas Mohr <100.30936@germany.net>

	* [misc/winsock.c]
	Fixed bug in WSACleanup which lead to crashes in WINSOCK_HandleIO.

	* [graphics/fontengine.c] [include/font.h]
	Minor improvements.

	* [memory/global.c]
	Implemented GlobalEntryHandle.

	* [misc/toolhelp.c]
	Fixed a memory bug in Notify*register.

	* [misc/w32scomb.c]
	Improved Get16DLLAddress.

	* [objects/gdiobj.c]
	Implemented GdiSeeGdiDo.


Sat Feb 14 14:57:39 1998  John Richardson <jrichard@zko.dec.com>

	* [win32/console.c]
	Added the console implementation, AllocConsole, FreeConsole,
	CONSOLE_InheritConsole.

	* [documentation/console]
	Some documentation on the console.

	* [include/winerror.h]
	Added some error defines.

	* [scheduler/k32obj.c]
	Registered the scheduler ops.

Fri Feb 13 19:35:35 1998  James Moody  <013263m@dragon.acadiau.ca>

	* [ole/ole2nls.c]
	Some English language fixes for missing values.

	* [controls/listbox.c]
	Fix to allow an empty listbox to deselect all items.

	* [relay32/user32.spec] [windows/keyboard.c]
	CreateAcceleratorTableA stub method.

	* [windows/sysmetrics.c]
	Added missing SM_CXCURSOR & SM_CYCURSOR initializers.

	* [windows/message.c]
	PostThreadMessage32A stub method.

Fri Feb 13 17:12:24 1998  Jim Peterson <jspeter@roanoke.infi.net>

	* [libtest/hello3res.rc] [libtest/hello3.c] [libtest/Makefile.in]
	Updated the 'hello3' test so that it functions properly again.

Fri Feb 13 14:08:07 1998  Martin Boehme  <boehme@informatik.mu-luebeck.de>
	
	* [graphics/mapping.c]
	Fixed the embarrassing bugs I introduced into DPtoLP and
	LPtoDP.

	* [windows/scroll.c]
	Prevent ScrollWindow32 from sending WM_ERASEBKGND.

Thu Feb 12 22:46:53 1998  Huw D M Davies <h.davies1@physics.oxford.ac.uk>

	* [objects/metafile] [include/ldt.h]
	Fix to cope with records longer than 64K.

	* [windows/clipboard.c]
	Clean up bitmaps and metapicts properly.

Mon Feb  3 21:52:18 1998  Karl Backström <karl_b@geocities.com>

	* [programs/winhelp/Sw.rc] [resources/sysres_Sw.rc]
	Minor update of Swedish language support.
1998-02-15 19:40:49 +00:00

82 lines
2.9 KiB
C

/*
* LDT copy
*
* Copyright 1995 Alexandre Julliard
*/
#ifndef __WINE_LDT_H
#define __WINE_LDT_H
#include "wintypes.h"
enum seg_type
{
SEGMENT_DATA = 0,
SEGMENT_STACK = 1,
SEGMENT_CODE = 2
};
/* This structure represents a real LDT entry. */
/* It is used by get_ldt_entry() and set_ldt_entry(). */
typedef struct
{
unsigned long base; /* base address */
unsigned long limit; /* segment limit (in pages or bytes) */
int seg_32bit; /* is segment 32-bit? */
int read_only; /* is segment read-only? */
int limit_in_pages; /* is the limit in pages or bytes? */
enum seg_type type; /* segment type */
} ldt_entry;
extern void LDT_BytesToEntry( const unsigned long *buffer, ldt_entry *content);
extern void LDT_EntryToBytes( unsigned long *buffer, const ldt_entry *content);
extern int LDT_GetEntry( int entry, ldt_entry *content );
extern int LDT_SetEntry( int entry, const ldt_entry *content );
extern void LDT_Print( int start, int length );
/* This structure is used to build the local copy of the LDT. */
typedef struct
{
unsigned long base; /* base address or 0 if entry is free */
unsigned long limit; /* limit in bytes or 0 if entry is free */
} ldt_copy_entry;
#define LDT_SIZE 8192
extern ldt_copy_entry ldt_copy[LDT_SIZE];
#define __AHSHIFT 3 /* don't change! */
#define __AHINCR (1 << __AHSHIFT)
#define SELECTOR_TO_ENTRY(sel) (((int)(sel) & 0xffff) >> __AHSHIFT)
#define ENTRY_TO_SELECTOR(i) ((i) ? (((int)(i) << __AHSHIFT) | 7) : 0)
#define IS_LDT_ENTRY_FREE(i) (!(ldt_flags_copy[(i)] & LDT_FLAGS_ALLOCATED))
#define IS_SELECTOR_FREE(sel) (IS_LDT_ENTRY_FREE(SELECTOR_TO_ENTRY(sel)))
#define GET_SEL_BASE(sel) (ldt_copy[SELECTOR_TO_ENTRY(sel)].base)
#define GET_SEL_LIMIT(sel) (ldt_copy[SELECTOR_TO_ENTRY(sel)].limit)
/* Convert a segmented ptr (16:16) to a linear (32) pointer */
#define PTR_SEG_OFF_TO_LIN(seg,off) \
((void*)(GET_SEL_BASE(seg) + (unsigned int)(off)))
#define PTR_SEG_TO_LIN(ptr) \
(__winelib ? (void*)(ptr) : PTR_SEG_OFF_TO_LIN(SELECTOROF(ptr),OFFSETOF(ptr)))
#define PTR_SEG_OFF_TO_SEGPTR(seg,off) \
(__winelib ? (SEGPTR)PTR_SEG_OFF_TO_LIN(seg,off) : (SEGPTR)MAKELONG(off,seg))
#define PTR_SEG_OFF_TO_HUGEPTR(seg,off) \
(PTR_SEG_OFF_TO_SEGPTR( (seg) + (HIWORD(off) << __AHSHIFT), LOWORD(off) ))
extern unsigned char ldt_flags_copy[LDT_SIZE];
#define LDT_FLAGS_TYPE 0x03 /* Mask for segment type */
#define LDT_FLAGS_READONLY 0x04 /* Segment is read-only (data) */
#define LDT_FLAGS_EXECONLY 0x04 /* Segment is execute-only (code) */
#define LDT_FLAGS_32BIT 0x08 /* Segment is 32-bit (code or stack) */
#define LDT_FLAGS_BIG 0x10 /* Segment is big (limit is in pages) */
#define LDT_FLAGS_ALLOCATED 0x80 /* Segment is allocated (no longer free) */
#define GET_SEL_FLAGS(sel) (ldt_flags_copy[SELECTOR_TO_ENTRY(sel)])
#endif /* __WINE_LDT_H */