ReactOS 0.4.15-dev-8222-g9164419
xfile.c
Go to the documentation of this file.
1#ifdef __REACTOS__
2#include "precomp.h"
3#else
4/*
5 * Copyright (C) 2012 Christian Costa
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 *
21 */
22
23
24#include "d3dx9_private.h"
25#include "d3dx9xof.h"
26#undef MAKE_DDHRESULT
27#include "dxfile.h"
28#endif /* __REACTOS__ */
29
31
33{
34 switch (error)
35 {
45 return D3DXFERR_BADVALUE;
46 default:
47 FIXME("Cannot map error %#x\n", error);
48 return E_FAIL;
49 }
50}
51
53{
54 ID3DXFile ID3DXFile_iface;
56 IDirectXFile *dxfile;
57};
58
60{
61 ID3DXFileEnumObject ID3DXFileEnumObject_iface;
64 ID3DXFileData **children;
65};
66
68{
69 ID3DXFileData ID3DXFileData_iface;
72 IDirectXFileData *dxfile_data;
74 ID3DXFileData **children;
75};
76
77static inline struct d3dx9_file *impl_from_ID3DXFile(ID3DXFile *iface)
78{
79 return CONTAINING_RECORD(iface, struct d3dx9_file, ID3DXFile_iface);
80}
81
82static inline struct d3dx9_file_enum_object *impl_from_ID3DXFileEnumObject(ID3DXFileEnumObject *iface)
83{
85}
86
87static inline struct d3dx9_file_data *impl_from_ID3DXFileData(ID3DXFileData *iface)
88{
90}
91
92static HRESULT WINAPI d3dx9_file_data_QueryInterface(ID3DXFileData *iface, REFIID riid, void **out)
93{
94 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
95
96 if (IsEqualGUID(riid, &IID_ID3DXFileData)
98 {
99 iface->lpVtbl->AddRef(iface);
100 *out = iface;
101 return S_OK;
102 }
103
104 WARN("Interface %s not found.\n", debugstr_guid(riid));
105
106 *out = NULL;
107 return E_NOINTERFACE;
108}
109
110static ULONG WINAPI d3dx9_file_data_AddRef(ID3DXFileData *iface)
111{
112 struct d3dx9_file_data *file_data = impl_from_ID3DXFileData(iface);
113 ULONG refcount = InterlockedIncrement(&file_data->ref);
114
115 TRACE("%p increasing refcount to %u.\n", file_data, refcount);
116
117 return refcount;
118}
119
120static ULONG WINAPI d3dx9_file_data_Release(ID3DXFileData *iface)
121{
122 struct d3dx9_file_data *file_data = impl_from_ID3DXFileData(iface);
123 ULONG refcount = InterlockedDecrement(&file_data->ref);
124
125 TRACE("%p decreasing refcount to %u.\n", file_data, refcount);
126
127 if (!refcount)
128 {
129 ULONG i;
130
131 for (i = 0; i < file_data->nb_children; ++i)
132 {
133 ID3DXFileData *child = file_data->children[i];
134 child->lpVtbl->Release(child);
135 }
136 HeapFree(GetProcessHeap(), 0, file_data->children);
138 HeapFree(GetProcessHeap(), 0, file_data);
139 }
140
141 return refcount;
142}
143
144static HRESULT WINAPI d3dx9_file_data_GetEnum(ID3DXFileData *iface, ID3DXFileEnumObject **enum_object)
145{
146 FIXME("iface %p, enum_object %p stub!\n", iface, enum_object);
147
148 return E_NOTIMPL;
149}
150
151static HRESULT WINAPI d3dx9_file_data_GetName(ID3DXFileData *iface, char *name, SIZE_T *size)
152{
153 struct d3dx9_file_data *file_data = impl_from_ID3DXFileData(iface);
154 DWORD dxfile_size;
155 HRESULT ret;
156
157 TRACE("iface %p, name %p, size %p.\n", iface, name, size);
158
159 if (!size)
160 return D3DXFERR_BADVALUE;
161
162 dxfile_size = *size;
163
164 ret = IDirectXFileData_GetName(file_data->dxfile_data, name, &dxfile_size);
165 if (ret != DXFILE_OK)
167
168 if (!dxfile_size)
169 {
170 /* Contrary to d3dxof, d3dx9_36 returns an empty string with a null byte when no name is available.
171 * If the input size is 0, it returns a length of 1 without touching the buffer */
172 dxfile_size = 1;
173 if (name && *size)
174 name[0] = 0;
175 }
176
177 *size = dxfile_size;
178
179 return S_OK;
180}
181
182static HRESULT WINAPI d3dx9_file_data_GetId(ID3DXFileData *iface, GUID *guid)
183{
184 struct d3dx9_file_data *file_data = impl_from_ID3DXFileData(iface);
185 HRESULT ret;
186
187 TRACE("iface %p, guid %p.\n", iface, guid);
188
189 if (!guid)
190 return E_POINTER;
191
193 if (ret != DXFILE_OK)
195
196 return S_OK;
197}
198
199static HRESULT WINAPI d3dx9_file_data_Lock(ID3DXFileData *iface, SIZE_T *size, const void **data)
200{
201 struct d3dx9_file_data *file_data = impl_from_ID3DXFileData(iface);
202 DWORD dxfile_size;
203 HRESULT ret;
204
205 TRACE("iface %p, size %p, data %p.\n", iface, size, data);
206
207 if (!size || !data)
208 return E_POINTER;
209
210 ret = IDirectXFileData_GetData(file_data->dxfile_data, NULL, &dxfile_size, (void **)data);
211 if (ret != DXFILE_OK)
213
214 *size = dxfile_size;
215
216 return S_OK;
217}
218
219static HRESULT WINAPI d3dx9_file_data_Unlock(ID3DXFileData *iface)
220{
221 TRACE("iface %p.\n", iface);
222
223 /* Nothing to do */
224
225 return S_OK;
226}
227
228static HRESULT WINAPI d3dx9_file_data_GetType(ID3DXFileData *iface, GUID *guid)
229{
230 struct d3dx9_file_data *file_data = impl_from_ID3DXFileData(iface);
231 const GUID *dxfile_guid;
232 HRESULT ret;
233
234 TRACE("iface %p, guid %p.\n", iface, guid);
235
236 ret = IDirectXFileData_GetType(file_data->dxfile_data, &dxfile_guid);
237 if (ret != DXFILE_OK)
239
240 *guid = *dxfile_guid;
241
242 return S_OK;
243}
244
245static BOOL WINAPI d3dx9_file_data_IsReference(ID3DXFileData *iface)
246{
247 struct d3dx9_file_data *file_data = impl_from_ID3DXFileData(iface);
248
249 TRACE("iface %p.\n", iface);
250
251 return file_data->reference;
252}
253
255{
256 struct d3dx9_file_data *file_data = impl_from_ID3DXFileData(iface);
257
258 TRACE("iface %p, children %p.\n", iface, children);
259
260 if (!children)
261 return E_POINTER;
262
263 *children = file_data->nb_children;
264
265 return S_OK;
266}
267
268static HRESULT WINAPI d3dx9_file_data_GetChild(ID3DXFileData *iface, SIZE_T id, ID3DXFileData **object)
269{
270 struct d3dx9_file_data *file_data = impl_from_ID3DXFileData(iface);
271
272 TRACE("iface %p, id %#lx, object %p.\n", iface, id, object);
273
274 if (!object)
275 return E_POINTER;
276
277 *object = file_data->children[id];
278 (*object)->lpVtbl->AddRef(*object);
279
280 return S_OK;
281}
282
283static const ID3DXFileDataVtbl d3dx9_file_data_vtbl =
284{
297};
298
299static HRESULT d3dx9_file_data_create(IDirectXFileObject *dxfile_object, ID3DXFileData **ret_iface)
300{
301 struct d3dx9_file_data *object;
302 IDirectXFileObject *data_object;
303 unsigned int children_array_size = 0;
304 HRESULT ret;
305
306 TRACE("dxfile_object %p, ret_iface %p.\n", dxfile_object, ret_iface);
307
308 *ret_iface = NULL;
309
310 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
311 if (!object)
312 return E_OUTOFMEMORY;
313
314 object->ID3DXFileData_iface.lpVtbl = &d3dx9_file_data_vtbl;
315 object->ref = 1;
316
317 ret = IDirectXFileObject_QueryInterface(dxfile_object, &IID_IDirectXFileData, (void **)&object->dxfile_data);
318 if (FAILED(ret))
319 {
320 IDirectXFileDataReference *reference;
321
322 ret = IDirectXFileObject_QueryInterface(dxfile_object, &IID_IDirectXFileDataReference, (void **)&reference);
323 if (SUCCEEDED(ret))
324 {
326 IUnknown_Release(reference);
327 if (FAILED(ret))
328 {
329 HeapFree(GetProcessHeap(), 0, object);
330 return E_FAIL;
331 }
332 object->reference = TRUE;
333 }
334 else
335 {
336 FIXME("Don't know what to do with binary object\n");
337 HeapFree(GetProcessHeap(), 0, object);
338 return E_FAIL;
339 }
340 }
341
342 while (SUCCEEDED(ret = IDirectXFileData_GetNextObject(object->dxfile_data, &data_object)))
343 {
344 if (object->nb_children >= children_array_size)
345 {
346 ID3DXFileData **new_children;
347
348 if (object->children)
349 {
350 children_array_size *= 2;
351 new_children = HeapReAlloc(GetProcessHeap(), 0, object->children,
352 sizeof(*object->children) * children_array_size);
353 }
354 else
355 {
356 children_array_size = 4;
357 new_children = HeapAlloc(GetProcessHeap(), 0, sizeof(*object->children) * children_array_size);
358 }
359 if (!new_children)
360 {
362 break;
363 }
364 object->children = new_children;
365 }
366 ret = d3dx9_file_data_create(data_object, &object->children[object->nb_children]);
367 IUnknown_Release(data_object);
368 if (FAILED(ret))
369 break;
370 object->nb_children++;
371 }
373 {
374 (&object->ID3DXFileData_iface)->lpVtbl->Release(&object->ID3DXFileData_iface);
375 return ret;
376 }
377 if (object->children)
378 {
379 ID3DXFileData **new_children;
380
381 new_children = HeapReAlloc(GetProcessHeap(), 0, object->children,
382 sizeof(*object->children) * object->nb_children);
383 if (new_children)
384 object->children = new_children;
385 }
386
387 TRACE("Found %u children\n", object->nb_children);
388
389 *ret_iface = &object->ID3DXFileData_iface;
390
391 return S_OK;
392}
393
394static HRESULT WINAPI d3dx9_file_enum_object_QueryInterface(ID3DXFileEnumObject *iface, REFIID riid, void **out)
395{
396 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
397
398 if (IsEqualGUID(riid, &IID_ID3DXFileEnumObject)
400 {
401 iface->lpVtbl->AddRef(iface);
402 *out = iface;
403 return S_OK;
404 }
405
406 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
407
408 *out = NULL;
409 return E_NOINTERFACE;
410}
411
412static ULONG WINAPI d3dx9_file_enum_object_AddRef(ID3DXFileEnumObject *iface)
413{
414 struct d3dx9_file_enum_object *file_enum = impl_from_ID3DXFileEnumObject(iface);
415 ULONG refcount = InterlockedIncrement(&file_enum->ref);
416
417 TRACE("%p increasing refcount to %u.\n", file_enum, refcount);
418
419 return refcount;
420}
421
422static ULONG WINAPI d3dx9_file_enum_object_Release(ID3DXFileEnumObject *iface)
423{
424 struct d3dx9_file_enum_object *file_enum = impl_from_ID3DXFileEnumObject(iface);
425 ULONG refcount = InterlockedDecrement(&file_enum->ref);
426
427 TRACE("%p decreasing refcount to %u.\n", file_enum, refcount);
428
429 if (!refcount)
430 {
431 ULONG i;
432
433 for (i = 0; i < file_enum->nb_children; ++i)
434 {
435 ID3DXFileData *child = file_enum->children[i];
436 child->lpVtbl->Release(child);
437 }
438 HeapFree(GetProcessHeap(), 0, file_enum->children);
439 HeapFree(GetProcessHeap(), 0, file_enum);
440 }
441
442 return refcount;
443}
444
445static HRESULT WINAPI d3dx9_file_enum_object_GetFile(ID3DXFileEnumObject *iface, ID3DXFile **file)
446{
447 FIXME("iface %p, file %p stub!\n", iface, file);
448
449 return E_NOTIMPL;
450}
451
453{
454 struct d3dx9_file_enum_object *file_enum = impl_from_ID3DXFileEnumObject(iface);
455
456 TRACE("iface %p, children %p.\n", iface, children);
457
458 if (!children)
459 return E_POINTER;
460
461 *children = file_enum->nb_children;
462
463 return S_OK;
464}
465
466static HRESULT WINAPI d3dx9_file_enum_object_GetChild(ID3DXFileEnumObject *iface, SIZE_T id, ID3DXFileData **object)
467{
468 struct d3dx9_file_enum_object *file_enum = impl_from_ID3DXFileEnumObject(iface);
469
470 TRACE("iface %p, id %#lx, object %p.\n", iface, id, object);
471
472 if (!object)
473 return E_POINTER;
474
475 *object = file_enum->children[id];
476 (*object)->lpVtbl->AddRef(*object);
477
478 return S_OK;
479}
480
482 REFGUID guid, ID3DXFileData **object)
483{
484 FIXME("iface %p, guid %s, object %p stub!\n", iface, debugstr_guid(guid), object);
485
486 return E_NOTIMPL;
487}
488
490 const char *name, ID3DXFileData **object)
491{
492 FIXME("iface %p, name %s, object %p stub!\n", iface, debugstr_a(name), object);
493
494 return E_NOTIMPL;
495}
496
497static const ID3DXFileEnumObjectVtbl d3dx9_file_enum_object_vtbl =
498{
507};
508
509static HRESULT WINAPI d3dx9_file_QueryInterface(ID3DXFile *iface, REFIID riid, void **out)
510{
511 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
512
513 if (IsEqualGUID(riid, &IID_ID3DXFile)
515 {
516 iface->lpVtbl->AddRef(iface);
517 *out = iface;
518 return S_OK;
519 }
520
521 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
522
523 *out = NULL;
524 return E_NOINTERFACE;
525}
526
527static ULONG WINAPI d3dx9_file_AddRef(ID3DXFile *iface)
528{
529 struct d3dx9_file *file = impl_from_ID3DXFile(iface);
530 ULONG refcount = InterlockedIncrement(&file->ref);
531
532 TRACE("%p increasing refcount to %u.\n", file, refcount);
533
534 return refcount;
535}
536
537static ULONG WINAPI d3dx9_file_Release(ID3DXFile *iface)
538{
539 struct d3dx9_file *file = impl_from_ID3DXFile(iface);
540 ULONG refcount = InterlockedDecrement(&file->ref);
541
542 TRACE("%p decreasing refcount to %u.\n", file, refcount);
543
544 if (!refcount)
545 {
546 IDirectXFile_Release(file->dxfile);
548 }
549
550 return refcount;
551}
552
553static HRESULT WINAPI d3dx9_file_CreateEnumObject(ID3DXFile *iface, const void *source,
554 D3DXF_FILELOADOPTIONS options, ID3DXFileEnumObject **enum_object)
555{
556 struct d3dx9_file *file = impl_from_ID3DXFile(iface);
558 IDirectXFileEnumObject *dxfile_enum_object;
559 void *dxfile_source;
560 DXFILELOADOPTIONS dxfile_options;
561 DXFILELOADRESOURCE dxfile_resource;
562 DXFILELOADMEMORY dxfile_memory;
563 IDirectXFileData *data_object;
564 unsigned children_array_size = 0;
565 HRESULT ret;
566
567 TRACE("iface %p, source %p, options %#x, enum_object %p.\n", iface, source, options, enum_object);
568
569 if (!enum_object)
570 return E_POINTER;
571
572 *enum_object = NULL;
573
575 {
576 dxfile_source = (void*)source;
577 dxfile_options = DXFILELOAD_FROMFILE;
578 }
580 {
582
583 dxfile_resource.hModule = resource->hModule;
584 dxfile_resource.lpName = resource->lpName;
585 dxfile_resource.lpType = resource->lpType;
586 dxfile_source = &dxfile_resource;
587 dxfile_options = DXFILELOAD_FROMRESOURCE;
588 }
590 {
592
593 dxfile_memory.lpMemory = (void *)memory->lpMemory;
594 dxfile_memory.dSize = memory->dSize;
595 dxfile_source = &dxfile_memory;
596 dxfile_options = DXFILELOAD_FROMMEMORY;
597 }
598 else
599 {
600 FIXME("Source type %u is not handled yet\n", options);
601 return E_NOTIMPL;
602 }
603
604 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
605 if (!object)
606 return E_OUTOFMEMORY;
607
608 object->ID3DXFileEnumObject_iface.lpVtbl = &d3dx9_file_enum_object_vtbl;
609 object->ref = 1;
610
611 ret = IDirectXFile_CreateEnumObject(file->dxfile, dxfile_source, dxfile_options, &dxfile_enum_object);
612
613 if (ret != S_OK)
614 {
615 HeapFree(GetProcessHeap(), 0, object);
616 return ret;
617 }
618
619 /* Fill enum object with top level data objects */
620 while (SUCCEEDED(ret = IDirectXFileEnumObject_GetNextDataObject(dxfile_enum_object, &data_object)))
621 {
622 if (object->nb_children >= children_array_size)
623 {
624 ID3DXFileData **new_children;
625
626 if (object->children)
627 {
628 children_array_size *= 2;
629 new_children = HeapReAlloc(GetProcessHeap(), 0, object->children,
630 sizeof(*object->children) * children_array_size);
631 }
632 else
633 {
634 children_array_size = 4;
635 new_children = HeapAlloc(GetProcessHeap(), 0, sizeof(*object->children) * children_array_size);
636 }
637 if (!new_children)
638 {
640 break;
641 }
642 object->children = new_children;
643 }
644 ret = d3dx9_file_data_create((IDirectXFileObject*)data_object,
645 &object->children[object->nb_children]);
646 IUnknown_Release(data_object);
647 if (FAILED(ret))
648 break;
649 object->nb_children++;
650 }
651 if (object->children)
652 {
653 ID3DXFileData **new_children;
654
655 new_children = HeapReAlloc(GetProcessHeap(), 0, object->children,
656 sizeof(*object->children) * object->nb_children);
657 if (new_children)
658 object->children = new_children;
659 }
660
661 IDirectXFileEnumObject_Release(dxfile_enum_object);
662
664 WARN("Cannot get all top level data objects\n");
665
666 TRACE("Found %u children\n", object->nb_children);
667
668 *enum_object = &object->ID3DXFileEnumObject_iface;
669
670 return S_OK;
671}
672
673static HRESULT WINAPI d3dx9_file_CreateSaveObject(ID3DXFile *iface, const void *data,
674 D3DXF_FILESAVEOPTIONS options, D3DXF_FILEFORMAT format, ID3DXFileSaveObject **save_object)
675{
676 FIXME("iface %p, data %p, options %#x, format %#x, save_object %p stub!\n",
677 iface, data, options, format, save_object);
678
679 return E_NOTIMPL;
680}
681
682static HRESULT WINAPI d3dx9_file_RegisterTemplates(ID3DXFile *iface, const void *data, SIZE_T size)
683{
684 struct d3dx9_file *file = impl_from_ID3DXFile(iface);
685 HRESULT ret;
686
687 TRACE("iface %p, data %p, size %lu.\n", iface, data, size);
688
689 ret = IDirectXFile_RegisterTemplates(file->dxfile, (void *)data, size);
690 if (ret != DXFILE_OK)
691 {
692 WARN("Error %#x\n", ret);
694 }
695
696 return S_OK;
697}
698
699static HRESULT WINAPI d3dx9_file_RegisterEnumTemplates(ID3DXFile *iface, ID3DXFileEnumObject *enum_object)
700{
701 FIXME("iface %p, enum_object %p stub!\n", iface, enum_object);
702
703 return E_NOTIMPL;
704}
705
706static const ID3DXFileVtbl d3dx9_file_vtbl =
707{
715};
716
717HRESULT WINAPI D3DXFileCreate(ID3DXFile **d3dxfile)
718{
719 struct d3dx9_file *object;
720 HRESULT ret;
721
722 TRACE("d3dxfile %p.\n", d3dxfile);
723
724 if (!d3dxfile)
725 return E_POINTER;
726
727 *d3dxfile = NULL;
728
729 object = HeapAlloc(GetProcessHeap(), 0, sizeof(*object));
730 if (!object)
731 return E_OUTOFMEMORY;
732
733 ret = DirectXFileCreate(&object->dxfile);
734 if (ret != S_OK)
735 {
736 HeapFree(GetProcessHeap(), 0, object);
737 if (ret == E_OUTOFMEMORY)
738 return ret;
739 return E_FAIL;
740 }
741
742 object->ID3DXFile_iface.lpVtbl = &d3dx9_file_vtbl;
743 object->ref = 1;
744
745 *d3dxfile = &object->ID3DXFile_iface;
746
747 return S_OK;
748}
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
const GUID IID_IUnknown
#define FIXME(fmt,...)
Definition: debug.h:114
#define WARN(fmt,...)
Definition: debug.h:115
#define D3DXF_FILELOAD_FROMFILE
Definition: d3dx9xof.h:38
#define D3DXFERR_BADFILEVERSION
Definition: d3dx9xof.h:172
DWORD D3DXF_FILESAVEOPTIONS
Definition: d3dx9xof.h:33
#define D3DXFERR_BADFILEFLOATSIZE
Definition: d3dx9xof.h:173
#define D3DXF_FILELOAD_FROMRESOURCE
Definition: d3dx9xof.h:40
DWORD D3DXF_FILELOADOPTIONS
Definition: d3dx9xof.h:37
#define D3DXF_FILELOAD_FROMMEMORY
Definition: d3dx9xof.h:41
#define D3DXFERR_PARSEERROR
Definition: d3dx9xof.h:175
#define D3DXFERR_BADFILETYPE
Definition: d3dx9xof.h:171
DWORD D3DXF_FILEFORMAT
Definition: d3dx9xof.h:28
#define D3DXFERR_BADVALUE
Definition: d3dx9xof.h:164
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
static HRESULT WINAPI d3dx9_file_data_GetEnum(ID3DXFileData *iface, ID3DXFileEnumObject **enum_object)
Definition: xfile.c:144
static HRESULT WINAPI d3dx9_file_data_GetChild(ID3DXFileData *iface, SIZE_T id, ID3DXFileData **object)
Definition: xfile.c:268
static HRESULT WINAPI d3dx9_file_enum_object_GetDataObjectByName(ID3DXFileEnumObject *iface, const char *name, ID3DXFileData **object)
Definition: xfile.c:489
static struct d3dx9_file_enum_object * impl_from_ID3DXFileEnumObject(ID3DXFileEnumObject *iface)
Definition: xfile.c:82
static HRESULT WINAPI d3dx9_file_data_Lock(ID3DXFileData *iface, SIZE_T *size, const void **data)
Definition: xfile.c:199
static HRESULT WINAPI d3dx9_file_CreateEnumObject(ID3DXFile *iface, const void *source, D3DXF_FILELOADOPTIONS options, ID3DXFileEnumObject **enum_object)
Definition: xfile.c:553
static HRESULT WINAPI d3dx9_file_data_GetType(ID3DXFileData *iface, GUID *guid)
Definition: xfile.c:228
static HRESULT WINAPI d3dx9_file_data_Unlock(ID3DXFileData *iface)
Definition: xfile.c:219
static HRESULT WINAPI d3dx9_file_CreateSaveObject(ID3DXFile *iface, const void *data, D3DXF_FILESAVEOPTIONS options, D3DXF_FILEFORMAT format, ID3DXFileSaveObject **save_object)
Definition: xfile.c:673
static HRESULT WINAPI d3dx9_file_RegisterTemplates(ID3DXFile *iface, const void *data, SIZE_T size)
Definition: xfile.c:682
static HRESULT WINAPI d3dx9_file_enum_object_GetChildren(ID3DXFileEnumObject *iface, SIZE_T *children)
Definition: xfile.c:452
static HRESULT WINAPI d3dx9_file_QueryInterface(ID3DXFile *iface, REFIID riid, void **out)
Definition: xfile.c:509
static ULONG WINAPI d3dx9_file_data_AddRef(ID3DXFileData *iface)
Definition: xfile.c:110
static HRESULT WINAPI d3dx9_file_data_GetId(ID3DXFileData *iface, GUID *guid)
Definition: xfile.c:182
static HRESULT WINAPI d3dx9_file_RegisterEnumTemplates(ID3DXFile *iface, ID3DXFileEnumObject *enum_object)
Definition: xfile.c:699
static struct d3dx9_file_data * impl_from_ID3DXFileData(ID3DXFileData *iface)
Definition: xfile.c:87
static HRESULT WINAPI d3dx9_file_data_GetChildren(ID3DXFileData *iface, SIZE_T *children)
Definition: xfile.c:254
static ULONG WINAPI d3dx9_file_Release(ID3DXFile *iface)
Definition: xfile.c:537
static HRESULT WINAPI d3dx9_file_enum_object_GetChild(ID3DXFileEnumObject *iface, SIZE_T id, ID3DXFileData **object)
Definition: xfile.c:466
static const ID3DXFileVtbl d3dx9_file_vtbl
Definition: xfile.c:706
static HRESULT error_dxfile_to_d3dxfile(HRESULT error)
Definition: xfile.c:32
static HRESULT WINAPI d3dx9_file_data_QueryInterface(ID3DXFileData *iface, REFIID riid, void **out)
Definition: xfile.c:92
static const ID3DXFileEnumObjectVtbl d3dx9_file_enum_object_vtbl
Definition: xfile.c:497
static HRESULT WINAPI d3dx9_file_enum_object_QueryInterface(ID3DXFileEnumObject *iface, REFIID riid, void **out)
Definition: xfile.c:394
static HRESULT d3dx9_file_data_create(IDirectXFileObject *dxfile_object, ID3DXFileData **ret_iface)
Definition: xfile.c:299
static const ID3DXFileDataVtbl d3dx9_file_data_vtbl
Definition: xfile.c:283
static ULONG WINAPI d3dx9_file_enum_object_Release(ID3DXFileEnumObject *iface)
Definition: xfile.c:422
static ULONG WINAPI d3dx9_file_enum_object_AddRef(ID3DXFileEnumObject *iface)
Definition: xfile.c:412
static ULONG WINAPI d3dx9_file_data_Release(ID3DXFileData *iface)
Definition: xfile.c:120
HRESULT WINAPI D3DXFileCreate(ID3DXFile **d3dxfile)
Definition: xfile.c:717
static HRESULT WINAPI d3dx9_file_enum_object_GetFile(ID3DXFileEnumObject *iface, ID3DXFile **file)
Definition: xfile.c:445
static HRESULT WINAPI d3dx9_file_enum_object_GetDataObjectById(ID3DXFileEnumObject *iface, REFGUID guid, ID3DXFileData **object)
Definition: xfile.c:481
static HRESULT WINAPI d3dx9_file_data_GetName(ID3DXFileData *iface, char *name, SIZE_T *size)
Definition: xfile.c:151
static ULONG WINAPI d3dx9_file_AddRef(ID3DXFile *iface)
Definition: xfile.c:527
static BOOL WINAPI d3dx9_file_data_IsReference(ID3DXFileData *iface)
Definition: xfile.c:245
static struct d3dx9_file * impl_from_ID3DXFile(ID3DXFile *iface)
Definition: xfile.c:77
HRESULT WINAPI DirectXFileCreate(LPDIRECTXFILE *lplpDirectXFile)
Definition: main.c:153
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapReAlloc
Definition: compat.h:734
#define HeapFree(x, y, z)
Definition: compat.h:735
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define IDirectXFile_RegisterTemplates(p, a, b)
Definition: dxfile.h:86
DWORD DXFILELOADOPTIONS
Definition: dxfile.h:35
#define IDirectXFile_Release(p)
Definition: dxfile.h:82
#define IDirectXFileData_GetId(p, a)
Definition: dxfile.h:188
#define IDirectXFileEnumObject_GetNextDataObject(p, a)
Definition: dxfile.h:109
#define IDirectXFileEnumObject_Release(p)
Definition: dxfile.h:107
#define DXFILELOAD_FROMFILE
Definition: dxfile.h:37
#define DXFILEERR_BADFILEVERSION
Definition: dxfile.h:282
#define IDirectXFile_CreateEnumObject(p, a, b, c)
Definition: dxfile.h:84
#define DXFILEERR_BADFILEFLOATSIZE
Definition: dxfile.h:283
#define DXFILEERR_BADFILETYPE
Definition: dxfile.h:281
#define IDirectXFileData_GetType(p, a)
Definition: dxfile.h:191
#define DXFILE_OK
Definition: dxfile.h:268
#define IDirectXFileData_GetName(p, a, b)
Definition: dxfile.h:187
#define DXFILEERR_PARSEERROR
Definition: dxfile.h:286
#define IDirectXFileData_GetData(p, a, b, c)
Definition: dxfile.h:190
#define IDirectXFileObject_QueryInterface(p, a, b)
Definition: dxfile.h:158
#define DXFILELOAD_FROMRESOURCE
Definition: dxfile.h:38
#define DXFILEERR_NOMOREOBJECTS
Definition: dxfile.h:291
#define DXFILELOAD_FROMMEMORY
Definition: dxfile.h:39
#define IDirectXFileDataReference_Resolve(p, a)
Definition: dxfile.h:217
#define DXFILEERR_BADVALUE
Definition: dxfile.h:271
#define IDirectXFileData_GetNextObject(p, a)
Definition: dxfile.h:192
#define IDirectXFileData_Release(p)
Definition: dxfile.h:185
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
GLsizeiptr size
Definition: glext.h:5919
GLint reference
Definition: glext.h:11729
GLuint id
Definition: glext.h:5910
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
REFIID riid
Definition: atlbase.h:39
nsrefcnt Release()
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_guid
Definition: kernel32.h:35
#define debugstr_a
Definition: kernel32.h:31
const GUID * guid
#define error(str)
Definition: mkdosfs.c:1605
static char memory[1024 *256]
Definition: process.c:116
static HWND child
Definition: cursoricon.c:298
long LONG
Definition: pedump.c:60
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
static FILE * out
Definition: regtests2xml.c:44
#define TRACE(s)
Definition: solgame.cpp:4
LPVOID lpMemory
Definition: dxfile.h:50
HMODULE hModule
Definition: dxfile.h:44
Definition: scsiwmi.h:51
ID3DXFileData ** children
Definition: xfile.c:74
ID3DXFileData ID3DXFileData_iface
Definition: xfile.c:69
LONG ref
Definition: xfile.c:70
ULONG nb_children
Definition: xfile.c:73
IDirectXFileData * dxfile_data
Definition: xfile.c:72
BOOL reference
Definition: xfile.c:71
ID3DXFileEnumObject ID3DXFileEnumObject_iface
Definition: xfile.c:61
ID3DXFileData ** children
Definition: xfile.c:64
IDirectXFile * dxfile
Definition: xfile.c:56
ID3DXFile ID3DXFile_iface
Definition: xfile.c:54
LONG ref
Definition: xfile.c:55
Definition: fci.c:127
LONG ref
Definition: filesystem.c:120
Definition: name.c:39
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
int ret
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:2364
#define E_POINTER
Definition: winerror.h:2365