ReactOS  0.4.12-dev-685-gf36cbf7
xfile.c File Reference
#include "config.h"
#include "wine/port.h"
#include "d3dx9_private.h"
#include "d3dx9xof.h"
#include "dxfile.h"
Include dependency graph for xfile.c:

Go to the source code of this file.

Classes

struct  d3dx9_file
 
struct  d3dx9_file_enum_object
 
struct  d3dx9_file_data
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (d3dx)
 
static HRESULT error_dxfile_to_d3dxfile (HRESULT error)
 
static struct d3dx9_fileimpl_from_ID3DXFile (ID3DXFile *iface)
 
static struct d3dx9_file_enum_objectimpl_from_ID3DXFileEnumObject (ID3DXFileEnumObject *iface)
 
static struct d3dx9_file_dataimpl_from_ID3DXFileData (ID3DXFileData *iface)
 
static HRESULT WINAPI d3dx9_file_data_QueryInterface (ID3DXFileData *iface, REFIID riid, void **out)
 
static ULONG WINAPI d3dx9_file_data_AddRef (ID3DXFileData *iface)
 
static ULONG WINAPI d3dx9_file_data_Release (ID3DXFileData *iface)
 
static HRESULT WINAPI d3dx9_file_data_GetEnum (ID3DXFileData *iface, ID3DXFileEnumObject **enum_object)
 
static HRESULT WINAPI d3dx9_file_data_GetName (ID3DXFileData *iface, char *name, SIZE_T *size)
 
static HRESULT WINAPI d3dx9_file_data_GetId (ID3DXFileData *iface, GUID *guid)
 
static HRESULT WINAPI d3dx9_file_data_Lock (ID3DXFileData *iface, SIZE_T *size, const void **data)
 
static HRESULT WINAPI d3dx9_file_data_Unlock (ID3DXFileData *iface)
 
static HRESULT WINAPI d3dx9_file_data_GetType (ID3DXFileData *iface, GUID *guid)
 
static BOOL WINAPI d3dx9_file_data_IsReference (ID3DXFileData *iface)
 
static HRESULT WINAPI d3dx9_file_data_GetChildren (ID3DXFileData *iface, SIZE_T *children)
 
static HRESULT WINAPI d3dx9_file_data_GetChild (ID3DXFileData *iface, SIZE_T id, ID3DXFileData **object)
 
static HRESULT d3dx9_file_data_create (IDirectXFileObject *dxfile_object, ID3DXFileData **ret_iface)
 
static HRESULT WINAPI d3dx9_file_enum_object_QueryInterface (ID3DXFileEnumObject *iface, REFIID riid, void **out)
 
static ULONG WINAPI d3dx9_file_enum_object_AddRef (ID3DXFileEnumObject *iface)
 
static ULONG WINAPI d3dx9_file_enum_object_Release (ID3DXFileEnumObject *iface)
 
static HRESULT WINAPI d3dx9_file_enum_object_GetFile (ID3DXFileEnumObject *iface, ID3DXFile **file)
 
static HRESULT WINAPI d3dx9_file_enum_object_GetChildren (ID3DXFileEnumObject *iface, SIZE_T *children)
 
static HRESULT WINAPI d3dx9_file_enum_object_GetChild (ID3DXFileEnumObject *iface, SIZE_T id, ID3DXFileData **object)
 
static HRESULT WINAPI d3dx9_file_enum_object_GetDataObjectById (ID3DXFileEnumObject *iface, REFGUID guid, ID3DXFileData **object)
 
static HRESULT WINAPI d3dx9_file_enum_object_GetDataObjectByName (ID3DXFileEnumObject *iface, const char *name, ID3DXFileData **object)
 
static HRESULT WINAPI d3dx9_file_QueryInterface (ID3DXFile *iface, REFIID riid, void **out)
 
static ULONG WINAPI d3dx9_file_AddRef (ID3DXFile *iface)
 
static ULONG WINAPI d3dx9_file_Release (ID3DXFile *iface)
 
