Removed useless WINE_TRACE_ON tests.
[wine/multimedia.git] / include / wownt32.h
blob7de80f0cbcf0956f80ba8f88e687a5a1dee63f51
1 /*
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
21 #ifndef _WOWNT32_H_
22 #define _WOWNT32_H_
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);
39 typedef enum
41 WOW_TYPE_HWND,
42 WOW_TYPE_HMENU,
43 WOW_TYPE_HDWP,
44 WOW_TYPE_HDROP,
45 WOW_TYPE_HDC,
46 WOW_TYPE_HFONT,
47 WOW_TYPE_HMETAFILE,
48 WOW_TYPE_HRGN,
49 WOW_TYPE_HBITMAP,
50 WOW_TYPE_HBRUSH,
51 WOW_TYPE_HPALETTE,
52 WOW_TYPE_HPEN,
53 WOW_TYPE_HACCEL,
54 WOW_TYPE_HTASK,
55 WOW_TYPE_FULLHWND
57 } WOW_HANDLE_TYPE;
59 HANDLE WINAPI WOWHandle32(WORD,WOW_HANDLE_TYPE);
60 WORD WINAPI WOWHandle16(HANDLE,WOW_HANDLE_TYPE);
62 #ifdef __WINESRC__
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 DWORD WINAPI K32WOWCallback16(DWORD,DWORD);
67 BOOL WINAPI K32WOWCallback16Ex(DWORD,DWORD,DWORD,LPVOID,LPDWORD);
68 #define WOWHandle32 K32WOWHandle32
69 #define WOWHandle16 K32WOWHandle16
70 #define WOWCallback16 K32WOWCallback16
71 #define WOWCallback16Ex K32WOWCallback16Ex
72 #endif
74 #ifdef __WINESRC__
75 /* under Wine we use optimized versions where we can */
76 #define HWND_32(h16) ((HWND) (ULONG_PTR)(h16))
77 #define HMENU_32(h16) ((HMENU) (ULONG_PTR)(h16))
78 #define HDWP_32(h16) ((HDWP) (ULONG_PTR)(h16))
79 #define HDROP_32(h16) ((HDROP) (ULONG_PTR)(h16))
80 #define HDC_32(h16) ((HDC) (ULONG_PTR)(h16))
81 #define HFONT_32(h16) ((HFONT) (ULONG_PTR)(h16))
82 #define HRGN_32(h16) ((HRGN) (ULONG_PTR)(h16))
83 #define HBITMAP_32(h16) ((HBITMAP) (ULONG_PTR)(h16))
84 #define HBRUSH_32(h16) ((HBRUSH) (ULONG_PTR)(h16))
85 #define HPALETTE_32(h16) ((HPALETTE) (ULONG_PTR)(h16))
86 #define HPEN_32(h16) ((HPEN) (ULONG_PTR)(h16))
87 #define HACCEL_32(h16) ((HACCEL) (ULONG_PTR)(h16))
89 #define HWND_16(h32) (LOWORD(h32))
90 #define HMENU_16(h32) (LOWORD(h32))
91 #define HDWP_16(h32) (LOWORD(h32))
92 #define HDROP_16(h32) (LOWORD(h32))
93 #define HDC_16(h32) (LOWORD(h32))
94 #define HFONT_16(h32) (LOWORD(h32))
95 #define HRGN_16(h32) (LOWORD(h32))
96 #define HBITMAP_16(h32) (LOWORD(h32))
97 #define HBRUSH_16(h32) (LOWORD(h32))
98 #define HPALETTE_16(h32) (LOWORD(h32))
99 #define HPEN_16(h32) (LOWORD(h32))
100 #define HACCEL_16(h32) (LOWORD(h32))
102 #else /* __WINESRC__ */
104 #define HWND_32(h16) ((HWND) (WOWHandle32(h16, WOW_TYPE_HWND)))
105 #define HMENU_32(h16) ((HMENU) (WOWHandle32(h16, WOW_TYPE_HMENU)))
106 #define HDWP_32(h16) ((HDWP) (WOWHandle32(h16, WOW_TYPE_HDWP)))
107 #define HDROP_32(h16) ((HDROP) (WOWHandle32(h16, WOW_TYPE_HDROP)))
108 #define HDC_32(h16) ((HDC) (WOWHandle32(h16, WOW_TYPE_HDC)))
109 #define HFONT_32(h16) ((HFONT) (WOWHandle32(h16, WOW_TYPE_HFONT)))
110 #define HRGN_32(h16) ((HRGN) (WOWHandle32(h16, WOW_TYPE_HRGN)))
111 #define HBITMAP_32(h16) ((HBITMAP) (WOWHandle32(h16, WOW_TYPE_HBITMAP)))
112 #define HBRUSH_32(h16) ((HBRUSH) (WOWHandle32(h16, WOW_TYPE_HBRUSH)))
113 #define HPALETTE_32(h16) ((HPALETTE) (WOWHandle32(h16, WOW_TYPE_HPALETTE)))
114 #define HPEN_32(h16) ((HPEN) (WOWHandle32(h16, WOW_TYPE_HPEN)))
115 #define HACCEL_32(h16) ((HACCEL) (WOWHandle32(h16, WOW_TYPE_HACCEL)))
117 #define HWND_16(h32) (WOWHandle16(h32, WOW_TYPE_HWND))
118 #define HMENU_16(h32) (WOWHandle16(h32, WOW_TYPE_HMENU))
119 #define HDWP_16(h32) (WOWHandle16(h32, WOW_TYPE_HDWP))
120 #define HDROP_16(h32) (WOWHandle16(h32, WOW_TYPE_HDROP))
121 #define HDC_16(h32) (WOWHandle16(h32, WOW_TYPE_HDC))
122 #define HFONT_16(h32) (WOWHandle16(h32, WOW_TYPE_HFONT))
123 #define HRGN_16(h32) (WOWHandle16(h32, WOW_TYPE_HRGN))
124 #define HBITMAP_16(h32) (WOWHandle16(h32, WOW_TYPE_HBITMAP))
125 #define HBRUSH_16(h32) (WOWHandle16(h32, WOW_TYPE_HBRUSH))
126 #define HPALETTE_16(h32) (WOWHandle16(h32, WOW_TYPE_HPALETTE))
127 #define HPEN_16(h32) (WOWHandle16(h32, WOW_TYPE_HPEN))
128 #define HACCEL_16(h32) (WOWHandle16(h32, WOW_TYPE_HACCEL))
130 #endif /* __WINESRC__ */
132 #define HMETAFILE_32(h16) ((HMETAFILE)(WOWHandle32(h16, WOW_TYPE_HMETAFILE)))
133 #define HTASK_32(h16) ((DWORD)(WOWHandle32(h16, WOW_TYPE_HTASK)))
134 #define FULLHWND_32(h16) ((HWND)(WOWHandle32(h16, WOW_TYPE_FULLHWND)))
136 #define HMETAFILE_16(h32) (WOWHandle16(h32, WOW_TYPE_HMETAFILE))
137 #define HTASK_16(h32) (WOWHandle16((HANDLE)(h32), WOW_TYPE_HTASK))
139 #define WCB16_PASCAL 0
140 #define WCB16_CDECL 1
141 #define WCB16_MAX_CBARGS 16
143 /* Wine extensions: call register function, context ptr is passed in the return value LPDWORD */
144 #define WCB16_REGS 2
145 #define WCB16_REGS_LONG 4 /* function uses 32-bit lret */
147 DWORD WINAPI WOWCallback16(DWORD,DWORD);
148 BOOL WINAPI WOWCallback16Ex(DWORD,DWORD,DWORD,LPVOID,LPDWORD);
150 #endif /* _WOWNT32_H_ */