4 * Copyright 1995 Alexandre Julliard
7 #ifndef __WINE_SELECTORS_H
8 #define __WINE_SELECTORS_H
11 #include "wine/library.h"
13 extern WORD
SELECTOR_AllocBlock( const void *base
, DWORD size
, unsigned char flags
);
14 extern WORD
SELECTOR_ReallocBlock( WORD sel
, const void *base
, DWORD size
);
15 extern void SELECTOR_FreeBlock( WORD sel
);
17 extern UINT W32S_offset
;
19 #define W32S_APP2WINE(addr) ((addr)? (DWORD)(addr) + W32S_offset : 0)
20 #define W32S_WINE2APP(addr) ((addr)? (DWORD)(addr) - W32S_offset : 0)
22 #define FIRST_LDT_ENTRY_TO_ALLOC 17
24 #define IS_SELECTOR_FREE(sel) (!(wine_ldt_copy.flags[LOWORD(sel) >> 3] & WINE_LDT_FLAGS_ALLOCATED))
26 /* Determine if sel is a system selector (i.e. not managed by Wine) */
27 #define IS_SELECTOR_SYSTEM(sel) \
28 (!((sel) & 4) || ((LOWORD(sel) >> 3) < FIRST_LDT_ENTRY_TO_ALLOC))
29 #define IS_SELECTOR_32BIT(sel) \
30 (IS_SELECTOR_SYSTEM(sel) || (wine_ldt_copy.flags[LOWORD(sel) >> 3] & WINE_LDT_FLAGS_32BIT))
32 #endif /* __WINE_SELECTORS_H */