static HRESULT WINAPI d3dx9_file_CreateEnumObject (ID3DXFile *iface, const void *source, D3DXF_FILELOADOPTIONS options, ID3DXFileEnumObject **enum_object)
 
static HRESULT WINAPI d3dx9_file_CreateSaveObject (ID3DXFile *iface, const void *data, D3DXF_FILESAVEOPTIONS options, D3DXF_FILEFORMAT format, ID3DXFileSaveObject **save_object)
 
static HRESULT WINAPI d3dx9_file_RegisterTemplates (ID3DXFile *iface, const void *data, SIZE_T size)
 
static HRESULT WINAPI d3dx9_file_RegisterEnumTemplates (ID3DXFile *iface, ID3DXFileEnumObject *enum_object)
 
HRESULT WINAPI D3DXFileCreate (ID3DXFile **d3dxfile)
 

Variables

static const ID3DXFileDataVtbl d3dx9_file_data_vtbl
 
static const ID3DXFileEnumObjectVtbl d3dx9_file_enum_object_vtbl
 
static const ID3DXFileVtbl d3dx9_file_vtbl
 

Function Documentation

◆ d3dx9_file_AddRef()

static ULONG WINAPI d3dx9_file_AddRef ( ID3DXFile *  iface)
static

Definition at line 525 of file xfile.c.

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 }
static struct d3dx9_file * impl_from_ID3DXFile(ID3DXFile *iface)
Definition: xfile.c:75
#define TRACE(s)
Definition: solgame.cpp:4
LONG ref
Definition: filesystem.c:119
#define InterlockedIncrement
Definition: armddk.h:53
unsigned int ULONG
Definition: retypes.h:1
Definition: fci.c:126

◆ d3dx9_file_CreateEnumObject()

static HRESULT WINAPI d3dx9_file_CreateEnumObject ( ID3DXFile *  iface,
const void source,
D3DXF_FILELOADOPTIONS  options,
ID3DXFileEnumObject **  enum_object 
)
static

Definition at line 551 of file xfile.c.

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 }
#define D3DXF_FILELOAD_FROMRESOURCE
Definition: d3dx9xof.h:40
#define IDirectXFileEnumObject_Release(p)
Definition: dxfile.h:107
LPVOID lpMemory
Definition: dxfile.h:50
#define WARN(fmt,...)
Definition: debug.h:111
#define DXFILEERR_NOMOREOBJECTS
Definition: dxfile.h:291
static struct d3dx9_file * impl_from_ID3DXFile(ID3DXFile *iface)
Definition: xfile.c:75
static char memory[1024 *256]
Definition: process.c:116
#define DXFILELOAD_FROMFILE
Definition: dxfile.h:37
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define FIXME(fmt,...)
Definition: debug.h:110
HMODULE hModule
Definition: dxfile.h:44
#define IDirectXFileEnumObject_GetNextDataObject(p, a)
Definition: dxfile.h:109
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
static HRESULT d3dx9_file_data_create(IDirectXFileObject *dxfile_object, ID3DXFileData **ret_iface)
Definition: xfile.c:297
#define IDirectXFile_CreateEnumObject(p, a, b, c)
Definition: dxfile.h:84
DWORD DXFILELOADOPTIONS
Definition: dxfile.h:35
int ret
#define D3DXF_FILELOAD_FROMFILE
Definition: d3dx9xof.h:38
static const ID3DXFileEnumObjectVtbl d3dx9_file_enum_object_vtbl
Definition: xfile.c:495
#define DXFILELOAD_FROMRESOURCE
Definition: dxfile.h:38
#define S_OK
Definition: intsafe.h:59
#define HeapReAlloc
Definition: compat.h:393
#define E_NOTIMPL
Definition: ddrawi.h:99
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define D3DXF_FILELOAD_FROMMEMORY
Definition: d3dx9xof.h:41
#define E_POINTER
Definition: winerror.h:2365
#define HeapFree(x, y, z)
Definition: compat.h:394
void * object
Definition: jmemsys.h:48
#define SUCCEEDED(hr)
Definition: intsafe.h:57
Definition: fci.c:126
#define DXFILELOAD_FROMMEMORY
Definition: dxfile.h:39

