ReactOS 0.4.16-dev-401-g45b008d
d3dxof.c
Go to the documentation of this file.
1/*
2 * Implementation of DirectX File Interfaces
3 *
4 * Copyright 2004, 2008, 2010 Christian Costa
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21#include "wine/debug.h"
22
23#define COBJMACROS
24
25#include "winbase.h"
26#include "wingdi.h"
27
28#include "d3dxof_private.h"
29#include "dxfile.h"
30
31#include <stdio.h>
32
35
36static const struct IDirectXFileVtbl IDirectXFile_Vtbl;
37static const struct IDirectXFileBinaryVtbl IDirectXFileBinary_Vtbl;
38static const struct IDirectXFileDataVtbl IDirectXFileData_Vtbl;
39static const struct IDirectXFileDataReferenceVtbl IDirectXFileDataReference_Vtbl;
40static const struct IDirectXFileEnumObjectVtbl IDirectXFileEnumObject_Vtbl;
41static const struct IDirectXFileSaveObjectVtbl IDirectXFileSaveObject_Vtbl;
42
46
47#define TOKEN_DWORD 41
48#define TOKEN_FLOAT 42
49
51{
53
54 TRACE("(%p,%p)\n", pUnkOuter, ppObj);
55
57 if (!object)
58 return DXFILEERR_BADALLOC;
59
60 object->IDirectXFile_iface.lpVtbl = &IDirectXFile_Vtbl;
61 object->ref = 1;
62
63 /* Reserve first template to handle the case sensitive legacy type indexColor */
64 object->nb_xtemplates = 1;
65 strcpy(object->xtemplates[0].name, "indexColor");
66 object->xtemplates[0].nb_members = 2;
67 object->xtemplates[0].members[0].type = TOKEN_DWORD;
68 object->xtemplates[0].members[0].nb_dims = 0;
69 object->xtemplates[0].members[1].type = TOKEN_FLOAT;
70 object->xtemplates[0].members[1].nb_dims = 1;
71 object->xtemplates[0].members[1].dim_fixed[0] = TRUE;
72 object->xtemplates[0].members[1].dim_value[0] = 4;
73
74 *ppObj = &object->IDirectXFile_iface;
75
76 return S_OK;
77}
78
79static inline IDirectXFileImpl *impl_from_IDirectXFile(IDirectXFile *iface)
80{
81 return CONTAINING_RECORD(iface, IDirectXFileImpl, IDirectXFile_iface);
82}
83
84/*** IUnknown methods ***/
86{
88
89 TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ppvObject);
90
92 || IsEqualGUID(riid, &IID_IDirectXFile))
93 {
94 IUnknown_AddRef(iface);
95 *ppvObject = &This->IDirectXFile_iface;
96 return S_OK;
97 }
98
99 ERR("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppvObject);
100 return E_NOINTERFACE;
101}
102
103static ULONG WINAPI IDirectXFileImpl_AddRef(IDirectXFile* iface)
104{
107
108 TRACE("(%p/%p)->(): new ref %d\n", iface, This, ref);
109
110 return ref;
111}
112
113static ULONG WINAPI IDirectXFileImpl_Release(IDirectXFile* iface)
114{
117
118 TRACE("(%p/%p)->(): new ref %d\n", iface, This, ref);
119
120 if (!ref)
122
123 return ref;
124}
125
126/*** IDirectXFile methods ***/
127static HRESULT WINAPI IDirectXFileImpl_CreateEnumObject(IDirectXFile* iface, LPVOID pvSource, DXFILELOADOPTIONS dwLoadOptions, LPDIRECTXFILEENUMOBJECT* ppEnumObj)
128{
131 HRESULT hr;
134 DWORD bytes_written;
135
136 TRACE("(%p/%p)->(%p,%x,%p)\n", This, iface, pvSource, dwLoadOptions, ppEnumObj);
137
138 if (!ppEnumObj)
139 return DXFILEERR_BADVALUE;
140
141 /* Only lowest 4 bits are relevant in DXFILELOADOPTIONS */
142 dwLoadOptions &= 0xF;
143
145 if (FAILED(hr))
146 return hr;
147
148 if (dwLoadOptions == DXFILELOAD_FROMFILE)
149 {
150 HANDLE hFile, file_mapping;
151
152 TRACE("Open source file '%s'\n", (char*)pvSource);
153
156 {
157 TRACE("File '%s' not found\n", (char*)pvSource);
159 }
160
162
163 file_mapping = CreateFileMappingA(hFile, NULL, PAGE_READONLY, 0, 0, NULL);
165 if (!file_mapping)
166 {
168 goto error;
169 }
170
171 object->mapped_memory = MapViewOfFile(file_mapping, FILE_MAP_READ, 0, 0, 0);
172 CloseHandle(file_mapping);
173 if (!object->mapped_memory)
174 {
176 goto error;
177 }
178 file_buffer = object->mapped_memory;
179 }
180 else if (dwLoadOptions == DXFILELOAD_FROMRESOURCE)
181 {
182 HRSRC resource_info;
184 LPDXFILELOADRESOURCE lpdxflr = pvSource;
185
186 TRACE("Source in resource (module = %p, name = %s, type = %s)\n", lpdxflr->hModule, debugstr_a(lpdxflr->lpName), debugstr_a(lpdxflr->lpType));
187
188 resource_info = FindResourceA(lpdxflr->hModule, lpdxflr->lpName, lpdxflr->lpType);
189 if (!resource_info)
190 {
192 goto error;
193 }
194
195 file_size = SizeofResource(lpdxflr->hModule, resource_info);
196
197 resource_data = LoadResource(lpdxflr->hModule, resource_info);
198 if (!resource_data)
199 {
201 goto error;
202 }
203
205 if (!file_buffer)
206 {
208 goto error;
209 }
210 }
211 else if (dwLoadOptions == DXFILELOAD_FROMMEMORY)
212 {
213 LPDXFILELOADMEMORY lpdxflm = pvSource;
214
215 TRACE("Source in memory at %p with size %d\n", lpdxflm->lpMemory, lpdxflm->dSize);
216
217 file_buffer = lpdxflm->lpMemory;
218 file_size = lpdxflm->dSize;
219 }
220 else
221 {
222 FIXME("Source type %d is not handled yet\n", dwLoadOptions);
224 goto error;
225 }
226
227 TRACE("File size is %d bytes\n", file_size);
228
229 if (TRACE_ON(d3dxof_dump))
230 {
231 static USHORT num;
232 char tmp[12];
233 HANDLE file;
234 sprintf(tmp, "file%05u.x", num++);
235
238 {
239 WriteFile(file, file_buffer, file_size, &bytes_written, NULL);
241 }
242 }
243
244 object->pDirectXFile = This;
245
246 object->buf.pdxf = This;
247 object->buf.token_present = FALSE;
248 object->buf.buffer = file_buffer;
249 object->buf.rem_bytes = file_size;
250 hr = parse_header(&object->buf, &object->decomp_buffer);
251 if (FAILED(hr))
252 goto error;
253
254 /* Check if there are templates defined before the object */
255 if (!parse_templates(&object->buf, TRUE))
256 {
258 goto error;
259 }
260
261 if (TRACE_ON(d3dxof))
262 {
263 ULONG i;
264 TRACE("Registered templates (%d):\n", This->nb_xtemplates);
265 for (i = 1; i < This->nb_xtemplates; i++)
266 TRACE("%s - %s\n", This->xtemplates[i].name, debugstr_guid(&This->xtemplates[i].class_id));
267 }
268
269 *ppEnumObj = &object->IDirectXFileEnumObject_iface;
270
271 return DXFILE_OK;
272
273error:
274 IDirectXFileEnumObject_Release(&object->IDirectXFileEnumObject_iface);
275 *ppEnumObj = NULL;
276
277 return hr;
278}
279
280static HRESULT WINAPI IDirectXFileImpl_CreateSaveObject(IDirectXFile* iface, LPCSTR szFileName, DXFILEFORMAT dwFileFormat, LPDIRECTXFILESAVEOBJECT* ppSaveObj)
281{
284 HRESULT hr;
285
286 FIXME("(%p/%p)->(%s,%x,%p) partial stub!\n", This, iface, szFileName, dwFileFormat, ppSaveObj);
287
288 if (!szFileName || !ppSaveObj)
289 return E_POINTER;
290
292 if (SUCCEEDED(hr))
293 *ppSaveObj = &object->IDirectXFileSaveObject_iface;
294 return hr;
295}
296
298{
301 HRESULT hr;
302 LPBYTE decomp_buffer = NULL;
303 DWORD bytes_written;
304
305 ZeroMemory(&buf, sizeof(buf));
306 buf.buffer = pvData;
307 buf.rem_bytes = cbSize;
308 buf.pdxf = This;
309
310 TRACE("(%p/%p)->(%p,%d)\n", This, iface, pvData, cbSize);
311
312 if (!pvData)
313 return DXFILEERR_BADVALUE;
314
315 if (TRACE_ON(d3dxof_dump))
316 {
317 static USHORT num;
318 char tmp[16];
319 HANDLE file;
320 sprintf(tmp, "template%05u.x", num++);
321
324 {
325 WriteFile(file, pvData, cbSize, &bytes_written, NULL);
327 }
328 }
329
330 hr = parse_header(&buf, &decomp_buffer);
331 if (FAILED(hr))
332 goto cleanup;
333
334 if (!parse_templates(&buf, FALSE))
335 {
337 goto cleanup;
338 }
339
340 if (TRACE_ON(d3dxof))
341 {
342 ULONG i;
343 TRACE("Registered templates (%d):\n", This->nb_xtemplates);
344 for (i = 1; i < This->nb_xtemplates; i++)
345 TRACE("%s - %s\n", This->xtemplates[i].name, debugstr_guid(&This->xtemplates[i].class_id));
346 }
347
348 hr = DXFILE_OK;
349cleanup:
350 HeapFree(GetProcessHeap(), 0, decomp_buffer);
351 return hr;
352}
353
354static const IDirectXFileVtbl IDirectXFile_Vtbl =
355{
362};
363
365{
367
368 TRACE("(%p)\n", ppObj);
369
371 if (!object)
372 return DXFILEERR_BADALLOC;
373
374 object->IDirectXFileBinary_iface.lpVtbl = &IDirectXFileBinary_Vtbl;
375 object->ref = 1;
376
377 *ppObj = object;
378
379 return DXFILE_OK;
380}
381
382static inline IDirectXFileBinaryImpl *impl_from_IDirectXFileBinary(IDirectXFileBinary *iface)
383{
384 return CONTAINING_RECORD(iface, IDirectXFileBinaryImpl, IDirectXFileBinary_iface);
385}
386
387/*** IUnknown methods ***/
389{
391
392 TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ppvObject);
393
395 || IsEqualGUID(riid, &IID_IDirectXFileObject)
396 || IsEqualGUID(riid, &IID_IDirectXFileBinary))
397 {
398 IUnknown_AddRef(iface);
399 *ppvObject = &This->IDirectXFileBinary_iface;
400 return S_OK;
401 }
402
403 /* Do not print an error for interfaces that can be queried to retrieve the type of the object */
404 if (!IsEqualGUID(riid, &IID_IDirectXFileData)
405 && !IsEqualGUID(riid, &IID_IDirectXFileDataReference))
406 ERR("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppvObject);
407
408 return E_NOINTERFACE;
409}
410
411static ULONG WINAPI IDirectXFileBinaryImpl_AddRef(IDirectXFileBinary* iface)
412{
415
416 TRACE("(%p/%p)->(): new ref %d\n", iface, This, ref);
417
418 return ref;
419}
420
421static ULONG WINAPI IDirectXFileBinaryImpl_Release(IDirectXFileBinary* iface)
422{
425
426 TRACE("(%p/%p)->(): new ref %d\n", iface, This, ref);
427
428 if (!ref)
430
431 return ref;
432}
433
434/*** IDirectXFileObject methods ***/
435static HRESULT WINAPI IDirectXFileBinaryImpl_GetName(IDirectXFileBinary* iface, LPSTR pstrNameBuf, LPDWORD pdwBufLen)
436
437{
439
440 FIXME("(%p/%p)->(%p,%p) stub!\n", This, iface, pstrNameBuf, pdwBufLen);
441
442 return DXFILEERR_BADVALUE;
443}
444
445static HRESULT WINAPI IDirectXFileBinaryImpl_GetId(IDirectXFileBinary* iface, LPGUID pGuid)
446{
448
449 FIXME("(%p/%p)->(%p) stub!\n", This, iface, pGuid);
450
451 return DXFILEERR_BADVALUE;
452}
453
454/*** IDirectXFileBinary methods ***/
455static HRESULT WINAPI IDirectXFileBinaryImpl_GetSize(IDirectXFileBinary* iface, DWORD* pcbSize)
456{
458
459 FIXME("(%p/%p)->(%p) stub!\n", This, iface, pcbSize);
460
461 return DXFILEERR_BADVALUE;
462}
463
464static HRESULT WINAPI IDirectXFileBinaryImpl_GetMimeType(IDirectXFileBinary* iface, LPCSTR* pszMimeType)
465{
467
468 FIXME("(%p/%p)->(%p) stub!\n", This, iface, pszMimeType);
469
470 return DXFILEERR_BADVALUE;
471}
472
473static HRESULT WINAPI IDirectXFileBinaryImpl_Read(IDirectXFileBinary* iface, LPVOID pvData, DWORD cbSize, LPDWORD pcbRead)
474{
476
477 FIXME("(%p/%p)->(%p, %d, %p) stub!\n", This, iface, pvData, cbSize, pcbRead);
478
479 return DXFILEERR_BADVALUE;
480}
481
482static const IDirectXFileBinaryVtbl IDirectXFileBinary_Vtbl =
483{
492};
493
495{
497
498 TRACE("(%p)\n", ppObj);
499
501 if (!object)
502 return DXFILEERR_BADALLOC;
503
504 object->IDirectXFileData_iface.lpVtbl = &IDirectXFileData_Vtbl;
505 object->ref = 1;
506
507 *ppObj = object;
508
509 return S_OK;
510}
511
512static inline IDirectXFileDataImpl *impl_from_IDirectXFileData(IDirectXFileData *iface)
513{
514 return CONTAINING_RECORD(iface, IDirectXFileDataImpl, IDirectXFileData_iface);
515}
516
517/*** IUnknown methods ***/
519{
521
522 TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ppvObject);
523
525 || IsEqualGUID(riid, &IID_IDirectXFileObject)
526 || IsEqualGUID(riid, &IID_IDirectXFileData))
527 {
528 IUnknown_AddRef(iface);
529 *ppvObject = &This->IDirectXFileData_iface;
530 return S_OK;
531 }
532
533 /* Do not print an error for interfaces that can be queried to retrieve the type of the object */
534 if (!IsEqualGUID(riid, &IID_IDirectXFileBinary)
535 && !IsEqualGUID(riid, &IID_IDirectXFileDataReference))
536 ERR("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppvObject);
537
538 return E_NOINTERFACE;
539}
540
541static ULONG WINAPI IDirectXFileDataImpl_AddRef(IDirectXFileData* iface)
542{
545
546 TRACE("(%p/%p)->(): new ref %d\n", iface, This, ref);
547
548 return ref;
549}
550
551static ULONG WINAPI IDirectXFileDataImpl_Release(IDirectXFileData* iface)
552{
555
556 TRACE("(%p/%p)->(): new ref %d\n", iface, This, ref);
557
558 if (!ref)
559 {
560 if (!This->level && !This->from_ref)
561 {
562 HeapFree(GetProcessHeap(), 0, This->pstrings);
563 if (This->pobj)
564 {
565 HeapFree(GetProcessHeap(), 0, This->pobj->pdata);
566 HeapFree(GetProcessHeap(), 0, This->pobj);
567 }
568 }
570 }
571
572 return ref;
573}
574
575/*** IDirectXFileObject methods ***/
576static HRESULT WINAPI IDirectXFileDataImpl_GetName(IDirectXFileData* iface, LPSTR pstrNameBuf, LPDWORD pdwBufLen)
577{
579 DWORD len;
580
581 TRACE("(%p/%p)->(%p,%p)\n", This, iface, pstrNameBuf, pdwBufLen);
582
583 if (!pdwBufLen)
584 return DXFILEERR_BADVALUE;
585
586 len = strlen(This->pobj->name);
587 if (len)
588 len++;
589
590 if (pstrNameBuf) {
591 if (*pdwBufLen < len)
592 return DXFILEERR_BADVALUE;
593 CopyMemory(pstrNameBuf, This->pobj->name, len);
594 /* Even if we return a size of 0, an empty string with a null byte must be returned */
595 if (*pdwBufLen && !len)
596 pstrNameBuf[0] = 0;
597 }
598 *pdwBufLen = len;
599
600 return DXFILE_OK;
601}
602
603static HRESULT WINAPI IDirectXFileDataImpl_GetId(IDirectXFileData* iface, LPGUID pGuid)
604{
606
607 TRACE("(%p/%p)->(%p)\n", This, iface, pGuid);
608
609 if (!pGuid)
610 return DXFILEERR_BADVALUE;
611
612 *pGuid = This->pobj->class_id;
613
614 return DXFILE_OK;
615}
616
617/*** IDirectXFileData methods ***/
618static HRESULT WINAPI IDirectXFileDataImpl_GetData(IDirectXFileData* iface, LPCSTR szMember, DWORD* pcbSize, void** ppvData)
619{
621
622 TRACE("(%p/%p)->(%s,%p,%p)\n", This, iface, debugstr_a(szMember), pcbSize, ppvData);
623
624 if (!pcbSize || !ppvData)
625 return DXFILEERR_BADVALUE;
626
627 if (szMember)
628 {
629 ULONG i;
630 for (i = 0; i < This->pobj->nb_members; i++)
631 if (!strcmp(This->pobj->members[i].name, szMember))
632 break;
633 if (i == This->pobj->nb_members)
634 {
635 WARN("Unknown member '%s'\n", szMember);
637 }
638 *pcbSize = This->pobj->members[i].size;
639 *ppvData = This->pobj->root->pdata + This->pobj->members[i].start;
640 }
641 else
642 {
643 *pcbSize = This->pobj->size;
644 *ppvData = This->pobj->root->pdata + This->pobj->pos_data;
645 }
646
647 return DXFILE_OK;
648}
649
650static HRESULT WINAPI IDirectXFileDataImpl_GetType(IDirectXFileData* iface, const GUID** pguid)
651{
653 static GUID guid;
654
655 TRACE("(%p/%p)->(%p)\n", This, iface, pguid);
656
657 if (!pguid)
658 return DXFILEERR_BADVALUE;
659
660 guid = This->pobj->type;
661 *pguid = &guid;
662
663 return DXFILE_OK;
664}
665
666static HRESULT WINAPI IDirectXFileDataImpl_GetNextObject(IDirectXFileData* iface, LPDIRECTXFILEOBJECT* ppChildObj)
667{
668 HRESULT hr;
670
671 TRACE("(%p/%p)->(%p)\n", This, iface, ppChildObj);
672
673 if (This->cur_enum_object >= This->pobj->nb_children)
674 {
675 *ppChildObj = NULL;
677 }
678
679 if (This->from_ref && (This->level >= 1))
680 {
681 /* Only 2 levels can be enumerated if the object is obtained from a reference */
682 *ppChildObj = NULL;
684 }
685
686 if (This->pobj->children[This->cur_enum_object]->binary)
687 {
689
691 if (FAILED(hr))
692 return hr;
693
694 *ppChildObj = (LPDIRECTXFILEOBJECT)&object->IDirectXFileBinary_iface;
695 }
696 else if (This->pobj->children[This->cur_enum_object]->ptarget)
697 {
699
701 if (FAILED(hr))
702 return hr;
703
704 object->ptarget = This->pobj->children[This->cur_enum_object++]->ptarget;
705
706 *ppChildObj = (LPDIRECTXFILEOBJECT)&object->IDirectXFileDataReference_iface;
707 }
708 else
709 {
711
713 if (FAILED(hr))
714 return hr;
715
716 object->pobj = This->pobj->children[This->cur_enum_object++];
717 object->cur_enum_object = 0;
718 object->from_ref = This->from_ref;
719 object->level = This->level + 1;
720
721 *ppChildObj = (LPDIRECTXFILEOBJECT)&object->IDirectXFileData_iface;
722 }
723
724 return DXFILE_OK;
725}
726
728{
730
731 FIXME("(%p/%p)->(%p) stub!\n", This, iface, pDataObj);
732
733 return DXFILEERR_BADVALUE;
734}
735
736static HRESULT WINAPI IDirectXFileDataImpl_AddDataReference(IDirectXFileData* iface, LPCSTR szRef, const GUID* pguidRef)
737{
739
740 FIXME("(%p/%p)->(%s,%p) stub!\n", This, iface, szRef, pguidRef);
741
742 return DXFILEERR_BADVALUE;
743}
744
745static HRESULT WINAPI IDirectXFileDataImpl_AddBinaryObject(IDirectXFileData* iface, LPCSTR szName, const GUID* pguid, LPCSTR szMimeType, LPVOID pvData, DWORD cbSize)
746{
748
749 FIXME("(%p/%p)->(%s,%p,%s,%p,%d) stub!\n", This, iface, szName, pguid, szMimeType, pvData, cbSize);
750
751 return DXFILEERR_BADVALUE;
752}
753
754static const IDirectXFileDataVtbl IDirectXFileData_Vtbl =
755{
767};
768
770{
772
773 TRACE("(%p)\n", ppObj);
774
776 if (!object)
777 return DXFILEERR_BADALLOC;
778
779 object->IDirectXFileDataReference_iface.lpVtbl = &IDirectXFileDataReference_Vtbl;
780 object->ref = 1;
781
782 *ppObj = object;
783
784 return S_OK;
785}
786
787static inline IDirectXFileDataReferenceImpl *impl_from_IDirectXFileDataReference(IDirectXFileDataReference *iface)
788{
789 return CONTAINING_RECORD(iface, IDirectXFileDataReferenceImpl, IDirectXFileDataReference_iface);
790}
791
792/*** IUnknown methods ***/
793static HRESULT WINAPI IDirectXFileDataReferenceImpl_QueryInterface(IDirectXFileDataReference* iface, REFIID riid, void** ppvObject)
794{
796
797 TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ppvObject);
798
800 || IsEqualGUID(riid, &IID_IDirectXFileObject)
801 || IsEqualGUID(riid, &IID_IDirectXFileDataReference))
802 {
803 IUnknown_AddRef(iface);
804 *ppvObject = &This->IDirectXFileDataReference_iface;
805 return S_OK;
806 }
807
808 /* Do not print an error for interfaces that can be queried to retrieve the type of the object */
809 if (!IsEqualGUID(riid, &IID_IDirectXFileData)
810 && !IsEqualGUID(riid, &IID_IDirectXFileBinary))
811 ERR("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppvObject);
812
813 return E_NOINTERFACE;
814}
815
816static ULONG WINAPI IDirectXFileDataReferenceImpl_AddRef(IDirectXFileDataReference* iface)
817{
820
821 TRACE("(%p/%p)->(): new ref %d\n", iface, This, ref);
822
823 return ref;
824}
825
826static ULONG WINAPI IDirectXFileDataReferenceImpl_Release(IDirectXFileDataReference* iface)
827{
830
831 TRACE("(%p/%p)->(): new ref %d\n", iface, This, ref);
832
833 if (!ref)
835
836 return ref;
837}
838
839/*** IDirectXFileObject methods ***/
840static HRESULT WINAPI IDirectXFileDataReferenceImpl_GetName(IDirectXFileDataReference* iface, LPSTR pstrNameBuf, LPDWORD pdwBufLen)
841{
843 DWORD len;
844
845 TRACE("(%p/%p)->(%p,%p)\n", This, iface, pstrNameBuf, pdwBufLen);
846
847 if (!pdwBufLen)
848 return DXFILEERR_BADVALUE;
849
850 len = strlen(This->ptarget->name);
851 if (len)
852 len++;
853
854 if (pstrNameBuf) {
855 if (*pdwBufLen < len)
856 return DXFILEERR_BADVALUE;
857 CopyMemory(pstrNameBuf, This->ptarget->name, len);
858 /* Even if we return a size of 0, an empty string with a null byte must be returned */
859 if (*pdwBufLen && !len)
860 pstrNameBuf[0] = 0;
861 }
862 *pdwBufLen = len;
863
864 return DXFILE_OK;
865}
866
867static HRESULT WINAPI IDirectXFileDataReferenceImpl_GetId(IDirectXFileDataReference* iface, LPGUID pGuid)
868{
870
871 TRACE("(%p/%p)->(%p)\n", This, iface, pGuid);
872
873 if (!pGuid)
874 return DXFILEERR_BADVALUE;
875
876 *pGuid = This->ptarget->class_id;
877
878 return DXFILE_OK;
879}
880
881/*** IDirectXFileDataReference ***/
882static HRESULT WINAPI IDirectXFileDataReferenceImpl_Resolve(IDirectXFileDataReference* iface, LPDIRECTXFILEDATA* ppDataObj)
883{
886 HRESULT hr;
887
888 TRACE("(%p/%p)->(%p)\n", This, iface, ppDataObj);
889
890 if (!ppDataObj)
891 return DXFILEERR_BADVALUE;
892
894 if (FAILED(hr))
895 return hr;
896
897 object->pobj = This->ptarget;
898 object->cur_enum_object = 0;
899 object->level = 0;
900 object->from_ref = TRUE;
901
902 *ppDataObj = &object->IDirectXFileData_iface;
903
904 return DXFILE_OK;
905}
906
907static const IDirectXFileDataReferenceVtbl IDirectXFileDataReference_Vtbl =
908{
915};
916
918{
920
921 TRACE("(%p)\n", ppObj);
922
924 if (!object)
925 return DXFILEERR_BADALLOC;
926
927 object->IDirectXFileEnumObject_iface.lpVtbl = &IDirectXFileEnumObject_Vtbl;
928 object->ref = 1;
929
930 *ppObj = object;
931
932 return S_OK;
933}
934
935static inline IDirectXFileEnumObjectImpl *impl_from_IDirectXFileEnumObject(IDirectXFileEnumObject *iface)
936{
937 return CONTAINING_RECORD(iface, IDirectXFileEnumObjectImpl, IDirectXFileEnumObject_iface);
938}
939
940/*** IUnknown methods ***/
941static HRESULT WINAPI IDirectXFileEnumObjectImpl_QueryInterface(IDirectXFileEnumObject* iface, REFIID riid, void** ppvObject)
942{
944
945 TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ppvObject);
946
948 || IsEqualGUID(riid, &IID_IDirectXFileEnumObject))
949 {
950 IUnknown_AddRef(iface);
951 *ppvObject = &This->IDirectXFileEnumObject_iface;
952 return S_OK;
953 }
954
955 ERR("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppvObject);
956 return E_NOINTERFACE;
957}
958
959static ULONG WINAPI IDirectXFileEnumObjectImpl_AddRef(IDirectXFileEnumObject* iface)
960{
963
964 TRACE("(%p/%p)->(): new ref %d\n", iface, This, ref);
965
966 return ref;
967}
968
969static ULONG WINAPI IDirectXFileEnumObjectImpl_Release(IDirectXFileEnumObject* iface)
970{
973
974 TRACE("(%p/%p)->(): new ref %d\n", iface, This, ref);
975
976 if (!ref)
977 {
978 ULONG i;
979 for (i = 0; i < This->nb_xobjects; i++)
980 IDirectXFileData_Release(This->pRefObjects[i]);
981 if (This->mapped_memory)
982 UnmapViewOfFile(This->mapped_memory);
983 HeapFree(GetProcessHeap(), 0, This->decomp_buffer);
985 }
986
987 return ref;
988}
989
990/*** IDirectXFileEnumObject methods ***/
991static HRESULT WINAPI IDirectXFileEnumObjectImpl_GetNextDataObject(IDirectXFileEnumObject* iface, LPDIRECTXFILEDATA* ppDataObj)
992{
995 HRESULT hr;
996
997 if (!ppDataObj)
998 return E_POINTER;
999
1000 *ppDataObj = NULL;
1001
1002 TRACE("(%p/%p)->(%p)\n", This, iface, ppDataObj);
1003
1004 if (This->nb_xobjects >= MAX_OBJECTS)
1005 {
1006 ERR("Too many objects\n");
1008 }
1009
1010 /* Check if there are templates defined before the object */
1011 if (!parse_templates(&This->buf, TRUE))
1012 return DXFILEERR_PARSEERROR;
1013
1014 if (!This->buf.rem_bytes)
1016
1018 if (FAILED(hr))
1019 return hr;
1020
1021 object->pobj = HeapAlloc(GetProcessHeap(), 0, sizeof(xobject)*MAX_SUBOBJECTS);
1022 if (!object->pobj)
1023 {
1025 goto error;
1026 }
1027
1028 object->pstrings = HeapAlloc(GetProcessHeap(), 0, MAX_STRINGS_BUFFER);
1029 if (!object->pstrings)
1030 {
1032 goto error;
1033 }
1034
1035 object->cur_enum_object = 0;
1036 object->level = 0;
1037 object->from_ref = FALSE;
1038
1039 This->buf.pxo_globals = This->xobjects;
1040 This->buf.nb_pxo_globals = This->nb_xobjects;
1041 This->buf.level = 0;
1042 This->buf.pdata = NULL;
1043 This->buf.capacity = 0;
1044 This->buf.cur_pos_data = 0;
1045 This->buf.cur_pstrings = This->buf.pstrings = object->pstrings;
1046 This->buf.pxo = This->xobjects[This->nb_xobjects] = This->buf.pxo_tab = object->pobj;
1047 This->buf.pxo->pdata = NULL;
1048 This->buf.pxo->nb_subobjects = 1;
1049
1050 if (!parse_object(&This->buf))
1051 {
1052 WARN("Object is not correct\n");
1054 goto error;
1055 }
1056
1057 *ppDataObj = &object->IDirectXFileData_iface;
1058
1059 /* Get a reference to created object */
1060 This->pRefObjects[This->nb_xobjects] = &object->IDirectXFileData_iface;
1061 IDirectXFileData_AddRef(This->pRefObjects[This->nb_xobjects]);
1062
1063 This->nb_xobjects++;
1064
1065 return DXFILE_OK;
1066
1067error:
1068
1069 IDirectXFileData_Release(&object->IDirectXFileData_iface);
1070
1071 return hr;
1072}
1073
1074static HRESULT WINAPI IDirectXFileEnumObjectImpl_GetDataObjectById(IDirectXFileEnumObject* iface, REFGUID rguid, LPDIRECTXFILEDATA* ppDataObj)
1075{
1077
1078 FIXME("(%p/%p)->(%p,%p) stub!\n", This, iface, rguid, ppDataObj);
1079
1080 return DXFILEERR_BADVALUE;
1081}
1082
1084{
1086
1087 FIXME("(%p/%p)->(%s,%p) stub!\n", This, iface, szName, ppDataObj);
1088
1089 return DXFILEERR_BADVALUE;
1090}
1091
1092static const IDirectXFileEnumObjectVtbl IDirectXFileEnumObject_Vtbl =
1093{
1100};
1101
1103{
1105
1106 TRACE("(%p)\n", ppObj);
1107
1109 if (!object)
1110 return DXFILEERR_BADALLOC;
1111
1112 object->IDirectXFileSaveObject_iface.lpVtbl = &IDirectXFileSaveObject_Vtbl;
1113 object->ref = 1;
1114
1115 *ppObj = object;
1116
1117 return S_OK;
1118}
1119
1120static inline IDirectXFileSaveObjectImpl *impl_from_IDirectXFileSaveObject(IDirectXFileSaveObject *iface)
1121{
1122 return CONTAINING_RECORD(iface, IDirectXFileSaveObjectImpl, IDirectXFileSaveObject_iface);
1123}
1124
1125/*** IUnknown methods ***/
1126static HRESULT WINAPI IDirectXFileSaveObjectImpl_QueryInterface(IDirectXFileSaveObject* iface, REFIID riid, void** ppvObject)
1127{
1129
1130 TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ppvObject);
1131
1133 || IsEqualGUID(riid, &IID_IDirectXFileSaveObject))
1134 {
1135 IUnknown_AddRef(iface);
1136 *ppvObject = &This->IDirectXFileSaveObject_iface;
1137 return S_OK;
1138 }
1139
1140 ERR("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppvObject);
1141 return E_NOINTERFACE;
1142}
1143
1144static ULONG WINAPI IDirectXFileSaveObjectImpl_AddRef(IDirectXFileSaveObject* iface)
1145{
1148
1149 TRACE("(%p/%p)->(): new ref %d\n", iface, This, ref);
1150
1151 return ref;
1152}
1153
1154static ULONG WINAPI IDirectXFileSaveObjectImpl_Release(IDirectXFileSaveObject* iface)
1155{
1158
1159 TRACE("(%p/%p)->(): new ref %d\n", iface, This, ref);
1160
1161 if (!ref)
1163
1164 return ref;
1165}
1166
1167static HRESULT WINAPI IDirectXFileSaveObjectImpl_SaveTemplates(IDirectXFileSaveObject* iface, DWORD cTemplates, const GUID** ppguidTemplates)
1168{
1170
1171 FIXME("(%p/%p)->(%d,%p) stub!\n", This, iface, cTemplates, ppguidTemplates);
1172
1173 return DXFILE_OK;
1174}
1175
1176static HRESULT WINAPI IDirectXFileSaveObjectImpl_CreateDataObject(IDirectXFileSaveObject* iface, REFGUID rguidTemplate, LPCSTR szName, const GUID* pguid, DWORD cbSize, LPVOID pvData, LPDIRECTXFILEDATA* ppDataObj)
1177{
1179
1180 FIXME("(%p/%p)->(%p,%s,%p,%d,%p,%p) stub!\n", This, iface, rguidTemplate, szName, pguid, cbSize, pvData, ppDataObj);
1181
1182 return DXFILEERR_BADVALUE;
1183}
1184
1185static HRESULT WINAPI IDirectXFileSaveObjectImpl_SaveData(IDirectXFileSaveObject* iface, LPDIRECTXFILEDATA ppDataObj)
1186{
1188
1189 FIXME("(%p/%p)->(%p) stub!\n", This, iface, ppDataObj);
1190
1191 return DXFILEERR_BADVALUE;
1192}
1193
1194static const IDirectXFileSaveObjectVtbl IDirectXFileSaveObject_Vtbl =
1195{
1202};
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
const GUID IID_IUnknown
static HRESULT WINAPI IDirectXFileEnumObjectImpl_GetNextDataObject(IDirectXFileEnumObject *iface, LPDIRECTXFILEDATA *ppDataObj)
Definition: d3dxof.c:991
static HRESULT WINAPI IDirectXFileImpl_RegisterTemplates(IDirectXFile *iface, LPVOID pvData, DWORD cbSize)
Definition: d3dxof.c:297
static HRESULT IDirectXFileDataImpl_Create(IDirectXFileDataImpl **ppObj)
Definition: d3dxof.c:494
static HRESULT WINAPI IDirectXFileSaveObjectImpl_SaveData(IDirectXFileSaveObject *iface, LPDIRECTXFILEDATA ppDataObj)
Definition: d3dxof.c:1185
static HRESULT WINAPI IDirectXFileEnumObjectImpl_QueryInterface(IDirectXFileEnumObject *iface, REFIID riid, void **ppvObject)
Definition: d3dxof.c:941
static HRESULT WINAPI IDirectXFileBinaryImpl_GetMimeType(IDirectXFileBinary *iface, LPCSTR *pszMimeType)
Definition: d3dxof.c:464
static HRESULT WINAPI IDirectXFileDataImpl_GetName(IDirectXFileData *iface, LPSTR pstrNameBuf, LPDWORD pdwBufLen)
Definition: d3dxof.c:576
#define TOKEN_FLOAT
Definition: d3dxof.c:48
static HRESULT WINAPI IDirectXFileDataImpl_GetId(IDirectXFileData *iface, LPGUID pGuid)
Definition: d3dxof.c:603
static HRESULT WINAPI IDirectXFileDataImpl_GetNextObject(IDirectXFileData *iface, LPDIRECTXFILEOBJECT *ppChildObj)
Definition: d3dxof.c:666
static HRESULT WINAPI IDirectXFileImpl_CreateSaveObject(IDirectXFile *iface, LPCSTR szFileName, DXFILEFORMAT dwFileFormat, LPDIRECTXFILESAVEOBJECT *ppSaveObj)
Definition: d3dxof.c:280
static HRESULT WINAPI IDirectXFileDataReferenceImpl_QueryInterface(IDirectXFileDataReference *iface, REFIID riid, void **ppvObject)
Definition: d3dxof.c:793
static ULONG WINAPI IDirectXFileBinaryImpl_Release(IDirectXFileBinary *iface)
Definition: d3dxof.c:421
static IDirectXFileBinaryImpl * impl_from_IDirectXFileBinary(IDirectXFileBinary *iface)
Definition: d3dxof.c:382
static ULONG WINAPI IDirectXFileDataImpl_AddRef(IDirectXFileData *iface)
Definition: d3dxof.c:541
static HRESULT WINAPI IDirectXFileDataImpl_AddDataObject(IDirectXFileData *iface, LPDIRECTXFILEDATA pDataObj)
Definition: d3dxof.c:727
static ULONG WINAPI IDirectXFileEnumObjectImpl_Release(IDirectXFileEnumObject *iface)
Definition: d3dxof.c:969
static HRESULT WINAPI IDirectXFileSaveObjectImpl_SaveTemplates(IDirectXFileSaveObject *iface, DWORD cTemplates, const GUID **ppguidTemplates)
Definition: d3dxof.c:1167
static ULONG WINAPI IDirectXFileEnumObjectImpl_AddRef(IDirectXFileEnumObject *iface)
Definition: d3dxof.c:959
static HRESULT IDirectXFileDataReferenceImpl_Create(IDirectXFileDataReferenceImpl **ppObj)
Definition: d3dxof.c:769
static HRESULT WINAPI IDirectXFileDataImpl_AddDataReference(IDirectXFileData *iface, LPCSTR szRef, const GUID *pguidRef)
Definition: d3dxof.c:736
static HRESULT WINAPI IDirectXFileBinaryImpl_GetName(IDirectXFileBinary *iface, LPSTR pstrNameBuf, LPDWORD pdwBufLen)
Definition: d3dxof.c:435
static ULONG WINAPI IDirectXFileDataImpl_Release(IDirectXFileData *iface)
Definition: d3dxof.c:551
static HRESULT WINAPI IDirectXFileSaveObjectImpl_QueryInterface(IDirectXFileSaveObject *iface, REFIID riid, void **ppvObject)
Definition: d3dxof.c:1126
static const struct IDirectXFileBinaryVtbl IDirectXFileBinary_Vtbl
Definition: d3dxof.c:37
static HRESULT WINAPI IDirectXFileDataImpl_GetType(IDirectXFileData *iface, const GUID **pguid)
Definition: d3dxof.c:650
static IDirectXFileDataReferenceImpl * impl_from_IDirectXFileDataReference(IDirectXFileDataReference *iface)
Definition: d3dxof.c:787
static HRESULT WINAPI IDirectXFileImpl_QueryInterface(IDirectXFile *iface, REFIID riid, void **ppvObject)
Definition: d3dxof.c:85
static HRESULT WINAPI IDirectXFileImpl_CreateEnumObject(IDirectXFile *iface, LPVOID pvSource, DXFILELOADOPTIONS dwLoadOptions, LPDIRECTXFILEENUMOBJECT *ppEnumObj)
Definition: d3dxof.c:127
static HRESULT WINAPI IDirectXFileBinaryImpl_QueryInterface(IDirectXFileBinary *iface, REFIID riid, void **ppvObject)
Definition: d3dxof.c:388
#define TOKEN_DWORD
Definition: d3dxof.c:47
static const struct IDirectXFileDataReferenceVtbl IDirectXFileDataReference_Vtbl
Definition: d3dxof.c:39
static HRESULT IDirectXFileSaveObjectImpl_Create(IDirectXFileSaveObjectImpl **ppObj)
Definition: d3dxof.c:1102
static HRESULT WINAPI IDirectXFileDataReferenceImpl_GetId(IDirectXFileDataReference *iface, LPGUID pGuid)
Definition: d3dxof.c:867
static HRESULT WINAPI IDirectXFileBinaryImpl_GetId(IDirectXFileBinary *iface, LPGUID pGuid)
Definition: d3dxof.c:445
static ULONG WINAPI IDirectXFileSaveObjectImpl_Release(IDirectXFileSaveObject *iface)
Definition: d3dxof.c:1154
static ULONG WINAPI IDirectXFileBinaryImpl_AddRef(IDirectXFileBinary *iface)
Definition: d3dxof.c:411
static IDirectXFileEnumObjectImpl * impl_from_IDirectXFileEnumObject(IDirectXFileEnumObject *iface)
Definition: d3dxof.c:935
static ULONG WINAPI IDirectXFileSaveObjectImpl_AddRef(IDirectXFileSaveObject *iface)
Definition: d3dxof.c:1144
static ULONG WINAPI IDirectXFileDataReferenceImpl_AddRef(IDirectXFileDataReference *iface)
Definition: d3dxof.c:816
HRESULT IDirectXFileImpl_Create(IUnknown *pUnkOuter, LPVOID *ppObj)
Definition: d3dxof.c:50
static const struct IDirectXFileDataVtbl IDirectXFileData_Vtbl
Definition: d3dxof.c:38
static HRESULT WINAPI IDirectXFileDataImpl_AddBinaryObject(IDirectXFileData *iface, LPCSTR szName, const GUID *pguid, LPCSTR szMimeType, LPVOID pvData, DWORD cbSize)
Definition: d3dxof.c:745
static HRESULT WINAPI IDirectXFileDataImpl_QueryInterface(IDirectXFileData *iface, REFIID riid, void **ppvObject)
Definition: d3dxof.c:518
static IDirectXFileSaveObjectImpl * impl_from_IDirectXFileSaveObject(IDirectXFileSaveObject *iface)
Definition: d3dxof.c:1120
static const struct IDirectXFileSaveObjectVtbl IDirectXFileSaveObject_Vtbl
Definition: d3dxof.c:41
static const struct IDirectXFileEnumObjectVtbl IDirectXFileEnumObject_Vtbl
Definition: d3dxof.c:40
static HRESULT WINAPI IDirectXFileDataReferenceImpl_Resolve(IDirectXFileDataReference *iface, LPDIRECTXFILEDATA *ppDataObj)
Definition: d3dxof.c:882
static HRESULT IDirectXFileEnumObjectImpl_Create(IDirectXFileEnumObjectImpl **ppObj)
Definition: d3dxof.c:917
static HRESULT WINAPI IDirectXFileDataImpl_GetData(IDirectXFileData *iface, LPCSTR szMember, DWORD *pcbSize, void **ppvData)
Definition: d3dxof.c:618
static HRESULT WINAPI IDirectXFileBinaryImpl_Read(IDirectXFileBinary *iface, LPVOID pvData, DWORD cbSize, LPDWORD pcbRead)
Definition: d3dxof.c:473
static IDirectXFileDataImpl * impl_from_IDirectXFileData(IDirectXFileData *iface)
Definition: d3dxof.c:512
static HRESULT WINAPI IDirectXFileBinaryImpl_GetSize(IDirectXFileBinary *iface, DWORD *pcbSize)
Definition: d3dxof.c:455
static HRESULT IDirectXFileBinaryImpl_Create(IDirectXFileBinaryImpl **ppObj)
Definition: d3dxof.c:364
static IDirectXFileImpl * impl_from_IDirectXFile(IDirectXFile *iface)
Definition: d3dxof.c:79
static HRESULT WINAPI IDirectXFileDataReferenceImpl_GetName(IDirectXFileDataReference *iface, LPSTR pstrNameBuf, LPDWORD pdwBufLen)
Definition: d3dxof.c:840
static ULONG WINAPI IDirectXFileDataReferenceImpl_Release(IDirectXFileDataReference *iface)
Definition: d3dxof.c:826
static ULONG WINAPI IDirectXFileImpl_AddRef(IDirectXFile *iface)
Definition: d3dxof.c:103
static ULONG WINAPI IDirectXFileImpl_Release(IDirectXFile *iface)
Definition: d3dxof.c:113
static HRESULT WINAPI IDirectXFileSaveObjectImpl_CreateDataObject(IDirectXFileSaveObject *iface, REFGUID rguidTemplate, LPCSTR szName, const GUID *pguid, DWORD cbSize, LPVOID pvData, LPDIRECTXFILEDATA *ppDataObj)
Definition: d3dxof.c:1176
static HRESULT WINAPI IDirectXFileEnumObjectImpl_GetDataObjectById(IDirectXFileEnumObject *iface, REFGUID rguid, LPDIRECTXFILEDATA *ppDataObj)
Definition: d3dxof.c:1074
static HRESULT WINAPI IDirectXFileEnumObjectImpl_GetDataObjectByName(IDirectXFileEnumObject *iface, LPCSTR szName, LPDIRECTXFILEDATA *ppDataObj)
Definition: d3dxof.c:1083
static const struct IDirectXFileVtbl IDirectXFile_Vtbl
Definition: d3dxof.c:36
BOOL parse_templates(parse_buffer *buf, BOOL templates_only) DECLSPEC_HIDDEN
Definition: parsing.c:1098
#define MAX_SUBOBJECTS
HRESULT parse_header(parse_buffer *buf, BYTE **decomp_buffer_ptr) DECLSPEC_HIDDEN
Definition: parsing.c:184
BOOL parse_object(parse_buffer *buf) DECLSPEC_HIDDEN
Definition: parsing.c:1379
#define MAX_STRINGS_BUFFER
#define MAX_OBJECTS
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CloseHandle
Definition: compat.h:739
#define GetProcessHeap()
Definition: compat.h:736
#define PAGE_READONLY
Definition: compat.h:138
#define UnmapViewOfFile
Definition: compat.h:746
#define OPEN_EXISTING
Definition: compat.h:775
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define HeapAlloc
Definition: compat.h:733
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:740
#define GENERIC_READ
Definition: compat.h:135
#define TRACE_ON(x)
Definition: compat.h:75
#define HeapFree(x, y, z)
Definition: compat.h:735
#define FILE_MAP_READ
Definition: compat.h:776
#define WINE_DECLARE_DEBUG_CHANNEL(x)
Definition: compat.h:45
#define MapViewOfFile
Definition: compat.h:745
#define FILE_SHARE_READ
Definition: compat.h:136
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
static void cleanup(void)
Definition: main.c:1335
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
Definition: fileinfo.c:331
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
Definition: res.c:155
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
#define DXFILEERR_BADALLOC
Definition: dxfile.h:274
DWORD DXFILELOADOPTIONS
Definition: dxfile.h:35
#define DXFILEERR_RESOURCENOTFOUND
Definition: dxfile.h:278
#define IDirectXFileData_AddRef(p)
Definition: dxfile.h:184
struct IDirectXFileData * LPDIRECTXFILEDATA
Definition: dxfile.h:58
#define DXFILEERR_BADDATAREFERENCE
Definition: dxfile.h:289
#define IDirectXFileEnumObject_Release(p)
Definition: dxfile.h:107
struct IDirectXFileSaveObject * LPDIRECTXFILESAVEOBJECT
Definition: dxfile.h:56
#define DXFILELOAD_FROMFILE
Definition: dxfile.h:37
#define DXFILEERR_FILENOTFOUND
Definition: dxfile.h:277
#define DXFILEERR_NOTDONEYET
Definition: dxfile.h:276
#define DXFILEERR_BADFILETYPE
Definition: dxfile.h:281
struct IDirectXFileObject * LPDIRECTXFILEOBJECT
Definition: dxfile.h:57
#define DXFILE_OK
Definition: dxfile.h:268
DWORD DXFILEFORMAT
Definition: dxfile.h:29
#define DXFILEERR_PARSEERROR
Definition: dxfile.h:286
#define DXFILELOAD_FROMRESOURCE
Definition: dxfile.h:38
struct IDirectXFileEnumObject * LPDIRECTXFILEENUMOBJECT
Definition: dxfile.h:55
#define DXFILEERR_NOMOREOBJECTS
Definition: dxfile.h:291
#define DXFILELOAD_FROMMEMORY
Definition: dxfile.h:39
#define DXFILEERR_BADVALUE
Definition: dxfile.h:271
#define DXFILEERR_BADRESOURCE
Definition: dxfile.h:280
#define IDirectXFileData_Release(p)
Definition: dxfile.h:185
HANDLE NTAPI CreateFileMappingA(IN HANDLE hFile, IN LPSECURITY_ATTRIBUTES lpFileMappingAttributes, IN DWORD flProtect, IN DWORD dwMaximumSizeHigh, IN DWORD dwMaximumSizeLow, IN LPCSTR lpName)
Definition: filemap.c:23
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLuint GLuint num
Definition: glext.h:9618
GLenum GLsizei len
Definition: glext.h:6722
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
REFIID riid
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_guid
Definition: kernel32.h:35
#define debugstr_a
Definition: kernel32.h:31
const GUID * guid
#define error(str)
Definition: mkdosfs.c:1605
#define CREATE_ALWAYS
Definition: disk.h:72
#define sprintf(buf, format,...)
Definition: sprintf.c:55
_In_ HANDLE hFile
Definition: mswsock.h:90
#define GENERIC_WRITE
Definition: nt_native.h:90
unsigned short USHORT
Definition: pedump.c:61
static const WCHAR szName[]
Definition: powrprof.c:45
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
static unsigned int file_size
Definition: regtests2xml.c:47
static char * file_buffer
Definition: regtests2xml.c:46
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
LPVOID lpMemory
Definition: dxfile.h:50
HMODULE hModule
Definition: dxfile.h:44
Definition: scsiwmi.h:51
Definition: fci.c:127
Definition: send.c:48
unsigned char * LPBYTE
Definition: typedefs.h:53
uint32_t * LPDWORD
Definition: typedefs.h:59
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
#define ZeroMemory
Definition: winbase.h:1737
#define CopyMemory
Definition: winbase.h:1735
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082
_In_ ULONG _In_opt_ PVOID pvData
Definition: winddi.h:3749
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:2364
#define E_POINTER
Definition: winerror.h:2365
const char * LPCSTR
Definition: xmlstorage.h:183
char * LPSTR
Definition: xmlstorage.h:182