Release 960414
[wine.git] / win32 / struct32.c
blob4a70c17096a6900e955c436e647ec16d2e367c5a
1 /*
2 * Win32 structure conversion functions
4 * Copyright 1996 Martin von Loewis
5 */
7 #include <stdio.h>
8 #include "windows.h"
9 #include "winerror.h"
10 #include "struct32.h"
11 #include "stddebug.h"
12 #include "debug.h"
14 void STRUCT32_POINT32to16(const POINT32* p32,POINT* p16)
16 p16->x = p32->x;
17 p16->y = p32->y;
20 void STRUCT32_POINT16to32(const POINT* p16,POINT32* p32)
22 p32->x = p16->x;
23 p32->y = p16->y;
26 void STRUCT32_SIZE16to32(const SIZE* p16, SIZE32* p32)
29 p32->cx = p16->cx;
30 p32->cy = p16->cy;
33 void STRUCT32_MSG16to32(MSG *msg16,MSG32 *msg32)
35 msg32->hwnd=(DWORD)msg16->hwnd;
36 msg32->message=msg16->message;
37 msg32->wParam=msg16->wParam;
38 msg32->lParam=msg16->lParam;
39 msg32->time=msg16->time;
40 msg32->pt.x=msg16->pt.x;
41 msg32->pt.y=msg16->pt.y;
44 void STRUCT32_MSG32to16(MSG32 *msg32,MSG *msg16)
46 msg16->hwnd=(HWND)msg32->hwnd;
47 msg16->message=msg32->message;
48 msg16->wParam=msg32->wParam;
49 msg16->lParam=msg32->lParam;
50 msg16->time=msg32->time;
51 msg16->pt.x=msg32->pt.x;
52 msg16->pt.y=msg32->pt.y;
55 void STRUCT32_RECT32to16(const RECT32* r32,RECT *r16)
57 r16->left = r32->left;
58 r16->right = r32->right;
59 r16->top = r32->top;
60 r16->bottom = r32->bottom;
63 void STRUCT32_RECT16to32(const RECT* r16,RECT32 *r32)
65 r32->left = r16->left;
66 r32->right = r16->right;
67 r32->top = r16->top;
68 r32->bottom = r16->bottom;
71 void STRUCT32_MINMAXINFO32to16(const MINMAXINFO32 *from,MINMAXINFO *to)
73 STRUCT32_POINT32to16(&from->ptReserved,&to->ptReserved);
74 STRUCT32_POINT32to16(&from->ptMaxSize,&to->ptMaxSize);
75 STRUCT32_POINT32to16(&from->ptMaxPosition,&to->ptMaxPosition);
76 STRUCT32_POINT32to16(&from->ptMinTrackSize,&to->ptMinTrackSize);
77 STRUCT32_POINT32to16(&from->ptMaxTrackSize,&to->ptMaxTrackSize);
80 void STRUCT32_MINMAXINFO16to32(const MINMAXINFO *from,MINMAXINFO32 *to)
82 STRUCT32_POINT16to32(&from->ptReserved,&to->ptReserved);
83 STRUCT32_POINT16to32(&from->ptMaxSize,&to->ptMaxSize);
84 STRUCT32_POINT16to32(&from->ptMaxPosition,&to->ptMaxPosition);
85 STRUCT32_POINT16to32(&from->ptMinTrackSize,&to->ptMinTrackSize);
86 STRUCT32_POINT16to32(&from->ptMaxTrackSize,&to->ptMaxTrackSize);
89 void STRUCT32_WINDOWPOS32to16(const WINDOWPOS32* from,WINDOWPOS* to)
91 to->hwnd=from->hwnd;
92 to->hwndInsertAfter=from->hwndInsertAfter;
93 to->x=from->x;
94 to->y=from->y;
95 to->cx=from->cx;
96 to->flags=from->flags;
99 void STRUCT32_WINDOWPOS16to32(const WINDOWPOS* from,WINDOWPOS32* to)
101 to->hwnd=from->hwnd;
102 to->hwndInsertAfter=from->hwndInsertAfter;
103 to->x=from->x;
104 to->y=from->y;
105 to->cx=from->cx;
106 to->flags=from->flags;
109 void STRUCT32_NCCALCSIZE32to16Flat(const NCCALCSIZE_PARAMS32* from,
110 NCCALCSIZE_PARAMS* to)
112 STRUCT32_RECT32to16(from->rgrc,to->rgrc);
113 STRUCT32_RECT32to16(from->rgrc+1,to->rgrc+1);
114 STRUCT32_RECT32to16(from->rgrc+2,to->rgrc+2);
117 void STRUCT32_NCCALCSIZE16to32Flat(const NCCALCSIZE_PARAMS* from,
118 NCCALCSIZE_PARAMS32* to)
120 STRUCT32_RECT16to32(from->rgrc,to->rgrc);
121 STRUCT32_RECT16to32(from->rgrc+1,to->rgrc+1);
122 STRUCT32_RECT16to32(from->rgrc+2,to->rgrc+2);
125 /* The strings are not copied */
126 void STRUCT32_CREATESTRUCT32to16(const CREATESTRUCT32* from,CREATESTRUCT* to)
128 to->lpCreateParams = (LPVOID)from->lpCreateParams;
129 to->hInstance = from->hInstance;
130 to->hMenu = from->hMenu;
131 to->hwndParent = from->hwndParent;
132 to->cy = from->cy;
133 to->cx = from->cx;
134 to->y = from->y;
135 to->style = from->style;
136 to->dwExStyle = from->dwExStyle;
139 void STRUCT32_CREATESTRUCT16to32(const CREATESTRUCT* from,CREATESTRUCT32 *to)
141 to->lpCreateParams = (DWORD)from->lpCreateParams;
142 to->hInstance = from->hInstance;
143 to->hMenu = from->hMenu;
144 to->hwndParent = from->hwndParent;
145 to->cy = from->cy;
146 to->cx = from->cx;
147 to->y = from->y;
148 to->style = from->style;
149 to->dwExStyle = from->dwExStyle;