2004-06-03 02:03:23 +02:00
|
|
|
/*
|
|
|
|
* DirectX File private interfaces (D3DXOF.DLL)
|
|
|
|
*
|
2008-08-22 13:16:58 +02:00
|
|
|
* Copyright 2004, 2008 Christian Costa
|
2004-06-03 02:03:23 +02:00
|
|
|
*
|
|
|
|
* This file contains the (internal) driver registration functions,
|
|
|
|
* driver enumeration APIs and DirectDraw creation functions.
|
|
|
|
*
|
|
|
|
* 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 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2004-06-03 02:03:23 +02: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"
|
|
|
|
|
2008-08-22 13:16:58 +02:00
|
|
|
#define MAX_NAME_LEN 32
|
2008-11-23 21:31:13 +01:00
|
|
|
#define MAX_ARRAY_DIM 4
|
2008-08-22 13:16:58 +02:00
|
|
|
#define MAX_MEMBERS 50
|
2008-11-30 12:18:08 +01:00
|
|
|
#define MAX_CHILDS 100
|
2008-08-22 13:16:58 +02:00
|
|
|
#define MAX_TEMPLATES 200
|
2008-11-11 12:39:46 +01:00
|
|
|
#define MAX_OBJECTS 500
|
2010-03-23 08:32:20 +01:00
|
|
|
#define MAX_SUBOBJECTS 2000
|
2008-12-14 18:57:31 +01:00
|
|
|
#define MAX_STRINGS_BUFFER 10000
|
2008-08-22 13:16:58 +02: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 20:57:45 +01:00
|
|
|
BOOL binary;
|
2008-08-22 13:16:58 +02:00
|
|
|
ULONG nb_childs;
|
|
|
|
char childs[MAX_CHILDS][MAX_NAME_LEN];
|
|
|
|
ULONG nb_members;
|
|
|
|
member members[MAX_MEMBERS];
|
|
|
|
} xtemplate;
|
|
|
|
|
2008-09-16 22:22:28 +02:00
|
|
|
typedef struct {
|
2008-12-27 12:01:00 +01:00
|
|
|
char* name;
|
2009-03-12 09:06:16 +01:00
|
|
|
ULONG start;
|
2008-09-16 22:22:28 +02:00
|
|
|
ULONG size;
|
|
|
|
} xobject_member;
|
|
|
|
|
|
|
|
struct _xobject {
|
2008-12-16 20:57:45 +01:00
|
|
|
BOOL binary;
|
2008-09-24 22:38:29 +02:00
|
|
|
struct _xobject* ptarget;
|
2008-09-16 22:22:28 +02:00
|
|
|
char name[MAX_NAME_LEN];
|
|
|
|
GUID class_id;
|
|
|
|
GUID type;
|
|
|
|
LPBYTE pdata;
|
2009-03-12 09:06:16 +01:00
|
|
|
ULONG pos_data;
|
2008-09-16 22:22:28 +02:00
|
|
|
DWORD size;
|
|
|
|
ULONG nb_members;
|
|
|
|
xobject_member members[MAX_MEMBERS];
|
|
|
|
ULONG nb_childs;
|
2008-10-07 22:53:38 +02:00
|
|
|
ULONG nb_subobjects;
|
2008-09-16 22:22:28 +02:00
|
|
|
struct _xobject * childs[MAX_CHILDS];
|
2009-03-12 09:06:16 +01:00
|
|
|
struct _xobject * root;
|
2008-09-16 22:22:28 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _xobject xobject;
|
|
|
|
|
2004-06-03 02:03:23 +02:00
|
|
|
typedef struct {
|
2010-01-12 09:54:36 +01:00
|
|
|
const IDirectXFileVtbl *lpVtbl;
|
2005-07-12 19:03:19 +02:00
|
|
|
LONG ref;
|
2008-08-22 13:16:58 +02:00
|
|
|
ULONG nb_xtemplates;
|
|
|
|
xtemplate xtemplates[MAX_TEMPLATES];
|
2004-06-03 02:03:23 +02:00
|
|
|
} IDirectXFileImpl;
|
|
|
|
|
|
|
|
typedef struct {
|
2010-01-12 09:54:36 +01:00
|
|
|
const IDirectXFileBinaryVtbl *lpVtbl;
|
2005-07-12 19:03:19 +02:00
|
|
|
LONG ref;
|
2004-06-03 02:03:23 +02:00
|
|
|
} IDirectXFileBinaryImpl;
|
|
|
|
|
|
|
|
typedef struct {
|
2010-01-12 09:54:36 +01:00
|
|
|
const IDirectXFileDataVtbl *lpVtbl;
|
2005-07-12 19:03:19 +02:00
|
|
|
LONG ref;
|
2008-09-16 22:22:28 +02:00
|
|
|
xobject* pobj;
|
|
|
|
int cur_enum_object;
|
2008-10-07 22:52:55 +02:00
|
|
|
BOOL from_ref;
|
|
|
|
ULONG level;
|
2008-11-09 11:11:40 +01:00
|
|
|
LPBYTE pstrings;
|
2004-06-03 02:03:23 +02:00
|
|
|
} IDirectXFileDataImpl;
|
|
|
|
|
|
|
|
typedef struct {
|
2010-01-12 09:54:36 +01:00
|
|
|
const IDirectXFileDataReferenceVtbl *lpVtbl;
|
2005-07-12 19:03:19 +02:00
|
|
|
LONG ref;
|
2008-09-24 22:38:29 +02:00
|
|
|
xobject* ptarget;
|
2004-06-03 02:03:23 +02:00
|
|
|
} IDirectXFileDataReferenceImpl;
|
|
|
|
|
|
|
|
typedef struct {
|
2010-01-12 09:54:36 +01:00
|
|
|
const IDirectXFileObjectVtbl *lpVtbl;
|
2005-07-12 19:03:19 +02:00
|
|
|
LONG ref;
|
2004-06-03 02:03:23 +02:00
|
|
|
} IDirectXFileObjectImpl;
|
|
|
|
|
2008-09-16 22:22:28 +02:00
|
|
|
typedef struct {
|
|
|
|
/* Buffer to parse */
|
|
|
|
LPBYTE buffer;
|
|
|
|
DWORD rem_bytes;
|
|
|
|
/* Misc info */
|
2008-09-20 12:34:00 +02:00
|
|
|
WORD current_token;
|
|
|
|
BOOL token_present;
|
2008-09-16 22:22:28 +02:00
|
|
|
BOOL txt;
|
2009-03-12 09:06:16 +01:00
|
|
|
ULONG cur_pos_data;
|
2008-11-09 11:11:40 +01:00
|
|
|
LPBYTE cur_pstrings;
|
2008-09-16 22:22:28 +02:00
|
|
|
BYTE value[100];
|
2008-12-23 11:56:27 +01:00
|
|
|
xobject** pxo_globals;
|
2008-09-24 22:38:29 +02:00
|
|
|
ULONG nb_pxo_globals;
|
2008-09-22 20:27:09 +02:00
|
|
|
xobject* pxo_tab;
|
2008-09-16 22:22:28 +02:00
|
|
|
IDirectXFileImpl* pdxf;
|
|
|
|
xobject* pxo;
|
|
|
|
xtemplate* pxt[MAX_SUBOBJECTS];
|
|
|
|
ULONG level;
|
2008-11-16 19:44:51 +01:00
|
|
|
LPBYTE pdata;
|
2009-03-24 23:59:37 +01:00
|
|
|
ULONG capacity;
|
2008-11-09 11:11:40 +01:00
|
|
|
LPBYTE pstrings;
|
2008-09-16 22:22:28 +02:00
|
|
|
} parse_buffer;
|
|
|
|
|
2004-06-03 02:03:23 +02:00
|
|
|
typedef struct {
|
2010-01-12 09:54:36 +01:00
|
|
|
const IDirectXFileEnumObjectVtbl *lpVtbl;
|
2005-07-12 19:03:19 +02:00
|
|
|
LONG ref;
|
2008-09-01 22:55:44 +02:00
|
|
|
DXFILELOADOPTIONS source;
|
|
|
|
HANDLE hFile;
|
2009-02-03 22:58:34 +01:00
|
|
|
HANDLE file_mapping;
|
|
|
|
LPBYTE buffer;
|
2009-02-10 14:12:47 +01:00
|
|
|
HGLOBAL resource_data;
|
2010-04-12 11:21:33 +02:00
|
|
|
LPBYTE decomp_buffer;
|
2008-09-16 22:22:28 +02:00
|
|
|
parse_buffer buf;
|
|
|
|
IDirectXFileImpl* pDirectXFile;
|
|
|
|
ULONG nb_xobjects;
|
2008-12-23 11:56:27 +01:00
|
|
|
xobject* xobjects[MAX_OBJECTS];
|
2008-12-23 12:47:48 +01:00
|
|
|
IDirectXFileData* pRefObjects[MAX_OBJECTS];
|
2004-06-03 02:03:23 +02:00
|
|
|
} IDirectXFileEnumObjectImpl;
|
|
|
|
|
|
|
|
typedef struct {
|
2010-01-12 09:54:36 +01:00
|
|
|
const IDirectXFileSaveObjectVtbl *lpVtbl;
|
2005-07-12 19:03:19 +02:00
|
|
|
LONG ref;
|
2004-06-03 02:03:23 +02:00
|
|
|
} IDirectXFileSaveObjectImpl;
|
|
|
|
|
2004-06-04 21:36:56 +02:00
|
|
|
HRESULT IDirectXFileImpl_Create(IUnknown *pUnkOuter, LPVOID *ppObj);
|
|
|
|
HRESULT IDirectXFileFileObjectImpl_Create(IDirectXFileObjectImpl** ppObj);
|
|
|
|
HRESULT IDirectXFileFileSaveObjectImpl_Create(IDirectXFileSaveObjectImpl** ppObj);
|
|
|
|
|
2008-12-31 12:27:24 +01:00
|
|
|
BOOL read_bytes(parse_buffer * buf, LPVOID data, DWORD size);
|
|
|
|
BOOL parse_template(parse_buffer * buf);
|
|
|
|
void dump_template(xtemplate* templates_array, xtemplate* ptemplate);
|
|
|
|
BOOL is_template_available(parse_buffer * buf);
|
|
|
|
BOOL parse_object(parse_buffer * buf);
|
|
|
|
|
2010-04-12 11:21:33 +02:00
|
|
|
int mszip_decompress(int inlen, int outlen, char* inbuffer, char* outbuffer);
|
|
|
|
|
2004-06-03 02:03:23 +02:00
|
|
|
#endif /* __D3DXOF_PRIVATE_INCLUDED__ */
|