◆ d3dx9_file_CreateSaveObject()

static HRESULT WINAPI d3dx9_file_CreateSaveObject ( ID3DXFile *  iface,
const void data,
D3DXF_FILESAVEOPTIONS  options,
D3DXF_FILEFORMAT  format,
ID3DXFileSaveObject **  save_object 
)
static

Definition at line 671 of file xfile.c.

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 }
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define FIXME(fmt,...)
Definition: debug.h:110
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ d3dx9_file_data_AddRef()

static ULONG WINAPI d3dx9_file_data_AddRef ( ID3DXFileData *  iface)
static

Definition at line 108 of file xfile.c.

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 }
static struct d3dx9_file_data * impl_from_ID3DXFileData(ID3DXFileData *iface)
Definition: xfile.c:85
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedIncrement
Definition: armddk.h:53
unsigned int ULONG
Definition: retypes.h:1
LONG ref
Definition: xfile.c:68

◆ d3dx9_file_data_create()

static HRESULT d3dx9_file_data_create ( IDirectXFileObject *  dxfile_object,
ID3DXFileData **  ret_iface 
)
static

Definition at line 297 of file xfile.c.

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 }
#define TRUE
Definition: types.h:120
#define DXFILEERR_NOMOREOBJECTS
Definition: dxfile.h:291
#define E_FAIL
Definition: ddrawi.h:102
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define IDirectXFileData_GetNextObject(p, a)
Definition: dxfile.h:192
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
static HRESULT d3dx9_file_data_create(IDirectXFileObject *dxfile_object, ID3DXFileData **ret_iface)
Definition: xfile.c:297
#define IDirectXFileObject_QueryInterface(p, a, b)
Definition: dxfile.h:158
int ret
GLint reference
Definition: glext.h:11729
#define IDirectXFileDataReference_Resolve(p, a)
Definition: dxfile.h:217
#define S_OK
Definition: intsafe.h:59
#define HeapReAlloc
Definition: compat.h:393
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
static const ID3DXFileDataVtbl d3dx9_file_data_vtbl
Definition: xfile.c:281
#define HeapFree(x, y, z)
Definition: compat.h:394
void * object
Definition: jmemsys.h:48
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by d3dx9_file_CreateEnumObject().

◆ d3dx9_file_data_GetChild()

static HRESULT WINAPI d3dx9_file_data_GetChild ( ID3DXFileData *  iface,
SIZE_T  id,
ID3DXFileData **  object 
)
static

Definition at line 266 of file xfile.c.

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 }
static struct d3dx9_file_data * impl_from_ID3DXFileData(ID3DXFileData *iface)
Definition: xfile.c:85
ID3DXFileData ** children
Definition: xfile.c:72
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
GLenum GLuint id
Definition: glext.h:5579
#define E_POINTER
Definition: winerror.h:2365

◆ d3dx9_file_data_GetChildren()

static HRESULT WINAPI d3dx9_file_data_GetChildren ( ID3DXFileData *  iface,
SIZE_T children 
)
static

Definition at line 252 of file xfile.c.

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 }
ULONG nb_children
Definition: xfile.c:71
static struct d3dx9_file_data * impl_from_ID3DXFileData(ID3DXFileData *iface)
Definition: xfile.c:85
ID3DXFileData ** children
Definition: xfile.c:72
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
#define E_POINTER
Definition: winerror.h:2365

◆ d3dx9_file_data_GetEnum()

static HRESULT WINAPI d3dx9_file_data_GetEnum ( ID3DXFileData *  iface,
ID3DXFileEnumObject **  enum_object 
)
static

Definition at line 142 of file xfile.c.

