2 * Basic type definitions for 16 bit variations on Windows types.
3 * These types are provided mostly to insure compatibility with
6 * Copyright (C) the Wine project
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #ifndef __WINE_WINDEF16_H
24 #define __WINE_WINDEF16_H
32 /* Standard data types */
34 typedef unsigned short BOOL16;
37 typedef UINT16 HANDLE16;
38 typedef HANDLE16 *LPHANDLE16;
40 typedef UINT16 WPARAM16;
41 typedef INT16 *LPINT16;
42 typedef UINT16 *LPUINT16;
44 typedef WORD CATCHBUF[9];
45 typedef WORD *LPCATCHBUF;
47 #define MAKESEGPTR(seg,off) ((SEGPTR)MAKELONG(off,seg))
48 #define SELECTOROF(ptr) (HIWORD(ptr))
49 #define OFFSETOF(ptr) (LOWORD(ptr))
51 typedef WORD *VA_LIST16;
53 #define __VA_ROUNDED16(type) \
54 ((sizeof(type) + sizeof(WORD) - 1) / sizeof(WORD) * sizeof(WORD))
55 #define VA_ARG16(list,type) \
56 (((list) = (VA_LIST16)((char *)(list) + __VA_ROUNDED16(type))), \
57 *((type *)(void *)((char *)(list) - __VA_ROUNDED16(type))))
59 #define HFILE_ERROR16 ((HFILE16)-1)
61 #define DECLARE_HANDLE16(a) \
62 typedef HANDLE16 a##16; \
63 typedef a##16 *P##a##16; \
64 typedef a##16 *NP##a##16; \
65 typedef a##16 *LP##a##16
67 DECLARE_HANDLE16(HACMDRIVERID);
68 DECLARE_HANDLE16(HACMDRIVER);
69 DECLARE_HANDLE16(HACMOBJ);
70 DECLARE_HANDLE16(HACMSTREAM);
71 DECLARE_HANDLE16(HMETAFILEPICT);
73 DECLARE_HANDLE16(HACCEL);
74 DECLARE_HANDLE16(HBITMAP);
75 DECLARE_HANDLE16(HBRUSH);
76 DECLARE_HANDLE16(HCOLORSPACE);
77 DECLARE_HANDLE16(HCURSOR);
78 DECLARE_HANDLE16(HDC);
79 DECLARE_HANDLE16(HDROP);
80 DECLARE_HANDLE16(HDRVR);
81 DECLARE_HANDLE16(HDWP);
82 DECLARE_HANDLE16(HENHMETAFILE);
83 DECLARE_HANDLE16(HFILE);
84 DECLARE_HANDLE16(HFONT);
85 DECLARE_HANDLE16(HICON);
86 DECLARE_HANDLE16(HINSTANCE);
87 DECLARE_HANDLE16(HKEY);
88 DECLARE_HANDLE16(HMENU);
89 DECLARE_HANDLE16(HMETAFILE);
90 DECLARE_HANDLE16(HMIDI);
91 DECLARE_HANDLE16(HMIDIIN);
92 DECLARE_HANDLE16(HMIDIOUT);
93 DECLARE_HANDLE16(HMIDISTRM);
94 DECLARE_HANDLE16(HMIXER);
95 DECLARE_HANDLE16(HMIXEROBJ);
96 DECLARE_HANDLE16(HMMIO);
97 DECLARE_HANDLE16(HPALETTE);
98 DECLARE_HANDLE16(HPEN);
99 DECLARE_HANDLE16(HQUEUE);
100 DECLARE_HANDLE16(HRGN);
101 DECLARE_HANDLE16(HRSRC);
102 DECLARE_HANDLE16(HTASK);
103 DECLARE_HANDLE16(HWAVE);
104 DECLARE_HANDLE16(HWAVEIN);
105 DECLARE_HANDLE16(HWAVEOUT);
106 DECLARE_HANDLE16(HWINSTA);
107 DECLARE_HANDLE16(HDESK);
108 DECLARE_HANDLE16(HWND);
109 DECLARE_HANDLE16(HKL);
110 DECLARE_HANDLE16(HIC);
111 DECLARE_HANDLE16(HRASCONN);
112 #undef DECLARE_HANDLE16
114 typedef HINSTANCE16 HMODULE16;
115 typedef HANDLE16 HGDIOBJ16;
116 typedef HANDLE16 HGLOBAL16;
117 typedef HANDLE16 HLOCAL16;
119 #include <pshpack1.h>
121 /* The SIZE structure */
127 } SIZE16, *PSIZE16, *LPSIZE16;
129 /* The POINT structure */
135 } POINT16, *PPOINT16, *LPPOINT16;
137 /* The RECT structure */
149 /* Callback function pointers types */
151 typedef LRESULT (CALLBACK *DRIVERPROC16)(DWORD,HDRVR16,UINT16,LPARAM,LPARAM);
152 typedef BOOL16 (CALLBACK *DLGPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
153 typedef INT16 (CALLBACK *EDITWORDBREAKPROC16)(LPSTR,INT16,INT16,INT16);
154 typedef LRESULT (CALLBACK *FARPROC16)();
155 typedef INT16 (CALLBACK *PROC16)();
156 typedef BOOL16 (CALLBACK *GRAYSTRINGPROC16)(HDC16,LPARAM,INT16);
157 typedef LRESULT (CALLBACK *HOOKPROC16)(INT16,WPARAM16,LPARAM);
158 typedef BOOL16 (CALLBACK *PROPENUMPROC16)(HWND16,SEGPTR,HANDLE16);
159 typedef VOID (CALLBACK *TIMERPROC16)(HWND16,UINT16,UINT16,DWORD);
160 typedef LRESULT (CALLBACK *WNDENUMPROC16)(HWND16,LPARAM);
161 typedef LRESULT (CALLBACK *WNDPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
163 #endif /* __WINE_WINDEF16_H */