[AMSTREAM] Sync with Wine Staging 3.9. CORE-14656
[reactos.git] / dll / directx / ddraw / ddraw_structures.txt
1 DirectDraw Object struct
2
3 DDRAWI_DIRECTDRAW_INT
4 it is the the return pointer from ddraw.dll to the program
5
6 DDRAWI_DIRECTDRAW_LCL
7 It is the program own private data
8
9 DDRAWI_DIRECTDRAW_GBL
10 This struct is gboal for whole ddraw.dll for all program
11 it is static in ddraw if it change it change for all
12 program
13
14 The struct
15
16 from http://msdn2.microsoft.com/en-us/library/ms898267.aspx
17 it was not document for windows 2000/xp/2003 but ms did document it
18 for windows ce 5.0 the link are to windows ce 5.0 arch
19
20 typedef struct _DDRAWI_DIRECTDRAW_INT {
21 LPVOID lpVtbl;
22 LPDDRAWI_DIRECTDRAW_LCL lpLcl;
23 LPDDRAWI_DIRECTDRAW_INT lpLink;
24 DWORD dwIntRefCnt;
25 } DDRAWI_DIRECTDRAW_INT;
26
27 Rest of the struct are from msdn for windows 2000/xp/2003
28 typedef struct _DDRAWI_DIRECTDRAW_LCL {
29 DWORD lpDDMore;
30 LPDDRAWI_DIRECTDRAW_GBL lpGbl; // fill it from function Create_DirectDraw with static pointer ddgbl
31 DWORD dwUnused0;
32 DWORD dwLocalFlags;
33 DWORD dwLocalRefCnt;
34 DWORD dwProcessId;
35 IUnknown FAR *pUnkOuter;
36 DWORD dwObsolete1;
37 ULONG_PTR hWnd;
38 ULONG_PTR hDC; // create HDC and save it to this pointer
39 DWORD dwErrorMode;
40 LPDDRAWI_DDRAWSURFACE_INT lpPrimary; // The primary surface
41 LPDDRAWI_DDRAWSURFACE_INT lpCB;
42 DWORD dwPreferredMode;
43 HINSTANCE hD3DInstance;
44 IUnknown FAR *pD3DIUnknown;
45 LPDDHAL_CALLBACKS lpDDCB; // same memory pointer as DDRAWI_DIRECTDRAW_GBL->lpDDCBtmp, setup by function StartDirectDraw
46 ULONG_PTR hDDVxd;
47 DWORD dwAppHackFlags;
48 ULONG_PTR hFocusWnd;
49 DWORD dwHotTracking;
50 DWORD dwIMEState;
51 ULONG_PTR hWndPopup;
52 ULONG_PTR hDD; // from Gdientry1 copy the _DDRAWI_DIRECTDRAW_GBL hDD after startup then copy this back each time we need hDD
53 ULONG_PTR hGammaCalibrator;
54 LPDDGAMMACALIBRATORPROC lpGammaCalibrator;
55 } DDRAWI_DIRECTDRAW_LCL;
56
57 typedef struct _DDRAWI_DIRECTDRAW_GBL {
58 DWORD dwRefCnt;
59 DWORD dwFlags;
60 FLATPTR fpPrimaryOrig;
61 DDCORECAPS ddCaps;
62 DWORD dwInternal1;
63 DWORD dwUnused1[9];
64 LPDDHAL_CALLBACKS lpDDCBtmp;
65 LPDDRAWI_DDRAWSURFACE_INT dsList; // list of all created directdraw surface, it is a pointer list
66 LPDDRAWI_DDRAWPALETTE_INT palList;
67 LPDDRAWI_DDRAWCLIPPER_INT clipperList;
68 LPDDRAWI_DIRECTDRAW_GBL lp16DD; // pointer to it self (DDRAWI_DIRECTDRAW_GBL)
69 DWORD dwMaxOverlays;
70 DWORD dwCurrOverlays;
71 DWORD dwMonitorFrequency; // current monitor freq, (nvidia always set this to 0, it is a bug in nvidia drv)
72 DDCORECAPS ddHELCaps;
73 DWORD dwUnused2[50];
74 DDCOLORKEY ddckCKDestOverlay;
75 DDCOLORKEY ddckCKSrcOverlay;
76 VIDMEMINFO vmiData;
77 LPVOID lpDriverHandle;
78 LPDDRAWI_DIRECTDRAW_LCL lpExclusiveOwner; // which local directdraw comobject is in Exclusive mode and own this
79 DWORD dwModeIndex;
80 DWORD dwModeIndexOrig;
81 DWORD dwNumFourCC;
82 DWORD FAR *lpdwFourCC;
83 DWORD dwNumModes;
84 LPDDHALMODEINFO lpModeInfo;
85 PROCESS_LIST plProcessList;
86 DWORD dwSurfaceLockCount;
87 DWORD dwAliasedLockCnt;
88 ULONG_PTR dwReserved3;
89 ULONG_PTR hDD; // GdiEntry1 are filling this pointer
90 char cObsolete[12];
91 DWORD dwReserved1;
92 DWORD dwReserved2;
93 DBLNODE dbnOverlayRoot;
94 volatile LPWORD lpwPDeviceFlags;
95 DWORD dwPDevice;
96 DWORD dwWin16LockCnt;
97 DWORD dwUnused3;
98 DWORD hInstance;
99 DWORD dwEvent16;
100 DWORD dwSaveNumModes;
101 ULONG_PTR lpD3DGlobalDriverData;
102 ULONG_PTR lpD3DHALCallbacks;
103 DDCORECAPS ddBothCaps;
104 LPDDVIDEOPORTCAPS lpDDVideoPortCaps;
105 LPDDRAWI_DDVIDEOPORT_INT dvpList;
106 ULONG_PTR lpD3DHALCallbacks2;
107 RECT rectDevice;
108 DWORD cMonitors;
109 LPVOID gpbmiSrc;
110 LPVOID gpbmiDest;
111 LPHEAPALIASINFO phaiHeapAliases;
112 ULONG_PTR hKernelHandle;
113 ULONG_PTR pfnNotifyProc;
114 LPDDKERNELCAPS lpDDKernelCaps;
115 LPDDNONLOCALVIDMEMCAPS lpddNLVCaps;
116 LPDDNONLOCALVIDMEMCAPS lpddNLVHELCaps;
117 LPDDNONLOCALVIDMEMCAPS lpddNLVBothCaps;
118 ULONG_PTR lpD3DExtendedCaps;
119 DWORD dwDOSBoxEvent;
120 RECT rectDesktop;
121 char cDriverName[MAX_DRIVER_NAME]; // driver name, if we send in CreateDirectDraw(NULL, ...) this will be fill in the name "display"
122 ULONG_PTR lpD3DHALCallbacks3;
123 DWORD dwNumZPixelFormats;
124 LPDDPIXELFORMAT lpZPixelFormats;
125 LPDDRAWI_DDMOTIONCOMP_INT mcList;
126 DWORD hDDVxd;
127 DDSCAPSEX ddsCapsMore;
128 } DDRAWI_DIRECTDRAW_GBL;
129
130 Clipper Object struct
131 DDRAWI_DDRAWCLIPPER_INT
132 It is the the return pointer from ddraw.dll to the program
133
134 DDRAWI_DDRAWCLIPPER_LCL
135 It is the program own private data
136
137 DDRAWI_DDRAWCLIPPER_GBL
138 This struct is gboal for whole ddraw.dll for all program
139 it is static in ddraw if it change it change for all
140 program
141
142 The struct
143
144 typedef struct _DDRAWI_DDRAWCLIPPER_INT {
145 LPVOID lpVtbl;
146 LPDDRAWI_DDRAWCLIPPER_LCL lpLcl;
147 LPDDRAWI_DDRAWCLIPPER_INT lpLink;
148 DWORD dwIntRefCnt;
149 } DDRAWI_DDRAWCLIPPER_INT;
150
151 typedef struct _DDRAWI_DDRAWCLIPPER_LCL {
152 DWORD lpClipMore;
153 LPDDRAWI_DDRAWCLIPPER_GBL lpGbl;
154 LPDDRAWI_DIRECTDRAW_LCL lpDD_lcl;
155 DWORD dwLocalRefCnt;
156 IUnknown FAR *pUnkOuter;
157 LPDDRAWI_DIRECTDRAW_INT lpDD_int;
158 ULONG_PTR dwReserved1;
159 IUnknown *pAddrefedThisOwner;
160 } DDRAWI_DDRAWCLIPPER_LCL;
161
162
163 typedef struct _DDRAWI_DDRAWCLIPPER_GBL {
164 DWORD dwRefCnt;
165 DWORD dwFlags;
166 LPDDRAWI_DIRECTDRAW_GBL lpDD;
167 DWORD dwProcessId;
168 ULONG_PTR dwReserved1;
169 ULONG_PTR hWnd;
170 LPRGNDATA lpStaticClipList;
171 } DDRAWI_DDRAWCLIPPER_GBL;
172
173 typedef struct _DDRAWI_DDRAWPALETTE_INT {
174 LPVOID lpVtbl;
175 LPDDRAWI_DDRAWPALETTE_LCL lpLcl;
176 LPDDRAWI_DDRAWPALETTE_INT lpLink;
177 DWORD dwIntRefCnt;
178 } DDRAWI_DDRAWPALETTE_INT;
179
180 typedef struct _DDRAWI_DDRAWPALETTE_LCL {
181 DWORD lpPalMore;
182 LPDDRAWI_DDRAWPALETTE_GBL lpGbl;
183 ULONG_PTR dwUnused0;
184 DWORD dwLocalRefCnt;
185 IUnknown FAR *pUnkOuter;
186 LPDDRAWI_DIRECTDRAW_LCL lpDD_lcl;
187 ULONG_PTR dwReserved1;
188 ULONG_PTR dwDDRAWReserved1;
189 ULONG_PTR dwDDRAWReserved2;
190 ULONG_PTR dwDDRAWReserved3;
191 } DDRAWI_DDRAWPALETTE_LCL;
192
193 typedef struct _DDRAWI_DDRAWPALETTE_GBL {
194 DWORD dwRefCnt;
195 DWORD dwFlags;
196 LPDDRAWI_DIRECTDRAW_LCL lpDD_lcl;
197 DWORD dwProcessId;
198 LPPALETTEENTRY lpColorTable;
199 union {
200 ULONG_PTR dwReserved1;
201 HPALETTE hHELGDIPalette;
202 };
203 DWORD dwDriverReserved;
204 DWORD dwContentsStamp;
205 DWORD dwSaveStamp;
206 DWORD dwHandle;
207 } DDRAWI_DDRAWPALETTE_GBL;
208
209
210 typedef struct _DDRAWI_DDVIDEOPORT_INT {
211 LPVOID lpVtbl;
212 LPDDRAWI_DDVIDEOPORT_LCL lpLcl;
213 LPDDRAWI_DDVIDEOPORT_INT lpLink;
214 DWORD dwIntRefCnt;
215 DWORD dwFlags;
216 } DDRAWI_DDVIDEOPORT_INT;
217
218 typedef struct _DDRAWI_DDVIDEOPORT_LCL {
219 LPDDRAWI_DIRECTDRAW_LCL lpDD;
220 DDVIDEOPORTDESC ddvpDesc;
221 DDVIDEOPORTINFO ddvpInfo;
222 LPDDRAWI_DDRAWSURFACE_INT lpSurface;
223 LPDDRAWI_DDRAWSURFACE_INT lpVBISurface;
224 LPDDRAWI_DDRAWSURFACE_INT *lpFlipInts;
225 DWORD dwNumAutoflip;
226 DWORD dwProcessID;
227 DWORD dwStateFlags;
228 DWORD dwFlags;
229 DWORD dwRefCnt;
230 FLATPTR fpLastFlip;
231 ULONG_PTR dwReserved1;
232 ULONG_PTR dwReserved2;
233 HANDLE hDDVideoPort;
234 DWORD dwNumVBIAutoflip;
235 LPDDVIDEOPORTDESC lpVBIDesc;
236 LPDDVIDEOPORTDESC lpVideoDesc;
237 LPDDVIDEOPORTINFO lpVBIInfo;
238 LPDDVIDEOPORTINFO lpVideoInfo;
239 DWORD dwVBIProcessID;
240 } DDRAWI_DDVIDEOPORT_LCL;
241
242
243 Surface:
244
245 typedef struct _DDRAWI_DDRAWSURFACE_GBL {
246 DWORD dwRefCnt;
247 DWORD dwGlobalFlags;
248 union {
249 LPACCESSRECTLIST lpRectList;
250 DWORD dwBlockSizeY;
251 };
252 union {
253 LPVMEMHEAP lpVidMemHeap;
254 DWORD dwBlockSizeX;
255 };
256 union {
257 LPDDRAWI_DIRECTDRAW_GBL lpDD;
258 LPVOID lpDDHandle;
259 };
260 FLATPTR fpVidMem;
261 union {
262 LONG lPitch;
263 DWORD dwLinearSize;
264 };
265 WORD wHeight;
266 WORD wWidth;
267 DWORD dwUsageCount;
268 ULONG_PTR dwReserved1;
269 DDPIXELFORMAT ddpfSurface;
270 } DDRAWI_DDRAWSURFACE_GBL;
271
272 The following informations might be incorrectly
273 I am using logic thinking since the info does
274 not exists in MSDN so I am drawing clue how
275 previews stuffs works that are document in MSDN/DDK
276
277 follow struct should exists ???
278 DDRAWI_DDVIDEOPORT_GBL
279 DDRAWI_DDGAMMACONTROL_INT
280 DDRAWI_DDGAMMACONTROL_LCL
281 DDRAWI_DDGAMMACONTROL_GBL
282 DDRAWI_DDCOLORCONTROL_INT
283 DDRAWI_DDCOLORCONTROL_LCL
284 DDRAWI_DDCOLORCONTROL_GBL
285 DDRAWI_KERNEL_INT
286 DDRAWI_KERNEL_LCL
287 DDRAWI_KERNEL_GBL
288 DDRAWI_DDKERNELSURFACE_INT
289 DDRAWI_DDKERNELSURFACE_LCL
290 DDRAWI_DDKERNELSURFACE_GBL
291
292 follow struct can be easy create
293 DDRAWI_DDGAMMACONTROL_INT
294 DDRAWI_DDCOLORCONTROL_INT
295 DDRAWI_KERNEL_INT
296
297 the DDRAWI_DDGAMMACONTROL_INT should looking like this
298 typedef struct _DDRAWI_DDGAMMACONTROL_INT
299 {
300 LPVOID lpVtbl;
301 LPDDRAWI_DDGAMMACONTROL_LCL lpLcl;
302 LPDDRAWI_DDGAMMACONTROL_INT lpLink;
303 DWORD dwIntRefCnt;
304 } DDRAWI_DDGAMMACONTROL_INT, *LPDDRAWI_DDGAMMACONTROL_INT
305
306 how did I got this struct I looked at all other INT struct how they where
307 build. But it is not 100% sure this one is right untill I/we known how
308 the DDRAWI_DDGAMMACONTROL_LCL works and DDRAWI_DDCOLORCONTROL_GBL
309 our internal struct will look like this
310
311 typedef struct _DDRAWI_DDGAMMACONTROL_INT
312 {
313 LPVOID lpVtbl;
314 LPVOID lpLcl;
315 LPVOID lpLink;
316 DWORD dwIntRefCnt;
317 } DDRAWI_DDGAMMACONTROL_INT, *LPDDRAWI_DDGAMMACONTROL_INT
318
319 same goes for DDRAWI_DDCOLORCONTROL_INT
320
321 typedef struct DDRAWI_DDCOLORCONTROL_INT
322 {
323 LPVOID lpVtbl;
324 LPVOID lpLcl;
325 LPVOID lpLink;
326 DWORD dwIntRefCnt;
327 } DDRAWI_DDCOLORCONTROL_INT, *LPDDRAWI_DDCOLORCONTROL_INT
328
329
330
331
332
333
334
335