143 {
144  FIXME("iface %p, enum_object %p stub!\n", iface, enum_object);
145 
146  return E_NOTIMPL;
147 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ d3dx9_file_data_GetId()

static HRESULT WINAPI d3dx9_file_data_GetId ( ID3DXFileData *  iface,
GUID guid 
)
static

Definition at line 180 of file xfile.c.

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 }
static HRESULT error_dxfile_to_d3dxfile(HRESULT error)
Definition: xfile.c:30
static struct d3dx9_file_data * impl_from_ID3DXFileData(ID3DXFileData *iface)
Definition: xfile.c:85
#define DXFILE_OK
Definition: dxfile.h:268
const GUID * guid
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
IDirectXFileData * dxfile_data
Definition: xfile.c:70
int ret
#define S_OK
Definition: intsafe.h:59
#define E_POINTER
Definition: winerror.h:2365
#define IDirectXFileData_GetId(p, a)
Definition: dxfile.h:188

◆ d3dx9_file_data_GetName()

static HRESULT WINAPI d3dx9_file_data_GetName ( ID3DXFileData *  iface,
char name,
SIZE_T size 
)
static

Definition at line 149 of file xfile.c.

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 }
static HRESULT error_dxfile_to_d3dxfile(HRESULT error)
Definition: xfile.c:30
static struct d3dx9_file_data * impl_from_ID3DXFileData(ID3DXFileData *iface)
Definition: xfile.c:85
#define IDirectXFileData_GetName(p, a, b)
Definition: dxfile.h:187
#define DXFILE_OK
Definition: dxfile.h:268
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
LONG HRESULT
Definition: typedefs.h:77
#define D3DXFERR_BADVALUE
Definition: d3dx9xof.h:164
unsigned long DWORD
Definition: ntddk_ex.h:95
IDirectXFileData * dxfile_data
Definition: xfile.c:70
int ret
#define S_OK
Definition: intsafe.h:59
Definition: name.c:36

◆ d3dx9_file_data_GetType()

static HRESULT WINAPI d3dx9_file_data_GetType ( ID3DXFileData *  iface,
GUID guid 
)
static

Definition at line 226 of file xfile.c.

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 }
static HRESULT error_dxfile_to_d3dxfile(HRESULT error)
Definition: xfile.c:30
static struct d3dx9_file_data * impl_from_ID3DXFileData(ID3DXFileData *iface)
Definition: xfile.c:85
#define DXFILE_OK
Definition: dxfile.h:268
const GUID * guid
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
IDirectXFileData * dxfile_data
Definition: xfile.c:70
int ret
#define IDirectXFileData_GetType(p, a)
Definition: dxfile.h:191
#define S_OK
Definition: intsafe.h:59

◆ d3dx9_file_data_IsReference()

static BOOL WINAPI d3dx9_file_data_IsReference ( ID3DXFileData *  iface)
static

Definition at line 243 of file xfile.c.

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 }
static struct d3dx9_file_data * impl_from_ID3DXFileData(ID3DXFileData *iface)
Definition: xfile.c:85
#define TRACE(s)
Definition: solgame.cpp:4
BOOL reference
Definition: xfile.c:69

◆ d3dx9_file_data_Lock()

static HRESULT WINAPI d3dx9_file_data_Lock ( ID3DXFileData *  iface,
SIZE_T size,
const void **  data 
)
static

Definition at line 197 of file xfile.c.

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 }
static HRESULT error_dxfile_to_d3dxfile(HRESULT error)
Definition: xfile.c:30
static struct d3dx9_file_data * impl_from_ID3DXFileData(ID3DXFileData *iface)
Definition: xfile.c:85
#define DXFILE_OK
Definition: dxfile.h:268
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
IDirectXFileData * dxfile_data
Definition: xfile.c:70
int ret
#define IDirectXFileData_GetData(p, a, b, c)
Definition: dxfile.h:190
#define S_OK
Definition: intsafe.h:59
#define E_POINTER
Definition: winerror.h:2365

◆ d3dx9_file_data_QueryInterface()

static HRESULT WINAPI d3dx9_file_data_QueryInterface ( ID3DXFileData *  iface,
REFIID  riid,
void **  out 
)
static

Definition at line 90 of file xfile.c.

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 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define WARN(fmt,...)
Definition: debug.h:111
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
static FILE * out
Definition: regtests2xml.c:44
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021

◆ d3dx9_file_data_Release()

static ULONG WINAPI d3dx9_file_data_Release ( ID3DXFileData *  iface)
static

