mpr: Fix translations.
[wine/multimedia.git] / dlls / d3dx9_36 / effect.c
blobe4c90076563039e90b9011f694db85c24ff42c57
1 /*
2 * Copyright 2010 Christian Costa
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include "config.h"
20 #include "wine/port.h"
21 #include "wine/debug.h"
22 #include "wine/unicode.h"
23 #include "windef.h"
24 #include "wingdi.h"
25 #include "d3dx9_36_private.h"
27 WINE_DEFAULT_DEBUG_CHANNEL(d3dx);
29 static const struct ID3DXEffectVtbl ID3DXEffect_Vtbl;
31 typedef struct ID3DXEffectImpl {
32 const ID3DXEffectVtbl *lpVtbl;
33 LONG ref;
34 } ID3DXEffectImpl;
36 /*** IUnknown methods ***/
37 static HRESULT WINAPI ID3DXEffectImpl_QueryInterface(ID3DXEffect* iface, REFIID riid, void** object)
39 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
41 TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), object);
43 if (IsEqualGUID(riid, &IID_IUnknown) ||
44 IsEqualGUID(riid, &IID_ID3DXBaseEffect) ||
45 IsEqualGUID(riid, &IID_ID3DXEffect))
47 This->lpVtbl->AddRef(iface);
48 *object = This;
49 return S_OK;
52 ERR("Interface %s not found\n", debugstr_guid(riid));
54 return E_NOINTERFACE;
57 static ULONG WINAPI ID3DXEffectImpl_AddRef(ID3DXEffect* iface)
59 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
61 TRACE("(%p)->(): AddRef from %u\n", This, This->ref);
63 return InterlockedIncrement(&This->ref);
66 static ULONG WINAPI ID3DXEffectImpl_Release(ID3DXEffect* iface)
68 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
69 ULONG ref = InterlockedDecrement(&This->ref);
71 TRACE("(%p)->(): Release from %u\n", This, ref + 1);
73 if (!ref)
74 HeapFree(GetProcessHeap(), 0, This);
76 return ref;
79 /*** ID3DXBaseEffect methods ***/
80 static HRESULT WINAPI ID3DXEffectImpl_GetDesc(ID3DXEffect* iface, D3DXEFFECT_DESC* desc)
82 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
84 FIXME("(%p)->(%p): stub\n", This, desc);
86 return E_NOTIMPL;
89 static HRESULT WINAPI ID3DXEffectImpl_GetParameterDesc(ID3DXEffect* iface, D3DXHANDLE parameter, D3DXPARAMETER_DESC* desc)
91 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
93 FIXME("(%p)->(%p, %p): stub\n", This, parameter, desc);
95 return E_NOTIMPL;
98 static HRESULT WINAPI ID3DXEffectImpl_GetTechniqueDesc(ID3DXEffect* iface, D3DXHANDLE technique, D3DXTECHNIQUE_DESC* desc)
100 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
102 FIXME("(%p)->(%p, %p): stub\n", This, technique, desc);
104 return E_NOTIMPL;
107 static HRESULT WINAPI ID3DXEffectImpl_GetPassDesc(ID3DXEffect* iface, D3DXHANDLE pass, D3DXPASS_DESC* desc)
109 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
111 FIXME("(%p)->(%p, %p): stub\n", This, pass, desc);
113 return E_NOTIMPL;
116 static HRESULT WINAPI ID3DXEffectImpl_GetFunctionDesc(ID3DXEffect* iface, D3DXHANDLE shader, D3DXFUNCTION_DESC* desc)
118 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
120 FIXME("(%p)->(%p, %p): stub\n", This, shader, desc);
122 return E_NOTIMPL;
125 static D3DXHANDLE WINAPI ID3DXEffectImpl_GetParameter(ID3DXEffect* iface, D3DXHANDLE parameter, UINT index)
127 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
129 FIXME("(%p)->(%p, %u): stub\n", This, parameter, index);
131 return NULL;
134 static D3DXHANDLE WINAPI ID3DXEffectImpl_GetParameterByName(ID3DXEffect* iface, D3DXHANDLE parameter, LPCSTR name)
136 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
138 FIXME("(%p)->(%p, %s): stub\n", This, parameter, name);
140 return NULL;
143 static D3DXHANDLE WINAPI ID3DXEffectImpl_GetParameterBySemantic(ID3DXEffect* iface, D3DXHANDLE parameter, LPCSTR semantic)
145 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
147 FIXME("(%p)->(%p, %s): stub\n", This, parameter, semantic);
149 return NULL;
152 static D3DXHANDLE WINAPI ID3DXEffectImpl_GetParameterElement(ID3DXEffect* iface, D3DXHANDLE parameter, UINT index)
154 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
156 FIXME("(%p)->(%p, %u): stub\n", This, parameter, index);
158 return NULL;
161 static D3DXHANDLE WINAPI ID3DXEffectImpl_GetTechnique(ID3DXEffect* iface, UINT index)
163 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
165 FIXME("(%p)->(%u): stub\n", This, index);
167 return NULL;
170 static D3DXHANDLE WINAPI ID3DXEffectImpl_GetTechniqueByName(ID3DXEffect* iface, LPCSTR name)
172 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
174 FIXME("(%p)->(%s): stub\n", This, name);
176 return NULL;
179 static D3DXHANDLE WINAPI ID3DXEffectImpl_GetPass(ID3DXEffect* iface, D3DXHANDLE technique, UINT index)
181 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
183 FIXME("(%p)->(%p, %u): stub\n", This, technique, index);
185 return NULL;
188 static D3DXHANDLE WINAPI ID3DXEffectImpl_GetPassByName(ID3DXEffect* iface, D3DXHANDLE technique, LPCSTR name)
190 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
192 FIXME("(%p)->(%p, %s): stub\n", This, technique, name);
194 return NULL;
197 static D3DXHANDLE WINAPI ID3DXEffectImpl_GetFunction(ID3DXEffect* iface, UINT index)
199 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
201 FIXME("(%p)->(%u): stub\n", This, index);
203 return NULL;
206 static D3DXHANDLE WINAPI ID3DXEffectImpl_GetFunctionByName(ID3DXEffect* iface, LPCSTR name)
208 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
210 FIXME("(%p)->(%s): stub\n", This, name);
212 return NULL;
215 static D3DXHANDLE WINAPI ID3DXEffectImpl_GetAnnotation(ID3DXEffect* iface, D3DXHANDLE object, UINT index)
217 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
219 FIXME("(%p)->(%p, %u): stub\n", This, object, index);
221 return NULL;
224 static D3DXHANDLE WINAPI ID3DXEffectImpl_GetAnnotationByName(ID3DXEffect* iface, D3DXHANDLE object, LPCSTR name)
226 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
228 FIXME("(%p)->(%p, %s): stub\n", This, object, name);
230 return NULL;
233 static HRESULT WINAPI ID3DXEffectImpl_SetValue(ID3DXEffect* iface, D3DXHANDLE parameter, LPCVOID data, UINT bytes)
235 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
237 FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, data, bytes);
239 return E_NOTIMPL;
242 static HRESULT WINAPI ID3DXEffectImpl_GetValue(ID3DXEffect* iface, D3DXHANDLE parameter, LPVOID data, UINT bytes)
244 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
246 FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, data, bytes);
248 return E_NOTIMPL;
251 static HRESULT WINAPI ID3DXEffectImpl_SetBool(ID3DXEffect* iface, D3DXHANDLE parameter, BOOL b)
253 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
255 FIXME("(%p)->(%p, %u): stub\n", This, parameter, b);
257 return E_NOTIMPL;
260 static HRESULT WINAPI ID3DXEffectImpl_GetBool(ID3DXEffect* iface, D3DXHANDLE parameter, BOOL* b)
262 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
264 FIXME("(%p)->(%p, %p): stub\n", This, parameter, b);
266 return E_NOTIMPL;
269 static HRESULT WINAPI ID3DXEffectImpl_SetBoolArray(ID3DXEffect* iface, D3DXHANDLE parameter, CONST BOOL* b, UINT count)
271 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
273 FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, b, count);
275 return E_NOTIMPL;
278 static HRESULT WINAPI ID3DXEffectImpl_GetBoolArray(ID3DXEffect* iface, D3DXHANDLE parameter, BOOL* b, UINT count)
280 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
282 FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, b, count);
284 return E_NOTIMPL;
287 static HRESULT WINAPI ID3DXEffectImpl_SetInt(ID3DXEffect* iface, D3DXHANDLE parameter, INT n)
289 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
291 FIXME("(%p)->(%p, %d): stub\n", This, parameter, n);
293 return E_NOTIMPL;
296 static HRESULT WINAPI ID3DXEffectImpl_GetInt(ID3DXEffect* iface, D3DXHANDLE parameter, INT* n)
298 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
300 FIXME("(%p)->(%p, %p): stub\n", This, parameter, n);
302 return E_NOTIMPL;
305 static HRESULT WINAPI ID3DXEffectImpl_SetIntArray(ID3DXEffect* iface, D3DXHANDLE parameter, CONST INT* n, UINT count)
307 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
309 FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, n, count);
311 return E_NOTIMPL;
314 static HRESULT WINAPI ID3DXEffectImpl_GetIntArray(ID3DXEffect* iface, D3DXHANDLE parameter, INT* n, UINT count)
316 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
318 FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, n, count);
320 return E_NOTIMPL;
323 static HRESULT WINAPI ID3DXEffectImpl_SetFloat(ID3DXEffect* iface, D3DXHANDLE parameter, FLOAT f)
325 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
327 FIXME("(%p)->(%p, %f): stub\n", This, parameter, f);
329 return E_NOTIMPL;
332 static HRESULT WINAPI ID3DXEffectImpl_GetFloat(ID3DXEffect* iface, D3DXHANDLE parameter, FLOAT* f)
334 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
336 FIXME("(%p)->(%p, %p): stub\n", This, parameter, f);
338 return E_NOTIMPL;
341 static HRESULT WINAPI ID3DXEffectImpl_SetFloatArray(ID3DXEffect* iface, D3DXHANDLE parameter, CONST FLOAT* f, UINT count)
343 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
345 FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, f, count);
347 return E_NOTIMPL;
350 static HRESULT WINAPI ID3DXEffectImpl_GetFloatArray(ID3DXEffect* iface, D3DXHANDLE parameter, FLOAT* f, UINT count)
352 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
354 FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, f, count);
356 return E_NOTIMPL;
359 static HRESULT WINAPI ID3DXEffectImpl_SetVector(ID3DXEffect* iface, D3DXHANDLE parameter, CONST D3DXVECTOR4* vector)
361 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
363 FIXME("(%p)->(%p, %p): stub\n", This, parameter, vector);
365 return E_NOTIMPL;
368 static HRESULT WINAPI ID3DXEffectImpl_GetVector(ID3DXEffect* iface, D3DXHANDLE parameter, D3DXVECTOR4* vector)
370 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
372 FIXME("(%p)->(%p, %p): stub\n", This, parameter, vector);
374 return E_NOTIMPL;
377 static HRESULT WINAPI ID3DXEffectImpl_SetVectorArray(ID3DXEffect* iface, D3DXHANDLE parameter, CONST D3DXVECTOR4* vector, UINT count)
379 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
381 FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, vector, count);
383 return E_NOTIMPL;
386 static HRESULT WINAPI ID3DXEffectImpl_GetVectorArray(ID3DXEffect* iface, D3DXHANDLE parameter, D3DXVECTOR4* vector, UINT count)
388 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
390 FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, vector, count);
392 return E_NOTIMPL;
395 static HRESULT WINAPI ID3DXEffectImpl_SetMatrix(ID3DXEffect* iface, D3DXHANDLE parameter, CONST D3DXMATRIX* matrix)
397 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
399 FIXME("(%p)->(%p, %p): stub\n", This, parameter, matrix);
401 return E_NOTIMPL;
404 static HRESULT WINAPI ID3DXEffectImpl_GetMatrix(ID3DXEffect* iface, D3DXHANDLE parameter, D3DXMATRIX* matrix)
406 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
408 FIXME("(%p)->(%p, %p): stub\n", This, parameter, matrix);
410 return E_NOTIMPL;
413 static HRESULT WINAPI ID3DXEffectImpl_SetMatrixArray(ID3DXEffect* iface, D3DXHANDLE parameter, CONST D3DXMATRIX* matrix, UINT count)
415 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
417 FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, matrix, count);
419 return E_NOTIMPL;
422 static HRESULT WINAPI ID3DXEffectImpl_GetMatrixArray(ID3DXEffect* iface, D3DXHANDLE parameter, D3DXMATRIX* matrix, UINT count)
424 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
426 FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, matrix, count);
428 return E_NOTIMPL;
431 static HRESULT WINAPI ID3DXEffectImpl_SetMatrixPointerArray(ID3DXEffect* iface, D3DXHANDLE parameter, CONST D3DXMATRIX** matrix, UINT count)
433 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
435 FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, matrix, count);
437 return E_NOTIMPL;
440 static HRESULT WINAPI ID3DXEffectImpl_GetMatrixPointerArray(ID3DXEffect* iface, D3DXHANDLE parameter, D3DXMATRIX** matrix, UINT count)
442 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
444 FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, matrix, count);
446 return E_NOTIMPL;
449 static HRESULT WINAPI ID3DXEffectImpl_SetMatrixTranspose(ID3DXEffect* iface, D3DXHANDLE parameter, CONST D3DXMATRIX* matrix)
451 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
453 FIXME("(%p)->(%p, %p): stub\n", This, parameter, matrix);
455 return E_NOTIMPL;
458 static HRESULT WINAPI ID3DXEffectImpl_GetMatrixTranspose(ID3DXEffect* iface, D3DXHANDLE parameter, D3DXMATRIX* matrix)
460 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
462 FIXME("(%p)->(%p, %p): stub\n", This, parameter, matrix);
464 return E_NOTIMPL;
467 static HRESULT WINAPI ID3DXEffectImpl_SetMatrixTransposeArray(ID3DXEffect* iface, D3DXHANDLE parameter, CONST D3DXMATRIX* matrix, UINT count)
469 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
471 FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, matrix, count);
473 return E_NOTIMPL;
476 static HRESULT WINAPI ID3DXEffectImpl_GetMatrixTransposeArray(ID3DXEffect* iface, D3DXHANDLE parameter, D3DXMATRIX* matrix, UINT count)
478 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
480 FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, matrix, count);
482 return E_NOTIMPL;
485 static HRESULT WINAPI ID3DXEffectImpl_SetMatrixTransposePointerArray(ID3DXEffect* iface, D3DXHANDLE parameter, CONST D3DXMATRIX** matrix, UINT count)
487 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
489 FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, matrix, count);
491 return E_NOTIMPL;
494 static HRESULT WINAPI ID3DXEffectImpl_GetMatrixTransposePointerArray(ID3DXEffect* iface, D3DXHANDLE parameter, D3DXMATRIX** matrix, UINT count)
496 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
498 FIXME("(%p)->(%p, %p, %u): stub\n", This, parameter, matrix, count);
500 return E_NOTIMPL;
503 static HRESULT WINAPI ID3DXEffectImpl_SetString(ID3DXEffect* iface, D3DXHANDLE parameter, LPCSTR string)
505 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
507 FIXME("(%p)->(%p, %p): stub\n", This, parameter, string);
509 return E_NOTIMPL;
512 static HRESULT WINAPI ID3DXEffectImpl_GetString(ID3DXEffect* iface, D3DXHANDLE parameter, LPCSTR* string)
514 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
516 FIXME("(%p)->(%p, %p): stub\n", This, parameter, string);
518 return E_NOTIMPL;
521 static HRESULT WINAPI ID3DXEffectImpl_SetTexture(ID3DXEffect* iface, D3DXHANDLE parameter, LPDIRECT3DBASETEXTURE9 texture)
523 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
525 FIXME("(%p)->(%p, %p): stub\n", This, parameter, texture);
527 return E_NOTIMPL;
530 static HRESULT WINAPI ID3DXEffectImpl_GetTexture(ID3DXEffect* iface, D3DXHANDLE parameter, LPDIRECT3DBASETEXTURE9* texture)
532 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
534 FIXME("(%p)->(%p, %p): stub\n", This, parameter, texture);
536 return E_NOTIMPL;
539 static HRESULT WINAPI ID3DXEffectImpl_GetPixelShader(ID3DXEffect* iface, D3DXHANDLE parameter, LPDIRECT3DPIXELSHADER9* pshader)
541 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
543 FIXME("(%p)->(%p, %p): stub\n", This, parameter, pshader);
545 return E_NOTIMPL;
548 static HRESULT WINAPI ID3DXEffectImpl_GetVertexShader(ID3DXEffect* iface, D3DXHANDLE parameter, LPDIRECT3DVERTEXSHADER9* vshader)
550 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
552 FIXME("(%p)->(%p, %p): stub\n", This, parameter, vshader);
554 return E_NOTIMPL;
557 static HRESULT WINAPI ID3DXEffectImpl_SetArrayRange(ID3DXEffect* iface, D3DXHANDLE parameter, UINT start, UINT end)
559 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
561 FIXME("(%p)->(%p, %u, %u): stub\n", This, parameter, start, end);
563 return E_NOTIMPL;
566 /*** ID3DXEffect methods ***/
567 static HRESULT WINAPI ID3DXEffectImpl_GetPool(ID3DXEffect* iface, LPD3DXEFFECTPOOL* pool)
569 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
571 FIXME("(%p)->(%p): stub\n", This, pool);
573 return E_NOTIMPL;
576 static HRESULT WINAPI ID3DXEffectImpl_SetTechnique(ID3DXEffect* iface, D3DXHANDLE technique)
578 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
580 FIXME("(%p)->(%p): stub\n", This, technique);
582 return E_NOTIMPL;
585 static D3DXHANDLE WINAPI ID3DXEffectImpl_GetCurrentTechnique(ID3DXEffect* iface)
587 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
589 FIXME("(%p)->(): stub\n", This);
591 return NULL;
594 static HRESULT WINAPI ID3DXEffectImpl_ValidateTechnique(ID3DXEffect* iface, D3DXHANDLE technique)
596 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
598 FIXME("(%p)->(%p): stub\n", This, technique);
600 return D3D_OK;
603 static HRESULT WINAPI ID3DXEffectImpl_FindNextValidTechnique(ID3DXEffect* iface, D3DXHANDLE technique, D3DXHANDLE* next_technique)
605 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
607 FIXME("(%p)->(%p, %p): stub\n", This, technique, next_technique);
609 return E_NOTIMPL;
612 static BOOL WINAPI ID3DXEffectImpl_IsParameterUsed(ID3DXEffect* iface, D3DXHANDLE parameter, D3DXHANDLE technique)
614 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
616 FIXME("(%p)->(%p, %p): stub\n", This, parameter, technique);
618 return FALSE;
621 static HRESULT WINAPI ID3DXEffectImpl_Begin(ID3DXEffect* iface, UINT *passes, DWORD flags)
623 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
625 FIXME("(%p)->(%p, %#x): stub\n", This, passes, flags);
627 return E_NOTIMPL;
630 static HRESULT WINAPI ID3DXEffectImpl_BeginPass(ID3DXEffect* iface, UINT pass)
632 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
634 FIXME("(%p)->(%u): stub\n", This, pass);
636 return E_NOTIMPL;
639 static HRESULT WINAPI ID3DXEffectImpl_CommitChanges(ID3DXEffect* iface)
641 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
643 FIXME("(%p)->(): stub\n", This);
645 return E_NOTIMPL;
648 static HRESULT WINAPI ID3DXEffectImpl_EndPass(ID3DXEffect* iface)
650 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
652 FIXME("(%p)->(): stub\n", This);
654 return E_NOTIMPL;
657 static HRESULT WINAPI ID3DXEffectImpl_End(ID3DXEffect* iface)
659 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
661 FIXME("(%p)->(): stub\n", This);
663 return E_NOTIMPL;
666 static HRESULT WINAPI ID3DXEffectImpl_GetDevice(ID3DXEffect* iface, LPDIRECT3DDEVICE9* device)
668 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
670 FIXME("(%p)->(%p): stub\n", This, device);
672 return E_NOTIMPL;
675 static HRESULT WINAPI ID3DXEffectImpl_OnLostDevice(ID3DXEffect* iface)
677 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
679 FIXME("(%p)->(): stub\n", This);
681 return E_NOTIMPL;
684 static HRESULT WINAPI ID3DXEffectImpl_OnResetDevice(ID3DXEffect* iface)
686 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
688 FIXME("(%p)->(): stub\n", This);
690 return E_NOTIMPL;
693 static HRESULT WINAPI ID3DXEffectImpl_SetStateManager(ID3DXEffect* iface, LPD3DXEFFECTSTATEMANAGER manager)
695 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
697 FIXME("(%p)->(%p): stub\n", This, manager);
699 return E_NOTIMPL;
702 static HRESULT WINAPI ID3DXEffectImpl_GetStateManager(ID3DXEffect* iface, LPD3DXEFFECTSTATEMANAGER* manager)
704 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
706 FIXME("(%p)->(%p): stub\n", This, manager);
708 return E_NOTIMPL;
711 static HRESULT WINAPI ID3DXEffectImpl_BeginParameterBlock(ID3DXEffect* iface)
713 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
715 FIXME("(%p)->(): stub\n", This);
717 return E_NOTIMPL;
720 static D3DXHANDLE WINAPI ID3DXEffectImpl_EndParameterBlock(ID3DXEffect* iface)
722 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
724 FIXME("(%p)->(): stub\n", This);
726 return NULL;
729 static HRESULT WINAPI ID3DXEffectImpl_ApplyParameterBlock(ID3DXEffect* iface, D3DXHANDLE parameter_block)
731 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
733 FIXME("(%p)->(%p): stub\n", This, parameter_block);
735 return E_NOTIMPL;
738 static HRESULT WINAPI ID3DXEffectImpl_DeleteParameterBlock(ID3DXEffect* iface, D3DXHANDLE parameter_block)
740 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
742 FIXME("(%p)->(%p): stub\n", This, parameter_block);
744 return E_NOTIMPL;
747 static HRESULT WINAPI ID3DXEffectImpl_CloneEffect(ID3DXEffect* iface, LPDIRECT3DDEVICE9 device, LPD3DXEFFECT* effect)
749 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
751 FIXME("(%p)->(%p, %p): stub\n", This, device, effect);
753 return E_NOTIMPL;
756 static HRESULT WINAPI ID3DXEffectImpl_SetRawValue(ID3DXEffect* iface, D3DXHANDLE parameter, LPCVOID data, UINT byte_offset, UINT bytes)
758 ID3DXEffectImpl *This = (ID3DXEffectImpl *)iface;
760 FIXME("(%p)->(%p, %p, %u, %u): stub\n", This, parameter, data, byte_offset, bytes);
762 return E_NOTIMPL;
765 static const struct ID3DXEffectVtbl ID3DXEffect_Vtbl =
767 /*** IUnknown methods ***/
768 ID3DXEffectImpl_QueryInterface,
769 ID3DXEffectImpl_AddRef,
770 ID3DXEffectImpl_Release,
771 /*** ID3DXBaseEffect methods ***/
772 ID3DXEffectImpl_GetDesc,
773 ID3DXEffectImpl_GetParameterDesc,
774 ID3DXEffectImpl_GetTechniqueDesc,
775 ID3DXEffectImpl_GetPassDesc,
776 ID3DXEffectImpl_GetFunctionDesc,
777 ID3DXEffectImpl_GetParameter,
778 ID3DXEffectImpl_GetParameterByName,
779 ID3DXEffectImpl_GetParameterBySemantic,
780 ID3DXEffectImpl_GetParameterElement,
781 ID3DXEffectImpl_GetTechnique,
782 ID3DXEffectImpl_GetTechniqueByName,
783 ID3DXEffectImpl_GetPass,
784 ID3DXEffectImpl_GetPassByName,
785 ID3DXEffectImpl_GetFunction,
786 ID3DXEffectImpl_GetFunctionByName,
787 ID3DXEffectImpl_GetAnnotation,
788 ID3DXEffectImpl_GetAnnotationByName,
789 ID3DXEffectImpl_SetValue,
790 ID3DXEffectImpl_GetValue,
791 ID3DXEffectImpl_SetBool,
792 ID3DXEffectImpl_GetBool,
793 ID3DXEffectImpl_SetBoolArray,
794 ID3DXEffectImpl_GetBoolArray,
795 ID3DXEffectImpl_SetInt,
796 ID3DXEffectImpl_GetInt,
797 ID3DXEffectImpl_SetIntArray,
798 ID3DXEffectImpl_GetIntArray,
799 ID3DXEffectImpl_SetFloat,
800 ID3DXEffectImpl_GetFloat,
801 ID3DXEffectImpl_SetFloatArray,
802 ID3DXEffectImpl_GetFloatArray,
803 ID3DXEffectImpl_SetVector,
804 ID3DXEffectImpl_GetVector,
805 ID3DXEffectImpl_SetVectorArray,
806 ID3DXEffectImpl_GetVectorArray,
807 ID3DXEffectImpl_SetMatrix,
808 ID3DXEffectImpl_GetMatrix,
809 ID3DXEffectImpl_SetMatrixArray,
810 ID3DXEffectImpl_GetMatrixArray,
811 ID3DXEffectImpl_SetMatrixPointerArray,
812 ID3DXEffectImpl_GetMatrixPointerArray,
813 ID3DXEffectImpl_SetMatrixTranspose,
814 ID3DXEffectImpl_GetMatrixTranspose,
815 ID3DXEffectImpl_SetMatrixTransposeArray,
816 ID3DXEffectImpl_GetMatrixTransposeArray,
817 ID3DXEffectImpl_SetMatrixTransposePointerArray,
818 ID3DXEffectImpl_GetMatrixTransposePointerArray,
819 ID3DXEffectImpl_SetString,
820 ID3DXEffectImpl_GetString,
821 ID3DXEffectImpl_SetTexture,
822 ID3DXEffectImpl_GetTexture,
823 ID3DXEffectImpl_GetPixelShader,
824 ID3DXEffectImpl_GetVertexShader,
825 ID3DXEffectImpl_SetArrayRange,
826 /*** ID3DXEffect methods ***/
827 ID3DXEffectImpl_GetPool,
828 ID3DXEffectImpl_SetTechnique,
829 ID3DXEffectImpl_GetCurrentTechnique,
830 ID3DXEffectImpl_ValidateTechnique,
831 ID3DXEffectImpl_FindNextValidTechnique,
832 ID3DXEffectImpl_IsParameterUsed,
833 ID3DXEffectImpl_Begin,
834 ID3DXEffectImpl_BeginPass,
835 ID3DXEffectImpl_CommitChanges,
836 ID3DXEffectImpl_EndPass,
837 ID3DXEffectImpl_End,
838 ID3DXEffectImpl_GetDevice,
839 ID3DXEffectImpl_OnLostDevice,
840 ID3DXEffectImpl_OnResetDevice,
841 ID3DXEffectImpl_SetStateManager,
842 ID3DXEffectImpl_GetStateManager,
843 ID3DXEffectImpl_BeginParameterBlock,
844 ID3DXEffectImpl_EndParameterBlock,
845 ID3DXEffectImpl_ApplyParameterBlock,
846 ID3DXEffectImpl_DeleteParameterBlock,
847 ID3DXEffectImpl_CloneEffect,
848 ID3DXEffectImpl_SetRawValue
851 HRESULT WINAPI D3DXCreateEffectEx(LPDIRECT3DDEVICE9 device,
852 LPCVOID srcdata,
853 UINT srcdatalen,
854 CONST D3DXMACRO* defines,
855 LPD3DXINCLUDE include,
856 LPCSTR skip_constants,
857 DWORD flags,
858 LPD3DXEFFECTPOOL pool,
859 LPD3DXEFFECT* effect,
860 LPD3DXBUFFER* compilation_errors)
862 ID3DXEffectImpl* object;
864 FIXME("(%p, %p, %u, %p, %p, %p, %#x, %p, %p, %p): semi-stub\n", device, srcdata, srcdatalen, defines, include,
865 skip_constants, flags, pool, effect, compilation_errors);
867 if (!device || !srcdata)
868 return D3DERR_INVALIDCALL;
870 if (!srcdatalen)
871 return E_FAIL;
873 /* Native dll allows effect to be null so just return D3D_OK after doing basic checks */
874 if (!effect)
875 return D3D_OK;
877 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ID3DXEffectImpl));
878 if (!object)
880 ERR("Out of memory\n");
881 return E_OUTOFMEMORY;
884 object->lpVtbl = &ID3DXEffect_Vtbl;
885 object->ref = 1;
887 *effect = (LPD3DXEFFECT)object;
889 return D3D_OK;
892 HRESULT WINAPI D3DXCreateEffect(LPDIRECT3DDEVICE9 device,
893 LPCVOID srcdata,
894 UINT srcdatalen,
895 CONST D3DXMACRO* defines,
896 LPD3DXINCLUDE include,
897 DWORD flags,
898 LPD3DXEFFECTPOOL pool,
899 LPD3DXEFFECT* effect,
900 LPD3DXBUFFER* compilation_errors)
902 TRACE("(%p, %p, %u, %p, %p, %#x, %p, %p, %p): Forwarded to D3DXCreateEffectEx\n", device, srcdata, srcdatalen, defines,
903 include, flags, pool, effect, compilation_errors);
905 return D3DXCreateEffectEx(device, srcdata, srcdatalen, defines, include, NULL, flags, pool, effect, compilation_errors);
908 HRESULT WINAPI D3DXCreateEffectCompiler(LPCSTR srcdata,
909 UINT srcdatalen,
910 CONST D3DXMACRO* defines,
911 LPD3DXINCLUDE include,
912 DWORD flags,
913 LPD3DXEFFECTCOMPILER* compiler,
914 LPD3DXBUFFER* parse_errors)
916 FIXME("(%p, %u, %p, %p, %#x, %p, %p): stub\n", srcdata, srcdatalen, defines, include, flags, compiler, parse_errors);
918 return E_NOTIMPL;
921 static const struct ID3DXEffectPoolVtbl ID3DXEffectPool_Vtbl;
923 typedef struct ID3DXEffectPoolImpl {
924 const ID3DXEffectPoolVtbl *lpVtbl;
925 LONG ref;
926 } ID3DXEffectPoolImpl;
928 /*** IUnknown methods ***/
929 static HRESULT WINAPI ID3DXEffectPoolImpl_QueryInterface(ID3DXEffectPool* iface, REFIID riid, void** object)
931 ID3DXEffectPoolImpl *This = (ID3DXEffectPoolImpl *)iface;
933 TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), object);
935 if (IsEqualGUID(riid, &IID_IUnknown) ||
936 IsEqualGUID(riid, &IID_ID3DXEffectPool))
938 This->lpVtbl->AddRef(iface);
939 *object = This;
940 return S_OK;
943 WARN("Interface %s not found\n", debugstr_guid(riid));
945 return E_NOINTERFACE;
948 static ULONG WINAPI ID3DXEffectPoolImpl_AddRef(ID3DXEffectPool* iface)
950 ID3DXEffectPoolImpl *This = (ID3DXEffectPoolImpl *)iface;
952 TRACE("(%p)->(): AddRef from %u\n", This, This->ref);
954 return InterlockedIncrement(&This->ref);
957 static ULONG WINAPI ID3DXEffectPoolImpl_Release(ID3DXEffectPool* iface)
959 ID3DXEffectPoolImpl *This = (ID3DXEffectPoolImpl *)iface;
960 ULONG ref = InterlockedDecrement(&This->ref);
962 TRACE("(%p)->(): Release from %u\n", This, ref + 1);
964 if (!ref)
965 HeapFree(GetProcessHeap(), 0, This);
967 return ref;
970 static const struct ID3DXEffectPoolVtbl ID3DXEffectPool_Vtbl =
972 /*** IUnknown methods ***/
973 ID3DXEffectPoolImpl_QueryInterface,
974 ID3DXEffectPoolImpl_AddRef,
975 ID3DXEffectPoolImpl_Release
978 HRESULT WINAPI D3DXCreateEffectPool(LPD3DXEFFECTPOOL* pool)
980 ID3DXEffectPoolImpl* object;
982 TRACE("(%p)\n", pool);
984 if (!pool)
985 return D3DERR_INVALIDCALL;
987 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ID3DXEffectImpl));
988 if (!object)
990 ERR("Out of memory\n");
991 return E_OUTOFMEMORY;
994 object->lpVtbl = &ID3DXEffectPool_Vtbl;
995 object->ref = 1;
997 *pool = (LPD3DXEFFECTPOOL)object;
999 return S_OK;
1002 HRESULT WINAPI D3DXCreateEffectFromFileExW(LPDIRECT3DDEVICE9 device, LPCWSTR srcfile,
1003 const D3DXMACRO *defines, LPD3DXINCLUDE include, LPCSTR skipconstants, DWORD flags,
1004 LPD3DXEFFECTPOOL pool, LPD3DXEFFECT *effect, LPD3DXBUFFER *compilationerrors)
1006 LPVOID buffer;
1007 HRESULT ret;
1008 DWORD size;
1010 TRACE("(%s): relay\n", debugstr_w(srcfile));
1012 if (!device || !srcfile || !defines)
1013 return D3DERR_INVALIDCALL;
1015 ret = map_view_of_file(srcfile, &buffer, &size);
1017 if (FAILED(ret))
1018 return D3DXERR_INVALIDDATA;
1020 ret = D3DXCreateEffectEx(device, buffer, size, defines, include, skipconstants, flags, pool, effect, compilationerrors);
1021 UnmapViewOfFile(buffer);
1023 return ret;
1026 HRESULT WINAPI D3DXCreateEffectFromFileExA(LPDIRECT3DDEVICE9 device, LPCSTR srcfile,
1027 const D3DXMACRO *defines, LPD3DXINCLUDE include, LPCSTR skipconstants, DWORD flags,
1028 LPD3DXEFFECTPOOL pool, LPD3DXEFFECT *effect, LPD3DXBUFFER *compilationerrors)
1030 LPWSTR srcfileW;
1031 HRESULT ret;
1032 DWORD len;
1034 TRACE("(void): relay\n");
1036 if (!srcfile || !defines)
1037 return D3DERR_INVALIDCALL;
1039 len = MultiByteToWideChar(CP_ACP, 0, srcfile, -1, NULL, 0);
1040 srcfileW = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len * sizeof(WCHAR));
1041 MultiByteToWideChar(CP_ACP, 0, srcfile, -1, srcfileW, len);
1043 ret = D3DXCreateEffectFromFileExW(device, srcfileW, defines, include, skipconstants, flags, pool, effect, compilationerrors);
1044 HeapFree(GetProcessHeap(), 0, srcfileW);
1046 return ret;
1049 HRESULT WINAPI D3DXCreateEffectFromFileW(LPDIRECT3DDEVICE9 device, LPCWSTR srcfile,
1050 const D3DXMACRO *defines, LPD3DXINCLUDE include, DWORD flags, LPD3DXEFFECTPOOL pool,
1051 LPD3DXEFFECT *effect, LPD3DXBUFFER *compilationerrors)
1053 TRACE("(void): relay\n");
1054 return D3DXCreateEffectFromFileExW(device, srcfile, defines, include, NULL, flags, pool, effect, compilationerrors);
1057 HRESULT WINAPI D3DXCreateEffectFromFileA(LPDIRECT3DDEVICE9 device, LPCSTR srcfile,
1058 const D3DXMACRO *defines, LPD3DXINCLUDE include, DWORD flags, LPD3DXEFFECTPOOL pool,
1059 LPD3DXEFFECT *effect, LPD3DXBUFFER *compilationerrors)
1061 TRACE("(void): relay\n");
1062 return D3DXCreateEffectFromFileExA(device, srcfile, defines, include, NULL, flags, pool, effect, compilationerrors);
1065 HRESULT WINAPI D3DXCreateEffectFromResourceExW(LPDIRECT3DDEVICE9 device, HMODULE srcmodule, LPCWSTR srcresource,
1066 const D3DXMACRO *defines, LPD3DXINCLUDE include, LPCSTR skipconstants, DWORD flags,
1067 LPD3DXEFFECTPOOL pool, LPD3DXEFFECT *effect, LPD3DXBUFFER *compilationerrors)
1069 HRSRC resinfo;
1071 TRACE("(%p, %s): relay\n", srcmodule, debugstr_w(srcresource));
1073 if (!device || !defines)
1074 return D3DERR_INVALIDCALL;
1076 resinfo = FindResourceW(srcmodule, srcresource, (LPCWSTR) RT_RCDATA);
1078 if (resinfo)
1080 LPVOID buffer;
1081 HRESULT ret;
1082 DWORD size;
1084 ret = load_resource_into_memory(srcmodule, resinfo, &buffer, &size);
1086 if (FAILED(ret))
1087 return D3DXERR_INVALIDDATA;
1089 return D3DXCreateEffectEx(device, buffer, size, defines, include, skipconstants, flags, pool, effect, compilationerrors);
1092 return D3DXERR_INVALIDDATA;
1095 HRESULT WINAPI D3DXCreateEffectFromResourceExA(LPDIRECT3DDEVICE9 device, HMODULE srcmodule, LPCSTR srcresource,
1096 const D3DXMACRO *defines, LPD3DXINCLUDE include, LPCSTR skipconstants, DWORD flags,
1097 LPD3DXEFFECTPOOL pool, LPD3DXEFFECT *effect, LPD3DXBUFFER *compilationerrors)
1099 HRSRC resinfo;
1101 TRACE("(%p, %s): relay\n", srcmodule, debugstr_a(srcresource));
1103 if (!device || !defines)
1104 return D3DERR_INVALIDCALL;
1106 resinfo = FindResourceA(srcmodule, srcresource, (LPCSTR) RT_RCDATA);
1108 if (resinfo)
1110 LPVOID buffer;
1111 HRESULT ret;
1112 DWORD size;
1114 ret = load_resource_into_memory(srcmodule, resinfo, &buffer, &size);
1116 if (FAILED(ret))
1117 return D3DXERR_INVALIDDATA;
1119 return D3DXCreateEffectEx(device, buffer, size, defines, include, skipconstants, flags, pool, effect, compilationerrors);
1122 return D3DXERR_INVALIDDATA;
1125 HRESULT WINAPI D3DXCreateEffectFromResourceW(LPDIRECT3DDEVICE9 device, HMODULE srcmodule, LPCWSTR srcresource,
1126 const D3DXMACRO *defines, LPD3DXINCLUDE include, DWORD flags, LPD3DXEFFECTPOOL pool,
1127 LPD3DXEFFECT *effect, LPD3DXBUFFER *compilationerrors)
1129 TRACE("(void): relay\n");
1130 return D3DXCreateEffectFromResourceExW(device, srcmodule, srcresource, defines, include, NULL, flags, pool, effect, compilationerrors);
1133 HRESULT WINAPI D3DXCreateEffectFromResourceA(LPDIRECT3DDEVICE9 device, HMODULE srcmodule, LPCSTR srcresource,
1134 const D3DXMACRO *defines, LPD3DXINCLUDE include, DWORD flags, LPD3DXEFFECTPOOL pool,
1135 LPD3DXEFFECT *effect, LPD3DXBUFFER *compilationerrors)
1137 TRACE("(void): relay\n");
1138 return D3DXCreateEffectFromResourceExA(device, srcmodule, srcresource, defines, include, NULL, flags, pool, effect, compilationerrors);
1141 HRESULT WINAPI D3DXCreateEffectCompilerFromFileW(LPCWSTR srcfile, const D3DXMACRO *defines, LPD3DXINCLUDE include,
1142 DWORD flags, LPD3DXEFFECTCOMPILER *effectcompiler, LPD3DXBUFFER *parseerrors)
1144 LPVOID buffer;
1145 HRESULT ret;
1146 DWORD size;
1148 TRACE("(%s): relay\n", debugstr_w(srcfile));
1150 if (!srcfile || !defines)
1151 return D3DERR_INVALIDCALL;
1153 ret = map_view_of_file(srcfile, &buffer, &size);
1155 if (FAILED(ret))
1156 return D3DXERR_INVALIDDATA;
1158 ret = D3DXCreateEffectCompiler(buffer, size, defines, include, flags, effectcompiler, parseerrors);
1159 UnmapViewOfFile(buffer);
1161 return ret;
1164 HRESULT WINAPI D3DXCreateEffectCompilerFromFileA(LPCSTR srcfile, const D3DXMACRO *defines, LPD3DXINCLUDE include,
1165 DWORD flags, LPD3DXEFFECTCOMPILER *effectcompiler, LPD3DXBUFFER *parseerrors)
1167 LPWSTR srcfileW;
1168 HRESULT ret;
1169 DWORD len;
1171 TRACE("(void): relay\n");
1173 if (!srcfile || !defines)
1174 return D3DERR_INVALIDCALL;
1176 len = MultiByteToWideChar(CP_ACP, 0, srcfile, -1, NULL, 0);
1177 srcfileW = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len * sizeof(WCHAR));
1178 MultiByteToWideChar(CP_ACP, 0, srcfile, -1, srcfileW, len);
1180 ret = D3DXCreateEffectCompilerFromFileW(srcfileW, defines, include, flags, effectcompiler, parseerrors);
1181 HeapFree(GetProcessHeap(), 0, srcfileW);
1183 return ret;
1186 HRESULT WINAPI D3DXCreateEffectCompilerFromResourceA(HMODULE srcmodule, LPCSTR srcresource, const D3DXMACRO *defines,
1187 LPD3DXINCLUDE include, DWORD flags, LPD3DXEFFECTCOMPILER *effectcompiler, LPD3DXBUFFER *parseerrors)
1189 HRSRC resinfo;
1191 TRACE("(%p, %s): relay\n", srcmodule, debugstr_a(srcresource));
1193 resinfo = FindResourceA(srcmodule, srcresource, (LPCSTR) RT_RCDATA);
1195 if (resinfo)
1197 LPVOID buffer;
1198 HRESULT ret;
1199 DWORD size;
1201 ret = load_resource_into_memory(srcmodule, resinfo, &buffer, &size);
1203 if (FAILED(ret))
1204 return D3DXERR_INVALIDDATA;
1206 return D3DXCreateEffectCompiler(buffer, size, defines, include, flags, effectcompiler, parseerrors);
1209 return D3DXERR_INVALIDDATA;
1212 HRESULT WINAPI D3DXCreateEffectCompilerFromResourceW(HMODULE srcmodule, LPCWSTR srcresource, const D3DXMACRO *defines,
1213 LPD3DXINCLUDE include, DWORD flags, LPD3DXEFFECTCOMPILER *effectcompiler, LPD3DXBUFFER *parseerrors)
1215 HRSRC resinfo;
1217 TRACE("(%p, %s): relay\n", srcmodule, debugstr_w(srcresource));
1219 resinfo = FindResourceW(srcmodule, srcresource, (LPCWSTR) RT_RCDATA);
1221 if (resinfo)
1223 LPVOID buffer;
1224 HRESULT ret;
1225 DWORD size;
1227 ret = load_resource_into_memory(srcmodule, resinfo, &buffer, &size);
1229 if (FAILED(ret))
1230 return D3DXERR_INVALIDDATA;
1232 return D3DXCreateEffectCompiler(buffer, size, defines, include, flags, effectcompiler, parseerrors);
1235 return D3DXERR_INVALIDDATA;