d3dxof: Create FileEnumObject using its constructor.
[wine.git] / dlls / d3dxof / d3dxof.c
blobc141c42f285e4737f65a2e0d7f3730a87b11e15f
1 /*
2 * Implementation of DirectX File Interfaces
4 * Copyright 2004, 2008 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
24 #include "config.h"
25 #include "wine/debug.h"
27 #define COBJMACROS
29 #include "winbase.h"
30 #include "wingdi.h"
32 #include "d3dxof_private.h"
33 #include "dxfile.h"
35 #include <stdio.h>
37 WINE_DEFAULT_DEBUG_CHANNEL(d3dxof);
39 #define MAKEFOUR(a,b,c,d) ((DWORD)a + ((DWORD)b << 8) + ((DWORD)c << 16) + ((DWORD)d << 24))
40 #define XOFFILE_FORMAT_MAGIC MAKEFOUR('x','o','f',' ')
41 #define XOFFILE_FORMAT_VERSION MAKEFOUR('0','3','0','2')
42 #define XOFFILE_FORMAT_BINARY MAKEFOUR('b','i','n',' ')
43 #define XOFFILE_FORMAT_TEXT MAKEFOUR('t','x','t',' ')
44 #define XOFFILE_FORMAT_COMPRESSED MAKEFOUR('c','m','p',' ')
45 #define XOFFILE_FORMAT_FLOAT_BITS_32 MAKEFOUR('0','0','3','2')
46 #define XOFFILE_FORMAT_FLOAT_BITS_64 MAKEFOUR('0','0','6','4')
48 #define TOKEN_NAME 1
49 #define TOKEN_STRING 2
50 #define TOKEN_INTEGER 3
51 #define TOKEN_GUID 5
52 #define TOKEN_INTEGER_LIST 6
53 #define TOKEN_FLOAT_LIST 7
54 #define TOKEN_OBRACE 10
55 #define TOKEN_CBRACE 11
56 #define TOKEN_OPAREN 12
57 #define TOKEN_CPAREN 13
58 #define TOKEN_OBRACKET 14
59 #define TOKEN_CBRACKET 15
60 #define TOKEN_OANGLE 16
61 #define TOKEN_CANGLE 17
62 #define TOKEN_DOT 18
63 #define TOKEN_COMMA 19
64 #define TOKEN_SEMICOLON 20
65 #define TOKEN_TEMPLATE 31
66 #define TOKEN_WORD 40
67 #define TOKEN_DWORD 41
68 #define TOKEN_FLOAT 42
69 #define TOKEN_DOUBLE 43
70 #define TOKEN_CHAR 44
71 #define TOKEN_UCHAR 45
72 #define TOKEN_SWORD 46
73 #define TOKEN_SDWORD 47
74 #define TOKEN_VOID 48
75 #define TOKEN_LPSTR 49
76 #define TOKEN_UNICODE 50
77 #define TOKEN_CSTRING 51
78 #define TOKEN_ARRAY 52
80 typedef struct {
81 /* Buffer to parse */
82 LPBYTE buffer;
83 DWORD rem_bytes;
84 /* Dump template content */
85 char* dump;
86 DWORD pos;
87 DWORD size;
88 } parse_buffer;
91 static const struct IDirectXFileVtbl IDirectXFile_Vtbl;
92 static const struct IDirectXFileBinaryVtbl IDirectXFileBinary_Vtbl;
93 static const struct IDirectXFileDataVtbl IDirectXFileData_Vtbl;
94 static const struct IDirectXFileDataReferenceVtbl IDirectXFileDataReference_Vtbl;
95 static const struct IDirectXFileEnumObjectVtbl IDirectXFileEnumObject_Vtbl;
96 static const struct IDirectXFileObjectVtbl IDirectXFileObject_Vtbl;
97 static const struct IDirectXFileSaveObjectVtbl IDirectXFileSaveObject_Vtbl;
99 HRESULT IDirectXFileImpl_Create(IUnknown* pUnkOuter, LPVOID* ppObj)
101 IDirectXFileImpl* object;
103 TRACE("(%p,%p)\n", pUnkOuter, ppObj);
105 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectXFileImpl));
107 object->lpVtbl.lpVtbl = &IDirectXFile_Vtbl;
108 object->ref = 1;
110 *ppObj = object;
112 return S_OK;
115 /*** IUnknown methods ***/
116 static HRESULT WINAPI IDirectXFileImpl_QueryInterface(IDirectXFile* iface, REFIID riid, void** ppvObject)
118 IDirectXFileImpl *This = (IDirectXFileImpl *)iface;
120 TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ppvObject);
122 if (IsEqualGUID(riid, &IID_IUnknown)
123 || IsEqualGUID(riid, &IID_IDirectXFile))
125 IClassFactory_AddRef(iface);
126 *ppvObject = This;
127 return S_OK;
130 ERR("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppvObject);
131 return E_NOINTERFACE;
134 static ULONG WINAPI IDirectXFileImpl_AddRef(IDirectXFile* iface)
136 IDirectXFileImpl *This = (IDirectXFileImpl *)iface;
137 ULONG ref = InterlockedIncrement(&This->ref);
139 TRACE("(%p/%p): AddRef from %d\n", iface, This, ref - 1);
141 return ref;
144 static ULONG WINAPI IDirectXFileImpl_Release(IDirectXFile* iface)
146 IDirectXFileImpl *This = (IDirectXFileImpl *)iface;
147 ULONG ref = InterlockedDecrement(&This->ref);
149 TRACE("(%p/%p): ReleaseRef to %d\n", iface, This, ref);
151 if (!ref)
152 HeapFree(GetProcessHeap(), 0, This);
154 return ref;
157 /*** IDirectXFile methods ***/
158 static HRESULT WINAPI IDirectXFileImpl_CreateEnumObject(IDirectXFile* iface, LPVOID pvSource, DXFILELOADOPTIONS dwLoadOptions, LPDIRECTXFILEENUMOBJECT* ppEnumObj)
161 IDirectXFileImpl *This = (IDirectXFileImpl *)iface;
162 IDirectXFileEnumObjectImpl* object;
163 HRESULT hr;
165 FIXME("(%p/%p)->(%p,%x,%p) stub!\n", This, iface, pvSource, dwLoadOptions, ppEnumObj);
167 if (dwLoadOptions == DXFILELOAD_FROMFILE)
169 HANDLE hFile;
170 TRACE("Open source file '%s'\n", (char*)pvSource);
171 hFile = CreateFileA((char*)pvSource, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
172 if (hFile == INVALID_HANDLE_VALUE)
174 TRACE("File '%s' not found\n", (char*)pvSource);
175 return DXFILEERR_FILENOTFOUND;
177 CloseHandle(hFile);
179 else
181 FIXME("Source type %d is not handled yet\n", dwLoadOptions);
184 hr = IDirectXFileEnumObjectImpl_Create(&object);
185 if (!SUCCEEDED(hr))
186 return hr;
188 *ppEnumObj = (LPDIRECTXFILEENUMOBJECT)object;
190 return DXFILE_OK;
193 static HRESULT WINAPI IDirectXFileImpl_CreateSaveObject(IDirectXFile* iface, LPCSTR szFileName, DXFILEFORMAT dwFileFormat, LPDIRECTXFILESAVEOBJECT* ppSaveObj)
195 IDirectXFileImpl *This = (IDirectXFileImpl *)iface;
197 FIXME("(%p/%p)->(%s,%x,%p) stub!\n", This, iface, szFileName, dwFileFormat, ppSaveObj);
199 return DXFILEERR_BADVALUE;
202 static BOOL read_bytes(parse_buffer * buf, LPVOID data, DWORD size)
204 if (buf->rem_bytes < size)
205 return FALSE;
206 memcpy(data, buf->buffer, size);
207 buf->buffer += size;
208 buf->rem_bytes -= size;
209 return TRUE;
212 static void add_string(parse_buffer * buf, const char * str)
214 DWORD len = strlen(str);
215 if ((buf->pos + len + 1) > buf->size)
217 FIXME("Dump buffer to small\n");
218 return;
220 sprintf(buf->dump + buf->pos, str);
221 buf->pos += len;
224 static void dump_TOKEN(WORD token)
226 #define DUMP_TOKEN(t) case t: TRACE(#t "\n"); break
227 switch(token)
229 DUMP_TOKEN(TOKEN_NAME);
230 DUMP_TOKEN(TOKEN_STRING);
231 DUMP_TOKEN(TOKEN_INTEGER);
232 DUMP_TOKEN(TOKEN_GUID);
233 DUMP_TOKEN(TOKEN_INTEGER_LIST);
234 DUMP_TOKEN(TOKEN_FLOAT_LIST);
235 DUMP_TOKEN(TOKEN_OBRACE);
236 DUMP_TOKEN(TOKEN_CBRACE);
237 DUMP_TOKEN(TOKEN_OPAREN);
238 DUMP_TOKEN(TOKEN_CPAREN);
239 DUMP_TOKEN(TOKEN_OBRACKET);
240 DUMP_TOKEN(TOKEN_CBRACKET);
241 DUMP_TOKEN(TOKEN_OANGLE);
242 DUMP_TOKEN(TOKEN_CANGLE);
243 DUMP_TOKEN(TOKEN_DOT);
244 DUMP_TOKEN(TOKEN_COMMA);
245 DUMP_TOKEN(TOKEN_SEMICOLON);
246 DUMP_TOKEN(TOKEN_TEMPLATE);
247 DUMP_TOKEN(TOKEN_WORD);
248 DUMP_TOKEN(TOKEN_DWORD);
249 DUMP_TOKEN(TOKEN_FLOAT);
250 DUMP_TOKEN(TOKEN_DOUBLE);
251 DUMP_TOKEN(TOKEN_CHAR);
252 DUMP_TOKEN(TOKEN_UCHAR);
253 DUMP_TOKEN(TOKEN_SWORD);
254 DUMP_TOKEN(TOKEN_SDWORD);
255 DUMP_TOKEN(TOKEN_VOID);
256 DUMP_TOKEN(TOKEN_LPSTR);
257 DUMP_TOKEN(TOKEN_UNICODE);
258 DUMP_TOKEN(TOKEN_CSTRING);
259 DUMP_TOKEN(TOKEN_ARRAY);
260 default:
261 if (0)
262 TRACE("Unknown token %d\n", token);
263 break;
265 #undef DUMP_TOKEN
268 static WORD check_TOKEN(parse_buffer * buf)
270 WORD token;
272 if (!read_bytes(buf, &token, 2))
273 return 0;
274 buf->buffer -= 2;
275 buf->rem_bytes += 2;
276 if (0)
278 TRACE("check: ");
279 dump_TOKEN(token);
281 return token;
284 static WORD parse_TOKEN(parse_buffer * buf)
286 WORD token;
288 if (!read_bytes(buf, &token, 2))
289 return 0;
291 switch(token)
293 case TOKEN_NAME:
294 case TOKEN_STRING:
295 case TOKEN_INTEGER:
296 case TOKEN_GUID:
297 case TOKEN_INTEGER_LIST:
298 case TOKEN_FLOAT_LIST:
299 break;
300 case TOKEN_OBRACE:
301 add_string(buf, "{ ");
302 break;
303 case TOKEN_CBRACE:
304 add_string(buf, "} ");
305 break;
306 case TOKEN_OPAREN:
307 add_string(buf, "( ");
308 break;
309 case TOKEN_CPAREN:
310 add_string(buf, ") ");
311 break;
312 case TOKEN_OBRACKET:
313 add_string(buf, "[ ");
314 break;
315 case TOKEN_CBRACKET:
316 add_string(buf, "] ");
317 break;
318 case TOKEN_OANGLE:
319 add_string(buf, "< ");
320 break;
321 case TOKEN_CANGLE:
322 add_string(buf, "> ");
323 break;
324 case TOKEN_DOT:
325 add_string(buf, ".");
326 break;
327 case TOKEN_COMMA:
328 add_string(buf, ", ");
329 break;
330 case TOKEN_SEMICOLON:
331 add_string(buf, "; ");
332 break;
333 case TOKEN_TEMPLATE:
334 add_string(buf, "template ");
335 break;
336 case TOKEN_WORD:
337 add_string(buf, "WORD ");
338 break;
339 case TOKEN_DWORD:
340 add_string(buf, "DWORD ");
341 break;
342 case TOKEN_FLOAT:
343 add_string(buf, "FLOAT ");
344 break;
345 case TOKEN_DOUBLE:
346 add_string(buf, "DOUBLE ");
347 break;
348 case TOKEN_CHAR:
349 add_string(buf, "CHAR ");
350 break;
351 case TOKEN_UCHAR:
352 add_string(buf, "UCHAR ");
353 break;
354 case TOKEN_SWORD:
355 add_string(buf, "SWORD ");
356 break;
357 case TOKEN_SDWORD:
358 add_string(buf, "SDWORD ");
359 break;
360 case TOKEN_VOID:
361 add_string(buf, "VOID ");
362 break;
363 case TOKEN_LPSTR:
364 add_string(buf, "LPSTR ");
365 break;
366 case TOKEN_UNICODE:
367 add_string(buf, "UNICODE ");
368 break;
369 case TOKEN_CSTRING:
370 add_string(buf, "CSTRING ");
371 break;
372 case TOKEN_ARRAY:
373 add_string(buf, "array ");
374 break;
375 default:
376 return 0;
379 if (0)
380 dump_TOKEN(token);
382 return token;
385 static inline BOOL is_primitive_type(WORD token)
387 BOOL ret;
388 switch(token)
390 case TOKEN_WORD:
391 case TOKEN_DWORD:
392 case TOKEN_FLOAT:
393 case TOKEN_DOUBLE:
394 case TOKEN_CHAR:
395 case TOKEN_UCHAR:
396 case TOKEN_SWORD:
397 case TOKEN_SDWORD:
398 case TOKEN_LPSTR:
399 case TOKEN_UNICODE:
400 case TOKEN_CSTRING:
401 ret = 1;
402 break;
403 default:
404 ret = 0;
405 break;
407 return ret;
410 static BOOL parse_name(parse_buffer * buf)
412 DWORD count;
413 static char strname[100];
415 if (parse_TOKEN(buf) != TOKEN_NAME)
416 return FALSE;
417 if (!read_bytes(buf, &count, 4))
418 return FALSE;
419 if (!read_bytes(buf, strname, count))
420 return FALSE;
421 strname[count] = 0;
422 /*TRACE("name = %s\n", strname);*/
423 add_string(buf, strname);
424 add_string(buf, " ");
426 return TRUE;
429 static BOOL parse_class_id(parse_buffer * buf)
431 char strguid[38];
432 GUID class_id;
434 if (parse_TOKEN(buf) != TOKEN_GUID)
435 return FALSE;
436 if (!read_bytes(buf, &class_id, 16))
437 return FALSE;
438 sprintf(strguid, "<%08X-%04X-%04X-%02X%02X%02X%02X%02X%02X%02X%02X>", class_id.Data1, class_id.Data2, class_id.Data3, class_id.Data4[0],
439 class_id.Data4[1], class_id.Data4[2], class_id.Data4[3], class_id.Data4[4], class_id.Data4[5], class_id.Data4[6], class_id.Data4[7]);
440 /*TRACE("guid = {%s}\n", strguid);*/
441 add_string(buf, strguid);
443 return TRUE;
446 static BOOL parse_integer(parse_buffer * buf)
448 DWORD integer;
450 if (parse_TOKEN(buf) != TOKEN_INTEGER)
451 return FALSE;
452 if (!read_bytes(buf, &integer, 4))
453 return FALSE;
454 /*TRACE("integer = %ld\n", integer);*/
455 sprintf(buf->dump+buf->pos, "%d ", integer);
456 buf->pos = strlen(buf->dump);
458 return TRUE;
461 static BOOL parse_template_option_info(parse_buffer * buf)
463 if (check_TOKEN(buf) == TOKEN_DOT)
465 parse_TOKEN(buf);
466 if (parse_TOKEN(buf) != TOKEN_DOT)
467 return FALSE;
468 if (parse_TOKEN(buf) != TOKEN_DOT)
469 return FALSE;
470 sprintf(buf->dump+buf->pos, " ");
471 buf->pos = strlen(buf->dump);
473 else
475 while (1)
477 if (!parse_name(buf))
478 return FALSE;
479 if (check_TOKEN(buf) == TOKEN_GUID)
480 if (!parse_class_id(buf))
481 return FALSE;
482 if (check_TOKEN(buf) != TOKEN_COMMA)
483 break;
484 parse_TOKEN(buf);
487 return TRUE;
490 static BOOL parse_template_members_list(parse_buffer * buf)
492 parse_buffer save1;
493 while (1)
495 save1 = *buf;
496 if (check_TOKEN(buf) == TOKEN_NAME)
498 if (!parse_name(buf))
499 break;
500 if (check_TOKEN(buf) == TOKEN_NAME)
501 if (!parse_name(buf))
502 break;
503 if (parse_TOKEN(buf) != TOKEN_SEMICOLON)
504 break;
506 else if (check_TOKEN(buf) == TOKEN_ARRAY)
508 parse_buffer save2;
509 WORD token;
510 parse_TOKEN(buf);
511 token = check_TOKEN(buf);
512 if (is_primitive_type(token))
514 parse_TOKEN(buf);
516 else
518 if (!parse_name(buf))
519 break;
521 if (!parse_name(buf))
522 break;
523 save2 = *buf;
524 while (check_TOKEN(buf) == TOKEN_OBRACKET)
526 parse_TOKEN(buf);
527 if (check_TOKEN(buf) == TOKEN_INTEGER)
529 if (!parse_integer(buf))
530 break;
532 else
534 if (!parse_name(buf))
535 break;
537 if (parse_TOKEN(buf) != TOKEN_CBRACKET)
538 break;
539 save2 = *buf;
541 *buf = save2;
542 if (parse_TOKEN(buf) != TOKEN_SEMICOLON)
543 break;
545 else if (is_primitive_type(check_TOKEN(buf)))
547 parse_TOKEN(buf);
548 if (check_TOKEN(buf) == TOKEN_NAME)
549 if (!parse_name(buf))
550 break;
551 if (parse_TOKEN(buf) != TOKEN_SEMICOLON)
552 break;
554 else
555 break;
556 add_string(buf, "\n");
558 *buf = save1;
559 return TRUE;
562 static BOOL parse_template_parts(parse_buffer * buf)
564 if (check_TOKEN(buf) == TOKEN_OBRACKET)
566 parse_TOKEN(buf);
567 if (!parse_template_option_info(buf))
568 return FALSE;
569 if (parse_TOKEN(buf) != TOKEN_CBRACKET)
570 return FALSE;
571 add_string(buf, "\n");
573 else
575 if (!parse_template_members_list(buf))
576 return FALSE;
577 if (check_TOKEN(buf) == TOKEN_OBRACKET)
579 parse_TOKEN(buf);
580 if (!parse_template_option_info(buf))
581 return FALSE;
582 if (parse_TOKEN(buf) != TOKEN_CBRACKET)
583 return FALSE;
584 add_string(buf, "\n");
588 return TRUE;
591 static BOOL parse_template(parse_buffer * buf)
593 if (parse_TOKEN(buf) != TOKEN_TEMPLATE)
594 return FALSE;
595 if (!parse_name(buf))
596 return FALSE;
597 add_string(buf, "\n");
598 if (parse_TOKEN(buf) != TOKEN_OBRACE)
599 return FALSE;
600 add_string(buf, "\n");
601 if (!parse_class_id(buf))
602 return FALSE;
603 add_string(buf, "\n");
604 if (!parse_template_parts(buf))
605 return FALSE;
606 if (parse_TOKEN(buf) != TOKEN_CBRACE)
607 return FALSE;
608 add_string(buf, "\n\n");
609 return TRUE;
612 static HRESULT WINAPI IDirectXFileImpl_RegisterTemplates(IDirectXFile* iface, LPVOID pvData, DWORD cbSize)
614 IDirectXFileImpl *This = (IDirectXFileImpl *)iface;
615 DWORD token_header;
616 parse_buffer buf;
618 buf.buffer = (LPBYTE)pvData;
619 buf.rem_bytes = cbSize;
620 buf.dump = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 500);
621 buf.size = 500;
623 FIXME("(%p/%p)->(%p,%d) partial stub!\n", This, iface, pvData, cbSize);
625 if (!pvData)
626 return DXFILEERR_BADVALUE;
628 if (cbSize < 16)
629 return DXFILEERR_BADFILETYPE;
631 if (TRACE_ON(d3dxof))
633 char string[17];
634 memcpy(string, pvData, 16);
635 string[16] = 0;
636 TRACE("header = '%s'\n", string);
639 read_bytes(&buf, &token_header, 4);
641 if (token_header != XOFFILE_FORMAT_MAGIC)
642 return DXFILEERR_BADFILETYPE;
644 read_bytes(&buf, &token_header, 4);
646 if (token_header != XOFFILE_FORMAT_VERSION)
647 return DXFILEERR_BADFILEVERSION;
649 read_bytes(&buf, &token_header, 4);
651 if ((token_header != XOFFILE_FORMAT_BINARY) && (token_header != XOFFILE_FORMAT_TEXT) && (token_header != XOFFILE_FORMAT_COMPRESSED))
652 return DXFILEERR_BADFILETYPE;
654 if (token_header == XOFFILE_FORMAT_TEXT)
656 FIXME("Text format not supported yet");
657 return DXFILEERR_BADVALUE;
660 if (token_header == XOFFILE_FORMAT_COMPRESSED)
662 FIXME("Compressed formats not supported yet");
663 return DXFILEERR_BADVALUE;
666 read_bytes(&buf, &token_header, 4);
668 if ((token_header != XOFFILE_FORMAT_FLOAT_BITS_32) && (token_header != XOFFILE_FORMAT_FLOAT_BITS_64))
669 return DXFILEERR_BADFILEFLOATSIZE;
671 while (buf.rem_bytes)
673 buf.pos = 0;
674 if (!parse_template(&buf))
676 TRACE("Template is not correct\n");
677 return DXFILEERR_BADVALUE;
679 else
680 TRACE("Template successfully parsed:\n");
681 if (TRACE_ON(d3dxof))
682 DPRINTF(buf.dump);
685 HeapFree(GetProcessHeap(), 0, buf.dump);
687 return DXFILE_OK;
690 static const IDirectXFileVtbl IDirectXFile_Vtbl =
692 IDirectXFileImpl_QueryInterface,
693 IDirectXFileImpl_AddRef,
694 IDirectXFileImpl_Release,
695 IDirectXFileImpl_CreateEnumObject,
696 IDirectXFileImpl_CreateSaveObject,
697 IDirectXFileImpl_RegisterTemplates
700 HRESULT IDirectXFileBinaryImpl_Create(IDirectXFileBinaryImpl** ppObj)
702 IDirectXFileBinaryImpl* object;
704 TRACE("(%p)\n", ppObj);
706 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectXFileBinaryImpl));
708 object->lpVtbl.lpVtbl = &IDirectXFileBinary_Vtbl;
709 object->ref = 1;
711 *ppObj = object;
713 return DXFILE_OK;
716 /*** IUnknown methods ***/
717 static HRESULT WINAPI IDirectXFileBinaryImpl_QueryInterface(IDirectXFileBinary* iface, REFIID riid, void** ppvObject)
719 IDirectXFileBinaryImpl *This = (IDirectXFileBinaryImpl *)iface;
721 TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ppvObject);
723 if (IsEqualGUID(riid, &IID_IUnknown)
724 || IsEqualGUID(riid, &IID_IDirectXFileObject)
725 || IsEqualGUID(riid, &IID_IDirectXFileBinary))
727 IClassFactory_AddRef(iface);
728 *ppvObject = This;
729 return S_OK;
732 ERR("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppvObject);
733 return E_NOINTERFACE;
736 static ULONG WINAPI IDirectXFileBinaryImpl_AddRef(IDirectXFileBinary* iface)
738 IDirectXFileBinaryImpl *This = (IDirectXFileBinaryImpl *)iface;
739 ULONG ref = InterlockedIncrement(&This->ref);
741 TRACE("(%p/%p): AddRef from %d\n", iface, This, ref - 1);
743 return ref;
746 static ULONG WINAPI IDirectXFileBinaryImpl_Release(IDirectXFileBinary* iface)
748 IDirectXFileBinaryImpl *This = (IDirectXFileBinaryImpl *)iface;
749 ULONG ref = InterlockedDecrement(&This->ref);
751 TRACE("(%p/%p): ReleaseRef to %d\n", iface, This, ref);
753 if (!ref)
754 HeapFree(GetProcessHeap(), 0, This);
756 return ref;
759 /*** IDirectXFileObject methods ***/
760 static HRESULT WINAPI IDirectXFileBinaryImpl_GetName(IDirectXFileBinary* iface, LPSTR pstrNameBuf, LPDWORD pdwBufLen)
763 IDirectXFileBinaryImpl *This = (IDirectXFileBinaryImpl *)iface;
765 FIXME("(%p/%p)->(%p,%p) stub!\n", This, iface, pstrNameBuf, pdwBufLen);
767 return DXFILEERR_BADVALUE;
770 static HRESULT WINAPI IDirectXFileBinaryImpl_GetId(IDirectXFileBinary* iface, LPGUID pGuid)
772 IDirectXFileBinaryImpl *This = (IDirectXFileBinaryImpl *)iface;
774 FIXME("(%p/%p)->(%p) stub!\n", This, iface, pGuid);
776 return DXFILEERR_BADVALUE;
779 /*** IDirectXFileBinary methods ***/
780 static HRESULT WINAPI IDirectXFileBinaryImpl_GetSize(IDirectXFileBinary* iface, DWORD* pcbSize)
782 IDirectXFileBinaryImpl *This = (IDirectXFileBinaryImpl *)iface;
784 FIXME("(%p/%p)->(%p) stub!\n", This, iface, pcbSize);
786 return DXFILEERR_BADVALUE;
789 static HRESULT WINAPI IDirectXFileBinaryImpl_GetMimeType(IDirectXFileBinary* iface, LPCSTR* pszMimeType)
791 IDirectXFileBinaryImpl *This = (IDirectXFileBinaryImpl *)iface;
793 FIXME("(%p/%p)->(%p) stub!\n", This, iface, pszMimeType);
795 return DXFILEERR_BADVALUE;
798 static HRESULT WINAPI IDirectXFileBinaryImpl_Read(IDirectXFileBinary* iface, LPVOID pvData, DWORD cbSize, LPDWORD pcbRead)
800 IDirectXFileBinaryImpl *This = (IDirectXFileBinaryImpl *)iface;
802 FIXME("(%p/%p)->(%p, %d, %p) stub!\n", This, iface, pvData, cbSize, pcbRead);
804 return DXFILEERR_BADVALUE;
807 static const IDirectXFileBinaryVtbl IDirectXFileBinary_Vtbl =
809 IDirectXFileBinaryImpl_QueryInterface,
810 IDirectXFileBinaryImpl_AddRef,
811 IDirectXFileBinaryImpl_Release,
812 IDirectXFileBinaryImpl_GetName,
813 IDirectXFileBinaryImpl_GetId,
814 IDirectXFileBinaryImpl_GetSize,
815 IDirectXFileBinaryImpl_GetMimeType,
816 IDirectXFileBinaryImpl_Read
819 HRESULT IDirectXFileDataImpl_Create(IDirectXFileDataImpl** ppObj)
821 IDirectXFileDataImpl* object;
823 TRACE("(%p)\n", ppObj);
825 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectXFileDataImpl));
827 object->lpVtbl.lpVtbl = &IDirectXFileData_Vtbl;
828 object->ref = 1;
830 *ppObj = object;
832 return S_OK;
835 /*** IUnknown methods ***/
836 static HRESULT WINAPI IDirectXFileDataImpl_QueryInterface(IDirectXFileData* iface, REFIID riid, void** ppvObject)
838 IDirectXFileDataImpl *This = (IDirectXFileDataImpl *)iface;
840 TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ppvObject);
842 if (IsEqualGUID(riid, &IID_IUnknown)
843 || IsEqualGUID(riid, &IID_IDirectXFileObject)
844 || IsEqualGUID(riid, &IID_IDirectXFileData))
846 IClassFactory_AddRef(iface);
847 *ppvObject = This;
848 return S_OK;
851 ERR("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppvObject);
852 return E_NOINTERFACE;
855 static ULONG WINAPI IDirectXFileDataImpl_AddRef(IDirectXFileData* iface)
857 IDirectXFileDataImpl *This = (IDirectXFileDataImpl *)iface;
858 ULONG ref = InterlockedIncrement(&This->ref);
860 TRACE("(%p/%p): AddRef from %d\n", iface, This, ref - 1);
862 return ref;
865 static ULONG WINAPI IDirectXFileDataImpl_Release(IDirectXFileData* iface)
867 IDirectXFileDataImpl *This = (IDirectXFileDataImpl *)iface;
868 ULONG ref = InterlockedDecrement(&This->ref);
870 TRACE("(%p/%p): ReleaseRef to %d\n", iface, This, ref);
872 if (!ref)
873 HeapFree(GetProcessHeap(), 0, This);
875 return ref;
878 /*** IDirectXFileObject methods ***/
879 static HRESULT WINAPI IDirectXFileDataImpl_GetName(IDirectXFileData* iface, LPSTR pstrNameBuf, LPDWORD pdwBufLen)
882 IDirectXFileDataImpl *This = (IDirectXFileDataImpl *)iface;
884 FIXME("(%p/%p)->(%p,%p) stub!\n", This, iface, pstrNameBuf, pdwBufLen);
886 return DXFILEERR_BADVALUE;
889 static HRESULT WINAPI IDirectXFileDataImpl_GetId(IDirectXFileData* iface, LPGUID pGuid)
891 IDirectXFileDataImpl *This = (IDirectXFileDataImpl *)iface;
893 FIXME("(%p/%p)->(%p) stub!\n", This, iface, pGuid);
895 return DXFILEERR_BADVALUE;
898 /*** IDirectXFileData methods ***/
899 static HRESULT WINAPI IDirectXFileDataImpl_GetData(IDirectXFileData* iface, LPCSTR szMember, DWORD* pcbSize, void** ppvData)
901 IDirectXFileDataImpl *This = (IDirectXFileDataImpl *)iface;
903 FIXME("(%p/%p)->(%s,%p,%p) stub!\n", This, iface, szMember, pcbSize, ppvData);
905 return DXFILEERR_BADVALUE;
908 static HRESULT WINAPI IDirectXFileDataImpl_GetType(IDirectXFileData* iface, const GUID** pguid)
910 IDirectXFileDataImpl *This = (IDirectXFileDataImpl *)iface;
912 FIXME("(%p/%p)->(%p) stub!\n", This, iface, pguid);
914 return DXFILEERR_BADVALUE;
917 static HRESULT WINAPI IDirectXFileDataImpl_GetNextObject(IDirectXFileData* iface, LPDIRECTXFILEOBJECT* ppChildObj)
919 IDirectXFileDataImpl *This = (IDirectXFileDataImpl *)iface;
921 FIXME("(%p/%p)->(%p) stub!\n", This, iface, ppChildObj);
923 return DXFILEERR_BADVALUE;
926 static HRESULT WINAPI IDirectXFileDataImpl_AddDataObject(IDirectXFileData* iface, LPDIRECTXFILEDATA pDataObj)
928 IDirectXFileDataImpl *This = (IDirectXFileDataImpl *)iface;
930 FIXME("(%p/%p)->(%p) stub!\n", This, iface, pDataObj);
932 return DXFILEERR_BADVALUE;
935 static HRESULT WINAPI IDirectXFileDataImpl_AddDataReference(IDirectXFileData* iface, LPCSTR szRef, const GUID* pguidRef)
937 IDirectXFileDataImpl *This = (IDirectXFileDataImpl *)iface;
939 FIXME("(%p/%p)->(%s,%p) stub!\n", This, iface, szRef, pguidRef);
941 return DXFILEERR_BADVALUE;
944 static HRESULT WINAPI IDirectXFileDataImpl_AddBinaryObject(IDirectXFileData* iface, LPCSTR szName, const GUID* pguid, LPCSTR szMimeType, LPVOID pvData, DWORD cbSize)
946 IDirectXFileDataImpl *This = (IDirectXFileDataImpl *)iface;
948 FIXME("(%p/%p)->(%s,%p,%s,%p,%d) stub!\n", This, iface, szName, pguid, szMimeType, pvData, cbSize);
950 return DXFILEERR_BADVALUE;
953 static const IDirectXFileDataVtbl IDirectXFileData_Vtbl =
955 IDirectXFileDataImpl_QueryInterface,
956 IDirectXFileDataImpl_AddRef,
957 IDirectXFileDataImpl_Release,
958 IDirectXFileDataImpl_GetName,
959 IDirectXFileDataImpl_GetId,
960 IDirectXFileDataImpl_GetData,
961 IDirectXFileDataImpl_GetType,
962 IDirectXFileDataImpl_GetNextObject,
963 IDirectXFileDataImpl_AddDataObject,
964 IDirectXFileDataImpl_AddDataReference,
965 IDirectXFileDataImpl_AddBinaryObject
968 HRESULT IDirectXFileDataReferenceImpl_Create(IDirectXFileDataReferenceImpl** ppObj)
970 IDirectXFileDataReferenceImpl* object;
972 TRACE("(%p)\n", ppObj);
974 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectXFileDataReferenceImpl));
976 object->lpVtbl.lpVtbl = &IDirectXFileDataReference_Vtbl;
977 object->ref = 1;
979 *ppObj = object;
981 return S_OK;
984 /*** IUnknown methods ***/
985 static HRESULT WINAPI IDirectXFileDataReferenceImpl_QueryInterface(IDirectXFileDataReference* iface, REFIID riid, void** ppvObject)
987 IDirectXFileDataReferenceImpl *This = (IDirectXFileDataReferenceImpl *)iface;
989 TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ppvObject);
991 if (IsEqualGUID(riid, &IID_IUnknown)
992 || IsEqualGUID(riid, &IID_IDirectXFileObject)
993 || IsEqualGUID(riid, &IID_IDirectXFileDataReference))
995 IClassFactory_AddRef(iface);
996 *ppvObject = This;
997 return S_OK;
1000 ERR("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppvObject);
1001 return E_NOINTERFACE;
1004 static ULONG WINAPI IDirectXFileDataReferenceImpl_AddRef(IDirectXFileDataReference* iface)
1006 IDirectXFileDataReferenceImpl *This = (IDirectXFileDataReferenceImpl *)iface;
1007 ULONG ref = InterlockedIncrement(&This->ref);
1009 TRACE("(%p/%p): AddRef from %d\n", iface, This, ref - 1);
1011 return ref;
1014 static ULONG WINAPI IDirectXFileDataReferenceImpl_Release(IDirectXFileDataReference* iface)
1016 IDirectXFileDataReferenceImpl *This = (IDirectXFileDataReferenceImpl *)iface;
1017 ULONG ref = InterlockedDecrement(&This->ref);
1019 TRACE("(%p/%p): ReleaseRef to %d\n", iface, This, ref);
1021 if (!ref)
1022 HeapFree(GetProcessHeap(), 0, This);
1024 return ref;
1027 /*** IDirectXFileObject methods ***/
1028 static HRESULT WINAPI IDirectXFileDataReferenceImpl_GetName(IDirectXFileDataReference* iface, LPSTR pstrNameBuf, LPDWORD pdwBufLen)
1030 IDirectXFileDataReferenceImpl *This = (IDirectXFileDataReferenceImpl *)iface;
1032 FIXME("(%p/%p)->(%p,%p) stub!\n", This, iface, pstrNameBuf, pdwBufLen);
1034 return DXFILEERR_BADVALUE;
1037 static HRESULT WINAPI IDirectXFileDataReferenceImpl_GetId(IDirectXFileDataReference* iface, LPGUID pGuid)
1039 IDirectXFileDataReferenceImpl *This = (IDirectXFileDataReferenceImpl *)iface;
1041 FIXME("(%p/%p)->(%p) stub!\n", This, iface, pGuid);
1043 return DXFILEERR_BADVALUE;
1046 /*** IDirectXFileDataReference ***/
1047 static HRESULT WINAPI IDirectXFileDataReferenceImpl_Resolve(IDirectXFileDataReference* iface, LPDIRECTXFILEDATA* ppDataObj)
1049 IDirectXFileDataReferenceImpl *This = (IDirectXFileDataReferenceImpl *)iface;
1051 FIXME("(%p/%p)->(%p) stub!\n", This, iface, ppDataObj);
1053 return DXFILEERR_BADVALUE;
1056 static const IDirectXFileDataReferenceVtbl IDirectXFileDataReference_Vtbl =
1058 IDirectXFileDataReferenceImpl_QueryInterface,
1059 IDirectXFileDataReferenceImpl_AddRef,
1060 IDirectXFileDataReferenceImpl_Release,
1061 IDirectXFileDataReferenceImpl_GetName,
1062 IDirectXFileDataReferenceImpl_GetId,
1063 IDirectXFileDataReferenceImpl_Resolve
1066 HRESULT IDirectXFileEnumObjectImpl_Create(IDirectXFileEnumObjectImpl** ppObj)
1068 IDirectXFileEnumObjectImpl* object;
1070 TRACE("(%p)\n", ppObj);
1072 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectXFileEnumObjectImpl));
1074 object->lpVtbl.lpVtbl = &IDirectXFileEnumObject_Vtbl;
1075 object->ref = 1;
1077 *ppObj = object;
1079 return S_OK;
1082 /*** IUnknown methods ***/
1083 static HRESULT WINAPI IDirectXFileEnumObjectImpl_QueryInterface(IDirectXFileEnumObject* iface, REFIID riid, void** ppvObject)
1085 IDirectXFileEnumObjectImpl *This = (IDirectXFileEnumObjectImpl *)iface;
1087 TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ppvObject);
1089 if (IsEqualGUID(riid, &IID_IUnknown)
1090 || IsEqualGUID(riid, &IID_IDirectXFileEnumObject))
1092 IClassFactory_AddRef(iface);
1093 *ppvObject = This;
1094 return S_OK;
1097 ERR("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppvObject);
1098 return E_NOINTERFACE;
1101 static ULONG WINAPI IDirectXFileEnumObjectImpl_AddRef(IDirectXFileEnumObject* iface)
1103 IDirectXFileEnumObjectImpl *This = (IDirectXFileEnumObjectImpl *)iface;
1104 ULONG ref = InterlockedIncrement(&This->ref);
1106 TRACE("(%p/%p): AddRef from %d\n", iface, This, ref - 1);
1108 return ref;
1111 static ULONG WINAPI IDirectXFileEnumObjectImpl_Release(IDirectXFileEnumObject* iface)
1113 IDirectXFileEnumObjectImpl *This = (IDirectXFileEnumObjectImpl *)iface;
1114 ULONG ref = InterlockedDecrement(&This->ref);
1116 TRACE("(%p/%p): ReleaseRef to %d\n", iface, This, ref);
1118 if (!ref)
1119 HeapFree(GetProcessHeap(), 0, This);
1121 return ref;
1124 /*** IDirectXFileEnumObject methods ***/
1125 static HRESULT WINAPI IDirectXFileEnumObjectImpl_GetNextDataObject(IDirectXFileEnumObject* iface, LPDIRECTXFILEDATA* ppDataObj)
1127 IDirectXFileEnumObjectImpl *This = (IDirectXFileEnumObjectImpl *)iface;
1128 IDirectXFileDataImpl* object;
1130 FIXME("(%p/%p)->(%p) stub!\n", This, iface, ppDataObj);
1132 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectXFileDataImpl));
1134 object->lpVtbl.lpVtbl = &IDirectXFileData_Vtbl;
1135 object->ref = 1;
1137 *ppDataObj = (LPDIRECTXFILEDATA)object;
1139 return DXFILEERR_BADVALUE;
1142 static HRESULT WINAPI IDirectXFileEnumObjectImpl_GetDataObjectById(IDirectXFileEnumObject* iface, REFGUID rguid, LPDIRECTXFILEDATA* ppDataObj)
1144 IDirectXFileEnumObjectImpl *This = (IDirectXFileEnumObjectImpl *)iface;
1146 FIXME("(%p/%p)->(%p,%p) stub!\n", This, iface, rguid, ppDataObj);
1148 return DXFILEERR_BADVALUE;
1151 static HRESULT WINAPI IDirectXFileEnumObjectImpl_GetDataObjectByName(IDirectXFileEnumObject* iface, LPCSTR szName, LPDIRECTXFILEDATA* ppDataObj)
1153 IDirectXFileEnumObjectImpl *This = (IDirectXFileEnumObjectImpl *)iface;
1155 FIXME("(%p/%p)->(%s,%p) stub!\n", This, iface, szName, ppDataObj);
1157 return DXFILEERR_BADVALUE;
1160 static const IDirectXFileEnumObjectVtbl IDirectXFileEnumObject_Vtbl =
1162 IDirectXFileEnumObjectImpl_QueryInterface,
1163 IDirectXFileEnumObjectImpl_AddRef,
1164 IDirectXFileEnumObjectImpl_Release,
1165 IDirectXFileEnumObjectImpl_GetNextDataObject,
1166 IDirectXFileEnumObjectImpl_GetDataObjectById,
1167 IDirectXFileEnumObjectImpl_GetDataObjectByName
1170 HRESULT IDirectXFileObjectImpl_Create(IDirectXFileObjectImpl** ppObj)
1172 IDirectXFileObjectImpl* object;
1174 TRACE("(%p)\n", ppObj);
1176 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectXFileObjectImpl));
1178 object->lpVtbl.lpVtbl = &IDirectXFileObject_Vtbl;
1179 object->ref = 1;
1181 *ppObj = object;
1183 return S_OK;
1186 /*** IUnknown methods ***/
1187 static HRESULT WINAPI IDirectXFileObjectImpl_QueryInterface(IDirectXFileObject* iface, REFIID riid, void** ppvObject)
1189 IDirectXFileObjectImpl *This = (IDirectXFileObjectImpl *)iface;
1191 TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ppvObject);
1193 if (IsEqualGUID(riid, &IID_IUnknown)
1194 || IsEqualGUID(riid, &IID_IDirectXFileObject))
1196 IClassFactory_AddRef(iface);
1197 *ppvObject = This;
1198 return S_OK;
1201 ERR("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppvObject);
1202 return E_NOINTERFACE;
1205 static ULONG WINAPI IDirectXFileObjectImpl_AddRef(IDirectXFileObject* iface)
1207 IDirectXFileObjectImpl *This = (IDirectXFileObjectImpl *)iface;
1208 ULONG ref = InterlockedIncrement(&This->ref);
1210 TRACE("(%p/%p): AddRef from %d\n", iface, This, ref - 1);
1212 return ref;
1215 static ULONG WINAPI IDirectXFileObjectImpl_Release(IDirectXFileObject* iface)
1217 IDirectXFileObjectImpl *This = (IDirectXFileObjectImpl *)iface;
1218 ULONG ref = InterlockedDecrement(&This->ref);
1220 TRACE("(%p/%p): ReleaseRef to %d\n", iface, This, ref);
1222 if (!ref)
1223 HeapFree(GetProcessHeap(), 0, This);
1225 return ref;
1228 /*** IDirectXFileObject methods ***/
1229 static HRESULT WINAPI IDirectXFileObjectImpl_GetName(IDirectXFileObject* iface, LPSTR pstrNameBuf, LPDWORD pdwBufLen)
1231 IDirectXFileDataReferenceImpl *This = (IDirectXFileDataReferenceImpl *)iface;
1233 FIXME("(%p/%p)->(%p,%p) stub!\n", This, iface, pstrNameBuf, pdwBufLen);
1235 return DXFILEERR_BADVALUE;
1238 static HRESULT WINAPI IDirectXFileObjectImpl_GetId(IDirectXFileObject* iface, LPGUID pGuid)
1240 IDirectXFileObjectImpl *This = (IDirectXFileObjectImpl *)iface;
1242 FIXME("(%p/%p)->(%p) stub!\n", This, iface, pGuid);
1244 return DXFILEERR_BADVALUE;
1247 static const IDirectXFileObjectVtbl IDirectXFileObject_Vtbl =
1249 IDirectXFileObjectImpl_QueryInterface,
1250 IDirectXFileObjectImpl_AddRef,
1251 IDirectXFileObjectImpl_Release,
1252 IDirectXFileObjectImpl_GetName,
1253 IDirectXFileObjectImpl_GetId
1256 HRESULT IDirectXFileSaveObjectImpl_Create(IDirectXFileSaveObjectImpl** ppObj)
1258 IDirectXFileSaveObjectImpl* object;
1260 TRACE("(%p)\n", ppObj);
1262 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectXFileSaveObjectImpl));
1264 object->lpVtbl.lpVtbl = &IDirectXFileSaveObject_Vtbl;
1265 object->ref = 1;
1267 *ppObj = object;
1269 return S_OK;
1272 /*** IUnknown methods ***/
1273 static HRESULT WINAPI IDirectXFileSaveObjectImpl_QueryInterface(IDirectXFileSaveObject* iface, REFIID riid, void** ppvObject)
1275 IDirectXFileSaveObjectImpl *This = (IDirectXFileSaveObjectImpl *)iface;
1277 TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ppvObject);
1279 if (IsEqualGUID(riid, &IID_IUnknown)
1280 || IsEqualGUID(riid, &IID_IDirectXFileSaveObject))
1282 IClassFactory_AddRef(iface);
1283 *ppvObject = This;
1284 return S_OK;
1287 ERR("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppvObject);
1288 return E_NOINTERFACE;
1291 static ULONG WINAPI IDirectXFileSaveObjectImpl_AddRef(IDirectXFileSaveObject* iface)
1293 IDirectXFileSaveObjectImpl *This = (IDirectXFileSaveObjectImpl *)iface;
1294 ULONG ref = InterlockedIncrement(&This->ref);
1296 TRACE("(%p/%p): AddRef from %d\n", iface, This, ref - 1);
1298 return ref;
1301 static ULONG WINAPI IDirectXFileSaveObjectImpl_Release(IDirectXFileSaveObject* iface)
1303 IDirectXFileSaveObjectImpl *This = (IDirectXFileSaveObjectImpl *)iface;
1304 ULONG ref = InterlockedDecrement(&This->ref);
1306 TRACE("(%p/%p): ReleaseRef to %d\n", iface, This, ref);
1308 if (!ref)
1309 HeapFree(GetProcessHeap(), 0, This);
1311 return ref;
1314 static HRESULT WINAPI IDirectXFileSaveObjectImpl_SaveTemplates(IDirectXFileSaveObject* iface, DWORD cTemplates, const GUID** ppguidTemplates)
1316 IDirectXFileSaveObjectImpl *This = (IDirectXFileSaveObjectImpl *)iface;
1318 FIXME("(%p/%p)->(%d,%p) stub!\n", This, iface, cTemplates, ppguidTemplates);
1320 return DXFILEERR_BADVALUE;
1323 static HRESULT WINAPI IDirectXFileSaveObjectImpl_CreateDataObject(IDirectXFileSaveObject* iface, REFGUID rguidTemplate, LPCSTR szName, const GUID* pguid, DWORD cbSize, LPVOID pvData, LPDIRECTXFILEDATA* ppDataObj)
1325 IDirectXFileSaveObjectImpl *This = (IDirectXFileSaveObjectImpl *)iface;
1327 FIXME("(%p/%p)->(%p,%s,%p,%d,%p,%p) stub!\n", This, iface, rguidTemplate, szName, pguid, cbSize, pvData, ppDataObj);
1329 return DXFILEERR_BADVALUE;
1332 static HRESULT WINAPI IDirectXFileSaveObjectImpl_SaveData(IDirectXFileSaveObject* iface, LPDIRECTXFILEDATA ppDataObj)
1334 IDirectXFileSaveObjectImpl *This = (IDirectXFileSaveObjectImpl *)iface;
1336 FIXME("(%p/%p)->(%p) stub!\n", This, iface, ppDataObj);
1338 return DXFILEERR_BADVALUE;
1341 static const IDirectXFileSaveObjectVtbl IDirectXFileSaveObject_Vtbl =
1343 IDirectXFileSaveObjectImpl_QueryInterface,
1344 IDirectXFileSaveObjectImpl_AddRef,
1345 IDirectXFileSaveObjectImpl_Release,
1346 IDirectXFileSaveObjectImpl_SaveTemplates,
1347 IDirectXFileSaveObjectImpl_CreateDataObject,
1348 IDirectXFileSaveObjectImpl_SaveData