Definition at line 118 of file xfile.c.

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 }
ULONG nb_children
Definition: xfile.c:71
#define IDirectXFileData_Release(p)
Definition: dxfile.h:185
static struct d3dx9_file_data * impl_from_ID3DXFileData(ID3DXFileData *iface)
Definition: xfile.c:85
static HWND child
Definition: cursoricon.c:298
ID3DXFileData ** children
Definition: xfile.c:72
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
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
nsrefcnt Release()
IDirectXFileData * dxfile_data
Definition: xfile.c:70
#define InterlockedDecrement
Definition: armddk.h:52
unsigned int ULONG
Definition: retypes.h:1
#define HeapFree(x, y, z)
Definition: compat.h:394
LONG ref
Definition: xfile.c:68

◆ d3dx9_file_data_Unlock()

static HRESULT WINAPI d3dx9_file_data_Unlock ( ID3DXFileData *  iface)
static

Definition at line 217 of file xfile.c.

218 {
219  TRACE("iface %p.\n", iface);
220 
221  /* Nothing to do */
222 
223  return S_OK;
224 }
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ d3dx9_file_enum_object_AddRef()

static ULONG WINAPI d3dx9_file_enum_object_AddRef ( ID3DXFileEnumObject *  iface)
static

Definition at line 410 of file xfile.c.

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 }
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3dx9_file_enum_object * impl_from_ID3DXFileEnumObject(ID3DXFileEnumObject *iface)
Definition: xfile.c:80
#define InterlockedIncrement
Definition: armddk.h:53
unsigned int ULONG
Definition: retypes.h:1

◆ d3dx9_file_enum_object_GetChild()

static HRESULT WINAPI d3dx9_file_enum_object_GetChild ( ID3DXFileEnumObject *  iface,
SIZE_T  id,
ID3DXFileData **  object 
)
static

Definition at line 464 of file xfile.c.

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 }
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3dx9_file_enum_object * impl_from_ID3DXFileEnumObject(ID3DXFileEnumObject *iface)
Definition: xfile.c:80
#define S_OK
Definition: intsafe.h:59
ID3DXFileData ** children
Definition: xfile.c:62
GLenum GLuint id
Definition: glext.h:5579
#define E_POINTER
Definition: winerror.h:2365

◆ d3dx9_file_enum_object_GetChildren()

static HRESULT WINAPI d3dx9_file_enum_object_GetChildren ( ID3DXFileEnumObject *  iface,
SIZE_T children 
)
static

Definition at line 450 of file xfile.c.

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 }
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3dx9_file_enum_object * impl_from_ID3DXFileEnumObject(ID3DXFileEnumObject *iface)
Definition: xfile.c:80
#define S_OK
Definition: intsafe.h:59
ID3DXFileData ** children
Definition: xfile.c:62
#define E_POINTER
Definition: winerror.h:2365

◆ d3dx9_file_enum_object_GetDataObjectById()

static HRESULT WINAPI d3dx9_file_enum_object_GetDataObjectById ( ID3DXFileEnumObject *  iface,
REFGUID  guid,
ID3DXFileData **  object 
)
static

Definition at line 479 of file xfile.c.

481 {
482  FIXME("iface %p, guid %s, object %p stub!\n", iface, debugstr_guid(guid), object);
483 
484  return E_NOTIMPL;
485 }
const GUID * guid
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_guid
Definition: kernel32.h:35
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ d3dx9_file_enum_object_GetDataObjectByName()

static HRESULT WINAPI d3dx9_file_enum_object_GetDataObjectByName ( ID3DXFileEnumObject *  iface,
const char name,
ID3DXFileData **  object 
)
static

Definition at line 487 of file xfile.c.

