2004-06-03 00:03:23 +00:00
|
|
|
/*
|
|
|
|
* DirectX File private interfaces (D3DXOF.DLL)
|
|
|
|
*
|
2008-08-22 11:16:58 +00:00
|
|
|
* Copyright 2004, 2008 Christian Costa
|
2004-06-03 00:03:23 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 12:49:52 +00:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2004-06-03 00:03:23 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __D3DXOF_PRIVATE_INCLUDED__
|
|
|
|
#define __D3DXOF_PRIVATE_INCLUDED__
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "wtypes.h"
|
|
|
|
#include "wingdi.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
#include "dxfile.h"
|
|
|
|
|
2012-02-20 20:11:12 +00:00
|
|
|
#define MAX_NAME_LEN 40
|
2008-11-23 20:31:13 +00:00
|
|
|
#define MAX_ARRAY_DIM 4
|
2008-08-22 11:16:58 +00:00
|
|
|
#define MAX_MEMBERS 50
|
2012-02-17 08:38:55 +00:00
|
|
|
#define MAX_CHILDREN 200
|
2008-08-22 11:16:58 +00:00
|
|
|
#define MAX_TEMPLATES 200
|
2008-11-11 11:39:46 +00:00
|
|
|
#define MAX_OBJECTS 500
|
2010-03-23 07:32:20 +00:00
|
|
|
#define MAX_SUBOBJECTS 2000
|
2008-12-14 17:57:31 +00:00
|
|
|
#define MAX_STRINGS_BUFFER 10000
|
2008-08-22 11:16:58 +00:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
DWORD type;
|
|
|
|
LONG idx_template;
|
|
|
|
char name[MAX_NAME_LEN];
|
|
|
|
ULONG nb_dims;
|
|
|
|
BOOL dim_fixed[MAX_ARRAY_DIM]; /* fixed or variable */
|
|
|
|
ULONG dim_value[MAX_ARRAY_DIM]; /* fixed value or member index */
|
|
|
|
} member;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
char name[MAX_NAME_LEN];
|
|
|
|
GUID class_id;
|
|
|
|
BOOL open;
|
2008-12-16 19:57:45 +00:00
|
|
|
BOOL binary;
|
2011-08-03 09:39:17 +00:00
|
|
|
ULONG nb_children;
|
|
|
|
char children[MAX_CHILDREN][MAX_NAME_LEN];
|
2008-08-22 11:16:58 +00:00
|
|
|
ULONG nb_members;
|
|
|
|
member members[MAX_MEMBERS];
|
|
|
|
} xtemplate;
|
|
|
|
|
2008-09-16 20:22:28 +00:00
|
|
|
typedef struct {
|
2008-12-27 11:01:00 +00:00
|
|
|
char* name;
|
2009-03-12 08:06:16 +00:00
|
|
|
ULONG start;
|
2008-09-16 20:22:28 +00:00
|
|
|
ULONG size;
|
|
|
|
} xobject_member;
|
|
|
|
|
|
|
|
struct _xobject {
|
2008-12-16 19:57:45 +00:00
|
|
|
BOOL binary;
|
2008-09-24 20:38:29 +00:00
|
|
|
struct _xobject* ptarget;
|
2008-09-16 20:22:28 +00:00
|
|
|
char name[MAX_NAME_LEN];
|
|
|
|
GUID class_id;
|
|
|
|
GUID type;
|
|
|
|
LPBYTE pdata;
|
2009-03-12 08:06:16 +00:00
|
|
|
ULONG pos_data;
|
2008-09-16 20:22:28 +00:00
|
|
|
DWORD size;
|
|
|
|
ULONG nb_members;
|
|
|
|
xobject_member members[MAX_MEMBERS];
|
2011-08-03 09:39:17 +00:00
|
|
|
ULONG nb_children;
|
2008-10-07 20:53:38 +00:00
|
|
|
ULONG nb_subobjects;
|
2011-08-03 09:39:17 +00:00
|
|
|
struct _xobject * children[MAX_CHILDREN];
|
2009-03-12 08:06:16 +00:00
|
|
|
struct _xobject * root;
|
2008-09-16 20:22:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _xobject xobject;
|
|
|
|
|
2004-06-03 00:03:23 +00:00
|
|
|
typedef struct {
|
2011-05-27 01:21:01 +00:00
|
|
|
IDirectXFile IDirectXFile_iface;
|
2005-07-12 17:03:19 +00:00
|
|
|
LONG ref;
|
2008-08-22 11:16:58 +00:00
|
|
|
ULONG nb_xtemplates;
|
|
|
|
xtemplate xtemplates[MAX_TEMPLATES];
|
2004-06-03 00:03:23 +00:00
|
|
|
} IDirectXFileImpl;
|
|
|
|
|
|
|
|
typedef struct {
|
2011-05-27 01:21:01 +00:00
|
|
|
IDirectXFileBinary IDirectXFileBinary_iface;
|
2005-07-12 17:03:19 +00:00
|
|
|
LONG ref;
|
2004-06-03 00:03:23 +00:00
|
|
|
} IDirectXFileBinaryImpl;
|
|
|
|
|
|
|
|
typedef struct {
|
2011-05-27 01:21:01 +00:00
|
|
|
IDirectXFileData IDirectXFileData_iface;
|
2005-07-12 17:03:19 +00:00
|
|
|
LONG ref;
|
2008-09-16 20:22:28 +00:00
|
|
|
xobject* pobj;
|
|
|
|
int cur_enum_object;
|
2008-10-07 20:52:55 +00:00
|
|
|
BOOL from_ref;
|
|
|
|
ULONG level;
|
2008-11-09 10:11:40 +00:00
|
|
|
LPBYTE pstrings;
|
2004-06-03 00:03:23 +00:00
|
|
|
} IDirectXFileDataImpl;
|
|
|
|
|
|
|
|
typedef struct {
|
2011-05-27 01:21:01 +00:00
|
|
|
IDirectXFileDataReference IDirectXFileDataReference_iface;
|
2005-07-12 17:03:19 +00:00
|
|
|
LONG ref;
|
2008-09-24 20:38:29 +00:00
|
|
|
xobject* ptarget;
|
2004-06-03 00:03:23 +00:00
|
|
|
} IDirectXFileDataReferenceImpl;
|
|
|
|
|
|
|
|
typedef struct {
|
2011-05-27 01:21:01 +00:00
|
|
|
IDirectXFileObject IDirectXFileObject_iface;
|
2005-07-12 17:03:19 +00:00
|
|
|
LONG ref;
|
2004-06-03 00:03:23 +00:00
|
|
|
} IDirectXFileObjectImpl;
|
|
|
|
|
2008-09-16 20:22:28 +00:00
|
|
|
typedef struct {
|
|
|
|
/* Buffer to parse */
|
|
|
|
LPBYTE buffer;
|
|
|
|
DWORD rem_bytes;
|
|
|
|
/* Misc info */
|
2008-09-20 10:34:00 +00:00
|
|
|
WORD current_token;
|
|
|
|
BOOL token_present;
|
2008-09-16 20:22:28 +00:00
|
|
|
BOOL txt;
|
2013-05-30 21:05:39 +00:00
|
|
|
DWORD list_nb_elements;
|
|
|
|
BOOL list_type_float;
|
2013-05-30 21:05:47 +00:00
|
|
|
BOOL list_separator;
|
2009-03-12 08:06:16 +00:00
|
|
|
ULONG cur_pos_data;
|
2008-11-09 10:11:40 +00:00
|
|
|
LPBYTE cur_pstrings;
|
2008-09-16 20:22:28 +00:00
|
|
|
BYTE value[100];
|
2008-12-23 10:56:27 +00:00
|
|
|
xobject** pxo_globals;
|
2008-09-24 20:38:29 +00:00
|
|
|
ULONG nb_pxo_globals;
|
2008-09-22 18:27:09 +00:00
|
|
|
xobject* pxo_tab;
|
2008-09-16 20:22:28 +00:00
|
|
|
IDirectXFileImpl* pdxf;
|
|
|
|
xobject* pxo;
|
|
|
|
xtemplate* pxt[MAX_SUBOBJECTS];
|
|
|
|
ULONG level;
|
2008-11-16 18:44:51 +00:00
|
|
|
LPBYTE pdata;
|
2009-03-24 22:59:37 +00:00
|
|
|
ULONG capacity;
|
2008-11-09 10:11:40 +00:00
|
|
|
LPBYTE pstrings;
|
2008-09-16 20:22:28 +00:00
|
|
|
} parse_buffer;
|
|
|
|
|
2004-06-03 00:03:23 +00:00
|
|
|
typedef struct {
|
2011-05-27 01:21:01 +00:00
|
|
|
IDirectXFileEnumObject IDirectXFileEnumObject_iface;
|
2005-07-12 17:03:19 +00:00
|
|
|
LONG ref;
|
2011-06-08 19:38:51 +00:00
|
|
|
LPBYTE mapped_memory;
|
2010-04-12 09:21:33 +00:00
|
|
|
LPBYTE decomp_buffer;
|
2008-09-16 20:22:28 +00:00
|
|
|
parse_buffer buf;
|
|
|
|
IDirectXFileImpl* pDirectXFile;
|
|
|
|
ULONG nb_xobjects;
|
2008-12-23 10:56:27 +00:00
|
|
|
xobject* xobjects[MAX_OBJECTS];
|
2008-12-23 11:47:48 +00:00
|
|
|
IDirectXFileData* pRefObjects[MAX_OBJECTS];
|
2004-06-03 00:03:23 +00:00
|
|
|
} IDirectXFileEnumObjectImpl;
|
|
|
|
|
|
|
|
typedef struct {
|
2011-05-27 01:21:01 +00:00
|
|
|
IDirectXFileSaveObject IDirectXFileSaveObject_iface;
|
2005-07-12 17:03:19 +00:00
|
|
|
LONG ref;
|
2004-06-03 00:03:23 +00:00
|
|
|
} IDirectXFileSaveObjectImpl;
|
|
|
|
|
2011-04-28 11:28:49 +00:00
|
|
|
HRESULT IDirectXFileImpl_Create(IUnknown *pUnkOuter, LPVOID *ppObj) DECLSPEC_HIDDEN;
|
2004-06-04 19:36:56 +00:00
|
|
|
|
2011-06-08 19:38:58 +00:00
|
|
|
HRESULT parse_header(parse_buffer *buf, BYTE **decomp_buffer_ptr) DECLSPEC_HIDDEN;
|
2011-04-28 11:28:49 +00:00
|
|
|
BOOL parse_object(parse_buffer * buf) DECLSPEC_HIDDEN;
|
2013-04-29 19:42:55 +00:00
|
|
|
BOOL parse_templates(parse_buffer * buf, BOOL templates_only) DECLSPEC_HIDDEN;
|
2008-12-31 11:27:24 +00:00
|
|
|
|
2011-04-28 11:28:49 +00:00
|
|
|
int mszip_decompress(int inlen, int outlen, char* inbuffer, char* outbuffer) DECLSPEC_HIDDEN;
|
2010-04-12 09:21:33 +00:00
|
|
|
|
2004-06-03 00:03:23 +00:00
|
|
|
#endif /* __D3DXOF_PRIVATE_INCLUDED__ */
|