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