489 {
490  FIXME("iface %p, name %s, object %p stub!\n", iface, debugstr_a(name), object);
491 
492  return E_NOTIMPL;
493 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_a
Definition: kernel32.h:31
#define E_NOTIMPL
Definition: ddrawi.h:99
Definition: name.c:36

◆ d3dx9_file_enum_object_GetFile()

static HRESULT WINAPI d3dx9_file_enum_object_GetFile ( ID3DXFileEnumObject *  iface,
ID3DXFile **  file 
)
static

Definition at line 443 of file xfile.c.

444 {
445  FIXME("iface %p, file %p stub!\n", iface, file);
446 
447  return E_NOTIMPL;
448 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
Definition: fci.c:126

◆ d3dx9_file_enum_object_QueryInterface()

static HRESULT WINAPI d3dx9_file_enum_object_QueryInterface ( ID3DXFileEnumObject *  iface,
REFIID  riid,
void **  out 
)
static

Definition at line 392 of file xfile.c.

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 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define WARN(fmt,...)
Definition: debug.h:111
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
static FILE * out
Definition: regtests2xml.c:44
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021

◆ d3dx9_file_enum_object_Release()

static ULONG WINAPI d3dx9_file_enum_object_Release ( ID3DXFileEnumObject *  iface)
static

Definition at line 420 of file xfile.c.

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 }
static HWND child
Definition: cursoricon.c:298
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
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
nsrefcnt Release()
#define InterlockedDecrement
Definition: armddk.h:52
static struct d3dx9_file_enum_object * impl_from_ID3DXFileEnumObject(ID3DXFileEnumObject *iface)
Definition: xfile.c:80
ID3DXFileData ** children
Definition: xfile.c:62
unsigned int ULONG
Definition: retypes.h:1
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ d3dx9_file_QueryInterface()

static HRESULT WINAPI d3dx9_file_QueryInterface ( ID3DXFile *  iface,
REFIID  riid,
void **  out 
)
static

Definition at line 507 of file xfile.c.

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 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define WARN(fmt,...)
Definition: debug.h:111
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
static FILE * out
Definition: regtests2xml.c:44
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021

◆ d3dx9_file_RegisterEnumTemplates()

static HRESULT WINAPI d3dx9_file_RegisterEnumTemplates ( ID3DXFile *  iface,
ID3DXFileEnumObject *  enum_object 
)
static

Definition at line 697 of file xfile.c.

698 {
699  FIXME("iface %p, enum_object %p stub!\n", iface, enum_object);
700 
701  return E_NOTIMPL;
702 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ d3dx9_file_RegisterTemplates()

static HRESULT WINAPI d3dx9_file_RegisterTemplates ( ID3DXFile *  iface,
const void data,
SIZE_T  size 
)
static

Definition at line 680 of file xfile.c.

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 }
static HRESULT error_dxfile_to_d3dxfile(HRESULT error)
Definition: xfile.c:30
#define WARN(fmt,...)
Definition: debug.h:111
static struct d3dx9_file * impl_from_ID3DXFile(ID3DXFile *iface)
Definition: xfile.c:75
#define DXFILE_OK
Definition: dxfile.h:268
#define IDirectXFile_RegisterTemplates(p, a, b)
Definition: dxfile.h:86
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
LONG HRESULT
Definition: typedefs.h:77
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
int ret
#define S_OK
Definition: intsafe.h:59
Definition: fci.c:126

◆ d3dx9_file_Release()

static ULONG WINAPI d3dx9_file_Release ( ID3DXFile *  iface)
static

Definition at line 535 of file xfile.c.

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 }
#define IDirectXFile_Release(p)
Definition: dxfile.h:82
static struct d3dx9_file * impl_from_ID3DXFile(ID3DXFile *iface)
Definition: xfile.c:75
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
#define InterlockedDecrement
Definition: armddk.h:52
LONG ref
Definition: filesystem.c:119
unsigned int ULONG
Definition: retypes.h:1
#define HeapFree(x, y, z)
Definition: compat.h:394
Definition: fci.c:126

◆ D3DXFileCreate()

HRESULT WINAPI D3DXFileCreate ( ID3DXFile **  d3dxfile)

