comctl32/listview: Implement overlay image support.
[wine] / dlls / d3drm / texture.c
1 /*
2  * Implementation of IDirect3DRMTextureX interfaces
3  *
4  * Copyright 2012 Christian Costa
5  *
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.
10  *
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.
15  *
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20
21 #include "wine/debug.h"
22
23 #define COBJMACROS
24
25 #include "winbase.h"
26 #include "wingdi.h"
27
28 #include "d3drm_private.h"
29
30 WINE_DEFAULT_DEBUG_CHANNEL(d3drm);
31
32 typedef struct {
33     IDirect3DRMTexture2 IDirect3DRMTexture2_iface;
34     IDirect3DRMTexture3 IDirect3DRMTexture3_iface;
35     LONG ref;
36     DWORD app_data;
37 } IDirect3DRMTextureImpl;
38
39 static inline IDirect3DRMTextureImpl *impl_from_IDirect3DRMTexture2(IDirect3DRMTexture2 *iface)
40 {
41     return CONTAINING_RECORD(iface, IDirect3DRMTextureImpl, IDirect3DRMTexture2_iface);
42 }
43
44 static inline IDirect3DRMTextureImpl *impl_from_IDirect3DRMTexture3(IDirect3DRMTexture3 *iface)
45 {
46     return CONTAINING_RECORD(iface, IDirect3DRMTextureImpl, IDirect3DRMTexture3_iface);
47 }
48
49 /*** IUnknown methods ***/
50 static HRESULT WINAPI IDirect3DRMTexture2Impl_QueryInterface(IDirect3DRMTexture2* iface,
51                                                              REFIID riid, void** object)
52 {
53     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
54
55     TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), object);
56
57     *object = NULL;
58
59     if (IsEqualGUID(riid, &IID_IUnknown) ||
60         IsEqualGUID(riid, &IID_IDirect3DRMTexture) ||
61         IsEqualGUID(riid, &IID_IDirect3DRMTexture2))
62     {
63         *object = &This->IDirect3DRMTexture2_iface;
64     }
65     else if (IsEqualGUID(riid, &IID_IDirect3DRMTexture3))
66     {
67         *object = &This->IDirect3DRMTexture3_iface;
68     }
69     else
70     {
71         FIXME("Interface %s not implemented\n", debugstr_guid(riid));
72         return E_NOINTERFACE;
73     }
74
75     IDirect3DRMTexture3_AddRef(iface);
76
77     return S_OK;
78 }
79
80 static ULONG WINAPI IDirect3DRMTexture2Impl_AddRef(IDirect3DRMTexture2* iface)
81 {
82     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
83     ULONG ref = InterlockedIncrement(&This->ref);
84
85     TRACE("(%p)->(): new ref = %d\n", iface, ref);
86
87     return ref;
88 }
89
90 static ULONG WINAPI IDirect3DRMTexture2Impl_Release(IDirect3DRMTexture2* iface)
91 {
92     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
93     ULONG ref = InterlockedDecrement(&This->ref);
94
95     TRACE("(%p)->(): new ref = %d\n", iface, ref);
96
97     if (!ref)
98         HeapFree(GetProcessHeap(), 0, This);
99
100     return ref;
101 }
102
103 /*** IDirect3DRMObject methods ***/
104 static HRESULT WINAPI IDirect3DRMTexture2Impl_Clone(IDirect3DRMTexture2* iface,
105                                                     LPUNKNOWN unknown, REFIID riid,
106                                                     LPVOID* object)
107 {
108     FIXME("(%p)->(%p, %s, %p): stub\n", iface, unknown, debugstr_guid(riid), object);
109
110     return E_NOTIMPL;
111 }
112
113 static HRESULT WINAPI IDirect3DRMTexture2Impl_AddDestroyCallback(IDirect3DRMTexture2* iface,
114                                                                  D3DRMOBJECTCALLBACK cb,
115                                                                  LPVOID argument)
116 {
117     FIXME("(%p)->(%p, %p): stub\n", iface, cb, argument);
118
119     return E_NOTIMPL;
120 }
121
122 static HRESULT WINAPI IDirect3DRMTexture2Impl_DeleteDestroyCallback(IDirect3DRMTexture2* iface,
123                                                                     D3DRMOBJECTCALLBACK cb,
124                                                                     LPVOID argument)
125 {
126     FIXME("(%p)->(%p, %p): stub\n", iface, cb, argument);
127
128     return E_NOTIMPL;
129 }
130
131 static HRESULT WINAPI IDirect3DRMTexture2Impl_SetAppData(IDirect3DRMTexture2* iface,
132                                                          DWORD data)
133 {
134     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
135
136     TRACE("(%p)->(%u)\n", iface, data);
137
138     return IDirect3DRMTexture3_SetAppData(&This->IDirect3DRMTexture3_iface, data);
139 }
140
141 static DWORD WINAPI IDirect3DRMTexture2Impl_GetAppData(IDirect3DRMTexture2* iface)
142 {
143     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
144
145     TRACE("(%p)->()\n", iface);
146
147     return IDirect3DRMTexture3_GetAppData(&This->IDirect3DRMTexture3_iface);
148 }
149
150 static HRESULT WINAPI IDirect3DRMTexture2Impl_SetName(IDirect3DRMTexture2* iface, LPCSTR name)
151 {
152     FIXME("(%p)->(%s): stub\n", iface, name);
153
154     return E_NOTIMPL;
155 }
156
157 static HRESULT WINAPI IDirect3DRMTexture2Impl_GetName(IDirect3DRMTexture2* iface,
158                                                       LPDWORD size, LPSTR name)
159 {
160     FIXME("(%p)->(%p, %p): stub\n", iface, size, name);
161
162     return E_NOTIMPL;
163 }
164
165 static HRESULT WINAPI IDirect3DRMTexture2Impl_GetClassName(IDirect3DRMTexture2* iface,
166                                                            LPDWORD size, LPSTR name)
167 {
168     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
169
170     TRACE("(%p/%p)->(%p, %p)\n", iface, This, size, name);
171
172     return IDirect3DRMTexture3_GetClassName(&This->IDirect3DRMTexture3_iface, size, name);
173 }
174
175 /*** IDirect3DRMTexture3 methods ***/
176 static HRESULT WINAPI IDirect3DRMTexture2Impl_InitFromFile(IDirect3DRMTexture2* iface, const char *filename)
177 {
178     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
179
180     FIXME("(%p/%p)->(%s): stub\n", iface, This, debugstr_a(filename));
181
182     return E_NOTIMPL;
183 }
184
185 static HRESULT WINAPI IDirect3DRMTexture2Impl_InitFromSurface(IDirect3DRMTexture2 *iface,
186         IDirectDrawSurface *surface)
187 {
188     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
189
190     FIXME("(%p/%p)->(%p): stub\n", iface, This, surface);
191
192     return E_NOTIMPL;
193 }
194
195 static HRESULT WINAPI IDirect3DRMTexture2Impl_InitFromResource(IDirect3DRMTexture2* iface, HRSRC resource)
196 {
197     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
198
199     FIXME("(%p/%p)->(%p): stub\n", iface, This, resource);
200
201     return E_NOTIMPL;
202 }
203
204 static HRESULT WINAPI IDirect3DRMTexture2Impl_Changed(IDirect3DRMTexture2* iface, BOOL pixels, BOOL palette)
205 {
206     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
207
208     FIXME("(%p/%p)->(%u, %u): stub\n", iface, This, pixels, palette);
209
210     return E_NOTIMPL;
211 }
212
213 static HRESULT WINAPI IDirect3DRMTexture2Impl_SetColors(IDirect3DRMTexture2* iface, DWORD max_colors)
214 {
215     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
216
217     FIXME("(%p/%p)->(%u): stub\n", iface, This, max_colors);
218
219     return E_NOTIMPL;
220 }
221
222 static HRESULT WINAPI IDirect3DRMTexture2Impl_SetShades(IDirect3DRMTexture2* iface, DWORD max_shades)
223 {
224     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
225
226     FIXME("(%p/%p)->(%u): stub\n", iface, This, max_shades);
227
228     return E_NOTIMPL;
229 }
230
231 static HRESULT WINAPI IDirect3DRMTexture2Impl_SetDecalSize(IDirect3DRMTexture2* iface, D3DVALUE width, D3DVALUE height)
232 {
233     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
234
235     FIXME("(%p/%p)->(%f, %f): stub\n", iface, This, width, height);
236
237     return E_NOTIMPL;
238 }
239
240 static HRESULT WINAPI IDirect3DRMTexture2Impl_SetDecalOrigin(IDirect3DRMTexture2* iface, LONG x, LONG y)
241 {
242     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
243
244     FIXME("(%p/%p)->(%d, %d): stub\n", iface, This, x, y);
245
246     return E_NOTIMPL;
247 }
248
249 static HRESULT WINAPI IDirect3DRMTexture2Impl_SetDecalScale(IDirect3DRMTexture2* iface, DWORD scale)
250 {
251     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
252
253     FIXME("(%p/%p)->(%u): stub\n", iface, This, scale);
254
255     return E_NOTIMPL;
256 }
257
258 static HRESULT WINAPI IDirect3DRMTexture2Impl_SetDecalTransparency(IDirect3DRMTexture2* iface, BOOL transparency)
259 {
260     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
261
262     FIXME("(%p/%p)->(%u): stub\n", iface, This, transparency);
263
264     return E_NOTIMPL;
265 }
266
267 static HRESULT WINAPI IDirect3DRMTexture2Impl_SetDecalTransparentColor(IDirect3DRMTexture2* iface, D3DCOLOR color)
268 {
269     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
270
271     FIXME("(%p/%p)->(%x): stub\n", iface, This, color);
272
273     return E_NOTIMPL;
274 }
275
276 static HRESULT WINAPI IDirect3DRMTexture2Impl_GetDecalSize(IDirect3DRMTexture2* iface, D3DVALUE* width, D3DVALUE* height)
277 {
278     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
279
280     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, height, width);
281
282     return E_NOTIMPL;
283 }
284
285 static HRESULT WINAPI IDirect3DRMTexture2Impl_GetDecalOrigin(IDirect3DRMTexture2* iface, LONG* x, LONG* y)
286 {
287     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
288
289     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, x, y);
290
291     return E_NOTIMPL;
292 }
293
294 static D3DRMIMAGE* WINAPI IDirect3DRMTexture2Impl_GetImage(IDirect3DRMTexture2* iface)
295 {
296     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
297
298     FIXME("(%p/%p)->(): stub\n", iface, This);
299
300     return NULL;
301 }
302
303 static DWORD WINAPI IDirect3DRMTexture2Impl_GetShades(IDirect3DRMTexture2* iface)
304 {
305     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
306
307     FIXME("(%p/%p)->(): stub\n", iface, This);
308
309     return 0;
310 }
311
312 static DWORD WINAPI IDirect3DRMTexture2Impl_GetColors(IDirect3DRMTexture2* iface)
313 {
314     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
315
316     FIXME("(%p/%p)->(): stub\n", iface, This);
317
318     return 0;
319 }
320
321 static DWORD WINAPI IDirect3DRMTexture2Impl_GetDecalScale(IDirect3DRMTexture2* iface)
322 {
323     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
324
325     FIXME("(%p/%p)->(): stub\n", iface, This);
326
327     return 0;
328 }
329
330 static BOOL WINAPI IDirect3DRMTexture2Impl_GetDecalTransparency(IDirect3DRMTexture2* iface)
331 {
332     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
333
334     FIXME("(%p/%p)->(): stub\n", iface, This);
335
336     return FALSE;
337 }
338
339 static D3DCOLOR WINAPI IDirect3DRMTexture2Impl_GetDecalTransparentColor(IDirect3DRMTexture2* iface)
340 {
341     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
342
343     FIXME("(%p/%p)->(): stub\n", iface, This);
344
345     return 0;
346 }
347
348 /*** IDirect3DRMTexture2 methods ***/
349 static HRESULT WINAPI IDirect3DRMTexture2Impl_InitFromImage(IDirect3DRMTexture2 *iface, D3DRMIMAGE *image)
350 {
351     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
352
353     FIXME("(%p/%p)->(%p): stub\n", iface, This, image);
354
355     return E_NOTIMPL;
356 }
357
358 static HRESULT WINAPI IDirect3DRMTexture2Impl_InitFromResource2(IDirect3DRMTexture2* iface, HMODULE module,
359                                                                LPCSTR /* LPCTSTR */ name, LPCSTR /* LPCTSTR */ type)
360 {
361     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
362
363     FIXME("(%p/%p)->(%p, %s, %s): stub\n", iface, This, module, debugstr_a(name), debugstr_a(type));
364
365     return E_NOTIMPL;
366 }
367
368 static HRESULT WINAPI IDirect3DRMTexture2Impl_GenerateMIPMap(IDirect3DRMTexture2* iface, DWORD flags)
369 {
370     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture2(iface);
371
372     FIXME("(%p/%p)->(%x): stub\n", iface, This, flags);
373
374     return E_NOTIMPL;
375 }
376
377 static const struct IDirect3DRMTexture2Vtbl Direct3DRMTexture2_Vtbl =
378 {
379     /*** IUnknown methods ***/
380     IDirect3DRMTexture2Impl_QueryInterface,
381     IDirect3DRMTexture2Impl_AddRef,
382     IDirect3DRMTexture2Impl_Release,
383     /*** IDirect3DRMObject methods ***/
384     IDirect3DRMTexture2Impl_Clone,
385     IDirect3DRMTexture2Impl_AddDestroyCallback,
386     IDirect3DRMTexture2Impl_DeleteDestroyCallback,
387     IDirect3DRMTexture2Impl_SetAppData,
388     IDirect3DRMTexture2Impl_GetAppData,
389     IDirect3DRMTexture2Impl_SetName,
390     IDirect3DRMTexture2Impl_GetName,
391     IDirect3DRMTexture2Impl_GetClassName,
392     /*** IDirect3DRMTexture methods ***/
393     IDirect3DRMTexture2Impl_InitFromFile,
394     IDirect3DRMTexture2Impl_InitFromSurface,
395     IDirect3DRMTexture2Impl_InitFromResource,
396     IDirect3DRMTexture2Impl_Changed,
397     IDirect3DRMTexture2Impl_SetColors,
398     IDirect3DRMTexture2Impl_SetShades,
399     IDirect3DRMTexture2Impl_SetDecalSize,
400     IDirect3DRMTexture2Impl_SetDecalOrigin,
401     IDirect3DRMTexture2Impl_SetDecalScale,
402     IDirect3DRMTexture2Impl_SetDecalTransparency,
403     IDirect3DRMTexture2Impl_SetDecalTransparentColor,
404     IDirect3DRMTexture2Impl_GetDecalSize,
405     IDirect3DRMTexture2Impl_GetDecalOrigin,
406     IDirect3DRMTexture2Impl_GetImage,
407     IDirect3DRMTexture2Impl_GetShades,
408     IDirect3DRMTexture2Impl_GetColors,
409     IDirect3DRMTexture2Impl_GetDecalScale,
410     IDirect3DRMTexture2Impl_GetDecalTransparency,
411     IDirect3DRMTexture2Impl_GetDecalTransparentColor,
412     /*** IDirect3DRMTexture2 methods ***/
413     IDirect3DRMTexture2Impl_InitFromImage,
414     IDirect3DRMTexture2Impl_InitFromResource2,
415     IDirect3DRMTexture2Impl_GenerateMIPMap
416 };
417
418 /*** IUnknown methods ***/
419 static HRESULT WINAPI IDirect3DRMTexture3Impl_QueryInterface(IDirect3DRMTexture3* iface,
420                                                            REFIID riid, void** object)
421 {
422     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
423
424     TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), object);
425
426     *object = NULL;
427
428     if (IsEqualGUID(riid, &IID_IUnknown) ||
429         IsEqualGUID(riid, &IID_IDirect3DRMTexture) ||
430         IsEqualGUID(riid, &IID_IDirect3DRMTexture2))
431     {
432         *object = &This->IDirect3DRMTexture2_iface;
433     }
434     else if (IsEqualGUID(riid, &IID_IDirect3DRMTexture3))
435     {
436         *object = &This->IDirect3DRMTexture3_iface;
437     }
438     else
439     {
440         FIXME("Interface %s not implemented\n", debugstr_guid(riid));
441         return E_NOINTERFACE;
442     }
443
444     IDirect3DRMTexture3_AddRef(iface);
445
446     return S_OK;
447 }
448
449 static ULONG WINAPI IDirect3DRMTexture3Impl_AddRef(IDirect3DRMTexture3* iface)
450 {
451     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
452     ULONG ref = InterlockedIncrement(&This->ref);
453
454     TRACE("(%p)->(): new ref = %d\n", iface, ref);
455
456     return ref;
457 }
458
459 static ULONG WINAPI IDirect3DRMTexture3Impl_Release(IDirect3DRMTexture3* iface)
460 {
461     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
462     ULONG ref = InterlockedDecrement(&This->ref);
463
464     TRACE("(%p)->(): new ref = %d\n", iface, ref);
465
466     if (!ref)
467         HeapFree(GetProcessHeap(), 0, This);
468
469     return ref;
470 }
471
472 /*** IDirect3DRMObject methods ***/
473 static HRESULT WINAPI IDirect3DRMTexture3Impl_Clone(IDirect3DRMTexture3* iface,
474                                                      LPUNKNOWN unknown, REFIID riid,
475                                                      LPVOID* object)
476 {
477     FIXME("(%p)->(%p, %s, %p): stub\n", iface, unknown, debugstr_guid(riid), object);
478
479     return E_NOTIMPL;
480 }
481
482 static HRESULT WINAPI IDirect3DRMTexture3Impl_AddDestroyCallback(IDirect3DRMTexture3* iface,
483                                                                   D3DRMOBJECTCALLBACK cb,
484                                                                   LPVOID argument)
485 {
486     FIXME("(%p)->(%p, %p): stub\n", iface, cb, argument);
487
488     return E_NOTIMPL;
489 }
490
491 static HRESULT WINAPI IDirect3DRMTexture3Impl_DeleteDestroyCallback(IDirect3DRMTexture3* iface,
492                                                                      D3DRMOBJECTCALLBACK cb,
493                                                                      LPVOID argument)
494 {
495     FIXME("(%p)->(%p, %p): stub\n", iface, cb, argument);
496
497     return E_NOTIMPL;
498 }
499
500 static HRESULT WINAPI IDirect3DRMTexture3Impl_SetAppData(IDirect3DRMTexture3* iface,
501                                                          DWORD data)
502 {
503     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
504
505     TRACE("(%p)->(%u)\n", iface, data);
506
507     This->app_data = data;
508
509     return D3DRM_OK;
510 }
511
512 static DWORD WINAPI IDirect3DRMTexture3Impl_GetAppData(IDirect3DRMTexture3* iface)
513 {
514     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
515
516     TRACE("(%p)->()\n", iface);
517
518     return This->app_data;
519 }
520
521 static HRESULT WINAPI IDirect3DRMTexture3Impl_SetName(IDirect3DRMTexture3* iface, LPCSTR name)
522 {
523     FIXME("(%p)->(%s): stub\n", iface, name);
524
525     return E_NOTIMPL;
526 }
527
528 static HRESULT WINAPI IDirect3DRMTexture3Impl_GetName(IDirect3DRMTexture3* iface,
529                                                        LPDWORD size, LPSTR name)
530 {
531     FIXME("(%p)->(%p, %p): stub\n", iface, size, name);
532
533     return E_NOTIMPL;
534 }
535
536 static HRESULT WINAPI IDirect3DRMTexture3Impl_GetClassName(IDirect3DRMTexture3* iface,
537                                                            LPDWORD size, LPSTR name)
538 {
539     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
540
541     TRACE("(%p/%p)->(%p, %p)\n", iface, This, size, name);
542
543     if (!size || *size < strlen("Texture") || !name)
544         return E_INVALIDARG;
545
546     strcpy(name, "Texture");
547     *size = sizeof("Texture");
548
549     return D3DRM_OK;
550 }
551
552 /*** IDirect3DRMTexture3 methods ***/
553 static HRESULT WINAPI IDirect3DRMTexture3Impl_InitFromFile(IDirect3DRMTexture3* iface, const char *filename)
554 {
555     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
556
557     FIXME("(%p/%p)->(%s): stub\n", iface, This, debugstr_a(filename));
558
559     return E_NOTIMPL;
560 }
561
562 static HRESULT WINAPI IDirect3DRMTexture3Impl_InitFromSurface(IDirect3DRMTexture3 *iface,
563         IDirectDrawSurface *surface)
564 {
565     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
566
567     FIXME("(%p/%p)->(%p): stub\n", iface, This, surface);
568
569     return E_NOTIMPL;
570 }
571
572 static HRESULT WINAPI IDirect3DRMTexture3Impl_InitFromResource(IDirect3DRMTexture3* iface, HRSRC resource)
573 {
574     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
575
576     FIXME("(%p/%p)->(%p): stub\n", iface, This, resource);
577
578     return E_NOTIMPL;
579 }
580
581 static HRESULT WINAPI IDirect3DRMTexture3Impl_Changed(IDirect3DRMTexture3* iface, DWORD flags, DWORD nb_rects, LPRECT rects)
582 {
583     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
584
585     FIXME("(%p/%p)->(%x, %u, %p): stub\n", iface, This, flags, nb_rects, rects);
586
587     return E_NOTIMPL;
588 }
589
590 static HRESULT WINAPI IDirect3DRMTexture3Impl_SetColors(IDirect3DRMTexture3* iface, DWORD max_colors)
591 {
592     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
593
594     FIXME("(%p/%p)->(%u): stub\n", iface, This, max_colors);
595
596     return E_NOTIMPL;
597 }
598
599 static HRESULT WINAPI IDirect3DRMTexture3Impl_SetShades(IDirect3DRMTexture3* iface, DWORD max_shades)
600 {
601     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
602
603     FIXME("(%p/%p)->(%u): stub\n", iface, This, max_shades);
604
605     return E_NOTIMPL;
606 }
607
608 static HRESULT WINAPI IDirect3DRMTexture3Impl_SetDecalSize(IDirect3DRMTexture3* iface, D3DVALUE width, D3DVALUE height)
609 {
610     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
611
612     FIXME("(%p/%p)->(%f, %f): stub\n", iface, This, width, height);
613
614     return E_NOTIMPL;
615 }
616
617 static HRESULT WINAPI IDirect3DRMTexture3Impl_SetDecalOrigin(IDirect3DRMTexture3* iface, LONG x, LONG y)
618 {
619     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
620
621     FIXME("(%p/%p)->(%d, %d): stub\n", iface, This, x, y);
622
623     return E_NOTIMPL;
624 }
625
626 static HRESULT WINAPI IDirect3DRMTexture3Impl_SetDecalScale(IDirect3DRMTexture3* iface, DWORD scale)
627 {
628     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
629
630     FIXME("(%p/%p)->(%u): stub\n", iface, This, scale);
631
632     return E_NOTIMPL;
633 }
634
635 static HRESULT WINAPI IDirect3DRMTexture3Impl_SetDecalTransparency(IDirect3DRMTexture3* iface, BOOL transparency)
636 {
637     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
638
639     FIXME("(%p/%p)->(%u): stub\n", iface, This, transparency);
640
641     return E_NOTIMPL;
642 }
643
644 static HRESULT WINAPI IDirect3DRMTexture3Impl_SetDecalTransparentColor(IDirect3DRMTexture3* iface, D3DCOLOR color)
645 {
646     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
647
648     FIXME("(%p/%p)->(%x): stub\n", iface, This, color);
649
650     return E_NOTIMPL;
651 }
652
653 static HRESULT WINAPI IDirect3DRMTexture3Impl_GetDecalSize(IDirect3DRMTexture3* iface, D3DVALUE* width, D3DVALUE* height)
654 {
655     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
656
657     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, height, width);
658
659     return E_NOTIMPL;
660 }
661
662 static HRESULT WINAPI IDirect3DRMTexture3Impl_GetDecalOrigin(IDirect3DRMTexture3* iface, LONG* x, LONG* y)
663 {
664     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
665
666     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, x, y);
667
668     return E_NOTIMPL;
669 }
670
671 static D3DRMIMAGE* WINAPI IDirect3DRMTexture3Impl_GetImage(IDirect3DRMTexture3* iface)
672 {
673     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
674
675     FIXME("(%p/%p)->(): stub\n", iface, This);
676
677     return NULL;
678 }
679
680 static DWORD WINAPI IDirect3DRMTexture3Impl_GetShades(IDirect3DRMTexture3* iface)
681 {
682     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
683
684     FIXME("(%p/%p)->(): stub\n", iface, This);
685
686     return 0;
687 }
688
689 static DWORD WINAPI IDirect3DRMTexture3Impl_GetColors(IDirect3DRMTexture3* iface)
690 {
691     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
692
693     FIXME("(%p/%p)->(): stub\n", iface, This);
694
695     return 0;
696 }
697
698 static DWORD WINAPI IDirect3DRMTexture3Impl_GetDecalScale(IDirect3DRMTexture3* iface)
699 {
700     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
701
702     FIXME("(%p/%p)->(): stub\n", iface, This);
703
704     return 0;
705 }
706
707 static BOOL WINAPI IDirect3DRMTexture3Impl_GetDecalTransparency(IDirect3DRMTexture3* iface)
708 {
709     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
710
711     FIXME("(%p/%p)->(): stub\n", iface, This);
712
713     return FALSE;
714 }
715
716 static D3DCOLOR WINAPI IDirect3DRMTexture3Impl_GetDecalTransparentColor(IDirect3DRMTexture3* iface)
717 {
718     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
719
720     FIXME("(%p/%p)->(): stub\n", iface, This);
721
722     return 0;
723 }
724
725 static HRESULT WINAPI IDirect3DRMTexture3Impl_InitFromImage(IDirect3DRMTexture3 *iface, D3DRMIMAGE *image)
726 {
727     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
728
729     FIXME("(%p/%p)->(%p): stub\n", iface, This, image);
730
731     return E_NOTIMPL;
732 }
733
734 static HRESULT WINAPI IDirect3DRMTexture3Impl_InitFromResource2(IDirect3DRMTexture3* iface, HMODULE module,
735                                                                LPCSTR /* LPCTSTR */ name, LPCSTR /* LPCTSTR */ type)
736 {
737     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
738
739     FIXME("(%p/%p)->(%p, %s, %s): stub\n", iface, This, module, debugstr_a(name), debugstr_a(type));
740
741     return E_NOTIMPL;
742 }
743
744 static HRESULT WINAPI IDirect3DRMTexture3Impl_GenerateMIPMap(IDirect3DRMTexture3* iface, DWORD flags)
745 {
746     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
747
748     FIXME("(%p/%p)->(%x): stub\n", iface, This, flags);
749
750     return E_NOTIMPL;
751 }
752
753 static HRESULT WINAPI IDirect3DRMTexture3Impl_GetSurface(IDirect3DRMTexture3 *iface,
754         DWORD flags, IDirectDrawSurface **surface)
755 {
756     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
757
758     FIXME("(%p/%p)->(%x, %p): stub\n", iface, This, flags, surface);
759
760     return E_NOTIMPL;
761 }
762
763 static HRESULT WINAPI IDirect3DRMTexture3Impl_SetCacheOptions(IDirect3DRMTexture3* iface, LONG importance, DWORD flags)
764 {
765     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
766
767     FIXME("(%p/%p)->(%d, %x): stub\n", iface, This, importance, flags);
768
769     return E_NOTIMPL;
770 }
771
772 static HRESULT WINAPI IDirect3DRMTexture3Impl_GetCacheOptions(IDirect3DRMTexture3* iface, LPLONG importance, LPDWORD flags)
773 {
774     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
775
776     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, importance, flags);
777
778     return E_NOTIMPL;
779 }
780
781 static HRESULT WINAPI IDirect3DRMTexture3Impl_SetDownsampleCallback(IDirect3DRMTexture3* iface, D3DRMDOWNSAMPLECALLBACK callback, LPVOID arg)
782 {
783     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
784
785     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, callback, arg);
786
787     return E_NOTIMPL;
788 }
789
790 static HRESULT WINAPI IDirect3DRMTexture3Impl_SetValidationCallback(IDirect3DRMTexture3* iface, D3DRMVALIDATIONCALLBACK callback, LPVOID arg)
791 {
792     IDirect3DRMTextureImpl *This = impl_from_IDirect3DRMTexture3(iface);
793
794     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, callback, arg);
795
796     return E_NOTIMPL;
797 }
798
799 static const struct IDirect3DRMTexture3Vtbl Direct3DRMTexture3_Vtbl =
800 {
801     /*** IUnknown methods ***/
802     IDirect3DRMTexture3Impl_QueryInterface,
803     IDirect3DRMTexture3Impl_AddRef,
804     IDirect3DRMTexture3Impl_Release,
805     /*** IDirect3DRMObject methods ***/
806     IDirect3DRMTexture3Impl_Clone,
807     IDirect3DRMTexture3Impl_AddDestroyCallback,
808     IDirect3DRMTexture3Impl_DeleteDestroyCallback,
809     IDirect3DRMTexture3Impl_SetAppData,
810     IDirect3DRMTexture3Impl_GetAppData,
811     IDirect3DRMTexture3Impl_SetName,
812     IDirect3DRMTexture3Impl_GetName,
813     IDirect3DRMTexture3Impl_GetClassName,
814     /*** IDirect3DRMTexture3 methods ***/
815     IDirect3DRMTexture3Impl_InitFromFile,
816     IDirect3DRMTexture3Impl_InitFromSurface,
817     IDirect3DRMTexture3Impl_InitFromResource,
818     IDirect3DRMTexture3Impl_Changed,
819     IDirect3DRMTexture3Impl_SetColors,
820     IDirect3DRMTexture3Impl_SetShades,
821     IDirect3DRMTexture3Impl_SetDecalSize,
822     IDirect3DRMTexture3Impl_SetDecalOrigin,
823     IDirect3DRMTexture3Impl_SetDecalScale,
824     IDirect3DRMTexture3Impl_SetDecalTransparency,
825     IDirect3DRMTexture3Impl_SetDecalTransparentColor,
826     IDirect3DRMTexture3Impl_GetDecalSize,
827     IDirect3DRMTexture3Impl_GetDecalOrigin,
828     IDirect3DRMTexture3Impl_GetImage,
829     IDirect3DRMTexture3Impl_GetShades,
830     IDirect3DRMTexture3Impl_GetColors,
831     IDirect3DRMTexture3Impl_GetDecalScale,
832     IDirect3DRMTexture3Impl_GetDecalTransparency,
833     IDirect3DRMTexture3Impl_GetDecalTransparentColor,
834     IDirect3DRMTexture3Impl_InitFromImage,
835     IDirect3DRMTexture3Impl_InitFromResource2,
836     IDirect3DRMTexture3Impl_GenerateMIPMap,
837     IDirect3DRMTexture3Impl_GetSurface,
838     IDirect3DRMTexture3Impl_SetCacheOptions,
839     IDirect3DRMTexture3Impl_GetCacheOptions,
840     IDirect3DRMTexture3Impl_SetDownsampleCallback,
841     IDirect3DRMTexture3Impl_SetValidationCallback
842 };
843
844 HRESULT Direct3DRMTexture_create(REFIID riid, IUnknown** ret_iface)
845 {
846     IDirect3DRMTextureImpl* object;
847
848     TRACE("(%p)\n", ret_iface);
849
850     object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DRMTextureImpl));
851     if (!object)
852         return E_OUTOFMEMORY;
853
854     object->IDirect3DRMTexture2_iface.lpVtbl = &Direct3DRMTexture2_Vtbl;
855     object->IDirect3DRMTexture3_iface.lpVtbl = &Direct3DRMTexture3_Vtbl;
856     object->ref = 1;
857
858     if (IsEqualGUID(riid, &IID_IDirect3DRMTexture3))
859         *ret_iface = (IUnknown*)&object->IDirect3DRMTexture3_iface;
860     else
861         *ret_iface = (IUnknown*)&object->IDirect3DRMTexture2_iface;
862
863     return S_OK;
864 }