2 * Implementation of DirectX File Interfaces
4 * Copyright 2004 Christian Costa
6 * This file contains the (internal) driver registration functions,
7 * driver enumeration APIs and DirectDraw creation functions.
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
25 #include "wine/debug.h"
32 #include "d3dxof_private.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(d3dxof
);
37 static const struct IDirectXFileVtbl IDirectXFile_Vtbl
;
38 static const struct IDirectXFileBinaryVtbl IDirectXFileBinary_Vtbl
;
39 static const struct IDirectXFileDataVtbl IDirectXFileData_Vtbl
;
40 static const struct IDirectXFileDataReferenceVtbl IDirectXFileDataReference_Vtbl
;
41 static const struct IDirectXFileEnumObjectVtbl IDirectXFileEnumObject_Vtbl
;
42 static const struct IDirectXFileObjectVtbl IDirectXFileObject_Vtbl
;
43 static const struct IDirectXFileSaveObjectVtbl IDirectXFileSaveObject_Vtbl
;
45 HRESULT
IDirectXFileImpl_Create(IUnknown
* pUnkOuter
, LPVOID
* ppObj
)
47 IDirectXFileImpl
* object
;
49 TRACE("(%p,%p)\n", pUnkOuter
, ppObj
);
51 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IDirectXFileImpl
));
53 object
->lpVtbl
.lpVtbl
= &IDirectXFile_Vtbl
;
61 /*** IUnknown methods ***/
62 static HRESULT WINAPI
IDirectXFileImpl_QueryInterface(IDirectXFile
* iface
, REFIID riid
, void** ppvObject
)
64 IDirectXFileImpl
*This
= (IDirectXFileImpl
*)iface
;
66 TRACE("(%p/%p)->(%s,%p)\n", iface
, This
, debugstr_guid(riid
), ppvObject
);
68 if (IsEqualGUID(riid
, &IID_IUnknown
)
69 || IsEqualGUID(riid
, &IID_IDirectXFile
))
71 IClassFactory_AddRef(iface
);
76 ERR("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppvObject
);
80 static ULONG WINAPI
IDirectXFileImpl_AddRef(IDirectXFile
* iface
)
82 IDirectXFileImpl
*This
= (IDirectXFileImpl
*)iface
;
83 ULONG ref
= InterlockedIncrement(&This
->ref
);
85 TRACE("(%p/%p): AddRef from %d\n", iface
, This
, ref
- 1);
90 static ULONG WINAPI
IDirectXFileImpl_Release(IDirectXFile
* iface
)
92 IDirectXFileImpl
*This
= (IDirectXFileImpl
*)iface
;
93 ULONG ref
= InterlockedDecrement(&This
->ref
);
95 TRACE("(%p/%p): ReleaseRef to %d\n", iface
, This
, ref
);
98 HeapFree(GetProcessHeap(), 0, This
);
103 /*** IDirectXFile methods ***/
104 static HRESULT WINAPI
IDirectXFileImpl_CreateEnumObject(IDirectXFile
* iface
, LPVOID pvSource
, DXFILELOADOPTIONS dwLoadOptions
, LPDIRECTXFILEENUMOBJECT
* ppEnumObj
)
107 IDirectXFileImpl
*This
= (IDirectXFileImpl
*)iface
;
108 IDirectXFileEnumObjectImpl
* object
;
110 FIXME("(%p/%p)->(%p,%x,%p) stub!\n", This
, iface
, pvSource
, dwLoadOptions
, ppEnumObj
);
112 if (dwLoadOptions
== 0)
114 FIXME("Source is a file '%s'\n", (char*)pvSource
);
117 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IDirectXFileEnumObjectImpl
));
119 object
->lpVtbl
.lpVtbl
= &IDirectXFileEnumObject_Vtbl
;
122 *ppEnumObj
= (LPDIRECTXFILEENUMOBJECT
)object
;
127 static HRESULT WINAPI
IDirectXFileImpl_CreateSaveObject(IDirectXFile
* iface
, LPCSTR szFileName
, DXFILEFORMAT dwFileFormat
, LPDIRECTXFILESAVEOBJECT
* ppSaveObj
)
129 IDirectXFileImpl
*This
= (IDirectXFileImpl
*)iface
;
131 FIXME("(%p/%p)->(%s,%x,%p) stub!\n", This
, iface
, szFileName
, dwFileFormat
, ppSaveObj
);
136 static HRESULT WINAPI
IDirectXFileImpl_RegisterTemplates(IDirectXFile
* iface
, LPVOID pvData
, DWORD cbSize
)
138 IDirectXFileImpl
*This
= (IDirectXFileImpl
*)iface
;
140 FIXME("(%p/%p)->(%p,%d) stub!\n", This
, iface
, pvData
, cbSize
);
145 static const IDirectXFileVtbl IDirectXFile_Vtbl
=
147 IDirectXFileImpl_QueryInterface
,
148 IDirectXFileImpl_AddRef
,
149 IDirectXFileImpl_Release
,
150 IDirectXFileImpl_CreateEnumObject
,
151 IDirectXFileImpl_CreateSaveObject
,
152 IDirectXFileImpl_RegisterTemplates
155 HRESULT
IDirectXFileBinaryImpl_Create(IDirectXFileBinaryImpl
** ppObj
)
157 IDirectXFileBinaryImpl
* object
;
159 TRACE("(%p)\n", ppObj
);
161 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IDirectXFileBinaryImpl
));
163 object
->lpVtbl
.lpVtbl
= &IDirectXFileBinary_Vtbl
;
171 /*** IUnknown methods ***/
172 static HRESULT WINAPI
IDirectXFileBinaryImpl_QueryInterface(IDirectXFileBinary
* iface
, REFIID riid
, void** ppvObject
)
174 IDirectXFileBinaryImpl
*This
= (IDirectXFileBinaryImpl
*)iface
;
176 TRACE("(%p/%p)->(%s,%p)\n", iface
, This
, debugstr_guid(riid
), ppvObject
);
178 if (IsEqualGUID(riid
, &IID_IUnknown
)
179 || IsEqualGUID(riid
, &IID_IDirectXFileObject
)
180 || IsEqualGUID(riid
, &IID_IDirectXFileBinary
))
182 IClassFactory_AddRef(iface
);
187 ERR("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppvObject
);
188 return E_NOINTERFACE
;
191 static ULONG WINAPI
IDirectXFileBinaryImpl_AddRef(IDirectXFileBinary
* iface
)
193 IDirectXFileBinaryImpl
*This
= (IDirectXFileBinaryImpl
*)iface
;
194 ULONG ref
= InterlockedIncrement(&This
->ref
);
196 TRACE("(%p/%p): AddRef from %d\n", iface
, This
, ref
- 1);
201 static ULONG WINAPI
IDirectXFileBinaryImpl_Release(IDirectXFileBinary
* iface
)
203 IDirectXFileBinaryImpl
*This
= (IDirectXFileBinaryImpl
*)iface
;
204 ULONG ref
= InterlockedDecrement(&This
->ref
);
206 TRACE("(%p/%p): ReleaseRef to %d\n", iface
, This
, ref
);
209 HeapFree(GetProcessHeap(), 0, This
);
214 /*** IDirectXFileObject methods ***/
215 static HRESULT WINAPI
IDirectXFileBinaryImpl_GetName(IDirectXFileBinary
* iface
, LPSTR pstrNameBuf
, LPDWORD pdwBufLen
)
218 IDirectXFileBinaryImpl
*This
= (IDirectXFileBinaryImpl
*)iface
;
220 FIXME("(%p/%p)->(%p,%p) stub!\n", This
, iface
, pstrNameBuf
, pdwBufLen
);
225 static HRESULT WINAPI
IDirectXFileBinaryImpl_GetId(IDirectXFileBinary
* iface
, LPGUID pGuid
)
227 IDirectXFileBinaryImpl
*This
= (IDirectXFileBinaryImpl
*)iface
;
229 FIXME("(%p/%p)->(%p) stub!\n", This
, iface
, pGuid
);
234 /*** IDirectXFileBinary methods ***/
235 static HRESULT WINAPI
IDirectXFileBinaryImpl_GetSize(IDirectXFileBinary
* iface
, DWORD
* pcbSize
)
237 IDirectXFileBinaryImpl
*This
= (IDirectXFileBinaryImpl
*)iface
;
239 FIXME("(%p/%p)->(%p) stub!\n", This
, iface
, pcbSize
);
244 static HRESULT WINAPI
IDirectXFileBinaryImpl_GetMimeType(IDirectXFileBinary
* iface
, LPCSTR
* pszMimeType
)
246 IDirectXFileBinaryImpl
*This
= (IDirectXFileBinaryImpl
*)iface
;
248 FIXME("(%p/%p)->(%p) stub!\n", This
, iface
, pszMimeType
);
253 static HRESULT WINAPI
IDirectXFileBinaryImpl_Read(IDirectXFileBinary
* iface
, LPVOID pvData
, DWORD cbSize
, LPDWORD pcbRead
)
255 IDirectXFileBinaryImpl
*This
= (IDirectXFileBinaryImpl
*)iface
;
257 FIXME("(%p/%p)->(%p, %d, %p) stub!\n", This
, iface
, pvData
, cbSize
, pcbRead
);
262 static const IDirectXFileBinaryVtbl IDirectXFileBinary_Vtbl
=
264 IDirectXFileBinaryImpl_QueryInterface
,
265 IDirectXFileBinaryImpl_AddRef
,
266 IDirectXFileBinaryImpl_Release
,
267 IDirectXFileBinaryImpl_GetName
,
268 IDirectXFileBinaryImpl_GetId
,
269 IDirectXFileBinaryImpl_GetSize
,
270 IDirectXFileBinaryImpl_GetMimeType
,
271 IDirectXFileBinaryImpl_Read
274 HRESULT
IDirectXFileDataImpl_Create(IDirectXFileDataImpl
** ppObj
)
276 IDirectXFileDataImpl
* object
;
278 TRACE("(%p)\n", ppObj
);
280 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IDirectXFileDataImpl
));
282 object
->lpVtbl
.lpVtbl
= &IDirectXFileData_Vtbl
;
290 /*** IUnknown methods ***/
291 static HRESULT WINAPI
IDirectXFileDataImpl_QueryInterface(IDirectXFileData
* iface
, REFIID riid
, void** ppvObject
)
293 IDirectXFileDataImpl
*This
= (IDirectXFileDataImpl
*)iface
;
295 TRACE("(%p/%p)->(%s,%p)\n", iface
, This
, debugstr_guid(riid
), ppvObject
);
297 if (IsEqualGUID(riid
, &IID_IUnknown
)
298 || IsEqualGUID(riid
, &IID_IDirectXFileObject
)
299 || IsEqualGUID(riid
, &IID_IDirectXFileData
))
301 IClassFactory_AddRef(iface
);
306 ERR("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppvObject
);
307 return E_NOINTERFACE
;
310 static ULONG WINAPI
IDirectXFileDataImpl_AddRef(IDirectXFileData
* iface
)
312 IDirectXFileDataImpl
*This
= (IDirectXFileDataImpl
*)iface
;
313 ULONG ref
= InterlockedIncrement(&This
->ref
);
315 TRACE("(%p/%p): AddRef from %d\n", iface
, This
, ref
- 1);
320 static ULONG WINAPI
IDirectXFileDataImpl_Release(IDirectXFileData
* iface
)
322 IDirectXFileDataImpl
*This
= (IDirectXFileDataImpl
*)iface
;
323 ULONG ref
= InterlockedDecrement(&This
->ref
);
325 TRACE("(%p/%p): ReleaseRef to %d\n", iface
, This
, ref
);
328 HeapFree(GetProcessHeap(), 0, This
);
333 /*** IDirectXFileObject methods ***/
334 static HRESULT WINAPI
IDirectXFileDataImpl_GetName(IDirectXFileData
* iface
, LPSTR pstrNameBuf
, LPDWORD pdwBufLen
)
337 IDirectXFileDataImpl
*This
= (IDirectXFileDataImpl
*)iface
;
339 FIXME("(%p/%p)->(%p,%p) stub!\n", This
, iface
, pstrNameBuf
, pdwBufLen
);
344 static HRESULT WINAPI
IDirectXFileDataImpl_GetId(IDirectXFileData
* iface
, LPGUID pGuid
)
346 IDirectXFileDataImpl
*This
= (IDirectXFileDataImpl
*)iface
;
348 FIXME("(%p/%p)->(%p) stub!\n", This
, iface
, pGuid
);
353 /*** IDirectXFileData methods ***/
354 static HRESULT WINAPI
IDirectXFileDataImpl_GetData(IDirectXFileData
* iface
, LPCSTR szMember
, DWORD
* pcbSize
, void** ppvData
)
356 IDirectXFileDataImpl
*This
= (IDirectXFileDataImpl
*)iface
;
358 FIXME("(%p/%p)->(%s,%p,%p) stub!\n", This
, iface
, szMember
, pcbSize
, ppvData
);
363 static HRESULT WINAPI
IDirectXFileDataImpl_GetType(IDirectXFileData
* iface
, const GUID
** pguid
)
365 IDirectXFileDataImpl
*This
= (IDirectXFileDataImpl
*)iface
;
367 FIXME("(%p/%p)->(%p) stub!\n", This
, iface
, pguid
);
372 static HRESULT WINAPI
IDirectXFileDataImpl_GetNextObject(IDirectXFileData
* iface
, LPDIRECTXFILEOBJECT
* ppChildObj
)
374 IDirectXFileDataImpl
*This
= (IDirectXFileDataImpl
*)iface
;
376 FIXME("(%p/%p)->(%p) stub!\n", This
, iface
, ppChildObj
);
381 static HRESULT WINAPI
IDirectXFileDataImpl_AddDataObject(IDirectXFileData
* iface
, LPDIRECTXFILEDATA pDataObj
)
383 IDirectXFileDataImpl
*This
= (IDirectXFileDataImpl
*)iface
;
385 FIXME("(%p/%p)->(%p) stub!\n", This
, iface
, pDataObj
);
390 static HRESULT WINAPI
IDirectXFileDataImpl_AddDataReference(IDirectXFileData
* iface
, LPCSTR szRef
, const GUID
* pguidRef
)
392 IDirectXFileDataImpl
*This
= (IDirectXFileDataImpl
*)iface
;
394 FIXME("(%p/%p)->(%s,%p) stub!\n", This
, iface
, szRef
, pguidRef
);
399 static HRESULT WINAPI
IDirectXFileDataImpl_AddBinaryObject(IDirectXFileData
* iface
, LPCSTR szName
, const GUID
* pguid
, LPCSTR szMimeType
, LPVOID pvData
, DWORD cbSize
)
401 IDirectXFileDataImpl
*This
= (IDirectXFileDataImpl
*)iface
;
403 FIXME("(%p/%p)->(%s,%p,%s,%p,%d) stub!\n", This
, iface
, szName
, pguid
, szMimeType
, pvData
, cbSize
);
408 static const IDirectXFileDataVtbl IDirectXFileData_Vtbl
=
410 IDirectXFileDataImpl_QueryInterface
,
411 IDirectXFileDataImpl_AddRef
,
412 IDirectXFileDataImpl_Release
,
413 IDirectXFileDataImpl_GetName
,
414 IDirectXFileDataImpl_GetId
,
415 IDirectXFileDataImpl_GetData
,
416 IDirectXFileDataImpl_GetType
,
417 IDirectXFileDataImpl_GetNextObject
,
418 IDirectXFileDataImpl_AddDataObject
,
419 IDirectXFileDataImpl_AddDataReference
,
420 IDirectXFileDataImpl_AddBinaryObject
423 HRESULT
IDirectXFileDataReferenceImpl_Create(IDirectXFileDataReferenceImpl
** ppObj
)
425 IDirectXFileDataReferenceImpl
* object
;
427 TRACE("(%p)\n", ppObj
);
429 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IDirectXFileDataReferenceImpl
));
431 object
->lpVtbl
.lpVtbl
= &IDirectXFileDataReference_Vtbl
;
439 /*** IUnknown methods ***/
440 static HRESULT WINAPI
IDirectXFileDataReferenceImpl_QueryInterface(IDirectXFileDataReference
* iface
, REFIID riid
, void** ppvObject
)
442 IDirectXFileDataReferenceImpl
*This
= (IDirectXFileDataReferenceImpl
*)iface
;
444 TRACE("(%p/%p)->(%s,%p)\n", iface
, This
, debugstr_guid(riid
), ppvObject
);
446 if (IsEqualGUID(riid
, &IID_IUnknown
)
447 || IsEqualGUID(riid
, &IID_IDirectXFileObject
)
448 || IsEqualGUID(riid
, &IID_IDirectXFileDataReference
))
450 IClassFactory_AddRef(iface
);
455 ERR("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppvObject
);
456 return E_NOINTERFACE
;
459 static ULONG WINAPI
IDirectXFileDataReferenceImpl_AddRef(IDirectXFileDataReference
* iface
)
461 IDirectXFileDataReferenceImpl
*This
= (IDirectXFileDataReferenceImpl
*)iface
;
462 ULONG ref
= InterlockedIncrement(&This
->ref
);
464 TRACE("(%p/%p): AddRef from %d\n", iface
, This
, ref
- 1);
469 static ULONG WINAPI
IDirectXFileDataReferenceImpl_Release(IDirectXFileDataReference
* iface
)
471 IDirectXFileDataReferenceImpl
*This
= (IDirectXFileDataReferenceImpl
*)iface
;
472 ULONG ref
= InterlockedDecrement(&This
->ref
);
474 TRACE("(%p/%p): ReleaseRef to %d\n", iface
, This
, ref
);
477 HeapFree(GetProcessHeap(), 0, This
);
482 /*** IDirectXFileObject methods ***/
483 static HRESULT WINAPI
IDirectXFileDataReferenceImpl_GetName(IDirectXFileDataReference
* iface
, LPSTR pstrNameBuf
, LPDWORD pdwBufLen
)
485 IDirectXFileDataReferenceImpl
*This
= (IDirectXFileDataReferenceImpl
*)iface
;
487 FIXME("(%p/%p)->(%p,%p) stub!\n", This
, iface
, pstrNameBuf
, pdwBufLen
);
492 static HRESULT WINAPI
IDirectXFileDataReferenceImpl_GetId(IDirectXFileDataReference
* iface
, LPGUID pGuid
)
494 IDirectXFileDataReferenceImpl
*This
= (IDirectXFileDataReferenceImpl
*)iface
;
496 FIXME("(%p/%p)->(%p) stub!\n", This
, iface
, pGuid
);
501 /*** IDirectXFileDataReference ***/
502 static HRESULT WINAPI
IDirectXFileDataReferenceImpl_Resolve(IDirectXFileDataReference
* iface
, LPDIRECTXFILEDATA
* ppDataObj
)
504 IDirectXFileDataReferenceImpl
*This
= (IDirectXFileDataReferenceImpl
*)iface
;
506 FIXME("(%p/%p)->(%p) stub!\n", This
, iface
, ppDataObj
);
511 static const IDirectXFileDataReferenceVtbl IDirectXFileDataReference_Vtbl
=
513 IDirectXFileDataReferenceImpl_QueryInterface
,
514 IDirectXFileDataReferenceImpl_AddRef
,
515 IDirectXFileDataReferenceImpl_Release
,
516 IDirectXFileDataReferenceImpl_GetName
,
517 IDirectXFileDataReferenceImpl_GetId
,
518 IDirectXFileDataReferenceImpl_Resolve
521 HRESULT
IDirectXFileEnumObjectImpl_Create(IDirectXFileEnumObjectImpl
** ppObj
)
523 IDirectXFileEnumObjectImpl
* object
;
525 TRACE("(%p)\n", ppObj
);
527 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IDirectXFileEnumObjectImpl
));
529 object
->lpVtbl
.lpVtbl
= &IDirectXFileEnumObject_Vtbl
;
537 /*** IUnknown methods ***/
538 static HRESULT WINAPI
IDirectXFileEnumObjectImpl_QueryInterface(IDirectXFileEnumObject
* iface
, REFIID riid
, void** ppvObject
)
540 IDirectXFileEnumObjectImpl
*This
= (IDirectXFileEnumObjectImpl
*)iface
;
542 TRACE("(%p/%p)->(%s,%p)\n", iface
, This
, debugstr_guid(riid
), ppvObject
);
544 if (IsEqualGUID(riid
, &IID_IUnknown
)
545 || IsEqualGUID(riid
, &IID_IDirectXFileEnumObject
))
547 IClassFactory_AddRef(iface
);
552 ERR("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppvObject
);
553 return E_NOINTERFACE
;
556 static ULONG WINAPI
IDirectXFileEnumObjectImpl_AddRef(IDirectXFileEnumObject
* iface
)
558 IDirectXFileEnumObjectImpl
*This
= (IDirectXFileEnumObjectImpl
*)iface
;
559 ULONG ref
= InterlockedIncrement(&This
->ref
);
561 TRACE("(%p/%p): AddRef from %d\n", iface
, This
, ref
- 1);
566 static ULONG WINAPI
IDirectXFileEnumObjectImpl_Release(IDirectXFileEnumObject
* iface
)
568 IDirectXFileEnumObjectImpl
*This
= (IDirectXFileEnumObjectImpl
*)iface
;
569 ULONG ref
= InterlockedDecrement(&This
->ref
);
571 TRACE("(%p/%p): ReleaseRef to %d\n", iface
, This
, ref
);
574 HeapFree(GetProcessHeap(), 0, This
);
579 /*** IDirectXFileEnumObject methods ***/
580 static HRESULT WINAPI
IDirectXFileEnumObjectImpl_GetNextDataObject(IDirectXFileEnumObject
* iface
, LPDIRECTXFILEDATA
* ppDataObj
)
582 IDirectXFileEnumObjectImpl
*This
= (IDirectXFileEnumObjectImpl
*)iface
;
583 IDirectXFileDataImpl
* object
;
585 FIXME("(%p/%p)->(%p) stub!\n", This
, iface
, ppDataObj
);
587 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IDirectXFileDataImpl
));
589 object
->lpVtbl
.lpVtbl
= &IDirectXFileData_Vtbl
;
592 *ppDataObj
= (LPDIRECTXFILEDATA
)object
;
597 static HRESULT WINAPI
IDirectXFileEnumObjectImpl_GetDataObjectById(IDirectXFileEnumObject
* iface
, REFGUID rguid
, LPDIRECTXFILEDATA
* ppDataObj
)
599 IDirectXFileEnumObjectImpl
*This
= (IDirectXFileEnumObjectImpl
*)iface
;
601 FIXME("(%p/%p)->(%p,%p) stub!\n", This
, iface
, rguid
, ppDataObj
);
606 static HRESULT WINAPI
IDirectXFileEnumObjectImpl_GetDataObjectByName(IDirectXFileEnumObject
* iface
, LPCSTR szName
, LPDIRECTXFILEDATA
* ppDataObj
)
608 IDirectXFileEnumObjectImpl
*This
= (IDirectXFileEnumObjectImpl
*)iface
;
610 FIXME("(%p/%p)->(%s,%p) stub!\n", This
, iface
, szName
, ppDataObj
);
615 static const IDirectXFileEnumObjectVtbl IDirectXFileEnumObject_Vtbl
=
617 IDirectXFileEnumObjectImpl_QueryInterface
,
618 IDirectXFileEnumObjectImpl_AddRef
,
619 IDirectXFileEnumObjectImpl_Release
,
620 IDirectXFileEnumObjectImpl_GetNextDataObject
,
621 IDirectXFileEnumObjectImpl_GetDataObjectById
,
622 IDirectXFileEnumObjectImpl_GetDataObjectByName
625 HRESULT
IDirectXFileObjectImpl_Create(IDirectXFileObjectImpl
** ppObj
)
627 IDirectXFileObjectImpl
* object
;
629 TRACE("(%p)\n", ppObj
);
631 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IDirectXFileObjectImpl
));
633 object
->lpVtbl
.lpVtbl
= &IDirectXFileObject_Vtbl
;
641 /*** IUnknown methods ***/
642 static HRESULT WINAPI
IDirectXFileObjectImpl_QueryInterface(IDirectXFileObject
* iface
, REFIID riid
, void** ppvObject
)
644 IDirectXFileObjectImpl
*This
= (IDirectXFileObjectImpl
*)iface
;
646 TRACE("(%p/%p)->(%s,%p)\n", iface
, This
, debugstr_guid(riid
), ppvObject
);
648 if (IsEqualGUID(riid
, &IID_IUnknown
)
649 || IsEqualGUID(riid
, &IID_IDirectXFileObject
))
651 IClassFactory_AddRef(iface
);
656 ERR("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppvObject
);
657 return E_NOINTERFACE
;
660 static ULONG WINAPI
IDirectXFileObjectImpl_AddRef(IDirectXFileObject
* iface
)
662 IDirectXFileObjectImpl
*This
= (IDirectXFileObjectImpl
*)iface
;
663 ULONG ref
= InterlockedIncrement(&This
->ref
);
665 TRACE("(%p/%p): AddRef from %d\n", iface
, This
, ref
- 1);
670 static ULONG WINAPI
IDirectXFileObjectImpl_Release(IDirectXFileObject
* iface
)
672 IDirectXFileObjectImpl
*This
= (IDirectXFileObjectImpl
*)iface
;
673 ULONG ref
= InterlockedDecrement(&This
->ref
);
675 TRACE("(%p/%p): ReleaseRef to %d\n", iface
, This
, ref
);
678 HeapFree(GetProcessHeap(), 0, This
);
683 /*** IDirectXFileObject methods ***/
684 static HRESULT WINAPI
IDirectXFileObjectImpl_GetName(IDirectXFileObject
* iface
, LPSTR pstrNameBuf
, LPDWORD pdwBufLen
)
686 IDirectXFileDataReferenceImpl
*This
= (IDirectXFileDataReferenceImpl
*)iface
;
688 FIXME("(%p/%p)->(%p,%p) stub!\n", This
, iface
, pstrNameBuf
, pdwBufLen
);
693 static HRESULT WINAPI
IDirectXFileObjectImpl_GetId(IDirectXFileObject
* iface
, LPGUID pGuid
)
695 IDirectXFileObjectImpl
*This
= (IDirectXFileObjectImpl
*)iface
;
697 FIXME("(%p/%p)->(%p) stub!\n", This
, iface
, pGuid
);
702 static const IDirectXFileObjectVtbl IDirectXFileObject_Vtbl
=
704 IDirectXFileObjectImpl_QueryInterface
,
705 IDirectXFileObjectImpl_AddRef
,
706 IDirectXFileObjectImpl_Release
,
707 IDirectXFileObjectImpl_GetName
,
708 IDirectXFileObjectImpl_GetId
711 HRESULT
IDirectXFileSaveObjectImpl_Create(IDirectXFileSaveObjectImpl
** ppObj
)
713 IDirectXFileSaveObjectImpl
* object
;
715 TRACE("(%p)\n", ppObj
);
717 object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IDirectXFileSaveObjectImpl
));
719 object
->lpVtbl
.lpVtbl
= &IDirectXFileSaveObject_Vtbl
;
727 /*** IUnknown methods ***/
728 static HRESULT WINAPI
IDirectXFileSaveObjectImpl_QueryInterface(IDirectXFileSaveObject
* iface
, REFIID riid
, void** ppvObject
)
730 IDirectXFileSaveObjectImpl
*This
= (IDirectXFileSaveObjectImpl
*)iface
;
732 TRACE("(%p/%p)->(%s,%p)\n", iface
, This
, debugstr_guid(riid
), ppvObject
);
734 if (IsEqualGUID(riid
, &IID_IUnknown
)
735 || IsEqualGUID(riid
, &IID_IDirectXFileSaveObject
))
737 IClassFactory_AddRef(iface
);
742 ERR("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppvObject
);
743 return E_NOINTERFACE
;
746 static ULONG WINAPI
IDirectXFileSaveObjectImpl_AddRef(IDirectXFileSaveObject
* iface
)
748 IDirectXFileSaveObjectImpl
*This
= (IDirectXFileSaveObjectImpl
*)iface
;
749 ULONG ref
= InterlockedIncrement(&This
->ref
);
751 TRACE("(%p/%p): AddRef from %d\n", iface
, This
, ref
- 1);
756 static ULONG WINAPI
IDirectXFileSaveObjectImpl_Release(IDirectXFileSaveObject
* iface
)
758 IDirectXFileSaveObjectImpl
*This
= (IDirectXFileSaveObjectImpl
*)iface
;
759 ULONG ref
= InterlockedDecrement(&This
->ref
);
761 TRACE("(%p/%p): ReleaseRef to %d\n", iface
, This
, ref
);
764 HeapFree(GetProcessHeap(), 0, This
);
769 static HRESULT WINAPI
IDirectXFileSaveObjectImpl_SaveTemplates(IDirectXFileSaveObject
* iface
, DWORD cTemplates
, const GUID
** ppguidTemplates
)
771 IDirectXFileSaveObjectImpl
*This
= (IDirectXFileSaveObjectImpl
*)iface
;
773 FIXME("(%p/%p)->(%d,%p) stub!\n", This
, iface
, cTemplates
, ppguidTemplates
);
778 static HRESULT WINAPI
IDirectXFileSaveObjectImpl_CreateDataObject(IDirectXFileSaveObject
* iface
, REFGUID rguidTemplate
, LPCSTR szName
, const GUID
* pguid
, DWORD cbSize
, LPVOID pvData
, LPDIRECTXFILEDATA
* ppDataObj
)
780 IDirectXFileSaveObjectImpl
*This
= (IDirectXFileSaveObjectImpl
*)iface
;
782 FIXME("(%p/%p)->(%p,%s,%p,%d,%p,%p) stub!\n", This
, iface
, rguidTemplate
, szName
, pguid
, cbSize
, pvData
, ppDataObj
);
787 static HRESULT WINAPI
IDirectXFileSaveObjectImpl_SaveData(IDirectXFileSaveObject
* iface
, LPDIRECTXFILEDATA ppDataObj
)
789 IDirectXFileSaveObjectImpl
*This
= (IDirectXFileSaveObjectImpl
*)iface
;
791 FIXME("(%p/%p)->(%p) stub!\n", This
, iface
, ppDataObj
);
796 static const IDirectXFileSaveObjectVtbl IDirectXFileSaveObject_Vtbl
=
798 IDirectXFileSaveObjectImpl_QueryInterface
,
799 IDirectXFileSaveObjectImpl_AddRef
,
800 IDirectXFileSaveObjectImpl_Release
,
801 IDirectXFileSaveObjectImpl_SaveTemplates
,
802 IDirectXFileSaveObjectImpl_CreateDataObject
,
803 IDirectXFileSaveObjectImpl_SaveData