Definition at line 715 of file xfile.c.

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 E_FAIL
Definition: ddrawi.h:102
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
static const ID3DXFileVtbl d3dx9_file_vtbl
Definition: xfile.c:704
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
int ret
#define S_OK
Definition: intsafe.h:59
HRESULT WINAPI DirectXFileCreate(LPDIRECTXFILE *lplpDirectXFile)
Definition: main.c:153
#define E_POINTER
Definition: winerror.h:2365
#define HeapFree(x, y, z)
Definition: compat.h:394
void * object
Definition: jmemsys.h:48

Referenced by D3DXLoadMeshFromXInMemory(), and D3DXLoadMeshHierarchyFromXInMemory().

◆ error_dxfile_to_d3dxfile()

static HRESULT error_dxfile_to_d3dxfile ( HRESULT  error)
static

Definition at line 30 of file xfile.c.

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 }
#define error(str)
Definition: mkdosfs.c:1605
#define DXFILEERR_BADVALUE
Definition: dxfile.h:271
#define DXFILEERR_BADFILETYPE
Definition: dxfile.h:281
#define E_FAIL
Definition: ddrawi.h:102
#define FIXME(fmt,...)
Definition: debug.h:110
#define DXFILEERR_PARSEERROR
Definition: dxfile.h:286
#define D3DXFERR_BADFILETYPE
Definition: d3dx9xof.h:171
#define D3DXFERR_BADVALUE
Definition: d3dx9xof.h:164
#define D3DXFERR_BADFILEFLOATSIZE
Definition: d3dx9xof.h:173
#define D3DXFERR_PARSEERROR
Definition: d3dx9xof.h:175
#define DXFILEERR_BADFILEFLOATSIZE
Definition: dxfile.h:283
#define DXFILEERR_BADFILEVERSION
Definition: dxfile.h:282
#define D3DXFERR_BADFILEVERSION
Definition: d3dx9xof.h:172

Referenced by d3dx9_file_data_GetId(), d3dx9_file_data_GetName(), d3dx9_file_data_GetType(), d3dx9_file_data_Lock(), and d3dx9_file_RegisterTemplates().

◆ impl_from_ID3DXFile()

static struct d3dx9_file* impl_from_ID3DXFile ( ID3DXFile *  iface)
inlinestatic

Definition at line 75 of file xfile.c.

76 {
77  return CONTAINING_RECORD(iface, struct d3dx9_file, ID3DXFile_iface);
78 }
ID3DXFile ID3DXFile_iface
Definition: xfile.c:52
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

Referenced by d3dx9_file_AddRef(), d3dx9_file_CreateEnumObject(), d3dx9_file_RegisterTemplates(), and d3dx9_file_Release().

◆ impl_from_ID3DXFileData()

static struct d3dx9_file_data* impl_from_ID3DXFileData ( ID3DXFileData *  iface)
inlinestatic

Definition at line 85 of file xfile.c.

86 {
87  return CONTAINING_RECORD(iface, struct d3dx9_file_data, ID3DXFileData_iface);
88 }
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

Referenced by d3dx9_file_data_AddRef(), d3dx9_file_data_GetChild(), d3dx9_file_data_GetChildren(), d3dx9_file_data_GetId(), d3dx9_file_data_GetName(), d3dx9_file_data_GetType(), d3dx9_file_data_IsReference(), d3dx9_file_data_Lock(), and d3dx9_file_data_Release().

◆ impl_from_ID3DXFileEnumObject()

static struct d3dx9_file_enum_object* impl_from_ID3DXFileEnumObject ( ID3DXFileEnumObject *  iface)
inlinestatic

Definition at line 80 of file xfile.c.

81 {
82  return CONTAINING_RECORD(iface, struct d3dx9_file_enum_object, ID3DXFileEnumObject_iface);
83 }
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

Referenced by d3dx9_file_enum_object_AddRef(), d3dx9_file_enum_object_GetChild(), d3dx9_file_enum_object_GetChildren(), and d3dx9_file_enum_object_Release().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( d3dx  )

Variable Documentation

◆ d3dx9_file_data_vtbl

