msi/tests: Prevent a popup on Windows NT.
[wine] / dlls / d3drm / d3drm.c
1 /*
2  * Implementation of IDirect3DRM Interface
3  *
4  * Copyright 2010 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     const IDirect3DRMVtbl *lpVtbl;
34     LONG ref;
35 } IDirect3DRMImpl;
36
37 static const struct IDirect3DRMVtbl Direct3DRM_Vtbl;
38
39 HRESULT Direct3DRM_create(LPDIRECT3DRM* ppDirect3DRM)
40 {
41     IDirect3DRMImpl* object;
42
43     TRACE("(%p)\n", ppDirect3DRM);
44
45     object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DRMImpl));
46     if (!object)
47     {
48         ERR("Out of memory\n");
49         return E_OUTOFMEMORY;
50     }
51
52     object->lpVtbl = &Direct3DRM_Vtbl;
53     object->ref = 1;
54
55     *ppDirect3DRM = (IDirect3DRM*)object;
56
57     return S_OK;
58 }
59
60 /*** IUnknown methods ***/
61 static HRESULT WINAPI IDirect3DRMImpl_QueryInterface(IDirect3DRM* iface, REFIID riid, void** ppvObject)
62 {
63     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
64
65     TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ppvObject);
66
67     if (IsEqualGUID(riid, &IID_IUnknown) ||
68         IsEqualGUID(riid, &IID_IDirect3DRM))
69     {
70         IUnknown_AddRef(iface);
71         *ppvObject = This;
72         return S_OK;
73     }
74
75     ERR("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppvObject);
76     return E_NOINTERFACE;
77 }
78
79 static ULONG WINAPI IDirect3DRMImpl_AddRef(IDirect3DRM* iface)
80 {
81     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
82
83     TRACE("(%p/%p)\n", iface, This);
84
85     return InterlockedIncrement(&This->ref);
86 }
87
88 static ULONG WINAPI IDirect3DRMImpl_Release(IDirect3DRM* iface)
89 {
90     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
91     ULONG ref = InterlockedDecrement(&This->ref);
92
93     TRACE("(%p/%p)\n", iface, This);
94
95     if (!ref)
96         HeapFree(GetProcessHeap(), 0, This);
97
98     return ref;
99 }
100
101 /*** IDirect3DRM methods ***/
102 static HRESULT WINAPI IDirect3DRMImpl_CreateObject(IDirect3DRM* iface, REFCLSID rclsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj)
103 {
104     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
105
106     FIXME("(%p/%p)->(%s,%p,%s,%p): stub\n", iface, This, debugstr_guid(rclsid), pUnkOuter, debugstr_guid(riid), ppvObj);
107
108     return E_NOTIMPL;
109 }
110
111 static HRESULT WINAPI IDirect3DRMImpl_CreateFrame(IDirect3DRM* iface, LPDIRECT3DRMFRAME pFrameParent, LPDIRECT3DRMFRAME * ppFrame)
112 {
113     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
114
115     FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, pFrameParent, ppFrame);
116
117     return E_NOTIMPL;
118 }
119
120 static HRESULT WINAPI IDirect3DRMImpl_CreateMesh(IDirect3DRM* iface, LPDIRECT3DRMMESH * ppMesh)
121 {
122     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
123
124     FIXME("(%p/%p)->(%p): stub\n", iface, This, ppMesh);
125
126     return E_NOTIMPL;
127 }
128
129 static HRESULT WINAPI IDirect3DRMImpl_CreateMeshBuilder(IDirect3DRM* iface, LPDIRECT3DRMMESHBUILDER * ppMeshBuilder)
130 {
131     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
132
133     TRACE("(%p/%p)->(%p)\n", iface, This, ppMeshBuilder);
134
135     return Direct3DRMMeshBuilder_create(ppMeshBuilder);
136 }
137
138 static HRESULT WINAPI IDirect3DRMImpl_CreateFace(IDirect3DRM* iface, LPDIRECT3DRMFACE * ppFace)
139 {
140     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
141
142     FIXME("(%p/%p)->(%p): stub\n", iface, This, ppFace);
143
144     return E_NOTIMPL;
145 }
146
147 static HRESULT WINAPI IDirect3DRMImpl_CreateAnimation(IDirect3DRM* iface, LPDIRECT3DRMANIMATION * ppAnimation)
148 {
149     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
150
151     FIXME("(%p/%p)->(%p): stub\n", iface, This, ppAnimation);
152
153     return E_NOTIMPL;
154 }
155
156 static HRESULT WINAPI IDirect3DRMImpl_CreateAnimationSet(IDirect3DRM* iface, LPDIRECT3DRMANIMATIONSET * ppAnimationSet)
157 {
158     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
159
160     FIXME("(%p/%p)->(%p): stub\n", iface, This, ppAnimationSet);
161
162     return E_NOTIMPL;
163 }
164
165 static HRESULT WINAPI IDirect3DRMImpl_CreateTexture(IDirect3DRM* iface, LPD3DRMIMAGE pImage, LPDIRECT3DRMTEXTURE * ppTexture)
166 {
167     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
168
169     FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, pImage, ppTexture);
170
171     return E_NOTIMPL;
172 }
173
174 static HRESULT WINAPI IDirect3DRMImpl_CreateLight(IDirect3DRM* iface, D3DRMLIGHTTYPE type, D3DCOLOR color, LPDIRECT3DRMLIGHT * ppLight)
175 {
176     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
177
178     FIXME("(%p/%p)->(%d,%d,%p): stub\n", iface, This, type, color, ppLight);
179
180     return E_NOTIMPL;
181 }
182
183 static HRESULT WINAPI IDirect3DRMImpl_CreateLightRGB(IDirect3DRM* iface, D3DRMLIGHTTYPE type,  D3DVALUE red, D3DVALUE green, D3DVALUE blue, LPDIRECT3DRMLIGHT * ppLight)
184 {
185     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
186
187     FIXME("(%p/%p)->(%d,%f,%f,%f,%p): stub\n", iface, This, type, red, green, blue, ppLight);
188
189     return E_NOTIMPL;
190 }
191
192 static HRESULT WINAPI IDirect3DRMImpl_Material(IDirect3DRM* iface, D3DVALUE m, LPDIRECT3DRMMATERIAL * ppMaterial)
193 {
194     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
195
196     FIXME("(%p/%p)->(%f,%p): stub\n", iface, This, m, ppMaterial);
197
198     return E_NOTIMPL;
199 }
200
201 static HRESULT WINAPI IDirect3DRMImpl_CreateDevice(IDirect3DRM* iface, DWORD width, DWORD height, LPDIRECT3DRMDEVICE * ppDevice)
202 {
203     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
204
205     FIXME("(%p/%p)->(%d,%d,%p): stub\n", iface, This, width, height, ppDevice);
206
207     return E_NOTIMPL;
208 }
209
210 static HRESULT WINAPI IDirect3DRMImpl_CreateDeviceFromSurface(IDirect3DRM* iface, LPGUID pGUID, LPDIRECTDRAW pDD, LPDIRECTDRAWSURFACE pDDSBack, LPDIRECT3DRMDEVICE * ppDevice)
211 {
212     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
213
214     FIXME("(%p/%p)->(%s,%p,%p,%p): stub\n", iface, This, debugstr_guid(pGUID), pDD, pDDSBack, ppDevice);
215
216     return E_NOTIMPL;
217 }
218
219 static HRESULT WINAPI IDirect3DRMImpl_CreateDeviceFromD3D(IDirect3DRM* iface, LPDIRECT3D pD3D, LPDIRECT3DDEVICE pD3DDev, LPDIRECT3DRMDEVICE * ppDevice)
220 {
221     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
222
223     FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, pD3D, pD3DDev, ppDevice);
224
225     return E_NOTIMPL;
226 }
227
228 static HRESULT WINAPI IDirect3DRMImpl_CreateDeviceFromClipper(IDirect3DRM* iface, LPDIRECTDRAWCLIPPER pDDClipper, LPGUID pGUID, int width, int height, LPDIRECT3DRMDEVICE * ppDevice)
229 {
230     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
231
232     FIXME("(%p/%p)->(%p,%s,%d,%d,%p): stub\n", iface, This, pDDClipper, debugstr_guid(pGUID), width, height, ppDevice);
233
234     return E_NOTIMPL;
235 }
236
237 static HRESULT WINAPI IDirect3DRMImpl_CreateShadow(IDirect3DRM* iface, LPDIRECT3DRMVISUAL pVisual, LPDIRECT3DRMLIGHT pLight, D3DVALUE px, D3DVALUE py, D3DVALUE pz, D3DVALUE nx, D3DVALUE ny, D3DVALUE nz, LPDIRECT3DRMVISUAL * ppVisual)
238 {
239     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
240
241     FIXME("(%p/%p)->(%p,%p,%f,%f,%f,%f,%f,%f,%p): stub\n", iface, This, pVisual, pLight, px, py, pz, nx, ny, nz, ppVisual);
242
243     return E_NOTIMPL;
244 }
245
246 static HRESULT WINAPI IDirect3DRMImpl_CreateTextureFromSurface(IDirect3DRM* iface, LPDIRECTDRAWSURFACE pDDS, LPDIRECT3DRMTEXTURE * ppTexture)
247 {
248     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
249
250     FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, pDDS, ppTexture);
251
252     return E_NOTIMPL;
253 }
254
255 static HRESULT WINAPI IDirect3DRMImpl_CreateViewport(IDirect3DRM* iface, LPDIRECT3DRMDEVICE pDevice, LPDIRECT3DRMFRAME pFrame, DWORD xpos, DWORD ypos, DWORD width, DWORD height, LPDIRECT3DRMVIEWPORT * ppViewport)
256 {
257     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
258
259     FIXME("(%p/%p)->(%p,%p,%d,%d,%d,%d,%p): stub\n", iface, This, pDevice, pFrame, xpos, ypos, width, height, ppViewport);
260
261     return E_NOTIMPL;
262 }
263
264 static HRESULT WINAPI IDirect3DRMImpl_CreateWrap(IDirect3DRM* iface, D3DRMWRAPTYPE type, LPDIRECT3DRMFRAME pFrame, D3DVALUE ox, D3DVALUE oy, D3DVALUE oz, D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, D3DVALUE ou, D3DVALUE ov, D3DVALUE su, D3DVALUE sv, LPDIRECT3DRMWRAP * ppWrap)
265 {
266     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
267
268     FIXME("(%p/%p)->(%d,%p,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%p): stub\n", iface, This, type, pFrame, ox, oy, oz, dx, dy, dz, ux, uy, uz, ou, ov, su, sv, ppWrap);
269
270     return E_NOTIMPL;
271 }
272
273 static HRESULT WINAPI IDirect3DRMImpl_CreateUserVisual(IDirect3DRM* iface, D3DRMUSERVISUALCALLBACK cb, LPVOID pArg, LPDIRECT3DRMUSERVISUAL * ppUserVisual)
274 {
275     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
276
277     FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, cb, pArg, ppUserVisual);
278
279     return E_NOTIMPL;
280 }
281
282 static HRESULT WINAPI IDirect3DRMImpl_LoadTexture(IDirect3DRM* iface, const char * filename, LPDIRECT3DRMTEXTURE * ppTexture)
283 {
284     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
285
286     FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, filename, ppTexture);
287
288     return E_NOTIMPL;
289 }
290
291 static HRESULT WINAPI IDirect3DRMImpl_LoadTextureFromResource(IDirect3DRM* iface, HRSRC rs, LPDIRECT3DRMTEXTURE * ppTexture)
292 {
293     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
294
295     FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, rs, ppTexture);
296
297     return E_NOTIMPL;
298 }
299
300 static HRESULT WINAPI IDirect3DRMImpl_SetSearchPath(IDirect3DRM* iface, LPCSTR path)
301 {
302     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
303
304     FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
305
306     return E_NOTIMPL;
307 }
308
309 static HRESULT WINAPI IDirect3DRMImpl_AddSearchPath(IDirect3DRM* iface, LPCSTR path)
310 {
311     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
312
313     FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
314
315     return E_NOTIMPL;
316 }
317
318 static HRESULT WINAPI IDirect3DRMImpl_GetSearchPath(IDirect3DRM* iface, DWORD *size_return, LPSTR path_return)
319 {
320     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
321
322     FIXME("(%p/%p)->(%p,%s): stub\n", iface, This, size_return, path_return);
323
324     return E_NOTIMPL;
325 }
326
327 static HRESULT WINAPI IDirect3DRMImpl_SetDefaultTextureColors(IDirect3DRM* iface, DWORD nb_colors)
328 {
329     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
330
331     FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_colors);
332
333     return E_NOTIMPL;
334 }
335
336 static HRESULT WINAPI IDirect3DRMImpl_SetDefaultTextureShades(IDirect3DRM* iface, DWORD nb_shades)
337 {
338     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
339
340     FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_shades);
341
342     return E_NOTIMPL;
343 }
344
345 static HRESULT WINAPI IDirect3DRMImpl_GetDevices(IDirect3DRM* iface, LPDIRECT3DRMDEVICEARRAY * ppDeviceArray)
346 {
347     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
348
349     FIXME("(%p/%p)->(%p): stub\n", iface, This, ppDeviceArray);
350
351     return E_NOTIMPL;
352 }
353
354 static HRESULT WINAPI IDirect3DRMImpl_GetNamedObject(IDirect3DRM* iface, const char * pName, LPDIRECT3DRMOBJECT * ppObject)
355 {
356     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
357
358     FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, pName, ppObject);
359
360     return E_NOTIMPL;
361 }
362
363 static HRESULT WINAPI IDirect3DRMImpl_EnumerateObjects(IDirect3DRM* iface, D3DRMOBJECTCALLBACK cb, LPVOID pArg)
364 {
365     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
366
367     FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, cb, pArg);
368
369     return E_NOTIMPL;
370 }
371
372 static HRESULT WINAPI IDirect3DRMImpl_Load(IDirect3DRM* iface, LPVOID pObjSource, LPVOID pObjID, LPIID * ppGUIDs, DWORD nb_GUIDs, D3DRMLOADOPTIONS LOFlags, D3DRMLOADCALLBACK LoadProc, LPVOID pArgLP, D3DRMLOADTEXTURECALLBACK LoadTextureProc, LPVOID pArgLTP, LPDIRECT3DRMFRAME pParentFrame)
373 {
374     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
375
376     FIXME("(%p/%p)->(%p,%p,%p,%d,%d,%p,%p,%p,%p,%p): stub\n", iface, This, pObjSource, pObjID, ppGUIDs, nb_GUIDs, LOFlags, LoadProc, pArgLP, LoadTextureProc, pArgLTP, pParentFrame);
377
378     return E_NOTIMPL;
379 }
380
381 static HRESULT WINAPI IDirect3DRMImpl_Tick(IDirect3DRM* iface, D3DVALUE tick)
382 {
383     IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
384
385     FIXME("(%p/%p)->(%f): stub\n", iface, This, tick);
386
387     return E_NOTIMPL;
388 }
389
390 static const struct IDirect3DRMVtbl Direct3DRM_Vtbl =
391 {
392     IDirect3DRMImpl_QueryInterface,
393     IDirect3DRMImpl_AddRef,
394     IDirect3DRMImpl_Release,
395     IDirect3DRMImpl_CreateObject,
396     IDirect3DRMImpl_CreateFrame,
397     IDirect3DRMImpl_CreateMesh,
398     IDirect3DRMImpl_CreateMeshBuilder,
399     IDirect3DRMImpl_CreateFace,
400     IDirect3DRMImpl_CreateAnimation,
401     IDirect3DRMImpl_CreateAnimationSet,
402     IDirect3DRMImpl_CreateTexture,
403     IDirect3DRMImpl_CreateLight,
404     IDirect3DRMImpl_CreateLightRGB,
405     IDirect3DRMImpl_Material,
406     IDirect3DRMImpl_CreateDevice,
407     IDirect3DRMImpl_CreateDeviceFromSurface,
408     IDirect3DRMImpl_CreateDeviceFromD3D,
409     IDirect3DRMImpl_CreateDeviceFromClipper,
410     IDirect3DRMImpl_CreateShadow,
411     IDirect3DRMImpl_CreateTextureFromSurface,
412     IDirect3DRMImpl_CreateViewport,
413     IDirect3DRMImpl_CreateWrap,
414     IDirect3DRMImpl_CreateUserVisual,
415     IDirect3DRMImpl_LoadTexture,
416     IDirect3DRMImpl_LoadTextureFromResource,
417     IDirect3DRMImpl_SetSearchPath,
418     IDirect3DRMImpl_AddSearchPath,
419     IDirect3DRMImpl_GetSearchPath,
420     IDirect3DRMImpl_SetDefaultTextureColors,
421     IDirect3DRMImpl_SetDefaultTextureShades,
422     IDirect3DRMImpl_GetDevices,
423     IDirect3DRMImpl_GetNamedObject,
424     IDirect3DRMImpl_EnumerateObjects,
425     IDirect3DRMImpl_Load,
426     IDirect3DRMImpl_Tick
427 };