1 /***************************************************************************
3 * Copyright (C) 1998-1999 Microsoft Corporation. All Rights Reserved.
7 * Content: DirectX File public header file
9 ***************************************************************************/
18 typedef DWORD DXFILEFORMAT
;
20 #define DXFILEFORMAT_BINARY 0
21 #define DXFILEFORMAT_TEXT 1
22 #define DXFILEFORMAT_COMPRESSED 2
24 typedef DWORD DXFILELOADOPTIONS
;
26 #define DXFILELOAD_FROMFILE 0x00L
27 #define DXFILELOAD_FROMRESOURCE 0x01L
28 #define DXFILELOAD_FROMMEMORY 0x02L
29 #define DXFILELOAD_FROMSTREAM 0x04L
30 #define DXFILELOAD_FROMURL 0x08L
32 typedef struct _DXFILELOADRESOURCE
{
36 }DXFILELOADRESOURCE
, *LPDXFILELOADRESOURCE
;
38 typedef struct _DXFILELOADMEMORY
{
41 }DXFILELOADMEMORY
, *LPDXFILELOADMEMORY
;
44 * DirectX File object types.
48 #define WIN_TYPES(itype, ptype) typedef interface itype *LP##ptype, **LPLP##ptype
51 WIN_TYPES(IDirectXFile
, DIRECTXFILE
);
52 WIN_TYPES(IDirectXFileEnumObject
, DIRECTXFILEENUMOBJECT
);
53 WIN_TYPES(IDirectXFileSaveObject
, DIRECTXFILESAVEOBJECT
);
54 WIN_TYPES(IDirectXFileObject
, DIRECTXFILEOBJECT
);
55 WIN_TYPES(IDirectXFileData
, DIRECTXFILEDATA
);
56 WIN_TYPES(IDirectXFileDataReference
, DIRECTXFILEDATAREFERENCE
);
57 WIN_TYPES(IDirectXFileBinary
, DIRECTXFILEBINARY
);
60 * API for creating IDirectXFile interface.
63 STDAPI
DirectXFileCreate(LPDIRECTXFILE
*lplpDirectXFile
);
66 * The methods for IUnknown
69 #define IUNKNOWN_METHODS(kind) \
70 STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) kind; \
71 STDMETHOD_(ULONG, AddRef) (THIS) kind; \
72 STDMETHOD_(ULONG, Release) (THIS) kind
75 * The methods for IDirectXFileObject
78 #define IDIRECTXFILEOBJECT_METHODS(kind) \
79 STDMETHOD(GetName) (THIS_ LPSTR, LPDWORD) kind; \
80 STDMETHOD(GetId) (THIS_ LPGUID) kind
83 * DirectX File interfaces.
87 #define INTERFACE IDirectXFile
89 DECLARE_INTERFACE_(IDirectXFile
, IUnknown
)
91 IUNKNOWN_METHODS(PURE
);
92 STDMETHOD(CreateEnumObject
) (THIS_ LPVOID
, DXFILELOADOPTIONS
,
93 LPDIRECTXFILEENUMOBJECT
*) PURE
;
94 STDMETHOD(CreateSaveObject
) (THIS_ LPCSTR
, DXFILEFORMAT
,
95 LPDIRECTXFILESAVEOBJECT
*) PURE
;
96 STDMETHOD(RegisterTemplates
) (THIS_ LPVOID
, DWORD
) PURE
;
100 #define INTERFACE IDirectXFileEnumObject
102 DECLARE_INTERFACE_(IDirectXFileEnumObject
, IUnknown
)
104 IUNKNOWN_METHODS(PURE
);
105 STDMETHOD(GetNextDataObject
) (THIS_ LPDIRECTXFILEDATA
*) PURE
;
106 STDMETHOD(GetDataObjectById
) (THIS_ REFGUID
, LPDIRECTXFILEDATA
*) PURE
;
107 STDMETHOD(GetDataObjectByName
) (THIS_ LPCSTR
, LPDIRECTXFILEDATA
*) PURE
;
111 #define INTERFACE IDirectXFileSaveObject
113 DECLARE_INTERFACE_(IDirectXFileSaveObject
, IUnknown
)
115 IUNKNOWN_METHODS(PURE
);
116 STDMETHOD(SaveTemplates
) (THIS_ DWORD
, const GUID
**) PURE
;
117 STDMETHOD(CreateDataObject
) (THIS_ REFGUID
, LPCSTR
, const GUID
*,
118 DWORD
, LPVOID
, LPDIRECTXFILEDATA
*) PURE
;
119 STDMETHOD(SaveData
) (THIS_ LPDIRECTXFILEDATA
) PURE
;
124 #define INTERFACE IDirectXFileObject
126 DECLARE_INTERFACE_(IDirectXFileObject
, IUnknown
)
128 IUNKNOWN_METHODS(PURE
);
129 IDIRECTXFILEOBJECT_METHODS(PURE
);
133 #define INTERFACE IDirectXFileData
135 DECLARE_INTERFACE_(IDirectXFileData
, IDirectXFileObject
)
137 IUNKNOWN_METHODS(PURE
);
138 IDIRECTXFILEOBJECT_METHODS(PURE
);
140 STDMETHOD(GetData
) (THIS_ LPCSTR
, DWORD
*, void **) PURE
;
141 STDMETHOD(GetType
) (THIS_
const GUID
**) PURE
;
142 STDMETHOD(GetNextObject
) (THIS_ LPDIRECTXFILEOBJECT
*) PURE
;
143 STDMETHOD(AddDataObject
) (THIS_ LPDIRECTXFILEDATA
) PURE
;
144 STDMETHOD(AddDataReference
) (THIS_ LPCSTR
, const GUID
*) PURE
;
145 STDMETHOD(AddBinaryObject
) (THIS_ LPCSTR
, const GUID
*, LPCSTR
, LPVOID
, DWORD
) PURE
;
149 #define INTERFACE IDirectXFileDataReference
151 DECLARE_INTERFACE_(IDirectXFileDataReference
, IDirectXFileObject
)
153 IUNKNOWN_METHODS(PURE
);
154 IDIRECTXFILEOBJECT_METHODS(PURE
);
156 STDMETHOD(Resolve
) (THIS_ LPDIRECTXFILEDATA
*) PURE
;
160 #define INTERFACE IDirectXFileBinary
162 DECLARE_INTERFACE_(IDirectXFileBinary
, IDirectXFileObject
)
164 IUNKNOWN_METHODS(PURE
);
165 IDIRECTXFILEOBJECT_METHODS(PURE
);
167 STDMETHOD(GetSize
) (THIS_ DWORD
*) PURE
;
168 STDMETHOD(GetMimeType
) (THIS_ LPCSTR
*) PURE
;
169 STDMETHOD(Read
) (THIS_ LPVOID
, DWORD
, LPDWORD
) PURE
;
173 * DirectXFile Object Class Id (for CoCreateInstance())
176 DEFINE_GUID(CLSID_CDirectXFile
, 0x4516ec43, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3);
179 * DirectX File Interface GUIDs.
182 DEFINE_GUID(IID_IDirectXFile
, 0x3d82ab40, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
183 DEFINE_GUID(IID_IDirectXFileEnumObject
, 0x3d82ab41, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
184 DEFINE_GUID(IID_IDirectXFileSaveObject
, 0x3d82ab42, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
185 DEFINE_GUID(IID_IDirectXFileObject
, 0x3d82ab43, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
186 DEFINE_GUID(IID_IDirectXFileData
, 0x3d82ab44, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
187 DEFINE_GUID(IID_IDirectXFileDataReference
, 0x3d82ab45, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
188 DEFINE_GUID(IID_IDirectXFileBinary
, 0x3d82ab46, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
191 * DirectX File Header template's GUID.
194 DEFINE_GUID(TID_DXFILEHeader
, 0x3d82ab43, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
198 * DirectX File errors.
202 #define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code )
206 #define DXFILEERR_BADOBJECT MAKE_DDHRESULT(850)
207 #define DXFILEERR_BADVALUE MAKE_DDHRESULT(851)
208 #define DXFILEERR_BADTYPE MAKE_DDHRESULT(852)
209 #define DXFILEERR_BADSTREAMHANDLE MAKE_DDHRESULT(853)
210 #define DXFILEERR_BADALLOC MAKE_DDHRESULT(854)
211 #define DXFILEERR_NOTFOUND MAKE_DDHRESULT(855)
212 #define DXFILEERR_NOTDONEYET MAKE_DDHRESULT(856)
213 #define DXFILEERR_FILENOTFOUND MAKE_DDHRESULT(857)
214 #define DXFILEERR_RESOURCENOTFOUND MAKE_DDHRESULT(858)
215 #define DXFILEERR_URLNOTFOUND MAKE_DDHRESULT(859)
216 #define DXFILEERR_BADRESOURCE MAKE_DDHRESULT(860)
217 #define DXFILEERR_BADFILETYPE MAKE_DDHRESULT(861)
218 #define DXFILEERR_BADFILEVERSION MAKE_DDHRESULT(862)
219 #define DXFILEERR_BADFILEFLOATSIZE MAKE_DDHRESULT(863)
220 #define DXFILEERR_BADFILECOMPRESSIONTYPE MAKE_DDHRESULT(864)
221 #define DXFILEERR_BADFILE MAKE_DDHRESULT(865)
222 #define DXFILEERR_PARSEERROR MAKE_DDHRESULT(866)
223 #define DXFILEERR_NOTEMPLATE MAKE_DDHRESULT(867)
224 #define DXFILEERR_BADARRAYSIZE MAKE_DDHRESULT(868)
225 #define DXFILEERR_BADDATAREFERENCE MAKE_DDHRESULT(869)
226 #define DXFILEERR_INTERNALERROR MAKE_DDHRESULT(870)
227 #define DXFILEERR_NOMOREOBJECTS MAKE_DDHRESULT(871)
228 #define DXFILEERR_BADINTRINSICS MAKE_DDHRESULT(872)
229 #define DXFILEERR_NOMORESTREAMHANDLES MAKE_DDHRESULT(873)
230 #define DXFILEERR_NOMOREDATA MAKE_DDHRESULT(874)
231 #define DXFILEERR_BADCACHEFILE MAKE_DDHRESULT(875)
232 #define DXFILEERR_NOINTERNET MAKE_DDHRESULT(876)
239 #endif /* _DXFILE_H_ */