2 * WOW Generic Thunk API
4 * Copyright (C) 1999 Ulrich Weigand
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 LPVOID WINAPI WOWGetVDMPointer(DWORD,DWORD,BOOL);
25 LPVOID WINAPI WOWGetVDMPointerFix(DWORD,DWORD,BOOL);
26 VOID WINAPI WOWGetVDMPointerUnfix(DWORD);
28 WORD WINAPI WOWGlobalAlloc16(WORD,DWORD);
29 WORD WINAPI WOWGlobalFree16(WORD);
30 DWORD WINAPI WOWGlobalLock16(WORD);
31 BOOL WINAPI WOWGlobalUnlock16(WORD);
32 DWORD WINAPI WOWGlobalAllocLock16(WORD,DWORD,WORD *);
33 WORD WINAPI WOWGlobalUnlockFree16(DWORD);
34 DWORD WINAPI WOWGlobalLockSize16(WORD,PDWORD);
36 VOID WINAPI WOWYield16(VOID);
37 VOID WINAPI WOWDirectedYield16(WORD);
59 HANDLE WINAPI WOWHandle32(WORD,WOW_HANDLE_TYPE);
60 WORD WINAPI WOWHandle16(HANDLE,WOW_HANDLE_TYPE);
63 /* under Wine use the kernel functions directly so we don't have to import wow32 */
64 HANDLE WINAPI K32WOWHandle32(WORD,WOW_HANDLE_TYPE);
65 WORD WINAPI K32WOWHandle16(HANDLE,WOW_HANDLE_TYPE);
66 #define WOWHandle32 K32WOWHandle32
67 #define WOWHandle16 K32WOWHandle16
71 /* under Wine we use optimized versions where we can */
72 #define HWND_32(h16) ((HWND) (ULONG_PTR)(h16))
73 #define HMENU_32(h16) ((HMENU) (ULONG_PTR)(h16))
74 #define HDWP_32(h16) ((HDWP) (ULONG_PTR)(h16))
75 #define HDROP_32(h16) ((HDROP) (ULONG_PTR)(h16))
76 #define HDC_32(h16) ((HDC) (ULONG_PTR)(h16))
77 #define HFONT_32(h16) ((HFONT) (ULONG_PTR)(h16))
78 #define HRGN_32(h16) ((HRGN) (ULONG_PTR)(h16))
79 #define HBITMAP_32(h16) ((HBITMAP) (ULONG_PTR)(h16))
80 #define HBRUSH_32(h16) ((HBRUSH) (ULONG_PTR)(h16))
81 #define HPALETTE_32(h16) ((HPALETTE) (ULONG_PTR)(h16))
82 #define HPEN_32(h16) ((HPEN) (ULONG_PTR)(h16))
83 #define HACCEL_32(h16) ((HACCEL) (ULONG_PTR)(h16))
85 #define HWND_16(h32) (LOWORD(h32))
86 #define HMENU_16(h32) (LOWORD(h32))
87 #define HDWP_16(h32) (LOWORD(h32))
88 #define HDROP_16(h32) (LOWORD(h32))
89 #define HDC_16(h32) (LOWORD(h32))
90 #define HFONT_16(h32) (LOWORD(h32))
91 #define HRGN_16(h32) (LOWORD(h32))
92 #define HBITMAP_16(h32) (LOWORD(h32))
93 #define HBRUSH_16(h32) (LOWORD(h32))
94 #define HPALETTE_16(h32) (LOWORD(h32))
95 #define HPEN_16(h32) (LOWORD(h32))
96 #define HACCEL_16(h32) (LOWORD(h32))
98 #else /* __WINESRC__ */
100 #define HWND_32(h16) ((HWND) (WOWHandle32(h16, WOW_TYPE_HWND)))
101 #define HMENU_32(h16) ((HMENU) (WOWHandle32(h16, WOW_TYPE_HMENU)))
102 #define HDWP_32(h16) ((HDWP) (WOWHandle32(h16, WOW_TYPE_HDWP)))
103 #define HDROP_32(h16) ((HDROP) (WOWHandle32(h16, WOW_TYPE_HDROP)))
104 #define HDC_32(h16) ((HDC) (WOWHandle32(h16, WOW_TYPE_HDC)))
105 #define HFONT_32(h16) ((HFONT) (WOWHandle32(h16, WOW_TYPE_HFONT)))
106 #define HRGN_32(h16) ((HRGN) (WOWHandle32(h16, WOW_TYPE_HRGN)))
107 #define HBITMAP_32(h16) ((HBITMAP) (WOWHandle32(h16, WOW_TYPE_HBITMAP)))
108 #define HBRUSH_32(h16) ((HBRUSH) (WOWHandle32(h16, WOW_TYPE_HBRUSH)))
109 #define HPALETTE_32(h16) ((HPALETTE) (WOWHandle32(h16, WOW_TYPE_HPALETTE)))
110 #define HPEN_32(h16) ((HPEN) (WOWHandle32(h16, WOW_TYPE_HPEN)))
111 #define HACCEL_32(h16) ((HACCEL) (WOWHandle32(h16, WOW_TYPE_HACCEL)))
113 #define HWND_16(h32) (WOWHandle16(h32, WOW_TYPE_HWND))
114 #define HMENU_16(h32) (WOWHandle16(h32, WOW_TYPE_HMENU))
115 #define HDWP_16(h32) (WOWHandle16(h32, WOW_TYPE_HDWP))
116 #define HDROP_16(h32) (WOWHandle16(h32, WOW_TYPE_HDROP))
117 #define HDC_16(h32) (WOWHandle16(h32, WOW_TYPE_HDC))
118 #define HFONT_16(h32) (WOWHandle16(h32, WOW_TYPE_HFONT))
119 #define HRGN_16(h32) (WOWHandle16(h32, WOW_TYPE_HRGN))
120 #define HBITMAP_16(h32) (WOWHandle16(h32, WOW_TYPE_HBITMAP))
121 #define HBRUSH_16(h32) (WOWHandle16(h32, WOW_TYPE_HBRUSH))
122 #define HPALETTE_16(h32) (WOWHandle16(h32, WOW_TYPE_HPALETTE))
123 #define HPEN_16(h32) (WOWHandle16(h32, WOW_TYPE_HPEN))
124 #define HACCEL_16(h32) (WOWHandle16(h32, WOW_TYPE_HACCEL))
126 #endif /* __WINESRC__ */
128 #define HMETAFILE_32(h16) ((HMETAFILE)(WOWHandle32(h16, WOW_TYPE_HMETAFILE)))
129 #define HTASK_32(h16) ((DWORD)(WOWHandle32(h16, WOW_TYPE_HTASK)))
130 #define FULLHWND_32(h16) ((HWND)(WOWHandle32(h16, WOW_TYPE_FULLHWND)))
132 #define HMETAFILE_16(h32) (WOWHandle16(h32, WOW_TYPE_HMETAFILE))
133 #define HTASK_16(h32) (WOWHandle16((HANDLE)(h32), WOW_TYPE_HTASK))
135 #define WCB16_PASCAL 0
136 #define WCB16_CDECL 1
137 #define WCB16_MAX_CBARGS 16
139 DWORD WINAPI WOWCallback16(DWORD,DWORD);
140 BOOL WINAPI WOWCallback16Ex(DWORD,DWORD,DWORD,LPVOID,LPDWORD);
142 #endif /* _WOWNT32_H_ */