const ID3DXFileDataVtbl d3dx9_file_data_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI d3dx9_file_data_GetChildren(ID3DXFileData *iface, SIZE_T *children)
Definition: xfile.c:252
static HRESULT WINAPI d3dx9_file_data_GetEnum(ID3DXFileData *iface, ID3DXFileEnumObject **enum_object)
Definition: xfile.c:142
static HRESULT WINAPI d3dx9_file_data_Unlock(ID3DXFileData *iface)
Definition: xfile.c:217
static BOOL WINAPI d3dx9_file_data_IsReference(ID3DXFileData *iface)
Definition: xfile.c:243
static HRESULT WINAPI d3dx9_file_data_GetId(ID3DXFileData *iface, GUID *guid)
Definition: xfile.c:180
static HRESULT WINAPI d3dx9_file_data_QueryInterface(ID3DXFileData *iface, REFIID riid, void **out)
Definition: xfile.c:90
static HRESULT WINAPI d3dx9_file_data_GetType(ID3DXFileData *iface, GUID *guid)
Definition: xfile.c:226
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
static HRESULT WINAPI d3dx9_file_data_GetChild(ID3DXFileData *iface, SIZE_T id, ID3DXFileData **object)
Definition: xfile.c:266
static HRESULT WINAPI d3dx9_file_data_GetName(ID3DXFileData *iface, char *name, SIZE_T *size)
Definition: xfile.c:149
static ULONG WINAPI d3dx9_file_data_AddRef(ID3DXFileData *iface)
Definition: xfile.c:108

Definition at line 281 of file xfile.c.

Referenced by d3dx9_file_data_create().

◆ d3dx9_file_enum_object_vtbl

const ID3DXFileEnumObjectVtbl d3dx9_file_enum_object_vtbl
static
Initial value:
=
{
}
static ULONG WINAPI d3dx9_file_enum_object_AddRef(ID3DXFileEnumObject *iface)
Definition: xfile.c:410
static HRESULT WINAPI d3dx9_file_enum_object_GetFile(ID3DXFileEnumObject *iface, ID3DXFile **file)
Definition: xfile.c:443
static HRESULT WINAPI d3dx9_file_enum_object_GetDataObjectById(ID3DXFileEnumObject *iface, REFGUID guid, ID3DXFileData **object)
Definition: xfile.c:479
static HRESULT WINAPI d3dx9_file_enum_object_GetDataObjectByName(ID3DXFileEnumObject *iface, const char *name, ID3DXFileData **object)
Definition: xfile.c:487
static HRESULT WINAPI d3dx9_file_enum_object_GetChild(ID3DXFileEnumObject *iface, SIZE_T id, ID3DXFileData **object)
Definition: xfile.c:464
static ULONG WINAPI d3dx9_file_enum_object_Release(ID3DXFileEnumObject *iface)
Definition: xfile.c:420
static HRESULT WINAPI d3dx9_file_enum_object_GetChildren(ID3DXFileEnumObject *iface, SIZE_T *children)
Definition: xfile.c:450
static HRESULT WINAPI d3dx9_file_enum_object_QueryInterface(ID3DXFileEnumObject *iface, REFIID riid, void **out)
Definition: xfile.c:392

Definition at line 495 of file xfile.c.

Referenced by d3dx9_file_CreateEnumObject().

◆ d3dx9_file_vtbl

const ID3DXFileVtbl d3dx9_file_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI d3dx9_file_RegisterEnumTemplates(ID3DXFile *iface, ID3DXFileEnumObject *enum_object)
Definition: xfile.c:697
static HRESULT WINAPI d3dx9_file_QueryInterface(ID3DXFile *iface, REFIID riid, void **out)
Definition: xfile.c:507
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
static ULONG WINAPI d3dx9_file_Release(ID3DXFile *iface)
Definition: xfile.c:535
static HRESULT WINAPI d3dx9_file_CreateEnumObject(ID3DXFile *iface, const void *source, D3DXF_FILELOADOPTIONS options, ID3DXFileEnumObject **enum_object)
Definition: xfile.c:551
static HRESULT WINAPI d3dx9_file_RegisterTemplates(ID3DXFile *iface, const void *data, SIZE_T size)
Definition: xfile.c:680

Definition at line 704 of file xfile.c.

Referenced by D3DXFileCreate().