* not using any external deps anymore. all openssl/directx requirements are now on svn and ready to be compiled.

* moved auth directory to shared
This commit is contained in:
False.Genesis 2007-06-19 19:10:52 +00:00
parent d5ce92e448
commit d0bf7c3c2b
207 changed files with 114142 additions and 56 deletions

View File

@ -210,34 +210,6 @@
<File <File
RelativePath=".\Client\SysDefs.h"> RelativePath=".\Client\SysDefs.h">
</File> </File>
<Filter
Name="Auth"
Filter="">
<File
RelativePath=".\Client\Auth\AuthCrypt.cpp">
</File>
<File
RelativePath=".\Client\Auth\AuthCrypt.h">
</File>
<File
RelativePath=".\Client\Auth\BigNumber.cpp">
</File>
<File
RelativePath=".\Client\Auth\BigNumber.h">
</File>
<File
RelativePath=".\Client\Auth\md5.c">
</File>
<File
RelativePath=".\Client\Auth\md5.h">
</File>
<File
RelativePath=".\Client\Auth\Sha1.cpp">
</File>
<File
RelativePath=".\Client\Auth\Sha1.h">
</File>
</Filter>
<Filter <Filter
Name="DefScript" Name="DefScript"
Filter=""> Filter="">

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,640 @@
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// File: D3D10Shader.h
// Content: D3D10 Shader Types and APIs
//
//////////////////////////////////////////////////////////////////////////////
#ifndef __D3D10SHADER_H__
#define __D3D10SHADER_H__
#include "d3d10.h"
//---------------------------------------------------------------------------
// D3D10_TX_VERSION:
// --------------
// Version token used to create a procedural texture filler in effects
// Used by D3D10Fill[]TX functions
//---------------------------------------------------------------------------
#define D3D10_TX_VERSION(_Major,_Minor) (('T' << 24) | ('X' << 16) | ((_Major) << 8) | (_Minor))
//----------------------------------------------------------------------------
// D3D10SHADER flags:
// -----------------
// D3D10_SHADER_DEBUG
// Insert debug file/line/type/symbol information.
//
// D3D10_SHADER_SKIP_VALIDATION
// Do not validate the generated code against known capabilities and
// constraints. This option is only recommended when compiling shaders
// you KNOW will work. (ie. have compiled before without this option.)
// Shaders are always validated by D3D before they are set to the device.
//
// D3D10_SHADER_SKIP_OPTIMIZATION
// Instructs the compiler to skip optimization steps during code generation.
// Unless you are trying to isolate a problem in your code using this option
// is not recommended.
//
// D3D10_SHADER_PACK_MATRIX_ROW_MAJOR
// Unless explicitly specified, matrices will be packed in row-major order
// on input and output from the shader.
//
// D3D10_SHADER_PACK_MATRIX_COLUMN_MAJOR
// Unless explicitly specified, matrices will be packed in column-major
// order on input and output from the shader. This is generally more
// efficient, since it allows vector-matrix multiplication to be performed
// using a series of dot-products.
//
// D3D10_SHADER_PARTIAL_PRECISION
// Force all computations in resulting shader to occur at partial precision.
// This may result in faster evaluation of shaders on some hardware.
//
// D3D10_SHADER_FORCE_VS_SOFTWARE_NO_OPT
// Force compiler to compile against the next highest available software
// target for vertex shaders. This flag also turns optimizations off,
// and debugging on.
//
// D3D10_SHADER_FORCE_PS_SOFTWARE_NO_OPT
// Force compiler to compile against the next highest available software
// target for pixel shaders. This flag also turns optimizations off,
// and debugging on.
//
// D3D10_SHADER_NO_PRESHADER
// Disables Preshaders. Using this flag will cause the compiler to not
// pull out static expression for evaluation on the host cpu
//
// D3D10_SHADER_AVOID_FLOW_CONTROL
// Hint compiler to avoid flow-control constructs where possible.
//
// D3D10_SHADER_PREFER_FLOW_CONTROL
// Hint compiler to prefer flow-control constructs where possible.
//
// D3D10_SHADER_ENABLE_STRICTNESS
// By default, the HLSL/Effect compilers are not strict on deprecated syntax.
// Specifying this flag enables the strict mode. Deprecated syntax may be
// removed in a future release, and enabling syntax is a good way to make sure
// your shaders comply to the latest spec.
//
// D3D10_SHADER_ENABLE_BACKWARDS_COMPATIBILITY
// This enables older shaders to compile to 4_0 targets.
//
//----------------------------------------------------------------------------
#define D3D10_SHADER_DEBUG (1 << 0)
#define D3D10_SHADER_SKIP_VALIDATION (1 << 1)
#define D3D10_SHADER_SKIP_OPTIMIZATION (1 << 2)
#define D3D10_SHADER_PACK_MATRIX_ROW_MAJOR (1 << 3)
#define D3D10_SHADER_PACK_MATRIX_COLUMN_MAJOR (1 << 4)
#define D3D10_SHADER_PARTIAL_PRECISION (1 << 5)
#define D3D10_SHADER_FORCE_VS_SOFTWARE_NO_OPT (1 << 6)
#define D3D10_SHADER_FORCE_PS_SOFTWARE_NO_OPT (1 << 7)
#define D3D10_SHADER_NO_PRESHADER (1 << 8)
#define D3D10_SHADER_AVOID_FLOW_CONTROL (1 << 9)
#define D3D10_SHADER_PREFER_FLOW_CONTROL (1 << 10)
#define D3D10_SHADER_ENABLE_STRICTNESS (1 << 11)
#define D3D10_SHADER_ENABLE_BACKWARDS_COMPATIBILITY (1 << 12)
//----------------------------------------------------------------------------
// D3D10_SHADER_MACRO:
// ----------
// Preprocessor macro definition. The application pass in a NULL-terminated
// array of this structure to various D3D10 APIs. This enables the application
// to #define tokens at runtime, before the file is parsed.
//----------------------------------------------------------------------------
typedef struct _D3D10_SHADER_MACRO
{
LPCSTR Name;
LPCSTR Definition;
} D3D10_SHADER_MACRO, *LPD3D10_SHADER_MACRO;
//----------------------------------------------------------------------------
// D3D10_SHADER_VARIABLE_CLASS:
//----------------------------------------------------------------------------
typedef enum _D3D10_SHADER_VARIABLE_CLASS
{
D3D10_SVC_SCALAR,
D3D10_SVC_VECTOR,
D3D10_SVC_MATRIX_ROWS,
D3D10_SVC_MATRIX_COLUMNS,
D3D10_SVC_OBJECT,
D3D10_SVC_STRUCT,
// force 32-bit size enum
D3D10_SVC_FORCE_DWORD = 0x7fffffff
} D3D10_SHADER_VARIABLE_CLASS, *LPD3D10_SHADER_VARIABLE_CLASS;
//----------------------------------------------------------------------------
// D3D10_SHADER_VARIABLE_TYPE:
//----------------------------------------------------------------------------
typedef enum _D3D10_SHADER_VARIABLE_TYPE
{
D3D10_SVT_VOID = 0,
D3D10_SVT_BOOL = 1,
D3D10_SVT_INT = 2,
D3D10_SVT_FLOAT = 3,
D3D10_SVT_STRING = 4,
D3D10_SVT_TEXTURE = 5,
D3D10_SVT_TEXTURE1D = 6,
D3D10_SVT_TEXTURE2D = 7,
D3D10_SVT_TEXTURE3D = 8,
D3D10_SVT_TEXTURECUBE = 9,
D3D10_SVT_SAMPLER = 10,
D3D10_SVT_PIXELSHADER = 15,
D3D10_SVT_VERTEXSHADER = 16,
D3D10_SVT_UINT = 19,
D3D10_SVT_UINT8 = 20,
D3D10_SVT_GEOMETRYSHADER = 21,
D3D10_SVT_RASTERIZER = 22,
D3D10_SVT_DEPTHSTENCIL = 23,
D3D10_SVT_BLEND = 24,
D3D10_SVT_BUFFER = 25,
D3D10_SVT_CBUFFER = 26,
D3D10_SVT_TBUFFER = 27,
D3D10_SVT_TEXTURE1DARRAY = 28,
D3D10_SVT_TEXTURE2DARRAY = 29,
// force 32-bit size enum
D3D10_SVT_FORCE_DWORD = 0x7fffffff
} D3D10_SHADER_VARIABLE_TYPE, *LPD3D10_SHADER_VARIABLE_TYPE;
//----------------------------------------------------------------------------
// D3D10_SHADER_INPUT_TYPE
//----------------------------------------------------------------------------
typedef enum _D3D10_SHADER_INPUT_TYPE
{
D3D10_SIT_CBUFFER,
D3D10_SIT_TBUFFER,
D3D10_SIT_TEXTURE,
D3D10_SIT_SAMPLER,
} D3D10_SHADER_INPUT_TYPE, *LPD3D10_SHADER_INPUT_TYPE;
typedef enum _D3D10_CBUFFER_TYPE
{
D3D10_CT_CBUFFER,
D3D10_CT_TBUFFER,
} D3D10_CBUFFER_TYPE, *LPD3D10_CBUFFER_TYPE;
typedef enum D3D10_NAME
{
D3D10_NAME_UNDEFINED = 0,
D3D10_NAME_POSITION = 1,
D3D10_NAME_CLIP_DISTANCE = 2,
D3D10_NAME_CULL_DISTANCE = 3,
D3D10_NAME_RENDER_TARGET_ARRAY_INDEX = 4,
D3D10_NAME_VIEWPORT_ARRAY_INDEX = 5,
D3D10_NAME_VERTEX_ID = 6,
D3D10_NAME_PRIMITIVE_ID = 7,
D3D10_NAME_INSTANCE_ID = 8,
D3D10_NAME_IS_FRONT_FACE = 9
} D3D10_NAME;
typedef enum D3D10_RESOURCE_DIMENSION
{
D3D10_RESOURCE_DIMENSION_UNKNOWN = 0,
D3D10_RESOURCE_DIMENSION_BUFFER = 1,
D3D10_RESOURCE_DIMENSION_TEXTURE1D = 2,
D3D10_RESOURCE_DIMENSION_TEXTURE2D = 3,
D3D10_RESOURCE_DIMENSION_TEXTURE3D = 4,
D3D10_RESOURCE_DIMENSION_TEXTURECUBE = 5,
D3D10_RESOURCE_DIMENSION_TEXTURE1DARRAY = 6,
D3D10_RESOURCE_DIMENSION_TEXTURE2DARRAY = 7,
} D3D10_RESOURCE_DIMENSION;
typedef enum D3D10_RESOURCE_RETURN_TYPE
{
D3D10_RETURN_TYPE_UNORM = 1,
D3D10_RETURN_TYPE_SNORM = 2,
D3D10_RETURN_TYPE_SINT = 3,
D3D10_RETURN_TYPE_UINT = 4,
D3D10_RETURN_TYPE_FLOAT = 5,
D3D10_RETURN_TYPE_MIXED = 6,
} D3D10_RESOURCE_RETURN_TYPE;
typedef enum D3D10_REGISTER_COMPONENT_TYPE
{
D3D10_REGISTER_COMPONENT_UNKNOWN = 0,
D3D10_REGISTER_COMPONENT_UINT32 = 1,
D3D10_REGISTER_COMPONENT_SINT32 = 2,
D3D10_REGISTER_COMPONENT_FLOAT32 = 3
} D3D10_REGISTER_COMPONENT_TYPE;
//----------------------------------------------------------------------------
// D3D10_INCLUDE_TYPE:
//----------------------------------------------------------------------------
typedef enum _D3D10_INCLUDE_TYPE
{
D3D10_INCLUDE_LOCAL,
D3D10_INCLUDE_SYSTEM,
// force 32-bit size enum
D3D10_INCLUDE_FORCE_DWORD = 0x7fffffff
} D3D10_INCLUDE_TYPE, *LPD3D10_INCLUDE_TYPE;
//----------------------------------------------------------------------------
// ID3D10Include:
// -------------
// This interface is intended to be implemented by the application, and can
// be used by various D3D10 APIs. This enables application-specific handling
// of #include directives in source files.
//
// Open()
// Opens an include file. If successful, it should fill in ppData and
// pBytes. The data pointer returned must remain valid until Close is
// subsequently called.
// Close()
// Closes an include file. If Open was successful, Close is guaranteed
// to be called before the API using this interface returns.
//----------------------------------------------------------------------------
typedef interface ID3D10Include ID3D10Include;
typedef interface ID3D10Include *LPD3D10INCLUDE;
#undef INTERFACE
#define INTERFACE ID3D10Include
DECLARE_INTERFACE(ID3D10Include)
{
STDMETHOD(Open)(THIS_ D3D10_INCLUDE_TYPE IncludeType, LPCSTR pFileName, LPCVOID pParentData, LPCVOID *ppData, UINT *pBytes) PURE;
STDMETHOD(Close)(THIS_ LPCVOID pData) PURE;
};
//----------------------------------------------------------------------------
// ID3D10ShaderReflection:
//----------------------------------------------------------------------------
//
// Structure definitions
//
typedef struct _D3D10_SHADER_DESC
{
UINT Version; // Shader version
LPCSTR Creator; // Creator string
UINT Flags; // Shader compilation/parse flags
UINT ConstantBuffers; // Number of constant buffers
UINT BoundResources; // Number of bound resources
UINT InputParameters; // Number of parameters in the input signature
UINT OutputParameters; // Number of parameters in the output signature
} D3D10_SHADER_DESC;
typedef struct _D3D10_SHADER_BUFFER_DESC
{
LPCSTR Name; // Name of the constant buffer
D3D10_CBUFFER_TYPE Type; // Indicates that this is a CBuffer or TBuffer
UINT Variables; // Number of member variables
UINT Size; // Size of CB (in bytes)
} D3D10_SHADER_BUFFER_DESC;
typedef struct _D3D10_SHADER_VARIABLE_DESC
{
LPCSTR Name; // Name of the variable
UINT StartOffset; // Offset in constant buffer's backing store
UINT Size; // Size of variable (in bytes)
LPVOID DefaultValue; // Raw pointer to default value
} D3D10_SHADER_VARIABLE_DESC;
typedef struct _D3D10_SHADER_TYPE_DESC
{
D3D10_SHADER_VARIABLE_CLASS Class; // Variable class (e.g. object, matrix, etc.)
D3D10_SHADER_VARIABLE_TYPE Type; // Variable type (e.g. float, sampler, etc.)
UINT Rows; // Number of rows (for matrices, 1 for other numeric, 0 if not applicable)
UINT Columns; // Number of columns (for vectors & matrices, 1 for other numeric, 0 if not applicable)
UINT Elements; // Number of elements (0 if not an array)
UINT Members; // Number of members (0 if not a structure)
} D3D10_SHADER_TYPE_DESC;
typedef struct _D3D10_SHADER_INPUT_BIND_DESC
{
LPCSTR Name; // Name of the resource
D3D10_SHADER_INPUT_TYPE Type; // Type of resource (e.g. texture, cbuffer, etc.)
UINT BindPoint; // Starting bind point
UINT BindCount; // Number of contiguous bind points (for arrays)
D3D10_RESOURCE_RETURN_TYPE ReturnType; // Return type (if texture)
D3D10_RESOURCE_DIMENSION Dimension; // Dimension (if texture)
} D3D10_SHADER_INPUT_BIND_DESC;
typedef struct _D3D10_SIGNATURE_PARAMETER_DESC
{
LPCSTR SemanticName; // Name of the semantic
UINT SemanticIndex; // Index of the semantic
UINT Register; // Number of member variables
D3D10_NAME SystemValueType;// A predefined system value, or D3D10_NAME_UNDEFINED if not applicable
D3D10_REGISTER_COMPONENT_TYPE ComponentType;// Scalar type (e.g. uint, float, etc.)
BYTE Mask; // Mask to indicate which components of the register
// are used (combination of D3D10_COMPONENT_MASK values)
BYTE ReadWriteMask; // Mask to indicate whether a given component is
// never written (if this is an output signature) or
// always read (if this is an input signature).
// (combination of D3D10_COMPONENT_MASK values)
} D3D10_SIGNATURE_PARAMETER_DESC;
//
// Interface definitions
//
typedef interface ID3D10ShaderReflectionType ID3D10ShaderReflectionType;
typedef interface ID3D10ShaderReflectionType *LPD3D10SHADERREFLECTIONTYPE;
// {C530AD7D-9B16-4395-A979-BA2ECFF83ADD}
DEFINE_GUID(IID_ID3D10ShaderReflectionType,
0xc530ad7d, 0x9b16, 0x4395, 0xa9, 0x79, 0xba, 0x2e, 0xcf, 0xf8, 0x3a, 0xdd);
#undef INTERFACE
#define INTERFACE ID3D10ShaderReflectionType
DECLARE_INTERFACE(ID3D10ShaderReflectionType)
{
STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_TYPE_DESC *pDesc) PURE;
STDMETHOD_(ID3D10ShaderReflectionType*, GetMemberTypeByIndex)(THIS_ UINT Index) PURE;
STDMETHOD_(ID3D10ShaderReflectionType*, GetMemberTypeByName)(THIS_ LPCSTR Name) PURE;
STDMETHOD_(LPCSTR, GetMemberTypeName)(THIS_ UINT Index) PURE;
};
typedef interface ID3D10ShaderReflectionVariable ID3D10ShaderReflectionVariable;
typedef interface ID3D10ShaderReflectionVariable *LPD3D10SHADERREFLECTIONVARIABLE;
// {1BF63C95-2650-405d-99C1-3636BD1DA0A1}
DEFINE_GUID(IID_ID3D10ShaderReflectionVariable,
0x1bf63c95, 0x2650, 0x405d, 0x99, 0xc1, 0x36, 0x36, 0xbd, 0x1d, 0xa0, 0xa1);
#undef INTERFACE
#define INTERFACE ID3D10ShaderReflectionVariable
DECLARE_INTERFACE(ID3D10ShaderReflectionVariable)
{
STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_VARIABLE_DESC *pDesc) PURE;
STDMETHOD_(ID3D10ShaderReflectionType*, GetType)(THIS) PURE;
};
typedef interface ID3D10ShaderReflectionConstantBuffer ID3D10ShaderReflectionConstantBuffer;
typedef interface ID3D10ShaderReflectionConstantBuffer *LPD3D10SHADERREFLECTIONCONSTANTBUFFER;
// {66C66A94-DDDD-4b62-A66A-F0DA33C2B4D0}
DEFINE_GUID(IID_ID3D10ShaderReflectionConstantBuffer,
0x66c66a94, 0xdddd, 0x4b62, 0xa6, 0x6a, 0xf0, 0xda, 0x33, 0xc2, 0xb4, 0xd0);
#undef INTERFACE
#define INTERFACE ID3D10ShaderReflectionConstantBuffer
DECLARE_INTERFACE(ID3D10ShaderReflectionConstantBuffer)
{
STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_BUFFER_DESC *pDesc) PURE;
STDMETHOD_(ID3D10ShaderReflectionVariable*, GetVariableByIndex)(THIS_ UINT Index) PURE;
STDMETHOD_(ID3D10ShaderReflectionVariable*, GetVariableByName)(THIS_ LPCSTR Name) PURE;
};
typedef interface ID3D10ShaderReflection ID3D10ShaderReflection;
typedef interface ID3D10ShaderReflection *LPD3D10SHADERREFLECTION;
// {D40E20B6-F8F7-42ad-AB20-4BAF8F15DFAA}
DEFINE_GUID(IID_ID3D10ShaderReflection,
0xd40e20b6, 0xf8f7, 0x42ad, 0xab, 0x20, 0x4b, 0xaf, 0x8f, 0x15, 0xdf, 0xaa);
#undef INTERFACE
#define INTERFACE ID3D10ShaderReflection
DECLARE_INTERFACE_(ID3D10ShaderReflection, IUnknown)
{
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_DESC *pDesc) PURE;
STDMETHOD_(ID3D10ShaderReflectionConstantBuffer*, GetConstantBufferByIndex)(THIS_ UINT Index) PURE;
STDMETHOD_(ID3D10ShaderReflectionConstantBuffer*, GetConstantBufferByName)(THIS_ LPCSTR Name) PURE;
STDMETHOD(GetResourceBindingDesc)(THIS_ UINT ResourceIndex, D3D10_SHADER_INPUT_BIND_DESC *pDesc) PURE;
STDMETHOD(GetInputParameterDesc)(THIS_ UINT ParameterIndex, D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
STDMETHOD(GetOutputParameterDesc)(THIS_ UINT ParameterIndex, D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
};
//////////////////////////////////////////////////////////////////////////////
// APIs //////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
//----------------------------------------------------------------------------
// D3D10CompileShader:
// ------------------
// Compiles a shader.
//
// Parameters:
// pSrcFile
// Source file name.
// hSrcModule
// Module handle. if NULL, current module will be used.
// pSrcResource
// Resource name in module.
// pSrcData
// Pointer to source code.
// SrcDataLen
// Size of source code, in bytes.
// pDefines
// Optional NULL-terminated array of preprocessor macro definitions.
// pInclude
// Optional interface pointer to use for handling #include directives.
// If this parameter is NULL, #includes will be honored when compiling
// from file, and will error when compiling from resource or memory.
// pFunctionName
// Name of the entrypoint function where execution should begin.
// pProfile
// Instruction set to be used when generating code. The D3D10 entry
// point currently supports only "vs_4_0", "ps_4_0", and "gs_4_0".
// Flags
// See D3D10_SHADER_xxx flags.
// ppShader
// Returns a buffer containing the created shader. This buffer contains
// the compiled shader code, as well as any embedded debug and symbol
// table info. (See D3D10GetShaderConstantTable)
// ppErrorMsgs
// Returns a buffer containing a listing of errors and warnings that were
// encountered during the compile. If you are running in a debugger,
// these are the same messages you will see in your debug output.
//----------------------------------------------------------------------------
HRESULT WINAPI D3D10CompileShader(LPCSTR pSrcData, SIZE_T SrcDataLen, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs);
//----------------------------------------------------------------------------
// D3D10DisassembleShader:
// ----------------------
// Takes a binary shader, and returns a buffer containing text assembly.
//
// Parameters:
// pShader
// Pointer to the shader byte code.
// ShaderSizeInBytes
// Size of the shader byte code in bytes.
// EnableColorCode
// Emit HTML tags for color coding the output?
// pComments
// Pointer to a comment string to include at the top of the shader.
// ppDisassembly
// Returns a buffer containing the disassembled shader.
//----------------------------------------------------------------------------
HRESULT WINAPI D3D10DisassembleShader(CONST UINT *pShader, BOOL EnableColorCode, LPCSTR pComments, ID3D10Blob** ppDisassembly);
//----------------------------------------------------------------------------
// D3D10GetShaderSize:
// ------------------
// Returns the size of the shader blob container, in bytes.
//
// Parameters:
// pFunction
// Pointer to the function UINT stream
//----------------------------------------------------------------------------
UINT WINAPI D3D10GetShaderSize(CONST UINT *pFunction);
//----------------------------------------------------------------------------
// D3D10GetShaderVersion:
// -----------------------
// Returns the shader version of a given shader. Returns zero if the shader
// function is NULL.
//
// Parameters:
// pFunction
// Pointer to the function UINT stream
//----------------------------------------------------------------------------
UINT WINAPI D3D10GetShaderVersion(CONST UINT *pFunction);
//----------------------------------------------------------------------------
// D3D10GetPixelShaderProfile/D3D10GetVertexShaderProfile/D3D10GetGeometryShaderProfile:
// -----------------------------------------------------
// Returns the name of the HLSL profile best suited to a given device.
//
// Parameters:
// pDevice
// Pointer to the device in question
//----------------------------------------------------------------------------
LPCSTR WINAPI D3D10GetPixelShaderProfile(ID3D10Device *pDevice);
LPCSTR WINAPI D3D10GetVertexShaderProfile(ID3D10Device *pDevice);
LPCSTR WINAPI D3D10GetGeometryShaderProfile(ID3D10Device *pDevice);
//----------------------------------------------------------------------------
// D3D10ReflectShader:
// ------------------
// Creates a shader reflection object that can be used to retrieve information
// about a compiled shader
//
// Parameters:
// pShaderBytecode
// Pointer to a compiled shader (same pointer that is passed into
// ID3D10Device::CreateShader)
// BytecodeLength
// Length of the shader bytecode buffer
// ppReflector
// [out] Returns a ID3D10ShaderReflection object that can be used to
// retrieve shader resource and constant buffer information
//
//----------------------------------------------------------------------------
HRESULT WINAPI D3D10ReflectShader(void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10ShaderReflection **ppReflector);
//----------------------------------------------------------------------------
// D3D10PreprocessShader
// ---------------------
// Creates a shader reflection object that can be used to retrieve information
// about a compiled shader
//
// Parameters:
// pSrcData
// Pointer to source code
// SrcDataLen
// Size of source code, in bytes
// pFileName
// Source file name (used for error output)
// pDefines
// Optional NULL-terminated array of preprocessor macro definitions.
// pInclude
// Optional interface pointer to use for handling #include directives.
// If this parameter is NULL, #includes will be honored when assembling
// from file, and will error when assembling from resource or memory.
// ppShaderText
// Returns a buffer containing a single large string that represents
// the resulting formatted token stream
// ppErrorMsgs
// Returns a buffer containing a listing of errors and warnings that were
// encountered during assembly. If you are running in a debugger,
// these are the same messages you will see in your debug output.
//----------------------------------------------------------------------------
HRESULT WINAPI D3D10PreprocessShader(LPCSTR pSrcData, SIZE_T SrcDataSize, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines,
LPD3D10INCLUDE pInclude, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs);
//////////////////////////////////////////////////////////////////////////
//
// Shader blob manipulation routines
// ---------------------------------
//
// void *pShaderBytecode - a buffer containing the result of an HLSL
// compilation. Typically this opaque buffer contains several
// discrete sections including the shader executable code, the input
// signature, and the output signature. This can typically be retrieved
// by calling ID3D10Blob::GetBufferPointer() on the returned blob
// from HLSL's compile APIs.
//
// UINT BytecodeLength - the length of pShaderBytecode. This can
// typically be retrieved by calling ID3D10Blob::GetBufferSize()
// on the returned blob from HLSL's compile APIs.
//
// ID3D10Blob **ppSignatureBlob(s) - a newly created buffer that
// contains only the signature portions of the original bytecode.
// This is a copy; the original bytecode is not modified. You may
// specify NULL for this parameter to have the bytecode validated
// for the presence of the corresponding signatures without actually
// copying them and creating a new blob.
//
// Returns E_INVALIDARG if any required parameters are NULL
// Returns E_FAIL is the bytecode is corrupt or missing signatures
// Returns S_OK on success
//
//////////////////////////////////////////////////////////////////////////
HRESULT D3D10GetInputSignatureBlob(void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10Blob **ppSignatureBlob);
HRESULT D3D10GetOutputSignatureBlob(void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10Blob **ppSignatureBlob);
HRESULT D3D10GetInputAndOutputSignatureBlob(void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10Blob **ppSignatureBlob);
#ifdef __cplusplus
}
#endif //__cplusplus
#endif //__D3D10SHADER_H__

View File

@ -0,0 +1,72 @@
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx10.h
// Content: D3DX10 utility library
//
//////////////////////////////////////////////////////////////////////////////
#ifdef __D3DX10_INTERNAL__
#error Incorrect D3DX10 header used
#endif
#ifndef __D3DX10_H__
#define __D3DX10_H__
// Defines
#include <limits.h>
#include <float.h>
#define D3DX10_DEFAULT ((UINT) -1)
#define D3DX10_FROM_FILE ((UINT) -3)
#define DXGI_FORMAT_FROM_FILE ((DXGI_FORMAT) -3)
#ifndef D3DX10INLINE
#ifdef _MSC_VER
#if (_MSC_VER >= 1200)
#define D3DX10INLINE __forceinline
#else
#define D3DX10INLINE __inline
#endif
#else
#ifdef __cplusplus
#define D3DX10INLINE inline
#else
#define D3DX10INLINE
#endif
#endif
#endif
// Includes
#include "d3d10.h"
#include "d3dx10.h"
#include "d3dx10math.h"
#include "d3dx10core.h"
#include "d3dx10tex.h"
#include "d3dx10mesh.h"
#include "d3dx10async.h"
// Errors
#define _FACDD 0x876
#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code )
enum _D3DX10_ERR {
D3DX10_ERR_CANNOT_MODIFY_INDEX_BUFFER = MAKE_DDHRESULT(2900),
D3DX10_ERR_INVALID_MESH = MAKE_DDHRESULT(2901),
D3DX10_ERR_CANNOT_ATTR_SORT = MAKE_DDHRESULT(2902),
D3DX10_ERR_SKINNING_NOT_SUPPORTED = MAKE_DDHRESULT(2903),
D3DX10_ERR_TOO_MANY_INFLUENCES = MAKE_DDHRESULT(2904),
D3DX10_ERR_INVALID_DATA = MAKE_DDHRESULT(2905),
D3DX10_ERR_LOADED_MESH_HAS_NO_DATA = MAKE_DDHRESULT(2906),
D3DX10_ERR_DUPLICATE_NAMED_FRAGMENT = MAKE_DDHRESULT(2907),
D3DX10_ERR_CANNOT_REMOVE_LAST_ITEM = MAKE_DDHRESULT(2908),
};
#endif //__D3DX10_H__

View File

@ -0,0 +1,418 @@
///////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx10core.h
// Content: D3DX10 core types and functions
//
///////////////////////////////////////////////////////////////////////////
#include "d3dx10.h"
#ifndef __D3DX10CORE_H__
#define __D3DX10CORE_H__
// Current name of the DLL shipped in the same SDK as this header.
#define D3DX10_DLL_W L"d3dx10.dll"
#define D3DX10_DLL_A "d3dx10.dll"
#ifdef UNICODE
#define D3DX10_DLL D3DX10_DLL_W
#else
#define D3DX10_DLL D3DX10_DLL_A
#endif
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
///////////////////////////////////////////////////////////////////////////
// D3DX10_SDK_VERSION:
// -----------------
// This identifier is passed to D3DX10CheckVersion in order to ensure that an
// application was built against the correct header files and lib files.
// This number is incremented whenever a header (or other) change would
// require applications to be rebuilt. If the version doesn't match,
// D3DX10CreateVersion will return FALSE. (The number itself has no meaning.)
///////////////////////////////////////////////////////////////////////////
#define D3DX10_VERSION 0x1002
#define D3DX10_SDK_VERSION 1000
HRESULT WINAPI D3DX10CheckVersion(UINT D3DSdkVersion, UINT D3DX10SdkVersion);
UINT WINAPI D3DX10GetDriverLevel(ID3D10Device *pDevice);
#ifdef __cplusplus
}
#endif //__cplusplus
//////////////////////////////////////////////////////////////////////////////
// D3DX10_SPRITE flags:
// -----------------
// D3DX10_SPRITE_SAVE_STATE
// Specifies device state should be saved and restored in Begin/End.
// D3DX10SPRITE_SORT_TEXTURE
// Sprites are sorted by texture prior to drawing. This is recommended when
// drawing non-overlapping sprites of uniform depth. For example, drawing
// screen-aligned text with ID3DX10Font.
// D3DX10SPRITE_SORT_DEPTH_FRONT_TO_BACK
// Sprites are sorted by depth front-to-back prior to drawing. This is
// recommended when drawing opaque sprites of varying depths.
// D3DX10SPRITE_SORT_DEPTH_BACK_TO_FRONT
// Sprites are sorted by depth back-to-front prior to drawing. This is
// recommended when drawing transparent sprites of varying depths.
// D3DX10SPRITE_ADDREF_TEXTURES
// AddRef/Release all textures passed in to DrawSpritesBuffered
//////////////////////////////////////////////////////////////////////////////
enum
{
D3DX10_SPRITE_SORT_TEXTURE = 0x01,
D3DX10_SPRITE_SORT_DEPTH_BACK_TO_FRONT = 0x02,
D3DX10_SPRITE_SORT_DEPTH_FRONT_TO_BACK = 0x04,
D3DX10_SPRITE_SAVE_STATE = 0x08,
D3DX10_SPRITE_ADDREF_TEXTURES = 0x10,
};
typedef struct _D3DX10_SPRITE
{
D3DXMATRIX matWorld;
D3DXVECTOR2 TexCoord;
D3DXVECTOR2 TexSize;
D3DXCOLOR ColorModulate;
ID3D10ShaderResourceView *pTexture;
UINT TextureIndex;
} D3DX10_SPRITE;
//////////////////////////////////////////////////////////////////////////////
// ID3DX10Sprite:
// ------------
// This object intends to provide an easy way to drawing sprites using D3D.
//
// Begin -
// Prepares device for drawing sprites.
//
// Draw -
// Draws a sprite
//
// Flush -
// Forces all batched sprites to submitted to the device.
//
// End -
// Restores device state to how it was when Begin was called.
//
//////////////////////////////////////////////////////////////////////////////
typedef interface ID3DX10Sprite ID3DX10Sprite;
typedef interface ID3DX10Sprite *LPD3DX10SPRITE;
// {BA0B762D-8D28-43ec-B9DC-2F84443B0614}
DEFINE_GUID(IID_ID3DX10Sprite,
0xba0b762d, 0x8d28, 0x43ec, 0xb9, 0xdc, 0x2f, 0x84, 0x44, 0x3b, 0x6, 0x14);
#undef INTERFACE
#define INTERFACE ID3DX10Sprite
DECLARE_INTERFACE_(ID3DX10Sprite, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DX10Sprite
STDMETHOD(Begin)(THIS_ UINT flags) PURE;
STDMETHOD(DrawSpritesBuffered)(THIS_ D3DX10_SPRITE *pSprites, UINT cSprites) PURE;
STDMETHOD(Flush)(THIS) PURE;
STDMETHOD(DrawSpritesImmediate)(THIS_ D3DX10_SPRITE *pSprites, UINT cSprites, UINT cbSprite, UINT flags) PURE;
STDMETHOD(End)(THIS) PURE;
STDMETHOD(GetViewTransform)(THIS_ D3DXMATRIX *pViewTransform) PURE;
STDMETHOD(SetViewTransform)(THIS_ D3DXMATRIX *pViewTransform) PURE;
STDMETHOD(GetProjectionTransform)(THIS_ D3DXMATRIX *pProjectionTransform) PURE;
STDMETHOD(SetProjectionTransform)(THIS_ D3DXMATRIX *pProjectionTransform) PURE;
STDMETHOD(GetDevice)(THIS_ ID3D10Device** ppDevice) PURE;
};
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
HRESULT WINAPI
D3DX10CreateSprite(
ID3D10Device* pDevice,
UINT cDeviceBufferSize,
LPD3DX10SPRITE* ppSprite);
#ifdef __cplusplus
}
#endif //__cplusplus
//////////////////////////////////////////////////////////////////////////////
// ID3DX10ThreadPump:
//////////////////////////////////////////////////////////////////////////////
#undef INTERFACE
#define INTERFACE ID3DX10DataLoader
DECLARE_INTERFACE(ID3DX10DataLoader)
{
STDMETHOD(Load)(THIS) PURE;
STDMETHOD(Decompress)(THIS_ void **ppData, SIZE_T *pcBytes) PURE;
STDMETHOD(Destroy)(THIS) PURE;
};
#undef INTERFACE
#define INTERFACE ID3DX10DataProcessor
DECLARE_INTERFACE(ID3DX10DataProcessor)
{
STDMETHOD(Process)(THIS_ void *pData, SIZE_T cBytes) PURE;
STDMETHOD(CreateDeviceObject)(THIS_ void **ppDataObject) PURE;
STDMETHOD(Destroy)(THIS) PURE;
};
// {C93FECFA-6967-478a-ABBC-402D90621FCB}
DEFINE_GUID(IID_ID3DX10ThreadPump,
0xc93fecfa, 0x6967, 0x478a, 0xab, 0xbc, 0x40, 0x2d, 0x90, 0x62, 0x1f, 0xcb);
#undef INTERFACE
#define INTERFACE ID3DX10ThreadPump
DECLARE_INTERFACE_(ID3DX10ThreadPump, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DX10ThreadPump
STDMETHOD(AddWorkItem)(THIS_ ID3DX10DataLoader *pDataLoader, ID3DX10DataProcessor *pDataProcessor, HRESULT *pHResult, void **ppDeviceObject) PURE;
STDMETHOD_(UINT, GetWorkItemCount)(THIS) PURE;
STDMETHOD(WaitForAllItems)(THIS) PURE;
STDMETHOD(ProcessDeviceWorkItems)(THIS_ UINT iWorkItemCount);
STDMETHOD(PurgeAllItems)(THIS) PURE;
STDMETHOD(GetQueueStatus)(THIS_ UINT *pIoQueue, UINT *pProcessQueue, UINT *pDeviceQueue) PURE;
};
HRESULT WINAPI D3DX10CreateThreadPump(UINT cIoThreads, UINT cProcThreads, ID3DX10ThreadPump **ppThreadPump);
//////////////////////////////////////////////////////////////////////////////
// ID3DX10Font:
// ----------
// Font objects contain the textures and resources needed to render a specific
// font on a specific device.
//
// GetGlyphData -
// Returns glyph cache data, for a given glyph.
//
// PreloadCharacters/PreloadGlyphs/PreloadText -
// Preloads glyphs into the glyph cache textures.
//
// DrawText -
// Draws formatted text on a D3D device. Some parameters are
// surprisingly similar to those of GDI's DrawText function. See GDI
// documentation for a detailed description of these parameters.
// If pSprite is NULL, an internal sprite object will be used.
//
//////////////////////////////////////////////////////////////////////////////
typedef struct _D3DX10_FONT_DESCA
{
INT Height;
UINT Width;
UINT Weight;
UINT MipLevels;
BOOL Italic;
BYTE CharSet;
BYTE OutputPrecision;
BYTE Quality;
BYTE PitchAndFamily;
CHAR FaceName[LF_FACESIZE];
} D3DX10_FONT_DESCA, *LPD3DX10_FONT_DESCA;
typedef struct _D3DX10_FONT_DESCW
{
INT Height;
UINT Width;
UINT Weight;
UINT MipLevels;
BOOL Italic;
BYTE CharSet;
BYTE OutputPrecision;
BYTE Quality;
BYTE PitchAndFamily;
WCHAR FaceName[LF_FACESIZE];
} D3DX10_FONT_DESCW, *LPD3DX10_FONT_DESCW;
#ifdef UNICODE
typedef D3DX10_FONT_DESCW D3DX10_FONT_DESC;
typedef LPD3DX10_FONT_DESCW LPD3DX10_FONT_DESC;
#else
typedef D3DX10_FONT_DESCA D3DX10_FONT_DESC;
typedef LPD3DX10_FONT_DESCA LPD3DX10_FONT_DESC;
#endif
typedef interface ID3DX10Font ID3DX10Font;
typedef interface ID3DX10Font *LPD3DX10FONT;
// {D79DBB70-5F21-4d36-BBC2-FF525C213CDC}
DEFINE_GUID(IID_ID3DX10Font,
0xd79dbb70, 0x5f21, 0x4d36, 0xbb, 0xc2, 0xff, 0x52, 0x5c, 0x21, 0x3c, 0xdc);
#undef INTERFACE
#define INTERFACE ID3DX10Font
DECLARE_INTERFACE_(ID3DX10Font, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DX10Font
STDMETHOD(GetDevice)(THIS_ ID3D10Device** ppDevice) PURE;
STDMETHOD(GetDescA)(THIS_ D3DX10_FONT_DESCA *pDesc) PURE;
STDMETHOD(GetDescW)(THIS_ D3DX10_FONT_DESCW *pDesc) PURE;
STDMETHOD_(BOOL, GetTextMetricsA)(THIS_ TEXTMETRICA *pTextMetrics) PURE;
STDMETHOD_(BOOL, GetTextMetricsW)(THIS_ TEXTMETRICW *pTextMetrics) PURE;
STDMETHOD_(HDC, GetDC)(THIS) PURE;
STDMETHOD(GetGlyphData)(THIS_ UINT Glyph, ID3D10ShaderResourceView** ppTexture, RECT *pBlackBox, POINT *pCellInc) PURE;
STDMETHOD(PreloadCharacters)(THIS_ UINT First, UINT Last) PURE;
STDMETHOD(PreloadGlyphs)(THIS_ UINT First, UINT Last) PURE;
STDMETHOD(PreloadTextA)(THIS_ LPCSTR pString, INT Count) PURE;
STDMETHOD(PreloadTextW)(THIS_ LPCWSTR pString, INT Count) PURE;
STDMETHOD_(INT, DrawTextA)(THIS_ LPD3DX10SPRITE pSprite, LPCSTR pString, INT Count, LPRECT pRect, UINT Format, D3DXCOLOR Color) PURE;
STDMETHOD_(INT, DrawTextW)(THIS_ LPD3DX10SPRITE pSprite, LPCWSTR pString, INT Count, LPRECT pRect, UINT Format, D3DXCOLOR Color) PURE;
#ifdef __cplusplus
#ifdef UNICODE
HRESULT GetDesc(D3DX10_FONT_DESCW *pDesc) { return GetDescW(pDesc); }
HRESULT PreloadText(LPCWSTR pString, INT Count) { return PreloadTextW(pString, Count); }
#else
HRESULT GetDesc(D3DX10_FONT_DESCA *pDesc) { return GetDescA(pDesc); }
HRESULT PreloadText(LPCSTR pString, INT Count) { return PreloadTextA(pString, Count); }
#endif
#endif //__cplusplus
};
#ifndef GetTextMetrics
#ifdef UNICODE
#define GetTextMetrics GetTextMetricsW
#else
#define GetTextMetrics GetTextMetricsA
#endif
#endif
#ifndef DrawText
#ifdef UNICODE
#define DrawText DrawTextW
#else
#define DrawText DrawTextA
#endif
#endif
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
HRESULT WINAPI
D3DX10CreateFontA(
ID3D10Device* pDevice,
INT Height,
UINT Width,
UINT Weight,
UINT MipLevels,
BOOL Italic,
UINT CharSet,
UINT OutputPrecision,
UINT Quality,
UINT PitchAndFamily,
LPCSTR pFaceName,
LPD3DX10FONT* ppFont);
HRESULT WINAPI
D3DX10CreateFontW(
ID3D10Device* pDevice,
INT Height,
UINT Width,
UINT Weight,
UINT MipLevels,
BOOL Italic,
UINT CharSet,
UINT OutputPrecision,
UINT Quality,
UINT PitchAndFamily,
LPCWSTR pFaceName,
LPD3DX10FONT* ppFont);
#ifdef UNICODE
#define D3DX10CreateFont D3DX10CreateFontW
#else
#define D3DX10CreateFont D3DX10CreateFontA
#endif
HRESULT WINAPI
D3DX10CreateFontIndirectA(
ID3D10Device* pDevice,
CONST D3DX10_FONT_DESCA* pDesc,
LPD3DX10FONT* ppFont);
HRESULT WINAPI
D3DX10CreateFontIndirectW(
ID3D10Device* pDevice,
CONST D3DX10_FONT_DESCW* pDesc,
LPD3DX10FONT* ppFont);
#ifdef UNICODE
#define D3DX10CreateFontIndirect D3DX10CreateFontIndirectW
#else
#define D3DX10CreateFontIndirect D3DX10CreateFontIndirectA
#endif
HRESULT WINAPI D3DX10UnsetAllDeviceObjects(ID3D10Device *pDevice);
#ifdef __cplusplus
}
#endif //__cplusplus
///////////////////////////////////////////////////////////////////////////
//
// TODO: move these to a central error header file
//
#define _FACD3D 0x876
#define MAKE_D3DHRESULT( code ) MAKE_HRESULT( 1, _FACD3D, code )
#define MAKE_D3DSTATUS( code ) MAKE_HRESULT( 0, _FACD3D, code )
#define D3DERR_INVALIDCALL MAKE_D3DHRESULT(2156)
#define D3DERR_WASSTILLDRAWING MAKE_D3DHRESULT(540)
#endif //__D3DX10CORE_H__

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,286 @@
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx10mesh.h
// Content: D3DX10 mesh types and functions
//
//////////////////////////////////////////////////////////////////////////////
#include "d3dx10.h"
#ifndef __D3DX10MESH_H__
#define __D3DX10MESH_H__
// {7ED943DD-52E8-40b5-A8D8-76685C406330}
DEFINE_GUID(IID_ID3DX10BaseMesh,
0x7ed943dd, 0x52e8, 0x40b5, 0xa8, 0xd8, 0x76, 0x68, 0x5c, 0x40, 0x63, 0x30);
// {04B0D117-1041-46b1-AA8A-3952848BA22E}
DEFINE_GUID(IID_ID3DX10MeshBuffer,
0x4b0d117, 0x1041, 0x46b1, 0xaa, 0x8a, 0x39, 0x52, 0x84, 0x8b, 0xa2, 0x2e);
// {4020E5C2-1403-4929-883F-E2E849FAC195}
DEFINE_GUID(IID_ID3DX10Mesh,
0x4020e5c2, 0x1403, 0x4929, 0x88, 0x3f, 0xe2, 0xe8, 0x49, 0xfa, 0xc1, 0x95);
// {8875769A-D579-4088-AAEB-534D1AD84E96}
DEFINE_GUID(IID_ID3DX10PMesh,
0x8875769a, 0xd579, 0x4088, 0xaa, 0xeb, 0x53, 0x4d, 0x1a, 0xd8, 0x4e, 0x96);
// {667EA4C7-F1CD-4386-B523-7C0290B83CC5}
DEFINE_GUID(IID_ID3DX10SPMesh,
0x667ea4c7, 0xf1cd, 0x4386, 0xb5, 0x23, 0x7c, 0x2, 0x90, 0xb8, 0x3c, 0xc5);
// {3CE6CC22-DBF2-44f4-894D-F9C34A337139}
DEFINE_GUID(IID_ID3DX10PatchMesh,
0x3ce6cc22, 0xdbf2, 0x44f4, 0x89, 0x4d, 0xf9, 0xc3, 0x4a, 0x33, 0x71, 0x39);
// Mesh options - lower 3 bytes only, upper byte used by _D3DX10MESHOPT option flags
enum _D3DX10MESH {
D3DX10_MESH_32_BIT = 0x001, // If set, then use 32 bit indices, if not set use 16 bit indices.
D3DX10_MESH_GS_ADJACENCY = 0x004, // If set, mesh contains GS adjacency info. Not valid on input.
};
typedef struct _D3DX10_ATTRIBUTE_RANGE
{
UINT AttribId;
UINT FaceStart;
UINT FaceCount;
UINT VertexStart;
UINT VertexCount;
} D3DX10_ATTRIBUTE_RANGE;
typedef D3DX10_ATTRIBUTE_RANGE* LPD3DX10_ATTRIBUTE_RANGE;
typedef enum _D3DX10_MESH_DISCARD_FLAGS
{
D3DX10_MESH_DISCARD_ATTRIBUTE_BUFFER = 0x01,
D3DX10_MESH_DISCARD_ATTRIBUTE_TABLE = 0x02,
D3DX10_MESH_DISCARD_POINTREPS = 0x04,
D3DX10_MESH_DISCARD_ADJACENCY = 0x08,
D3DX10_MESH_DISCARD_DEVICE_BUFFERS = 0x10,
} D3DX10_MESH_DISCARD_FLAGS;
typedef struct _D3DX10_WELD_EPSILONS
{
FLOAT Position; // NOTE: This does NOT replace the epsilon in GenerateAdjacency
// in general, it should be the same value or greater than the one passed to GeneratedAdjacency
FLOAT BlendWeights;
FLOAT Normal;
FLOAT PSize;
FLOAT Specular;
FLOAT Diffuse;
FLOAT Texcoord[8];
FLOAT Tangent;
FLOAT Binormal;
FLOAT TessFactor;
} D3DX10_WELD_EPSILONS;
typedef D3DX10_WELD_EPSILONS* LPD3DX10_WELD_EPSILONS;
typedef struct _D3DX10_INTERSECT_INFO
{
UINT FaceIndex; // index of face intersected
FLOAT U; // Barycentric Hit Coordinates
FLOAT V; // Barycentric Hit Coordinates
FLOAT Dist; // Ray-Intersection Parameter Distance
} D3DX10_INTERSECT_INFO, *LPD3DX10_INTERSECT_INFO;
// ID3DX10MeshBuffer is used by D3DX10Mesh vertex and index buffers
#undef INTERFACE
#define INTERFACE ID3DX10MeshBuffer
DECLARE_INTERFACE_(ID3DX10MeshBuffer, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DX10MeshBuffer
STDMETHOD(Map)(THIS_ void **ppData, SIZE_T *pSize) PURE;
STDMETHOD(Unmap)(THIS) PURE;
STDMETHOD_(SIZE_T, GetSize)(THIS) PURE;
};
// D3DX10 Mesh interfaces
#undef INTERFACE
#define INTERFACE ID3DX10Mesh
DECLARE_INTERFACE_(ID3DX10Mesh, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DX10Mesh
STDMETHOD_(UINT, GetFaceCount)(THIS) PURE;
STDMETHOD_(UINT, GetVertexCount)(THIS) PURE;
STDMETHOD_(UINT, GetVertexBufferCount)(THIS) PURE;
STDMETHOD_(UINT, GetFlags)(THIS) PURE;
STDMETHOD(GetVertexDescription)(THIS_ CONST D3D10_INPUT_ELEMENT_DESC **ppDesc, UINT *pDeclCount) PURE;
STDMETHOD(SetVertexData)(THIS_ UINT iBuffer, CONST void *pData) PURE;
STDMETHOD(GetVertexBuffer)(THIS_ UINT iBuffer, ID3DX10MeshBuffer **ppVertexBuffer) PURE;
STDMETHOD(SetIndexData)(THIS_ CONST void *pData, UINT cIndices) PURE;
STDMETHOD(GetIndexBuffer)(THIS_ ID3DX10MeshBuffer **ppIndexBuffer) PURE;
STDMETHOD(SetAttributeData)(THIS_ CONST UINT *pData) PURE;
STDMETHOD(GetAttributeBuffer)(THIS_ ID3DX10MeshBuffer **ppAttributeBuffer) PURE;
STDMETHOD(SetAttributeTable)(THIS_ CONST D3DX10_ATTRIBUTE_RANGE *pAttribTable, UINT cAttribTableSize) PURE;
STDMETHOD(GetAttributeTable)(THIS_ D3DX10_ATTRIBUTE_RANGE *pAttribTable, UINT *pAttribTableSize) PURE;
STDMETHOD(GenerateAdjacencyAndPointReps)(THIS_ FLOAT Epsilon) PURE;
STDMETHOD(GenerateGSAdjacency)(THIS) PURE;
STDMETHOD(SetAdjacencyData)(THIS_ CONST UINT *pAdjacency) PURE;
STDMETHOD(GetAdjacencyBuffer)(THIS_ ID3DX10MeshBuffer **ppAdjacency) PURE;
STDMETHOD(SetPointRepData)(THIS_ CONST UINT *pPointReps) PURE;
STDMETHOD(GetPointRepBuffer)(THIS_ ID3DX10MeshBuffer **ppPointReps) PURE;
STDMETHOD(Discard)(THIS_ D3DX10_MESH_DISCARD_FLAGS dwDiscard) PURE;
STDMETHOD(CloneMesh)(THIS_ UINT Flags, LPCWSTR pPosSemantic, CONST D3D10_INPUT_ELEMENT_DESC *pDesc, UINT DeclCount, ID3DX10Mesh** ppCloneMesh) PURE;
STDMETHOD(Optimize)(THIS_ UINT Flags, UINT * pFaceRemap, LPD3D10BLOB *ppVertexRemap) PURE;
STDMETHOD(GenerateAttributeBufferFromTable)(THIS) PURE;
STDMETHOD(Intersect)(THIS_ D3DXVECTOR3 *pRayPos, D3DXVECTOR3 *pRayDir,
UINT *pHitCount, UINT *pFaceIndex, float *pU, float *pV, float *pDist, ID3D10Blob **ppAllHits);
STDMETHOD(IntersectSubset)(THIS_ UINT AttribId, D3DXVECTOR3 *pRayPos, D3DXVECTOR3 *pRayDir,
UINT *pHitCount, UINT *pFaceIndex, float *pU, float *pV, float *pDist, ID3D10Blob **ppAllHits);
// ID3DX10Mesh - Device functions
STDMETHOD(CommitToDevice)(THIS) PURE;
STDMETHOD(DrawSubset)(THIS_ UINT AttribId) PURE;
STDMETHOD(DrawSubsetInstanced)(THIS_ UINT AttribId, UINT InstanceCount, UINT StartInstanceLocation) PURE;
STDMETHOD(GetDeviceVertexBuffer)(THIS_ UINT iBuffer, ID3D10Buffer **ppVertexBuffer) PURE;
STDMETHOD(GetDeviceIndexBuffer)(THIS_ ID3D10Buffer **ppIndexBuffer) PURE;
};
// Flat API
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
HRESULT WINAPI
D3DX10CreateMesh(
ID3D10Device *pDevice,
CONST D3D10_INPUT_ELEMENT_DESC *pDeclaration,
UINT DeclCount,
LPCWSTR pPositionSemantic,
UINT VertexCount,
UINT FaceCount,
UINT Options,
ID3DX10Mesh **ppMesh);
#ifdef __cplusplus
}
#endif //__cplusplus
// ID3DX10Mesh::Optimize options - upper byte only, lower 3 bytes used from _D3DX10MESH option flags
enum _D3DX10MESHOPT {
D3DX10_MESHOPT_COMPACT = 0x01000000,
D3DX10_MESHOPT_ATTR_SORT = 0x02000000,
D3DX10_MESHOPT_VERTEX_CACHE = 0x04000000,
D3DX10_MESHOPT_STRIP_REORDER = 0x08000000,
D3DX10_MESHOPT_IGNORE_VERTS = 0x10000000, // optimize faces only, don't touch vertices
D3DX10_MESHOPT_DO_NOT_SPLIT = 0x20000000, // do not split vertices shared between attribute groups when attribute sorting
D3DX10_MESHOPT_DEVICE_INDEPENDENT = 0x00400000, // Only affects VCache. uses a static known good cache size for all cards
// D3DX10_MESHOPT_SHAREVB has been removed, please use D3DX10MESH_VB_SHARE instead
};
//////////////////////////////////////////////////////////////////////////
// ID3DXSkinInfo
//////////////////////////////////////////////////////////////////////////
// {420BD604-1C76-4a34-A466-E45D0658A32C}
DEFINE_GUID(IID_ID3DX10SkinInfo,
0x420bd604, 0x1c76, 0x4a34, 0xa4, 0x66, 0xe4, 0x5d, 0x6, 0x58, 0xa3, 0x2c);
// scaling modes for ID3DX10SkinInfo::Compact() & ID3DX10SkinInfo::UpdateMesh()
#define D3DX10_SKININFO_NO_SCALING 0
#define D3DX10_SKININFO_SCALE_TO_1 1
#define D3DX10_SKININFO_SCALE_TO_TOTAL 2
typedef struct _D3DX10_SKINNING_CHANNEL
{
UINT SrcOffset;
UINT DestOffset;
BOOL IsNormal;
} D3DX10_SKINNING_CHANNEL;
#undef INTERFACE
#define INTERFACE ID3DX10SkinInfo
typedef struct ID3DX10SkinInfo *LPD3DX10SKININFO;
DECLARE_INTERFACE_(ID3DX10SkinInfo, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
STDMETHOD_(UINT , GetNumVertices)(THIS) PURE;
STDMETHOD_(UINT , GetNumBones)(THIS) PURE;
STDMETHOD_(UINT , GetMaxBoneInfluences)(THIS) PURE;
STDMETHOD(AddVertices)(THIS_ UINT Count) PURE;
STDMETHOD(RemapVertices)(THIS_ UINT NewVertexCount, UINT *pVertexRemap) PURE;
STDMETHOD(AddBones)(THIS_ UINT Count) PURE;
STDMETHOD(RemoveBone)(THIS_ UINT Index) PURE;
STDMETHOD(RemapBones)(THIS_ UINT NewBoneCount, UINT *pBoneRemap) PURE;
STDMETHOD(AddBoneInfluences)(THIS_ UINT BoneIndex, UINT InfluenceCount, UINT *pIndices, float *pWeights) PURE;
STDMETHOD(ClearBoneInfluences)(THIS_ UINT BoneIndex) PURE;
STDMETHOD_(UINT , GetBoneInfluenceCount)(THIS_ UINT BoneIndex) PURE;
STDMETHOD(GetBoneInfluences)(THIS_ UINT BoneIndex, UINT Offset, UINT Count, UINT *pDestIndices, float *pDestWeights) PURE;
STDMETHOD(FindBoneInfluenceIndex)(THIS_ UINT BoneIndex, UINT VertexIndex, UINT *pInfluenceIndex) PURE;
STDMETHOD(SetBoneInfluence)(THIS_ UINT BoneIndex, UINT InfluenceIndex, float Weight) PURE;
STDMETHOD(GetBoneInfluence)(THIS_ UINT BoneIndex, UINT InfluenceIndex, float *pWeight) PURE;
STDMETHOD(Compact)(THIS_ UINT MaxPerVertexInfluences, UINT ScaleMode, float MinWeight) PURE;
STDMETHOD(DoSoftwareSkinning)(UINT StartVertex, UINT VertexCount, void *pSrcVertices, UINT SrcStride, void *pDestVertices, UINT DestStride, D3DXMATRIX *pBoneMatrices, D3DXMATRIX *pInverseTransposeBoneMatrices, D3DX10_SKINNING_CHANNEL *pChannelDescs, UINT NumChannels) PURE;
};
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
HRESULT WINAPI
D3DX10CreateSkinInfo(LPD3DX10SKININFO* ppSkinInfo);
#ifdef __cplusplus
}
#endif //__cplusplus
typedef struct _D3DX10_ATTRIBUTE_WEIGHTS
{
FLOAT Position;
FLOAT Boundary;
FLOAT Normal;
FLOAT Diffuse;
FLOAT Specular;
FLOAT Texcoord[8];
FLOAT Tangent;
FLOAT Binormal;
} D3DX10_ATTRIBUTE_WEIGHTS, *LPD3DX10_ATTRIBUTE_WEIGHTS;
#endif //__D3DX10MESH_H__

View File

@ -0,0 +1,637 @@
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx10tex.h
// Content: D3DX10 texturing APIs
//
//////////////////////////////////////////////////////////////////////////////
#include "d3dx10.h"
#ifndef __D3DX10TEX_H__
#define __D3DX10TEX_H__
//----------------------------------------------------------------------------
// D3DX10_FILTER flags:
// ------------------
//
// A valid filter must contain one of these values:
//
// D3DX10_FILTER_NONE
// No scaling or filtering will take place. Pixels outside the bounds
// of the source image are assumed to be transparent black.
// D3DX10_FILTER_POINT
// Each destination pixel is computed by sampling the nearest pixel
// from the source image.
// D3DX10_FILTER_LINEAR
// Each destination pixel is computed by linearly interpolating between
// the nearest pixels in the source image. This filter works best
// when the scale on each axis is less than 2.
// D3DX10_FILTER_TRIANGLE
// Every pixel in the source image contributes equally to the
// destination image. This is the slowest of all the filters.
// D3DX10_FILTER_BOX
// Each pixel is computed by averaging a 2x2(x2) box pixels from
// the source image. Only works when the dimensions of the
// destination are half those of the source. (as with mip maps)
//
// And can be OR'd with any of these optional flags:
//
// D3DX10_FILTER_MIRROR_U
// Indicates that pixels off the edge of the texture on the U-axis
// should be mirrored, not wraped.
// D3DX10_FILTER_MIRROR_V
// Indicates that pixels off the edge of the texture on the V-axis
// should be mirrored, not wraped.
// D3DX10_FILTER_MIRROR_W
// Indicates that pixels off the edge of the texture on the W-axis
// should be mirrored, not wraped.
// D3DX10_FILTER_MIRROR
// Same as specifying D3DX10_FILTER_MIRROR_U | D3DX10_FILTER_MIRROR_V |
// D3DX10_FILTER_MIRROR_V
// D3DX10_FILTER_DITHER
// Dithers the resulting image using a 4x4 order dither pattern.
// D3DX10_FILTER_SRGB_IN
// Denotes that the input data is in sRGB (gamma 2.2) colorspace.
// D3DX10_FILTER_SRGB_OUT
// Denotes that the output data is in sRGB (gamma 2.2) colorspace.
// D3DX10_FILTER_SRGB
// Same as specifying D3DX10_FILTER_SRGB_IN | D3DX10_FILTER_SRGB_OUT
//
//----------------------------------------------------------------------------
typedef enum D3DX10_FILTER_FLAG
{
D3DX10_FILTER_NONE = (1 << 0),
D3DX10_FILTER_POINT = (2 << 0),
D3DX10_FILTER_LINEAR = (3 << 0),
D3DX10_FILTER_TRIANGLE = (4 << 0),
D3DX10_FILTER_BOX = (5 << 0),
D3DX10_FILTER_MIRROR_U = (1 << 16),
D3DX10_FILTER_MIRROR_V = (2 << 16),
D3DX10_FILTER_MIRROR_W = (4 << 16),
D3DX10_FILTER_MIRROR = (7 << 16),
D3DX10_FILTER_DITHER = (1 << 19),
D3DX10_FILTER_DITHER_DIFFUSION= (2 << 19),
D3DX10_FILTER_SRGB_IN = (1 << 21),
D3DX10_FILTER_SRGB_OUT = (2 << 21),
D3DX10_FILTER_SRGB = (3 << 21),
} D3DX10_FILTER_FLAG;
//----------------------------------------------------------------------------
// D3DX10_NORMALMAP flags:
// ---------------------
// These flags are used to control how D3DX10ComputeNormalMap generates normal
// maps. Any number of these flags may be OR'd together in any combination.
//
// D3DX10_NORMALMAP_MIRROR_U
// Indicates that pixels off the edge of the texture on the U-axis
// should be mirrored, not wraped.
// D3DX10_NORMALMAP_MIRROR_V
// Indicates that pixels off the edge of the texture on the V-axis
// should be mirrored, not wraped.
// D3DX10_NORMALMAP_MIRROR
// Same as specifying D3DX10_NORMALMAP_MIRROR_U | D3DX10_NORMALMAP_MIRROR_V
// D3DX10_NORMALMAP_INVERTSIGN
// Inverts the direction of each normal
// D3DX10_NORMALMAP_COMPUTE_OCCLUSION
// Compute the per pixel Occlusion term and encodes it into the alpha.
// An Alpha of 1 means that the pixel is not obscured in anyway, and
// an alpha of 0 would mean that the pixel is completly obscured.
//
//----------------------------------------------------------------------------
typedef enum D3DX10_NORMALMAP_FLAG
{
D3DX10_NORMALMAP_MIRROR_U = (1 << 16),
D3DX10_NORMALMAP_MIRROR_V = (2 << 16),
D3DX10_NORMALMAP_MIRROR = (3 << 16),
D3DX10_NORMALMAP_INVERTSIGN = (8 << 16),
D3DX10_NORMALMAP_COMPUTE_OCCLUSION = (16 << 16),
} D3DX10_NORMALMAP_FLAG;
//----------------------------------------------------------------------------
// D3DX10_CHANNEL flags:
// -------------------
// These flags are used by functions which operate on or more channels
// in a texture.
//
// D3DX10_CHANNEL_RED
// Indicates the red channel should be used
// D3DX10_CHANNEL_BLUE
// Indicates the blue channel should be used
// D3DX10_CHANNEL_GREEN
// Indicates the green channel should be used
// D3DX10_CHANNEL_ALPHA
// Indicates the alpha channel should be used
// D3DX10_CHANNEL_LUMINANCE
// Indicates the luminaces of the red green and blue channels should be
// used.
//
//----------------------------------------------------------------------------
typedef enum D3DX10_CHANNEL_FLAG
{
D3DX10_CHANNEL_RED = (1 << 0),
D3DX10_CHANNEL_BLUE = (1 << 1),
D3DX10_CHANNEL_GREEN = (1 << 2),
D3DX10_CHANNEL_ALPHA = (1 << 3),
D3DX10_CHANNEL_LUMINANCE = (1 << 4),
} D3DX10_CHANNEL_FLAG;
//----------------------------------------------------------------------------
// D3DX10_IMAGE_FILE_FORMAT:
// ---------------------
// This enum is used to describe supported image file formats.
//
//----------------------------------------------------------------------------
typedef enum _D3DX10_IMAGE_FILE_FORMAT
{
D3DX10_IFF_BMP = 0,
D3DX10_IFF_JPG = 1,
D3DX10_IFF_PNG = 3,
D3DX10_IFF_DDS = 4,
D3DX10_IFF_TIFF = 10,
D3DX10_IFF_GIF = 11,
D3DX10_IFF_FORCE_DWORD = 0x7fffffff
} D3DX10_IMAGE_FILE_FORMAT;
//----------------------------------------------------------------------------
// D3DX10_IMAGE_INFO:
// ---------------
// This structure is used to return a rough description of what the
// the original contents of an image file looked like.
//
// Width
// Width of original image in pixels
// Height
// Height of original image in pixels
// Depth
// Depth of original image in pixels
// ArraySize
// Array size in textures
// MipLevels
// Number of mip levels in original image
// Format
// D3D format which most closely describes the data in original image
// ResourceType
// D3DRESOURCETYPE representing the type of texture stored in the file.
// D3DRTYPE_TEXTURE, D3DRTYPE_VOLUMETEXTURE, or D3DRTYPE_CUBETEXTURE.
// ImageFileFormat
// D3DX10_IMAGE_FILE_FORMAT representing the format of the image file.
//
//----------------------------------------------------------------------------
typedef struct _D3DX10_IMAGE_INFO
{
UINT Width;
UINT Height;
UINT Depth;
UINT ArraySize;
UINT MipLevels;
DXGI_FORMAT Format;
D3D10_RESOURCE ResourceType;
D3DX10_IMAGE_FILE_FORMAT ImageFileFormat;
} D3DX10_IMAGE_INFO;
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
//////////////////////////////////////////////////////////////////////////////
// Image File APIs ///////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//----------------------------------------------------------------------------
// D3DX10_IMAGE_LOAD_INFO:
// ---------------
// This structure can be optionally passed in to texture loader APIs to
// control how textures get loaded. Pass in D3DX10_DEFAULT for any of these
// to have D3DX automatically pick defaults based on the source file.
//
// Width
// Rescale texture to Width texels wide
// Height
// Rescale texture to Height texels high
// Depth
// Rescale texture to Depth texels deep
// FirstMipLevel
// First mip level to load
// MipLevels
// Number of mip levels to load after the first level
// Usage
// D3D10_USAGE flag for the new texture
// BindFlags
// D3D10 Bind flags for the new texture
// CpuAccessFlags
// D3D10 CPU Access flags for the new texture
// MiscFlags
// Reserved. Must be 0
// Format
// Resample texture to the specified format
// Filter
// Filter the texture using the specified filter (only when resampling)
// MipFilter
// Filter the texture mip levels using the specified filter (only if
// generating mips)
// pSrcInfo
// (optional) pointer to a D3DX10_IMAGE_INFO structure that will get
// populated with source image information
//
//----------------------------------------------------------------------------
#define D3DX10_IMAGE_LOAD_VALID_FLAGS (0)
typedef struct _D3DX10_IMAGE_LOAD_INFO
{
UINT Width;
UINT Height;
UINT Depth;
UINT FirstMipLevel;
UINT MipLevels;
D3D10_USAGE Usage;
UINT32 BindFlags;
UINT32 CpuAccessFlags;
UINT32 MiscFlags;
DXGI_FORMAT Format;
UINT Filter;
UINT MipFilter;
D3DX10_IMAGE_INFO* pSrcInfo;
#ifdef __cplusplus
_D3DX10_IMAGE_LOAD_INFO()
{
Width = D3DX10_DEFAULT;
Height = D3DX10_DEFAULT;
Depth = D3DX10_DEFAULT;
FirstMipLevel = D3DX10_DEFAULT;
MipLevels = D3DX10_DEFAULT;
Usage = (D3D10_USAGE) D3DX10_DEFAULT;
BindFlags = D3DX10_DEFAULT;
CpuAccessFlags = D3DX10_DEFAULT;
MiscFlags = D3DX10_DEFAULT;
Format = DXGI_FORMAT_FROM_FILE;
Filter = D3DX10_DEFAULT;
MipFilter = D3DX10_DEFAULT;
pSrcInfo = NULL;
}
#endif
} D3DX10_IMAGE_LOAD_INFO;
//----------------------------------------------------------------------------
// D3DX10 Asynchronous texture I/O (advanced mode)
//----------------------------------------------------------------------------
HRESULT WINAPI D3DX10CreateAsyncFileLoaderW(LPCWSTR pFileName, ID3DX10DataLoader **ppDataLoader);
HRESULT WINAPI D3DX10CreateAsyncFileLoaderA(LPCSTR pFileName, ID3DX10DataLoader **ppDataLoader);
HRESULT WINAPI D3DX10CreateAsyncMemoryLoader(LPCVOID pData, SIZE_T cbData, ID3DX10DataLoader **ppDataLoader);
HRESULT WINAPI D3DX10CreateAsyncResourceLoaderW(HMODULE hSrcModule, LPCWSTR pSrcResource, ID3DX10DataLoader **ppDataLoader);
HRESULT WINAPI D3DX10CreateAsyncResourceLoaderA(HMODULE hSrcModule, LPCSTR pSrcResource, ID3DX10DataLoader **ppDataLoader);
#ifdef UNICODE
#define D3DX10CreateAsyncFileLoader D3DX10CreateAsyncFileLoaderW
#define D3DX10CreateAsyncResourceLoader D3DX10CreateAsyncResourceLoaderW
#else
#define D3DX10CreateAsyncFileLoader D3DX10CreateAsyncFileLoaderA
#define D3DX10CreateAsyncResourceLoader D3DX10CreateAsyncResourceLoaderA
#endif
HRESULT WINAPI D3DX10CreateAsyncTextureProcessor(ID3D10Device *pDevice, D3DX10_IMAGE_LOAD_INFO *pLoadInfo, ID3DX10DataProcessor **ppDataProcessor);
HRESULT WINAPI D3DX10CreateAsyncTextureInfoProcessor(D3DX10_IMAGE_INFO *pImageInfo, ID3DX10DataProcessor **ppDataProcessor);
HRESULT WINAPI D3DX10CreateAsyncShaderResourceViewProcessor(ID3D10Device *pDevice, D3DX10_IMAGE_LOAD_INFO *pLoadInfo, ID3DX10DataProcessor **ppDataProcessor);
//----------------------------------------------------------------------------
// GetImageInfoFromFile/Resource/Memory:
// ------------------------------
// Fills in a D3DX10_IMAGE_INFO struct with information about an image file.
//
// Parameters:
// pSrcFile
// File name of the source image.
// pSrcModule
// Module where resource is located, or NULL for module associated
// with image the os used to create the current process.
// pSrcResource
// Resource name.
// pSrcData
// Pointer to file in memory.
// SrcDataSize
// Size in bytes of file in memory.
// pPump
// Optional pointer to a thread pump object to use.
// pSrcInfo
// Pointer to a D3DX10_IMAGE_INFO structure to be filled in with the
// description of the data in the source image file.
//
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DX10GetImageInfoFromFileA(
LPCSTR pSrcFile,
ID3DX10ThreadPump* pPump,
D3DX10_IMAGE_INFO* pSrcInfo);
HRESULT WINAPI
D3DX10GetImageInfoFromFileW(
LPCWSTR pSrcFile,
ID3DX10ThreadPump* pPump,
D3DX10_IMAGE_INFO* pSrcInfo);
#ifdef UNICODE
#define D3DX10GetImageInfoFromFile D3DX10GetImageInfoFromFileW
#else
#define D3DX10GetImageInfoFromFile D3DX10GetImageInfoFromFileA
#endif
HRESULT WINAPI
D3DX10GetImageInfoFromResourceA(
HMODULE hSrcModule,
LPCSTR pSrcResource,
ID3DX10ThreadPump* pPump,
D3DX10_IMAGE_INFO* pSrcInfo);
HRESULT WINAPI
D3DX10GetImageInfoFromResourceW(
HMODULE hSrcModule,
LPCWSTR pSrcResource,
ID3DX10ThreadPump* pPump,
D3DX10_IMAGE_INFO* pSrcInfo);
#ifdef UNICODE
#define D3DX10GetImageInfoFromResource D3DX10GetImageInfoFromResourceW
#else
#define D3DX10GetImageInfoFromResource D3DX10GetImageInfoFromResourceA
#endif
HRESULT WINAPI
D3DX10GetImageInfoFromMemory(
LPCVOID pSrcData,
SIZE_T SrcDataSize,
ID3DX10ThreadPump* pPump,
D3DX10_IMAGE_INFO* pSrcInfo);
//////////////////////////////////////////////////////////////////////////////
// Create/Save Texture APIs //////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//----------------------------------------------------------------------------
// D3DX10CreateTextureFromFile/Resource/Memory:
// D3DX10CreateShaderResourceViewFromFile/Resource/Memory:
// -----------------------------------
// Create a texture object from a file or resource.
//
// Parameters:
//
// pDevice
// The D3D device with which the texture is going to be used.
// pSrcFile
// File name.
// hSrcModule
// Module handle. if NULL, current module will be used.
// pSrcResource
// Resource name in module
// pvSrcData
// Pointer to file in memory.
// SrcDataSize
// Size in bytes of file in memory.
// pLoadInfo
// Optional pointer to a D3DX10_IMAGE_LOAD_INFO structure that
// contains additional loader parameters.
// pPump
// Optional pointer to a thread pump object to use.
// ppTexture
// [out] Created texture object.
// ppShaderResourceView
// [out] Shader resource view object created.
//
//----------------------------------------------------------------------------
// FromFile
HRESULT WINAPI
D3DX10CreateShaderResourceViewFromFileA(
ID3D10Device* pDevice,
LPCSTR pSrcFile,
D3DX10_IMAGE_LOAD_INFO *pLoadInfo,
ID3DX10ThreadPump* pPump,
ID3D10ShaderResourceView** ppShaderResourceView);
HRESULT WINAPI
D3DX10CreateShaderResourceViewFromFileW(
ID3D10Device* pDevice,
LPCWSTR pSrcFile,
D3DX10_IMAGE_LOAD_INFO *pLoadInfo,
ID3DX10ThreadPump* pPump,
ID3D10ShaderResourceView** ppShaderResourceView);
#ifdef UNICODE
#define D3DX10CreateShaderResourceViewFromFile D3DX10CreateShaderResourceViewFromFileW
#else
#define D3DX10CreateShaderResourceViewFromFile D3DX10CreateShaderResourceViewFromFileA
#endif
HRESULT WINAPI
D3DX10CreateTextureFromFileA(
ID3D10Device* pDevice,
LPCSTR pSrcFile,
D3DX10_IMAGE_LOAD_INFO *pLoadInfo,
ID3DX10ThreadPump* pPump,
ID3D10Resource** ppShaderResourceView);
HRESULT WINAPI
D3DX10CreateTextureFromFileW(
ID3D10Device* pDevice,
LPCWSTR pSrcFile,
D3DX10_IMAGE_LOAD_INFO *pLoadInfo,
ID3DX10ThreadPump* pPump,
ID3D10Resource** ppShaderResourceView);
#ifdef UNICODE
#define D3DX10CreateTextureFromFile D3DX10CreateTextureFromFileW
#else
#define D3DX10CreateTextureFromFile D3DX10CreateTextureFromFileA
#endif
// FromResource (resources in dll/exes)
HRESULT WINAPI
D3DX10CreateShaderResourceViewFromResourceA(
ID3D10Device* pDevice,
HMODULE hSrcModule,
LPCSTR pSrcResource,
D3DX10_IMAGE_LOAD_INFO *pLoadInfo,
ID3DX10ThreadPump* pPump,
ID3D10ShaderResourceView** ppShaderResourceView);
HRESULT WINAPI
D3DX10CreateShaderResourceViewFromResourceW(
ID3D10Device* pDevice,
HMODULE hSrcModule,
LPCWSTR pSrcResource,
D3DX10_IMAGE_LOAD_INFO *pLoadInfo,
ID3DX10ThreadPump* pPump,
ID3D10ShaderResourceView** ppShaderResourceView);
#ifdef UNICODE
#define D3DX10CreateShaderResourceViewFromResource D3DX10CreateShaderResourceViewFromResourceW
#else
#define D3DX10CreateShaderResourceViewFromResource D3DX10CreateShaderResourceViewFromResourceA
#endif
HRESULT WINAPI
D3DX10CreateTextureFromResourceA(
ID3D10Device* pDevice,
HMODULE hSrcModule,
LPCSTR pSrcResource,
D3DX10_IMAGE_LOAD_INFO *pLoadInfo,
ID3DX10ThreadPump* pPump,
ID3D10Resource** ppTexture);
HRESULT WINAPI
D3DX10CreateTextureFromResourceW(
ID3D10Device* pDevice,
HMODULE hSrcModule,
LPCWSTR pSrcResource,
D3DX10_IMAGE_LOAD_INFO *pLoadInfo,
ID3DX10ThreadPump* pPump,
ID3D10Resource** ppTexture);
#ifdef UNICODE
#define D3DX10CreateTextureFromResource D3DX10CreateTextureFromResourceW
#else
#define D3DX10CreateTextureFromResource D3DX10CreateTextureFromResourceA
#endif
// FromFileInMemory
HRESULT WINAPI
D3DX10CreateShaderResourceViewFromMemory(
ID3D10Device* pDevice,
LPCVOID pSrcData,
SIZE_T SrcDataSize,
D3DX10_IMAGE_LOAD_INFO *pLoadInfo,
ID3DX10ThreadPump* pPump,
ID3D10ShaderResourceView** ppShaderResourceView);
HRESULT WINAPI
D3DX10CreateTextureFromMemory(
ID3D10Device* pDevice,
LPCVOID pSrcData,
SIZE_T SrcDataSize,
D3DX10_IMAGE_LOAD_INFO *pLoadInfo,
ID3DX10ThreadPump* pPump,
ID3D10Resource** ppTexture);
//----------------------------------------------------------------------------
// D3DX10SaveTextureToFile:
// ----------------------
// Save a texture to a file.
//
// Parameters:
// pDestFile
// File name of the destination file
// DestFormat
// D3DX10_IMAGE_FILE_FORMAT specifying file format to use when saving.
// pSrcTexture
// Source texture, containing the image to be saved
//
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DX10SaveTextureToFileA(
ID3D10Resource *pSrcTexture,
D3DX10_IMAGE_FILE_FORMAT DestFormat,
LPCSTR pDestFile);
HRESULT WINAPI
D3DX10SaveTextureToFileW(
ID3D10Resource *pSrcTexture,
D3DX10_IMAGE_FILE_FORMAT DestFormat,
LPCWSTR pDestFile);
#ifdef UNICODE
#define D3DX10SaveTextureToFile D3DX10SaveTextureToFileW
#else
#define D3DX10SaveTextureToFile D3DX10SaveTextureToFileA
#endif
//----------------------------------------------------------------------------
// D3DX10SaveTextureToMemory:
// ----------------------
// Save a texture to a file.
//
// Parameters:
// ppDestBuf
// address of a d3dxbuffer pointer to return the image data
// DestFormat
// D3DX10_IMAGE_FILE_FORMAT specifying file format to use when saving.
// pSrcTexture
// Source texture, containing the image to be saved
//
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DX10SaveTextureToMemory(
ID3D10Resource *pSrcTexture,
D3DX10_IMAGE_FILE_FORMAT DestFormat,
LPD3D10BLOB* ppDestBuf);
//----------------------------------------------------------------------------
// D3DX10ComputeNormalMap:
// ---------------------
// Converts a height map into a normal map. The (x,y,z) components of each
// normal are mapped to the (r,g,b) channels of the output texture.
//
// Parameters
// pSrcTexture
// Pointer to the source heightmap texture
// Flags
// D3DX10_NORMALMAP flags
// Channel
// D3DX10_CHANNEL specifying source of height information
// Amplitude
// The constant value which the height information is multiplied by.
// pDestTexture
// Pointer to the destination texture
//---------------------------------------------------------------------------
HRESULT WINAPI
D3DX10ComputeNormalMap(
ID3D10Texture2D *pSrcTexture,
UINT Flags,
UINT Channel,
FLOAT Amplitude,
ID3D10Texture2D *pDestTexture);
#ifdef __cplusplus
}
#endif //__cplusplus
#endif //__D3DX10TEX_H__

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,359 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 7.00.0485 */
/* Compiler settings for dxgitype.idl:
Oicf, W1, Zp8, env=Win32 (32b run)
protocol : dce , ms_ext, c_ext, robust
error checks: allocation ref bounds_check enum stub_data
VC __declspec() decoration level:
__declspec(uuid()), __declspec(selectany), __declspec(novtable)
DECLSPEC_UUID(), MIDL_INTERFACE()
*/
//@@MIDL_FILE_HEADING( )
#pragma warning( disable: 4049 ) /* more than 64k source lines */
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCSAL_H_VERSION__
#define __REQUIRED_RPCSAL_H_VERSION__ 100
#endif
#include "rpc.h"
#include "rpcndr.h"
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif // __RPCNDR_H_VERSION__
#ifndef __dxgitype_h__
#define __dxgitype_h__
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
/* Forward Declarations */
/* header files for imported files */
#include "oaidl.h"
#include "ocidl.h"
#ifdef __cplusplus
extern "C"{
#endif
/* interface __MIDL_itf_dxgitype_0000_0000 */
/* [local] */
#define _FACDXGI 0x87a
#define MAKE_DXGI_HRESULT( code ) MAKE_HRESULT( 1, _FACDXGI, code )
#define MAKE_DXGI_STATUS( code ) MAKE_HRESULT( 0, _FACDXGI, code )
#define DXGI_STATUS_OCCLUDED MAKE_DXGI_STATUS(1 )
#define DXGI_STATUS_CLIPPED MAKE_DXGI_STATUS(2 )
#define DXGI_STATUS_NO_REDIRECTION MAKE_DXGI_STATUS(4 )
#define DXGI_ERROR_INVALID_CALL MAKE_DXGI_HRESULT( 1 )
#define DXGI_ERROR_NOT_FOUND MAKE_DXGI_HRESULT( 2 )
#define DXGI_ERROR_MORE_DATA MAKE_DXGI_HRESULT( 3 )
#define DXGI_ERROR_UNSUPPORTED MAKE_DXGI_HRESULT( 4 )
#define DXGI_ERROR_DEVICE_REMOVED MAKE_DXGI_HRESULT( 5 )
#define DXGI_ERROR_DEVICE_HUNG MAKE_DXGI_HRESULT( 6 )
#define DXGI_ERROR_DEVICE_RESET MAKE_DXGI_HRESULT( 7 )
#define DXGI_ERROR_WAS_STILL_DRAWING MAKE_DXGI_HRESULT( 10 )
#define DXGI_ERROR_DRIVER_INTERNAL_ERROR MAKE_DXGI_HRESULT( 32 )
#define DXGI_ERROR_NONEXCLUSIVE MAKE_DXGI_HRESULT( 33 )
#define DXGI_CPU_ACCESS_NONE ( 0 )
#define DXGI_CPU_ACCESS_DYNAMIC ( 1 )
#define DXGI_CPU_ACCESS_READ_WRITE ( 2 )
#define DXGI_CPU_ACCESS_SCRATCH ( 3 )
#define DXGI_CPU_ACCESS_FIELD 15
#define DXGI_USAGE_SHADER_INPUT ( 1L << (0 + 4) )
#define DXGI_USAGE_RENDER_TARGET_OUTPUT ( 1L << (1 + 4) )
#define DXGI_USAGE_BACK_BUFFER ( 1L << (2 + 4) )
#define DXGI_USAGE_SHARED ( 1L << (3 + 4) )
#define DXGI_USAGE_PRIMARY ( 1L << (4 + 4) )
typedef UINT DXGI_USAGE;
typedef
enum DXGI_FORMAT
{ DXGI_FORMAT_UNKNOWN = 0,
DXGI_FORMAT_R32G32B32A32_TYPELESS = 1,
DXGI_FORMAT_R32G32B32A32_FLOAT = 2,
DXGI_FORMAT_R32G32B32A32_UINT = 3,
DXGI_FORMAT_R32G32B32A32_SINT = 4,
DXGI_FORMAT_R32G32B32_TYPELESS = 5,
DXGI_FORMAT_R32G32B32_FLOAT = 6,
DXGI_FORMAT_R32G32B32_UINT = 7,
DXGI_FORMAT_R32G32B32_SINT = 8,
DXGI_FORMAT_R16G16B16A16_TYPELESS = 9,
DXGI_FORMAT_R16G16B16A16_FLOAT = 10,
DXGI_FORMAT_R16G16B16A16_UNORM = 11,
DXGI_FORMAT_R16G16B16A16_UINT = 12,
DXGI_FORMAT_R16G16B16A16_SNORM = 13,
DXGI_FORMAT_R16G16B16A16_SINT = 14,
DXGI_FORMAT_R32G32_TYPELESS = 15,
DXGI_FORMAT_R32G32_FLOAT = 16,
DXGI_FORMAT_R32G32_UINT = 17,
DXGI_FORMAT_R32G32_SINT = 18,
DXGI_FORMAT_R32G8X24_TYPELESS = 19,
DXGI_FORMAT_D32_FLOAT_S8X24_UINT = 20,
DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS = 21,
DXGI_FORMAT_X32_TYPELESS_G8X24_UINT = 22,
DXGI_FORMAT_R10G10B10A2_TYPELESS = 23,
DXGI_FORMAT_R10G10B10A2_UNORM = 24,
DXGI_FORMAT_R10G10B10A2_UINT = 25,
DXGI_FORMAT_R11G11B10_FLOAT = 26,
DXGI_FORMAT_R8G8B8A8_TYPELESS = 27,
DXGI_FORMAT_R8G8B8A8_UNORM = 28,
DXGI_FORMAT_R8G8B8A8_UNORM_SRGB = 29,
DXGI_FORMAT_R8G8B8A8_UINT = 30,
DXGI_FORMAT_R8G8B8A8_SNORM = 31,
DXGI_FORMAT_R8G8B8A8_SINT = 32,
DXGI_FORMAT_R16G16_TYPELESS = 33,
DXGI_FORMAT_R16G16_FLOAT = 34,
DXGI_FORMAT_R16G16_UNORM = 35,
DXGI_FORMAT_R16G16_UINT = 36,
DXGI_FORMAT_R16G16_SNORM = 37,
DXGI_FORMAT_R16G16_SINT = 38,
DXGI_FORMAT_R32_TYPELESS = 39,
DXGI_FORMAT_D32_FLOAT = 40,
DXGI_FORMAT_R32_FLOAT = 41,
DXGI_FORMAT_R32_UINT = 42,
DXGI_FORMAT_R32_SINT = 43,
DXGI_FORMAT_R24G8_TYPELESS = 44,
DXGI_FORMAT_D24_UNORM_S8_UINT = 45,
DXGI_FORMAT_R24_UNORM_X8_TYPELESS = 46,
DXGI_FORMAT_X24_TYPELESS_G8_UINT = 47,
DXGI_FORMAT_R8G8_TYPELESS = 48,
DXGI_FORMAT_R8G8_UNORM = 49,
DXGI_FORMAT_R8G8_UINT = 50,
DXGI_FORMAT_R8G8_SNORM = 51,
DXGI_FORMAT_R8G8_SINT = 52,
DXGI_FORMAT_R16_TYPELESS = 53,
DXGI_FORMAT_R16_FLOAT = 54,
DXGI_FORMAT_D16_UNORM = 55,
DXGI_FORMAT_R16_UNORM = 56,
DXGI_FORMAT_R16_UINT = 57,
DXGI_FORMAT_R16_SNORM = 58,
DXGI_FORMAT_R16_SINT = 59,
DXGI_FORMAT_R8_TYPELESS = 60,
DXGI_FORMAT_R8_UNORM = 61,
DXGI_FORMAT_R8_UINT = 62,
DXGI_FORMAT_R8_SNORM = 63,
DXGI_FORMAT_R8_SINT = 64,
DXGI_FORMAT_A8_UNORM = 65,
DXGI_FORMAT_R1_UNORM = 66,
DXGI_FORMAT_R9G9B9E5_SHAREDEXP = 67,
DXGI_FORMAT_R8G8_B8G8_UNORM = 68,
DXGI_FORMAT_G8R8_G8B8_UNORM = 69,
DXGI_FORMAT_BC1_TYPELESS = 70,
DXGI_FORMAT_BC1_UNORM = 71,
DXGI_FORMAT_BC1_UNORM_SRGB = 72,
DXGI_FORMAT_BC2_TYPELESS = 73,
DXGI_FORMAT_BC2_UNORM = 74,
DXGI_FORMAT_BC2_UNORM_SRGB = 75,
DXGI_FORMAT_BC3_TYPELESS = 76,
DXGI_FORMAT_BC3_UNORM = 77,
DXGI_FORMAT_BC3_UNORM_SRGB = 78,
DXGI_FORMAT_BC4_TYPELESS = 79,
DXGI_FORMAT_BC4_UNORM = 80,
DXGI_FORMAT_BC4_SNORM = 81,
DXGI_FORMAT_BC5_TYPELESS = 82,
DXGI_FORMAT_BC5_UNORM = 83,
DXGI_FORMAT_BC5_SNORM = 84,
DXGI_FORMAT_B5G6R5_UNORM = 85,
DXGI_FORMAT_B5G5R5A1_UNORM = 86,
DXGI_FORMAT_B8G8R8A8_UNORM = 87,
DXGI_FORMAT_B8G8R8X8_UNORM = 88,
DXGI_FORMAT_FORCE_UINT = 0xffffffffUL
} DXGI_FORMAT;
typedef struct DXGI_RGB
{
float Red;
float Green;
float Blue;
} DXGI_RGB;
typedef struct DXGI_GAMMA_CONTROL
{
DXGI_RGB Scale;
DXGI_RGB Offset;
DXGI_RGB GammaCurve[ 1025 ];
} DXGI_GAMMA_CONTROL;
typedef struct DXGI_GAMMA_CONTROL_CAPABILIITES
{
BOOL ScaleAndOffsetSupported;
float MaxConvertedValue;
float MinConvertedValue;
UINT NumGammaControlPoints;
float ControlPointPositions[ 1025 ];
} DXGI_GAMMA_CONTROL_CAPABILIITES;
typedef struct DXGI_FRAME_STATISTICS
{
UINT PresentCount;
UINT PresentRefreshCount;
UINT SyncRefreshCount;
LARGE_INTEGER SyncQPCTime;
LARGE_INTEGER SyncGPUTime;
} DXGI_FRAME_STATISTICS;
typedef struct DXGI_RATIONAL
{
UINT Numerator;
UINT Denominator;
} DXGI_RATIONAL;
typedef
enum DXGI_MODE_SCANLINE_ORDER
{ DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED = 0,
DXGI_MODE_SCANLINE_ORDER_PROGRESSIVE = 1,
DXGI_MODE_SCANLINE_ORDER_UPPER_FIELD_FIRST = 2,
DXGI_MODE_SCANLINE_ORDER_LOWER_FIELD_FIRST = 3
} DXGI_MODE_SCANLINE_ORDER;
typedef
enum DXGI_MODE_SCALING
{ DXGI_MODE_SCALING_UNSPECIFIED = 0,
DXGI_MODE_SCALING_CENTERED = 1,
DXGI_MODE_SCALING_STRETCHED = 2
} DXGI_MODE_SCALING;
typedef
enum DXGI_MODE_ROTATION
{ DXGI_MODE_ROTATION_UNSPECIFIED = 0,
DXGI_MODE_ROTATION_IDENTITY = 1,
DXGI_MODE_ROTATION_ROTATE90 = 2,
DXGI_MODE_ROTATION_ROTATE180 = 3,
DXGI_MODE_ROTATION_ROTATE270 = 4
} DXGI_MODE_ROTATION;
typedef struct DXGI_MODE_DESC
{
UINT Width;
UINT Height;
DXGI_RATIONAL RefreshRate;
DXGI_FORMAT Format;
DXGI_MODE_SCANLINE_ORDER ScanlineOrdering;
DXGI_MODE_SCALING Scaling;
} DXGI_MODE_DESC;
typedef struct DXGI_MAPPED_RECT
{
INT Pitch;
BYTE *pBits;
} DXGI_MAPPED_RECT;
typedef struct DXGI_ADAPTER_DESC
{
WCHAR Description[ 128 ];
UINT VendorId;
UINT DeviceId;
UINT SubSysId;
UINT Revision;
SIZE_T DedicatedVideoMemory;
SIZE_T SharedVideoMemory;
} DXGI_ADAPTER_DESC;
#if !defined(HMONITOR_DECLARED) && !defined(HMONITOR) && (WINVER < 0x0500)
#define HMONITOR_DECLARED
#if 0
typedef HANDLE HMONITOR;
#endif
DECLARE_HANDLE(HMONITOR);
#endif
typedef struct DXGI_OUTPUT_DESC
{
WCHAR DeviceName[ 32 ];
RECT DesktopCoordinates;
BOOL AttachedToDesktop;
DXGI_MODE_ROTATION Rotation;
HMONITOR Monitor;
} DXGI_OUTPUT_DESC;
typedef struct DXGI_SAMPLE_DESC
{
UINT Count;
UINT Quality;
} DXGI_SAMPLE_DESC;
typedef struct DXGI_SHARED_RESOURCE
{
HANDLE Handle;
DXGI_USAGE OpenUsage;
} DXGI_SHARED_RESOURCE;
#define DXGI_RESOURCE_PRIORITY_MINIMUM ( 0x28000000 )
#define DXGI_RESOURCE_PRIORITY_LOW ( 0x50000000 )
#define DXGI_RESOURCE_PRIORITY_NORMAL ( 0x78000000 )
#define DXGI_RESOURCE_PRIORITY_HIGH ( 0xa0000000 )
#define DXGI_RESOURCE_PRIORITY_MAXIMUM ( 0xc8000000 )
typedef
enum DXGI_RESIDENCY
{ DXGI_RESIDENCY_FULLY_RESIDENT = 1,
DXGI_RESIDENCY_RESIDENT_IN_SHARED_MEMORY = 2,
DXGI_RESIDENCY_EVICTED_TO_DISK = 3
} DXGI_RESIDENCY;
typedef struct DXGI_SURFACE_DESC
{
UINT Width;
UINT Height;
DXGI_FORMAT Format;
DXGI_SAMPLE_DESC SampleDesc;
} DXGI_SURFACE_DESC;
typedef
enum DXGI_SWAP_EFFECT
{ DXGI_SWAP_EFFECT_DISCARD = 0,
DXGI_SWAP_EFFECT_COPY = 1
} DXGI_SWAP_EFFECT;
typedef struct DXGI_SWAP_CHAIN_DESC
{
DXGI_MODE_DESC BackBufferDesc;
DXGI_SAMPLE_DESC SampleDesc;
DXGI_SHARED_RESOURCE Sharing;
DXGI_USAGE BackBufferUsage;
UINT BackBufferCount;
UINT MaxFrameLatency;
HWND OutputWindow;
BOOL Windowed;
DXGI_SWAP_EFFECT SwapEffect;
DXGI_MODE_ROTATION BackBufferRotation;
} DXGI_SWAP_CHAIN_DESC;
extern RPC_IF_HANDLE __MIDL_itf_dxgitype_0000_0000_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_dxgitype_0000_0000_v0_0_s_ifspec;
/* Additional Prototypes for ALL interfaces */
/* end of Additional Prototypes */
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,99 @@
/*==========================================================================;
*
*
* File: dxerr.h
* Content: DirectX Error Library Include File
*
****************************************************************************/
#ifndef _DXERR_H_
#define _DXERR_H_
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
//
// DXGetErrorString
//
// Desc: Converts a DirectX HRESULT to a string
//
// Args: HRESULT hr Can be any error code from
// XACT D3D10 D3DX10 D3D9 D3DX9 D3D8 D3DX8 DDRAW DPLAY8 DMUSIC DSOUND DINPUT DSHOW
//
// Return: Converted string
//
const char* WINAPI DXGetErrorStringA(HRESULT hr);
const WCHAR* WINAPI DXGetErrorStringW(HRESULT hr);
#ifdef UNICODE
#define DXGetErrorString DXGetErrorStringW
#else
#define DXGetErrorString DXGetErrorStringA
#endif
//
// DXGetErrorDescription
//
// Desc: Returns a string description of a DirectX HRESULT
//
// Args: HRESULT hr Can be any error code from
// XACT D3D10 D3DX10 D3D9 D3DX9 D3D8 D3DX8 DDRAW DPLAY8 DMUSIC DSOUND DINPUT DSHOW
//
// Return: String description
//
const char* WINAPI DXGetErrorDescriptionA(HRESULT hr);
const WCHAR* WINAPI DXGetErrorDescriptionW(HRESULT hr);
#ifdef UNICODE
#define DXGetErrorDescription DXGetErrorDescriptionW
#else
#define DXGetErrorDescription DXGetErrorDescriptionA
#endif
//
// DXTrace
//
// Desc: Outputs a formatted error message to the debug stream
//
// Args: CHAR* strFile The current file, typically passed in using the
// __FILE__ macro.
// DWORD dwLine The current line number, typically passed in using the
// __LINE__ macro.
// HRESULT hr An HRESULT that will be traced to the debug stream.
// CHAR* strMsg A string that will be traced to the debug stream (may be NULL)
// BOOL bPopMsgBox If TRUE, then a message box will popup also containing the passed info.
//
// Return: The hr that was passed in.
//
HRESULT WINAPI DXTraceA( const char* strFile, DWORD dwLine, HRESULT hr, const char* strMsg, BOOL bPopMsgBox );
HRESULT WINAPI DXTraceW( const char* strFile, DWORD dwLine, HRESULT hr, const WCHAR* strMsg, BOOL bPopMsgBox );
#ifdef UNICODE
#define DXTrace DXTraceW
#else
#define DXTrace DXTraceA
#endif
//
// Helper macros
//
#if defined(DEBUG) | defined(_DEBUG)
#define DXTRACE_MSG(str) DXTrace( __FILE__, (DWORD)__LINE__, 0, str, FALSE )
#define DXTRACE_ERR(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, FALSE )
#define DXTRACE_ERR_MSGBOX(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, TRUE )
#else
#define DXTRACE_MSG(str) (0L)
#define DXTRACE_ERR(str,hr) (hr)
#define DXTRACE_ERR_MSGBOX(str,hr) (hr)
#endif
#ifdef __cplusplus
}
#endif //__cplusplus
#endif // _DXERR_H_

View File

@ -0,0 +1,120 @@
//==================================================================================================
// PIXPlugin.h
//
// Microsoft PIX Plugin Header
//
// Copyright (c) Microsoft Corporation, All rights reserved
//==================================================================================================
#pragma once
#ifdef __cplusplus
extern "C"
{
#endif
//==================================================================================================
// PIX_PLUGIN_SYSTEM_VERSION - Indicates version of the plugin interface the plugin is built with.
//==================================================================================================
#define PIX_PLUGIN_SYSTEM_VERSION 0x101
//==================================================================================================
// PIXCOUNTERID - A unique identifier for each PIX plugin counter.
//==================================================================================================
typedef int PIXCOUNTERID;
//==================================================================================================
// PIXCOUNTERDATATYPE - Indicates what type of data the counter produces.
//==================================================================================================
enum PIXCOUNTERDATATYPE
{
PCDT_RESERVED,
PCDT_FLOAT,
PCDT_INT,
PCDT_INT64,
PCDT_STRING,
};
//==================================================================================================
// PIXPLUGININFO - This structure is filled out by PIXGetPluginInfo and passed back to PIX.
//==================================================================================================
struct PIXPLUGININFO
{
// Filled in by caller:
HINSTANCE hinst;
// Filled in by PIXGetPluginInfo:
WCHAR* pstrPluginName; // Name of plugin
int iPluginVersion; // Version of this particular plugin
int iPluginSystemVersion; // Version of PIX's plugin system this plugin was designed for
};
//==================================================================================================
// PIXCOUNTERINFO - This structure is filled out by PIXGetCounterInfo and passed back to PIX
// to allow PIX to determine information about the counters in the plugin.
//==================================================================================================
struct PIXCOUNTERINFO
{
PIXCOUNTERID counterID; // Used to uniquely ID this counter
WCHAR* pstrName; // String name of the counter
PIXCOUNTERDATATYPE pcdtDataType; // Data type returned by this counter
};
//==================================================================================================
// PIXGetPluginInfo - This returns basic information about this plugin to PIX.
//==================================================================================================
BOOL WINAPI PIXGetPluginInfo( PIXPLUGININFO* pPIXPluginInfo );
//==================================================================================================
// PIXGetCounterInfo - This returns an array of PIXCOUNTERINFO structs to PIX.
// These PIXCOUNTERINFOs allow PIX to enumerate the counters contained
// in this plugin.
//==================================================================================================
BOOL WINAPI PIXGetCounterInfo( DWORD* pdwReturnCounters, PIXCOUNTERINFO** ppCounterInfoList );
//==================================================================================================
// PIXGetCounterDesc - This is called by PIX to request a description of the indicated counter.
//==================================================================================================
BOOL WINAPI PIXGetCounterDesc( PIXCOUNTERID id, WCHAR** ppstrCounterDesc );
//==================================================================================================
// PIXBeginExperiment - This called by PIX once per counter when instrumentation starts.
//==================================================================================================
BOOL WINAPI PIXBeginExperiment( PIXCOUNTERID id, const WCHAR* pstrApplication );
//==================================================================================================
// PIXEndFrame - This is called by PIX once per counter at the end of each frame to gather the
// counter value for that frame. Note that the pointer to the return data must
// continue to point to valid counter data until the next call to PIXEndFrame (or
// PIXEndExperiment) for the same counter. So do not set *ppReturnData to the same
// pointer for multiple counters, or point to a local variable that will go out of
// scope. See the sample PIX plugin for an example of how to structure a plugin
// properly.
//==================================================================================================
BOOL WINAPI PIXEndFrame( PIXCOUNTERID id, UINT iFrame, DWORD* pdwReturnBytes, BYTE** ppReturnData );
//==================================================================================================
// PIXEndExperiment - This is called by PIX once per counter when instrumentation ends.
//==================================================================================================
BOOL WINAPI PIXEndExperiment( PIXCOUNTERID id );
#ifdef __cplusplus
};
#endif
//==================================================================================================
// eof: PIXPlugin.h
//==================================================================================================

View File

@ -0,0 +1,279 @@
/*-========================================================================-_
| - X3DAUDIO - |
| Copyright (c) Microsoft Corporation. All rights reserved. |
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
|VERSION: 0.1 MODEL: Unmanaged User-mode |
|CONTRACT: N / A EXCEPT: No Exceptions |
|PARENT: N / A MINREQ: Win2000, Xenon |
|PROJECT: X3DAudio DIALECT: MS Visual C++ 7.0 |
|>------------------------------------------------------------------------<|
| DUTY: Cross-platform stand-alone 3D audio math library |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
NOTES:
1. Definition of terms:
LFE: Low Frequency Effect -- always omnidirectional.
LPF: Low Pass Filter, divided into two classifications:
Direct -- Applied to the direct signal path,
used for obstruction/occlusion effect.
Reverb -- Applied to the reverb signal path,
used for occlusion effect only.
2. Volume level is expressed as a linear amplitude scaler:
1.0f represents no attenuation applied to the original signal,
0.5f denotes an attenuation of 6dB, and 0.0f results in silence.
Amplification (volume > 1.0f) is also allowed, and is not clamped.
3. X3DAudio uses a left-handed Cartesian coordinate system with values
on the x-axis increasing from left to right, on the y-axis from
bottom to top, and on the z-axis from near to far.
Azimuths are measured clockwise from a given reference direction.
Distance measurement is with respect to user-defined world units.
Applications may provide coordinates using any system of measure
as all non-normalized calculations are scale invariant, with such
operations natively occurring in the user-defined world unit space.
Metric constants are supplied only as a convenience.
Distance is calculated using the Euclidean norm formula.
4. Only real values are permissible with functions using 32-bit
float parameters -- NAN and infinite values are not accepted.
All computation occurs in 32-bit precision mode. */
#ifndef __X3DAUDIO_H__
#define __X3DAUDIO_H__
//--------------<D-E-F-I-N-I-T-I-O-N-S>-------------------------------------//
#if defined(_XBOX)
#include <vectorintrinsics.h>
#endif
#include <d3d9types.h>
// speaker geometry configuration flags, specifies assignment of channels to speaker positions, defined as per WAVEFORMATEXTENSIBLE.dwChannelMask
#if !defined(SPEAKER_FRONT_LEFT)
#define SPEAKER_FRONT_LEFT 0x00000001
#define SPEAKER_FRONT_RIGHT 0x00000002
#define SPEAKER_FRONT_CENTER 0x00000004
#define SPEAKER_LOW_FREQUENCY 0x00000008
#define SPEAKER_BACK_LEFT 0x00000010
#define SPEAKER_BACK_RIGHT 0x00000020
#define SPEAKER_FRONT_LEFT_OF_CENTER 0x00000040
#define SPEAKER_FRONT_RIGHT_OF_CENTER 0x00000080
#define SPEAKER_BACK_CENTER 0x00000100
#define SPEAKER_SIDE_LEFT 0x00000200
#define SPEAKER_SIDE_RIGHT 0x00000400
#define SPEAKER_TOP_CENTER 0x00000800
#define SPEAKER_TOP_FRONT_LEFT 0x00001000
#define SPEAKER_TOP_FRONT_CENTER 0x00002000
#define SPEAKER_TOP_FRONT_RIGHT 0x00004000
#define SPEAKER_TOP_BACK_LEFT 0x00008000
#define SPEAKER_TOP_BACK_CENTER 0x00010000
#define SPEAKER_TOP_BACK_RIGHT 0x00020000
#endif
// standard speaker geometry configurations, used with X3DAudioInitialize
#if !defined(SPEAKER_STEREO) && !defined(SPEAKER_5POINT1)
#define SPEAKER_STEREO (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT)
#define SPEAKER_5POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT)
#endif
// xenon speaker geometry configuration, used with X3DAudioInitialize
#if defined(_XBOX)
#define SPEAKER_XBOX SPEAKER_5POINT1
#endif
#define X3DAUDIO_HANDLE_BYTESIZE 16 // size of instance handle in bytes
// float math constants
#define X3DAUDIO_PI 3.141592654f
#define X3DAUDIO_2PI 6.283185307f
// speed of sound in meters per second for dry air at approximately 20C, used with X3DAudioInitialize
#define X3DAUDIO_SPEED_OF_SOUND 343.5f
// calculation control flags, used with X3DAudioCalculate
#define X3DAUDIO_CALCULATE_MATRIX 0x00000001 // enable matrix coefficient table calculation
#define X3DAUDIO_CALCULATE_DELAY 0x00000002 // enable delay time array calculation (stereo final mix only)
#define X3DAUDIO_CALCULATE_LPF_DIRECT 0x00000004 // enable LPF direct-path coefficient calculation
#define X3DAUDIO_CALCULATE_LPF_REVERB 0x00000008 // enable LPF reverb-path coefficient calculation
#define X3DAUDIO_CALCULATE_REVERB 0x00000010 // enable reverb send level calculation
#define X3DAUDIO_CALCULATE_DOPPLER 0x00000020 // enable doppler shift factor calculation
#define X3DAUDIO_CALCULATE_EMITTER_ANGLE 0x00000040 // enable emitter-to-listener interior angle calculation
//--------------<M-A-C-R-O-S>-----------------------------------------------//
// function storage-class attribute and calltype
#if defined(_XBOX)
#define X3DAUDIO_API_(type) EXTERN_C type STDAPICALLTYPE
#else
#if defined(X3DEXPORT)
#define X3DAUDIO_API_(type) EXTERN_C __declspec(dllexport) type STDAPICALLTYPE
#else
#define X3DAUDIO_API_(type) EXTERN_C __declspec(dllimport) type STDAPICALLTYPE
#endif
#endif
#define X3DAUDIO_IMP_(type) type STDMETHODCALLTYPE
//--------------<D-A-T-A---T-Y-P-E-S>---------------------------------------//
// primitive types
typedef INT_PTR NWORD; // natural machine word, bytesize platform specific
typedef UINT_PTR UNWORD; // unsigned natural machine word, bytesize platform specific
typedef float FLOAT32; // 32-bit IEEE float
typedef D3DVECTOR X3DAUDIO_VECTOR; // float 3D vector
// instance handle to precalculated constants
typedef BYTE X3DAUDIO_HANDLE[X3DAUDIO_HANDLE_BYTESIZE];
// Distance curve point:
// Defines a DSP setting at a given normalized distance.
typedef struct X3DAUDIO_DISTANCE_CURVE_POINT
{
FLOAT32 Distance; // normalized distance, must be within [0.0f, 1.0f]
FLOAT32 DSPSetting; // DSP control setting
} X3DAUDIO_DISTANCE_CURVE_POINT, *LPX3DAUDIO_DISTANCE_CURVE_POINT;
// Distance curve:
// A piecewise curve made up of linear segments used to
// define DSP behaviour with respect to normalized distance.
//
// Note that curve point distances are normalized within [0.0f, 1.0f].
// X3DAUDIO_EMITTER.CurveDistanceScaler must be used to scale the
// normalized distances to user-defined world units.
// For distances beyond CurveDistanceScaler * 1.0f,
// pPoints[PointCount-1].DSPSetting is used as the DSP setting.
//
// All distance curve spans must be such that:
// pPoints[k-1].DSPSetting + ((pPoints[k].DSPSetting-pPoints[k-1].DSPSetting) / (pPoints[k].Distance-pPoints[k-1].Distance)) * (pPoints[k].Distance-pPoints[k-1].Distance) != NAN or infinite values
// For all points in the distance curve where 1 <= k < PointCount.
typedef struct X3DAUDIO_DISTANCE_CURVE
{
X3DAUDIO_DISTANCE_CURVE_POINT* pPoints; // distance curve point array, must have at least PointCount elements with no duplicates and be sorted in ascending order with respect to Distance
UINT32 PointCount; // number of distance curve points, must be >= 2 as all distance curves must have at least two endpoints, defining DSP settings at 0.0f and 1.0f normalized distance
} X3DAUDIO_DISTANCE_CURVE, *LPX3DAUDIO_DISTANCE_CURVE;
// Cone:
// Specifies directionality for a single-channel emitter by
// scaling DSP behaviour with respect to the emitter's front orientation.
// This is modeled using two sound cones: an inner cone and an outer cone.
// On/within the inner cone, DSP settings are scaled by the inner values.
// On/beyond the outer cone, DSP settings are scaled by the outer values.
// If on both the cones, DSP settings are scaled by the inner values only.
// Between the two cones, the scaler is linearly interpolated between the
// inner and outer values. Set both cone angles to 0 or X3DAUDIO_2PI for
// omnidirectionality using only the outer or inner values respectively.
typedef struct X3DAUDIO_CONE
{
FLOAT32 InnerAngle; // inner cone angle in radians, must be within [0.0f, X3DAUDIO_2PI]
FLOAT32 OuterAngle; // outer cone angle in radians, must be within [InnerAngle, X3DAUDIO_2PI]
FLOAT32 InnerVolume; // volume level scaler on/within inner cone, used only for matrix calculations, must be within [0.0f, 2.0f] when used
FLOAT32 OuterVolume; // volume level scaler on/beyond outer cone, used only for matrix calculations, must be within [0.0f, 2.0f] when used
FLOAT32 InnerLPF; // LPF (both direct and reverb paths) coefficient scaler on/within inner cone, used only for LPF (both direct and reverb paths) calculations, must be within [0.0f, 1.0f] when used
FLOAT32 OuterLPF; // LPF (both direct and reverb paths) coefficient scaler on/beyond outer cone, used only for LPF (both direct and reverb paths) calculations, must be within [0.0f, 1.0f] when used
FLOAT32 InnerReverb; // reverb send level scaler on/within inner cone, used only for reverb calculations, must be within [0.0f, 2.0f] when used
FLOAT32 OuterReverb; // reverb send level scaler on/beyond outer cone, used only for reverb calculations, must be within [0.0f, 2.0f] when used
} X3DAUDIO_CONE, *LPX3DAUDIO_CONE;
// Listener:
// Defines a point of 3D audio reception.
typedef struct X3DAUDIO_LISTENER
{
X3DAUDIO_VECTOR OrientFront; // orientation of front direction, used only for matrix and delay calculations, must be orthonormal with OrientTop when used
X3DAUDIO_VECTOR OrientTop; // orientation of top direction, used only for matrix and delay calculations, must be orthonormal with OrientFront when used
X3DAUDIO_VECTOR Position; // position in user-defined world units, does not affect Velocity
X3DAUDIO_VECTOR Velocity; // velocity vector in user-defined world units/second, used only for doppler calculations, does not affect Position
} X3DAUDIO_LISTENER, *LPX3DAUDIO_LISTENER;
// Emitter:
// Defines a 3D audio source, divided into two classifications:
//
// Single-point -- For use with single-channel sounds.
// Positioned at the emitter base, i.e. the channel radius
// and azimuth are ignored if the number of channels == 1.
//
// May be omnidirectional or directional using a cone.
// The cone originates from the emitter base position,
// and is directed by the emitter's front orientation.
//
// Multi-point -- For use with multi-channel sounds.
// Each non-LFE channel is positioned using an
// azimuth along the channel radius with respect to the
// front orientation vector in the plane orthogonal to the
// top orientation vector. An azimuth of X3DAUDIO_2PI
// specifies a channel is a LFE. Such channels are
// positioned at the emitter base and are calculated
// with respect to pLFECurve only, never pVolumeCurve.
//
// Multi-point emitters are always omnidirectional,
// i.e. the cone is ignored if the number of channels > 1.
//
// Note that many properties are shared among all channel points,
// locking certain behaviour with respect to the emitter base position.
// For example, doppler shift is always calculated with respect to the
// emitter base position and so is constant for all its channel points.
// Distance curve calculations are also with respect to the emitter base
// position, with the curves being calculated independently of each other.
// For instance, volume and LFE calculations do not affect one another.
typedef struct X3DAUDIO_EMITTER
{
X3DAUDIO_CONE* pCone; // sound cone, used only with single-channel emitters for matrix, LPF (both direct and reverb paths), and reverb calculations, NULL specifies omnidirectionality
X3DAUDIO_VECTOR OrientFront; // orientation of front direction, used only for emitter angle calculations or with multi-channel emitters for matrix calculations or single-channel emitters with cones for matrix, LPF (both direct and reverb paths), and reverb calculations, must be normalized when used
X3DAUDIO_VECTOR OrientTop; // orientation of top direction, used only with multi-channel emitters for matrix calculations, must be orthonormal with OrientFront when used
X3DAUDIO_VECTOR Position; // position in user-defined world units, does not affect Velocity
X3DAUDIO_VECTOR Velocity; // velocity vector in user-defined world units/second, used only for doppler calculations, does not affect Position
UINT32 ChannelCount; // number of sound channels, must be > 0
FLOAT32 ChannelRadius; // channel radius, used only with multi-channel emitters for matrix calculations, must be >= 0.0f when used
FLOAT32* pChannelAzimuths; // channel azimuth array, used only with multi-channel emitters for matrix calculations, contains positions of each channel expressed in radians along the channel radius with respect to the front orientation vector in the plane orthogonal to the top orientation vector, or X3DAUDIO_2PI to specify a LFE channel, must have at least ChannelCount elements, all within [0.0f, X3DAUDIO_2PI] when used
X3DAUDIO_DISTANCE_CURVE* pVolumeCurve; // volume level distance curve, used only for matrix calculations, NULL specifies the default curve: [0.0f,1.0f], [1.0f,0.0f]
X3DAUDIO_DISTANCE_CURVE* pLFECurve; // LFE level distance curve, used only for matrix calculations, NULL specifies the default curve: [0.0f,1.0f], [1.0f,0.0f]
X3DAUDIO_DISTANCE_CURVE* pLPFDirectCurve; // LPF direct-path coefficient distance curve, used only for LPF direct-path calculations, NULL specifies the default curve: [0.0f,0.0f], [1.0f,0.25f]
X3DAUDIO_DISTANCE_CURVE* pLPFReverbCurve; // LPF reverb-path coefficient distance curve, used only for LPF reverb-path calculations, NULL specifies the default curve: [0.0f,0.25f], [1.0f,0.25f]
X3DAUDIO_DISTANCE_CURVE* pReverbCurve; // reverb send level distance curve, used only for reverb calculations, NULL specifies the default curve: [0.0f,1.0f], [1.0f,0.0f]
FLOAT32 CurveDistanceScaler; // curve distance scaler, used to scale normalized distance curves to user-defined world units and/or exaggerate their effect, does not affect any other calculations, must be within [FLT_MIN, FLT_MAX] when used
FLOAT32 DopplerScaler; // doppler shift scaler, used to exaggerate doppler shift effect, does not affect any other calculations, must be within [0.0f, FLT_MAX] when used
} X3DAUDIO_EMITTER, *LPX3DAUDIO_EMITTER;
// DSP settings:
// Receives results from a call to X3DAudioCalculate() to be sent
// to the low-level audio rendering API for 3D signal processing.
//
// The user is responsible for allocating the matrix coefficient table,
// delay time array, and initializing the channel counts when used.
typedef struct X3DAUDIO_DSP_SETTINGS
{
FLOAT32* pMatrixCoefficients; // [in] matrix coefficient table, receives an array representing the volume level of each source channel present in each destination channel with the source channels being the column index and the destination channels being the row index of the table, must have at least SrcChannelCount*DstChannelCount elements
FLOAT32* pDelayTimes; // [in] delay time array, receives delays for each destination channel in milliseconds, must have at least DstChannelCount elements (stereo final mix only)
UINT32 SrcChannelCount; // [in] number of source channels, must equal number of channels on respective emitter
UINT32 DstChannelCount; // [in] number of destination channels, must equal number of channels on the final mix
FLOAT32 LPFDirectCoefficient; // [out] LPF direct-path coefficient
FLOAT32 LPFReverbCoefficient; // [out] LPF reverb-path coefficient
FLOAT32 ReverbLevel; // [out] reverb send level
FLOAT32 DopplerFactor; // [out] doppler shift factor, scales resampler ratio for doppler shift effect, where the effective frequency = DopplerFactor * original frequency
FLOAT32 EmitterToListenerAngle; // [out] emitter-to-listener interior angle, expressed in radians with respect to the emitter's front orientation
FLOAT32 EmitterToListenerDistance; // [out] distance in user-defined world units from the emitter base to listener position, always calculated
FLOAT32 EmitterVelocityComponent; // [out] component of emitter velocity vector projected onto emitter->listener vector in user-defined world units/second, calculated only for doppler
FLOAT32 ListenerVelocityComponent; // [out] component of listener velocity vector projected onto emitter->listener vector in user-defined world units/second, calculated only for doppler
} X3DAUDIO_DSP_SETTINGS, *LPX3DAUDIO_DSP_SETTINGS;
//--------------<F-U-N-C-T-I-O-N-S>-----------------------------------------//
// sets all global 3D audio constants
X3DAUDIO_API_(void) X3DAudioInitialize (UINT32 SpeakerChannelMask, FLOAT32 SpeedOfSound, X3DAUDIO_HANDLE Instance);
// calculates DSP settings with respect to 3D parameters
X3DAUDIO_API_(void) X3DAudioCalculate (const X3DAUDIO_HANDLE Instance, const X3DAUDIO_LISTENER* pListener, const X3DAUDIO_EMITTER* pEmitter, UINT32 Flags, X3DAUDIO_DSP_SETTINGS* pDSPSettings);
#endif // __X3DAUDIO_H__
//---------------------------------<-EOF->----------------------------------//

View File

@ -0,0 +1,156 @@
/***************************************************************************
* *
* XInput.h -- This module defines XBOX controller APIs *
* and constansts for the Windows platform. *
* *
* Copyright (c) Microsoft Corp. All rights reserved. *
* *
***************************************************************************/
#ifndef _XINPUT_H_
#define _XINPUT_H_
#include <windef.h>
// Current name of the DLL shipped in the same SDK as this header.
// The name reflects the current version
#define XINPUT_DLL_A "xinput1_1.dll"
#define XINPUT_DLL_W L"xinput1_1.dll"
#ifdef UNICODE
#define XINPUT_DLL XINPUT_DLL_W
#else
#define XINPUT_DLL XINPUT_DLL_A
#endif
//
// Device types available in XINPUT_CAPABILITIES
//
#define XINPUT_DEVTYPE_GAMEPAD 0x01
//
// Device subtypes available in XINPUT_CAPABILITIES
//
#define XINPUT_DEVSUBTYPE_GAMEPAD 0x01
#define XINPUT_DEVSUBTYPE_WHEEL 0x02
#define XINPUT_DEVSUBTYPE_ARCADE_STICK 0x03
#define XINPUT_DEVSUBTYPE_FLIGHT_SICK 0x04
#define XINPUT_DEVSUBTYPE_DANCE_PAD 0x05
//
// Flags for XINPUT_CAPABILITIES
//
#define XINPUT_CAPS_VOICE_SUPPORTED 0x0004
//
// Constants for gamepad buttons
//
#define XINPUT_GAMEPAD_DPAD_UP 0x0001
#define XINPUT_GAMEPAD_DPAD_DOWN 0x0002
#define XINPUT_GAMEPAD_DPAD_LEFT 0x0004
#define XINPUT_GAMEPAD_DPAD_RIGHT 0x0008
#define XINPUT_GAMEPAD_START 0x0010
#define XINPUT_GAMEPAD_BACK 0x0020
#define XINPUT_GAMEPAD_LEFT_THUMB 0x0040
#define XINPUT_GAMEPAD_RIGHT_THUMB 0x0080
#define XINPUT_GAMEPAD_LEFT_SHOULDER 0x0100
#define XINPUT_GAMEPAD_RIGHT_SHOULDER 0x0200
#define XINPUT_GAMEPAD_A 0x1000
#define XINPUT_GAMEPAD_B 0x2000
#define XINPUT_GAMEPAD_X 0x4000
#define XINPUT_GAMEPAD_Y 0x8000
//
// Gamepad thresholds
//
#define XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE 7849
#define XINPUT_GAMEPAD_RIGHT_THUMB_DEADZONE 8689
#define XINPUT_GAMEPAD_TRIGGER_THRESHOLD 30
//
// Flags to pass to XInputGetCapabilities
//
#define XINPUT_FLAG_GAMEPAD 0x00000001
//
// Structures used by XInput APIs
//
typedef struct _XINPUT_GAMEPAD
{
WORD wButtons;
BYTE bLeftTrigger;
BYTE bRightTrigger;
SHORT sThumbLX;
SHORT sThumbLY;
SHORT sThumbRX;
SHORT sThumbRY;
} XINPUT_GAMEPAD, *PXINPUT_GAMEPAD;
typedef struct _XINPUT_STATE
{
DWORD dwPacketNumber;
XINPUT_GAMEPAD Gamepad;
} XINPUT_STATE, *PXINPUT_STATE;
typedef struct _XINPUT_VIBRATION
{
WORD wLeftMotorSpeed;
WORD wRightMotorSpeed;
} XINPUT_VIBRATION, *PXINPUT_VIBRATION;
typedef struct _XINPUT_CAPABILITIES
{
BYTE Type;
BYTE SubType;
WORD Flags;
XINPUT_GAMEPAD Gamepad;
XINPUT_VIBRATION Vibration;
} XINPUT_CAPABILITIES, *PXINPUT_CAPABILITIES;
//
// XInput APIs
//
#ifdef __cplusplus
extern "C" {
#endif
DWORD WINAPI XInputGetState
(
DWORD dwUserIndex, // [in] Index of the gamer associated with the device
XINPUT_STATE* pState // [out] Receives the current state
);
DWORD WINAPI XInputSetState
(
DWORD dwUserIndex, // [in] Index of the gamer associated with the device
XINPUT_VIBRATION* pVibration // [in, out] The vibration information to send to the controller
);
DWORD WINAPI XInputGetCapabilities
(
DWORD dwUserIndex, // [in] Index of the gamer associated with the device
DWORD dwFlags, // [in] Input flags that identify the device type
XINPUT_CAPABILITIES* pCapabilities // [out] Receives the capabilities
);
void WINAPI XInputEnable
(
BOOL enable // [in] Indicates weather xinput is enabled or disabled.
);
DWORD WINAPI XInputGetDSoundAudioDeviceGuids
(
DWORD dwUserIndex, // [in] Index of the gamer associated with the device
GUID* pDSoundRenderGuid, // [out] DSound device ID for render
GUID* pDSoundCaptureGuid // [out] DSound device ID for capture
);
#ifdef __cplusplus
}
#endif
#endif //_XINPUT_H_

View File

@ -0,0 +1,51 @@
// comdecl.h: Macros to facilitate COM interface and GUID declarations.
// Copyright (c) Microsoft Corporation. All rights reserved.
#ifndef _COMDECL_H_
#define _COMDECL_H_
#include <basetyps.h> // For standard COM interface macros
// The DEFINE_CLSID() and DEFINE_IID() macros defined below allow COM GUIDs to
// be declared and defined in such a way that clients can obtain the GUIDs using
// either the __uuidof() extension or the old-style CLSID_Foo / IID_IFoo names.
// If using the latter approach, the client can also choose whether to get the
// GUID definitions by defining the INITGUID preprocessor constant or by linking
// to a GUID library. This works in either C or C++.
#ifdef __cplusplus
#define DECLSPEC_UUID_WRAPPER(x) __declspec(uuid(#x))
#ifdef INITGUID
#define DEFINE_CLSID(className, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
class DECLSPEC_UUID_WRAPPER(l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8) className; \
EXTERN_C const GUID DECLSPEC_SELECTANY CLSID_##className = __uuidof(className)
#define DEFINE_IID(interfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
interface DECLSPEC_UUID_WRAPPER(l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8) interfaceName; \
EXTERN_C const GUID DECLSPEC_SELECTANY IID_##interfaceName = __uuidof(interfaceName)
#else // INITGUID
#define DEFINE_CLSID(className, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
class DECLSPEC_UUID_WRAPPER(l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8) className; \
EXTERN_C const GUID CLSID_##className
#define DEFINE_IID(interfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
interface DECLSPEC_UUID_WRAPPER(l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8) interfaceName; \
EXTERN_C const GUID IID_##interfaceName
#endif // INITGUID
#else // __cplusplus
#define DEFINE_CLSID(className, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
DEFINE_GUID(CLSID_##className, 0x##l, 0x##w1, 0x##w2, 0x##b1, 0x##b2, 0x##b3, 0x##b4, 0x##b5, 0x##b6, 0x##b7, 0x##b8)
#define DEFINE_IID(interfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
DEFINE_GUID(IID_##interfaceName, 0x##l, 0x##w1, 0x##w2, 0x##b1, 0x##b2, 0x##b3, 0x##b4, 0x##b5, 0x##b6, 0x##b7, 0x##b8)
#endif // __cplusplus
#endif // #ifndef _COMDECL_H_

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,174 @@
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// File: D3D10Misc.h
// Content: D3D10 Device Creation APIs
//
//////////////////////////////////////////////////////////////////////////////
#ifndef __D3D10MISC_H__
#define __D3D10MISC_H__
#include "d3d10.h"
///////////////////////////////////////////////////////////////////////////
// ID3D10Blob:
// ------------
// The buffer object is used by D3D10 to return arbitrary size data.
//
// GetBufferPointer -
// Returns a pointer to the beginning of the buffer.
//
// GetBufferSize -
// Returns the size of the buffer, in bytes.
///////////////////////////////////////////////////////////////////////////
typedef interface ID3D10Blob ID3D10Blob;
typedef interface ID3D10Blob *LPD3D10BLOB;
// {8BA5FB08-5195-40e2-AC58-0D989C3A0102}
DEFINE_GUID(IID_ID3D10Blob,
0x8ba5fb08, 0x5195, 0x40e2, 0xac, 0x58, 0xd, 0x98, 0x9c, 0x3a, 0x1, 0x2);
#undef INTERFACE
#define INTERFACE ID3D10Blob
DECLARE_INTERFACE_(ID3D10Blob, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3D10Blob
STDMETHOD_(LPVOID, GetBufferPointer)(THIS) PURE;
STDMETHOD_(SIZE_T, GetBufferSize)(THIS) PURE;
};
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
///////////////////////////////////////////////////////////////////////////
// D3D10_DRIVER_TYPE
// ----------------
//
// This identifier is used to determine the implementation of Direct3D10
// to be used.
//
// Pass one of these values to D3D10CreateDevice
//
///////////////////////////////////////////////////////////////////////////
typedef enum D3D10_DRIVER_TYPE
{
D3D10_DRIVER_TYPE_HARDWARE = 0,
D3D10_DRIVER_TYPE_REFERENCE = 1,
D3D10_DRIVER_TYPE_NULL = 2,
D3D10_DRIVER_TYPE_SOFTWARE = 3,
} D3D10_DRIVER_TYPE;
DEFINE_GUID(GUID_DeviceType,
0xd722fb4d, 0x7a68, 0x437a, 0xb2, 0x0c, 0x58, 0x04, 0xee, 0x24, 0x94, 0xa6);
///////////////////////////////////////////////////////////////////////////
// D3D10CreateDevice
// ------------------
//
// pAdapter
// If NULL, D3D10CreateDevice will choose the primary adapter and
// create a new instance from a temporarily created IDXGIFactory.
// If non-NULL, D3D10CreateDevice will register the appropriate
// device, if necessary (via IDXGIAdapter::RegisterDrver), before
// creating the device.
// DriverType
// Specifies the driver type to be created: hardware, reference or
// null.
// Software
// HMODULE of a DLL implementing a software rasterizer. Must be NULL for
// non-Software driver types.
// Flags
// Any of those documented for D3D10CreateDevice.
// SDKVersion
// SDK version. Use the D3D10_SDK_VERSION macro.
// ppDevice
// Pointer to returned interface.
//
// Return Values
// Any of those documented for
// CreateDXGIFactory
// IDXGIFactory::EnumAdapters
// IDXGIAdapter::RegisterDriver
// D3D10CreateDevice
//
///////////////////////////////////////////////////////////////////////////
HRESULT WINAPI D3D10CreateDevice(
IDXGIAdapter *pAdapter,
D3D10_DRIVER_TYPE DriverType,
HMODULE Software,
UINT Flags,
UINT SDKVersion,
ID3D10Device **ppDevice);
///////////////////////////////////////////////////////////////////////////
// D3D10CreateDeviceAndSwapChain
// ------------------------------
//
// ppAdapter
// If NULL, D3D10CreateDevice will choose the primary adapter and
// create a new instance from a temporarily created IDXGIFactory.
// If non-NULL, D3D10CreateDevice will register the appropriate
// device, if necessary (via IDXGIAdapter::RegisterDrver), before
// creating the device.
// DriverType
// Specifies the driver type to be created: hardware, reference or
// null.
// Software
// HMODULE of a DLL implementing a software rasterizer. Must be NULL for
// non-Software driver types.
// Flags
// Any of those documented for D3D10CreateDevice.
// SDKVersion
// SDK version. Use the D3D10_SDK_VERSION macro.
// pSwapChainDesc
// Swap chain description, may be NULL.
// ppSwapChain
// Pointer to returned interface. May be NULL.
// ppDevice
// Pointer to returned interface.
//
// Return Values
// Any of those documented for
// CreateDXGIFactory
// IDXGIFactory::EnumAdapters
// IDXGIAdapter::RegisterDriver
// D3D10CreateDevice
// IDXGIFactory::CreateSwapChain
//
///////////////////////////////////////////////////////////////////////////
HRESULT WINAPI D3D10CreateDeviceAndSwapChain(
IDXGIAdapter *pAdapter,
D3D10_DRIVER_TYPE DriverType,
HMODULE Software,
UINT Flags,
UINT SDKVersion,
DXGI_SWAP_CHAIN_DESC *pSwapChainDesc,
IDXGISwapChain **ppSwapChain,
ID3D10Device **ppDevice);
///////////////////////////////////////////////////////////////////////////
// D3D10CreateBlob:
// -----------------
// Creates a Buffer of n Bytes
//////////////////////////////////////////////////////////////////////////
HRESULT WINAPI D3D10CreateBlob(SIZE_T NumBytes, LPD3D10BLOB *ppBuffer);
#ifdef __cplusplus
}
#endif //__cplusplus
#endif //__D3D10EFFECT_H__

View File

@ -0,0 +1,998 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 7.00.0485 */
/* Compiler settings for d3d10sdklayers.idl:
Oicf, W1, Zp8, env=Win32 (32b run)
protocol : dce , ms_ext, c_ext, robust
error checks: allocation ref bounds_check enum stub_data
VC __declspec() decoration level:
__declspec(uuid()), __declspec(selectany), __declspec(novtable)
DECLSPEC_UUID(), MIDL_INTERFACE()
*/
//@@MIDL_FILE_HEADING( )
#pragma warning( disable: 4049 ) /* more than 64k source lines */
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCSAL_H_VERSION__
#define __REQUIRED_RPCSAL_H_VERSION__ 100
#endif
#include "rpc.h"
#include "rpcndr.h"
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif // __RPCNDR_H_VERSION__
#ifndef COM_NO_WINDOWS_H
#include "windows.h"
#include "ole2.h"
#endif /*COM_NO_WINDOWS_H*/
#ifndef __d3d10sdklayers_h__
#define __d3d10sdklayers_h__
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
/* Forward Declarations */
#ifndef __ID3D10Debug_FWD_DEFINED__
#define __ID3D10Debug_FWD_DEFINED__
typedef interface ID3D10Debug ID3D10Debug;
#endif /* __ID3D10Debug_FWD_DEFINED__ */
#ifndef __ID3D10InfoQueue_FWD_DEFINED__
#define __ID3D10InfoQueue_FWD_DEFINED__
typedef interface ID3D10InfoQueue ID3D10InfoQueue;
#endif /* __ID3D10InfoQueue_FWD_DEFINED__ */
/* header files for imported files */
#include "oaidl.h"
#include "ocidl.h"
#ifdef __cplusplus
extern "C"{
#endif
/* interface __MIDL_itf_d3d10sdklayers_0000_0000 */
/* [local] */
#define D3D10_SDK_LAYERS_VERSION ( 2 )
#define D3D10_DEBUG_FEATURE_FLUSH_PER_RENDER_OP ( 0x1 )
extern RPC_IF_HANDLE __MIDL_itf_d3d10sdklayers_0000_0000_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_d3d10sdklayers_0000_0000_v0_0_s_ifspec;
#ifndef __ID3D10Debug_INTERFACE_DEFINED__
#define __ID3D10Debug_INTERFACE_DEFINED__
/* interface ID3D10Debug */
/* [unique][local][object][uuid] */
EXTERN_C const IID IID_ID3D10Debug;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("9B7E4E01-342C-4106-A19F-4F2704F689F0")
ID3D10Debug : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE SetFeatureMask(
UINT Mask) = 0;
virtual UINT STDMETHODCALLTYPE GetFeatureMask( void) = 0;
virtual HRESULT STDMETHODCALLTYPE Validate( void) = 0;
};
#else /* C style interface */
typedef struct ID3D10DebugVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D10Debug * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D10Debug * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D10Debug * This);
HRESULT ( STDMETHODCALLTYPE *SetFeatureMask )(
ID3D10Debug * This,
UINT Mask);
UINT ( STDMETHODCALLTYPE *GetFeatureMask )(
ID3D10Debug * This);
HRESULT ( STDMETHODCALLTYPE *Validate )(
ID3D10Debug * This);
END_INTERFACE
} ID3D10DebugVtbl;
interface ID3D10Debug
{
CONST_VTBL struct ID3D10DebugVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ID3D10Debug_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ID3D10Debug_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ID3D10Debug_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ID3D10Debug_SetFeatureMask(This,Mask) \
( (This)->lpVtbl -> SetFeatureMask(This,Mask) )
#define ID3D10Debug_GetFeatureMask(This) \
( (This)->lpVtbl -> GetFeatureMask(This) )
#define ID3D10Debug_Validate(This) \
( (This)->lpVtbl -> Validate(This) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ID3D10Debug_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_d3d10sdklayers_0000_0001 */
/* [local] */
typedef
enum D3D10_MESSAGE_CATEGORY
{ D3D10_MESSAGE_CATEGORY_APPLICATION_DEFINED = 0,
D3D10_MESSAGE_CATEGORY_MISCELLANEOUS = ( D3D10_MESSAGE_CATEGORY_APPLICATION_DEFINED + 1 ) ,
D3D10_MESSAGE_CATEGORY_INITIALIZATION = ( D3D10_MESSAGE_CATEGORY_MISCELLANEOUS + 1 ) ,
D3D10_MESSAGE_CATEGORY_CLEANUP = ( D3D10_MESSAGE_CATEGORY_INITIALIZATION + 1 ) ,
D3D10_MESSAGE_CATEGORY_COMPILATION = ( D3D10_MESSAGE_CATEGORY_CLEANUP + 1 ) ,
D3D10_MESSAGE_CATEGORY_STATE_CREATION = ( D3D10_MESSAGE_CATEGORY_COMPILATION + 1 ) ,
D3D10_MESSAGE_CATEGORY_STATE_SETTING = ( D3D10_MESSAGE_CATEGORY_STATE_CREATION + 1 ) ,
D3D10_MESSAGE_CATEGORY_STATE_GETTING = ( D3D10_MESSAGE_CATEGORY_STATE_SETTING + 1 ) ,
D3D10_MESSAGE_CATEGORY_RESOURCE_MANIPULATION = ( D3D10_MESSAGE_CATEGORY_STATE_GETTING + 1 ) ,
D3D10_MESSAGE_CATEGORY_EXECUTION = ( D3D10_MESSAGE_CATEGORY_RESOURCE_MANIPULATION + 1 )
} D3D10_MESSAGE_CATEGORY;
typedef
enum D3D10_MESSAGE_SEVERITY
{ D3D10_MESSAGE_SEVERITY_CORRUPTION = 0,
D3D10_MESSAGE_SEVERITY_ERROR = ( D3D10_MESSAGE_SEVERITY_CORRUPTION + 1 ) ,
D3D10_MESSAGE_SEVERITY_WARNING = ( D3D10_MESSAGE_SEVERITY_ERROR + 1 ) ,
D3D10_MESSAGE_SEVERITY_INFO = ( D3D10_MESSAGE_SEVERITY_WARNING + 1 )
} D3D10_MESSAGE_SEVERITY;
typedef
enum D3D10_MESSAGE_ID
{ D3D10_MESSAGE_ID_UNKNOWN = 0,
D3D10_MESSAGE_ID_STRING_FROM_APPLICATION = ( D3D10_MESSAGE_ID_UNKNOWN + 1 ) ,
D3D10_MESSAGE_ID_CORRUPTED_THIS = ( D3D10_MESSAGE_ID_STRING_FROM_APPLICATION + 1 ) ,
D3D10_MESSAGE_ID_CORRUPTED_PARAMETER0 = ( D3D10_MESSAGE_ID_CORRUPTED_THIS + 1 ) ,
D3D10_MESSAGE_ID_CORRUPTED_PARAMETER1 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER0 + 1 ) ,
D3D10_MESSAGE_ID_CORRUPTED_PARAMETER2 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER1 + 1 ) ,
D3D10_MESSAGE_ID_CORRUPTED_PARAMETER3 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER2 + 1 ) ,
D3D10_MESSAGE_ID_CORRUPTED_PARAMETER4 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER3 + 1 ) ,
D3D10_MESSAGE_ID_CORRUPTED_PARAMETER5 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER4 + 1 ) ,
D3D10_MESSAGE_ID_CORRUPTED_PARAMETER6 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER5 + 1 ) ,
D3D10_MESSAGE_ID_CORRUPTED_PARAMETER7 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER6 + 1 ) ,
D3D10_MESSAGE_ID_CORRUPTED_PARAMETER8 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER7 + 1 ) ,
D3D10_MESSAGE_ID_CORRUPTED_PARAMETER9 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER8 + 1 ) ,
D3D10_MESSAGE_ID_CORRUPTED_PARAMETER10 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER9 + 1 ) ,
D3D10_MESSAGE_ID_CORRUPTED_PARAMETER11 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER10 + 1 ) ,
D3D10_MESSAGE_ID_CORRUPTED_PARAMETER12 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER11 + 1 ) ,
D3D10_MESSAGE_ID_CORRUPTED_PARAMETER13 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER12 + 1 ) ,
D3D10_MESSAGE_ID_CORRUPTED_PARAMETER14 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER13 + 1 ) ,
D3D10_MESSAGE_ID_CORRUPTED_PARAMETER15 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER14 + 1 ) ,
D3D10_MESSAGE_ID_CORRUPTED_MULTITHREADING = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER15 + 1 ) ,
D3D10_MESSAGE_ID_MESSAGE_REPORTING_OUTOFMEMORY = ( D3D10_MESSAGE_ID_CORRUPTED_MULTITHREADING + 1 ) ,
D3D10_MESSAGE_ID_IASETINPUTLAYOUT_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_MESSAGE_REPORTING_OUTOFMEMORY + 1 ) ,
D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_IASETINPUTLAYOUT_UNBINDDELETINGOBJECT + 1 ) ,
D3D10_MESSAGE_ID_IASETINDEXBUFFER_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_UNBINDDELETINGOBJECT + 1 ) ,
D3D10_MESSAGE_ID_VSSETSHADER_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_IASETINDEXBUFFER_UNBINDDELETINGOBJECT + 1 ) ,
D3D10_MESSAGE_ID_VSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_VSSETSHADER_UNBINDDELETINGOBJECT + 1 ) ,
D3D10_MESSAGE_ID_VSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_VSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) ,
D3D10_MESSAGE_ID_VSSETSAMPLERS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_VSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) ,
D3D10_MESSAGE_ID_GSSETSHADER_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_VSSETSAMPLERS_UNBINDDELETINGOBJECT + 1 ) ,
D3D10_MESSAGE_ID_GSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_GSSETSHADER_UNBINDDELETINGOBJECT + 1 ) ,
D3D10_MESSAGE_ID_GSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_GSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) ,
D3D10_MESSAGE_ID_GSSETSAMPLERS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_GSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) ,
D3D10_MESSAGE_ID_SOSETTARGETS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_GSSETSAMPLERS_UNBINDDELETINGOBJECT + 1 ) ,
D3D10_MESSAGE_ID_PSSETSHADER_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_SOSETTARGETS_UNBINDDELETINGOBJECT + 1 ) ,
D3D10_MESSAGE_ID_PSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_PSSETSHADER_UNBINDDELETINGOBJECT + 1 ) ,
D3D10_MESSAGE_ID_PSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_PSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) ,
D3D10_MESSAGE_ID_PSSETSAMPLERS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_PSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) ,
D3D10_MESSAGE_ID_RSSETSTATE_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_PSSETSAMPLERS_UNBINDDELETINGOBJECT + 1 ) ,
D3D10_MESSAGE_ID_OMSETBLENDSTATE_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_RSSETSTATE_UNBINDDELETINGOBJECT + 1 ) ,
D3D10_MESSAGE_ID_OMSETDEPTHSTENCILSTATE_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_OMSETBLENDSTATE_UNBINDDELETINGOBJECT + 1 ) ,
D3D10_MESSAGE_ID_OMSETRENDERTARGETS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_OMSETDEPTHSTENCILSTATE_UNBINDDELETINGOBJECT + 1 ) ,
D3D10_MESSAGE_ID_SETPREDICATION_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_OMSETRENDERTARGETS_UNBINDDELETINGOBJECT + 1 ) ,
D3D10_MESSAGE_ID_GETPRIVATEDATA_MOREDATA = ( D3D10_MESSAGE_ID_SETPREDICATION_UNBINDDELETINGOBJECT + 1 ) ,
D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDFREEDATA = ( D3D10_MESSAGE_ID_GETPRIVATEDATA_MOREDATA + 1 ) ,
D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDIUNKNOWN = ( D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDFREEDATA + 1 ) ,
D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDFLAGS = ( D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDIUNKNOWN + 1 ) ,
D3D10_MESSAGE_ID_SETPRIVATEDATA_CHANGINGPARAMS = ( D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDFLAGS + 1 ) ,
D3D10_MESSAGE_ID_SETPRIVATEDATA_OUTOFMEMORY = ( D3D10_MESSAGE_ID_SETPRIVATEDATA_CHANGINGPARAMS + 1 ) ,
D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_SETPRIVATEDATA_OUTOFMEMORY + 1 ) ,
D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDSAMPLES = ( D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDFORMAT + 1 ) ,
D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDUSAGE = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDSAMPLES + 1 ) ,
D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDUSAGE + 1 ) ,
D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDBINDFLAGS + 1 ) ,
D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) ,
D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDFORMAT = ( D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDMISCFLAGS + 1 ) ,
D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDFORMAT + 1 ) ,
D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDCPUACCESSFLAGS + 1 ) ,
D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDINITIALDATA = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDBINDFLAGS + 1 ) ,
D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDINITIALDATA + 1 ) ,
D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDMIPLEVELS = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDDIMENSIONS + 1 ) ,
D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDMIPLEVELS + 1 ) ,
D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDMISCFLAGS + 1 ) ,
D3D10_MESSAGE_ID_CREATEBUFFER_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDARG_RETURN + 1 ) ,
D3D10_MESSAGE_ID_CREATEBUFFER_NULLDESC = ( D3D10_MESSAGE_ID_CREATEBUFFER_OUTOFMEMORY_RETURN + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_CREATEBUFFER_NULLDESC + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE1D_UNSUPPORTEDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDFORMAT + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDSAMPLES = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_UNSUPPORTEDFORMAT + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDUSAGE = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDSAMPLES + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDUSAGE + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDBINDFLAGS + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDMISCFLAGS + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDFORMAT + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDCPUACCESSFLAGS + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDINITIALDATA = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDBINDFLAGS + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDINITIALDATA + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDMIPLEVELS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDDIMENSIONS + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDMIPLEVELS + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDMISCFLAGS + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE1D_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDARG_RETURN + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE1D_NULLDESC = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_OUTOFMEMORY_RETURN + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE1D_RESOURCETOOLARGE = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_NULLDESC + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_RESOURCETOOLARGE + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE2D_UNSUPPORTEDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDFORMAT + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDSAMPLES = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_UNSUPPORTEDFORMAT + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDUSAGE = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDSAMPLES + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDUSAGE + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDBINDFLAGS + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDMISCFLAGS + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDFORMAT + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDCPUACCESSFLAGS + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDINITIALDATA = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDBINDFLAGS + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDINITIALDATA + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDMIPLEVELS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDDIMENSIONS + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDMIPLEVELS + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDMISCFLAGS + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE2D_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDARG_RETURN + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE2D_NULLDESC = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_OUTOFMEMORY_RETURN + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE2D_RESOURCETOOLARGE = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_NULLDESC + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_RESOURCETOOLARGE + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE3D_UNSUPPORTEDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDFORMAT + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDSAMPLES = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_UNSUPPORTEDFORMAT + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDUSAGE = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDSAMPLES + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDUSAGE + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDBINDFLAGS + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDMISCFLAGS + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDFORMAT + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDCPUACCESSFLAGS + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDINITIALDATA = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDBINDFLAGS + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDINITIALDATA + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDMIPLEVELS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDDIMENSIONS + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDMIPLEVELS + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDMISCFLAGS + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE3D_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDARG_RETURN + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE3D_NULLDESC = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_OUTOFMEMORY_RETURN + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURE3D_RESOURCETOOLARGE = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_NULLDESC + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURECUBE_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_RESOURCETOOLARGE + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURECUBE_UNSUPPORTEDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURECUBE_UNRECOGNIZEDFORMAT + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURECUBE_INVALIDSAMPLES = ( D3D10_MESSAGE_ID_CREATETEXTURECUBE_UNSUPPORTEDFORMAT + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURECUBE_UNRECOGNIZEDUSAGE = ( D3D10_MESSAGE_ID_CREATETEXTURECUBE_INVALIDSAMPLES + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURECUBE_UNRECOGNIZEDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURECUBE_UNRECOGNIZEDUSAGE + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURECUBE_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURECUBE_UNRECOGNIZEDBINDFLAGS + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURECUBE_UNRECOGNIZEDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURECUBE_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURECUBE_INVALIDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURECUBE_UNRECOGNIZEDMISCFLAGS + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURECUBE_INVALIDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURECUBE_INVALIDFORMAT + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURECUBE_INVALIDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURECUBE_INVALIDCPUACCESSFLAGS + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURECUBE_INVALIDINITIALDATA = ( D3D10_MESSAGE_ID_CREATETEXTURECUBE_INVALIDBINDFLAGS + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURECUBE_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATETEXTURECUBE_INVALIDINITIALDATA + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURECUBE_INVALIDMIPLEVELS = ( D3D10_MESSAGE_ID_CREATETEXTURECUBE_INVALIDDIMENSIONS + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURECUBE_INVALIDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURECUBE_INVALIDMIPLEVELS + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURECUBE_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATETEXTURECUBE_INVALIDMISCFLAGS + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURECUBE_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATETEXTURECUBE_INVALIDARG_RETURN + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURECUBE_NULLDESC = ( D3D10_MESSAGE_ID_CREATETEXTURECUBE_OUTOFMEMORY_RETURN + 1 ) ,
D3D10_MESSAGE_ID_CREATETEXTURECUBE_RESOURCETOOLARGE = ( D3D10_MESSAGE_ID_CREATETEXTURECUBE_NULLDESC + 1 ) ,
D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURECUBE_RESOURCETOOLARGE + 1 ) ,
D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDESC = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_UNRECOGNIZEDFORMAT + 1 ) ,
D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFORMAT = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDESC + 1 ) ,
D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFORMAT + 1 ) ,
D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDRESOURCE = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDIMENSIONS + 1 ) ,
D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_TOOMANYOBJECTS = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDRESOURCE + 1 ) ,
D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_TOOMANYOBJECTS + 1 ) ,
D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDARG_RETURN + 1 ) ,
D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_OUTOFMEMORY_RETURN + 1 ) ,
D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_UNSUPPORTEDFORMAT = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_UNRECOGNIZEDFORMAT + 1 ) ,
D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDESC = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_UNSUPPORTEDFORMAT + 1 ) ,
D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDFORMAT = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDESC + 1 ) ,
D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDFORMAT + 1 ) ,
D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDRESOURCE = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDIMENSIONS + 1 ) ,
D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_TOOMANYOBJECTS = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDRESOURCE + 1 ) ,
D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_TOOMANYOBJECTS + 1 ) ,
D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDARG_RETURN + 1 ) ,
D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_OUTOFMEMORY_RETURN + 1 ) ,
D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDESC = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_UNRECOGNIZEDFORMAT + 1 ) ,
D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFORMAT = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDESC + 1 ) ,
D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFORMAT + 1 ) ,
D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDRESOURCE = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDIMENSIONS + 1 ) ,
D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_TOOMANYOBJECTS = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDRESOURCE + 1 ) ,
D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_TOOMANYOBJECTS + 1 ) ,
D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDARG_RETURN + 1 ) ,
D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_OUTOFMEMORY = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_OUTOFMEMORY_RETURN + 1 ) ,
D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_TOOMANYELEMENTS = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_OUTOFMEMORY + 1 ) ,
D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDFORMAT = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_TOOMANYELEMENTS + 1 ) ,
D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INCOMPATIBLEFORMAT = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDFORMAT + 1 ) ,
D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOT = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INCOMPATIBLEFORMAT + 1 ) ,
D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDINPUTSLOTCLASS = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOT + 1 ) ,
D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_STEPRATESLOTCLASSMISMATCH = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDINPUTSLOTCLASS + 1 ) ,
D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOTCLASSCHANGE = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_STEPRATESLOTCLASSMISMATCH + 1 ) ,
D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSTEPRATECHANGE = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOTCLASSCHANGE + 1 ) ,
D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDALIGNMENT = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSTEPRATECHANGE + 1 ) ,
D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_DUPLICATESEMANTIC = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDALIGNMENT + 1 ) ,
D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_DUPLICATESEMANTIC + 1 ) ,
D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_NULLSEMANTIC = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE + 1 ) ,
D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_MISSINGELEMENT = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_NULLSEMANTIC + 1 ) ,
D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_NULLDESC = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_MISSINGELEMENT + 1 ) ,
D3D10_MESSAGE_ID_CREATEVERTEXSHADER_OUTOFMEMORY = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_NULLDESC + 1 ) ,
D3D10_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERBYTECODE = ( D3D10_MESSAGE_ID_CREATEVERTEXSHADER_OUTOFMEMORY + 1 ) ,
D3D10_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERTYPE = ( D3D10_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERBYTECODE + 1 ) ,
D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_OUTOFMEMORY = ( D3D10_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERTYPE + 1 ) ,
D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERBYTECODE = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_OUTOFMEMORY + 1 ) ,
D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERTYPE = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERBYTECODE + 1 ) ,
D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTOFMEMORY = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERTYPE + 1 ) ,
D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERBYTECODE = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTOFMEMORY + 1 ) ,
D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERBYTECODE + 1 ) ,
D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMENTRIES = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE + 1 ) ,
D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSTREAMSTRIDEUNUSED = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMENTRIES + 1 ) ,
D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDDECL = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSTREAMSTRIDEUNUSED + 1 ) ,
D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_EXPECTEDDECL = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDDECL + 1 ) ,
D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSLOT0EXPECTED = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_EXPECTEDDECL + 1 ) ,
D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSLOT = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSLOT0EXPECTED + 1 ) ,
D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_ONLYONEELEMENTPERSLOT = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSLOT + 1 ) ,
D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCOMPONENTCOUNT = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_ONLYONEELEMENTPERSLOT + 1 ) ,
D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTARTCOMPONENTANDCOMPONENTCOUNT = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCOMPONENTCOUNT + 1 ) ,
D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDGAPDEFINITION = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTARTCOMPONENTANDCOMPONENTCOUNT + 1 ) ,
D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_REPEATEDOUTPUT = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDGAPDEFINITION + 1 ) ,
D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSTREAMSTRIDE = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_REPEATEDOUTPUT + 1 ) ,
D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGSEMANTIC = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSTREAMSTRIDE + 1 ) ,
D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MASKMISMATCH = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGSEMANTIC + 1 ) ,
D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_CANTHAVEONLYGAPS = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MASKMISMATCH + 1 ) ,
D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DECLTOOCOMPLEX = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_CANTHAVEONLYGAPS + 1 ) ,
D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGOUTPUTSIGNATURE = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DECLTOOCOMPLEX + 1 ) ,
D3D10_MESSAGE_ID_CREATEPIXELSHADER_OUTOFMEMORY = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGOUTPUTSIGNATURE + 1 ) ,
D3D10_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERBYTECODE = ( D3D10_MESSAGE_ID_CREATEPIXELSHADER_OUTOFMEMORY + 1 ) ,
D3D10_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERTYPE = ( D3D10_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERBYTECODE + 1 ) ,
D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFILLMODE = ( D3D10_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERTYPE + 1 ) ,
D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDCULLMODE = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFILLMODE + 1 ) ,
D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDDEPTHBIASCLAMP = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDCULLMODE + 1 ) ,
D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDSLOPESCALEDDEPTHBIAS = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDDEPTHBIASCLAMP + 1 ) ,
D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_TOOMANYOBJECTS = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDSLOPESCALEDDEPTHBIAS + 1 ) ,
D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_NULLDESC = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_TOOMANYOBJECTS + 1 ) ,
D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHWRITEMASK = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_NULLDESC + 1 ) ,
D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHFUNC = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHWRITEMASK + 1 ) ,
D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFAILOP = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHFUNC + 1 ) ,
D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILZFAILOP = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFAILOP + 1 ) ,
D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILPASSOP = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILZFAILOP + 1 ) ,
D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFUNC = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILPASSOP + 1 ) ,
D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFAILOP = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFUNC + 1 ) ,
D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILZFAILOP = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFAILOP + 1 ) ,
D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILPASSOP = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILZFAILOP + 1 ) ,
D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFUNC = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILPASSOP + 1 ) ,
D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_TOOMANYOBJECTS = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFUNC + 1 ) ,
D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_NULLDESC = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_TOOMANYOBJECTS + 1 ) ,
D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLEND = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_NULLDESC + 1 ) ,
D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLEND = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLEND + 1 ) ,
D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOP = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLEND + 1 ) ,
D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLENDALPHA = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOP + 1 ) ,
D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLENDALPHA = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLENDALPHA + 1 ) ,
D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLENDALPHA + 1 ) ,
D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA + 1 ) ,
D3D10_MESSAGE_ID_CREATEBLENDSTATE_TOOMANYOBJECTS = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK + 1 ) ,
D3D10_MESSAGE_ID_CREATEBLENDSTATE_NULLDESC = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_TOOMANYOBJECTS + 1 ) ,
D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDFILTER = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_NULLDESC + 1 ) ,
D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSU = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDFILTER + 1 ) ,
D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSV = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSU + 1 ) ,
D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSW = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSV + 1 ) ,
D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMIPLODBIAS = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSW + 1 ) ,
D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXANISOTROPY = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMIPLODBIAS + 1 ) ,
D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDCOMPARISONFUNC = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXANISOTROPY + 1 ) ,
D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMINLOD = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDCOMPARISONFUNC + 1 ) ,
D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXLOD = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMINLOD + 1 ) ,
D3D10_MESSAGE_ID_CREATESAMPLERSTATE_TOOMANYOBJECTS = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXLOD + 1 ) ,
D3D10_MESSAGE_ID_CREATESAMPLERSTATE_NULLDESC = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_TOOMANYOBJECTS + 1 ) ,
D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDQUERY = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_NULLDESC + 1 ) ,
D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDQUERY + 1 ) ,
D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_UNEXPECTEDMISCFLAG = ( D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDMISCFLAGS + 1 ) ,
D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_NULLDESC = ( D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_UNEXPECTEDMISCFLAG + 1 ) ,
D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_INVALIDBUFFER = ( D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_NULLDESC + 1 ) ,
D3D10_MESSAGE_ID_IASETINDEXBUFFERS_INVALIDBUFFER = ( D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_INVALIDBUFFER + 1 ) ,
D3D10_MESSAGE_ID_VSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D10_MESSAGE_ID_IASETINDEXBUFFERS_INVALIDBUFFER + 1 ) ,
D3D10_MESSAGE_ID_GSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D10_MESSAGE_ID_VSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) ,
D3D10_MESSAGE_ID_SOSETTARGETS_INVALIDBUFFER = ( D3D10_MESSAGE_ID_GSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) ,
D3D10_MESSAGE_ID_PSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D10_MESSAGE_ID_SOSETTARGETS_INVALIDBUFFER + 1 ) ,
D3D10_MESSAGE_ID_CLEARRENDERTARGETVIEW_DENORMFLUSH = ( D3D10_MESSAGE_ID_PSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) ,
D3D10_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DENORMFLUSH = ( D3D10_MESSAGE_ID_CLEARRENDERTARGETVIEW_DENORMFLUSH + 1 ) ,
D3D10_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_SATURATE = ( D3D10_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DENORMFLUSH + 1 ) ,
D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSUBRESOURCE = ( D3D10_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_SATURATE + 1 ) ,
D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESUBRESOURCE = ( D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSUBRESOURCE + 1 ) ,
D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCEBOX = ( D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESUBRESOURCE + 1 ) ,
D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCE = ( D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCEBOX + 1 ) ,
D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSTATE = ( D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCE + 1 ) ,
D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESTATE = ( D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSTATE + 1 ) ,
D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCE = ( D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESTATE + 1 ) ,
D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDDESTINATIONSTATE = ( D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCE + 1 ) ,
D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCESTATE = ( D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDDESTINATIONSTATE + 1 ) ,
D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSUBRESOURCE = ( D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCESTATE + 1 ) ,
D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONBOX = ( D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSUBRESOURCE + 1 ) ,
D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSTATE = ( D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONBOX + 1 ) ,
D3D10_MESSAGE_ID_BUFFER_MAP_INVALIDMAPTYPE = ( D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSTATE + 1 ) ,
D3D10_MESSAGE_ID_BUFFER_MAP_INVALIDFLAGS = ( D3D10_MESSAGE_ID_BUFFER_MAP_INVALIDMAPTYPE + 1 ) ,
D3D10_MESSAGE_ID_BUFFER_MAP_ALREADYMAPPED = ( D3D10_MESSAGE_ID_BUFFER_MAP_INVALIDFLAGS + 1 ) ,
D3D10_MESSAGE_ID_BUFFER_MAP_DEVICEREMOVED_RETURN = ( D3D10_MESSAGE_ID_BUFFER_MAP_ALREADYMAPPED + 1 ) ,
D3D10_MESSAGE_ID_BUFFER_UNMAP_NOTMAPPED = ( D3D10_MESSAGE_ID_BUFFER_MAP_DEVICEREMOVED_RETURN + 1 ) ,
D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDMAPTYPE = ( D3D10_MESSAGE_ID_BUFFER_UNMAP_NOTMAPPED + 1 ) ,
D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDSUBRESOURCE = ( D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDMAPTYPE + 1 ) ,
D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDFLAGS = ( D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDSUBRESOURCE + 1 ) ,
D3D10_MESSAGE_ID_TEXTURE1D_MAP_ALREADYMAPPED = ( D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDFLAGS + 1 ) ,
D3D10_MESSAGE_ID_TEXTURE1D_MAP_DEVICEREMOVED_RETURN = ( D3D10_MESSAGE_ID_TEXTURE1D_MAP_ALREADYMAPPED + 1 ) ,
D3D10_MESSAGE_ID_TEXTURE1D_UNMAP_INVALIDSUBRESOURCE = ( D3D10_MESSAGE_ID_TEXTURE1D_MAP_DEVICEREMOVED_RETURN + 1 ) ,
D3D10_MESSAGE_ID_TEXTURE1D_UNMAP_NOTMAPPED = ( D3D10_MESSAGE_ID_TEXTURE1D_UNMAP_INVALIDSUBRESOURCE + 1 ) ,
D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDMAPTYPE = ( D3D10_MESSAGE_ID_TEXTURE1D_UNMAP_NOTMAPPED + 1 ) ,
D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDSUBRESOURCE = ( D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDMAPTYPE + 1 ) ,
D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDFLAGS = ( D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDSUBRESOURCE + 1 ) ,
D3D10_MESSAGE_ID_TEXTURE2D_MAP_ALREADYMAPPED = ( D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDFLAGS + 1 ) ,
D3D10_MESSAGE_ID_TEXTURE2D_MAP_DEVICEREMOVED_RETURN = ( D3D10_MESSAGE_ID_TEXTURE2D_MAP_ALREADYMAPPED + 1 ) ,
D3D10_MESSAGE_ID_TEXTURE2D_UNMAP_INVALIDSUBRESOURCE = ( D3D10_MESSAGE_ID_TEXTURE2D_MAP_DEVICEREMOVED_RETURN + 1 ) ,
D3D10_MESSAGE_ID_TEXTURE2D_UNMAP_NOTMAPPED = ( D3D10_MESSAGE_ID_TEXTURE2D_UNMAP_INVALIDSUBRESOURCE + 1 ) ,
D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDMAPTYPE = ( D3D10_MESSAGE_ID_TEXTURE2D_UNMAP_NOTMAPPED + 1 ) ,
D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDSUBRESOURCE = ( D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDMAPTYPE + 1 ) ,
D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDFLAGS = ( D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDSUBRESOURCE + 1 ) ,
D3D10_MESSAGE_ID_TEXTURE3D_MAP_ALREADYMAPPED = ( D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDFLAGS + 1 ) ,
D3D10_MESSAGE_ID_TEXTURE3D_MAP_DEVICEREMOVED_RETURN = ( D3D10_MESSAGE_ID_TEXTURE3D_MAP_ALREADYMAPPED + 1 ) ,
D3D10_MESSAGE_ID_TEXTURE3D_UNMAP_INVALIDSUBRESOURCE = ( D3D10_MESSAGE_ID_TEXTURE3D_MAP_DEVICEREMOVED_RETURN + 1 ) ,
D3D10_MESSAGE_ID_TEXTURE3D_UNMAP_NOTMAPPED = ( D3D10_MESSAGE_ID_TEXTURE3D_UNMAP_INVALIDSUBRESOURCE + 1 ) ,
D3D10_MESSAGE_ID_TEXTURECUBE_MAP_INVALIDMAPTYPE = ( D3D10_MESSAGE_ID_TEXTURE3D_UNMAP_NOTMAPPED + 1 ) ,
D3D10_MESSAGE_ID_TEXTURECUBE_MAP_INVALIDSUBRESOURCE = ( D3D10_MESSAGE_ID_TEXTURECUBE_MAP_INVALIDMAPTYPE + 1 ) ,
D3D10_MESSAGE_ID_TEXTURECUBE_MAP_INVALIDFLAGS = ( D3D10_MESSAGE_ID_TEXTURECUBE_MAP_INVALIDSUBRESOURCE + 1 ) ,
D3D10_MESSAGE_ID_TEXTURECUBE_MAP_ALREADYMAPPED = ( D3D10_MESSAGE_ID_TEXTURECUBE_MAP_INVALIDFLAGS + 1 ) ,
D3D10_MESSAGE_ID_TEXTURECUBE_MAP_DEVICEREMOVED_RETURN = ( D3D10_MESSAGE_ID_TEXTURECUBE_MAP_ALREADYMAPPED + 1 ) ,
D3D10_MESSAGE_ID_TEXTURECUBE_UNMAP_INVALIDSUBRESOURCE = ( D3D10_MESSAGE_ID_TEXTURECUBE_MAP_DEVICEREMOVED_RETURN + 1 ) ,
D3D10_MESSAGE_ID_TEXTURECUBE_UNMAP_NOTMAPPED = ( D3D10_MESSAGE_ID_TEXTURECUBE_UNMAP_INVALIDSUBRESOURCE + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_HAZARD = ( D3D10_MESSAGE_ID_TEXTURECUBE_UNMAP_NOTMAPPED + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_HAZARD + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_HAZARD + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_HAZARD + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_HAZARD + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_HAZARD + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_HAZARD + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_HAZARD + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_OMSETRENDERTARGETS_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_HAZARD + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_SOSETTARGETS_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_OMSETRENDERTARGETS_HAZARD + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEXPOS_OVERFLOW = ( D3D10_MESSAGE_ID_DEVICE_SOSETTARGETS_HAZARD + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_DRAWINDEXED_INDEXPOS_OVERFLOW = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEXPOS_OVERFLOW + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_DRAWINSTANCED_VERTEXPOS_OVERFLOW = ( D3D10_MESSAGE_ID_DEVICE_DRAWINDEXED_INDEXPOS_OVERFLOW + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_DRAWINSTANCED_INSTANCEPOS_OVERFLOW = ( D3D10_MESSAGE_ID_DEVICE_DRAWINSTANCED_VERTEXPOS_OVERFLOW + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INSTANCEPOS_OVERFLOW = ( D3D10_MESSAGE_ID_DEVICE_DRAWINSTANCED_INSTANCEPOS_OVERFLOW + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INDEXPOS_OVERFLOW = ( D3D10_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INSTANCEPOS_OVERFLOW + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_SHADER_MISSING = ( D3D10_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INDEXPOS_OVERFLOW + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_SHADER_MISSING + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERINDEX = ( D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_COMPONENTTYPE = ( D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERINDEX + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERMASK = ( D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_COMPONENTTYPE + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SYSTEMVALUE = ( D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERMASK + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS = ( D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SYSTEMVALUE + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_DRAW_INPUTLAYOUT_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_NOT_SET + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_DRAW_INPUTLAYOUT_NOT_SET + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_TOO_SMALL = ( D3D10_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_NOT_SET + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_DRAW_SAMPLER_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_TOO_SMALL + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_DRAW_SAMPLER_NOT_SET + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_DIMENSION_MISMATCH = ( D3D10_MESSAGE_ID_DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_STRIDE_TOO_SMALL = ( D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_DIMENSION_MISMATCH + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_TOO_SMALL = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_STRIDE_TOO_SMALL + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_TOO_SMALL + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_FORMAT_INVALID = ( D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_NOT_SET + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_TOO_SMALL = ( D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_FORMAT_INVALID + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_DRAW_GS_INPUT_PRIMITIVE_MISMATCH = ( D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_TOO_SMALL + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_RETURN_TYPE_MISMATCH = ( D3D10_MESSAGE_ID_DEVICE_DRAW_GS_INPUT_PRIMITIVE_MISMATCH + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_DRAW_POSITION_NOT_PRESENT = ( D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_RETURN_TYPE_MISMATCH + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_NOT_PRESENT = ( D3D10_MESSAGE_ID_DEVICE_DRAW_POSITION_NOT_PRESENT + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_DRAW_BOUND_RESOURCE_MAPPED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_NOT_PRESENT + 1 ) ,
D3D10_MESSAGE_ID_SETEXCEPTIONMODE_UNRECOGNIZEDFLAGS = ( D3D10_MESSAGE_ID_DEVICE_DRAW_BOUND_RESOURCE_MAPPED + 1 ) ,
D3D10_MESSAGE_ID_SETEXCEPTIONMODE_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_SETEXCEPTIONMODE_UNRECOGNIZEDFLAGS + 1 ) ,
D3D10_MESSAGE_ID_SETEXCEPTIONMODE_DEVICEREMOVED_RETURN = ( D3D10_MESSAGE_ID_SETEXCEPTIONMODE_INVALIDARG_RETURN + 1 ) ,
D3D10_MESSAGE_ID_REF_SIMULATING_INFINITELY_FAST_HARDWARE = ( D3D10_MESSAGE_ID_SETEXCEPTIONMODE_DEVICEREMOVED_RETURN + 1 ) ,
D3D10_MESSAGE_ID_REF_THREADING_MODE = ( D3D10_MESSAGE_ID_REF_SIMULATING_INFINITELY_FAST_HARDWARE + 1 ) ,
D3D10_MESSAGE_ID_REF_UMDRIVER_EXCEPTION = ( D3D10_MESSAGE_ID_REF_THREADING_MODE + 1 ) ,
D3D10_MESSAGE_ID_REF_KMDRIVER_EXCEPTION = ( D3D10_MESSAGE_ID_REF_UMDRIVER_EXCEPTION + 1 ) ,
D3D10_MESSAGE_ID_REF_HARDWARE_EXCEPTION = ( D3D10_MESSAGE_ID_REF_KMDRIVER_EXCEPTION + 1 ) ,
D3D10_MESSAGE_ID_REF_ACCESSING_INDEXABLE_TEMP_OUT_OF_RANGE = ( D3D10_MESSAGE_ID_REF_HARDWARE_EXCEPTION + 1 ) ,
D3D10_MESSAGE_ID_REF_PROBLEM_PARSING_SHADER = ( D3D10_MESSAGE_ID_REF_ACCESSING_INDEXABLE_TEMP_OUT_OF_RANGE + 1 ) ,
D3D10_MESSAGE_ID_REF_OUT_OF_MEMORY = ( D3D10_MESSAGE_ID_REF_PROBLEM_PARSING_SHADER + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_DRAW_INVALID_PRIMITIVETOPOLOGY = ( D3D10_MESSAGE_ID_REF_OUT_OF_MEMORY + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_OFFSET_UNALIGNED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_INVALID_PRIMITIVETOPOLOGY + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_STRIDE_UNALIGNED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_OFFSET_UNALIGNED + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_OFFSET_UNALIGNED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_STRIDE_UNALIGNED + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_OFFSET_UNALIGNED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_OFFSET_UNALIGNED + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_LD_UNSUPPORTED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_OFFSET_UNALIGNED + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_UNSUPPORTED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_LD_UNSUPPORTED + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_C_UNSUPPORTED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_UNSUPPORTED + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_MULTISAMPLE_UNSUPPORTED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_C_UNSUPPORTED + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNRECOGNIZED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_MULTISAMPLE_UNSUPPORTED + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNDEFINED = ( D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNRECOGNIZED + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_OFFSET_TOO_LARGE = ( D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNDEFINED + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_FORMAT_INVALID = ( D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_OFFSET_TOO_LARGE + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_TOO_LARGE = ( D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_FORMAT_INVALID + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_UNALIGNED = ( D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_TOO_LARGE + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_SOSETTARGETS_OFFSET_UNALIGNED = ( D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_UNALIGNED + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_GENERATEMIPS_RESOURCE_INVALID = ( D3D10_MESSAGE_ID_DEVICE_SOSETTARGETS_OFFSET_UNALIGNED + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_GENERATEMIPS_RESOURCE_INVALID + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_BUFFERS_EMPTY + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_VSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_VSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_GSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_GSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_PSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_IAGETVERTEXBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_PSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_VSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_IAGETVERTEXBUFFERS_BUFFERS_EMPTY + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_VSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_VSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_VSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_VSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_GSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_VSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_GSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_GSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_GSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_GSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_SOGETTARGETS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_GSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_PSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_SOGETTARGETS_BUFFERS_EMPTY + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_PSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_PSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_PSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_PSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_RSGETVIEWPORTS_VIEWPORTS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_PSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
D3D10_MESSAGE_ID_DEVICE_RSGETSCISSORRECTS_RECTS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_RSGETVIEWPORTS_VIEWPORTS_EMPTY + 1 )
} D3D10_MESSAGE_ID;
typedef struct D3D10_MESSAGE
{
D3D10_MESSAGE_CATEGORY Category;
D3D10_MESSAGE_SEVERITY Severity;
D3D10_MESSAGE_ID ID;
const WCHAR *pDescription;
SIZE_T DescriptionByteLength;
} D3D10_MESSAGE;
typedef struct D3D10_INFO_QUEUE_FILTER_DESC
{
UINT NumCategories;
D3D10_MESSAGE_CATEGORY *pCategoryList;
UINT NumSeverities;
D3D10_MESSAGE_SEVERITY *pSeverityList;
UINT NumIDs;
D3D10_MESSAGE_ID *pIDList;
} D3D10_INFO_QUEUE_FILTER_DESC;
typedef struct D3D10_INFO_QUEUE_FILTER
{
D3D10_INFO_QUEUE_FILTER_DESC AllowList;
D3D10_INFO_QUEUE_FILTER_DESC DenyList;
} D3D10_INFO_QUEUE_FILTER;
#define D3D10_INFO_QUEUE_DEFAULT_MESSAGE_COUNT_LIMIT 1024
extern RPC_IF_HANDLE __MIDL_itf_d3d10sdklayers_0000_0001_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_d3d10sdklayers_0000_0001_v0_0_s_ifspec;
#ifndef __ID3D10InfoQueue_INTERFACE_DEFINED__
#define __ID3D10InfoQueue_INTERFACE_DEFINED__
/* interface ID3D10InfoQueue */
/* [unique][local][object][uuid] */
EXTERN_C const IID IID_ID3D10InfoQueue;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("1b940b17-2642-4d1f-ab1f-b99bad0c395f")
ID3D10InfoQueue : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE SetMessageCountLimit(
/* */
__in UINT64 MessageCountLimit) = 0;
virtual void STDMETHODCALLTYPE ClearStoredMessages( void) = 0;
virtual HRESULT STDMETHODCALLTYPE GetMessage(
/* */
__in UINT64 MessageIndex,
/* */
__out_bcount_opt(*pMessageByteLength) D3D10_MESSAGE *pMessage,
/* */
__inout SIZE_T *pMessageByteLength) = 0;
virtual UINT64 STDMETHODCALLTYPE GetNumMessagesAllowedByStorageFilter( void) = 0;
virtual UINT64 STDMETHODCALLTYPE GetNumMessagesDeniedByStorageFilter( void) = 0;
virtual UINT64 STDMETHODCALLTYPE GetNumStoredMessages( void) = 0;
virtual UINT64 STDMETHODCALLTYPE GetNumStoredMessagesAllowedByRetrievalFilter( void) = 0;
virtual UINT64 STDMETHODCALLTYPE GetNumMessagesDiscardedByMessageCountLimit( void) = 0;
virtual UINT64 STDMETHODCALLTYPE GetMessageCountLimit( void) = 0;
virtual HRESULT STDMETHODCALLTYPE AddStorageFilterEntries(
/* */
__in D3D10_INFO_QUEUE_FILTER *pFilter) = 0;
virtual HRESULT STDMETHODCALLTYPE GetStorageFilter(
/* */
__out_bcount_opt(*pFilterByteLength) D3D10_INFO_QUEUE_FILTER *pFilter,
/* */
__inout SIZE_T *pFilterByteLength) = 0;
virtual void STDMETHODCALLTYPE ClearStorageFilter( void) = 0;
virtual HRESULT STDMETHODCALLTYPE PushEmptyStorageFilter( void) = 0;
virtual HRESULT STDMETHODCALLTYPE PushCopyOfStorageFilter( void) = 0;
virtual HRESULT STDMETHODCALLTYPE PushStorageFilter(
/* */
__in D3D10_INFO_QUEUE_FILTER *pFilter) = 0;
virtual void STDMETHODCALLTYPE PopStorageFilter( void) = 0;
virtual UINT STDMETHODCALLTYPE GetStorageFilterStackSize( void) = 0;
virtual HRESULT STDMETHODCALLTYPE AddRetrievalFilterEntries(
/* */
__in D3D10_INFO_QUEUE_FILTER *pFilter) = 0;
virtual HRESULT STDMETHODCALLTYPE GetRetrievalFilter(
/* */
__out_bcount_opt(*pFilterByteLength) D3D10_INFO_QUEUE_FILTER *pFilter,
/* */
__inout SIZE_T *pFilterByteLength) = 0;
virtual void STDMETHODCALLTYPE ClearRetrievalFilter( void) = 0;
virtual HRESULT STDMETHODCALLTYPE PushEmptyRetrievalFilter( void) = 0;
virtual HRESULT STDMETHODCALLTYPE PushCopyOfRetrievalFilter( void) = 0;
virtual HRESULT STDMETHODCALLTYPE PushRetrievalFilter(
/* */
__in D3D10_INFO_QUEUE_FILTER *pFilter) = 0;
virtual void STDMETHODCALLTYPE PopRetrievalFilter( void) = 0;
virtual UINT STDMETHODCALLTYPE GetRetrievalFilterStackSize( void) = 0;
virtual HRESULT STDMETHODCALLTYPE AddMessage(
/* */
__in D3D10_MESSAGE_CATEGORY Category,
/* */
__in D3D10_MESSAGE_SEVERITY Severity,
/* */
__in D3D10_MESSAGE_ID ID,
/* */
__in LPCWSTR pDescription) = 0;
virtual HRESULT STDMETHODCALLTYPE AddApplicationMessage(
/* */
__in D3D10_MESSAGE_SEVERITY Severity,
/* */
__in LPCWSTR pDescription) = 0;
};
#else /* C style interface */
typedef struct ID3D10InfoQueueVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D10InfoQueue * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D10InfoQueue * This);
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D10InfoQueue * This);
HRESULT ( STDMETHODCALLTYPE *SetMessageCountLimit )(
ID3D10InfoQueue * This,
/* */
__in UINT64 MessageCountLimit);
void ( STDMETHODCALLTYPE *ClearStoredMessages )(
ID3D10InfoQueue * This);
HRESULT ( STDMETHODCALLTYPE *GetMessage )(
ID3D10InfoQueue * This,
/* */
__in UINT64 MessageIndex,
/* */
__out_bcount_opt(*pMessageByteLength) D3D10_MESSAGE *pMessage,
/* */
__inout SIZE_T *pMessageByteLength);
UINT64 ( STDMETHODCALLTYPE *GetNumMessagesAllowedByStorageFilter )(
ID3D10InfoQueue * This);
UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDeniedByStorageFilter )(
ID3D10InfoQueue * This);
UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessages )(
ID3D10InfoQueue * This);
UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessagesAllowedByRetrievalFilter )(
ID3D10InfoQueue * This);
UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDiscardedByMessageCountLimit )(
ID3D10InfoQueue * This);
UINT64 ( STDMETHODCALLTYPE *GetMessageCountLimit )(
ID3D10InfoQueue * This);
HRESULT ( STDMETHODCALLTYPE *AddStorageFilterEntries )(
ID3D10InfoQueue * This,
/* */
__in D3D10_INFO_QUEUE_FILTER *pFilter);
HRESULT ( STDMETHODCALLTYPE *GetStorageFilter )(
ID3D10InfoQueue * This,
/* */
__out_bcount_opt(*pFilterByteLength) D3D10_INFO_QUEUE_FILTER *pFilter,
/* */
__inout SIZE_T *pFilterByteLength);
void ( STDMETHODCALLTYPE *ClearStorageFilter )(
ID3D10InfoQueue * This);
HRESULT ( STDMETHODCALLTYPE *PushEmptyStorageFilter )(
ID3D10InfoQueue * This);
HRESULT ( STDMETHODCALLTYPE *PushCopyOfStorageFilter )(
ID3D10InfoQueue * This);
HRESULT ( STDMETHODCALLTYPE *PushStorageFilter )(
ID3D10InfoQueue * This,
/* */
__in D3D10_INFO_QUEUE_FILTER *pFilter);
void ( STDMETHODCALLTYPE *PopStorageFilter )(
ID3D10InfoQueue * This);
UINT ( STDMETHODCALLTYPE *GetStorageFilterStackSize )(
ID3D10InfoQueue * This);
HRESULT ( STDMETHODCALLTYPE *AddRetrievalFilterEntries )(
ID3D10InfoQueue * This,
/* */
__in D3D10_INFO_QUEUE_FILTER *pFilter);
HRESULT ( STDMETHODCALLTYPE *GetRetrievalFilter )(
ID3D10InfoQueue * This,
/* */
__out_bcount_opt(*pFilterByteLength) D3D10_INFO_QUEUE_FILTER *pFilter,
/* */
__inout SIZE_T *pFilterByteLength);
void ( STDMETHODCALLTYPE *ClearRetrievalFilter )(
ID3D10InfoQueue * This);
HRESULT ( STDMETHODCALLTYPE *PushEmptyRetrievalFilter )(
ID3D10InfoQueue * This);
HRESULT ( STDMETHODCALLTYPE *PushCopyOfRetrievalFilter )(
ID3D10InfoQueue * This);
HRESULT ( STDMETHODCALLTYPE *PushRetrievalFilter )(
ID3D10InfoQueue * This,
/* */
__in D3D10_INFO_QUEUE_FILTER *pFilter);
void ( STDMETHODCALLTYPE *PopRetrievalFilter )(
ID3D10InfoQueue * This);
UINT ( STDMETHODCALLTYPE *GetRetrievalFilterStackSize )(
ID3D10InfoQueue * This);
HRESULT ( STDMETHODCALLTYPE *AddMessage )(
ID3D10InfoQueue * This,
/* */
__in D3D10_MESSAGE_CATEGORY Category,
/* */
__in D3D10_MESSAGE_SEVERITY Severity,
/* */
__in D3D10_MESSAGE_ID ID,
/* */
__in LPCWSTR pDescription);
HRESULT ( STDMETHODCALLTYPE *AddApplicationMessage )(
ID3D10InfoQueue * This,
/* */
__in D3D10_MESSAGE_SEVERITY Severity,
/* */
__in LPCWSTR pDescription);
END_INTERFACE
} ID3D10InfoQueueVtbl;
interface ID3D10InfoQueue
{
CONST_VTBL struct ID3D10InfoQueueVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define ID3D10InfoQueue_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define ID3D10InfoQueue_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define ID3D10InfoQueue_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define ID3D10InfoQueue_SetMessageCountLimit(This,MessageCountLimit) \
( (This)->lpVtbl -> SetMessageCountLimit(This,MessageCountLimit) )
#define ID3D10InfoQueue_ClearStoredMessages(This) \
( (This)->lpVtbl -> ClearStoredMessages(This) )
#define ID3D10InfoQueue_GetMessage(This,MessageIndex,pMessage,pMessageByteLength) \
( (This)->lpVtbl -> GetMessage(This,MessageIndex,pMessage,pMessageByteLength) )
#define ID3D10InfoQueue_GetNumMessagesAllowedByStorageFilter(This) \
( (This)->lpVtbl -> GetNumMessagesAllowedByStorageFilter(This) )
#define ID3D10InfoQueue_GetNumMessagesDeniedByStorageFilter(This) \
( (This)->lpVtbl -> GetNumMessagesDeniedByStorageFilter(This) )
#define ID3D10InfoQueue_GetNumStoredMessages(This) \
( (This)->lpVtbl -> GetNumStoredMessages(This) )
#define ID3D10InfoQueue_GetNumStoredMessagesAllowedByRetrievalFilter(This) \
( (This)->lpVtbl -> GetNumStoredMessagesAllowedByRetrievalFilter(This) )
#define ID3D10InfoQueue_GetNumMessagesDiscardedByMessageCountLimit(This) \
( (This)->lpVtbl -> GetNumMessagesDiscardedByMessageCountLimit(This) )
#define ID3D10InfoQueue_GetMessageCountLimit(This) \
( (This)->lpVtbl -> GetMessageCountLimit(This) )
#define ID3D10InfoQueue_AddStorageFilterEntries(This,pFilter) \
( (This)->lpVtbl -> AddStorageFilterEntries(This,pFilter) )
#define ID3D10InfoQueue_GetStorageFilter(This,pFilter,pFilterByteLength) \
( (This)->lpVtbl -> GetStorageFilter(This,pFilter,pFilterByteLength) )
#define ID3D10InfoQueue_ClearStorageFilter(This) \
( (This)->lpVtbl -> ClearStorageFilter(This) )
#define ID3D10InfoQueue_PushEmptyStorageFilter(This) \
( (This)->lpVtbl -> PushEmptyStorageFilter(This) )
#define ID3D10InfoQueue_PushCopyOfStorageFilter(This) \
( (This)->lpVtbl -> PushCopyOfStorageFilter(This) )
#define ID3D10InfoQueue_PushStorageFilter(This,pFilter) \
( (This)->lpVtbl -> PushStorageFilter(This,pFilter) )
#define ID3D10InfoQueue_PopStorageFilter(This) \
( (This)->lpVtbl -> PopStorageFilter(This) )
#define ID3D10InfoQueue_GetStorageFilterStackSize(This) \
( (This)->lpVtbl -> GetStorageFilterStackSize(This) )
#define ID3D10InfoQueue_AddRetrievalFilterEntries(This,pFilter) \
( (This)->lpVtbl -> AddRetrievalFilterEntries(This,pFilter) )
#define ID3D10InfoQueue_GetRetrievalFilter(This,pFilter,pFilterByteLength) \
( (This)->lpVtbl -> GetRetrievalFilter(This,pFilter,pFilterByteLength) )
#define ID3D10InfoQueue_ClearRetrievalFilter(This) \
( (This)->lpVtbl -> ClearRetrievalFilter(This) )
#define ID3D10InfoQueue_PushEmptyRetrievalFilter(This) \
( (This)->lpVtbl -> PushEmptyRetrievalFilter(This) )
#define ID3D10InfoQueue_PushCopyOfRetrievalFilter(This) \
( (This)->lpVtbl -> PushCopyOfRetrievalFilter(This) )
#define ID3D10InfoQueue_PushRetrievalFilter(This,pFilter) \
( (This)->lpVtbl -> PushRetrievalFilter(This,pFilter) )
#define ID3D10InfoQueue_PopRetrievalFilter(This) \
( (This)->lpVtbl -> PopRetrievalFilter(This) )
#define ID3D10InfoQueue_GetRetrievalFilterStackSize(This) \
( (This)->lpVtbl -> GetRetrievalFilterStackSize(This) )
#define ID3D10InfoQueue_AddMessage(This,Category,Severity,ID,pDescription) \
( (This)->lpVtbl -> AddMessage(This,Category,Severity,ID,pDescription) )
#define ID3D10InfoQueue_AddApplicationMessage(This,Severity,pDescription) \
( (This)->lpVtbl -> AddApplicationMessage(This,Severity,pDescription) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __ID3D10InfoQueue_INTERFACE_DEFINED__ */
/* Additional Prototypes for ALL interfaces */
/* end of Additional Prototypes */
#ifdef __cplusplus
}
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,364 @@
/*==========================================================================;
*
* Copyright (C) Microsoft Corporation. All Rights Reserved.
*
* File: d3d8caps.h
* Content: Direct3D capabilities include file
*
***************************************************************************/
#ifndef _D3D8CAPS_H
#define _D3D8CAPS_H
#ifndef DIRECT3D_VERSION
#define DIRECT3D_VERSION 0x0800
#endif //DIRECT3D_VERSION
// include this file content only if compiling for DX8 interfaces
#if(DIRECT3D_VERSION >= 0x0800)
#if defined(_X86_) || defined(_IA64_)
#pragma pack(4)
#endif
typedef struct _D3DCAPS8
{
/* Device Info */
D3DDEVTYPE DeviceType;
UINT AdapterOrdinal;
/* Caps from DX7 Draw */
DWORD Caps;
DWORD Caps2;
DWORD Caps3;
DWORD PresentationIntervals;
/* Cursor Caps */
DWORD CursorCaps;
/* 3D Device Caps */
DWORD DevCaps;
DWORD PrimitiveMiscCaps;
DWORD RasterCaps;
DWORD ZCmpCaps;
DWORD SrcBlendCaps;
DWORD DestBlendCaps;
DWORD AlphaCmpCaps;
DWORD ShadeCaps;
DWORD TextureCaps;
DWORD TextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DTexture8's
DWORD CubeTextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DCubeTexture8's
DWORD VolumeTextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DVolumeTexture8's
DWORD TextureAddressCaps; // D3DPTADDRESSCAPS for IDirect3DTexture8's
DWORD VolumeTextureAddressCaps; // D3DPTADDRESSCAPS for IDirect3DVolumeTexture8's
DWORD LineCaps; // D3DLINECAPS
DWORD MaxTextureWidth, MaxTextureHeight;
DWORD MaxVolumeExtent;
DWORD MaxTextureRepeat;
DWORD MaxTextureAspectRatio;
DWORD MaxAnisotropy;
float MaxVertexW;
float GuardBandLeft;
float GuardBandTop;
float GuardBandRight;
float GuardBandBottom;
float ExtentsAdjust;
DWORD StencilCaps;
DWORD FVFCaps;
DWORD TextureOpCaps;
DWORD MaxTextureBlendStages;
DWORD MaxSimultaneousTextures;
DWORD VertexProcessingCaps;
DWORD MaxActiveLights;
DWORD MaxUserClipPlanes;
DWORD MaxVertexBlendMatrices;
DWORD MaxVertexBlendMatrixIndex;
float MaxPointSize;
DWORD MaxPrimitiveCount; // max number of primitives per DrawPrimitive call
DWORD MaxVertexIndex;
DWORD MaxStreams;
DWORD MaxStreamStride; // max stride for SetStreamSource
DWORD VertexShaderVersion;
DWORD MaxVertexShaderConst; // number of vertex shader constant registers
DWORD PixelShaderVersion;
float MaxPixelShaderValue; // max value of pixel shader arithmetic component
} D3DCAPS8;
//
// BIT DEFINES FOR D3DCAPS8 DWORD MEMBERS
//
//
// Caps
//
#define D3DCAPS_READ_SCANLINE 0x00020000L
//
// Caps2
//
#define D3DCAPS2_NO2DDURING3DSCENE 0x00000002L
#define D3DCAPS2_FULLSCREENGAMMA 0x00020000L
#define D3DCAPS2_CANRENDERWINDOWED 0x00080000L
#define D3DCAPS2_CANCALIBRATEGAMMA 0x00100000L
#define D3DCAPS2_RESERVED 0x02000000L
#define D3DCAPS2_CANMANAGERESOURCE 0x10000000L
#define D3DCAPS2_DYNAMICTEXTURES 0x20000000L
//
// Caps3
//
#define D3DCAPS3_RESERVED 0x8000001fL
// Indicates that the device can respect the ALPHABLENDENABLE render state
// when fullscreen while using the FLIP or DISCARD swap effect.
// COPY and COPYVSYNC swap effects work whether or not this flag is set.
#define D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD 0x00000020L
//
// PresentationIntervals
//
#define D3DPRESENT_INTERVAL_DEFAULT 0x00000000L
#define D3DPRESENT_INTERVAL_ONE 0x00000001L
#define D3DPRESENT_INTERVAL_TWO 0x00000002L
#define D3DPRESENT_INTERVAL_THREE 0x00000004L
#define D3DPRESENT_INTERVAL_FOUR 0x00000008L
#define D3DPRESENT_INTERVAL_IMMEDIATE 0x80000000L
//
// CursorCaps
//
// Driver supports HW color cursor in at least hi-res modes(height >=400)
#define D3DCURSORCAPS_COLOR 0x00000001L
// Driver supports HW cursor also in low-res modes(height < 400)
#define D3DCURSORCAPS_LOWRES 0x00000002L
//
// DevCaps
//
#define D3DDEVCAPS_EXECUTESYSTEMMEMORY 0x00000010L /* Device can use execute buffers from system memory */
#define D3DDEVCAPS_EXECUTEVIDEOMEMORY 0x00000020L /* Device can use execute buffers from video memory */
#define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY 0x00000040L /* Device can use TL buffers from system memory */
#define D3DDEVCAPS_TLVERTEXVIDEOMEMORY 0x00000080L /* Device can use TL buffers from video memory */
#define D3DDEVCAPS_TEXTURESYSTEMMEMORY 0x00000100L /* Device can texture from system memory */
#define D3DDEVCAPS_TEXTUREVIDEOMEMORY 0x00000200L /* Device can texture from device memory */
#define D3DDEVCAPS_DRAWPRIMTLVERTEX 0x00000400L /* Device can draw TLVERTEX primitives */
#define D3DDEVCAPS_CANRENDERAFTERFLIP 0x00000800L /* Device can render without waiting for flip to complete */
#define D3DDEVCAPS_TEXTURENONLOCALVIDMEM 0x00001000L /* Device can texture from nonlocal video memory */
#define D3DDEVCAPS_DRAWPRIMITIVES2 0x00002000L /* Device can support DrawPrimitives2 */
#define D3DDEVCAPS_SEPARATETEXTUREMEMORIES 0x00004000L /* Device is texturing from separate memory pools */
#define D3DDEVCAPS_DRAWPRIMITIVES2EX 0x00008000L /* Device can support Extended DrawPrimitives2 i.e. DX7 compliant driver*/
#define D3DDEVCAPS_HWTRANSFORMANDLIGHT 0x00010000L /* Device can support transformation and lighting in hardware and DRAWPRIMITIVES2EX must be also */
#define D3DDEVCAPS_CANBLTSYSTONONLOCAL 0x00020000L /* Device supports a Tex Blt from system memory to non-local vidmem */
#define D3DDEVCAPS_HWRASTERIZATION 0x00080000L /* Device has HW acceleration for rasterization */
#define D3DDEVCAPS_PUREDEVICE 0x00100000L /* Device supports D3DCREATE_PUREDEVICE */
#define D3DDEVCAPS_QUINTICRTPATCHES 0x00200000L /* Device supports quintic Beziers and BSplines */
#define D3DDEVCAPS_RTPATCHES 0x00400000L /* Device supports Rect and Tri patches */
#define D3DDEVCAPS_RTPATCHHANDLEZERO 0x00800000L /* Indicates that RT Patches may be drawn efficiently using handle 0 */
#define D3DDEVCAPS_NPATCHES 0x01000000L /* Device supports N-Patches */
//
// PrimitiveMiscCaps
//
#define D3DPMISCCAPS_MASKZ 0x00000002L
#define D3DPMISCCAPS_LINEPATTERNREP 0x00000004L
#define D3DPMISCCAPS_CULLNONE 0x00000010L
#define D3DPMISCCAPS_CULLCW 0x00000020L
#define D3DPMISCCAPS_CULLCCW 0x00000040L
#define D3DPMISCCAPS_COLORWRITEENABLE 0x00000080L
#define D3DPMISCCAPS_CLIPPLANESCALEDPOINTS 0x00000100L /* Device correctly clips scaled points to clip planes */
#define D3DPMISCCAPS_CLIPTLVERTS 0x00000200L /* device will clip post-transformed vertex primitives */
#define D3DPMISCCAPS_TSSARGTEMP 0x00000400L /* device supports D3DTA_TEMP for temporary register */
#define D3DPMISCCAPS_BLENDOP 0x00000800L /* device supports D3DRS_BLENDOP */
#define D3DPMISCCAPS_NULLREFERENCE 0x00001000L /* Reference Device that doesnt render */
//
// LineCaps
//
#define D3DLINECAPS_TEXTURE 0x00000001L
#define D3DLINECAPS_ZTEST 0x00000002L
#define D3DLINECAPS_BLEND 0x00000004L
#define D3DLINECAPS_ALPHACMP 0x00000008L
#define D3DLINECAPS_FOG 0x00000010L
//
// RasterCaps
//
#define D3DPRASTERCAPS_DITHER 0x00000001L
#define D3DPRASTERCAPS_PAT 0x00000008L
#define D3DPRASTERCAPS_ZTEST 0x00000010L
#define D3DPRASTERCAPS_FOGVERTEX 0x00000080L
#define D3DPRASTERCAPS_FOGTABLE 0x00000100L
#define D3DPRASTERCAPS_ANTIALIASEDGES 0x00001000L
#define D3DPRASTERCAPS_MIPMAPLODBIAS 0x00002000L
#define D3DPRASTERCAPS_ZBIAS 0x00004000L
#define D3DPRASTERCAPS_ZBUFFERLESSHSR 0x00008000L
#define D3DPRASTERCAPS_FOGRANGE 0x00010000L
#define D3DPRASTERCAPS_ANISOTROPY 0x00020000L
#define D3DPRASTERCAPS_WBUFFER 0x00040000L
#define D3DPRASTERCAPS_WFOG 0x00100000L
#define D3DPRASTERCAPS_ZFOG 0x00200000L
#define D3DPRASTERCAPS_COLORPERSPECTIVE 0x00400000L /* Device iterates colors perspective correct */
#define D3DPRASTERCAPS_STRETCHBLTMULTISAMPLE 0x00800000L
//
// ZCmpCaps, AlphaCmpCaps
//
#define D3DPCMPCAPS_NEVER 0x00000001L
#define D3DPCMPCAPS_LESS 0x00000002L
#define D3DPCMPCAPS_EQUAL 0x00000004L
#define D3DPCMPCAPS_LESSEQUAL 0x00000008L
#define D3DPCMPCAPS_GREATER 0x00000010L
#define D3DPCMPCAPS_NOTEQUAL 0x00000020L
#define D3DPCMPCAPS_GREATEREQUAL 0x00000040L
#define D3DPCMPCAPS_ALWAYS 0x00000080L
//
// SourceBlendCaps, DestBlendCaps
//
#define D3DPBLENDCAPS_ZERO 0x00000001L
#define D3DPBLENDCAPS_ONE 0x00000002L
#define D3DPBLENDCAPS_SRCCOLOR 0x00000004L
#define D3DPBLENDCAPS_INVSRCCOLOR 0x00000008L
#define D3DPBLENDCAPS_SRCALPHA 0x00000010L
#define D3DPBLENDCAPS_INVSRCALPHA 0x00000020L
#define D3DPBLENDCAPS_DESTALPHA 0x00000040L
#define D3DPBLENDCAPS_INVDESTALPHA 0x00000080L
#define D3DPBLENDCAPS_DESTCOLOR 0x00000100L
#define D3DPBLENDCAPS_INVDESTCOLOR 0x00000200L
#define D3DPBLENDCAPS_SRCALPHASAT 0x00000400L
#define D3DPBLENDCAPS_BOTHSRCALPHA 0x00000800L
#define D3DPBLENDCAPS_BOTHINVSRCALPHA 0x00001000L
//
// ShadeCaps
//
#define D3DPSHADECAPS_COLORGOURAUDRGB 0x00000008L
#define D3DPSHADECAPS_SPECULARGOURAUDRGB 0x00000200L
#define D3DPSHADECAPS_ALPHAGOURAUDBLEND 0x00004000L
#define D3DPSHADECAPS_FOGGOURAUD 0x00080000L
//
// TextureCaps
//
#define D3DPTEXTURECAPS_PERSPECTIVE 0x00000001L /* Perspective-correct texturing is supported */
#define D3DPTEXTURECAPS_POW2 0x00000002L /* Power-of-2 texture dimensions are required - applies to non-Cube/Volume textures only. */
#define D3DPTEXTURECAPS_ALPHA 0x00000004L /* Alpha in texture pixels is supported */
#define D3DPTEXTURECAPS_SQUAREONLY 0x00000020L /* Only square textures are supported */
#define D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE 0x00000040L /* Texture indices are not scaled by the texture size prior to interpolation */
#define D3DPTEXTURECAPS_ALPHAPALETTE 0x00000080L /* Device can draw alpha from texture palettes */
// Device can use non-POW2 textures if:
// 1) D3DTEXTURE_ADDRESS is set to CLAMP for this texture's stage
// 2) D3DRS_WRAP(N) is zero for this texture's coordinates
// 3) mip mapping is not enabled (use magnification filter only)
#define D3DPTEXTURECAPS_NONPOW2CONDITIONAL 0x00000100L
#define D3DPTEXTURECAPS_PROJECTED 0x00000400L /* Device can do D3DTTFF_PROJECTED */
#define D3DPTEXTURECAPS_CUBEMAP 0x00000800L /* Device can do cubemap textures */
#define D3DPTEXTURECAPS_VOLUMEMAP 0x00002000L /* Device can do volume textures */
#define D3DPTEXTURECAPS_MIPMAP 0x00004000L /* Device can do mipmapped textures */
#define D3DPTEXTURECAPS_MIPVOLUMEMAP 0x00008000L /* Device can do mipmapped volume textures */
#define D3DPTEXTURECAPS_MIPCUBEMAP 0x00010000L /* Device can do mipmapped cube maps */
#define D3DPTEXTURECAPS_CUBEMAP_POW2 0x00020000L /* Device requires that cubemaps be power-of-2 dimension */
#define D3DPTEXTURECAPS_VOLUMEMAP_POW2 0x00040000L /* Device requires that volume maps be power-of-2 dimension */
//
// TextureFilterCaps
//
#define D3DPTFILTERCAPS_MINFPOINT 0x00000100L /* Min Filter */
#define D3DPTFILTERCAPS_MINFLINEAR 0x00000200L
#define D3DPTFILTERCAPS_MINFANISOTROPIC 0x00000400L
#define D3DPTFILTERCAPS_MIPFPOINT 0x00010000L /* Mip Filter */
#define D3DPTFILTERCAPS_MIPFLINEAR 0x00020000L
#define D3DPTFILTERCAPS_MAGFPOINT 0x01000000L /* Mag Filter */
#define D3DPTFILTERCAPS_MAGFLINEAR 0x02000000L
#define D3DPTFILTERCAPS_MAGFANISOTROPIC 0x04000000L
#define D3DPTFILTERCAPS_MAGFAFLATCUBIC 0x08000000L
#define D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC 0x10000000L
//
// TextureAddressCaps
//
#define D3DPTADDRESSCAPS_WRAP 0x00000001L
#define D3DPTADDRESSCAPS_MIRROR 0x00000002L
#define D3DPTADDRESSCAPS_CLAMP 0x00000004L
#define D3DPTADDRESSCAPS_BORDER 0x00000008L
#define D3DPTADDRESSCAPS_INDEPENDENTUV 0x00000010L
#define D3DPTADDRESSCAPS_MIRRORONCE 0x00000020L
//
// StencilCaps
//
#define D3DSTENCILCAPS_KEEP 0x00000001L
#define D3DSTENCILCAPS_ZERO 0x00000002L
#define D3DSTENCILCAPS_REPLACE 0x00000004L
#define D3DSTENCILCAPS_INCRSAT 0x00000008L
#define D3DSTENCILCAPS_DECRSAT 0x00000010L
#define D3DSTENCILCAPS_INVERT 0x00000020L
#define D3DSTENCILCAPS_INCR 0x00000040L
#define D3DSTENCILCAPS_DECR 0x00000080L
//
// TextureOpCaps
//
#define D3DTEXOPCAPS_DISABLE 0x00000001L
#define D3DTEXOPCAPS_SELECTARG1 0x00000002L
#define D3DTEXOPCAPS_SELECTARG2 0x00000004L
#define D3DTEXOPCAPS_MODULATE 0x00000008L
#define D3DTEXOPCAPS_MODULATE2X 0x00000010L
#define D3DTEXOPCAPS_MODULATE4X 0x00000020L
#define D3DTEXOPCAPS_ADD 0x00000040L
#define D3DTEXOPCAPS_ADDSIGNED 0x00000080L
#define D3DTEXOPCAPS_ADDSIGNED2X 0x00000100L
#define D3DTEXOPCAPS_SUBTRACT 0x00000200L
#define D3DTEXOPCAPS_ADDSMOOTH 0x00000400L
#define D3DTEXOPCAPS_BLENDDIFFUSEALPHA 0x00000800L
#define D3DTEXOPCAPS_BLENDTEXTUREALPHA 0x00001000L
#define D3DTEXOPCAPS_BLENDFACTORALPHA 0x00002000L
#define D3DTEXOPCAPS_BLENDTEXTUREALPHAPM 0x00004000L
#define D3DTEXOPCAPS_BLENDCURRENTALPHA 0x00008000L
#define D3DTEXOPCAPS_PREMODULATE 0x00010000L
#define D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR 0x00020000L
#define D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA 0x00040000L
#define D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR 0x00080000L
#define D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA 0x00100000L
#define D3DTEXOPCAPS_BUMPENVMAP 0x00200000L
#define D3DTEXOPCAPS_BUMPENVMAPLUMINANCE 0x00400000L
#define D3DTEXOPCAPS_DOTPRODUCT3 0x00800000L
#define D3DTEXOPCAPS_MULTIPLYADD 0x01000000L
#define D3DTEXOPCAPS_LERP 0x02000000L
//
// FVFCaps
//
#define D3DFVFCAPS_TEXCOORDCOUNTMASK 0x0000ffffL /* mask for texture coordinate count field */
#define D3DFVFCAPS_DONOTSTRIPELEMENTS 0x00080000L /* Device prefers that vertex elements not be stripped */
#define D3DFVFCAPS_PSIZE 0x00100000L /* Device can receive point size */
//
// VertexProcessingCaps
//
#define D3DVTXPCAPS_TEXGEN 0x00000001L /* device can do texgen */
#define D3DVTXPCAPS_MATERIALSOURCE7 0x00000002L /* device can do DX7-level colormaterialsource ops */
#define D3DVTXPCAPS_DIRECTIONALLIGHTS 0x00000008L /* device can do directional lights */
#define D3DVTXPCAPS_POSITIONALLIGHTS 0x00000010L /* device can do positional lights (includes point and spot) */
#define D3DVTXPCAPS_LOCALVIEWER 0x00000020L /* device can do local viewer */
#define D3DVTXPCAPS_TWEENING 0x00000040L /* device can do vertex tweening */
#define D3DVTXPCAPS_NO_VSDT_UBYTE4 0x00000080L /* device does not support D3DVSDT_UBYTE4 */
#pragma pack()
#endif /* (DIRECT3D_VERSION >= 0x0800) */
#endif /* _D3D8CAPS_H_ */

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,601 @@
/*==========================================================================;
*
* Copyright (C) Microsoft Corporation. All Rights Reserved.
*
* File: d3dcaps.h
* Content: Direct3D capabilities include file
*
***************************************************************************/
#ifndef _D3DCAPS_H
#define _D3DCAPS_H
/*
* Pull in DirectDraw include file automatically:
*/
#include "ddraw.h"
#ifndef DIRECT3D_VERSION
#define DIRECT3D_VERSION 0x0700
#endif
#if defined(_X86_) || defined(_IA64_)
#pragma pack(4)
#endif
/* Description of capabilities of transform */
typedef struct _D3DTRANSFORMCAPS {
DWORD dwSize;
DWORD dwCaps;
} D3DTRANSFORMCAPS, *LPD3DTRANSFORMCAPS;
#define D3DTRANSFORMCAPS_CLIP 0x00000001L /* Will clip whilst transforming */
/* Description of capabilities of lighting */
typedef struct _D3DLIGHTINGCAPS {
DWORD dwSize;
DWORD dwCaps; /* Lighting caps */
DWORD dwLightingModel; /* Lighting model - RGB or mono */
DWORD dwNumLights; /* Number of lights that can be handled */
} D3DLIGHTINGCAPS, *LPD3DLIGHTINGCAPS;
#define D3DLIGHTINGMODEL_RGB 0x00000001L
#define D3DLIGHTINGMODEL_MONO 0x00000002L
#define D3DLIGHTCAPS_POINT 0x00000001L /* Point lights supported */
#define D3DLIGHTCAPS_SPOT 0x00000002L /* Spot lights supported */
#define D3DLIGHTCAPS_DIRECTIONAL 0x00000004L /* Directional lights supported */
#if(DIRECT3D_VERSION < 0x700)
#define D3DLIGHTCAPS_PARALLELPOINT 0x00000008L /* Parallel point lights supported */
#endif
#if(DIRECT3D_VERSION < 0x500)
#define D3DLIGHTCAPS_GLSPOT 0x00000010L /* GL syle spot lights supported */
#endif
/* Description of capabilities for each primitive type */
typedef struct _D3DPrimCaps {
DWORD dwSize;
DWORD dwMiscCaps; /* Capability flags */
DWORD dwRasterCaps;
DWORD dwZCmpCaps;
DWORD dwSrcBlendCaps;
DWORD dwDestBlendCaps;
DWORD dwAlphaCmpCaps;
DWORD dwShadeCaps;
DWORD dwTextureCaps;
DWORD dwTextureFilterCaps;
DWORD dwTextureBlendCaps;
DWORD dwTextureAddressCaps;
DWORD dwStippleWidth; /* maximum width and height of */
DWORD dwStippleHeight; /* of supported stipple (up to 32x32) */
} D3DPRIMCAPS, *LPD3DPRIMCAPS;
/* D3DPRIMCAPS dwMiscCaps */
#define D3DPMISCCAPS_MASKPLANES 0x00000001L
#define D3DPMISCCAPS_MASKZ 0x00000002L
#define D3DPMISCCAPS_LINEPATTERNREP 0x00000004L
#define D3DPMISCCAPS_CONFORMANT 0x00000008L
#define D3DPMISCCAPS_CULLNONE 0x00000010L
#define D3DPMISCCAPS_CULLCW 0x00000020L
#define D3DPMISCCAPS_CULLCCW 0x00000040L
/* D3DPRIMCAPS dwRasterCaps */
#define D3DPRASTERCAPS_DITHER 0x00000001L
#define D3DPRASTERCAPS_ROP2 0x00000002L
#define D3DPRASTERCAPS_XOR 0x00000004L
#define D3DPRASTERCAPS_PAT 0x00000008L
#define D3DPRASTERCAPS_ZTEST 0x00000010L
#define D3DPRASTERCAPS_SUBPIXEL 0x00000020L
#define D3DPRASTERCAPS_SUBPIXELX 0x00000040L
#define D3DPRASTERCAPS_FOGVERTEX 0x00000080L
#define D3DPRASTERCAPS_FOGTABLE 0x00000100L
#define D3DPRASTERCAPS_STIPPLE 0x00000200L
#if(DIRECT3D_VERSION >= 0x0500)
#define D3DPRASTERCAPS_ANTIALIASSORTDEPENDENT 0x00000400L
#define D3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT 0x00000800L
#define D3DPRASTERCAPS_ANTIALIASEDGES 0x00001000L
#define D3DPRASTERCAPS_MIPMAPLODBIAS 0x00002000L
#define D3DPRASTERCAPS_ZBIAS 0x00004000L
#define D3DPRASTERCAPS_ZBUFFERLESSHSR 0x00008000L
#define D3DPRASTERCAPS_FOGRANGE 0x00010000L
#define D3DPRASTERCAPS_ANISOTROPY 0x00020000L
#endif /* DIRECT3D_VERSION >= 0x0500 */
#if(DIRECT3D_VERSION >= 0x0600)
#define D3DPRASTERCAPS_WBUFFER 0x00040000L
#define D3DPRASTERCAPS_TRANSLUCENTSORTINDEPENDENT 0x00080000L
#define D3DPRASTERCAPS_WFOG 0x00100000L
#define D3DPRASTERCAPS_ZFOG 0x00200000L
#endif /* DIRECT3D_VERSION >= 0x0600 */
/* D3DPRIMCAPS dwZCmpCaps, dwAlphaCmpCaps */
#define D3DPCMPCAPS_NEVER 0x00000001L
#define D3DPCMPCAPS_LESS 0x00000002L
#define D3DPCMPCAPS_EQUAL 0x00000004L
#define D3DPCMPCAPS_LESSEQUAL 0x00000008L
#define D3DPCMPCAPS_GREATER 0x00000010L
#define D3DPCMPCAPS_NOTEQUAL 0x00000020L
#define D3DPCMPCAPS_GREATEREQUAL 0x00000040L
#define D3DPCMPCAPS_ALWAYS 0x00000080L
/* D3DPRIMCAPS dwSourceBlendCaps, dwDestBlendCaps */
#define D3DPBLENDCAPS_ZERO 0x00000001L
#define D3DPBLENDCAPS_ONE 0x00000002L
#define D3DPBLENDCAPS_SRCCOLOR 0x00000004L
#define D3DPBLENDCAPS_INVSRCCOLOR 0x00000008L
#define D3DPBLENDCAPS_SRCALPHA 0x00000010L
#define D3DPBLENDCAPS_INVSRCALPHA 0x00000020L
#define D3DPBLENDCAPS_DESTALPHA 0x00000040L
#define D3DPBLENDCAPS_INVDESTALPHA 0x00000080L
#define D3DPBLENDCAPS_DESTCOLOR 0x00000100L
#define D3DPBLENDCAPS_INVDESTCOLOR 0x00000200L
#define D3DPBLENDCAPS_SRCALPHASAT 0x00000400L
#define D3DPBLENDCAPS_BOTHSRCALPHA 0x00000800L
#define D3DPBLENDCAPS_BOTHINVSRCALPHA 0x00001000L
/* D3DPRIMCAPS dwShadeCaps */
#define D3DPSHADECAPS_COLORFLATMONO 0x00000001L
#define D3DPSHADECAPS_COLORFLATRGB 0x00000002L
#define D3DPSHADECAPS_COLORGOURAUDMONO 0x00000004L
#define D3DPSHADECAPS_COLORGOURAUDRGB 0x00000008L
#define D3DPSHADECAPS_COLORPHONGMONO 0x00000010L
#define D3DPSHADECAPS_COLORPHONGRGB 0x00000020L
#define D3DPSHADECAPS_SPECULARFLATMONO 0x00000040L
#define D3DPSHADECAPS_SPECULARFLATRGB 0x00000080L
#define D3DPSHADECAPS_SPECULARGOURAUDMONO 0x00000100L
#define D3DPSHADECAPS_SPECULARGOURAUDRGB 0x00000200L
#define D3DPSHADECAPS_SPECULARPHONGMONO 0x00000400L
#define D3DPSHADECAPS_SPECULARPHONGRGB 0x00000800L
#define D3DPSHADECAPS_ALPHAFLATBLEND 0x00001000L
#define D3DPSHADECAPS_ALPHAFLATSTIPPLED 0x00002000L
#define D3DPSHADECAPS_ALPHAGOURAUDBLEND 0x00004000L
#define D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED 0x00008000L
#define D3DPSHADECAPS_ALPHAPHONGBLEND 0x00010000L
#define D3DPSHADECAPS_ALPHAPHONGSTIPPLED 0x00020000L
#define D3DPSHADECAPS_FOGFLAT 0x00040000L
#define D3DPSHADECAPS_FOGGOURAUD 0x00080000L
#define D3DPSHADECAPS_FOGPHONG 0x00100000L
/* D3DPRIMCAPS dwTextureCaps */
/*
* Perspective-correct texturing is supported
*/
#define D3DPTEXTURECAPS_PERSPECTIVE 0x00000001L
/*
* Power-of-2 texture dimensions are required
*/
#define D3DPTEXTURECAPS_POW2 0x00000002L
/*
* Alpha in texture pixels is supported
*/
#define D3DPTEXTURECAPS_ALPHA 0x00000004L
/*
* Color-keyed textures are supported
*/
#define D3DPTEXTURECAPS_TRANSPARENCY 0x00000008L
/*
* obsolete, see D3DPTADDRESSCAPS_BORDER
*/
#define D3DPTEXTURECAPS_BORDER 0x00000010L
/*
* Only square textures are supported
*/
#define D3DPTEXTURECAPS_SQUAREONLY 0x00000020L
#if(DIRECT3D_VERSION >= 0x0600)
/*
* Texture indices are not scaled by the texture size prior
* to interpolation.
*/
#define D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE 0x00000040L
/*
* Device can draw alpha from texture palettes
*/
#define D3DPTEXTURECAPS_ALPHAPALETTE 0x00000080L
/*
* Device can use non-POW2 textures if:
* 1) D3DTEXTURE_ADDRESS is set to CLAMP for this texture's stage
* 2) D3DRS_WRAP(N) is zero for this texture's coordinates
* 3) mip mapping is not enabled (use magnification filter only)
*/
#define D3DPTEXTURECAPS_NONPOW2CONDITIONAL 0x00000100L
#endif /* DIRECT3D_VERSION >= 0x0600 */
#if(DIRECT3D_VERSION >= 0x0700)
// 0x00000200L unused
/*
* Device can divide transformed texture coordinates by the
* COUNTth texture coordinate (can do D3DTTFF_PROJECTED)
*/
#define D3DPTEXTURECAPS_PROJECTED 0x00000400L
/*
* Device can do cubemap textures
*/
#define D3DPTEXTURECAPS_CUBEMAP 0x00000800L
#define D3DPTEXTURECAPS_COLORKEYBLEND 0x00001000L
#endif /* DIRECT3D_VERSION >= 0x0700 */
/* D3DPRIMCAPS dwTextureFilterCaps */
#define D3DPTFILTERCAPS_NEAREST 0x00000001L
#define D3DPTFILTERCAPS_LINEAR 0x00000002L
#define D3DPTFILTERCAPS_MIPNEAREST 0x00000004L
#define D3DPTFILTERCAPS_MIPLINEAR 0x00000008L
#define D3DPTFILTERCAPS_LINEARMIPNEAREST 0x00000010L
#define D3DPTFILTERCAPS_LINEARMIPLINEAR 0x00000020L
#if(DIRECT3D_VERSION >= 0x0600)
/* Device3 Min Filter */
#define D3DPTFILTERCAPS_MINFPOINT 0x00000100L
#define D3DPTFILTERCAPS_MINFLINEAR 0x00000200L
#define D3DPTFILTERCAPS_MINFANISOTROPIC 0x00000400L
/* Device3 Mip Filter */
#define D3DPTFILTERCAPS_MIPFPOINT 0x00010000L
#define D3DPTFILTERCAPS_MIPFLINEAR 0x00020000L
/* Device3 Mag Filter */
#define D3DPTFILTERCAPS_MAGFPOINT 0x01000000L
#define D3DPTFILTERCAPS_MAGFLINEAR 0x02000000L
#define D3DPTFILTERCAPS_MAGFANISOTROPIC 0x04000000L
#define D3DPTFILTERCAPS_MAGFAFLATCUBIC 0x08000000L
#define D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC 0x10000000L
#endif /* DIRECT3D_VERSION >= 0x0600 */
/* D3DPRIMCAPS dwTextureBlendCaps */
#define D3DPTBLENDCAPS_DECAL 0x00000001L
#define D3DPTBLENDCAPS_MODULATE 0x00000002L
#define D3DPTBLENDCAPS_DECALALPHA 0x00000004L
#define D3DPTBLENDCAPS_MODULATEALPHA 0x00000008L
#define D3DPTBLENDCAPS_DECALMASK 0x00000010L
#define D3DPTBLENDCAPS_MODULATEMASK 0x00000020L
#define D3DPTBLENDCAPS_COPY 0x00000040L
#if(DIRECT3D_VERSION >= 0x0500)
#define D3DPTBLENDCAPS_ADD 0x00000080L
#endif /* DIRECT3D_VERSION >= 0x0500 */
/* D3DPRIMCAPS dwTextureAddressCaps */
#define D3DPTADDRESSCAPS_WRAP 0x00000001L
#define D3DPTADDRESSCAPS_MIRROR 0x00000002L
#define D3DPTADDRESSCAPS_CLAMP 0x00000004L
#if(DIRECT3D_VERSION >= 0x0500)
#define D3DPTADDRESSCAPS_BORDER 0x00000008L
#define D3DPTADDRESSCAPS_INDEPENDENTUV 0x00000010L
#endif /* DIRECT3D_VERSION >= 0x0500 */
#if(DIRECT3D_VERSION >= 0x0600)
/* D3DDEVICEDESC dwStencilCaps */
#define D3DSTENCILCAPS_KEEP 0x00000001L
#define D3DSTENCILCAPS_ZERO 0x00000002L
#define D3DSTENCILCAPS_REPLACE 0x00000004L
#define D3DSTENCILCAPS_INCRSAT 0x00000008L
#define D3DSTENCILCAPS_DECRSAT 0x00000010L
#define D3DSTENCILCAPS_INVERT 0x00000020L
#define D3DSTENCILCAPS_INCR 0x00000040L
#define D3DSTENCILCAPS_DECR 0x00000080L
/* D3DDEVICEDESC dwTextureOpCaps */
#define D3DTEXOPCAPS_DISABLE 0x00000001L
#define D3DTEXOPCAPS_SELECTARG1 0x00000002L
#define D3DTEXOPCAPS_SELECTARG2 0x00000004L
#define D3DTEXOPCAPS_MODULATE 0x00000008L
#define D3DTEXOPCAPS_MODULATE2X 0x00000010L
#define D3DTEXOPCAPS_MODULATE4X 0x00000020L
#define D3DTEXOPCAPS_ADD 0x00000040L
#define D3DTEXOPCAPS_ADDSIGNED 0x00000080L
#define D3DTEXOPCAPS_ADDSIGNED2X 0x00000100L
#define D3DTEXOPCAPS_SUBTRACT 0x00000200L
#define D3DTEXOPCAPS_ADDSMOOTH 0x00000400L
#define D3DTEXOPCAPS_BLENDDIFFUSEALPHA 0x00000800L
#define D3DTEXOPCAPS_BLENDTEXTUREALPHA 0x00001000L
#define D3DTEXOPCAPS_BLENDFACTORALPHA 0x00002000L
#define D3DTEXOPCAPS_BLENDTEXTUREALPHAPM 0x00004000L
#define D3DTEXOPCAPS_BLENDCURRENTALPHA 0x00008000L
#define D3DTEXOPCAPS_PREMODULATE 0x00010000L
#define D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR 0x00020000L
#define D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA 0x00040000L
#define D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR 0x00080000L
#define D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA 0x00100000L
#define D3DTEXOPCAPS_BUMPENVMAP 0x00200000L
#define D3DTEXOPCAPS_BUMPENVMAPLUMINANCE 0x00400000L
#define D3DTEXOPCAPS_DOTPRODUCT3 0x00800000L
/* D3DDEVICEDESC dwFVFCaps flags */
#define D3DFVFCAPS_TEXCOORDCOUNTMASK 0x0000ffffL /* mask for texture coordinate count field */
#define D3DFVFCAPS_DONOTSTRIPELEMENTS 0x00080000L /* Device prefers that vertex elements not be stripped */
#endif /* DIRECT3D_VERSION >= 0x0600 */
/*
* Description for a device.
* This is used to describe a device that is to be created or to query
* the current device.
*/
typedef struct _D3DDeviceDesc {
DWORD dwSize; /* Size of D3DDEVICEDESC structure */
DWORD dwFlags; /* Indicates which fields have valid data */
D3DCOLORMODEL dcmColorModel; /* Color model of device */
DWORD dwDevCaps; /* Capabilities of device */
D3DTRANSFORMCAPS dtcTransformCaps; /* Capabilities of transform */
BOOL bClipping; /* Device can do 3D clipping */
D3DLIGHTINGCAPS dlcLightingCaps; /* Capabilities of lighting */
D3DPRIMCAPS dpcLineCaps;
D3DPRIMCAPS dpcTriCaps;
DWORD dwDeviceRenderBitDepth; /* One of DDBB_8, 16, etc.. */
DWORD dwDeviceZBufferBitDepth;/* One of DDBD_16, 32, etc.. */
DWORD dwMaxBufferSize; /* Maximum execute buffer size */
DWORD dwMaxVertexCount; /* Maximum vertex count */
#if(DIRECT3D_VERSION >= 0x0500)
// *** New fields for DX5 *** //
// Width and height caps are 0 for legacy HALs.
DWORD dwMinTextureWidth, dwMinTextureHeight;
DWORD dwMaxTextureWidth, dwMaxTextureHeight;
DWORD dwMinStippleWidth, dwMaxStippleWidth;
DWORD dwMinStippleHeight, dwMaxStippleHeight;
#endif /* DIRECT3D_VERSION >= 0x0500 */
#if(DIRECT3D_VERSION >= 0x0600)
// New fields for DX6
DWORD dwMaxTextureRepeat;
DWORD dwMaxTextureAspectRatio;
DWORD dwMaxAnisotropy;
// Guard band that the rasterizer can accommodate
// Screen-space vertices inside this space but outside the viewport
// will get clipped properly.
D3DVALUE dvGuardBandLeft;
D3DVALUE dvGuardBandTop;
D3DVALUE dvGuardBandRight;
D3DVALUE dvGuardBandBottom;
D3DVALUE dvExtentsAdjust;
DWORD dwStencilCaps;
DWORD dwFVFCaps;
DWORD dwTextureOpCaps;
WORD wMaxTextureBlendStages;
WORD wMaxSimultaneousTextures;
#endif /* DIRECT3D_VERSION >= 0x0600 */
} D3DDEVICEDESC, *LPD3DDEVICEDESC;
#if(DIRECT3D_VERSION >= 0x0700)
typedef struct _D3DDeviceDesc7 {
DWORD dwDevCaps; /* Capabilities of device */
D3DPRIMCAPS dpcLineCaps;
D3DPRIMCAPS dpcTriCaps;
DWORD dwDeviceRenderBitDepth; /* One of DDBB_8, 16, etc.. */
DWORD dwDeviceZBufferBitDepth;/* One of DDBD_16, 32, etc.. */
DWORD dwMinTextureWidth, dwMinTextureHeight;
DWORD dwMaxTextureWidth, dwMaxTextureHeight;
DWORD dwMaxTextureRepeat;
DWORD dwMaxTextureAspectRatio;
DWORD dwMaxAnisotropy;
D3DVALUE dvGuardBandLeft;
D3DVALUE dvGuardBandTop;
D3DVALUE dvGuardBandRight;
D3DVALUE dvGuardBandBottom;
D3DVALUE dvExtentsAdjust;
DWORD dwStencilCaps;
DWORD dwFVFCaps;
DWORD dwTextureOpCaps;
WORD wMaxTextureBlendStages;
WORD wMaxSimultaneousTextures;
DWORD dwMaxActiveLights;
D3DVALUE dvMaxVertexW;
GUID deviceGUID;
WORD wMaxUserClipPlanes;
WORD wMaxVertexBlendMatrices;
DWORD dwVertexProcessingCaps;
DWORD dwReserved1;
DWORD dwReserved2;
DWORD dwReserved3;
DWORD dwReserved4;
} D3DDEVICEDESC7, *LPD3DDEVICEDESC7;
#endif /* DIRECT3D_VERSION >= 0x0700 */
#define D3DDEVICEDESCSIZE (sizeof(D3DDEVICEDESC))
#define D3DDEVICEDESC7SIZE (sizeof(D3DDEVICEDESC7))
typedef HRESULT (CALLBACK * LPD3DENUMDEVICESCALLBACK)(GUID FAR *lpGuid, LPSTR lpDeviceDescription, LPSTR lpDeviceName, LPD3DDEVICEDESC, LPD3DDEVICEDESC, LPVOID);
#if(DIRECT3D_VERSION >= 0x0700)
typedef HRESULT (CALLBACK * LPD3DENUMDEVICESCALLBACK7)(LPSTR lpDeviceDescription, LPSTR lpDeviceName, LPD3DDEVICEDESC7, LPVOID);
#endif /* DIRECT3D_VERSION >= 0x0700 */
/* D3DDEVICEDESC dwFlags indicating valid fields */
#define D3DDD_COLORMODEL 0x00000001L /* dcmColorModel is valid */
#define D3DDD_DEVCAPS 0x00000002L /* dwDevCaps is valid */
#define D3DDD_TRANSFORMCAPS 0x00000004L /* dtcTransformCaps is valid */
#define D3DDD_LIGHTINGCAPS 0x00000008L /* dlcLightingCaps is valid */
#define D3DDD_BCLIPPING 0x00000010L /* bClipping is valid */
#define D3DDD_LINECAPS 0x00000020L /* dpcLineCaps is valid */
#define D3DDD_TRICAPS 0x00000040L /* dpcTriCaps is valid */
#define D3DDD_DEVICERENDERBITDEPTH 0x00000080L /* dwDeviceRenderBitDepth is valid */
#define D3DDD_DEVICEZBUFFERBITDEPTH 0x00000100L /* dwDeviceZBufferBitDepth is valid */
#define D3DDD_MAXBUFFERSIZE 0x00000200L /* dwMaxBufferSize is valid */
#define D3DDD_MAXVERTEXCOUNT 0x00000400L /* dwMaxVertexCount is valid */
/* D3DDEVICEDESC dwDevCaps flags */
#define D3DDEVCAPS_FLOATTLVERTEX 0x00000001L /* Device accepts floating point */
/* for post-transform vertex data */
#define D3DDEVCAPS_SORTINCREASINGZ 0x00000002L /* Device needs data sorted for increasing Z */
#define D3DDEVCAPS_SORTDECREASINGZ 0X00000004L /* Device needs data sorted for decreasing Z */
#define D3DDEVCAPS_SORTEXACT 0x00000008L /* Device needs data sorted exactly */
#define D3DDEVCAPS_EXECUTESYSTEMMEMORY 0x00000010L /* Device can use execute buffers from system memory */
#define D3DDEVCAPS_EXECUTEVIDEOMEMORY 0x00000020L /* Device can use execute buffers from video memory */
#define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY 0x00000040L /* Device can use TL buffers from system memory */
#define D3DDEVCAPS_TLVERTEXVIDEOMEMORY 0x00000080L /* Device can use TL buffers from video memory */
#define D3DDEVCAPS_TEXTURESYSTEMMEMORY 0x00000100L /* Device can texture from system memory */
#define D3DDEVCAPS_TEXTUREVIDEOMEMORY 0x00000200L /* Device can texture from device memory */
#if(DIRECT3D_VERSION >= 0x0500)
#define D3DDEVCAPS_DRAWPRIMTLVERTEX 0x00000400L /* Device can draw TLVERTEX primitives */
#define D3DDEVCAPS_CANRENDERAFTERFLIP 0x00000800L /* Device can render without waiting for flip to complete */
#define D3DDEVCAPS_TEXTURENONLOCALVIDMEM 0x00001000L /* Device can texture from nonlocal video memory */
#endif /* DIRECT3D_VERSION >= 0x0500 */
#if(DIRECT3D_VERSION >= 0x0600)
#define D3DDEVCAPS_DRAWPRIMITIVES2 0x00002000L /* Device can support DrawPrimitives2 */
#define D3DDEVCAPS_SEPARATETEXTUREMEMORIES 0x00004000L /* Device is texturing from separate memory pools */
#define D3DDEVCAPS_DRAWPRIMITIVES2EX 0x00008000L /* Device can support Extended DrawPrimitives2 i.e. DX7 compliant driver*/
#endif /* DIRECT3D_VERSION >= 0x0600 */
#if(DIRECT3D_VERSION >= 0x0700)
#define D3DDEVCAPS_HWTRANSFORMANDLIGHT 0x00010000L /* Device can support transformation and lighting in hardware and DRAWPRIMITIVES2EX must be also */
#define D3DDEVCAPS_CANBLTSYSTONONLOCAL 0x00020000L /* Device supports a Tex Blt from system memory to non-local vidmem */
#define D3DDEVCAPS_HWRASTERIZATION 0x00080000L /* Device has HW acceleration for rasterization */
/*
* These are the flags in the D3DDEVICEDESC7.dwVertexProcessingCaps field
*/
/* device can do texgen */
#define D3DVTXPCAPS_TEXGEN 0x00000001L
/* device can do IDirect3DDevice7 colormaterialsource ops */
#define D3DVTXPCAPS_MATERIALSOURCE7 0x00000002L
/* device can do vertex fog */
#define D3DVTXPCAPS_VERTEXFOG 0x00000004L
/* device can do directional lights */
#define D3DVTXPCAPS_DIRECTIONALLIGHTS 0x00000008L
/* device can do positional lights (includes point and spot) */
#define D3DVTXPCAPS_POSITIONALLIGHTS 0x00000010L
/* device can do local viewer */
#define D3DVTXPCAPS_LOCALVIEWER 0x00000020L
#endif /* DIRECT3D_VERSION >= 0x0700 */
#define D3DFDS_COLORMODEL 0x00000001L /* Match color model */
#define D3DFDS_GUID 0x00000002L /* Match guid */
#define D3DFDS_HARDWARE 0x00000004L /* Match hardware/software */
#define D3DFDS_TRIANGLES 0x00000008L /* Match in triCaps */
#define D3DFDS_LINES 0x00000010L /* Match in lineCaps */
#define D3DFDS_MISCCAPS 0x00000020L /* Match primCaps.dwMiscCaps */
#define D3DFDS_RASTERCAPS 0x00000040L /* Match primCaps.dwRasterCaps */
#define D3DFDS_ZCMPCAPS 0x00000080L /* Match primCaps.dwZCmpCaps */
#define D3DFDS_ALPHACMPCAPS 0x00000100L /* Match primCaps.dwAlphaCmpCaps */
#define D3DFDS_SRCBLENDCAPS 0x00000200L /* Match primCaps.dwSourceBlendCaps */
#define D3DFDS_DSTBLENDCAPS 0x00000400L /* Match primCaps.dwDestBlendCaps */
#define D3DFDS_SHADECAPS 0x00000800L /* Match primCaps.dwShadeCaps */
#define D3DFDS_TEXTURECAPS 0x00001000L /* Match primCaps.dwTextureCaps */
#define D3DFDS_TEXTUREFILTERCAPS 0x00002000L /* Match primCaps.dwTextureFilterCaps */
#define D3DFDS_TEXTUREBLENDCAPS 0x00004000L /* Match primCaps.dwTextureBlendCaps */
#define D3DFDS_TEXTUREADDRESSCAPS 0x00008000L /* Match primCaps.dwTextureBlendCaps */
/*
* FindDevice arguments
*/
typedef struct _D3DFINDDEVICESEARCH {
DWORD dwSize;
DWORD dwFlags;
BOOL bHardware;
D3DCOLORMODEL dcmColorModel;
GUID guid;
DWORD dwCaps;
D3DPRIMCAPS dpcPrimCaps;
} D3DFINDDEVICESEARCH, *LPD3DFINDDEVICESEARCH;
typedef struct _D3DFINDDEVICERESULT {
DWORD dwSize;
GUID guid; /* guid which matched */
D3DDEVICEDESC ddHwDesc; /* hardware D3DDEVICEDESC */
D3DDEVICEDESC ddSwDesc; /* software D3DDEVICEDESC */
} D3DFINDDEVICERESULT, *LPD3DFINDDEVICERESULT;
/*
* Description of execute buffer.
*/
typedef struct _D3DExecuteBufferDesc {
DWORD dwSize; /* size of this structure */
DWORD dwFlags; /* flags indicating which fields are valid */
DWORD dwCaps; /* capabilities of execute buffer */
DWORD dwBufferSize; /* size of execute buffer data */
LPVOID lpData; /* pointer to actual data */
} D3DEXECUTEBUFFERDESC, *LPD3DEXECUTEBUFFERDESC;
/* D3DEXECUTEBUFFER dwFlags indicating valid fields */
#define D3DDEB_BUFSIZE 0x00000001l /* buffer size valid */
#define D3DDEB_CAPS 0x00000002l /* caps valid */
#define D3DDEB_LPDATA 0x00000004l /* lpData valid */
/* D3DEXECUTEBUFFER dwCaps */
#define D3DDEBCAPS_SYSTEMMEMORY 0x00000001l /* buffer in system memory */
#define D3DDEBCAPS_VIDEOMEMORY 0x00000002l /* buffer in device memory */
#define D3DDEBCAPS_MEM (D3DDEBCAPS_SYSTEMMEMORY|D3DDEBCAPS_VIDEOMEMORY)
#if(DIRECT3D_VERSION < 0x0800)
#if(DIRECT3D_VERSION >= 0x0700)
typedef struct _D3DDEVINFO_TEXTUREMANAGER {
BOOL bThrashing; /* indicates if thrashing */
DWORD dwApproxBytesDownloaded; /* Approximate number of bytes downloaded by texture manager */
DWORD dwNumEvicts; /* number of textures evicted */
DWORD dwNumVidCreates; /* number of textures created in video memory */
DWORD dwNumTexturesUsed; /* number of textures used */
DWORD dwNumUsedTexInVid; /* number of used textures present in video memory */
DWORD dwWorkingSet; /* number of textures in video memory */
DWORD dwWorkingSetBytes; /* number of bytes in video memory */
DWORD dwTotalManaged; /* total number of managed textures */
DWORD dwTotalBytes; /* total number of bytes of managed textures */
DWORD dwLastPri; /* priority of last texture evicted */
} D3DDEVINFO_TEXTUREMANAGER, *LPD3DDEVINFO_TEXTUREMANAGER;
typedef struct _D3DDEVINFO_TEXTURING {
DWORD dwNumLoads; /* counts Load() API calls */
DWORD dwApproxBytesLoaded; /* Approximate number bytes loaded via Load() */
DWORD dwNumPreLoads; /* counts PreLoad() API calls */
DWORD dwNumSet; /* counts SetTexture() API calls */
DWORD dwNumCreates; /* counts texture creates */
DWORD dwNumDestroys; /* counts texture destroys */
DWORD dwNumSetPriorities; /* counts SetPriority() API calls */
DWORD dwNumSetLODs; /* counts SetLOD() API calls */
DWORD dwNumLocks; /* counts number of texture locks */
DWORD dwNumGetDCs; /* counts number of GetDCs to textures */
} D3DDEVINFO_TEXTURING, *LPD3DDEVINFO_TEXTURING;
#endif /* DIRECT3D_VERSION >= 0x0700 */
#endif //(DIRECT3D_VERSION < 0x0800)
#pragma pack()
#endif /* _D3DCAPS_H_ */

View File

@ -0,0 +1,342 @@
/*==========================================================================;
*
* Copyright (c) Microsoft Corporation. All rights reserved.
*
* File: d3drm.h
* Content: Direct3DRM include file
*
***************************************************************************/
#ifndef __D3DRM_H__
#define __D3DRM_H__
#include "ddraw.h"
#ifdef __cplusplus
struct IDirect3DRM;
#endif
typedef struct IDirect3DRM *LPDIRECT3DRM;
#include "d3drmobj.h"
#ifdef __cplusplus
extern "C" {
#endif
DEFINE_GUID(IID_IDirect3DRM, 0x2bc49361, 0x8327, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1);
DEFINE_GUID(IID_IDirect3DRM2, 0x4516ecc8, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3);
DEFINE_GUID(IID_IDirect3DRM3, 0x4516ec83, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3);
WIN_TYPES(IDirect3DRM, DIRECT3DRM);
WIN_TYPES(IDirect3DRM2, DIRECT3DRM2);
WIN_TYPES(IDirect3DRM3, DIRECT3DRM3);
/*
* Direct3DRM Object Class (for CoCreateInstance())
*/
DEFINE_GUID(CLSID_CDirect3DRM, 0x4516ec41, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3);
/* Create a Direct3DRM API */
STDAPI Direct3DRMCreate(LPDIRECT3DRM FAR *lplpDirect3DRM);
#undef INTERFACE
#define INTERFACE IDirect3DRM
DECLARE_INTERFACE_(IDirect3DRM, IUnknown)
{
IUNKNOWN_METHODS(PURE);
STDMETHOD(CreateObject)
(THIS_ REFCLSID rclsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID FAR* ppv) PURE;
STDMETHOD(CreateFrame) (THIS_ LPDIRECT3DRMFRAME, LPDIRECT3DRMFRAME *) PURE;
STDMETHOD(CreateMesh) (THIS_ LPDIRECT3DRMMESH *) PURE;
STDMETHOD(CreateMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER *) PURE;
STDMETHOD(CreateFace) (THIS_ LPDIRECT3DRMFACE *) PURE;
STDMETHOD(CreateAnimation) (THIS_ LPDIRECT3DRMANIMATION *) PURE;
STDMETHOD(CreateAnimationSet)(THIS_ LPDIRECT3DRMANIMATIONSET *) PURE;
STDMETHOD(CreateTexture) (THIS_ LPD3DRMIMAGE, LPDIRECT3DRMTEXTURE *) PURE;
STDMETHOD(CreateLight) (THIS_ D3DRMLIGHTTYPE, D3DCOLOR, LPDIRECT3DRMLIGHT *) PURE;
STDMETHOD(CreateLightRGB)
(THIS_ D3DRMLIGHTTYPE, D3DVALUE, D3DVALUE, D3DVALUE, LPDIRECT3DRMLIGHT *) PURE;
STDMETHOD(CreateMaterial) (THIS_ D3DVALUE, LPDIRECT3DRMMATERIAL *) PURE;
STDMETHOD(CreateDevice) (THIS_ DWORD, DWORD, LPDIRECT3DRMDEVICE *) PURE;
/* Create a Windows Device using DirectDraw surfaces */
STDMETHOD(CreateDeviceFromSurface)
( THIS_ LPGUID lpGUID, LPDIRECTDRAW lpDD,
LPDIRECTDRAWSURFACE lpDDSBack, LPDIRECT3DRMDEVICE *
) PURE;
/* Create a Windows Device using D3D objects */
STDMETHOD(CreateDeviceFromD3D)
( THIS_ LPDIRECT3D lpD3D, LPDIRECT3DDEVICE lpD3DDev,
LPDIRECT3DRMDEVICE *
) PURE;
STDMETHOD(CreateDeviceFromClipper)
( THIS_ LPDIRECTDRAWCLIPPER lpDDClipper, LPGUID lpGUID,
int width, int height, LPDIRECT3DRMDEVICE *) PURE;
STDMETHOD(CreateTextureFromSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDS, LPDIRECT3DRMTEXTURE *) PURE;
STDMETHOD(CreateShadow)
( THIS_ LPDIRECT3DRMVISUAL, LPDIRECT3DRMLIGHT,
D3DVALUE px, D3DVALUE py, D3DVALUE pz,
D3DVALUE nx, D3DVALUE ny, D3DVALUE nz,
LPDIRECT3DRMVISUAL *
) PURE;
STDMETHOD(CreateViewport)
( THIS_ LPDIRECT3DRMDEVICE, LPDIRECT3DRMFRAME, DWORD, DWORD,
DWORD, DWORD, LPDIRECT3DRMVIEWPORT *
) PURE;
STDMETHOD(CreateWrap)
( THIS_ D3DRMWRAPTYPE, LPDIRECT3DRMFRAME,
D3DVALUE ox, D3DVALUE oy, D3DVALUE oz,
D3DVALUE dx, D3DVALUE dy, D3DVALUE dz,
D3DVALUE ux, D3DVALUE uy, D3DVALUE uz,
D3DVALUE ou, D3DVALUE ov,
D3DVALUE su, D3DVALUE sv,
LPDIRECT3DRMWRAP *
) PURE;
STDMETHOD(CreateUserVisual) (THIS_ D3DRMUSERVISUALCALLBACK, LPVOID lPArg, LPDIRECT3DRMUSERVISUAL *) PURE;
STDMETHOD(LoadTexture) (THIS_ const char *, LPDIRECT3DRMTEXTURE *) PURE;
STDMETHOD(LoadTextureFromResource) (THIS_ HRSRC rs, LPDIRECT3DRMTEXTURE *) PURE;
STDMETHOD(SetSearchPath) (THIS_ LPCSTR) PURE;
STDMETHOD(AddSearchPath) (THIS_ LPCSTR) PURE;
STDMETHOD(GetSearchPath) (THIS_ DWORD *size_return, LPSTR path_return) PURE;
STDMETHOD(SetDefaultTextureColors)(THIS_ DWORD) PURE;
STDMETHOD(SetDefaultTextureShades)(THIS_ DWORD) PURE;
STDMETHOD(GetDevices) (THIS_ LPDIRECT3DRMDEVICEARRAY *) PURE;
STDMETHOD(GetNamedObject) (THIS_ const char *, LPDIRECT3DRMOBJECT *) PURE;
STDMETHOD(EnumerateObjects) (THIS_ D3DRMOBJECTCALLBACK, LPVOID) PURE;
STDMETHOD(Load)
( THIS_ LPVOID, LPVOID, LPIID *, DWORD, D3DRMLOADOPTIONS,
D3DRMLOADCALLBACK, LPVOID, D3DRMLOADTEXTURECALLBACK, LPVOID,
LPDIRECT3DRMFRAME
) PURE;
STDMETHOD(Tick) (THIS_ D3DVALUE) PURE;
};
#undef INTERFACE
#define INTERFACE IDirect3DRM2
DECLARE_INTERFACE_(IDirect3DRM2, IUnknown)
{
IUNKNOWN_METHODS(PURE);
STDMETHOD(CreateObject)
(THIS_ REFCLSID rclsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID FAR* ppv) PURE;
STDMETHOD(CreateFrame) (THIS_ LPDIRECT3DRMFRAME, LPDIRECT3DRMFRAME2 *) PURE;
STDMETHOD(CreateMesh) (THIS_ LPDIRECT3DRMMESH *) PURE;
STDMETHOD(CreateMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER2 *) PURE;
STDMETHOD(CreateFace) (THIS_ LPDIRECT3DRMFACE *) PURE;
STDMETHOD(CreateAnimation) (THIS_ LPDIRECT3DRMANIMATION *) PURE;
STDMETHOD(CreateAnimationSet)(THIS_ LPDIRECT3DRMANIMATIONSET *) PURE;
STDMETHOD(CreateTexture) (THIS_ LPD3DRMIMAGE, LPDIRECT3DRMTEXTURE2 *) PURE;
STDMETHOD(CreateLight) (THIS_ D3DRMLIGHTTYPE, D3DCOLOR, LPDIRECT3DRMLIGHT *) PURE;
STDMETHOD(CreateLightRGB)
(THIS_ D3DRMLIGHTTYPE, D3DVALUE, D3DVALUE, D3DVALUE, LPDIRECT3DRMLIGHT *) PURE;
STDMETHOD(CreateMaterial) (THIS_ D3DVALUE, LPDIRECT3DRMMATERIAL *) PURE;
STDMETHOD(CreateDevice) (THIS_ DWORD, DWORD, LPDIRECT3DRMDEVICE2 *) PURE;
/* Create a Windows Device using DirectDraw surfaces */
STDMETHOD(CreateDeviceFromSurface)
( THIS_ LPGUID lpGUID, LPDIRECTDRAW lpDD,
LPDIRECTDRAWSURFACE lpDDSBack, LPDIRECT3DRMDEVICE2 *
) PURE;
/* Create a Windows Device using D3D objects */
STDMETHOD(CreateDeviceFromD3D)
( THIS_ LPDIRECT3D2 lpD3D, LPDIRECT3DDEVICE2 lpD3DDev,
LPDIRECT3DRMDEVICE2 *
) PURE;
STDMETHOD(CreateDeviceFromClipper)
( THIS_ LPDIRECTDRAWCLIPPER lpDDClipper, LPGUID lpGUID,
int width, int height, LPDIRECT3DRMDEVICE2 *) PURE;
STDMETHOD(CreateTextureFromSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDS, LPDIRECT3DRMTEXTURE2 *) PURE;
STDMETHOD(CreateShadow)
( THIS_ LPDIRECT3DRMVISUAL, LPDIRECT3DRMLIGHT,
D3DVALUE px, D3DVALUE py, D3DVALUE pz,
D3DVALUE nx, D3DVALUE ny, D3DVALUE nz,
LPDIRECT3DRMVISUAL *
) PURE;
STDMETHOD(CreateViewport)
( THIS_ LPDIRECT3DRMDEVICE, LPDIRECT3DRMFRAME, DWORD, DWORD,
DWORD, DWORD, LPDIRECT3DRMVIEWPORT *
) PURE;
STDMETHOD(CreateWrap)
( THIS_ D3DRMWRAPTYPE, LPDIRECT3DRMFRAME,
D3DVALUE ox, D3DVALUE oy, D3DVALUE oz,
D3DVALUE dx, D3DVALUE dy, D3DVALUE dz,
D3DVALUE ux, D3DVALUE uy, D3DVALUE uz,
D3DVALUE ou, D3DVALUE ov,
D3DVALUE su, D3DVALUE sv,
LPDIRECT3DRMWRAP *
) PURE;
STDMETHOD(CreateUserVisual) (THIS_ D3DRMUSERVISUALCALLBACK, LPVOID lPArg, LPDIRECT3DRMUSERVISUAL *) PURE;
STDMETHOD(LoadTexture) (THIS_ const char *, LPDIRECT3DRMTEXTURE2 *) PURE;
STDMETHOD(LoadTextureFromResource) (THIS_ HMODULE hModule, LPCTSTR strName, LPCTSTR strType, LPDIRECT3DRMTEXTURE2 *) PURE;
STDMETHOD(SetSearchPath) (THIS_ LPCSTR) PURE;
STDMETHOD(AddSearchPath) (THIS_ LPCSTR) PURE;
STDMETHOD(GetSearchPath) (THIS_ DWORD *size_return, LPSTR path_return) PURE;
STDMETHOD(SetDefaultTextureColors)(THIS_ DWORD) PURE;
STDMETHOD(SetDefaultTextureShades)(THIS_ DWORD) PURE;
STDMETHOD(GetDevices) (THIS_ LPDIRECT3DRMDEVICEARRAY *) PURE;
STDMETHOD(GetNamedObject) (THIS_ const char *, LPDIRECT3DRMOBJECT *) PURE;
STDMETHOD(EnumerateObjects) (THIS_ D3DRMOBJECTCALLBACK, LPVOID) PURE;
STDMETHOD(Load)
( THIS_ LPVOID, LPVOID, LPIID *, DWORD, D3DRMLOADOPTIONS,
D3DRMLOADCALLBACK, LPVOID, D3DRMLOADTEXTURECALLBACK, LPVOID,
LPDIRECT3DRMFRAME
) PURE;
STDMETHOD(Tick) (THIS_ D3DVALUE) PURE;
STDMETHOD(CreateProgressiveMesh)(THIS_ LPDIRECT3DRMPROGRESSIVEMESH *) PURE;
};
#undef INTERFACE
#define INTERFACE IDirect3DRM3
DECLARE_INTERFACE_(IDirect3DRM3, IUnknown)
{
IUNKNOWN_METHODS(PURE);
STDMETHOD(CreateObject)
(THIS_ REFCLSID rclsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID FAR* ppv) PURE;
STDMETHOD(CreateFrame) (THIS_ LPDIRECT3DRMFRAME3, LPDIRECT3DRMFRAME3 *) PURE;
STDMETHOD(CreateMesh) (THIS_ LPDIRECT3DRMMESH *) PURE;
STDMETHOD(CreateMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER3 *) PURE;
STDMETHOD(CreateFace) (THIS_ LPDIRECT3DRMFACE2 *) PURE;
STDMETHOD(CreateAnimation) (THIS_ LPDIRECT3DRMANIMATION2 *) PURE;
STDMETHOD(CreateAnimationSet)(THIS_ LPDIRECT3DRMANIMATIONSET2 *) PURE;
STDMETHOD(CreateTexture) (THIS_ LPD3DRMIMAGE, LPDIRECT3DRMTEXTURE3 *) PURE;
STDMETHOD(CreateLight) (THIS_ D3DRMLIGHTTYPE, D3DCOLOR, LPDIRECT3DRMLIGHT *) PURE;
STDMETHOD(CreateLightRGB)
(THIS_ D3DRMLIGHTTYPE, D3DVALUE, D3DVALUE, D3DVALUE, LPDIRECT3DRMLIGHT *) PURE;
STDMETHOD(CreateMaterial) (THIS_ D3DVALUE, LPDIRECT3DRMMATERIAL2 *) PURE;
STDMETHOD(CreateDevice) (THIS_ DWORD, DWORD, LPDIRECT3DRMDEVICE3 *) PURE;
/* Create a Windows Device using DirectDraw surfaces */
STDMETHOD(CreateDeviceFromSurface)
( THIS_ LPGUID lpGUID, LPDIRECTDRAW lpDD,
LPDIRECTDRAWSURFACE lpDDSBack, DWORD dwFlags, LPDIRECT3DRMDEVICE3 *
) PURE;
/* Create a Windows Device using D3D objects */
STDMETHOD(CreateDeviceFromD3D)
( THIS_ LPDIRECT3D2 lpD3D, LPDIRECT3DDEVICE2 lpD3DDev,
LPDIRECT3DRMDEVICE3 *
) PURE;
STDMETHOD(CreateDeviceFromClipper)
( THIS_ LPDIRECTDRAWCLIPPER lpDDClipper, LPGUID lpGUID,
int width, int height, LPDIRECT3DRMDEVICE3 *) PURE;
STDMETHOD(CreateTextureFromSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDS, LPDIRECT3DRMTEXTURE3 *) PURE;
STDMETHOD(CreateShadow)
( THIS_ LPUNKNOWN, LPDIRECT3DRMLIGHT,
D3DVALUE px, D3DVALUE py, D3DVALUE pz,
D3DVALUE nx, D3DVALUE ny, D3DVALUE nz,
LPDIRECT3DRMSHADOW2 *
) PURE;
STDMETHOD(CreateViewport)
( THIS_ LPDIRECT3DRMDEVICE3, LPDIRECT3DRMFRAME3, DWORD, DWORD,
DWORD, DWORD, LPDIRECT3DRMVIEWPORT2 *
) PURE;
STDMETHOD(CreateWrap)
( THIS_ D3DRMWRAPTYPE, LPDIRECT3DRMFRAME3,
D3DVALUE ox, D3DVALUE oy, D3DVALUE oz,
D3DVALUE dx, D3DVALUE dy, D3DVALUE dz,
D3DVALUE ux, D3DVALUE uy, D3DVALUE uz,
D3DVALUE ou, D3DVALUE ov,
D3DVALUE su, D3DVALUE sv,
LPDIRECT3DRMWRAP *
) PURE;
STDMETHOD(CreateUserVisual) (THIS_ D3DRMUSERVISUALCALLBACK, LPVOID lPArg, LPDIRECT3DRMUSERVISUAL *) PURE;
STDMETHOD(LoadTexture) (THIS_ const char *, LPDIRECT3DRMTEXTURE3 *) PURE;
STDMETHOD(LoadTextureFromResource) (THIS_ HMODULE hModule, LPCTSTR strName, LPCTSTR strType, LPDIRECT3DRMTEXTURE3 *) PURE;
STDMETHOD(SetSearchPath) (THIS_ LPCSTR) PURE;
STDMETHOD(AddSearchPath) (THIS_ LPCSTR) PURE;
STDMETHOD(GetSearchPath) (THIS_ DWORD *size_return, LPSTR path_return) PURE;
STDMETHOD(SetDefaultTextureColors)(THIS_ DWORD) PURE;
STDMETHOD(SetDefaultTextureShades)(THIS_ DWORD) PURE;
STDMETHOD(GetDevices) (THIS_ LPDIRECT3DRMDEVICEARRAY *) PURE;
STDMETHOD(GetNamedObject) (THIS_ const char *, LPDIRECT3DRMOBJECT *) PURE;
STDMETHOD(EnumerateObjects) (THIS_ D3DRMOBJECTCALLBACK, LPVOID) PURE;
STDMETHOD(Load)
( THIS_ LPVOID, LPVOID, LPIID *, DWORD, D3DRMLOADOPTIONS,
D3DRMLOADCALLBACK, LPVOID, D3DRMLOADTEXTURE3CALLBACK, LPVOID,
LPDIRECT3DRMFRAME3
) PURE;
STDMETHOD(Tick) (THIS_ D3DVALUE) PURE;
STDMETHOD(CreateProgressiveMesh)(THIS_ LPDIRECT3DRMPROGRESSIVEMESH *) PURE;
/* Used with IDirect3DRMObject2 */
STDMETHOD(RegisterClient) (THIS_ REFGUID rguid, LPDWORD lpdwID) PURE;
STDMETHOD(UnregisterClient) (THIS_ REFGUID rguid) PURE;
STDMETHOD(CreateClippedVisual) (THIS_ LPDIRECT3DRMVISUAL, LPDIRECT3DRMCLIPPEDVISUAL *) PURE;
STDMETHOD(SetOptions) (THIS_ DWORD);
STDMETHOD(GetOptions) (THIS_ LPDWORD);
};
#define D3DRM_OK DD_OK
#define D3DRMERR_BADOBJECT MAKE_DDHRESULT(781)
#define D3DRMERR_BADTYPE MAKE_DDHRESULT(782)
#define D3DRMERR_BADALLOC MAKE_DDHRESULT(783)
#define D3DRMERR_FACEUSED MAKE_DDHRESULT(784)
#define D3DRMERR_NOTFOUND MAKE_DDHRESULT(785)
#define D3DRMERR_NOTDONEYET MAKE_DDHRESULT(786)
#define D3DRMERR_FILENOTFOUND MAKE_DDHRESULT(787)
#define D3DRMERR_BADFILE MAKE_DDHRESULT(788)
#define D3DRMERR_BADDEVICE MAKE_DDHRESULT(789)
#define D3DRMERR_BADVALUE MAKE_DDHRESULT(790)
#define D3DRMERR_BADMAJORVERSION MAKE_DDHRESULT(791)
#define D3DRMERR_BADMINORVERSION MAKE_DDHRESULT(792)
#define D3DRMERR_UNABLETOEXECUTE MAKE_DDHRESULT(793)
#define D3DRMERR_LIBRARYNOTFOUND MAKE_DDHRESULT(794)
#define D3DRMERR_INVALIDLIBRARY MAKE_DDHRESULT(795)
#define D3DRMERR_PENDING MAKE_DDHRESULT(796)
#define D3DRMERR_NOTENOUGHDATA MAKE_DDHRESULT(797)
#define D3DRMERR_REQUESTTOOLARGE MAKE_DDHRESULT(798)
#define D3DRMERR_REQUESTTOOSMALL MAKE_DDHRESULT(799)
#define D3DRMERR_CONNECTIONLOST MAKE_DDHRESULT(800)
#define D3DRMERR_LOADABORTED MAKE_DDHRESULT(801)
#define D3DRMERR_NOINTERNET MAKE_DDHRESULT(802)
#define D3DRMERR_BADCACHEFILE MAKE_DDHRESULT(803)
#define D3DRMERR_BOXNOTSET MAKE_DDHRESULT(804)
#define D3DRMERR_BADPMDATA MAKE_DDHRESULT(805)
#define D3DRMERR_CLIENTNOTREGISTERED MAKE_DDHRESULT(806)
#define D3DRMERR_NOTCREATEDFROMDDS MAKE_DDHRESULT(807)
#define D3DRMERR_NOSUCHKEY MAKE_DDHRESULT(808)
#define D3DRMERR_INCOMPATABLEKEY MAKE_DDHRESULT(809)
#define D3DRMERR_ELEMENTINUSE MAKE_DDHRESULT(810)
#define D3DRMERR_TEXTUREFORMATNOTFOUND MAKE_DDHRESULT(811)
#define D3DRMERR_NOTAGGREGATED MAKE_DDHRESULT(812)
#ifdef __cplusplus
};
#endif
#endif /* _D3DRMAPI_H_ */

View File

@ -0,0 +1,695 @@
/*==========================================================================;
*
* Copyright (c) Microsoft Corporation. All rights reserved.
*
* File: d3drm.h
* Content: Direct3DRM include file
*
***************************************************************************/
#ifndef __D3DRMDEFS_H__
#define __D3DRMDEFS_H__
#include <stddef.h>
#include "d3dtypes.h"
#ifdef WIN32
#define D3DRMAPI __stdcall
#else
#define D3DRMAPI
#endif
#if defined(__cplusplus)
extern "C" {
#endif
#ifndef TRUE
#define FALSE 0
#define TRUE 1
#endif
typedef struct _D3DRMVECTOR4D
{ D3DVALUE x, y, z, w;
} D3DRMVECTOR4D, *LPD3DRMVECTOR4D;
typedef D3DVALUE D3DRMMATRIX4D[4][4];
typedef struct _D3DRMQUATERNION
{ D3DVALUE s;
D3DVECTOR v;
} D3DRMQUATERNION, *LPD3DRMQUATERNION;
typedef struct _D3DRMRAY
{ D3DVECTOR dvDir;
D3DVECTOR dvPos;
} D3DRMRAY, *LPD3DRMRAY;
typedef struct _D3DRMBOX
{ D3DVECTOR min, max;
} D3DRMBOX, *LPD3DRMBOX;
typedef void (*D3DRMWRAPCALLBACK)
(LPD3DVECTOR, int* u, int* v, LPD3DVECTOR a, LPD3DVECTOR b, LPVOID);
typedef enum _D3DRMLIGHTTYPE
{ D3DRMLIGHT_AMBIENT,
D3DRMLIGHT_POINT,
D3DRMLIGHT_SPOT,
D3DRMLIGHT_DIRECTIONAL,
D3DRMLIGHT_PARALLELPOINT
} D3DRMLIGHTTYPE, *LPD3DRMLIGHTTYPE;
typedef enum _D3DRMSHADEMODE {
D3DRMSHADE_FLAT = 0,
D3DRMSHADE_GOURAUD = 1,
D3DRMSHADE_PHONG = 2,
D3DRMSHADE_MASK = 7,
D3DRMSHADE_MAX = 8
} D3DRMSHADEMODE, *LPD3DRMSHADEMODE;
typedef enum _D3DRMLIGHTMODE {
D3DRMLIGHT_OFF = 0 * D3DRMSHADE_MAX,
D3DRMLIGHT_ON = 1 * D3DRMSHADE_MAX,
D3DRMLIGHT_MASK = 7 * D3DRMSHADE_MAX,
D3DRMLIGHT_MAX = 8 * D3DRMSHADE_MAX
} D3DRMLIGHTMODE, *LPD3DRMLIGHTMODE;
typedef enum _D3DRMFILLMODE {
D3DRMFILL_POINTS = 0 * D3DRMLIGHT_MAX,
D3DRMFILL_WIREFRAME = 1 * D3DRMLIGHT_MAX,
D3DRMFILL_SOLID = 2 * D3DRMLIGHT_MAX,
D3DRMFILL_MASK = 7 * D3DRMLIGHT_MAX,
D3DRMFILL_MAX = 8 * D3DRMLIGHT_MAX
} D3DRMFILLMODE, *LPD3DRMFILLMODE;
typedef DWORD D3DRMRENDERQUALITY, *LPD3DRMRENDERQUALITY;
#define D3DRMRENDER_WIREFRAME (D3DRMSHADE_FLAT+D3DRMLIGHT_OFF+D3DRMFILL_WIREFRAME)
#define D3DRMRENDER_UNLITFLAT (D3DRMSHADE_FLAT+D3DRMLIGHT_OFF+D3DRMFILL_SOLID)
#define D3DRMRENDER_FLAT (D3DRMSHADE_FLAT+D3DRMLIGHT_ON+D3DRMFILL_SOLID)
#define D3DRMRENDER_GOURAUD (D3DRMSHADE_GOURAUD+D3DRMLIGHT_ON+D3DRMFILL_SOLID)
#define D3DRMRENDER_PHONG (D3DRMSHADE_PHONG+D3DRMLIGHT_ON+D3DRMFILL_SOLID)
#define D3DRMRENDERMODE_BLENDEDTRANSPARENCY 1
#define D3DRMRENDERMODE_SORTEDTRANSPARENCY 2
#define D3DRMRENDERMODE_LIGHTINMODELSPACE 8
#define D3DRMRENDERMODE_VIEWDEPENDENTSPECULAR 16
#define D3DRMRENDERMODE_DISABLESORTEDALPHAZWRITE 32
typedef enum _D3DRMTEXTUREQUALITY
{ D3DRMTEXTURE_NEAREST, /* choose nearest texel */
D3DRMTEXTURE_LINEAR, /* interpolate 4 texels */
D3DRMTEXTURE_MIPNEAREST, /* nearest texel in nearest mipmap */
D3DRMTEXTURE_MIPLINEAR, /* interpolate 2 texels from 2 mipmaps */
D3DRMTEXTURE_LINEARMIPNEAREST, /* interpolate 4 texels in nearest mipmap */
D3DRMTEXTURE_LINEARMIPLINEAR /* interpolate 8 texels from 2 mipmaps */
} D3DRMTEXTUREQUALITY, *LPD3DRMTEXTUREQUALITY;
/*
* Texture flags
*/
#define D3DRMTEXTURE_FORCERESIDENT 0x00000001 /* texture should be kept in video memory */
#define D3DRMTEXTURE_STATIC 0x00000002 /* texture will not change */
#define D3DRMTEXTURE_DOWNSAMPLEPOINT 0x00000004 /* point filtering should be used when downsampling */
#define D3DRMTEXTURE_DOWNSAMPLEBILINEAR 0x00000008 /* bilinear filtering should be used when downsampling */
#define D3DRMTEXTURE_DOWNSAMPLEREDUCEDEPTH 0x00000010 /* reduce bit depth when downsampling */
#define D3DRMTEXTURE_DOWNSAMPLENONE 0x00000020 /* texture should never be downsampled */
#define D3DRMTEXTURE_CHANGEDPIXELS 0x00000040 /* pixels have changed */
#define D3DRMTEXTURE_CHANGEDPALETTE 0x00000080 /* palette has changed */
#define D3DRMTEXTURE_INVALIDATEONLY 0x00000100 /* dirty regions are invalid */
/*
* Shadow flags
*/
#define D3DRMSHADOW_TRUEALPHA 0x00000001 /* shadow should render without artifacts when true alpha is on */
typedef enum _D3DRMCOMBINETYPE
{ D3DRMCOMBINE_REPLACE,
D3DRMCOMBINE_BEFORE,
D3DRMCOMBINE_AFTER
} D3DRMCOMBINETYPE, *LPD3DRMCOMBINETYPE;
typedef D3DCOLORMODEL D3DRMCOLORMODEL, *LPD3DRMCOLORMODEL;
typedef enum _D3DRMPALETTEFLAGS
{ D3DRMPALETTE_FREE, /* renderer may use this entry freely */
D3DRMPALETTE_READONLY, /* fixed but may be used by renderer */
D3DRMPALETTE_RESERVED /* may not be used by renderer */
} D3DRMPALETTEFLAGS, *LPD3DRMPALETTEFLAGS;
typedef struct _D3DRMPALETTEENTRY
{ unsigned char red; /* 0 .. 255 */
unsigned char green; /* 0 .. 255 */
unsigned char blue; /* 0 .. 255 */
unsigned char flags; /* one of D3DRMPALETTEFLAGS */
} D3DRMPALETTEENTRY, *LPD3DRMPALETTEENTRY;
typedef struct _D3DRMIMAGE
{ int width, height; /* width and height in pixels */
int aspectx, aspecty; /* aspect ratio for non-square pixels */
int depth; /* bits per pixel */
int rgb; /* if false, pixels are indices into a
palette otherwise, pixels encode
RGB values. */
int bytes_per_line; /* number of bytes of memory for a
scanline. This must be a multiple
of 4. */
void* buffer1; /* memory to render into (first buffer). */
void* buffer2; /* second rendering buffer for double
buffering, set to NULL for single
buffering. */
unsigned long red_mask;
unsigned long green_mask;
unsigned long blue_mask;
unsigned long alpha_mask; /* if rgb is true, these are masks for
the red, green and blue parts of a
pixel. Otherwise, these are masks
for the significant bits of the
red, green and blue elements in the
palette. For instance, most SVGA
displays use 64 intensities of red,
green and blue, so the masks should
all be set to 0xfc. */
int palette_size; /* number of entries in palette */
D3DRMPALETTEENTRY* palette; /* description of the palette (only if
rgb is false). Must be (1<<depth)
elements. */
} D3DRMIMAGE, *LPD3DRMIMAGE;
typedef enum _D3DRMWRAPTYPE
{ D3DRMWRAP_FLAT,
D3DRMWRAP_CYLINDER,
D3DRMWRAP_SPHERE,
D3DRMWRAP_CHROME,
D3DRMWRAP_SHEET,
D3DRMWRAP_BOX
} D3DRMWRAPTYPE, *LPD3DRMWRAPTYPE;
#define D3DRMWIREFRAME_CULL 1 /* cull backfaces */
#define D3DRMWIREFRAME_HIDDENLINE 2 /* lines are obscured by closer objects */
/*
* Do not use righthanded perspective in Viewport2::SetProjection().
* Set up righthanded mode by using IDirect3DRM3::SetOptions().
*/
typedef enum _D3DRMPROJECTIONTYPE
{ D3DRMPROJECT_PERSPECTIVE,
D3DRMPROJECT_ORTHOGRAPHIC,
D3DRMPROJECT_RIGHTHANDPERSPECTIVE, /* Only valid pre-DX6 */
D3DRMPROJECT_RIGHTHANDORTHOGRAPHIC /* Only valid pre-DX6 */
} D3DRMPROJECTIONTYPE, *LPD3DRMPROJECTIONTYPE;
#define D3DRMOPTIONS_LEFTHANDED 0x00000001L /* Default */
#define D3DRMOPTIONS_RIGHTHANDED 0x00000002L
typedef enum _D3DRMXOFFORMAT
{ D3DRMXOF_BINARY,
D3DRMXOF_COMPRESSED,
D3DRMXOF_TEXT
} D3DRMXOFFORMAT, *LPD3DRMXOFFORMAT;
typedef DWORD D3DRMSAVEOPTIONS;
#define D3DRMXOFSAVE_NORMALS 1
#define D3DRMXOFSAVE_TEXTURECOORDINATES 2
#define D3DRMXOFSAVE_MATERIALS 4
#define D3DRMXOFSAVE_TEXTURENAMES 8
#define D3DRMXOFSAVE_ALL 15
#define D3DRMXOFSAVE_TEMPLATES 16
#define D3DRMXOFSAVE_TEXTURETOPOLOGY 32
typedef enum _D3DRMCOLORSOURCE
{ D3DRMCOLOR_FROMFACE,
D3DRMCOLOR_FROMVERTEX
} D3DRMCOLORSOURCE, *LPD3DRMCOLORSOURCE;
typedef enum _D3DRMFRAMECONSTRAINT
{ D3DRMCONSTRAIN_Z, /* use only X and Y rotations */
D3DRMCONSTRAIN_Y, /* use only X and Z rotations */
D3DRMCONSTRAIN_X /* use only Y and Z rotations */
} D3DRMFRAMECONSTRAINT, *LPD3DRMFRAMECONSTRAINT;
typedef enum _D3DRMMATERIALMODE
{ D3DRMMATERIAL_FROMMESH,
D3DRMMATERIAL_FROMPARENT,
D3DRMMATERIAL_FROMFRAME
} D3DRMMATERIALMODE, *LPD3DRMMATERIALMODE;
typedef enum _D3DRMFOGMODE
{ D3DRMFOG_LINEAR, /* linear between start and end */
D3DRMFOG_EXPONENTIAL, /* density * exp(-distance) */
D3DRMFOG_EXPONENTIALSQUARED /* density * exp(-distance*distance) */
} D3DRMFOGMODE, *LPD3DRMFOGMODE;
typedef enum _D3DRMZBUFFERMODE {
D3DRMZBUFFER_FROMPARENT, /* default */
D3DRMZBUFFER_ENABLE, /* enable zbuffering */
D3DRMZBUFFER_DISABLE /* disable zbuffering */
} D3DRMZBUFFERMODE, *LPD3DRMZBUFFERMODE;
typedef enum _D3DRMSORTMODE {
D3DRMSORT_FROMPARENT, /* default */
D3DRMSORT_NONE, /* don't sort child frames */
D3DRMSORT_FRONTTOBACK, /* sort child frames front-to-back */
D3DRMSORT_BACKTOFRONT /* sort child frames back-to-front */
} D3DRMSORTMODE, *LPD3DRMSORTMODE;
typedef struct _D3DRMMATERIALOVERRIDE
{
DWORD dwSize; /* Size of this structure */
DWORD dwFlags; /* Indicate which fields are valid */
D3DCOLORVALUE dcDiffuse; /* RGBA */
D3DCOLORVALUE dcAmbient; /* RGB */
D3DCOLORVALUE dcEmissive; /* RGB */
D3DCOLORVALUE dcSpecular; /* RGB */
D3DVALUE dvPower;
LPUNKNOWN lpD3DRMTex;
} D3DRMMATERIALOVERRIDE, *LPD3DRMMATERIALOVERRIDE;
#define D3DRMMATERIALOVERRIDE_DIFFUSE_ALPHAONLY 0x00000001L
#define D3DRMMATERIALOVERRIDE_DIFFUSE_RGBONLY 0x00000002L
#define D3DRMMATERIALOVERRIDE_DIFFUSE 0x00000003L
#define D3DRMMATERIALOVERRIDE_AMBIENT 0x00000004L
#define D3DRMMATERIALOVERRIDE_EMISSIVE 0x00000008L
#define D3DRMMATERIALOVERRIDE_SPECULAR 0x00000010L
#define D3DRMMATERIALOVERRIDE_POWER 0x00000020L
#define D3DRMMATERIALOVERRIDE_TEXTURE 0x00000040L
#define D3DRMMATERIALOVERRIDE_DIFFUSE_ALPHAMULTIPLY 0x00000080L
#define D3DRMMATERIALOVERRIDE_ALL 0x000000FFL
#define D3DRMFPTF_ALPHA 0x00000001L
#define D3DRMFPTF_NOALPHA 0x00000002L
#define D3DRMFPTF_PALETTIZED 0x00000004L
#define D3DRMFPTF_NOTPALETTIZED 0x00000008L
#define D3DRMSTATECHANGE_UPDATEONLY 0x000000001L
#define D3DRMSTATECHANGE_VOLATILE 0x000000002L
#define D3DRMSTATECHANGE_NONVOLATILE 0x000000004L
#define D3DRMSTATECHANGE_RENDER 0x000000020L
#define D3DRMSTATECHANGE_LIGHT 0x000000040L
/*
* Values for flags in RM3::CreateDeviceFromSurface
*/
#define D3DRMDEVICE_NOZBUFFER 0x00000001L
/*
* Values for flags in Object2::SetClientData
*/
#define D3DRMCLIENTDATA_NONE 0x00000001L
#define D3DRMCLIENTDATA_LOCALFREE 0x00000002L
#define D3DRMCLIENTDATA_IUNKNOWN 0x00000004L
/*
* Values for flags in Frame2::AddMoveCallback.
*/
#define D3DRMCALLBACK_PREORDER 0
#define D3DRMCALLBACK_POSTORDER 1
/*
* Values for flags in MeshBuilder2::RayPick.
*/
#define D3DRMRAYPICK_ONLYBOUNDINGBOXES 1
#define D3DRMRAYPICK_IGNOREFURTHERPRIMITIVES 2
#define D3DRMRAYPICK_INTERPOLATEUV 4
#define D3DRMRAYPICK_INTERPOLATECOLOR 8
#define D3DRMRAYPICK_INTERPOLATENORMAL 0x10
/*
* Values for flags in MeshBuilder3::AddFacesIndexed.
*/
#define D3DRMADDFACES_VERTICESONLY 1
/*
* Values for flags in MeshBuilder2::GenerateNormals.
*/
#define D3DRMGENERATENORMALS_PRECOMPACT 1
#define D3DRMGENERATENORMALS_USECREASEANGLE 2
/*
* Values for MeshBuilder3::GetParentMesh
*/
#define D3DRMMESHBUILDER_DIRECTPARENT 1
#define D3DRMMESHBUILDER_ROOTMESH 2
/*
* Flags for MeshBuilder3::Enable
*/
#define D3DRMMESHBUILDER_RENDERENABLE 0x00000001L
#define D3DRMMESHBUILDER_PICKENABLE 0x00000002L
/*
* Flags for MeshBuilder3::AddMeshBuilder
*/
#define D3DRMADDMESHBUILDER_DONTCOPYAPPDATA 1
#define D3DRMADDMESHBUILDER_FLATTENSUBMESHES 2
#define D3DRMADDMESHBUILDER_NOSUBMESHES 4
/*
* Flags for Object2::GetAge when used with MeshBuilders
*/
#define D3DRMMESHBUILDERAGE_GEOMETRY 0x00000001L
#define D3DRMMESHBUILDERAGE_MATERIALS 0x00000002L
#define D3DRMMESHBUILDERAGE_TEXTURES 0x00000004L
/*
* Format flags for MeshBuilder3::AddTriangles.
*/
#define D3DRMFVF_TYPE 0x00000001L
#define D3DRMFVF_NORMAL 0x00000002L
#define D3DRMFVF_COLOR 0x00000004L
#define D3DRMFVF_TEXTURECOORDS 0x00000008L
#define D3DRMVERTEX_STRIP 0x00000001L
#define D3DRMVERTEX_FAN 0x00000002L
#define D3DRMVERTEX_LIST 0x00000004L
/*
* Values for flags in Viewport2::Clear2
*/
#define D3DRMCLEAR_TARGET 0x00000001L
#define D3DRMCLEAR_ZBUFFER 0x00000002L
#define D3DRMCLEAR_DIRTYRECTS 0x00000004L
#define D3DRMCLEAR_ALL (D3DRMCLEAR_TARGET | \
D3DRMCLEAR_ZBUFFER | \
D3DRMCLEAR_DIRTYRECTS)
/*
* Values for flags in Frame3::SetSceneFogMethod
*/
#define D3DRMFOGMETHOD_VERTEX 0x00000001L
#define D3DRMFOGMETHOD_TABLE 0x00000002L
#define D3DRMFOGMETHOD_ANY 0x00000004L
/*
* Values for flags in Frame3::SetTraversalOptions
*/
#define D3DRMFRAME_RENDERENABLE 0x00000001L
#define D3DRMFRAME_PICKENABLE 0x00000002L
typedef DWORD D3DRMANIMATIONOPTIONS;
#define D3DRMANIMATION_OPEN 0x01L
#define D3DRMANIMATION_CLOSED 0x02L
#define D3DRMANIMATION_LINEARPOSITION 0x04L
#define D3DRMANIMATION_SPLINEPOSITION 0x08L
#define D3DRMANIMATION_SCALEANDROTATION 0x00000010L
#define D3DRMANIMATION_POSITION 0x00000020L
typedef DWORD D3DRMINTERPOLATIONOPTIONS;
#define D3DRMINTERPOLATION_OPEN 0x01L
#define D3DRMINTERPOLATION_CLOSED 0x02L
#define D3DRMINTERPOLATION_NEAREST 0x0100L
#define D3DRMINTERPOLATION_LINEAR 0x04L
#define D3DRMINTERPOLATION_SPLINE 0x08L
#define D3DRMINTERPOLATION_VERTEXCOLOR 0x40L
#define D3DRMINTERPOLATION_SLERPNORMALS 0x80L
typedef DWORD D3DRMLOADOPTIONS;
#define D3DRMLOAD_FROMFILE 0x00L
#define D3DRMLOAD_FROMRESOURCE 0x01L
#define D3DRMLOAD_FROMMEMORY 0x02L
#define D3DRMLOAD_FROMSTREAM 0x04L
#define D3DRMLOAD_FROMURL 0x08L
#define D3DRMLOAD_BYNAME 0x10L
#define D3DRMLOAD_BYPOSITION 0x20L
#define D3DRMLOAD_BYGUID 0x40L
#define D3DRMLOAD_FIRST 0x80L
#define D3DRMLOAD_INSTANCEBYREFERENCE 0x100L
#define D3DRMLOAD_INSTANCEBYCOPYING 0x200L
#define D3DRMLOAD_ASYNCHRONOUS 0x400L
typedef struct _D3DRMLOADRESOURCE {
HMODULE hModule;
LPCTSTR lpName;
LPCTSTR lpType;
} D3DRMLOADRESOURCE, *LPD3DRMLOADRESOURCE;
typedef struct _D3DRMLOADMEMORY {
LPVOID lpMemory;
DWORD dSize;
} D3DRMLOADMEMORY, *LPD3DRMLOADMEMORY;
#define D3DRMPMESHSTATUS_VALID 0x01L
#define D3DRMPMESHSTATUS_INTERRUPTED 0x02L
#define D3DRMPMESHSTATUS_BASEMESHCOMPLETE 0x04L
#define D3DRMPMESHSTATUS_COMPLETE 0x08L
#define D3DRMPMESHSTATUS_RENDERABLE 0x10L
#define D3DRMPMESHEVENT_BASEMESH 0x01L
#define D3DRMPMESHEVENT_COMPLETE 0x02L
typedef struct _D3DRMPMESHLOADSTATUS {
DWORD dwSize; // Size of this structure
DWORD dwPMeshSize; // Total Size (bytes)
DWORD dwBaseMeshSize; // Total Size of the Base Mesh
DWORD dwBytesLoaded; // Total bytes loaded
DWORD dwVerticesLoaded; // Number of vertices loaded
DWORD dwFacesLoaded; // Number of faces loaded
HRESULT dwLoadResult; // Result of the load operation
DWORD dwFlags;
} D3DRMPMESHLOADSTATUS, *LPD3DRMPMESHLOADSTATUS;
typedef enum _D3DRMUSERVISUALREASON {
D3DRMUSERVISUAL_CANSEE,
D3DRMUSERVISUAL_RENDER
} D3DRMUSERVISUALREASON, *LPD3DRMUSERVISUALREASON;
typedef struct _D3DRMANIMATIONKEY
{
DWORD dwSize;
DWORD dwKeyType;
D3DVALUE dvTime;
DWORD dwID;
#if (!defined __cplusplus) || (!defined D3D_OVERLOADS)
union
{
D3DRMQUATERNION dqRotateKey;
D3DVECTOR dvScaleKey;
D3DVECTOR dvPositionKey;
};
#else
/*
* We do this as D3D_OVERLOADS defines constructors for D3DVECTOR,
* this can then not be used in a union. Use the inlines provided
* to extract and set the required component.
*/
D3DVALUE dvK[4];
#endif
} D3DRMANIMATIONKEY;
typedef D3DRMANIMATIONKEY *LPD3DRMANIMATIONKEY;
#if (defined __cplusplus) && (defined D3D_OVERLOADS)
inline VOID
D3DRMAnimationGetRotateKey(const D3DRMANIMATIONKEY& rmKey,
D3DRMQUATERNION& rmQuat)
{
rmQuat.s = rmKey.dvK[0];
rmQuat.v = D3DVECTOR(rmKey.dvK[1], rmKey.dvK[2], rmKey.dvK[3]);
}
inline VOID
D3DRMAnimationGetScaleKey(const D3DRMANIMATIONKEY& rmKey,
D3DVECTOR& dvVec)
{
dvVec = D3DVECTOR(rmKey.dvK[0], rmKey.dvK[1], rmKey.dvK[2]);
}
inline VOID
D3DRMAnimationGetPositionKey(const D3DRMANIMATIONKEY& rmKey,
D3DVECTOR& dvVec)
{
dvVec = D3DVECTOR(rmKey.dvK[0], rmKey.dvK[1], rmKey.dvK[2]);
}
inline VOID
D3DRMAnimationSetRotateKey(D3DRMANIMATIONKEY& rmKey,
const D3DRMQUATERNION& rmQuat)
{
rmKey.dvK[0] = rmQuat.s;
rmKey.dvK[1] = rmQuat.v.x;
rmKey.dvK[2] = rmQuat.v.y;
rmKey.dvK[3] = rmQuat.v.z;
}
inline VOID
D3DRMAnimationSetScaleKey(D3DRMANIMATIONKEY& rmKey,
const D3DVECTOR& dvVec)
{
rmKey.dvK[0] = dvVec.x;
rmKey.dvK[1] = dvVec.y;
rmKey.dvK[2] = dvVec.z;
}
inline VOID
D3DRMAnimationSetPositionKey(D3DRMANIMATIONKEY& rmKey,
const D3DVECTOR& dvVec)
{
rmKey.dvK[0] = dvVec.x;
rmKey.dvK[1] = dvVec.y;
rmKey.dvK[2] = dvVec.z;
}
#endif
#define D3DRMANIMATION_ROTATEKEY 0x01
#define D3DRMANIMATION_SCALEKEY 0x02
#define D3DRMANIMATION_POSITIONKEY 0x03
typedef DWORD D3DRMMAPPING, D3DRMMAPPINGFLAG, *LPD3DRMMAPPING;
static const D3DRMMAPPINGFLAG D3DRMMAP_WRAPU = 1;
static const D3DRMMAPPINGFLAG D3DRMMAP_WRAPV = 2;
static const D3DRMMAPPINGFLAG D3DRMMAP_PERSPCORRECT = 4;
typedef struct _D3DRMVERTEX
{ D3DVECTOR position;
D3DVECTOR normal;
D3DVALUE tu, tv;
D3DCOLOR color;
} D3DRMVERTEX, *LPD3DRMVERTEX;
typedef LONG D3DRMGROUPINDEX; /* group indexes begin a 0 */
static const D3DRMGROUPINDEX D3DRMGROUP_ALLGROUPS = -1;
/*
* Create a color from three components in the range 0-1 inclusive.
*/
extern D3DCOLOR D3DRMAPI D3DRMCreateColorRGB(D3DVALUE red,
D3DVALUE green,
D3DVALUE blue);
/*
* Create a color from four components in the range 0-1 inclusive.
*/
extern D3DCOLOR D3DRMAPI D3DRMCreateColorRGBA(D3DVALUE red,
D3DVALUE green,
D3DVALUE blue,
D3DVALUE alpha);
/*
* Get the red component of a color.
*/
extern D3DVALUE D3DRMAPI D3DRMColorGetRed(D3DCOLOR);
/*
* Get the green component of a color.
*/
extern D3DVALUE D3DRMAPI D3DRMColorGetGreen(D3DCOLOR);
/*
* Get the blue component of a color.
*/
extern D3DVALUE D3DRMAPI D3DRMColorGetBlue(D3DCOLOR);
/*
* Get the alpha component of a color.
*/
extern D3DVALUE D3DRMAPI D3DRMColorGetAlpha(D3DCOLOR);
/*
* Add two vectors. Returns its first argument.
*/
extern LPD3DVECTOR D3DRMAPI D3DRMVectorAdd(LPD3DVECTOR d,
LPD3DVECTOR s1,
LPD3DVECTOR s2);
/*
* Subtract two vectors. Returns its first argument.
*/
extern LPD3DVECTOR D3DRMAPI D3DRMVectorSubtract(LPD3DVECTOR d,
LPD3DVECTOR s1,
LPD3DVECTOR s2);
/*
* Reflect a ray about a given normal. Returns its first argument.
*/
extern LPD3DVECTOR D3DRMAPI D3DRMVectorReflect(LPD3DVECTOR d,
LPD3DVECTOR ray,
LPD3DVECTOR norm);
/*
* Calculate the vector cross product. Returns its first argument.
*/
extern LPD3DVECTOR D3DRMAPI D3DRMVectorCrossProduct(LPD3DVECTOR d,
LPD3DVECTOR s1,
LPD3DVECTOR s2);
/*
* Return the vector dot product.
*/
extern D3DVALUE D3DRMAPI D3DRMVectorDotProduct(LPD3DVECTOR s1,
LPD3DVECTOR s2);
/*
* Scale a vector so that its modulus is 1. Returns its argument or
* NULL if there was an error (e.g. a zero vector was passed).
*/
extern LPD3DVECTOR D3DRMAPI D3DRMVectorNormalize(LPD3DVECTOR);
#define D3DRMVectorNormalise D3DRMVectorNormalize
/*
* Return the length of a vector (e.g. sqrt(x*x + y*y + z*z)).
*/
extern D3DVALUE D3DRMAPI D3DRMVectorModulus(LPD3DVECTOR v);
/*
* Set the rotation part of a matrix to be a rotation of theta radians
* around the given axis.
*/
extern LPD3DVECTOR D3DRMAPI D3DRMVectorRotate(LPD3DVECTOR r, LPD3DVECTOR v, LPD3DVECTOR axis, D3DVALUE theta);
/*
* Scale a vector uniformly in all three axes
*/
extern LPD3DVECTOR D3DRMAPI D3DRMVectorScale(LPD3DVECTOR d, LPD3DVECTOR s, D3DVALUE factor);
/*
* Return a random unit vector
*/
extern LPD3DVECTOR D3DRMAPI D3DRMVectorRandom(LPD3DVECTOR d);
/*
* Returns a unit quaternion that represents a rotation of theta radians
* around the given axis.
*/
extern LPD3DRMQUATERNION D3DRMAPI D3DRMQuaternionFromRotation(LPD3DRMQUATERNION quat,
LPD3DVECTOR v,
D3DVALUE theta);
/*
* Calculate the product of two quaternions
*/
extern LPD3DRMQUATERNION D3DRMAPI D3DRMQuaternionMultiply(LPD3DRMQUATERNION q,
LPD3DRMQUATERNION a,
LPD3DRMQUATERNION b);
/*
* Interpolate between two quaternions
*/
extern LPD3DRMQUATERNION D3DRMAPI D3DRMQuaternionSlerp(LPD3DRMQUATERNION q,
LPD3DRMQUATERNION a,
LPD3DRMQUATERNION b,
D3DVALUE alpha);
/*
* Calculate the matrix for the rotation that a unit quaternion represents
*/
extern void D3DRMAPI D3DRMMatrixFromQuaternion(D3DRMMATRIX4D dmMat, LPD3DRMQUATERNION lpDqQuat);
/*
* Calculate the quaternion that corresponds to a rotation matrix
*/
extern LPD3DRMQUATERNION D3DRMAPI D3DRMQuaternionFromMatrix(LPD3DRMQUATERNION, D3DRMMATRIX4D);
#if defined(__cplusplus)
};
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,50 @@
/*==========================================================================;
*
* Copyright (c) Microsoft Corporation. All rights reserved.
*
* File: d3drm.h
* Content: Direct3DRM include file
*
***************************************************************************/
#ifndef __D3DRMWIN_H__
#define __D3DRMWIN_H__
#ifndef WIN32
#define WIN32
#endif
#include "d3drm.h"
#include "ddraw.h"
#include "d3d.h"
/*
* GUIDS used by Direct3DRM Windows interface
*/
DEFINE_GUID(IID_IDirect3DRMWinDevice, 0xc5016cc0, 0xd273, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1);
WIN_TYPES(IDirect3DRMWinDevice, DIRECT3DRMWINDEVICE);
#undef INTERFACE
#define INTERFACE IDirect3DRMWinDevice
DECLARE_INTERFACE_(IDirect3DRMWinDevice, IDirect3DRMObject)
{
IUNKNOWN_METHODS(PURE);
IDIRECT3DRMOBJECT_METHODS(PURE);
/*
* IDirect3DRMWinDevice methods
*/
/* Repaint the window with the last frame which was rendered. */
STDMETHOD(HandlePaint)(THIS_ HDC hdc) PURE;
/* Respond to a WM_ACTIVATE message. */
STDMETHOD(HandleActivate)(THIS_ WORD wparam) PURE;
};
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,255 @@
/******************************************************************
* *
* D3DVec.inl *
* *
* Float-valued 3D vector class for Direct3D. *
* *
* Copyright (c) Microsoft Corp. All rights reserved. *
* *
******************************************************************/
#include <math.h>
// =====================================
// Constructors
// =====================================
inline
_D3DVECTOR::_D3DVECTOR(D3DVALUE f)
{
x = y = z = f;
}
inline
_D3DVECTOR::_D3DVECTOR(D3DVALUE _x, D3DVALUE _y, D3DVALUE _z)
{
x = _x; y = _y; z = _z;
}
inline
_D3DVECTOR::_D3DVECTOR(const D3DVALUE f[3])
{
x = f[0]; y = f[1]; z = f[2];
}
// =====================================
// Access grants
// =====================================
inline const D3DVALUE&
_D3DVECTOR::operator[](int i) const
{
return (&x)[i];
}
inline D3DVALUE&
_D3DVECTOR::operator[](int i)
{
return (&x)[i];
}
// =====================================
// Assignment operators
// =====================================
inline _D3DVECTOR&
_D3DVECTOR::operator += (const _D3DVECTOR& v)
{
x += v.x; y += v.y; z += v.z;
return *this;
}
inline _D3DVECTOR&
_D3DVECTOR::operator -= (const _D3DVECTOR& v)
{
x -= v.x; y -= v.y; z -= v.z;
return *this;
}
inline _D3DVECTOR&
_D3DVECTOR::operator *= (const _D3DVECTOR& v)
{
x *= v.x; y *= v.y; z *= v.z;
return *this;
}
inline _D3DVECTOR&
_D3DVECTOR::operator /= (const _D3DVECTOR& v)
{
x /= v.x; y /= v.y; z /= v.z;
return *this;
}
inline _D3DVECTOR&
_D3DVECTOR::operator *= (D3DVALUE s)
{
x *= s; y *= s; z *= s;
return *this;
}
inline _D3DVECTOR&
_D3DVECTOR::operator /= (D3DVALUE s)
{
x /= s; y /= s; z /= s;
return *this;
}
inline _D3DVECTOR
operator + (const _D3DVECTOR& v)
{
return v;
}
inline _D3DVECTOR
operator - (const _D3DVECTOR& v)
{
return _D3DVECTOR(-v.x, -v.y, -v.z);
}
inline _D3DVECTOR
operator + (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
{
return _D3DVECTOR(v1.x+v2.x, v1.y+v2.y, v1.z+v2.z);
}
inline _D3DVECTOR
operator - (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
{
return _D3DVECTOR(v1.x-v2.x, v1.y-v2.y, v1.z-v2.z);
}
inline _D3DVECTOR
operator * (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
{
return _D3DVECTOR(v1.x*v2.x, v1.y*v2.y, v1.z*v2.z);
}
inline _D3DVECTOR
operator / (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
{
return _D3DVECTOR(v1.x/v2.x, v1.y/v2.y, v1.z/v2.z);
}
inline int
operator < (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
{
return v1[0] < v2[0] && v1[1] < v2[1] && v1[2] < v2[2];
}
inline int
operator <= (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
{
return v1[0] <= v2[0] && v1[1] <= v2[1] && v1[2] <= v2[2];
}
inline _D3DVECTOR
operator * (const _D3DVECTOR& v, D3DVALUE s)
{
return _D3DVECTOR(s*v.x, s*v.y, s*v.z);
}
inline _D3DVECTOR
operator * (D3DVALUE s, const _D3DVECTOR& v)
{
return _D3DVECTOR(s*v.x, s*v.y, s*v.z);
}
inline _D3DVECTOR
operator / (const _D3DVECTOR& v, D3DVALUE s)
{
return _D3DVECTOR(v.x/s, v.y/s, v.z/s);
}
inline int
operator == (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
{
return v1.x==v2.x && v1.y==v2.y && v1.z == v2.z;
}
inline D3DVALUE
Magnitude (const _D3DVECTOR& v)
{
return (D3DVALUE) sqrt(SquareMagnitude(v));
}
inline D3DVALUE
SquareMagnitude (const _D3DVECTOR& v)
{
return v.x*v.x + v.y*v.y + v.z*v.z;
}
inline _D3DVECTOR
Normalize (const _D3DVECTOR& v)
{
return v / Magnitude(v);
}
inline D3DVALUE
Min (const _D3DVECTOR& v)
{
D3DVALUE ret = v.x;
if (v.y < ret) ret = v.y;
if (v.z < ret) ret = v.z;
return ret;
}
inline D3DVALUE
Max (const _D3DVECTOR& v)
{
D3DVALUE ret = v.x;
if (ret < v.y) ret = v.y;
if (ret < v.z) ret = v.z;
return ret;
}
inline _D3DVECTOR
Minimize (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
{
return _D3DVECTOR( v1[0] < v2[0] ? v1[0] : v2[0],
v1[1] < v2[1] ? v1[1] : v2[1],
v1[2] < v2[2] ? v1[2] : v2[2]);
}
inline _D3DVECTOR
Maximize (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
{
return _D3DVECTOR( v1[0] > v2[0] ? v1[0] : v2[0],
v1[1] > v2[1] ? v1[1] : v2[1],
v1[2] > v2[2] ? v1[2] : v2[2]);
}
inline D3DVALUE
DotProduct (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
{
return v1.x*v2.x + v1.y * v2.y + v1.z*v2.z;
}
inline _D3DVECTOR
CrossProduct (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
{
_D3DVECTOR result;
result[0] = v1[1] * v2[2] - v1[2] * v2[1];
result[1] = v1[2] * v2[0] - v1[0] * v2[2];
result[2] = v1[0] * v2[1] - v1[1] * v2[0];
return result;
}
inline _D3DMATRIX
operator* (const _D3DMATRIX& a, const _D3DMATRIX& b)
{
_D3DMATRIX ret;
for (int i=0; i<4; i++) {
for (int j=0; j<4; j++) {
ret(i, j) = 0.0f;
for (int k=0; k<4; k++) {
ret(i, j) += a(i, k) * b(k, j);
}
}
}
return ret;
}

View File

@ -0,0 +1,26 @@
///////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx.h
// Content: D3DX utility library
//
///////////////////////////////////////////////////////////////////////////
#ifndef __D3DX_H__
#define __D3DX_H__
#ifndef D3DXINLINE
#ifdef __cplusplus
#define D3DXINLINE inline
#else
#define D3DXINLINE _inline
#endif
#endif
#include "d3dxcore.h"
#include "d3dxmath.h"
#include "d3dxshapes.h"
#include "d3dxsprite.h"
#endif //__D3DX_H__

View File

@ -0,0 +1,280 @@
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// File: D3DX10Effect.h
// Content: D3DX10 Effect / Shader loaders
//
//////////////////////////////////////////////////////////////////////////////
#ifndef __D3DX10EFFECT_H__
#define __D3DX10EFFECT_H__
#include "d3dx10.h"
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
//----------------------------------------------------------------------------
// D3DX10CompileShader:
// ------------------
// Compiles a shader.
//
// Parameters:
// pSrcFile
// Source file name.
// hSrcModule
// Module handle. if NULL, current module will be used.
// pSrcResource
// Resource name in module.
// pSrcData
// Pointer to source code.
// SrcDataLen
// Size of source code, in bytes.
// pDefines
// Optional NULL-terminated array of preprocessor macro definitions.
// pInclude
// Optional interface pointer to use for handling #include directives.
// If this parameter is NULL, #includes will be honored when compiling
// from file, and will error when compiling from resource or memory.
// pFunctionName
// Name of the entrypoint function where execution should begin.
// pProfile
// Instruction set to be used when generating code. Currently supported
// profiles are "vs_1_1", "vs_2_0", "vs_2_a", "vs_2_sw", "ps_1_1",
// "ps_1_2", "ps_1_3", "ps_1_4", "ps_2_0", "ps_2_a", "ps_2_sw", "tx_1_0"
// Flags
// See D3D10_SHADER_xxx flags.
// ppShader
// Returns a buffer containing the created shader. This buffer contains
// the compiled shader code, as well as any embedded debug and symbol
// table info. (See D3D10GetShaderConstantTable)
// ppErrorMsgs
// Returns a buffer containing a listing of errors and warnings that were
// encountered during the compile. If you are running in a debugger,
// these are the same messages you will see in your debug output.
//----------------------------------------------------------------------------
HRESULT WINAPI D3DX10CompileShaderFromFileA(LPCSTR pSrcFile,CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs);
HRESULT WINAPI D3DX10CompileShaderFromFileW(LPCWSTR pSrcFile, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs);
#ifdef UNICODE
#define D3DX10CompileShaderFromFile D3DX10CompileShaderFromFileW
#else
#define D3DX10CompileShaderFromFile D3DX10CompileShaderFromFileA
#endif
HRESULT WINAPI D3DX10CompileShaderFromResourceA(HMODULE hSrcModule, LPCSTR pSrcResource, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs);
HRESULT WINAPI D3DX10CompileShaderFromResourceW(HMODULE hSrcModule, LPCWSTR pSrcResource, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs);
#ifdef UNICODE
#define D3DX10CompileShaderFromResource D3DX10CompileShaderFromResourceW
#else
#define D3DX10CompileShaderFromResource D3DX10CompileShaderFromResourceA
#endif
HRESULT WINAPI D3DX10CompileShaderFromMemory(LPCSTR pSrcData, SIZE_T SrcDataLen, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs);
//----------------------------------------------------------------------------
// D3D10CreateEffectFromXXXX:
// --------------------------
// Creates an effect from a binary effect or file
//
// Parameters:
//
// [in]
//
// TODO: Unicode support
// TODO: Support for binary (and not just ASCII)
//
// pFileName
// Name of the ASCII (uncompiled) or binary (compiled) Effect file to load
//
// hModule
// Handle to the module containing the resource to compile from
// pResourceName
// Name of the resource within hModule to compile from
//
// pData
// Blob of effect data, either ASCII (uncompiled) or binary (compiled)
// DataLength
// Length of the data blob
//
// pDefines
// Optional NULL-terminated array of preprocessor macro definitions.
// pInclude
// Optional interface pointer to use for handling #include directives.
// If this parameter is NULL, #includes will be honored when compiling
// from file, and will error when compiling from resource or memory.
// HLSLFlags
// Compilation flags pertaining to shaders and data types, honored by
// the HLSL compiler
// FXFlags
// Compilation flags pertaining to Effect compilation, honored
// by the Effect compiler
// pDevice
// Pointer to the D3D10 device on which to create Effect resources
// pEffectPool
// Pointer to an Effect pool to share variables with or NULL
//
// [out]
//
// ppEffect
// Address of the newly created Effect interface
// ppEffectPool
// Address of the newly created Effect pool interface
// ppErrors
// If non-NULL, address of a buffer with error messages that occurred
// during parsing or compilation
//
//----------------------------------------------------------------------------
HRESULT WINAPI D3DX10CompileEffectFromFileA(LPCSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines,
ID3D10Include *pInclude, UINT HLSLFlags, UINT FXFlags, ID3DX10ThreadPump* pPump,
ID3D10Blob **ppCompiledEffect, ID3D10Blob **ppErrors);
HRESULT WINAPI D3DX10CompileEffectFromFileW(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines,
ID3D10Include *pInclude, UINT HLSLFlags, UINT FXFlags, ID3DX10ThreadPump* pPump,
ID3D10Blob **ppCompiledEffect, ID3D10Blob **ppErrors);
HRESULT WINAPI D3DX10CompileEffectFromMemory(LPCVOID pData, SIZE_T DataLength, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines,
ID3D10Include *pInclude, UINT HLSLFlags, UINT FXFlags,
ID3DX10ThreadPump* pPump, ID3D10Blob **ppCompiledEffect, ID3D10Blob **ppErrors);
HRESULT WINAPI D3DX10CompileEffectFromResourceA(HMODULE hModule, LPCSTR pResourceName, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines,
ID3D10Include *pInclude, UINT HLSLFlags, UINT FXFlags,
ID3DX10ThreadPump* pPump, ID3D10Blob **ppCompiledEffect, ID3D10Blob **ppErrors);
HRESULT WINAPI D3DX10CompileEffectFromResourceW(HMODULE hModule, LPCWSTR pResourceName, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines,
ID3D10Include *pInclude, UINT HLSLFlags, UINT FXFlags,
ID3DX10ThreadPump* pPump, ID3D10Blob **ppCompiledEffect, ID3D10Blob **ppErrors);
#ifdef UNICODE
#define D3DX10CompileEffectFromFile D3DX10CompileEffectFromFileW
#define D3DX10CompileEffectFromResource D3DX10CompileEffectFromResourceW
#else
#define D3DX10CompileEffectFromFile D3DX10CompileEffectFromFileA
#define D3DX10CompileEffectFromResource D3DX10CompileEffectFromResourceA
#endif
HRESULT WINAPI D3DX10CreateEffectFromFileA(LPCSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines,
ID3D10Include *pInclude, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors);
HRESULT WINAPI D3DX10CreateEffectFromFileW(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines,
ID3D10Include *pInclude, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors);
HRESULT WINAPI D3DX10CreateEffectFromMemory(LPCVOID pData, SIZE_T DataLength, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines,
ID3D10Include *pInclude, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors);
HRESULT WINAPI D3DX10CreateEffectFromResourceA(HMODULE hModule, LPCSTR pResourceName, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines,
ID3D10Include *pInclude, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors);
HRESULT WINAPI D3DX10CreateEffectFromResourceW(HMODULE hModule, LPCWSTR pResourceName, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines,
ID3D10Include *pInclude, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors);
#ifdef UNICODE
#define D3DX10CreateEffectFromFile D3DX10CreateEffectFromFileW
#define D3DX10CreateEffectFromResource D3DX10CreateEffectFromResourceW
#else
#define D3DX10CreateEffectFromFile D3DX10CreateEffectFromFileA
#define D3DX10CreateEffectFromResource D3DX10CreateEffectFromResourceA
#endif
HRESULT WINAPI D3DX10CreateEffectPoolFromFileA(LPCSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines,
ID3D10Include *pInclude, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, ID3DX10ThreadPump* pPump,
ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors);
HRESULT WINAPI D3DX10CreateEffectPoolFromFileW(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines,
ID3D10Include *pInclude, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, ID3DX10ThreadPump* pPump,
ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors);
HRESULT WINAPI D3DX10CreateEffectPoolFromMemory(LPCVOID pData, SIZE_T DataLength, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines,
ID3D10Include *pInclude, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
ID3DX10ThreadPump* pPump, ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors);
HRESULT WINAPI D3DX10CreateEffectPoolFromResourceA(HMODULE hModule, LPCSTR pResourceName, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines,
ID3D10Include *pInclude, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
ID3DX10ThreadPump* pPump, ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors);
HRESULT WINAPI D3DX10CreateEffectPoolFromResourceW(HMODULE hModule, LPCWSTR pResourceName, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines,
ID3D10Include *pInclude, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
ID3DX10ThreadPump* pPump, ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors);
#ifdef UNICODE
#define D3DX10CreateEffectPoolFromFile D3DX10CreateEffectPoolFromFileW
#define D3DX10CreateEffectPoolFromResource D3DX10CreateEffectPoolFromResourceW
#else
#define D3DX10CreateEffectPoolFromFile D3DX10CreateEffectPoolFromFileA
#define D3DX10CreateEffectPoolFromResource D3DX10CreateEffectPoolFromResourceA
#endif
HRESULT WINAPI D3DX10PreprocessShaderFromFileA(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines,
LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs);
HRESULT WINAPI D3DX10PreprocessShaderFromFileW(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines,
LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs);
HRESULT WINAPI D3DX10PreprocessShaderFromMemory(LPCSTR pSrcData, SIZE_T SrcDataSize, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines,
LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs);
HRESULT WINAPI D3DX10PreprocessShaderFromResourceA(HMODULE hModule, LPCSTR pResourceName, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs);
HRESULT WINAPI D3DX10PreprocessShaderFromResourceW(HMODULE hModule, LPCWSTR pResourceName, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines,
LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs);
#ifdef UNICODE
#define D3DX10PreprocessShaderFromFile D3DX10PreprocessShaderFromFileW
#define D3DX10PreprocessShaderFromResource D3DX10PreprocessShaderFromResourceW
#else
#define D3DX10PreprocessShaderFromFile D3DX10PreprocessShaderFromFileA
#define D3DX10PreprocessShaderFromResource D3DX10PreprocessShaderFromResourceA
#endif
//----------------------------------------------------------------------------
// Async processors
//----------------------------------------------------------------------------
HRESULT WINAPI D3DX10CreateAsyncShaderCompilerProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags,
ID3D10Blob **ppCompiledShader, ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor);
HRESULT WINAPI D3DX10CreateAsyncEffectCompilerProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
UINT Flags, UINT FXFlags,
ID3D10Blob **ppCompiledShader, ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor);
HRESULT WINAPI D3DX10CreateAsyncEffectCreateProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
UINT Flags, UINT FXFlags, ID3D10Device *pDevice,
ID3D10EffectPool *pPool, ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor);
HRESULT WINAPI D3DX10CreateAsyncEffectPoolCreateProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
UINT Flags, UINT FXFlags, ID3D10Device *pDevice,
ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor);
HRESULT WINAPI D3DX10CreateAsyncShaderPreprocessProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude,
ID3D10Blob** ppShaderText, ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor);
#ifdef __cplusplus
}
#endif //__cplusplus
#endif //__D3D10EFFECT_H__

View File

@ -0,0 +1,45 @@
///////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx8.h
// Content: D3DX utility library
//
///////////////////////////////////////////////////////////////////////////
#ifndef __D3DX8_H__
#define __D3DX8_H__
#include "d3d8.h"
#include <limits.h>
#ifndef D3DXINLINE
#ifdef _MSC_VER
#if (_MSC_VER >= 1200)
#define D3DXINLINE __forceinline
#else
#define D3DXINLINE __inline
#endif
#else
#ifdef __cplusplus
#define D3DXINLINE inline
#else
#define D3DXINLINE
#endif
#endif
#endif
#define D3DX_DEFAULT ULONG_MAX
#define D3DX_DEFAULT_FLOAT FLT_MAX
#include "d3dx8math.h"
#include "d3dx8core.h"
#include "d3dx8tex.h"
#include "d3dx8mesh.h"
#include "d3dx8shape.h"
#include "d3dx8effect.h"
#endif //__D3DX8_H__

View File

@ -0,0 +1,563 @@
///////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx8core.h
// Content: D3DX core types and functions
//
///////////////////////////////////////////////////////////////////////////
#include "d3dx8.h"
#ifndef __D3DX8CORE_H__
#define __D3DX8CORE_H__
///////////////////////////////////////////////////////////////////////////
// ID3DXBuffer:
// ------------
// The buffer object is used by D3DX to return arbitrary size data.
//
// GetBufferPointer -
// Returns a pointer to the beginning of the buffer.
//
// GetBufferSize -
// Returns the size of the buffer, in bytes.
///////////////////////////////////////////////////////////////////////////
typedef interface ID3DXBuffer ID3DXBuffer;
typedef interface ID3DXBuffer *LPD3DXBUFFER;
// {932E6A7E-C68E-45dd-A7BF-53D19C86DB1F}
DEFINE_GUID(IID_ID3DXBuffer,
0x932e6a7e, 0xc68e, 0x45dd, 0xa7, 0xbf, 0x53, 0xd1, 0x9c, 0x86, 0xdb, 0x1f);
#undef INTERFACE
#define INTERFACE ID3DXBuffer
DECLARE_INTERFACE_(ID3DXBuffer, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DXBuffer
STDMETHOD_(LPVOID, GetBufferPointer)(THIS) PURE;
STDMETHOD_(DWORD, GetBufferSize)(THIS) PURE;
};
///////////////////////////////////////////////////////////////////////////
// ID3DXFont:
// ----------
// Font objects contain the textures and resources needed to render
// a specific font on a specific device.
//
// Begin -
// Prepartes device for drawing text. This is optional.. if DrawText
// is called outside of Begin/End, it will call Begin and End for you.
//
// DrawText -
// Draws formatted text on a D3D device. Some parameters are
// surprisingly similar to those of GDI's DrawText function. See GDI
// documentation for a detailed description of these parameters.
//
// End -
// Restores device state to how it was when Begin was called.
//
// OnLostDevice, OnResetDevice -
// Call OnLostDevice() on this object before calling Reset() on the
// device, so that this object can release any stateblocks and video
// memory resources. After Reset(), the call OnResetDevice().
//
///////////////////////////////////////////////////////////////////////////
typedef interface ID3DXFont ID3DXFont;
typedef interface ID3DXFont *LPD3DXFONT;
// {89FAD6A5-024D-49af-8FE7-F51123B85E25}
DEFINE_GUID( IID_ID3DXFont,
0x89fad6a5, 0x24d, 0x49af, 0x8f, 0xe7, 0xf5, 0x11, 0x23, 0xb8, 0x5e, 0x25);
#undef INTERFACE
#define INTERFACE ID3DXFont
DECLARE_INTERFACE_(ID3DXFont, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DXFont
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE8* ppDevice) PURE;
STDMETHOD(GetLogFont)(THIS_ LOGFONT* pLogFont) PURE;
STDMETHOD(Begin)(THIS) PURE;
STDMETHOD_(INT, DrawTextA)(THIS_ LPCSTR pString, INT Count, LPRECT pRect, DWORD Format, D3DCOLOR Color) PURE;
STDMETHOD_(INT, DrawTextW)(THIS_ LPCWSTR pString, INT Count, LPRECT pRect, DWORD Format, D3DCOLOR Color) PURE;
STDMETHOD(End)(THIS) PURE;
STDMETHOD(OnLostDevice)(THIS) PURE;
STDMETHOD(OnResetDevice)(THIS) PURE;
};
#ifndef DrawText
#ifdef UNICODE
#define DrawText DrawTextW
#else
#define DrawText DrawTextA
#endif
#endif
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
HRESULT WINAPI
D3DXCreateFont(
LPDIRECT3DDEVICE8 pDevice,
HFONT hFont,
LPD3DXFONT* ppFont);
HRESULT WINAPI
D3DXCreateFontIndirect(
LPDIRECT3DDEVICE8 pDevice,
CONST LOGFONT* pLogFont,
LPD3DXFONT* ppFont);
#ifdef __cplusplus
}
#endif //__cplusplus
///////////////////////////////////////////////////////////////////////////
// ID3DXSprite:
// ------------
// This object intends to provide an easy way to drawing sprites using D3D.
//
// Begin -
// Prepares device for drawing sprites
//
// Draw, DrawAffine, DrawTransform -
// Draws a sprite in screen-space. Before transformation, the sprite is
// the size of SrcRect, with its top-left corner at the origin (0,0).
// The color and alpha channels are modulated by Color.
//
// End -
// Restores device state to how it was when Begin was called.
//
// OnLostDevice, OnResetDevice -
// Call OnLostDevice() on this object before calling Reset() on the
// device, so that this object can release any stateblocks and video
// memory resources. After Reset(), the call OnResetDevice().
///////////////////////////////////////////////////////////////////////////
typedef interface ID3DXSprite ID3DXSprite;
typedef interface ID3DXSprite *LPD3DXSPRITE;
// {13D69D15-F9B0-4e0f-B39E-C91EB33F6CE7}
DEFINE_GUID( IID_ID3DXSprite,
0x13d69d15, 0xf9b0, 0x4e0f, 0xb3, 0x9e, 0xc9, 0x1e, 0xb3, 0x3f, 0x6c, 0xe7);
#undef INTERFACE
#define INTERFACE ID3DXSprite
DECLARE_INTERFACE_(ID3DXSprite, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DXSprite
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE8* ppDevice) PURE;
STDMETHOD(Begin)(THIS) PURE;
STDMETHOD(Draw)(THIS_ LPDIRECT3DTEXTURE8 pSrcTexture,
CONST RECT* pSrcRect, CONST D3DXVECTOR2* pScaling,
CONST D3DXVECTOR2* pRotationCenter, FLOAT Rotation,
CONST D3DXVECTOR2* pTranslation, D3DCOLOR Color) PURE;
STDMETHOD(DrawTransform)(THIS_ LPDIRECT3DTEXTURE8 pSrcTexture,
CONST RECT* pSrcRect, CONST D3DXMATRIX* pTransform,
D3DCOLOR Color) PURE;
STDMETHOD(End)(THIS) PURE;
STDMETHOD(OnLostDevice)(THIS) PURE;
STDMETHOD(OnResetDevice)(THIS) PURE;
};
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
HRESULT WINAPI
D3DXCreateSprite(
LPDIRECT3DDEVICE8 pDevice,
LPD3DXSPRITE* ppSprite);
#ifdef __cplusplus
}
#endif //__cplusplus
///////////////////////////////////////////////////////////////////////////
// ID3DXRenderToSurface:
// ---------------------
// This object abstracts rendering to surfaces. These surfaces do not
// necessarily need to be render targets. If they are not, a compatible
// render target is used, and the result copied into surface at end scene.
//
// BeginScene, EndScene -
// Call BeginScene() and EndScene() at the beginning and ending of your
// scene. These calls will setup and restore render targets, viewports,
// etc..
//
// OnLostDevice, OnResetDevice -
// Call OnLostDevice() on this object before calling Reset() on the
// device, so that this object can release any stateblocks and video
// memory resources. After Reset(), the call OnResetDevice().
///////////////////////////////////////////////////////////////////////////
typedef struct _D3DXRTS_DESC
{
UINT Width;
UINT Height;
D3DFORMAT Format;
BOOL DepthStencil;
D3DFORMAT DepthStencilFormat;
} D3DXRTS_DESC;
typedef interface ID3DXRenderToSurface ID3DXRenderToSurface;
typedef interface ID3DXRenderToSurface *LPD3DXRENDERTOSURFACE;
// {82DF5B90-E34E-496e-AC1C-62117A6A5913}
DEFINE_GUID( IID_ID3DXRenderToSurface,
0x82df5b90, 0xe34e, 0x496e, 0xac, 0x1c, 0x62, 0x11, 0x7a, 0x6a, 0x59, 0x13);
#undef INTERFACE
#define INTERFACE ID3DXRenderToSurface
DECLARE_INTERFACE_(ID3DXRenderToSurface, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DXRenderToSurface
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE8* ppDevice) PURE;
STDMETHOD(GetDesc)(THIS_ D3DXRTS_DESC* pDesc) PURE;
STDMETHOD(BeginScene)(THIS_ LPDIRECT3DSURFACE8 pSurface, CONST D3DVIEWPORT8* pViewport) PURE;
STDMETHOD(EndScene)(THIS) PURE;
STDMETHOD(OnLostDevice)(THIS) PURE;
STDMETHOD(OnResetDevice)(THIS) PURE;
};
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
HRESULT WINAPI
D3DXCreateRenderToSurface(
LPDIRECT3DDEVICE8 pDevice,
UINT Width,
UINT Height,
D3DFORMAT Format,
BOOL DepthStencil,
D3DFORMAT DepthStencilFormat,
LPD3DXRENDERTOSURFACE* ppRenderToSurface);
#ifdef __cplusplus
}
#endif //__cplusplus
///////////////////////////////////////////////////////////////////////////
// ID3DXRenderToEnvMap:
// --------------------
// This object abstracts rendering to environment maps. These surfaces
// do not necessarily need to be render targets. If they are not, a
// compatible render target is used, and the result copied into the
// environment map at end scene.
//
// BeginCube, BeginSphere, BeginHemisphere, BeginParabolic -
// This function initiates the rendering of the environment map. As
// parameters, you pass the textures in which will get filled in with
// the resulting environment map.
//
// Face -
// Call this function to initiate the drawing of each face. For each
// environment map, you will call this six times.. once for each face
// in D3DCUBEMAP_FACES.
//
// End -
// This will restore all render targets, and if needed compose all the
// rendered faces into the environment map surfaces.
//
// OnLostDevice, OnResetDevice -
// Call OnLostDevice() on this object before calling Reset() on the
// device, so that this object can release any stateblocks and video
// memory resources. After Reset(), the call OnResetDevice().
///////////////////////////////////////////////////////////////////////////
typedef struct _D3DXRTE_DESC
{
UINT Size;
D3DFORMAT Format;
BOOL DepthStencil;
D3DFORMAT DepthStencilFormat;
} D3DXRTE_DESC;
typedef interface ID3DXRenderToEnvMap ID3DXRenderToEnvMap;
typedef interface ID3DXRenderToEnvMap *LPD3DXRenderToEnvMap;
// {4E42C623-9451-44b7-8C86-ABCCDE5D52C8}
DEFINE_GUID( IID_ID3DXRenderToEnvMap,
0x4e42c623, 0x9451, 0x44b7, 0x8c, 0x86, 0xab, 0xcc, 0xde, 0x5d, 0x52, 0xc8);
#undef INTERFACE
#define INTERFACE ID3DXRenderToEnvMap
DECLARE_INTERFACE_(ID3DXRenderToEnvMap, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DXRenderToEnvMap
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE8* ppDevice) PURE;
STDMETHOD(GetDesc)(THIS_ D3DXRTE_DESC* pDesc) PURE;
STDMETHOD(BeginCube)(THIS_
LPDIRECT3DCUBETEXTURE8 pCubeTex) PURE;
STDMETHOD(BeginSphere)(THIS_
LPDIRECT3DTEXTURE8 pTex) PURE;
STDMETHOD(BeginHemisphere)(THIS_
LPDIRECT3DTEXTURE8 pTexZPos,
LPDIRECT3DTEXTURE8 pTexZNeg) PURE;
STDMETHOD(BeginParabolic)(THIS_
LPDIRECT3DTEXTURE8 pTexZPos,
LPDIRECT3DTEXTURE8 pTexZNeg) PURE;
STDMETHOD(Face)(THIS_ D3DCUBEMAP_FACES Face) PURE;
STDMETHOD(End)(THIS) PURE;
STDMETHOD(OnLostDevice)(THIS) PURE;
STDMETHOD(OnResetDevice)(THIS) PURE;
};
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
HRESULT WINAPI
D3DXCreateRenderToEnvMap(
LPDIRECT3DDEVICE8 pDevice,
UINT Size,
D3DFORMAT Format,
BOOL DepthStencil,
D3DFORMAT DepthStencilFormat,
LPD3DXRenderToEnvMap* ppRenderToEnvMap);
#ifdef __cplusplus
}
#endif //__cplusplus
///////////////////////////////////////////////////////////////////////////
// Shader assemblers:
///////////////////////////////////////////////////////////////////////////
//-------------------------------------------------------------------------
// D3DXASM flags:
// --------------
//
// D3DXASM_DEBUG
// Generate debug info.
//
// D3DXASM_SKIPVALIDATION
// Do not validate the generated code against known capabilities and
// constraints. This option is only recommended when assembling shaders
// you KNOW will work. (ie. have assembled before without this option.)
//-------------------------------------------------------------------------
#define D3DXASM_DEBUG (1 << 0)
#define D3DXASM_SKIPVALIDATION (1 << 1)
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
//-------------------------------------------------------------------------
// D3DXAssembleShader:
// -------------------
// Assembles an ascii description of a vertex or pixel shader into
// binary form.
//
// Parameters:
// pSrcFile
// Source file name
// hSrcModule
// Module handle. if NULL, current module will be used.
// pSrcResource
// Resource name in module
// pSrcData
// Pointer to source code
// SrcDataLen
// Size of source code, in bytes
// Flags
// D3DXASM_xxx flags
// ppConstants
// Returns an ID3DXBuffer object containing constant declarations.
// ppCompiledShader
// Returns an ID3DXBuffer object containing the object code.
// ppCompilationErrors
// Returns an ID3DXBuffer object containing ascii error messages
//-------------------------------------------------------------------------
HRESULT WINAPI
D3DXAssembleShaderFromFileA(
LPCSTR pSrcFile,
DWORD Flags,
LPD3DXBUFFER* ppConstants,
LPD3DXBUFFER* ppCompiledShader,
LPD3DXBUFFER* ppCompilationErrors);
HRESULT WINAPI
D3DXAssembleShaderFromFileW(
LPCWSTR pSrcFile,
DWORD Flags,
LPD3DXBUFFER* ppConstants,
LPD3DXBUFFER* ppCompiledShader,
LPD3DXBUFFER* ppCompilationErrors);
#ifdef UNICODE
#define D3DXAssembleShaderFromFile D3DXAssembleShaderFromFileW
#else
#define D3DXAssembleShaderFromFile D3DXAssembleShaderFromFileA
#endif
HRESULT WINAPI
D3DXAssembleShaderFromResourceA(
HMODULE hSrcModule,
LPCSTR pSrcResource,
DWORD Flags,
LPD3DXBUFFER* ppConstants,
LPD3DXBUFFER* ppCompiledShader,
LPD3DXBUFFER* ppCompilationErrors);
HRESULT WINAPI
D3DXAssembleShaderFromResourceW(
HMODULE hSrcModule,
LPCWSTR pSrcResource,
DWORD Flags,
LPD3DXBUFFER* ppConstants,
LPD3DXBUFFER* ppCompiledShader,
LPD3DXBUFFER* ppCompilationErrors);
#ifdef UNICODE
#define D3DXAssembleShaderFromResource D3DXAssembleShaderFromResourceW
#else
#define D3DXAssembleShaderFromResource D3DXAssembleShaderFromResourceA
#endif
HRESULT WINAPI
D3DXAssembleShader(
LPCVOID pSrcData,
UINT SrcDataLen,
DWORD Flags,
LPD3DXBUFFER* ppConstants,
LPD3DXBUFFER* ppCompiledShader,
LPD3DXBUFFER* ppCompilationErrors);
#ifdef __cplusplus
}
#endif //__cplusplus
///////////////////////////////////////////////////////////////////////////
// Misc APIs:
///////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
//-------------------------------------------------------------------------
// D3DXGetErrorString:
// ------------------
// Returns the error string for given an hresult. Interprets all D3DX and
// D3D hresults.
//
// Parameters:
// hr
// The error code to be deciphered.
// pBuffer
// Pointer to the buffer to be filled in.
// BufferLen
// Count of characters in buffer. Any error message longer than this
// length will be truncated to fit.
//-------------------------------------------------------------------------
HRESULT WINAPI
D3DXGetErrorStringA(
HRESULT hr,
LPSTR pBuffer,
UINT BufferLen);
HRESULT WINAPI
D3DXGetErrorStringW(
HRESULT hr,
LPWSTR pBuffer,
UINT BufferLen);
#ifdef UNICODE
#define D3DXGetErrorString D3DXGetErrorStringW
#else
#define D3DXGetErrorString D3DXGetErrorStringA
#endif
#ifdef __cplusplus
}
#endif //__cplusplus
#endif //__D3DX8CORE_H__

View File

@ -0,0 +1,226 @@
///////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx8effect.h
// Content: D3DX effect types and functions
//
///////////////////////////////////////////////////////////////////////////
#include "d3dx8.h"
#ifndef __D3DX8EFFECT_H__
#define __D3DX8EFFECT_H__
#define D3DXFX_DONOTSAVESTATE (1 << 0)
typedef enum _D3DXPARAMETERTYPE
{
D3DXPT_DWORD = 0,
D3DXPT_FLOAT = 1,
D3DXPT_VECTOR = 2,
D3DXPT_MATRIX = 3,
D3DXPT_TEXTURE = 4,
D3DXPT_VERTEXSHADER = 5,
D3DXPT_PIXELSHADER = 6,
D3DXPT_CONSTANT = 7,
D3DXPT_STRING = 8,
D3DXPT_FORCE_DWORD = 0x7fffffff /* force 32-bit size enum */
} D3DXPARAMETERTYPE;
typedef struct _D3DXEFFECT_DESC
{
UINT Parameters;
UINT Techniques;
} D3DXEFFECT_DESC;
typedef struct _D3DXPARAMETER_DESC
{
LPCSTR Name;
LPCSTR Index;
D3DXPARAMETERTYPE Type;
} D3DXPARAMETER_DESC;
typedef struct _D3DXTECHNIQUE_DESC
{
LPCSTR Name;
LPCSTR Index;
UINT Passes;
} D3DXTECHNIQUE_DESC;
typedef struct _D3DXPASS_DESC
{
LPCSTR Name;
LPCSTR Index;
} D3DXPASS_DESC;
//////////////////////////////////////////////////////////////////////////////
// ID3DXEffect ///////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
typedef interface ID3DXEffect ID3DXEffect;
typedef interface ID3DXEffect *LPD3DXEFFECT;
// {648B1CEB-8D4E-4d66-B6FA-E44969E82E89}
DEFINE_GUID( IID_ID3DXEffect,
0x648b1ceb, 0x8d4e, 0x4d66, 0xb6, 0xfa, 0xe4, 0x49, 0x69, 0xe8, 0x2e, 0x89);
#undef INTERFACE
#define INTERFACE ID3DXEffect
DECLARE_INTERFACE_(ID3DXEffect, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DXEffect
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE8* ppDevice) PURE;
STDMETHOD(GetDesc)(THIS_ D3DXEFFECT_DESC* pDesc) PURE;
STDMETHOD(GetParameterDesc)(THIS_ LPCSTR pParameter, D3DXPARAMETER_DESC* pDesc) PURE;
STDMETHOD(GetTechniqueDesc)(THIS_ LPCSTR pTechnique, D3DXTECHNIQUE_DESC* pDesc) PURE;
STDMETHOD(GetPassDesc)(THIS_ LPCSTR pTechnique, LPCSTR pPass, D3DXPASS_DESC* pDesc) PURE;
STDMETHOD(FindNextValidTechnique)(THIS_ LPCSTR pTechnique, D3DXTECHNIQUE_DESC* pDesc) PURE;
STDMETHOD(CloneEffect)(THIS_ LPDIRECT3DDEVICE8 pDevice, LPD3DXEFFECT* ppEffect) PURE;
STDMETHOD(GetCompiledEffect)(THIS_ LPD3DXBUFFER* ppCompiledEffect) PURE;
STDMETHOD(SetTechnique)(THIS_ LPCSTR pTechnique) PURE;
STDMETHOD(GetTechnique)(THIS_ LPCSTR* ppTechnique) PURE;
STDMETHOD(SetDword)(THIS_ LPCSTR pParameter, DWORD dw) PURE;
STDMETHOD(GetDword)(THIS_ LPCSTR pParameter, DWORD* pdw) PURE;
STDMETHOD(SetFloat)(THIS_ LPCSTR pParameter, FLOAT f) PURE;
STDMETHOD(GetFloat)(THIS_ LPCSTR pParameter, FLOAT* pf) PURE;
STDMETHOD(SetVector)(THIS_ LPCSTR pParameter, CONST D3DXVECTOR4* pVector) PURE;
STDMETHOD(GetVector)(THIS_ LPCSTR pParameter, D3DXVECTOR4* pVector) PURE;
STDMETHOD(SetMatrix)(THIS_ LPCSTR pParameter, CONST D3DXMATRIX* pMatrix) PURE;
STDMETHOD(GetMatrix)(THIS_ LPCSTR pParameter, D3DXMATRIX* pMatrix) PURE;
STDMETHOD(SetTexture)(THIS_ LPCSTR pParameter, LPDIRECT3DBASETEXTURE8 pTexture) PURE;
STDMETHOD(GetTexture)(THIS_ LPCSTR pParameter, LPDIRECT3DBASETEXTURE8 *ppTexture) PURE;
STDMETHOD(SetVertexShader)(THIS_ LPCSTR pParameter, DWORD Handle) PURE;
STDMETHOD(GetVertexShader)(THIS_ LPCSTR pParameter, DWORD* pHandle) PURE;
STDMETHOD(SetPixelShader)(THIS_ LPCSTR pParameter, DWORD Handle) PURE;
STDMETHOD(GetPixelShader)(THIS_ LPCSTR pParameter, DWORD* pHandle) PURE;
STDMETHOD(SetString)(THIS_ LPCSTR pParameter, LPCSTR pString) PURE;
STDMETHOD(GetString)(THIS_ LPCSTR pParameter, LPCSTR* ppString) PURE;
STDMETHOD_(BOOL, IsParameterUsed)(THIS_ LPCSTR pParameter) PURE;
STDMETHOD(Validate)(THIS) PURE;
STDMETHOD(Begin)(THIS_ UINT *pPasses, DWORD Flags) PURE;
STDMETHOD(Pass)(THIS_ UINT Pass) PURE;
STDMETHOD(End)(THIS) PURE;
STDMETHOD(OnLostDevice)(THIS) PURE;
STDMETHOD(OnResetDevice)(THIS) PURE;
};
//////////////////////////////////////////////////////////////////////////////
// APIs //////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
//----------------------------------------------------------------------------
// D3DXCreateEffect:
// -----------------
// Creates an effect from an ascii or binaray effect description.
//
// Parameters:
// pDevice
// Pointer of the device on which to create the effect
// pSrcFile
// Name of the file containing the effect description
// hSrcModule
// Module handle. if NULL, current module will be used.
// pSrcResource
// Resource name in module
// pSrcData
// Pointer to effect description
// SrcDataSize
// Size of the effect description in bytes
// ppEffect
// Returns a buffer containing created effect.
// ppCompilationErrors
// Returns a buffer containing any error messages which occurred during
// compile. Or NULL if you do not care about the error messages.
//
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreateEffectFromFileA(
LPDIRECT3DDEVICE8 pDevice,
LPCSTR pSrcFile,
LPD3DXEFFECT* ppEffect,
LPD3DXBUFFER* ppCompilationErrors);
HRESULT WINAPI
D3DXCreateEffectFromFileW(
LPDIRECT3DDEVICE8 pDevice,
LPCWSTR pSrcFile,
LPD3DXEFFECT* ppEffect,
LPD3DXBUFFER* ppCompilationErrors);
#ifdef UNICODE
#define D3DXCreateEffectFromFile D3DXCreateEffectFromFileW
#else
#define D3DXCreateEffectFromFile D3DXCreateEffectFromFileA
#endif
HRESULT WINAPI
D3DXCreateEffectFromResourceA(
LPDIRECT3DDEVICE8 pDevice,
HMODULE hSrcModule,
LPCSTR pSrcResource,
LPD3DXEFFECT* ppEffect,
LPD3DXBUFFER* ppCompilationErrors);
HRESULT WINAPI
D3DXCreateEffectFromResourceW(
LPDIRECT3DDEVICE8 pDevice,
HMODULE hSrcModule,
LPCWSTR pSrcResource,
LPD3DXEFFECT* ppEffect,
LPD3DXBUFFER* ppCompilationErrors);
#ifdef UNICODE
#define D3DXCreateEffectFromResource D3DXCreateEffectFromResourceW
#else
#define D3DXCreateEffectFromResource D3DXCreateEffectFromResourceA
#endif
HRESULT WINAPI
D3DXCreateEffect(
LPDIRECT3DDEVICE8 pDevice,
LPCVOID pSrcData,
UINT SrcDataSize,
LPD3DXEFFECT* ppEffect,
LPD3DXBUFFER* ppCompilationErrors);
#ifdef __cplusplus
}
#endif //__cplusplus
#endif //__D3DX8EFFECT_H__

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,760 @@
//////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx8mesh.h
// Content: D3DX mesh types and functions
//
//////////////////////////////////////////////////////////////////////////////
#include "d3dx8.h"
#ifndef __D3DX8MESH_H__
#define __D3DX8MESH_H__
#include "dxfile.h" // defines LPDIRECTXFILEDATA
// {2A835771-BF4D-43f4-8E14-82A809F17D8A}
DEFINE_GUID(IID_ID3DXBaseMesh,
0x2a835771, 0xbf4d, 0x43f4, 0x8e, 0x14, 0x82, 0xa8, 0x9, 0xf1, 0x7d, 0x8a);
// {CCAE5C3B-4DD1-4d0f-997E-4684CA64557F}
DEFINE_GUID(IID_ID3DXMesh,
0xccae5c3b, 0x4dd1, 0x4d0f, 0x99, 0x7e, 0x46, 0x84, 0xca, 0x64, 0x55, 0x7f);
// {19FBE386-C282-4659-97BD-CB869B084A6C}
DEFINE_GUID(IID_ID3DXPMesh,
0x19fbe386, 0xc282, 0x4659, 0x97, 0xbd, 0xcb, 0x86, 0x9b, 0x8, 0x4a, 0x6c);
// {4E3CA05C-D4FF-4d11-8A02-16459E08F6F4}
DEFINE_GUID(IID_ID3DXSPMesh,
0x4e3ca05c, 0xd4ff, 0x4d11, 0x8a, 0x2, 0x16, 0x45, 0x9e, 0x8, 0xf6, 0xf4);
// {8DB06ECC-EBFC-408a-9404-3074B4773515}
DEFINE_GUID(IID_ID3DXSkinMesh,
0x8db06ecc, 0xebfc, 0x408a, 0x94, 0x4, 0x30, 0x74, 0xb4, 0x77, 0x35, 0x15);
// Mesh options - lower 3 bytes only, upper byte used by _D3DXMESHOPT option flags
enum _D3DXMESH {
D3DXMESH_32BIT = 0x001, // If set, then use 32 bit indices, if not set use 16 bit indices.
D3DXMESH_DONOTCLIP = 0x002, // Use D3DUSAGE_DONOTCLIP for VB & IB.
D3DXMESH_POINTS = 0x004, // Use D3DUSAGE_POINTS for VB & IB.
D3DXMESH_RTPATCHES = 0x008, // Use D3DUSAGE_RTPATCHES for VB & IB.
D3DXMESH_NPATCHES = 0x4000,// Use D3DUSAGE_NPATCHES for VB & IB.
D3DXMESH_VB_SYSTEMMEM = 0x010, // Use D3DPOOL_SYSTEMMEM for VB. Overrides D3DXMESH_MANAGEDVERTEXBUFFER
D3DXMESH_VB_MANAGED = 0x020, // Use D3DPOOL_MANAGED for VB.
D3DXMESH_VB_WRITEONLY = 0x040, // Use D3DUSAGE_WRITEONLY for VB.
D3DXMESH_VB_DYNAMIC = 0x080, // Use D3DUSAGE_DYNAMIC for VB.
D3DXMESH_VB_SOFTWAREPROCESSING = 0x8000, // Use D3DUSAGE_SOFTWAREPROCESSING for VB.
D3DXMESH_IB_SYSTEMMEM = 0x100, // Use D3DPOOL_SYSTEMMEM for IB. Overrides D3DXMESH_MANAGEDINDEXBUFFER
D3DXMESH_IB_MANAGED = 0x200, // Use D3DPOOL_MANAGED for IB.
D3DXMESH_IB_WRITEONLY = 0x400, // Use D3DUSAGE_WRITEONLY for IB.
D3DXMESH_IB_DYNAMIC = 0x800, // Use D3DUSAGE_DYNAMIC for IB.
D3DXMESH_IB_SOFTWAREPROCESSING= 0x10000, // Use D3DUSAGE_SOFTWAREPROCESSING for IB.
D3DXMESH_VB_SHARE = 0x1000, // Valid for Clone* calls only, forces cloned mesh/pmesh to share vertex buffer
D3DXMESH_USEHWONLY = 0x2000, // Valid for ID3DXSkinMesh::ConvertToBlendedMesh
// Helper options
D3DXMESH_SYSTEMMEM = 0x110, // D3DXMESH_VB_SYSTEMMEM | D3DXMESH_IB_SYSTEMMEM
D3DXMESH_MANAGED = 0x220, // D3DXMESH_VB_MANAGED | D3DXMESH_IB_MANAGED
D3DXMESH_WRITEONLY = 0x440, // D3DXMESH_VB_WRITEONLY | D3DXMESH_IB_WRITEONLY
D3DXMESH_DYNAMIC = 0x880, // D3DXMESH_VB_DYNAMIC | D3DXMESH_IB_DYNAMIC
D3DXMESH_SOFTWAREPROCESSING = 0x18000, // D3DXMESH_VB_SOFTWAREPROCESSING | D3DXMESH_IB_SOFTWAREPROCESSING
};
// option field values for specifying min value in D3DXGeneratePMesh and D3DXSimplifyMesh
enum _D3DXMESHSIMP
{
D3DXMESHSIMP_VERTEX = 0x1,
D3DXMESHSIMP_FACE = 0x2,
};
enum _MAX_FVF_DECL_SIZE
{
MAX_FVF_DECL_SIZE = 20
};
typedef struct ID3DXBaseMesh *LPD3DXBASEMESH;
typedef struct ID3DXMesh *LPD3DXMESH;
typedef struct ID3DXPMesh *LPD3DXPMESH;
typedef struct ID3DXSPMesh *LPD3DXSPMESH;
typedef struct ID3DXSkinMesh *LPD3DXSKINMESH;
typedef struct _D3DXATTRIBUTERANGE
{
DWORD AttribId;
DWORD FaceStart;
DWORD FaceCount;
DWORD VertexStart;
DWORD VertexCount;
} D3DXATTRIBUTERANGE;
typedef D3DXATTRIBUTERANGE* LPD3DXATTRIBUTERANGE;
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
struct D3DXMATERIAL
{
D3DMATERIAL8 MatD3D;
LPSTR pTextureFilename;
};
typedef struct D3DXMATERIAL *LPD3DXMATERIAL;
#ifdef __cplusplus
}
#endif //__cplusplus
typedef struct _D3DXATTRIBUTEWEIGHTS
{
FLOAT Position;
FLOAT Boundary;
FLOAT Normal;
FLOAT Diffuse;
FLOAT Specular;
FLOAT Tex[8];
} D3DXATTRIBUTEWEIGHTS;
typedef D3DXATTRIBUTEWEIGHTS* LPD3DXATTRIBUTEWEIGHTS;
enum _D3DXWELDEPSILONSFLAGS
{
D3DXWELDEPSILONS_WELDALL = 0x1, // weld all vertices marked by adjacency as being overlapping
D3DXWELDEPSILONS_WELDPARTIALMATCHES = 0x2, // if a given vertex component is within epsilon, modify partial matched
// vertices so that both components identical AND if all components "equal"
// remove one of the vertices
D3DXWELDEPSILONS_DONOTREMOVEVERTICES = 0x4, // instructs weld to only allow modifications to vertices and not removal
// ONLY valid if D3DXWELDEPSILONS_WELDPARTIALMATCHES is set
// useful to modify vertices to be equal, but not allow vertices to be removed
};
typedef struct _D3DXWELDEPSILONS
{
FLOAT SkinWeights;
FLOAT Normal;
FLOAT Tex[8];
DWORD Flags;
} D3DXWELDEPSILONS;
typedef D3DXWELDEPSILONS* LPD3DXWELDEPSILONS;
#undef INTERFACE
#define INTERFACE ID3DXBaseMesh
DECLARE_INTERFACE_(ID3DXBaseMesh, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DXBaseMesh
STDMETHOD(DrawSubset)(THIS_ DWORD AttribId) PURE;
STDMETHOD_(DWORD, GetNumFaces)(THIS) PURE;
STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE;
STDMETHOD_(DWORD, GetFVF)(THIS) PURE;
STDMETHOD(GetDeclaration)(THIS_ DWORD Declaration[MAX_FVF_DECL_SIZE]) PURE;
STDMETHOD_(DWORD, GetOptions)(THIS) PURE;
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE8* ppDevice) PURE;
STDMETHOD(CloneMeshFVF)(THIS_ DWORD Options,
DWORD FVF, LPDIRECT3DDEVICE8 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE;
STDMETHOD(CloneMesh)(THIS_ DWORD Options,
CONST DWORD *pDeclaration, LPDIRECT3DDEVICE8 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE;
STDMETHOD(GetVertexBuffer)(THIS_ LPDIRECT3DVERTEXBUFFER8* ppVB) PURE;
STDMETHOD(GetIndexBuffer)(THIS_ LPDIRECT3DINDEXBUFFER8* ppIB) PURE;
STDMETHOD(LockVertexBuffer)(THIS_ DWORD Flags, BYTE** ppData) PURE;
STDMETHOD(UnlockVertexBuffer)(THIS) PURE;
STDMETHOD(LockIndexBuffer)(THIS_ DWORD Flags, BYTE** ppData) PURE;
STDMETHOD(UnlockIndexBuffer)(THIS) PURE;
STDMETHOD(GetAttributeTable)(
THIS_ D3DXATTRIBUTERANGE *pAttribTable, DWORD* pAttribTableSize) PURE;
STDMETHOD(ConvertPointRepsToAdjacency)(THIS_ CONST DWORD* pPRep, DWORD* pAdjacency) PURE;
STDMETHOD(ConvertAdjacencyToPointReps)(THIS_ CONST DWORD* pAdjacency, DWORD* pPRep) PURE;
STDMETHOD(GenerateAdjacency)(THIS_ FLOAT Epsilon, DWORD* pAdjacency) PURE;
};
#undef INTERFACE
#define INTERFACE ID3DXMesh
DECLARE_INTERFACE_(ID3DXMesh, ID3DXBaseMesh)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DXBaseMesh
STDMETHOD(DrawSubset)(THIS_ DWORD AttribId) PURE;
STDMETHOD_(DWORD, GetNumFaces)(THIS) PURE;
STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE;
STDMETHOD_(DWORD, GetFVF)(THIS) PURE;
STDMETHOD(GetDeclaration)(THIS_ DWORD Declaration[MAX_FVF_DECL_SIZE]) PURE;
STDMETHOD_(DWORD, GetOptions)(THIS) PURE;
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE8* ppDevice) PURE;
STDMETHOD(CloneMeshFVF)(THIS_ DWORD Options,
DWORD FVF, LPDIRECT3DDEVICE8 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE;
STDMETHOD(CloneMesh)(THIS_ DWORD Options,
CONST DWORD *pDeclaration, LPDIRECT3DDEVICE8 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE;
STDMETHOD(GetVertexBuffer)(THIS_ LPDIRECT3DVERTEXBUFFER8* ppVB) PURE;
STDMETHOD(GetIndexBuffer)(THIS_ LPDIRECT3DINDEXBUFFER8* ppIB) PURE;
STDMETHOD(LockVertexBuffer)(THIS_ DWORD Flags, BYTE** ppData) PURE;
STDMETHOD(UnlockVertexBuffer)(THIS) PURE;
STDMETHOD(LockIndexBuffer)(THIS_ DWORD Flags, BYTE** ppData) PURE;
STDMETHOD(UnlockIndexBuffer)(THIS) PURE;
STDMETHOD(GetAttributeTable)(
THIS_ D3DXATTRIBUTERANGE *pAttribTable, DWORD* pAttribTableSize) PURE;
STDMETHOD(ConvertPointRepsToAdjacency)(THIS_ CONST DWORD* pPRep, DWORD* pAdjacency) PURE;
STDMETHOD(ConvertAdjacencyToPointReps)(THIS_ CONST DWORD* pAdjacency, DWORD* pPRep) PURE;
STDMETHOD(GenerateAdjacency)(THIS_ FLOAT Epsilon, DWORD* pAdjacency) PURE;
// ID3DXMesh
STDMETHOD(LockAttributeBuffer)(THIS_ DWORD Flags, DWORD** ppData) PURE;
STDMETHOD(UnlockAttributeBuffer)(THIS) PURE;
STDMETHOD(Optimize)(THIS_ DWORD Flags, CONST DWORD* pAdjacencyIn, DWORD* pAdjacencyOut,
DWORD* pFaceRemap, LPD3DXBUFFER *ppVertexRemap,
LPD3DXMESH* ppOptMesh) PURE;
STDMETHOD(OptimizeInplace)(THIS_ DWORD Flags, CONST DWORD* pAdjacencyIn, DWORD* pAdjacencyOut,
DWORD* pFaceRemap, LPD3DXBUFFER *ppVertexRemap) PURE;
};
#undef INTERFACE
#define INTERFACE ID3DXPMesh
DECLARE_INTERFACE_(ID3DXPMesh, ID3DXBaseMesh)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DXBaseMesh
STDMETHOD(DrawSubset)(THIS_ DWORD AttribId) PURE;
STDMETHOD_(DWORD, GetNumFaces)(THIS) PURE;
STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE;
STDMETHOD_(DWORD, GetFVF)(THIS) PURE;
STDMETHOD(GetDeclaration)(THIS_ DWORD Declaration[MAX_FVF_DECL_SIZE]) PURE;
STDMETHOD_(DWORD, GetOptions)(THIS) PURE;
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE8* ppDevice) PURE;
STDMETHOD(CloneMeshFVF)(THIS_ DWORD Options,
DWORD FVF, LPDIRECT3DDEVICE8 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE;
STDMETHOD(CloneMesh)(THIS_ DWORD Options,
CONST DWORD *pDeclaration, LPDIRECT3DDEVICE8 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE;
STDMETHOD(GetVertexBuffer)(THIS_ LPDIRECT3DVERTEXBUFFER8* ppVB) PURE;
STDMETHOD(GetIndexBuffer)(THIS_ LPDIRECT3DINDEXBUFFER8* ppIB) PURE;
STDMETHOD(LockVertexBuffer)(THIS_ DWORD Flags, BYTE** ppData) PURE;
STDMETHOD(UnlockVertexBuffer)(THIS) PURE;
STDMETHOD(LockIndexBuffer)(THIS_ DWORD Flags, BYTE** ppData) PURE;
STDMETHOD(UnlockIndexBuffer)(THIS) PURE;
STDMETHOD(GetAttributeTable)(
THIS_ D3DXATTRIBUTERANGE *pAttribTable, DWORD* pAttribTableSize) PURE;
STDMETHOD(ConvertPointRepsToAdjacency)(THIS_ CONST DWORD* pPRep, DWORD* pAdjacency) PURE;
STDMETHOD(ConvertAdjacencyToPointReps)(THIS_ CONST DWORD* pAdjacency, DWORD* pPRep) PURE;
STDMETHOD(GenerateAdjacency)(THIS_ FLOAT Epsilon, DWORD* pAdjacency) PURE;
// ID3DXPMesh
STDMETHOD(ClonePMeshFVF)(THIS_ DWORD Options,
DWORD FVF, LPDIRECT3DDEVICE8 pD3D, LPD3DXPMESH* ppCloneMesh) PURE;
STDMETHOD(ClonePMesh)(THIS_ DWORD Options,
CONST DWORD *pDeclaration, LPDIRECT3DDEVICE8 pD3D, LPD3DXPMESH* ppCloneMesh) PURE;
STDMETHOD(SetNumFaces)(THIS_ DWORD Faces) PURE;
STDMETHOD(SetNumVertices)(THIS_ DWORD Vertices) PURE;
STDMETHOD_(DWORD, GetMaxFaces)(THIS) PURE;
STDMETHOD_(DWORD, GetMinFaces)(THIS) PURE;
STDMETHOD_(DWORD, GetMaxVertices)(THIS) PURE;
STDMETHOD_(DWORD, GetMinVertices)(THIS) PURE;
STDMETHOD(Save)(THIS_ IStream *pStream, LPD3DXMATERIAL pMaterials, DWORD NumMaterials) PURE;
STDMETHOD(Optimize)(THIS_ DWORD Flags, DWORD* pAdjacencyOut,
DWORD* pFaceRemap, LPD3DXBUFFER *ppVertexRemap,
LPD3DXMESH* ppOptMesh) PURE;
STDMETHOD(OptimizeBaseLOD)(THIS_ DWORD Flags, DWORD* pFaceRemap) PURE;
STDMETHOD(TrimByFaces)(THIS_ DWORD NewFacesMin, DWORD NewFacesMax, DWORD *rgiFaceRemap, DWORD *rgiVertRemap) PURE;
STDMETHOD(TrimByVertices)(THIS_ DWORD NewVerticesMin, DWORD NewVerticesMax, DWORD *rgiFaceRemap, DWORD *rgiVertRemap) PURE;
STDMETHOD(GetAdjacency)(THIS_ DWORD* pAdjacency) PURE;
};
#undef INTERFACE
#define INTERFACE ID3DXSPMesh
DECLARE_INTERFACE_(ID3DXSPMesh, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DXSPMesh
STDMETHOD_(DWORD, GetNumFaces)(THIS) PURE;
STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE;
STDMETHOD_(DWORD, GetFVF)(THIS) PURE;
STDMETHOD(GetDeclaration)(THIS_ DWORD Declaration[MAX_FVF_DECL_SIZE]) PURE;
STDMETHOD_(DWORD, GetOptions)(THIS) PURE;
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE8* ppDevice) PURE;
STDMETHOD(CloneMeshFVF)(THIS_ DWORD Options,
DWORD FVF, LPDIRECT3DDEVICE8 pD3D, DWORD *pAdjacencyOut, DWORD *pVertexRemapOut, LPD3DXMESH* ppCloneMesh) PURE;
STDMETHOD(CloneMesh)(THIS_ DWORD Options,
CONST DWORD *pDeclaration, LPDIRECT3DDEVICE8 pD3DDevice, DWORD *pAdjacencyOut, DWORD *pVertexRemapOut, LPD3DXMESH* ppCloneMesh) PURE;
STDMETHOD(ClonePMeshFVF)(THIS_ DWORD Options,
DWORD FVF, LPDIRECT3DDEVICE8 pD3D, DWORD *pVertexRemapOut, LPD3DXPMESH* ppCloneMesh) PURE;
STDMETHOD(ClonePMesh)(THIS_ DWORD Options,
CONST DWORD *pDeclaration, LPDIRECT3DDEVICE8 pD3D, DWORD *pVertexRemapOut, LPD3DXPMESH* ppCloneMesh) PURE;
STDMETHOD(ReduceFaces)(THIS_ DWORD Faces) PURE;
STDMETHOD(ReduceVertices)(THIS_ DWORD Vertices) PURE;
STDMETHOD_(DWORD, GetMaxFaces)(THIS) PURE;
STDMETHOD_(DWORD, GetMaxVertices)(THIS) PURE;
STDMETHOD(GetVertexAttributeWeights)(THIS_ LPD3DXATTRIBUTEWEIGHTS pVertexAttributeWeights) PURE;
STDMETHOD(GetVertexWeights)(THIS_ FLOAT *pVertexWeights) PURE;
};
#define UNUSED16 (0xffff)
#define UNUSED32 (0xffffffff)
// ID3DXMesh::Optimize options - upper byte only, lower 3 bytes used from _D3DXMESH option flags
enum _D3DXMESHOPT {
D3DXMESHOPT_COMPACT = 0x01000000,
D3DXMESHOPT_ATTRSORT = 0x02000000,
D3DXMESHOPT_VERTEXCACHE = 0x04000000,
D3DXMESHOPT_STRIPREORDER = 0x08000000,
D3DXMESHOPT_IGNOREVERTS = 0x10000000, // optimize faces only, don't touch vertices
D3DXMESHOPT_SHAREVB = 0x1000, // same as D3DXMESH_VB_SHARE
};
// Subset of the mesh that has the same attribute and bone combination.
// This subset can be rendered in a single draw call
typedef struct _D3DXBONECOMBINATION
{
DWORD AttribId;
DWORD FaceStart;
DWORD FaceCount;
DWORD VertexStart;
DWORD VertexCount;
DWORD* BoneId;
} D3DXBONECOMBINATION, *LPD3DXBONECOMBINATION;
#undef INTERFACE
#define INTERFACE ID3DXSkinMesh
DECLARE_INTERFACE_(ID3DXSkinMesh, IUnknown)
{
// IUnknown
STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
// ID3DXMesh
STDMETHOD_(DWORD, GetNumFaces)(THIS) PURE;
STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE;
STDMETHOD_(DWORD, GetFVF)(THIS) PURE;
STDMETHOD(GetDeclaration)(THIS_ DWORD Declaration[MAX_FVF_DECL_SIZE]) PURE;
STDMETHOD_(DWORD, GetOptions)(THIS) PURE;
STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE8* ppDevice) PURE;
STDMETHOD(GetVertexBuffer)(THIS_ LPDIRECT3DVERTEXBUFFER8* ppVB) PURE;
STDMETHOD(GetIndexBuffer)(THIS_ LPDIRECT3DINDEXBUFFER8* ppIB) PURE;
STDMETHOD(LockVertexBuffer)(THIS_ DWORD flags, BYTE** ppData) PURE;
STDMETHOD(UnlockVertexBuffer)(THIS) PURE;
STDMETHOD(LockIndexBuffer)(THIS_ DWORD flags, BYTE** ppData) PURE;
STDMETHOD(UnlockIndexBuffer)(THIS) PURE;
STDMETHOD(LockAttributeBuffer)(THIS_ DWORD flags, DWORD** ppData) PURE;
STDMETHOD(UnlockAttributeBuffer)(THIS) PURE;
// ID3DXSkinMesh
STDMETHOD_(DWORD, GetNumBones)(THIS) PURE;
STDMETHOD(GetOriginalMesh)(THIS_ LPD3DXMESH* ppMesh) PURE;
STDMETHOD(SetBoneInfluence)(THIS_ DWORD bone, DWORD numInfluences, CONST DWORD* vertices, CONST FLOAT* weights) PURE;
STDMETHOD_(DWORD, GetNumBoneInfluences)(THIS_ DWORD bone) PURE;
STDMETHOD(GetBoneInfluence)(THIS_ DWORD bone, DWORD* vertices, FLOAT* weights) PURE;
STDMETHOD(GetMaxVertexInfluences)(THIS_ DWORD* maxVertexInfluences) PURE;
STDMETHOD(GetMaxFaceInfluences)(THIS_ DWORD* maxFaceInfluences) PURE;
STDMETHOD(ConvertToBlendedMesh)(THIS_ DWORD Options,
CONST LPDWORD pAdjacencyIn,
LPDWORD pAdjacencyOut,
DWORD* pNumBoneCombinations,
LPD3DXBUFFER* ppBoneCombinationTable,
DWORD* pFaceRemap,
LPD3DXBUFFER *ppVertexRemap,
LPD3DXMESH* ppMesh) PURE;
STDMETHOD(ConvertToIndexedBlendedMesh)(THIS_ DWORD Options,
CONST LPDWORD pAdjacencyIn,
DWORD paletteSize,
LPDWORD pAdjacencyOut,
DWORD* pNumBoneCombinations,
LPD3DXBUFFER* ppBoneCombinationTable,
DWORD* pFaceRemap,
LPD3DXBUFFER *ppVertexRemap,
LPD3DXMESH* ppMesh) PURE;
STDMETHOD(GenerateSkinnedMesh)(THIS_ DWORD Options,
FLOAT minWeight,
CONST LPDWORD pAdjacencyIn,
LPDWORD pAdjacencyOut,
DWORD* pFaceRemap,
LPD3DXBUFFER *ppVertexRemap,
LPD3DXMESH* ppMesh) PURE;
STDMETHOD(UpdateSkinnedMesh)(THIS_ CONST D3DXMATRIX* pBoneTransforms, CONST D3DXMATRIX* pBoneInvTransforms, LPD3DXMESH pMesh) PURE;
};
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
HRESULT WINAPI
D3DXCreateMesh(
DWORD NumFaces,
DWORD NumVertices,
DWORD Options,
CONST DWORD *pDeclaration,
LPDIRECT3DDEVICE8 pD3D,
LPD3DXMESH* ppMesh);
HRESULT WINAPI
D3DXCreateMeshFVF(
DWORD NumFaces,
DWORD NumVertices,
DWORD Options,
DWORD FVF,
LPDIRECT3DDEVICE8 pD3D,
LPD3DXMESH* ppMesh);
HRESULT WINAPI
D3DXCreateSPMesh(
LPD3DXMESH pMesh,
CONST DWORD* pAdjacency,
CONST LPD3DXATTRIBUTEWEIGHTS pVertexAttributeWeights,
CONST FLOAT *pVertexWeights,
LPD3DXSPMESH* ppSMesh);
// clean a mesh up for simplification, try to make manifold
HRESULT WINAPI
D3DXCleanMesh(
LPD3DXMESH pMeshIn,
CONST DWORD* pAdjacencyIn,
LPD3DXMESH* ppMeshOut,
DWORD* pAdjacencyOut,
LPD3DXBUFFER* ppErrorsAndWarnings);
HRESULT WINAPI
D3DXValidMesh(
LPD3DXMESH pMeshIn,
CONST DWORD* pAdjacency,
LPD3DXBUFFER* ppErrorsAndWarnings);
HRESULT WINAPI
D3DXGeneratePMesh(
LPD3DXMESH pMesh,
CONST DWORD* pAdjacency,
CONST LPD3DXATTRIBUTEWEIGHTS pVertexAttributeWeights,
CONST FLOAT *pVertexWeights,
DWORD MinValue,
DWORD Options,
LPD3DXPMESH* ppPMesh);
HRESULT WINAPI
D3DXSimplifyMesh(
LPD3DXMESH pMesh,
CONST DWORD* pAdjacency,
CONST LPD3DXATTRIBUTEWEIGHTS pVertexAttributeWeights,
CONST FLOAT *pVertexWeights,
DWORD MinValue,
DWORD Options,
LPD3DXMESH* ppMesh);
HRESULT WINAPI
D3DXComputeBoundingSphere(
PVOID pPointsFVF,
DWORD NumVertices,
DWORD FVF,
D3DXVECTOR3 *pCenter,
FLOAT *pRadius);
HRESULT WINAPI
D3DXComputeBoundingBox(
PVOID pPointsFVF,
DWORD NumVertices,
DWORD FVF,
D3DXVECTOR3 *pMin,
D3DXVECTOR3 *pMax);
HRESULT WINAPI
D3DXComputeNormals(
LPD3DXBASEMESH pMesh,
CONST DWORD *pAdjacency);
HRESULT WINAPI
D3DXCreateBuffer(
DWORD NumBytes,
LPD3DXBUFFER *ppBuffer);
HRESULT WINAPI
D3DXLoadMeshFromX(
LPSTR pFilename,
DWORD Options,
LPDIRECT3DDEVICE8 pD3D,
LPD3DXBUFFER *ppAdjacency,
LPD3DXBUFFER *ppMaterials,
DWORD *pNumMaterials,
LPD3DXMESH *ppMesh);
HRESULT WINAPI
D3DXLoadMeshFromXInMemory(
PBYTE Memory,
DWORD SizeOfMemory,
DWORD Options,
LPDIRECT3DDEVICE8 pD3D,
LPD3DXBUFFER *ppAdjacency,
LPD3DXBUFFER *ppMaterials,
DWORD *pNumMaterials,
LPD3DXMESH *ppMesh);
HRESULT WINAPI
D3DXLoadMeshFromXResource(
HMODULE Module,
LPCTSTR Name,
LPCTSTR Type,
DWORD Options,
LPDIRECT3DDEVICE8 pD3D,
LPD3DXBUFFER *ppAdjacency,
LPD3DXBUFFER *ppMaterials,
DWORD *pNumMaterials,
LPD3DXMESH *ppMesh);
HRESULT WINAPI
D3DXSaveMeshToX(
LPSTR pFilename,
LPD3DXMESH pMesh,
CONST DWORD* pAdjacency,
CONST LPD3DXMATERIAL pMaterials,
DWORD NumMaterials,
DWORD Format
);
HRESULT WINAPI
D3DXCreatePMeshFromStream(
IStream *pStream,
DWORD Options,
LPDIRECT3DDEVICE8 pD3DDevice,
LPD3DXBUFFER *ppMaterials,
DWORD* pNumMaterials,
LPD3DXPMESH *ppPMesh);
HRESULT WINAPI
D3DXCreateSkinMesh(
DWORD NumFaces,
DWORD NumVertices,
DWORD NumBones,
DWORD Options,
CONST DWORD *pDeclaration,
LPDIRECT3DDEVICE8 pD3D,
LPD3DXSKINMESH* ppSkinMesh);
HRESULT WINAPI
D3DXCreateSkinMeshFVF(
DWORD NumFaces,
DWORD NumVertices,
DWORD NumBones,
DWORD Options,
DWORD FVF,
LPDIRECT3DDEVICE8 pD3D,
LPD3DXSKINMESH* ppSkinMesh);
HRESULT WINAPI
D3DXCreateSkinMeshFromMesh(
LPD3DXMESH pMesh,
DWORD numBones,
LPD3DXSKINMESH* ppSkinMesh);
HRESULT WINAPI
D3DXLoadMeshFromXof(
LPDIRECTXFILEDATA pXofObjMesh,
DWORD Options,
LPDIRECT3DDEVICE8 pD3DDevice,
LPD3DXBUFFER *ppAdjacency,
LPD3DXBUFFER *ppMaterials,
DWORD *pNumMaterials,
LPD3DXMESH *ppMesh);
HRESULT WINAPI
D3DXLoadSkinMeshFromXof(
LPDIRECTXFILEDATA pxofobjMesh,
DWORD Options,
LPDIRECT3DDEVICE8 pD3D,
LPD3DXBUFFER* ppAdjacency,
LPD3DXBUFFER* ppMaterials,
DWORD *pMatOut,
LPD3DXBUFFER* ppBoneNames,
LPD3DXBUFFER* ppBoneTransforms,
LPD3DXSKINMESH* ppMesh);
HRESULT WINAPI
D3DXTessellateNPatches(
LPD3DXMESH pMeshIn,
CONST DWORD* pAdjacencyIn,
FLOAT NumSegs,
BOOL QuadraticInterpNormals, // if false use linear intrep for normals, if true use quadratic
LPD3DXMESH *ppMeshOut,
LPD3DXBUFFER *ppAdjacencyOut);
UINT WINAPI
D3DXGetFVFVertexSize(DWORD FVF);
HRESULT WINAPI
D3DXDeclaratorFromFVF(
DWORD FVF,
DWORD Declaration[MAX_FVF_DECL_SIZE]);
HRESULT WINAPI
D3DXFVFFromDeclarator(
CONST DWORD *pDeclarator,
DWORD *pFVF);
HRESULT WINAPI
D3DXWeldVertices(
CONST LPD3DXMESH pMesh,
LPD3DXWELDEPSILONS pEpsilons,
CONST DWORD *pAdjacencyIn,
DWORD *pAdjacencyOut,
DWORD* pFaceRemap,
LPD3DXBUFFER *ppVertexRemap);
typedef struct _D3DXINTERSECTINFO
{
DWORD FaceIndex; // index of face intersected
FLOAT U; // Barycentric Hit Coordinates
FLOAT V; // Barycentric Hit Coordinates
FLOAT Dist; // Ray-Intersection Parameter Distance
} D3DXINTERSECTINFO, *LPD3DXINTERSECTINFO;
HRESULT WINAPI
D3DXIntersect(
LPD3DXBASEMESH pMesh,
CONST D3DXVECTOR3 *pRayPos,
CONST D3DXVECTOR3 *pRayDir,
BOOL *pHit, // True if any faces were intersected
DWORD *pFaceIndex, // index of closest face intersected
FLOAT *pU, // Barycentric Hit Coordinates
FLOAT *pV, // Barycentric Hit Coordinates
FLOAT *pDist, // Ray-Intersection Parameter Distance
LPD3DXBUFFER *ppAllHits, // Array of D3DXINTERSECTINFOs for all hits (not just closest)
DWORD *pCountOfHits); // Number of entries in AllHits array
HRESULT WINAPI
D3DXIntersectSubset(
LPD3DXBASEMESH pMesh,
DWORD AttribId,
CONST D3DXVECTOR3 *pRayPos,
CONST D3DXVECTOR3 *pRayDir,
BOOL *pHit, // True if any faces were intersected
DWORD *pFaceIndex, // index of closest face intersected
FLOAT *pU, // Barycentric Hit Coordinates
FLOAT *pV, // Barycentric Hit Coordinates
FLOAT *pDist, // Ray-Intersection Parameter Distance
LPD3DXBUFFER *ppAllHits, // Array of D3DXINTERSECTINFOs for all hits (not just closest)
DWORD *pCountOfHits); // Number of entries in AllHits array
HRESULT WINAPI D3DXSplitMesh
(
CONST LPD3DXMESH pMeshIn,
CONST DWORD *pAdjacencyIn,
CONST DWORD MaxSize,
CONST DWORD Options,
DWORD *pMeshesOut,
LPD3DXBUFFER *ppMeshArrayOut,
LPD3DXBUFFER *ppAdjacencyArrayOut,
LPD3DXBUFFER *ppFaceRemapArrayOut,
LPD3DXBUFFER *ppVertRemapArrayOut
);
BOOL D3DXIntersectTri
(
CONST D3DXVECTOR3 *p0, // Triangle vertex 0 position
CONST D3DXVECTOR3 *p1, // Triangle vertex 1 position
CONST D3DXVECTOR3 *p2, // Triangle vertex 2 position
CONST D3DXVECTOR3 *pRayPos, // Ray origin
CONST D3DXVECTOR3 *pRayDir, // Ray direction
FLOAT *pU, // Barycentric Hit Coordinates
FLOAT *pV, // Barycentric Hit Coordinates
FLOAT *pDist); // Ray-Intersection Parameter Distance
BOOL WINAPI
D3DXSphereBoundProbe(
CONST D3DXVECTOR3 *pCenter,
FLOAT Radius,
CONST D3DXVECTOR3 *pRayPosition,
CONST D3DXVECTOR3 *pRayDirection);
BOOL WINAPI
D3DXBoxBoundProbe(
CONST D3DXVECTOR3 *pMin,
CONST D3DXVECTOR3 *pMax,
CONST D3DXVECTOR3 *pRayPosition,
CONST D3DXVECTOR3 *pRayDirection);
enum _D3DXERR {
D3DXERR_CANNOTMODIFYINDEXBUFFER = MAKE_DDHRESULT(2900),
D3DXERR_INVALIDMESH = MAKE_DDHRESULT(2901),
D3DXERR_CANNOTATTRSORT = MAKE_DDHRESULT(2902),
D3DXERR_SKINNINGNOTSUPPORTED = MAKE_DDHRESULT(2903),
D3DXERR_TOOMANYINFLUENCES = MAKE_DDHRESULT(2904),
D3DXERR_INVALIDDATA = MAKE_DDHRESULT(2905),
D3DXERR_LOADEDMESHASNODATA = MAKE_DDHRESULT(2906),
};
#define D3DX_COMP_TANGENT_NONE 0xFFFFFFFF
HRESULT WINAPI D3DXComputeTangent(LPD3DXMESH InMesh,
DWORD TexStage,
LPD3DXMESH OutMesh,
DWORD TexStageUVec,
DWORD TexStageVVec,
DWORD Wrap,
DWORD *Adjacency);
HRESULT WINAPI
D3DXConvertMeshSubsetToSingleStrip
(
LPD3DXBASEMESH MeshIn,
DWORD AttribId,
DWORD IBOptions,
LPDIRECT3DINDEXBUFFER8 *ppIndexBuffer,
DWORD *pNumIndices
);
HRESULT WINAPI
D3DXConvertMeshSubsetToStrips
(
LPD3DXBASEMESH MeshIn,
DWORD AttribId,
DWORD IBOptions,
LPDIRECT3DINDEXBUFFER8 *ppIndexBuffer,
DWORD *pNumIndices,
LPD3DXBUFFER *ppStripLengths,
DWORD *pNumStrips
);
#ifdef __cplusplus
}
#endif //__cplusplus
#endif //__D3DX8MESH_H__

View File

@ -0,0 +1,220 @@
///////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dx8shapes.h
// Content: D3DX simple shapes
//
///////////////////////////////////////////////////////////////////////////
#include "d3dx8.h"
#ifndef __D3DX8SHAPES_H__
#define __D3DX8SHAPES_H__
///////////////////////////////////////////////////////////////////////////
// Functions:
///////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
//-------------------------------------------------------------------------
// D3DXCreatePolygon:
// ------------------
// Creates a mesh containing an n-sided polygon. The polygon is centered
// at the origin.
//
// Parameters:
//
// pDevice The D3D device with which the mesh is going to be used.
// Length Length of each side.
// Sides Number of sides the polygon has. (Must be >= 3)
// ppMesh The mesh object which will be created
// ppAdjacency Returns a buffer containing adjacency info. Can be NULL.
//-------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreatePolygon(
LPDIRECT3DDEVICE8 pDevice,
FLOAT Length,
UINT Sides,
LPD3DXMESH* ppMesh,
LPD3DXBUFFER* ppAdjacency);
//-------------------------------------------------------------------------
// D3DXCreateBox:
// --------------
// Creates a mesh containing an axis-aligned box. The box is centered at
// the origin.
//
// Parameters:
//
// pDevice The D3D device with which the mesh is going to be used.
// Width Width of box (along X-axis)
// Height Height of box (along Y-axis)
// Depth Depth of box (along Z-axis)
// ppMesh The mesh object which will be created
// ppAdjacency Returns a buffer containing adjacency info. Can be NULL.
//-------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreateBox(
LPDIRECT3DDEVICE8 pDevice,
FLOAT Width,
FLOAT Height,
FLOAT Depth,
LPD3DXMESH* ppMesh,
LPD3DXBUFFER* ppAdjacency);
//-------------------------------------------------------------------------
// D3DXCreateCylinder:
// -------------------
// Creates a mesh containing a cylinder. The generated cylinder is
// centered at the origin, and its axis is aligned with the Z-axis.
//
// Parameters:
//
// pDevice The D3D device with which the mesh is going to be used.
// Radius1 Radius at -Z end (should be >= 0.0f)
// Radius2 Radius at +Z end (should be >= 0.0f)
// Length Length of cylinder (along Z-axis)
// Slices Number of slices about the main axis
// Stacks Number of stacks along the main axis
// ppMesh The mesh object which will be created
// ppAdjacency Returns a buffer containing adjacency info. Can be NULL.
//-------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreateCylinder(
LPDIRECT3DDEVICE8 pDevice,
FLOAT Radius1,
FLOAT Radius2,
FLOAT Length,
UINT Slices,
UINT Stacks,
LPD3DXMESH* ppMesh,
LPD3DXBUFFER* ppAdjacency);
//-------------------------------------------------------------------------
// D3DXCreateSphere:
// -----------------
// Creates a mesh containing a sphere. The sphere is centered at the
// origin.
//
// Parameters:
//
// pDevice The D3D device with which the mesh is going to be used.
// Radius Radius of the sphere (should be >= 0.0f)
// Slices Number of slices about the main axis
// Stacks Number of stacks along the main axis
// ppMesh The mesh object which will be created
// ppAdjacency Returns a buffer containing adjacency info. Can be NULL.
//-------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreateSphere(
LPDIRECT3DDEVICE8 pDevice,
FLOAT Radius,
UINT Slices,
UINT Stacks,
LPD3DXMESH* ppMesh,
LPD3DXBUFFER* ppAdjacency);
//-------------------------------------------------------------------------
// D3DXCreateTorus:
// ----------------
// Creates a mesh containing a torus. The generated torus is centered at
// the origin, and its axis is aligned with the Z-axis.
//
// Parameters:
//
// pDevice The D3D device with which the mesh is going to be used.
// InnerRadius Inner radius of the torus (should be >= 0.0f)
// OuterRadius Outer radius of the torue (should be >= 0.0f)
// Sides Number of sides in a cross-section (must be >= 3)
// Rings Number of rings making up the torus (must be >= 3)
// ppMesh The mesh object which will be created
// ppAdjacency Returns a buffer containing adjacency info. Can be NULL.
//-------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreateTorus(
LPDIRECT3DDEVICE8 pDevice,
FLOAT InnerRadius,
FLOAT OuterRadius,
UINT Sides,
UINT Rings,
LPD3DXMESH* ppMesh,
LPD3DXBUFFER* ppAdjacency);
//-------------------------------------------------------------------------
// D3DXCreateTeapot:
// -----------------
// Creates a mesh containing a teapot.
//
// Parameters:
//
// pDevice The D3D device with which the mesh is going to be used.
// ppMesh The mesh object which will be created
// ppAdjacency Returns a buffer containing adjacency info. Can be NULL.
//-------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreateTeapot(
LPDIRECT3DDEVICE8 pDevice,
LPD3DXMESH* ppMesh,
LPD3DXBUFFER* ppAdjacency);
//-------------------------------------------------------------------------
// D3DXCreateText:
// ---------------
// Creates a mesh containing the specified text using the font associated
// with the device context.
//
// Parameters:
//
// pDevice The D3D device with which the mesh is going to be used.
// hDC Device context, with desired font selected
// pText Text to generate
// Deviation Maximum chordal deviation from true font outlines
// Extrusion Amount to extrude text in -Z direction
// ppMesh The mesh object which will be created
// pGlyphMetrics Address of buffer to receive glyph metric data (or NULL)
//-------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreateTextA(
LPDIRECT3DDEVICE8 pDevice,
HDC hDC,
LPCSTR pText,
FLOAT Deviation,
FLOAT Extrusion,
LPD3DXMESH* ppMesh,
LPD3DXBUFFER* ppAdjacency,
LPGLYPHMETRICSFLOAT pGlyphMetrics);
HRESULT WINAPI
D3DXCreateTextW(
LPDIRECT3DDEVICE8 pDevice,
HDC hDC,
LPCWSTR pText,
FLOAT Deviation,
FLOAT Extrusion,
LPD3DXMESH* ppMesh,
LPD3DXBUFFER* ppAdjacency,
LPGLYPHMETRICSFLOAT pGlyphMetrics);
#ifdef UNICODE
#define D3DXCreateText D3DXCreateTextW
#else
#define D3DXCreateText D3DXCreateTextA
#endif
#ifdef __cplusplus
}
#endif //__cplusplus
#endif //__D3DX8SHAPES_H__

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,407 @@
//----------------------------------------------------------------------
//
// d3dxerr.h -- 0xC code definitions for the D3DX API
//
// Copyright (c) Microsoft Corp. All rights reserved.
//
//----------------------------------------------------------------------
#ifndef __D3DXERR_H__
#define __D3DXERR_H__
//
//
// Values are 32 bit values layed out as follows:
//
// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
// +---+-+-+-----------------------+-------------------------------+
// |Sev|C|R| Facility | Code |
// +---+-+-+-----------------------+-------------------------------+
//
// where
//
// Sev - is the severity code
//
// 00 - Success
// 01 - Informational
// 10 - Warning
// 11 - Error
//
// C - is the Customer code flag
//
// R - is a reserved bit
//
// Facility - is the facility code
//
// Code - is the facility's status code
//
//
// Define the facility codes
//
#define FACILITY_D3DX 0x877
//
// MessageId: D3DXERR_NOMEMORY
//
// MessageText:
//
// Out of memory.
//
#define D3DXERR_NOMEMORY ((HRESULT)0xC8770BB8L)
//
// MessageId: D3DXERR_NULLPOINTER
//
// MessageText:
//
// A NULL pointer was passed as a parameter.
//
#define D3DXERR_NULLPOINTER ((HRESULT)0xC8770BB9L)
//
// MessageId: D3DXERR_INVALIDD3DXDEVICEINDEX
//
// MessageText:
//
// The Device Index passed in is invalid.
//
#define D3DXERR_INVALIDD3DXDEVICEINDEX ((HRESULT)0xC8770BBAL)
//
// MessageId: D3DXERR_NODIRECTDRAWAVAILABLE
//
// MessageText:
//
// DirectDraw has not been created.
//
#define D3DXERR_NODIRECTDRAWAVAILABLE ((HRESULT)0xC8770BBBL)
//
// MessageId: D3DXERR_NODIRECT3DAVAILABLE
//
// MessageText:
//
// Direct3D has not been created.
//
#define D3DXERR_NODIRECT3DAVAILABLE ((HRESULT)0xC8770BBCL)
//
// MessageId: D3DXERR_NODIRECT3DDEVICEAVAILABLE
//
// MessageText:
//
// Direct3D device has not been created.
//
#define D3DXERR_NODIRECT3DDEVICEAVAILABLE ((HRESULT)0xC8770BBDL)
//
// MessageId: D3DXERR_NOPRIMARYAVAILABLE
//
// MessageText:
//
// Primary surface has not been created.
//
#define D3DXERR_NOPRIMARYAVAILABLE ((HRESULT)0xC8770BBEL)
//
// MessageId: D3DXERR_NOZBUFFERAVAILABLE
//
// MessageText:
//
// Z buffer has not been created.
//
#define D3DXERR_NOZBUFFERAVAILABLE ((HRESULT)0xC8770BBFL)
//
// MessageId: D3DXERR_NOBACKBUFFERAVAILABLE
//
// MessageText:
//
// Backbuffer has not been created.
//
#define D3DXERR_NOBACKBUFFERAVAILABLE ((HRESULT)0xC8770BC0L)
//
// MessageId: D3DXERR_COULDNTUPDATECAPS
//
// MessageText:
//
// Failed to update caps database after changing display mode.
//
#define D3DXERR_COULDNTUPDATECAPS ((HRESULT)0xC8770BC1L)
//
// MessageId: D3DXERR_NOZBUFFER
//
// MessageText:
//
// Could not create Z buffer.
//
#define D3DXERR_NOZBUFFER ((HRESULT)0xC8770BC2L)
//
// MessageId: D3DXERR_INVALIDMODE
//
// MessageText:
//
// Display mode is not valid.
//
#define D3DXERR_INVALIDMODE ((HRESULT)0xC8770BC3L)
//
// MessageId: D3DXERR_INVALIDPARAMETER
//
// MessageText:
//
// One or more of the parameters passed is invalid.
//
#define D3DXERR_INVALIDPARAMETER ((HRESULT)0xC8770BC4L)
//
// MessageId: D3DXERR_INITFAILED
//
// MessageText:
//
// D3DX failed to initialize itself.
//
#define D3DXERR_INITFAILED ((HRESULT)0xC8770BC5L)
//
// MessageId: D3DXERR_STARTUPFAILED
//
// MessageText:
//
// D3DX failed to start up.
//
#define D3DXERR_STARTUPFAILED ((HRESULT)0xC8770BC6L)
//
// MessageId: D3DXERR_D3DXNOTSTARTEDYET
//
// MessageText:
//
// D3DXInitialize() must be called first.
//
#define D3DXERR_D3DXNOTSTARTEDYET ((HRESULT)0xC8770BC7L)
//
// MessageId: D3DXERR_NOTINITIALIZED
//
// MessageText:
//
// D3DX is not initialized yet.
//
#define D3DXERR_NOTINITIALIZED ((HRESULT)0xC8770BC8L)
//
// MessageId: D3DXERR_FAILEDDRAWTEXT
//
// MessageText:
//
// Failed to render text to the surface.
//
#define D3DXERR_FAILEDDRAWTEXT ((HRESULT)0xC8770BC9L)
//
// MessageId: D3DXERR_BADD3DXCONTEXT
//
// MessageText:
//
// Bad D3DX context.
//
#define D3DXERR_BADD3DXCONTEXT ((HRESULT)0xC8770BCAL)
//
// MessageId: D3DXERR_CAPSNOTSUPPORTED
//
// MessageText:
//
// The requested device capabilities are not supported.
//
#define D3DXERR_CAPSNOTSUPPORTED ((HRESULT)0xC8770BCBL)
//
// MessageId: D3DXERR_UNSUPPORTEDFILEFORMAT
//
// MessageText:
//
// The image file format is unrecognized.
//
#define D3DXERR_UNSUPPORTEDFILEFORMAT ((HRESULT)0xC8770BCCL)
//
// MessageId: D3DXERR_IFLERROR
//
// MessageText:
//
// The image file loading library error.
//
#define D3DXERR_IFLERROR ((HRESULT)0xC8770BCDL)
//
// MessageId: D3DXERR_FAILEDGETCAPS
//
// MessageText:
//
// Could not obtain device caps.
//
#define D3DXERR_FAILEDGETCAPS ((HRESULT)0xC8770BCEL)
//
// MessageId: D3DXERR_CANNOTRESIZEFULLSCREEN
//
// MessageText:
//
// Resize does not work for full-screen.
//
#define D3DXERR_CANNOTRESIZEFULLSCREEN ((HRESULT)0xC8770BCFL)
//
// MessageId: D3DXERR_CANNOTRESIZENONWINDOWED
//
// MessageText:
//
// Resize does not work for non-windowed contexts.
//
#define D3DXERR_CANNOTRESIZENONWINDOWED ((HRESULT)0xC8770BD0L)
//
// MessageId: D3DXERR_FRONTBUFFERALREADYEXISTS
//
// MessageText:
//
// Front buffer already exists.
//
#define D3DXERR_FRONTBUFFERALREADYEXISTS ((HRESULT)0xC8770BD1L)
//
// MessageId: D3DXERR_FULLSCREENPRIMARYEXISTS
//
// MessageText:
//
// The app is using the primary in full-screen mode.
//
#define D3DXERR_FULLSCREENPRIMARYEXISTS ((HRESULT)0xC8770BD2L)
//
// MessageId: D3DXERR_GETDCFAILED
//
// MessageText:
//
// Could not get device context.
//
#define D3DXERR_GETDCFAILED ((HRESULT)0xC8770BD3L)
//
// MessageId: D3DXERR_BITBLTFAILED
//
// MessageText:
//
// Could not bitBlt.
//
#define D3DXERR_BITBLTFAILED ((HRESULT)0xC8770BD4L)
//
// MessageId: D3DXERR_NOTEXTURE
//
// MessageText:
//
// There is no surface backing up this texture.
//
#define D3DXERR_NOTEXTURE ((HRESULT)0xC8770BD5L)
//
// MessageId: D3DXERR_MIPLEVELABSENT
//
// MessageText:
//
// There is no such miplevel for this surface.
//
#define D3DXERR_MIPLEVELABSENT ((HRESULT)0xC8770BD6L)
//
// MessageId: D3DXERR_SURFACENOTPALETTED
//
// MessageText:
//
// The surface is not paletted.
//
#define D3DXERR_SURFACENOTPALETTED ((HRESULT)0xC8770BD7L)
//
// MessageId: D3DXERR_ENUMFORMATSFAILED
//
// MessageText:
//
// An error occured while enumerating surface formats.
//
#define D3DXERR_ENUMFORMATSFAILED ((HRESULT)0xC8770BD8L)
//
// MessageId: D3DXERR_COLORDEPTHTOOLOW
//
// MessageText:
//
// D3DX only supports color depths of 16 bit or greater.
//
#define D3DXERR_COLORDEPTHTOOLOW ((HRESULT)0xC8770BD9L)
//
// MessageId: D3DXERR_INVALIDFILEFORMAT
//
// MessageText:
//
// The file format is invalid.
//
#define D3DXERR_INVALIDFILEFORMAT ((HRESULT)0xC8770BDAL)
//
// MessageId: D3DXERR_NOMATCHFOUND
//
// MessageText:
//
// No suitable match found.
//
#define D3DXERR_NOMATCHFOUND ((HRESULT)0xC8770BDBL)
#endif //__D3DXERR_H__

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,209 @@
///////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dxshapes.h
// Content: D3DX simple shapes
//
///////////////////////////////////////////////////////////////////////////
#ifndef __D3DXSHAPES_H__
#define __D3DXSHAPES_H__
#include <d3d.h>
#include <limits.h>
#include "d3dxerr.h"
typedef struct ID3DXSimpleShape *LPD3DXSIMPLESHAPE;
// {CFCD4602-EB7B-11d2-A440-00A0C90629A8}
DEFINE_GUID( IID_ID3DXSimpleShape,
0xcfcd4602, 0xeb7b, 0x11d2, 0xa4, 0x40, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8 );
///////////////////////////////////////////////////////////////////////////
// Interfaces:
///////////////////////////////////////////////////////////////////////////
//-------------------------------------------------------------------------
// ID3DXSimpleShape interface:
//-------------------------------------------------------------------------
DECLARE_INTERFACE_(ID3DXSimpleShape, IUnknown)
{
// IUnknown methods
STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID* ppvObj) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
// ID3DXSimpleShape methods
STDMETHOD_(LPDIRECT3DVERTEXBUFFER7, GetVB)(THIS) PURE;
STDMETHOD_(DWORD, GetIndices)(THIS_ LPWORD *ppIndices) PURE;
STDMETHOD(Draw)(THIS) PURE;
};
///////////////////////////////////////////////////////////////////////////
// Functions:
///////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
//-------------------------------------------------------------------------
// D3DXCreatePolygon: Creates an 'n' sided polygon using the device
// ---------------- specified. It returns a vertex buffer that can be used
// for drawing or manipulation by the program later on.
//
// Params:
// [in] LPDIRECT3DDEVICE7 pDevice: The device to create off.
// [in] float sideSize: Length of a side.
// [in] DWORD numTexCoords: The number of texture coordinates desired
// in the vertex-buffer. (Default is 1)
// D3DX_DEFAULT is a valid input.
// [out] IDirect3DVertexBuffer7** ppVB: The output shape interface.
//-------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreatePolygon(LPDIRECT3DDEVICE7 pDevice,
float sideSize,
DWORD numSides,
DWORD numTexCoords,
LPD3DXSIMPLESHAPE* ppShape );
//-------------------------------------------------------------------------
// D3DXCreateBox: Creates a box (cuboid) of given dimensions using the
// ------------ device. It returns a vertex buffer that can
// be used for drawing or manipulation by the program later on.
//
// Params:
// [in] LPDIRECT3DDEVICE7 pDevice: The device to create off.
// [in] float width: Width of the box (along x-axis)
// [in] float height: Height of the box (along y-axis)
// [in] float depth: Depth of the box (along z-axis)
// [in] DWORD numTexCoords: The number of texture coordinates desired
// in the vertex-buffer. Default is 1.
// D3DX_DEFAULT is a valid input here.
// [out] LPD3DXSIMPLESHAPE* ppShape: The output vertex-buffer.
//-------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreateBox(LPDIRECT3DDEVICE7 pDevice,
float width,
float height,
float depth,
DWORD numTexCoords,
LPD3DXSIMPLESHAPE* ppShape );
//-------------------------------------------------------------------------
// D3DXCreateCylinder: Creates a cylinder of given dimensions using the
// ----------------- device. It returns a vertex buffer that
// can be used for drawing or manipulation by the program
// later on.
//
// Params:
// [in] LPDIRECT3DDEVICE7 pDevice: The device to create off.
// [in] float baseRadius: Base-radius (default is 1.0f, shd be >= 0.0f)
// [in] float topRadius: Top-radius (default is 1.0f, shd be >= 0.0f)
// [in] float height: Height (default is 1.0f, shd be >= 0.0f)
// [in] DWORD numSlices: Number of slices about the main axis.
// (default is 8) D3DX_DEFAULT is a valid input.
// [in] DWORD numStacks: Number of stacks along the main axis.
// (default is 8) D3DX_DEFAULT is a valid input.
// [in] DWORD numTexCoords: The number of texture coordinates desired
// in the vertex-buffer. Default is 1.
// D3DX_DEFAULT is a valid input here.
// [out] LPD3DXSIMPLESHAPE* ppShape: The output shape interface.
//-------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreateCylinder(LPDIRECT3DDEVICE7 pDevice,
float baseRadius,
float topRadius,
float height,
DWORD numSlices,
DWORD numStacks,
DWORD numTexCoords,
LPD3DXSIMPLESHAPE* ppShape );
//-------------------------------------------------------------------------
// D3DXCreateTorus: Creates a torus of given dimensions using the
// -------------- device specified. It returns a vertex buffer that can
// be used for drawing or manipulation by the program later
// on. It draws a doughnut, centered at (0, 0, 0) whose axis
// is aligned with the z-axis. With the innerRadius used
// as the radius of the cross-section (minor-Radius) and
// the outerRadius used as the radius of the central 'hole'.
//
// Params:
// [in] LPDIRECT3DDEVICE7 pDevice: The device to create off.
// [in] float innerRadius: inner radius (default is 1.0f, shd be >= 0.0f)
// [in] float outerRadius: outer radius (default is 2.0f, shd be >= 0.0f)
// [in] DWORD numSides: Number of sides in the cross-section
// (default is 8). D3DX_DEFAULT is a valid input.
// [in] DWORD numRings: Number of rings making up the torus
// (default is 8) D3DX_DEFAULT is a valid input.
// [in] DWORD numTexCoords: The number of texture coordinates desired
// in the vertex-buffer. Default is 1.
// D3DX_DEFAULT is a valid input here.
// [out] LPD3DXSIMPLESHAPE* ppShape: The output shape interface.
//-------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreateTorus(LPDIRECT3DDEVICE7 pDevice,
float innerRadius,
float outerRadius,
DWORD numSides,
DWORD numRings,
DWORD numTexCoords,
LPD3DXSIMPLESHAPE* ppShape );
//-------------------------------------------------------------------------
// D3DXCreateTeapot: Creates a teapot using the device specified.
// ---------------- It returns a vertex buffer that can be used for
// drawing or manipulation by the program later on.
//
// Params:
// [in] LPDIRECT3DDEVICE7 pDevice: The device to create off.
// [in] DWORD numTexCoords: The number of texture coordinates desired
// in the vertex-buffer. Default is 1.
// D3DX_DEFAULT is a valid input here.
// [out] LPD3DXSIMPLESHAPE* ppShape: The output shape interface.
//-------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreateTeapot(LPDIRECT3DDEVICE7 pDevice,
DWORD numTexCoords,
LPD3DXSIMPLESHAPE* ppShape);
//-------------------------------------------------------------------------
// D3DXCreateSphere: Creates a cylinder of given dimensions using the
// ---------------- device specified.
// It returns a vertex buffer that can be used for
// drawing or manipulation by the program later on.
//
// Params:
// [in] LPDIRECT3DDEVICE7 pDevice: The device to create off.
// [in] float radius: radius (default is 1.0f, shd be >= 0.0f)
// [in] float height: Height (default is 1.0f, shd be >= 0.0f)
// [in] DWORD numSlices: Number of slices about the main axis
// (default is 8) D3DX_DEFAULT is a valid input.
// [in] DWORD numStacks: Number of stacks along the main axis
// (default is 8) D3DX_DEFAULT is a valid input.
// [in] DWORD numTexCoords: The number of texture coordinates desired
// in the vertex-buffer. Default is 1.
// D3DX_DEFAULT is a valid input here.
// [out] LPD3DXSIMPLESHAPE* ppShape: The output shape interface.
//-------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreateSphere(LPDIRECT3DDEVICE7 pDevice,
float radius,
DWORD numSlices,
DWORD numStacks,
DWORD numTexCoords,
LPD3DXSIMPLESHAPE* ppShape);
#ifdef __cplusplus
}
#endif //__cplusplus
#endif //__D3DXSHAPES_H__

View File

@ -0,0 +1,321 @@
///////////////////////////////////////////////////////////////////////////
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
// File: d3dxsprite.h
// Content: D3DX sprite helper functions
//
// These functions allow you to use sprites with D3DX. A "sprite" is
// loosely defined as a 2D image that you want to transfer to the
// rendering target. The source image can be a texture created
// with the help of the D3DX texture loader; though advanced users may
// want to create their own. A helper function (PrepareDeviceForSprite)
// is provided to make it easy to set up render states on a device.
// (Again, advanced users can use their own created devices.)
//
// There are two general techniques for sprites; the simpler one just
// specifies a destination rectangle and a rotation anlge. A more
// powerful technique supports rendering to non-rectangular quads.
//
// Both techniques support clipping, alpha, and rotation. More
// details are below.
//
///////////////////////////////////////////////////////////////////////////
#ifndef __D3DXSPRITE_H__
#define __D3DXSPRITE_H__
#include <d3d.h>
#include <limits.h>
#include "d3dxerr.h"
#ifdef __cplusplus
extern "C" {
#endif
//-------------------------------------------------------------------------
// D3DXPrepareDeviceForSprite:
//
// Call this function to set up all the render states necessary for
// BltSprite/WarpSprite to work correctly. (Advanced users may opt to
// not call this function first; in which case Blt/WarpSprite functions
// will use whatever render/texture states were set up on the device when
// they are called.)
//
// Warning: This function modifies render states and may impact performance
// negatively on some 3D hardware if it is called too often per frame.
//
// Warning: If the render state changes (other than through calls to
// BltSprite or WarpSprite), you will need to call this function again before
// calling BltSprite or WarpSprite.
//
// Details: This function modifies the the rendering first texture stage and
// it modifies some renderstates for the entire device. Here is the exact
// list:
//
// SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
// SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
// SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
// SetTextureStageState(0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE);
// SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE);
// SetTextureStageState(0, D3DTSS_MINFILTER, D3DTFN_LINEAR);
// SetTextureStageState(0, D3DTSS_MAGFILTER, D3DTFG_LINEAR);
//
// SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_SRCALPHA);
// SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_INVSRCALPHA);
// SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, TRUE);
//
// Depending on the value of ZEnable parameter, this function will
// will either call
// SetRenderState(D3DRENDERSTATE_ZENABLE, FALSE);
// - or -
// SetRenderState(D3DRENDERSTATE_ZENABLE, TRUE);
//
// Parameters:
// pd3dDevice - a pointer to the d3d device that you wish to prepare
// for use with D3DX Sprite Services
// ZEnable - a flag indicating whether you want the sprites to
// check and update the Z buffer as part of rendering.
// If ZEnable is FALSE, OR you are using
// alpha-blending, then it is necessary to render your
// sprites from back-to-front.
//
//-------------------------------------------------------------------------
#ifdef __cplusplus
HRESULT WINAPI
D3DXPrepareDeviceForSprite( LPDIRECT3DDEVICE7 pd3dDevice,
BOOL ZEnable = FALSE);
#else
HRESULT WINAPI
D3DXPrepareDeviceForSprite( LPDIRECT3DDEVICE7 pd3dDevice,
BOOL ZEnable);
#endif
//-------------------------------------------------------------------------
// The D3DXDrawBasicSprite() function performs blitting of source images onto
// a 3D rendering device. This function only calls SetTexture on the first
// renderstage with the parameter (pd3dTexture) if that parameter is non-null.
// This function assumes that D3DXPrepareDeviceForSprite has been called on
// the device or that caller has in some other way correctly prepared the
// renderstates.
//
// This function supports scaling, rotations, alpha-blending, and choosing
// a source sub-rect.
//
// Rotation angle is specified in radians. Both rotations and scales
// are applied around the center of the sprite; where the center of the
// sprite is half the width/height of the sprite, plus the offset parameter.
//
// Use the offset parameter if you want the sprite's center to be something
// other than the image center.
//
// The destination point indicates where you would like the center of
// the sprite to draw to.
//
// Parameters:
// pd3dTexture - a pointer to the surface containing the texture
// pd3dDevice - a pointer to the d3d device to render to. It is
// assumed that render states are set up. (See
// D3DXPrepareDeviceForSprite)
// ppointDest - a pointer to the target point for the sprite. The
// components of the vector must be in screen
// space.
// alpha - alpha value to apply to sprite. 1.0 means totally
// opaque; and 0.0 means totally transparent.
// WARNING: If you are using alpha, then you should render
// from back to front in order to avoid rendering
// artifacts.
// angleRad - angle of rotation around the 'center' of the rect
// scale - a uniform scale that is applied to the source rect
// to specify the size of the image that is rendered
// pOffset - offset from the center of the source rect to use as the
// center of rotation
// pSourceRect - a rect that indicates what portion of the source
// source texture to use. If NULL is passed, then the
// entire source is used. If the source texture was
// created via D3DX, then the rect should be specified
// in the coordinates of the original image (so that you
// don't have to worry about stretching/scaling that D3DX
// may have done to make the image work with your current
// 3D Device.) Note that horizontal or vertical mirroring
// may be simply accomplished by swapping the left/right
// or top/bottom fields of this RECT.
//-------------------------------------------------------------------------
#ifdef __cplusplus
HRESULT WINAPI
D3DXDrawSpriteSimple(LPDIRECTDRAWSURFACE7 pd3dTexture,
LPDIRECT3DDEVICE7 pd3dDevice,
const D3DXVECTOR3 *ppointDest,
float alpha = 1.0f,
float scale = 1.0f,
float angleRad = 0.0f,
const D3DXVECTOR2 *pOffset = NULL,
const RECT *pSourceRect = NULL);
#else
HRESULT WINAPI
D3DXDrawSpriteSimple(LPDIRECTDRAWSURFACE7 pd3dTexture,
LPDIRECT3DDEVICE7 pd3dDevice,
D3DXVECTOR3 *ppointDest,
float alpha,
float scale,
float angleRad,
D3DXVECTOR2 *pOffset,
RECT *pSourceRect);
#endif
//-------------------------------------------------------------------------
// The D3DXDrawSprite() function transforms source images onto a 3D
// rendering device. It takes a general 4x4 matrix which is use to transform
// the points of a default rect: (left=-.5, top=-.5, right=+.5, bottom=+.5).
// (This default rect was chosen so that it was centered around the origin
// to ease setting up rotations. And it was chosen to have a width/height of one
// to ease setting up scales.)
//
// This function only calls SetTexture on the first
// renderstage with the parameter (pd3dTexture) if that parameter is non-null.
// This function assumes that D3DXPrepareDeviceForSprite has been called on
// the device or that caller has in some other way correctly prepared the
// renderstates.
//
// This function supports alpha-blending, and choosing
// a source sub-rect. (A value of NULL for source sub-rect means the entire
// texture is used.)
//
// Note that if the transformed points have a value for w (the homogenous
// coordinate) that is not 1, then this function will invert it and pass
// that value to D3D as the rhw field of a TLVERTEX. If the value for w is
// zero, then it use 1 as the rhw.
//
// Parameters:
// pd3dTexture - a pointer to the surface containing the texture
// pd3dDevice - a pointer to the d3d device to render to. It is
// assumed that render states are set up. (See
// D3DXPrepareDeviceForSprite)
// pMatrixTransform - 4x4 matrix that specifies the transformation
// that will be applied to the default -.5 to +.5
// rectangle.
// alpha - alpha value to apply to sprite. 1.0 means totally
// opaque; and 0.0 means totally transparent.
// WARNING: If you are using alpha, then you should render
// from back to front in order to avoid rendering
// artifacts.Furthermore, you should avoid scenarios where
// semi-transparent objects intersect.
// pSourceRect - a rect that indicates what portion of the source
// source texture to use. If NULL is passed, then the
// entire source is used. If the source texture was
// created via D3DX, then the rect should be specified
// in the coordinates of the original image (so that you
// don't have to worry about stretching/scaling that D3DX
// may have done to make the image work with your current
// 3D Device.) Note that mirroring may be simply accomplished
// by swapping the left/right or top/bottom fields of
// this RECT.
//
//-------------------------------------------------------------------------
#ifdef __cplusplus
HRESULT WINAPI
D3DXDrawSpriteTransform(LPDIRECTDRAWSURFACE7 pd3dTexture,
LPDIRECT3DDEVICE7 pd3dDevice,
const D3DXMATRIX *pMatrixTransform,
float alpha = 1.0f,
const RECT *pSourceRect = NULL);
#else
HRESULT WINAPI
D3DXDrawSpriteTransform(LPDIRECTDRAWSURFACE7 pd3dTexture,
LPDIRECT3DDEVICE7 pd3dDevice,
D3DXMATRIX *pMatrixTransform,
float alpha,
RECT *pSourceRect);
#endif
//-------------------------------------------------------------------------
// The D3DXBuildSpriteTransform() function is a helper provided which
// creates a matrix corresponding to simple properties. This matrix is
// set up to pass directly to D3DXTransformSprite.
//
// Parameters:
// pMatrix - a pointer to the result matrix
// prectDest - a pointer to the target rectangle for the sprite
// angleRad - angle of rotation around the 'center' of the rect
// pOffset - offset from the center of the source rect to use as the
// center of rotation
//
//-------------------------------------------------------------------------
#ifdef __cplusplus
void WINAPI
D3DXBuildSpriteTransform(D3DXMATRIX *pMatrix,
const RECT *prectDest,
float angleRad = 0.0f,
const D3DXVECTOR2 *pOffset = NULL);
#else
void WINAPI
D3DXBuildSpriteTransform(D3DXMATRIX *pMatrix,
RECT *prectDest,
float angleRad,
D3DXVECTOR2 *pOffset);
#endif
//-------------------------------------------------------------------------
// The D3DXDrawSprite3D() function renders a texture onto a 3D quad. The
// quad ABCD is broken into two triangles ABC and ACD which are rendered
// via DrawPrim.
//
// Parameters:
// pd3dTexture - a pointer to the surface containing the texture
// pd3dDevice - a pointer to the d3d device to render to. It is
// assumed that render states are set up. (See
// D3DXPrepareDeviceForSprite)
// quad - array of 4 points in the following order:
// upper-left, upper-right, lower-right, lower-left.
// If these vectors contain a W, then this function
// will take the reciprocal of that value to pass as
// as the rhw (i.e. reciprocal homogenous w).
// alpha - alpha value to apply to sprite. 1.0 means totally
// opaque; and 0.0 means totally transparent.
// WARNING: If you are using alpha, then you should render
// from back to front in order to avoid rendering
// artifacts.Furthermore, you should avoid scenarios where
// semi-transparent objects intersect.
// pSourceRect - a rect that indicates what portion of the source
// source texture to use. If NULL is passed, then the
// entire source is used. If the source texture was
// created via D3DX, then the rect should be specified
// in the coordinates of the original image (so that you
// don't have to worry about stretching/scaling that D3DX
// may have done to make the image work with your current
// 3D Device.) Note that mirroring may be simply accomplished
// by swapping the left/right or top/bottom fields of
// this RECT.
//-------------------------------------------------------------------------
#ifdef __cplusplus
HRESULT WINAPI
D3DXDrawSprite3D(LPDIRECTDRAWSURFACE7 pd3dTexture,
LPDIRECT3DDEVICE7 pd3dDevice,
const D3DXVECTOR4 quad[4],
float alpha = 1.0f,
const RECT *pSourceRect = NULL);
#else
HRESULT WINAPI
D3DXDrawSprite3D(LPDIRECTDRAWSURFACE7 pd3dTexture,
LPDIRECT3DDEVICE7 pd3dDevice,
D3DXVECTOR4 quad[4],
float alpha,
RECT *pSourceRect);
#endif
#ifdef __cplusplus
} // extern "C"
#endif
#endif // __D3DXSPRITE_H__

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,755 @@
/****************************************************************************
*
* Copyright (C) 1995-2000 Microsoft Corporation. All Rights Reserved.
*
* File: dinputd.h
* Content: DirectInput include file for device driver implementors
*
****************************************************************************/
#ifndef __DINPUTD_INCLUDED__
#define __DINPUTD_INCLUDED__
#ifndef DIRECTINPUT_VERSION
#define DIRECTINPUT_VERSION 0x0800
#pragma message(__FILE__ ": DIRECTINPUT_VERSION undefined. Defaulting to version 0x0800")
#endif
#ifdef __cplusplus
extern "C" {
#endif
/****************************************************************************
*
* Interfaces
*
****************************************************************************/
#ifndef DIJ_RINGZERO
DEFINE_GUID(IID_IDirectInputEffectDriver, 0x02538130,0x898F,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
DEFINE_GUID(IID_IDirectInputJoyConfig, 0x1DE12AB1,0xC9F5,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(IID_IDirectInputPIDDriver, 0xEEC6993A,0xB3FD,0x11D2,0xA9,0x16,0x00,0xC0,0x4F,0xB9,0x86,0x38);
DEFINE_GUID(IID_IDirectInputJoyConfig8, 0xeb0d7dfa,0x1990,0x4f27,0xb4,0xd6,0xed,0xf2,0xee,0xc4,0xa4,0x4c);
#endif /* DIJ_RINGZERO */
/****************************************************************************
*
* IDirectInputEffectDriver
*
****************************************************************************/
typedef struct DIOBJECTATTRIBUTES {
DWORD dwFlags;
WORD wUsagePage;
WORD wUsage;
} DIOBJECTATTRIBUTES, *LPDIOBJECTATTRIBUTES;
typedef const DIOBJECTATTRIBUTES *LPCDIOBJECTATTRIBUTES;
typedef struct DIFFOBJECTATTRIBUTES {
DWORD dwFFMaxForce;
DWORD dwFFForceResolution;
} DIFFOBJECTATTRIBUTES, *LPDIFFOBJECTATTRIBUTES;
typedef const DIFFOBJECTATTRIBUTES *LPCDIFFOBJECTATTRIBUTES;
typedef struct DIOBJECTCALIBRATION {
LONG lMin;
LONG lCenter;
LONG lMax;
} DIOBJECTCALIBRATION, *LPDIOBJECTCALIBRATION;
typedef const DIOBJECTCALIBRATION *LPCDIOBJECTCALIBRATION;
typedef struct DIPOVCALIBRATION {
LONG lMin[5];
LONG lMax[5];
} DIPOVCALIBRATION, *LPDIPOVCALIBRATION;
typedef const DIPOVCALIBRATION *LPCDIPOVCALIBRATION;
typedef struct DIEFFECTATTRIBUTES {
DWORD dwEffectId;
DWORD dwEffType;
DWORD dwStaticParams;
DWORD dwDynamicParams;
DWORD dwCoords;
} DIEFFECTATTRIBUTES, *LPDIEFFECTATTRIBUTES;
typedef const DIEFFECTATTRIBUTES *LPCDIEFFECTATTRIBUTES;
typedef struct DIFFDEVICEATTRIBUTES {
DWORD dwFlags;
DWORD dwFFSamplePeriod;
DWORD dwFFMinTimeResolution;
} DIFFDEVICEATTRIBUTES, *LPDIFFDEVICEATTRIBUTES;
typedef const DIFFDEVICEATTRIBUTES *LPCDIFFDEVICEATTRIBUTES;
typedef struct DIDRIVERVERSIONS {
DWORD dwSize;
DWORD dwFirmwareRevision;
DWORD dwHardwareRevision;
DWORD dwFFDriverVersion;
} DIDRIVERVERSIONS, *LPDIDRIVERVERSIONS;
typedef const DIDRIVERVERSIONS *LPCDIDRIVERVERSIONS;
typedef struct DIDEVICESTATE {
DWORD dwSize;
DWORD dwState;
DWORD dwLoad;
} DIDEVICESTATE, *LPDIDEVICESTATE;
#define DEV_STS_EFFECT_RUNNING DIEGES_PLAYING
#ifndef DIJ_RINGZERO
typedef struct DIHIDFFINITINFO {
DWORD dwSize;
LPWSTR pwszDeviceInterface;
GUID GuidInstance;
} DIHIDFFINITINFO, *LPDIHIDFFINITINFO;
#undef INTERFACE
#define INTERFACE IDirectInputEffectDriver
DECLARE_INTERFACE_(IDirectInputEffectDriver, IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IDirectInputEffectDriver methods ***/
STDMETHOD(DeviceID)(THIS_ DWORD,DWORD,DWORD,DWORD,LPVOID) PURE;
STDMETHOD(GetVersions)(THIS_ LPDIDRIVERVERSIONS) PURE;
STDMETHOD(Escape)(THIS_ DWORD,DWORD,LPDIEFFESCAPE) PURE;
STDMETHOD(SetGain)(THIS_ DWORD,DWORD) PURE;
STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD,DWORD) PURE;
STDMETHOD(GetForceFeedbackState)(THIS_ DWORD,LPDIDEVICESTATE) PURE;
STDMETHOD(DownloadEffect)(THIS_ DWORD,DWORD,LPDWORD,LPCDIEFFECT,DWORD) PURE;
STDMETHOD(DestroyEffect)(THIS_ DWORD,DWORD) PURE;
STDMETHOD(StartEffect)(THIS_ DWORD,DWORD,DWORD,DWORD) PURE;
STDMETHOD(StopEffect)(THIS_ DWORD,DWORD) PURE;
STDMETHOD(GetEffectStatus)(THIS_ DWORD,DWORD,LPDWORD) PURE;
};
typedef struct IDirectInputEffectDriver *LPDIRECTINPUTEFFECTDRIVER;
#if !defined(__cplusplus) || defined(CINTERFACE)
#define IDirectInputEffectDriver_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectInputEffectDriver_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirectInputEffectDriver_Release(p) (p)->lpVtbl->Release(p)
#define IDirectInputEffectDriver_DeviceID(p,a,b,c,d,e) (p)->lpVtbl->DeviceID(p,a,b,c,d,e)
#define IDirectInputEffectDriver_GetVersions(p,a) (p)->lpVtbl->GetVersions(p,a)
#define IDirectInputEffectDriver_Escape(p,a,b,c) (p)->lpVtbl->Escape(p,a,b,c)
#define IDirectInputEffectDriver_SetGain(p,a,b) (p)->lpVtbl->SetGain(p,a,b)
#define IDirectInputEffectDriver_SendForceFeedbackCommand(p,a,b) (p)->lpVtbl->SendForceFeedbackCommand(p,a,b)
#define IDirectInputEffectDriver_GetForceFeedbackState(p,a,b) (p)->lpVtbl->GetForceFeedbackState(p,a,b)
#define IDirectInputEffectDriver_DownloadEffect(p,a,b,c,d,e) (p)->lpVtbl->DownloadEffect(p,a,b,c,d,e)
#define IDirectInputEffectDriver_DestroyEffect(p,a,b) (p)->lpVtbl->DestroyEffect(p,a,b)
#define IDirectInputEffectDriver_StartEffect(p,a,b,c,d) (p)->lpVtbl->StartEffect(p,a,b,c,d)
#define IDirectInputEffectDriver_StopEffect(p,a,b) (p)->lpVtbl->StopEffect(p,a,b)
#define IDirectInputEffectDriver_GetEffectStatus(p,a,b,c) (p)->lpVtbl->GetEffectStatus(p,a,b,c)
#else
#define IDirectInputEffectDriver_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirectInputEffectDriver_AddRef(p) (p)->AddRef()
#define IDirectInputEffectDriver_Release(p) (p)->Release()
#define IDirectInputEffectDriver_DeviceID(p,a,b,c,d,e) (p)->DeviceID(a,b,c,d,e)
#define IDirectInputEffectDriver_GetVersions(p,a) (p)->GetVersions(a)
#define IDirectInputEffectDriver_Escape(p,a,b,c) (p)->Escape(a,b,c)
#define IDirectInputEffectDriver_SetGain(p,a,b) (p)->SetGain(a,b)
#define IDirectInputEffectDriver_SendForceFeedbackCommand(p,a,b) (p)->SendForceFeedbackCommand(a,b)
#define IDirectInputEffectDriver_GetForceFeedbackState(p,a,b) (p)->GetForceFeedbackState(a,b)
#define IDirectInputEffectDriver_DownloadEffect(p,a,b,c,d,e) (p)->DownloadEffect(a,b,c,d,e)
#define IDirectInputEffectDriver_DestroyEffect(p,a,b) (p)->DestroyEffect(a,b)
#define IDirectInputEffectDriver_StartEffect(p,a,b,c,d) (p)->StartEffect(a,b,c,d)
#define IDirectInputEffectDriver_StopEffect(p,a,b) (p)->StopEffect(a,b)
#define IDirectInputEffectDriver_GetEffectStatus(p,a,b,c) (p)->GetEffectStatus(a,b,c)
#endif
#endif /* DIJ_RINGZERO */
/****************************************************************************
*
* IDirectInputJoyConfig
*
****************************************************************************/
/****************************************************************************
*
* Definitions copied from the DDK
*
****************************************************************************/
#ifndef JOY_HW_NONE
/* pre-defined joystick types */
#define JOY_HW_NONE 0
#define JOY_HW_CUSTOM 1
#define JOY_HW_2A_2B_GENERIC 2
#define JOY_HW_2A_4B_GENERIC 3
#define JOY_HW_2B_GAMEPAD 4
#define JOY_HW_2B_FLIGHTYOKE 5
#define JOY_HW_2B_FLIGHTYOKETHROTTLE 6
#define JOY_HW_3A_2B_GENERIC 7
#define JOY_HW_3A_4B_GENERIC 8
#define JOY_HW_4B_GAMEPAD 9
#define JOY_HW_4B_FLIGHTYOKE 10
#define JOY_HW_4B_FLIGHTYOKETHROTTLE 11
#define JOY_HW_TWO_2A_2B_WITH_Y 12
#define JOY_HW_LASTENTRY 13
/* calibration flags */
#define JOY_ISCAL_XY 0x00000001l /* XY are calibrated */
#define JOY_ISCAL_Z 0x00000002l /* Z is calibrated */
#define JOY_ISCAL_R 0x00000004l /* R is calibrated */
#define JOY_ISCAL_U 0x00000008l /* U is calibrated */
#define JOY_ISCAL_V 0x00000010l /* V is calibrated */
#define JOY_ISCAL_POV 0x00000020l /* POV is calibrated */
/* point of view constants */
#define JOY_POV_NUMDIRS 4
#define JOY_POVVAL_FORWARD 0
#define JOY_POVVAL_BACKWARD 1
#define JOY_POVVAL_LEFT 2
#define JOY_POVVAL_RIGHT 3
/* Specific settings for joystick hardware */
#define JOY_HWS_HASZ 0x00000001l /* has Z info? */
#define JOY_HWS_HASPOV 0x00000002l /* point of view hat present */
#define JOY_HWS_POVISBUTTONCOMBOS 0x00000004l /* pov done through combo of buttons */
#define JOY_HWS_POVISPOLL 0x00000008l /* pov done through polling */
#define JOY_HWS_ISYOKE 0x00000010l /* joystick is a flight yoke */
#define JOY_HWS_ISGAMEPAD 0x00000020l /* joystick is a game pad */
#define JOY_HWS_ISCARCTRL 0x00000040l /* joystick is a car controller */
/* X defaults to J1 X axis */
#define JOY_HWS_XISJ1Y 0x00000080l /* X is on J1 Y axis */
#define JOY_HWS_XISJ2X 0x00000100l /* X is on J2 X axis */
#define JOY_HWS_XISJ2Y 0x00000200l /* X is on J2 Y axis */
/* Y defaults to J1 Y axis */
#define JOY_HWS_YISJ1X 0x00000400l /* Y is on J1 X axis */
#define JOY_HWS_YISJ2X 0x00000800l /* Y is on J2 X axis */
#define JOY_HWS_YISJ2Y 0x00001000l /* Y is on J2 Y axis */
/* Z defaults to J2 Y axis */
#define JOY_HWS_ZISJ1X 0x00002000l /* Z is on J1 X axis */
#define JOY_HWS_ZISJ1Y 0x00004000l /* Z is on J1 Y axis */
#define JOY_HWS_ZISJ2X 0x00008000l /* Z is on J2 X axis */
/* POV defaults to J2 Y axis, if it is not button based */
#define JOY_HWS_POVISJ1X 0x00010000l /* pov done through J1 X axis */
#define JOY_HWS_POVISJ1Y 0x00020000l /* pov done through J1 Y axis */
#define JOY_HWS_POVISJ2X 0x00040000l /* pov done through J2 X axis */
/* R defaults to J2 X axis */
#define JOY_HWS_HASR 0x00080000l /* has R (4th axis) info */
#define JOY_HWS_RISJ1X 0x00100000l /* R done through J1 X axis */
#define JOY_HWS_RISJ1Y 0x00200000l /* R done through J1 Y axis */
#define JOY_HWS_RISJ2Y 0x00400000l /* R done through J2 X axis */
/* U & V for future hardware */
#define JOY_HWS_HASU 0x00800000l /* has U (5th axis) info */
#define JOY_HWS_HASV 0x01000000l /* has V (6th axis) info */
/* Usage settings */
#define JOY_US_HASRUDDER 0x00000001l /* joystick configured with rudder */
#define JOY_US_PRESENT 0x00000002l /* is joystick actually present? */
#define JOY_US_ISOEM 0x00000004l /* joystick is an OEM defined type */
/* reserved for future use -> as link to next possible dword */
#define JOY_US_RESERVED 0x80000000l /* reserved */
/* Settings for TypeInfo Flags1 */
#define JOYTYPE_ZEROGAMEENUMOEMDATA 0x00000001l /* Zero GameEnum's OEM data field */
#define JOYTYPE_NOAUTODETECTGAMEPORT 0x00000002l /* Device does not support Autodetect gameport*/
#define JOYTYPE_NOHIDDIRECT 0x00000004l /* Do not use HID directly for this device */
#define JOYTYPE_ANALOGCOMPAT 0x00000008l /* Expose the analog compatible ID */
#define JOYTYPE_DEFAULTPROPSHEET 0x80000000l /* CPL overrides custom property sheet */
/* Settings for TypeInfo Flags2 */
#define JOYTYPE_DEVICEHIDE 0x00010000l /* Hide unclassified devices */
#define JOYTYPE_MOUSEHIDE 0x00020000l /* Hide mice */
#define JOYTYPE_KEYBHIDE 0x00040000l /* Hide keyboards */
#define JOYTYPE_GAMEHIDE 0x00080000l /* Hide game controllers */
#define JOYTYPE_HIDEACTIVE 0x00100000l /* Hide flags are active */
#define JOYTYPE_INFOMASK 0x00E00000l /* Mask for type specific info */
#define JOYTYPE_INFODEFAULT 0x00000000l /* Use default axis mappings */
#define JOYTYPE_INFOYYPEDALS 0x00200000l /* Use Y as a combined pedals axis */
#define JOYTYPE_INFOZYPEDALS 0x00400000l /* Use Z for accelerate, Y for brake */
#define JOYTYPE_INFOYRPEDALS 0x00600000l /* Use Y for accelerate, R for brake */
#define JOYTYPE_INFOZRPEDALS 0x00800000l /* Use Z for accelerate, R for brake */
#define JOYTYPE_INFOZISSLIDER 0x00200000l /* Use Z as a slider */
#define JOYTYPE_INFOZISZ 0x00400000l /* Use Z as Z axis */
#define JOYTYPE_ENABLEINPUTREPORT 0x01000000l /* Enable initial input reports */
/* struct for storing x,y, z, and rudder values */
typedef struct joypos_tag {
DWORD dwX;
DWORD dwY;
DWORD dwZ;
DWORD dwR;
DWORD dwU;
DWORD dwV;
} JOYPOS, FAR *LPJOYPOS;
/* struct for storing ranges */
typedef struct joyrange_tag {
JOYPOS jpMin;
JOYPOS jpMax;
JOYPOS jpCenter;
} JOYRANGE,FAR *LPJOYRANGE;
/*
* dwTimeout - value at which to timeout joystick polling
* jrvRanges - range of values app wants returned for axes
* jpDeadZone - area around center to be considered
* as "dead". specified as a percentage
* (0-100). Only X & Y handled by system driver
*/
typedef struct joyreguservalues_tag {
DWORD dwTimeOut;
JOYRANGE jrvRanges;
JOYPOS jpDeadZone;
} JOYREGUSERVALUES, FAR *LPJOYREGUSERVALUES;
typedef struct joyreghwsettings_tag {
DWORD dwFlags;
DWORD dwNumButtons;
} JOYREGHWSETTINGS, FAR *LPJOYHWSETTINGS;
/* range of values returned by the hardware (filled in by calibration) */
/*
* jrvHardware - values returned by hardware
* dwPOVValues - POV values returned by hardware
* dwCalFlags - what has been calibrated
*/
typedef struct joyreghwvalues_tag {
JOYRANGE jrvHardware;
DWORD dwPOVValues[JOY_POV_NUMDIRS];
DWORD dwCalFlags;
} JOYREGHWVALUES, FAR *LPJOYREGHWVALUES;
/* hardware configuration */
/*
* hws - hardware settings
* dwUsageSettings - usage settings
* hwv - values returned by hardware
* dwType - type of joystick
* dwReserved - reserved for OEM drivers
*/
typedef struct joyreghwconfig_tag {
JOYREGHWSETTINGS hws;
DWORD dwUsageSettings;
JOYREGHWVALUES hwv;
DWORD dwType;
DWORD dwReserved;
} JOYREGHWCONFIG, FAR *LPJOYREGHWCONFIG;
/* joystick calibration info structure */
typedef struct joycalibrate_tag {
UINT wXbase;
UINT wXdelta;
UINT wYbase;
UINT wYdelta;
UINT wZbase;
UINT wZdelta;
} JOYCALIBRATE;
typedef JOYCALIBRATE FAR *LPJOYCALIBRATE;
#endif
#ifndef DIJ_RINGZERO
#define MAX_JOYSTRING 256
typedef BOOL (FAR PASCAL * LPDIJOYTYPECALLBACK)(LPCWSTR, LPVOID);
#ifndef MAX_JOYSTICKOEMVXDNAME
#define MAX_JOYSTICKOEMVXDNAME 260
#endif
#define DITC_REGHWSETTINGS 0x00000001
#define DITC_CLSIDCONFIG 0x00000002
#define DITC_DISPLAYNAME 0x00000004
#define DITC_CALLOUT 0x00000008
#define DITC_HARDWAREID 0x00000010
#define DITC_FLAGS1 0x00000020
#define DITC_FLAGS2 0x00000040
#define DITC_MAPFILE 0x00000080
/* This structure is defined for DirectX 5.0 compatibility */
typedef struct DIJOYTYPEINFO_DX5 {
DWORD dwSize;
JOYREGHWSETTINGS hws;
CLSID clsidConfig;
WCHAR wszDisplayName[MAX_JOYSTRING];
WCHAR wszCallout[MAX_JOYSTICKOEMVXDNAME];
} DIJOYTYPEINFO_DX5, *LPDIJOYTYPEINFO_DX5;
typedef const DIJOYTYPEINFO_DX5 *LPCDIJOYTYPEINFO_DX5;
/* This structure is defined for DirectX 6.1 compatibility */
typedef struct DIJOYTYPEINFO_DX6 {
DWORD dwSize;
JOYREGHWSETTINGS hws;
CLSID clsidConfig;
WCHAR wszDisplayName[MAX_JOYSTRING];
WCHAR wszCallout[MAX_JOYSTICKOEMVXDNAME];
WCHAR wszHardwareId[MAX_JOYSTRING];
DWORD dwFlags1;
} DIJOYTYPEINFO_DX6, *LPDIJOYTYPEINFO_DX6;
typedef const DIJOYTYPEINFO_DX6 *LPCDIJOYTYPEINFO_DX6;
typedef struct DIJOYTYPEINFO {
DWORD dwSize;
JOYREGHWSETTINGS hws;
CLSID clsidConfig;
WCHAR wszDisplayName[MAX_JOYSTRING];
WCHAR wszCallout[MAX_JOYSTICKOEMVXDNAME];
#if(DIRECTINPUT_VERSION >= 0x05b2)
WCHAR wszHardwareId[MAX_JOYSTRING];
DWORD dwFlags1;
#if(DIRECTINPUT_VERSION >= 0x0800)
DWORD dwFlags2;
WCHAR wszMapFile[MAX_JOYSTRING];
#endif /* DIRECTINPUT_VERSION >= 0x0800 */
#endif /* DIRECTINPUT_VERSION >= 0x05b2 */
} DIJOYTYPEINFO, *LPDIJOYTYPEINFO;
typedef const DIJOYTYPEINFO *LPCDIJOYTYPEINFO;
#define DIJC_GUIDINSTANCE 0x00000001
#define DIJC_REGHWCONFIGTYPE 0x00000002
#define DIJC_GAIN 0x00000004
#define DIJC_CALLOUT 0x00000008
#define DIJC_WDMGAMEPORT 0x00000010
/* This structure is defined for DirectX 5.0 compatibility */
typedef struct DIJOYCONFIG_DX5 {
DWORD dwSize;
GUID guidInstance;
JOYREGHWCONFIG hwc;
DWORD dwGain;
WCHAR wszType[MAX_JOYSTRING];
WCHAR wszCallout[MAX_JOYSTRING];
} DIJOYCONFIG_DX5, *LPDIJOYCONFIG_DX5;
typedef const DIJOYCONFIG_DX5 *LPCDIJOYCONFIG_DX5;
typedef struct DIJOYCONFIG {
DWORD dwSize;
GUID guidInstance;
JOYREGHWCONFIG hwc;
DWORD dwGain;
WCHAR wszType[MAX_JOYSTRING];
WCHAR wszCallout[MAX_JOYSTRING];
#if(DIRECTINPUT_VERSION >= 0x05b2)
GUID guidGameport;
#endif /* DIRECTINPUT_VERSION >= 0x05b2 */
} DIJOYCONFIG, *LPDIJOYCONFIG;
typedef const DIJOYCONFIG *LPCDIJOYCONFIG;
#define DIJU_USERVALUES 0x00000001
#define DIJU_GLOBALDRIVER 0x00000002
#define DIJU_GAMEPORTEMULATOR 0x00000004
typedef struct DIJOYUSERVALUES {
DWORD dwSize;
JOYREGUSERVALUES ruv;
WCHAR wszGlobalDriver[MAX_JOYSTRING];
WCHAR wszGameportEmulator[MAX_JOYSTRING];
} DIJOYUSERVALUES, *LPDIJOYUSERVALUES;
typedef const DIJOYUSERVALUES *LPCDIJOYUSERVALUES;
DEFINE_GUID(GUID_KeyboardClass, 0x4D36E96B,0xE325,0x11CE,0xBF,0xC1,0x08,0x00,0x2B,0xE1,0x03,0x18);
DEFINE_GUID(GUID_MediaClass, 0x4D36E96C,0xE325,0x11CE,0xBF,0xC1,0x08,0x00,0x2B,0xE1,0x03,0x18);
DEFINE_GUID(GUID_MouseClass, 0x4D36E96F,0xE325,0x11CE,0xBF,0xC1,0x08,0x00,0x2B,0xE1,0x03,0x18);
DEFINE_GUID(GUID_HIDClass, 0x745A17A0,0x74D3,0x11D0,0xB6,0xFE,0x00,0xA0,0xC9,0x0F,0x57,0xDA);
#undef INTERFACE
#define INTERFACE IDirectInputJoyConfig
DECLARE_INTERFACE_(IDirectInputJoyConfig, IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IDirectInputJoyConfig methods ***/
STDMETHOD(Acquire)(THIS) PURE;
STDMETHOD(Unacquire)(THIS) PURE;
STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE;
STDMETHOD(SendNotify)(THIS) PURE;
STDMETHOD(EnumTypes)(THIS_ LPDIJOYTYPECALLBACK,LPVOID) PURE;
STDMETHOD(GetTypeInfo)(THIS_ LPCWSTR,LPDIJOYTYPEINFO,DWORD) PURE;
STDMETHOD(SetTypeInfo)(THIS_ LPCWSTR,LPCDIJOYTYPEINFO,DWORD) PURE;
STDMETHOD(DeleteType)(THIS_ LPCWSTR) PURE;
STDMETHOD(GetConfig)(THIS_ UINT,LPDIJOYCONFIG,DWORD) PURE;
STDMETHOD(SetConfig)(THIS_ UINT,LPCDIJOYCONFIG,DWORD) PURE;
STDMETHOD(DeleteConfig)(THIS_ UINT) PURE;
STDMETHOD(GetUserValues)(THIS_ LPDIJOYUSERVALUES,DWORD) PURE;
STDMETHOD(SetUserValues)(THIS_ LPCDIJOYUSERVALUES,DWORD) PURE;
STDMETHOD(AddNewHardware)(THIS_ HWND,REFGUID) PURE;
STDMETHOD(OpenTypeKey)(THIS_ LPCWSTR,DWORD,PHKEY) PURE;
STDMETHOD(OpenConfigKey)(THIS_ UINT,DWORD,PHKEY) PURE;
};
typedef struct IDirectInputJoyConfig *LPDIRECTINPUTJOYCONFIG;
#if !defined(__cplusplus) || defined(CINTERFACE)
#define IDirectInputJoyConfig_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectInputJoyConfig_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirectInputJoyConfig_Release(p) (p)->lpVtbl->Release(p)
#define IDirectInputJoyConfig_Acquire(p) (p)->lpVtbl->Acquire(p)
#define IDirectInputJoyConfig_Unacquire(p) (p)->lpVtbl->Unacquire(p)
#define IDirectInputJoyConfig_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
#define IDirectInputJoyConfig_SendNotify(p) (p)->lpVtbl->SendNotify(p)
#define IDirectInputJoyConfig_EnumTypes(p,a,b) (p)->lpVtbl->EnumTypes(p,a,b)
#define IDirectInputJoyConfig_GetTypeInfo(p,a,b,c) (p)->lpVtbl->GetTypeInfo(p,a,b,c)
#define IDirectInputJoyConfig_SetTypeInfo(p,a,b,c) (p)->lpVtbl->SetTypeInfo(p,a,b,c)
#define IDirectInputJoyConfig_DeleteType(p,a) (p)->lpVtbl->DeleteType(p,a)
#define IDirectInputJoyConfig_GetConfig(p,a,b,c) (p)->lpVtbl->GetConfig(p,a,b,c)
#define IDirectInputJoyConfig_SetConfig(p,a,b,c) (p)->lpVtbl->SetConfig(p,a,b,c)
#define IDirectInputJoyConfig_DeleteConfig(p,a) (p)->lpVtbl->DeleteConfig(p,a)
#define IDirectInputJoyConfig_GetUserValues(p,a,b) (p)->lpVtbl->GetUserValues(p,a,b)
#define IDirectInputJoyConfig_SetUserValues(p,a,b) (p)->lpVtbl->SetUserValues(p,a,b)
#define IDirectInputJoyConfig_AddNewHardware(p,a,b) (p)->lpVtbl->AddNewHardware(p,a,b)
#define IDirectInputJoyConfig_OpenTypeKey(p,a,b,c) (p)->lpVtbl->OpenTypeKey(p,a,b,c)
#define IDirectInputJoyConfig_OpenConfigKey(p,a,b,c) (p)->lpVtbl->OpenConfigKey(p,a,b,c)
#else
#define IDirectInputJoyConfig_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirectInputJoyConfig_AddRef(p) (p)->AddRef()
#define IDirectInputJoyConfig_Release(p) (p)->Release()
#define IDirectInputJoyConfig_Acquire(p) (p)->Acquire()
#define IDirectInputJoyConfig_Unacquire(p) (p)->Unacquire()
#define IDirectInputJoyConfig_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
#define IDirectInputJoyConfig_SendNotify(p) (p)->SendNotify()
#define IDirectInputJoyConfig_EnumTypes(p,a,b) (p)->EnumTypes(a,b)
#define IDirectInputJoyConfig_GetTypeInfo(p,a,b,c) (p)->GetTypeInfo(a,b,c)
#define IDirectInputJoyConfig_SetTypeInfo(p,a,b,c) (p)->SetTypeInfo(a,b,c)
#define IDirectInputJoyConfig_DeleteType(p,a) (p)->DeleteType(a)
#define IDirectInputJoyConfig_GetConfig(p,a,b,c) (p)->GetConfig(a,b,c)
#define IDirectInputJoyConfig_SetConfig(p,a,b,c) (p)->SetConfig(a,b,c)
#define IDirectInputJoyConfig_DeleteConfig(p,a) (p)->DeleteConfig(a)
#define IDirectInputJoyConfig_GetUserValues(p,a,b) (p)->GetUserValues(a,b)
#define IDirectInputJoyConfig_SetUserValues(p,a,b) (p)->SetUserValues(a,b)
#define IDirectInputJoyConfig_AddNewHardware(p,a,b) (p)->AddNewHardware(a,b)
#define IDirectInputJoyConfig_OpenTypeKey(p,a,b,c) (p)->OpenTypeKey(a,b,c)
#define IDirectInputJoyConfig_OpenConfigKey(p,a,b,c) (p)->OpenConfigKey(a,b,c)
#endif
#endif /* DIJ_RINGZERO */
#if(DIRECTINPUT_VERSION >= 0x0800)
#ifndef DIJ_RINGZERO
#undef INTERFACE
#define INTERFACE IDirectInputJoyConfig8
DECLARE_INTERFACE_(IDirectInputJoyConfig8, IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IDirectInputJoyConfig8 methods ***/
STDMETHOD(Acquire)(THIS) PURE;
STDMETHOD(Unacquire)(THIS) PURE;
STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE;
STDMETHOD(SendNotify)(THIS) PURE;
STDMETHOD(EnumTypes)(THIS_ LPDIJOYTYPECALLBACK,LPVOID) PURE;
STDMETHOD(GetTypeInfo)(THIS_ LPCWSTR,LPDIJOYTYPEINFO,DWORD) PURE;
STDMETHOD(SetTypeInfo)(THIS_ LPCWSTR,LPCDIJOYTYPEINFO,DWORD,LPWSTR) PURE;
STDMETHOD(DeleteType)(THIS_ LPCWSTR) PURE;
STDMETHOD(GetConfig)(THIS_ UINT,LPDIJOYCONFIG,DWORD) PURE;
STDMETHOD(SetConfig)(THIS_ UINT,LPCDIJOYCONFIG,DWORD) PURE;
STDMETHOD(DeleteConfig)(THIS_ UINT) PURE;
STDMETHOD(GetUserValues)(THIS_ LPDIJOYUSERVALUES,DWORD) PURE;
STDMETHOD(SetUserValues)(THIS_ LPCDIJOYUSERVALUES,DWORD) PURE;
STDMETHOD(AddNewHardware)(THIS_ HWND,REFGUID) PURE;
STDMETHOD(OpenTypeKey)(THIS_ LPCWSTR,DWORD,PHKEY) PURE;
STDMETHOD(OpenAppStatusKey)(THIS_ PHKEY) PURE;
};
typedef struct IDirectInputJoyConfig8 *LPDIRECTINPUTJOYCONFIG8;
#if !defined(__cplusplus) || defined(CINTERFACE)
#define IDirectInputJoyConfig8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectInputJoyConfig8_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirectInputJoyConfig8_Release(p) (p)->lpVtbl->Release(p)
#define IDirectInputJoyConfig8_Acquire(p) (p)->lpVtbl->Acquire(p)
#define IDirectInputJoyConfig8_Unacquire(p) (p)->lpVtbl->Unacquire(p)
#define IDirectInputJoyConfig8_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
#define IDirectInputJoyConfig8_SendNotify(p) (p)->lpVtbl->SendNotify(p)
#define IDirectInputJoyConfig8_EnumTypes(p,a,b) (p)->lpVtbl->EnumTypes(p,a,b)
#define IDirectInputJoyConfig8_GetTypeInfo(p,a,b,c) (p)->lpVtbl->GetTypeInfo(p,a,b,c)
#define IDirectInputJoyConfig8_SetTypeInfo(p,a,b,c,d) (p)->lpVtbl->SetTypeInfo(p,a,b,c,d)
#define IDirectInputJoyConfig8_DeleteType(p,a) (p)->lpVtbl->DeleteType(p,a)
#define IDirectInputJoyConfig8_GetConfig(p,a,b,c) (p)->lpVtbl->GetConfig(p,a,b,c)
#define IDirectInputJoyConfig8_SetConfig(p,a,b,c) (p)->lpVtbl->SetConfig(p,a,b,c)
#define IDirectInputJoyConfig8_DeleteConfig(p,a) (p)->lpVtbl->DeleteConfig(p,a)
#define IDirectInputJoyConfig8_GetUserValues(p,a,b) (p)->lpVtbl->GetUserValues(p,a,b)
#define IDirectInputJoyConfig8_SetUserValues(p,a,b) (p)->lpVtbl->SetUserValues(p,a,b)
#define IDirectInputJoyConfig8_AddNewHardware(p,a,b) (p)->lpVtbl->AddNewHardware(p,a,b)
#define IDirectInputJoyConfig8_OpenTypeKey(p,a,b,c) (p)->lpVtbl->OpenTypeKey(p,a,b,c)
#define IDirectInputJoyConfig8_OpenAppStatusKey(p,a) (p)->lpVtbl->OpenAppStatusKey(p,a)
#else
#define IDirectInputJoyConfig8_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirectInputJoyConfig8_AddRef(p) (p)->AddRef()
#define IDirectInputJoyConfig8_Release(p) (p)->Release()
#define IDirectInputJoyConfig8_Acquire(p) (p)->Acquire()
#define IDirectInputJoyConfig8_Unacquire(p) (p)->Unacquire()
#define IDirectInputJoyConfig8_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
#define IDirectInputJoyConfig8_SendNotify(p) (p)->SendNotify()
#define IDirectInputJoyConfig8_EnumTypes(p,a,b) (p)->EnumTypes(a,b)
#define IDirectInputJoyConfig8_GetTypeInfo(p,a,b,c) (p)->GetTypeInfo(a,b,c)
#define IDirectInputJoyConfig8_SetTypeInfo(p,a,b,c,d) (p)->SetTypeInfo(a,b,c,d)
#define IDirectInputJoyConfig8_DeleteType(p,a) (p)->DeleteType(a)
#define IDirectInputJoyConfig8_GetConfig(p,a,b,c) (p)->GetConfig(a,b,c)
#define IDirectInputJoyConfig8_SetConfig(p,a,b,c) (p)->SetConfig(a,b,c)
#define IDirectInputJoyConfig8_DeleteConfig(p,a) (p)->DeleteConfig(a)
#define IDirectInputJoyConfig8_GetUserValues(p,a,b) (p)->GetUserValues(a,b)
#define IDirectInputJoyConfig8_SetUserValues(p,a,b) (p)->SetUserValues(a,b)
#define IDirectInputJoyConfig8_AddNewHardware(p,a,b) (p)->AddNewHardware(a,b)
#define IDirectInputJoyConfig8_OpenTypeKey(p,a,b,c) (p)->OpenTypeKey(a,b,c)
#define IDirectInputJoyConfig8_OpenAppStatusKey(p,a) (p)->OpenAppStatusKey(a)
#endif
#endif /* DIJ_RINGZERO */
/****************************************************************************
*
* Notification Messages
*
****************************************************************************/
/* RegisterWindowMessage with this to get DirectInput notification messages */
#define DIRECTINPUT_NOTIFICATION_MSGSTRINGA "DIRECTINPUT_NOTIFICATION_MSGSTRING"
#define DIRECTINPUT_NOTIFICATION_MSGSTRINGW L"DIRECTINPUT_NOTIFICATION_MSGSTRING"
#ifdef UNICODE
#define DIRECTINPUT_NOTIFICATION_MSGSTRING DIRECTINPUT_NOTIFICATION_MSGSTRINGW
#else
#define DIRECTINPUT_NOTIFICATION_MSGSTRING DIRECTINPUT_NOTIFICATION_MSGSTRINGA
#endif
#define DIMSGWP_NEWAPPSTART 0x00000001
#define DIMSGWP_DX8APPSTART 0x00000002
#define DIMSGWP_DX8MAPPERAPPSTART 0x00000003
#endif /* DIRECTINPUT_VERSION >= 0x0800 */
#define DIAPPIDFLAG_NOTIME 0x00000001
#define DIAPPIDFLAG_NOSIZE 0x00000002
#define DIRECTINPUT_REGSTR_VAL_APPIDFLAGA "AppIdFlag"
#define DIRECTINPUT_REGSTR_KEY_LASTAPPA "MostRecentApplication"
#define DIRECTINPUT_REGSTR_KEY_LASTMAPAPPA "MostRecentMapperApplication"
#define DIRECTINPUT_REGSTR_VAL_VERSIONA "Version"
#define DIRECTINPUT_REGSTR_VAL_NAMEA "Name"
#define DIRECTINPUT_REGSTR_VAL_IDA "Id"
#define DIRECTINPUT_REGSTR_VAL_MAPPERA "UsesMapper"
#define DIRECTINPUT_REGSTR_VAL_LASTSTARTA "MostRecentStart"
#define DIRECTINPUT_REGSTR_VAL_APPIDFLAGW L"AppIdFlag"
#define DIRECTINPUT_REGSTR_KEY_LASTAPPW L"MostRecentApplication"
#define DIRECTINPUT_REGSTR_KEY_LASTMAPAPPW L"MostRecentMapperApplication"
#define DIRECTINPUT_REGSTR_VAL_VERSIONW L"Version"
#define DIRECTINPUT_REGSTR_VAL_NAMEW L"Name"
#define DIRECTINPUT_REGSTR_VAL_IDW L"Id"
#define DIRECTINPUT_REGSTR_VAL_MAPPERW L"UsesMapper"
#define DIRECTINPUT_REGSTR_VAL_LASTSTARTW L"MostRecentStart"
#ifdef UNICODE
#define DIRECTINPUT_REGSTR_VAL_APPIDFLAG DIRECTINPUT_REGSTR_VAL_APPIDFLAGW
#define DIRECTINPUT_REGSTR_KEY_LASTAPP DIRECTINPUT_REGSTR_KEY_LASTAPPW
#define DIRECTINPUT_REGSTR_KEY_LASTMAPAPP DIRECTINPUT_REGSTR_KEY_LASTMAPAPPW
#define DIRECTINPUT_REGSTR_VAL_VERSION DIRECTINPUT_REGSTR_VAL_VERSIONW
#define DIRECTINPUT_REGSTR_VAL_NAME DIRECTINPUT_REGSTR_VAL_NAMEW
#define DIRECTINPUT_REGSTR_VAL_ID DIRECTINPUT_REGSTR_VAL_IDW
#define DIRECTINPUT_REGSTR_VAL_MAPPER DIRECTINPUT_REGSTR_VAL_MAPPERW
#define DIRECTINPUT_REGSTR_VAL_LASTSTART DIRECTINPUT_REGSTR_VAL_LASTSTARTW
#else
#define DIRECTINPUT_REGSTR_VAL_APPIDFLAG DIRECTINPUT_REGSTR_VAL_APPIDFLAGA
#define DIRECTINPUT_REGSTR_KEY_LASTAPP DIRECTINPUT_REGSTR_KEY_LASTAPPA
#define DIRECTINPUT_REGSTR_KEY_LASTMAPAPP DIRECTINPUT_REGSTR_KEY_LASTMAPAPPA
#define DIRECTINPUT_REGSTR_VAL_VERSION DIRECTINPUT_REGSTR_VAL_VERSIONA
#define DIRECTINPUT_REGSTR_VAL_NAME DIRECTINPUT_REGSTR_VAL_NAMEA
#define DIRECTINPUT_REGSTR_VAL_ID DIRECTINPUT_REGSTR_VAL_IDA
#define DIRECTINPUT_REGSTR_VAL_MAPPER DIRECTINPUT_REGSTR_VAL_MAPPERA
#define DIRECTINPUT_REGSTR_VAL_LASTSTART DIRECTINPUT_REGSTR_VAL_LASTSTARTA
#endif
/****************************************************************************
*
* Return Codes
*
****************************************************************************/
#define DIERR_NOMOREITEMS \
MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NO_MORE_ITEMS)
/*
* Device driver-specific codes.
*/
#define DIERR_DRIVERFIRST 0x80040300L
#define DIERR_DRIVERLAST 0x800403FFL
/*
* Unless the specific driver has been precisely identified, no meaning
* should be attributed to these values other than that the driver
* originated the error. However, to illustrate the types of error that
* may be causing the failure, the PID force feedback driver distributed
* with DirectX 7 could return the following errors:
*
* DIERR_DRIVERFIRST + 1
* The requested usage was not found.
* DIERR_DRIVERFIRST + 2
* The parameter block couldn't be downloaded to the device.
* DIERR_DRIVERFIRST + 3
* PID initialization failed.
* DIERR_DRIVERFIRST + 4
* The provided values couldn't be scaled.
*/
/*
* Device installer errors.
*/
/*
* Registry entry or DLL for class installer invalid
* or class installer not found.
*/
#define DIERR_INVALIDCLASSINSTALLER 0x80040400L
/*
* The user cancelled the install operation.
*/
#define DIERR_CANCELLED 0x80040401L
/*
* The INF file for the selected device could not be
* found or is invalid or is damaged.
*/
#define DIERR_BADINF 0x80040402L
/****************************************************************************
*
* Map files
*
****************************************************************************/
/*
* Delete particular data from default map file.
*/
#define DIDIFT_DELETE 0x01000000
#ifdef __cplusplus
};
#endif
#endif /* __DINPUTD_INCLUDED__ */

View File

@ -0,0 +1,267 @@
/*==========================================================================;
//
// dls1.h
//
//
// Description:
//
// Interface defines and structures for the Instrument Collection Form
// RIFF DLS.
//
//
// Written by Sonic Foundry 1996. Released for public use.
//
//=========================================================================*/
#ifndef _INC_DLS1
#define _INC_DLS1
/*//////////////////////////////////////////////////////////////////////////
//
//
// Layout of an instrument collection:
//
//
// RIFF [] 'DLS ' [dlid,colh,INSTLIST,WAVEPOOL,INFOLIST]
//
// INSTLIST
// LIST [] 'lins'
// LIST [] 'ins ' [dlid,insh,RGNLIST,ARTLIST,INFOLIST]
// LIST [] 'ins ' [dlid,insh,RGNLIST,ARTLIST,INFOLIST]
// LIST [] 'ins ' [dlid,insh,RGNLIST,ARTLIST,INFOLIST]
//
// RGNLIST
// LIST [] 'lrgn'
// LIST [] 'rgn ' [rgnh,wsmp,wlnk,ARTLIST]
// LIST [] 'rgn ' [rgnh,wsmp,wlnk,ARTLIST]
// LIST [] 'rgn ' [rgnh,wsmp,wlnk,ARTLIST]
//
// ARTLIST
// LIST [] 'lart'
// 'art1' level 1 Articulation connection graph
// 'art2' level 2 Articulation connection graph
// '3rd1' Possible 3rd party articulation structure 1
// '3rd2' Possible 3rd party articulation structure 2 .... and so on
//
// WAVEPOOL
// ptbl [] [pool table]
// LIST [] 'wvpl'
// [path],
// [path],
// LIST [] 'wave' [dlid,RIFFWAVE]
// LIST [] 'wave' [dlid,RIFFWAVE]
// LIST [] 'wave' [dlid,RIFFWAVE]
// LIST [] 'wave' [dlid,RIFFWAVE]
// LIST [] 'wave' [dlid,RIFFWAVE]
//
// INFOLIST
// LIST [] 'INFO'
// 'icmt' 'One of those crazy comments.'
// 'icop' 'Copyright (C) 1996 Sonic Foundry'
//
/////////////////////////////////////////////////////////////////////////*/
/*/////////////////////////////////////////////////////////////////////////
// FOURCC's used in the DLS file
/////////////////////////////////////////////////////////////////////////*/
#define FOURCC_DLS mmioFOURCC('D','L','S',' ')
#define FOURCC_DLID mmioFOURCC('d','l','i','d')
#define FOURCC_COLH mmioFOURCC('c','o','l','h')
#define FOURCC_WVPL mmioFOURCC('w','v','p','l')
#define FOURCC_PTBL mmioFOURCC('p','t','b','l')
#define FOURCC_PATH mmioFOURCC('p','a','t','h')
#define FOURCC_wave mmioFOURCC('w','a','v','e')
#define FOURCC_LINS mmioFOURCC('l','i','n','s')
#define FOURCC_INS mmioFOURCC('i','n','s',' ')
#define FOURCC_INSH mmioFOURCC('i','n','s','h')
#define FOURCC_LRGN mmioFOURCC('l','r','g','n')
#define FOURCC_RGN mmioFOURCC('r','g','n',' ')
#define FOURCC_RGNH mmioFOURCC('r','g','n','h')
#define FOURCC_LART mmioFOURCC('l','a','r','t')
#define FOURCC_ART1 mmioFOURCC('a','r','t','1')
#define FOURCC_WLNK mmioFOURCC('w','l','n','k')
#define FOURCC_WSMP mmioFOURCC('w','s','m','p')
#define FOURCC_VERS mmioFOURCC('v','e','r','s')
/*/////////////////////////////////////////////////////////////////////////
// Articulation connection graph definitions
/////////////////////////////////////////////////////////////////////////*/
/* Generic Sources */
#define CONN_SRC_NONE 0x0000
#define CONN_SRC_LFO 0x0001
#define CONN_SRC_KEYONVELOCITY 0x0002
#define CONN_SRC_KEYNUMBER 0x0003
#define CONN_SRC_EG1 0x0004
#define CONN_SRC_EG2 0x0005
#define CONN_SRC_PITCHWHEEL 0x0006
/* Midi Controllers 0-127 */
#define CONN_SRC_CC1 0x0081
#define CONN_SRC_CC7 0x0087
#define CONN_SRC_CC10 0x008a
#define CONN_SRC_CC11 0x008b
/* Generic Destinations */
#define CONN_DST_NONE 0x0000
#define CONN_DST_ATTENUATION 0x0001
#define CONN_DST_PITCH 0x0003
#define CONN_DST_PAN 0x0004
/* LFO Destinations */
#define CONN_DST_LFO_FREQUENCY 0x0104
#define CONN_DST_LFO_STARTDELAY 0x0105
/* EG1 Destinations */
#define CONN_DST_EG1_ATTACKTIME 0x0206
#define CONN_DST_EG1_DECAYTIME 0x0207
#define CONN_DST_EG1_RELEASETIME 0x0209
#define CONN_DST_EG1_SUSTAINLEVEL 0x020a
/* EG2 Destinations */
#define CONN_DST_EG2_ATTACKTIME 0x030a
#define CONN_DST_EG2_DECAYTIME 0x030b
#define CONN_DST_EG2_RELEASETIME 0x030d
#define CONN_DST_EG2_SUSTAINLEVEL 0x030e
#define CONN_TRN_NONE 0x0000
#define CONN_TRN_CONCAVE 0x0001
typedef struct _DLSID {
ULONG ulData1;
USHORT usData2;
USHORT usData3;
BYTE abData4[8];
} DLSID, FAR *LPDLSID;
typedef struct _DLSVERSION {
DWORD dwVersionMS;
DWORD dwVersionLS;
}DLSVERSION, FAR *LPDLSVERSION;
typedef struct _CONNECTION {
USHORT usSource;
USHORT usControl;
USHORT usDestination;
USHORT usTransform;
LONG lScale;
}CONNECTION, FAR *LPCONNECTION;
/* Level 1 Articulation Data */
typedef struct _CONNECTIONLIST {
ULONG cbSize; /* size of the connection list structure */
ULONG cConnections; /* count of connections in the list */
} CONNECTIONLIST, FAR *LPCONNECTIONLIST;
/*/////////////////////////////////////////////////////////////////////////
// Generic type defines for regions and instruments
/////////////////////////////////////////////////////////////////////////*/
typedef struct _RGNRANGE {
USHORT usLow;
USHORT usHigh;
}RGNRANGE, FAR * LPRGNRANGE;
#define F_INSTRUMENT_DRUMS 0x80000000
typedef struct _MIDILOCALE {
ULONG ulBank;
ULONG ulInstrument;
}MIDILOCALE, FAR *LPMIDILOCALE;
/*/////////////////////////////////////////////////////////////////////////
// Header structures found in an DLS file for collection, instruments, and
// regions.
/////////////////////////////////////////////////////////////////////////*/
#define F_RGN_OPTION_SELFNONEXCLUSIVE 0x0001
typedef struct _RGNHEADER {
RGNRANGE RangeKey; /* Key range */
RGNRANGE RangeVelocity; /* Velocity Range */
USHORT fusOptions; /* Synthesis options for this range */
USHORT usKeyGroup; /* Key grouping for non simultaneous play */
/* 0 = no group, 1 up is group */
/* for Level 1 only groups 1-15 are allowed */
}RGNHEADER, FAR *LPRGNHEADER;
typedef struct _INSTHEADER {
ULONG cRegions; /* Count of regions in this instrument */
MIDILOCALE Locale; /* Intended MIDI locale of this instrument */
}INSTHEADER, FAR *LPINSTHEADER;
typedef struct _DLSHEADER {
ULONG cInstruments; /* Count of instruments in the collection */
}DLSHEADER, FAR *LPDLSHEADER;
/*////////////////////////////////////////////////////////////////////////////
// definitions for the Wave link structure
////////////////////////////////////////////////////////////////////////////*/
/* **** For level 1 only WAVELINK_CHANNEL_MONO is valid **** */
/* ulChannel allows for up to 32 channels of audio with each bit position */
/* specifiying a channel of playback */
#define WAVELINK_CHANNEL_LEFT 0x0001l
#define WAVELINK_CHANNEL_RIGHT 0x0002l
#define F_WAVELINK_PHASE_MASTER 0x0001
typedef struct _WAVELINK { /* any paths or links are stored right after struct */
USHORT fusOptions; /* options flags for this wave */
USHORT usPhaseGroup; /* Phase grouping for locking channels */
ULONG ulChannel; /* channel placement */
ULONG ulTableIndex; /* index into the wave pool table, 0 based */
}WAVELINK, FAR *LPWAVELINK;
#define POOL_CUE_NULL 0xffffffffl
typedef struct _POOLCUE {
ULONG ulOffset; /* Offset to the entry in the list */
}POOLCUE, FAR *LPPOOLCUE;
typedef struct _POOLTABLE {
ULONG cbSize; /* size of the pool table structure */
ULONG cCues; /* count of cues in the list */
} POOLTABLE, FAR *LPPOOLTABLE;
/*////////////////////////////////////////////////////////////////////////////
// Structures for the "wsmp" chunk
////////////////////////////////////////////////////////////////////////////*/
#define F_WSMP_NO_TRUNCATION 0x0001l
#define F_WSMP_NO_COMPRESSION 0x0002l
typedef struct _rwsmp {
ULONG cbSize;
USHORT usUnityNote; /* MIDI Unity Playback Note */
SHORT sFineTune; /* Fine Tune in log tuning */
LONG lAttenuation; /* Overall Attenuation to be applied to data */
ULONG fulOptions; /* Flag options */
ULONG cSampleLoops; /* Count of Sample loops, 0 loops is one shot */
} WSMPL, FAR *LPWSMPL;
/* This loop type is a normal forward playing loop which is continually */
/* played until the envelope reaches an off threshold in the release */
/* portion of the volume envelope */
#define WLOOP_TYPE_FORWARD 0
typedef struct _rloop {
ULONG cbSize;
ULONG ulType; /* Loop Type */
ULONG ulStart; /* Start of loop in samples */
ULONG ulLength; /* Length of loop in samples */
} WLOOP, FAR *LPWLOOP;
#endif /*_INC_DLS1 */

View File

@ -0,0 +1,130 @@
/*
dls2.h
Description:
Interface defines and structures for the DLS2 extensions of DLS.
Written by Microsoft 1998. Released for public use.
*/
#ifndef _INC_DLS2
#define _INC_DLS2
/*
FOURCC's used in the DLS2 file, in addition to DLS1 chunks
*/
#define FOURCC_RGN2 mmioFOURCC('r','g','n','2')
#define FOURCC_LAR2 mmioFOURCC('l','a','r','2')
#define FOURCC_ART2 mmioFOURCC('a','r','t','2')
#define FOURCC_CDL mmioFOURCC('c','d','l',' ')
#define FOURCC_DLID mmioFOURCC('d','l','i','d')
/*
Articulation connection graph definitions. These are in addition to
the definitions in the DLS1 header.
*/
/* Generic Sources (in addition to DLS1 sources. */
#define CONN_SRC_POLYPRESSURE 0x0007 /* Polyphonic Pressure */
#define CONN_SRC_CHANNELPRESSURE 0x0008 /* Channel Pressure */
#define CONN_SRC_VIBRATO 0x0009 /* Vibrato LFO */
#define CONN_SRC_MONOPRESSURE 0x000a /* MIDI Mono pressure */
/* Midi Controllers */
#define CONN_SRC_CC91 0x00db /* Reverb Send */
#define CONN_SRC_CC93 0x00dd /* Chorus Send */
/* Generic Destinations */
#define CONN_DST_GAIN 0x0001 /* Same as CONN_DST_ ATTENUATION, but more appropriate terminology. */
#define CONN_DST_KEYNUMBER 0x0005 /* Key Number Generator */
/* Audio Channel Output Destinations */
#define CONN_DST_LEFT 0x0010 /* Left Channel Send */
#define CONN_DST_RIGHT 0x0011 /* Right Channel Send */
#define CONN_DST_CENTER 0x0012 /* Center Channel Send */
#define CONN_DST_LEFTREAR 0x0013 /* Left Rear Channel Send */
#define CONN_DST_RIGHTREAR 0x0014 /* Right Rear Channel Send */
#define CONN_DST_LFE_CHANNEL 0x0015 /* LFE Channel Send */
#define CONN_DST_CHORUS 0x0080 /* Chorus Send */
#define CONN_DST_REVERB 0x0081 /* Reverb Send */
/* Vibrato LFO Destinations */
#define CONN_DST_VIB_FREQUENCY 0x0114 /* Vibrato Frequency */
#define CONN_DST_VIB_STARTDELAY 0x0115 /* Vibrato Start Delay */
/* EG1 Destinations */
#define CONN_DST_EG1_DELAYTIME 0x020B /* EG1 Delay Time */
#define CONN_DST_EG1_HOLDTIME 0x020C /* EG1 Hold Time */
#define CONN_DST_EG1_SHUTDOWNTIME 0x020D /* EG1 Shutdown Time */
/* EG2 Destinations */
#define CONN_DST_EG2_DELAYTIME 0x030F /* EG2 Delay Time */
#define CONN_DST_EG2_HOLDTIME 0x0310 /* EG2 Hold Time */
/* Filter Destinations */
#define CONN_DST_FILTER_CUTOFF 0x0500 /* Filter Cutoff Frequency */
#define CONN_DST_FILTER_Q 0x0501 /* Filter Resonance */
/* Transforms */
#define CONN_TRN_CONVEX 0x0002 /* Convex Transform */
#define CONN_TRN_SWITCH 0x0003 /* Switch Transform */
/* Conditional chunk operators */
#define DLS_CDL_AND 0x0001 /* X = X & Y */
#define DLS_CDL_OR 0x0002 /* X = X | Y */
#define DLS_CDL_XOR 0x0003 /* X = X ^ Y */
#define DLS_CDL_ADD 0x0004 /* X = X + Y */
#define DLS_CDL_SUBTRACT 0x0005 /* X = X - Y */
#define DLS_CDL_MULTIPLY 0x0006 /* X = X * Y */
#define DLS_CDL_DIVIDE 0x0007 /* X = X / Y */
#define DLS_CDL_LOGICAL_AND 0x0008 /* X = X && Y */
#define DLS_CDL_LOGICAL_OR 0x0009 /* X = X || Y */
#define DLS_CDL_LT 0x000A /* X = (X < Y) */
#define DLS_CDL_LE 0x000B /* X = (X <= Y) */
#define DLS_CDL_GT 0x000C /* X = (X > Y) */
#define DLS_CDL_GE 0x000D /* X = (X >= Y) */
#define DLS_CDL_EQ 0x000E /* X = (X == Y) */
#define DLS_CDL_NOT 0x000F /* X = !X */
#define DLS_CDL_CONST 0x0010 /* 32-bit constant */
#define DLS_CDL_QUERY 0x0011 /* 32-bit value returned from query */
#define DLS_CDL_QUERYSUPPORTED 0x0012 /* Test to see if query is supported by synth */
/*
Loop and release
*/
#define WLOOP_TYPE_RELEASE 1
/*
WaveLink chunk <wlnk-ck>
*/
#define F_WAVELINK_MULTICHANNEL 0x0002
/*
DLSID queries for <cdl-ck>
*/
DEFINE_GUID(DLSID_GMInHardware, 0x178f2f24, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
DEFINE_GUID(DLSID_GSInHardware, 0x178f2f25, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
DEFINE_GUID(DLSID_XGInHardware, 0x178f2f26, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
DEFINE_GUID(DLSID_SupportsDLS1, 0x178f2f27, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
DEFINE_GUID(DLSID_SupportsDLS2, 0xf14599e5, 0x4689, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
DEFINE_GUID(DLSID_SampleMemorySize, 0x178f2f28, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
DEFINE_GUID(DLSID_ManufacturersID, 0xb03e1181, 0x8095, 0x11d2, 0xa1, 0xef, 0x0, 0x60, 0x8, 0x33, 0xdb, 0xd8);
DEFINE_GUID(DLSID_ProductID, 0xb03e1182, 0x8095, 0x11d2, 0xa1, 0xef, 0x0, 0x60, 0x8, 0x33, 0xdb, 0xd8);
DEFINE_GUID(DLSID_SamplePlaybackRate, 0x2a91f713, 0xa4bf, 0x11d2, 0xbb, 0xdf, 0x0, 0x60, 0x8, 0x33, 0xdb, 0xd8);
#endif /* _INC_DLS2 */

View File

@ -0,0 +1,199 @@
/************************************************************************
* *
* dmdls.h -- DLS download definitions for DirectMusic API's *
* *
* Copyright (c) Microsoft Corporation. All rights reserved. *
* *
************************************************************************/
#ifndef _DMDLS_
#define _DMDLS_
#include "dls1.h"
typedef long PCENT; /* Pitch cents */
typedef long GCENT; /* Gain cents */
typedef long TCENT; /* Time cents */
typedef long PERCENT; /* Per.. cent! */
typedef LONGLONG REFERENCE_TIME;
typedef REFERENCE_TIME *LPREFERENCE_TIME;
#ifndef MAKE_FOURCC
#define MAKEFOURCC(ch0, ch1, ch2, ch3) \
((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \
((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
typedef DWORD FOURCC; /* a four character code */
#endif
typedef struct _DMUS_DOWNLOADINFO
{
DWORD dwDLType; /* Instrument or Wave */
DWORD dwDLId; /* Unique identifier to tag this download. */
DWORD dwNumOffsetTableEntries; /* Number of index in the offset address table. */
DWORD cbSize; /* Total size of this memory chunk. */
} DMUS_DOWNLOADINFO;
#define DMUS_DOWNLOADINFO_INSTRUMENT 1
#define DMUS_DOWNLOADINFO_WAVE 2
#define DMUS_DOWNLOADINFO_INSTRUMENT2 3 /* New version for better DLS2 support. */
/* Support for oneshot and streaming wave data
*/
#define DMUS_DOWNLOADINFO_WAVEARTICULATION 4 /* Wave articulation data */
#define DMUS_DOWNLOADINFO_STREAMINGWAVE 5 /* One chunk of a streaming */
#define DMUS_DOWNLOADINFO_ONESHOTWAVE 6
#define DMUS_DEFAULT_SIZE_OFFSETTABLE 1
/* Flags for DMUS_INSTRUMENT's ulFlags member */
#define DMUS_INSTRUMENT_GM_INSTRUMENT (1 << 0)
typedef struct _DMUS_OFFSETTABLE
{
ULONG ulOffsetTable[DMUS_DEFAULT_SIZE_OFFSETTABLE];
} DMUS_OFFSETTABLE;
typedef struct _DMUS_INSTRUMENT
{
ULONG ulPatch;
ULONG ulFirstRegionIdx;
ULONG ulGlobalArtIdx; /* If zero the instrument does not have an articulation */
ULONG ulFirstExtCkIdx; /* If zero no 3rd party entenstion chunks associated with the instrument */
ULONG ulCopyrightIdx; /* If zero no Copyright information associated with the instrument */
ULONG ulFlags;
} DMUS_INSTRUMENT;
typedef struct _DMUS_REGION
{
RGNRANGE RangeKey;
RGNRANGE RangeVelocity;
USHORT fusOptions;
USHORT usKeyGroup;
ULONG ulRegionArtIdx; /* If zero the region does not have an articulation */
ULONG ulNextRegionIdx; /* If zero no more regions */
ULONG ulFirstExtCkIdx; /* If zero no 3rd party entenstion chunks associated with the region */
WAVELINK WaveLink;
WSMPL WSMP; /* If WSMP.cSampleLoops > 1 then a WLOOP is included */
WLOOP WLOOP[1];
} DMUS_REGION;
typedef struct _DMUS_LFOPARAMS
{
PCENT pcFrequency;
TCENT tcDelay;
GCENT gcVolumeScale;
PCENT pcPitchScale;
GCENT gcMWToVolume;
PCENT pcMWToPitch;
} DMUS_LFOPARAMS;
typedef struct _DMUS_VEGPARAMS
{
TCENT tcAttack;
TCENT tcDecay;
PERCENT ptSustain;
TCENT tcRelease;
TCENT tcVel2Attack;
TCENT tcKey2Decay;
} DMUS_VEGPARAMS;
typedef struct _DMUS_PEGPARAMS
{
TCENT tcAttack;
TCENT tcDecay;
PERCENT ptSustain;
TCENT tcRelease;
TCENT tcVel2Attack;
TCENT tcKey2Decay;
PCENT pcRange;
} DMUS_PEGPARAMS;
typedef struct _DMUS_MSCPARAMS
{
PERCENT ptDefaultPan;
} DMUS_MSCPARAMS;
typedef struct _DMUS_ARTICPARAMS
{
DMUS_LFOPARAMS LFO;
DMUS_VEGPARAMS VolEG;
DMUS_PEGPARAMS PitchEG;
DMUS_MSCPARAMS Misc;
} DMUS_ARTICPARAMS;
typedef struct _DMUS_ARTICULATION /* Articulation chunk for DMUS_DOWNLOADINFO_INSTRUMENT format. */
{
ULONG ulArt1Idx; /* DLS Level 1 articulation chunk */
ULONG ulFirstExtCkIdx; /* 3rd party extenstion chunks associated with the articulation */
} DMUS_ARTICULATION;
typedef struct _DMUS_ARTICULATION2 /* Articulation chunk for DMUS_DOWNLOADINFO_INSTRUMENT2 format. */
{
ULONG ulArtIdx; /* DLS Level 1/2 articulation chunk */
ULONG ulFirstExtCkIdx; /* 3rd party extenstion chunks associated with the articulation */
ULONG ulNextArtIdx; /* Additional articulation chunks */
} DMUS_ARTICULATION2;
#define DMUS_MIN_DATA_SIZE 4
/* The actual number is determined by cbSize of struct _DMUS_EXTENSIONCHUNK */
typedef struct _DMUS_EXTENSIONCHUNK
{
ULONG cbSize; /* Size of extension chunk */
ULONG ulNextExtCkIdx; /* If zero no more 3rd party entenstion chunks */
FOURCC ExtCkID;
BYTE byExtCk[DMUS_MIN_DATA_SIZE]; /* The actual number that follows is determined by cbSize */
} DMUS_EXTENSIONCHUNK;
/* The actual number is determined by cbSize of struct _DMUS_COPYRIGHT */
typedef struct _DMUS_COPYRIGHT
{
ULONG cbSize; /* Size of copyright information */
BYTE byCopyright[DMUS_MIN_DATA_SIZE]; /* The actual number that follows is determined by cbSize */
} DMUS_COPYRIGHT;
typedef struct _DMUS_WAVEDATA
{
ULONG cbSize;
BYTE byData[DMUS_MIN_DATA_SIZE];
} DMUS_WAVEDATA;
typedef struct _DMUS_WAVE
{
ULONG ulFirstExtCkIdx; /* If zero no 3rd party entenstion chunks associated with the wave */
ULONG ulCopyrightIdx; /* If zero no Copyright information associated with the wave */
ULONG ulWaveDataIdx; /* Location of actual wave data. */
WAVEFORMATEX WaveformatEx;
} DMUS_WAVE;
typedef struct _DMUS_NOTERANGE *LPDMUS_NOTERANGE;
typedef struct _DMUS_NOTERANGE
{
DWORD dwLowNote; /* Sets the low note for the range of MIDI note events to which the instrument responds.*/
DWORD dwHighNote; /* Sets the high note for the range of MIDI note events to which the instrument responds.*/
} DMUS_NOTERANGE;
typedef struct _DMUS_WAVEARTDL
{
ULONG ulDownloadIdIdx; /* Download ID's of each buffer */
ULONG ulBus; /* Playback bus */
ULONG ulBuffers; /* Buffers */
ULONG ulMasterDLId; /* Download ID of master voice of slave group */
USHORT usOptions; /* Same as DLS2 region options */
} DMUS_WAVEARTDL,
*LPDMUS_WAVEARTDL;
typedef struct _DMUS_WAVEDL
{
ULONG cbWaveData; /* Bytes of wave data */
} DMUS_WAVEDL,
*LPDMUS_WAVEDL;
#endif

View File

@ -0,0 +1,843 @@
/************************************************************************
* *
* dmerror.h -- Error codes returned by DirectMusic API's *
* *
* Copyright (c) Microsoft Corporation. All rights reserved. *
* *
************************************************************************/
#ifndef _DMERROR_
#define _DMERROR_
#define FACILITY_DIRECTMUSIC 0x878 /* Shared with DirectSound */
#define DMUS_ERRBASE 0x1000 /* Make error codes human readable in hex */
#ifndef MAKE_HRESULT
#define MAKE_HRESULT(sev,fac,code) \
((HRESULT) (((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code))) )
#endif
#define MAKE_DMHRESULTSUCCESS(code) MAKE_HRESULT(0, FACILITY_DIRECTMUSIC, (DMUS_ERRBASE + (code)))
#define MAKE_DMHRESULTERROR(code) MAKE_HRESULT(1, FACILITY_DIRECTMUSIC, (DMUS_ERRBASE + (code)))
/* DMUS_S_PARTIALLOAD
*
* The object could only load partially. This can happen if some components are
* not registered properly, such as embedded tracks and tools. This can also happen
* if some content is missing. For example, if a segment uses a DLS collection that
* is not in the loader's current search directory.
*/
#define DMUS_S_PARTIALLOAD MAKE_DMHRESULTSUCCESS(0x091)
/* DMUS_S_PARTIALDOWNLOAD
*
* Return value from IDirectMusicBand::Download() which indicates that
* some of the instruments safely downloaded, but others failed. This usually
* occurs when some instruments are on PChannels not supported by the performance
* or port.
*/
#define DMUS_S_PARTIALDOWNLOAD MAKE_DMHRESULTSUCCESS(0x092)
/* DMUS_S_REQUEUE
*
* Return value from IDirectMusicTool::ProcessPMsg() which indicates to the
* performance that it should cue the PMsg again automatically.
*/
#define DMUS_S_REQUEUE MAKE_DMHRESULTSUCCESS(0x200)
/* DMUS_S_FREE
*
* Return value from IDirectMusicTool::ProcessPMsg() which indicates to the
* performance that it should free the PMsg automatically.
*/
#define DMUS_S_FREE MAKE_DMHRESULTSUCCESS(0x201)
/* DMUS_S_END
*
* Return value from IDirectMusicTrack::Play() which indicates to the
* segment that the track has no more data after mtEnd.
*/
#define DMUS_S_END MAKE_DMHRESULTSUCCESS(0x202)
/* DMUS_S_STRING_TRUNCATED
*
* Returned string has been truncated to fit the buffer size.
*/
#define DMUS_S_STRING_TRUNCATED MAKE_DMHRESULTSUCCESS(0x210)
/* DMUS_S_LAST_TOOL
*
* Returned from IDirectMusicGraph::StampPMsg(), this indicates that the PMsg
* is already stamped with the last tool in the graph. The returned PMsg's
* tool pointer is now NULL.
*/
#define DMUS_S_LAST_TOOL MAKE_DMHRESULTSUCCESS(0x211)
/* DMUS_S_OVER_CHORD
*
* Returned from IDirectMusicPerformance::MusicToMIDI(), this indicates
* that no note has been calculated because the music value has the note
* at a position higher than the top note of the chord. This applies only
* to DMUS_PLAYMODE_NORMALCHORD play mode. This success code indicates
* that the caller should not do anything with the note. It is not meant
* to be played against this chord.
*/
#define DMUS_S_OVER_CHORD MAKE_DMHRESULTSUCCESS(0x212)
/* DMUS_S_UP_OCTAVE
*
* Returned from IDirectMusicPerformance::MIDIToMusic(), and
* IDirectMusicPerformance::MusicToMIDI(), this indicates
* that the note conversion generated a note value that is below 0,
* so it has been bumped up one or more octaves to be in the proper
* MIDI range of 0 through 127.
* Note that this is valid for MIDIToMusic() when using play modes
* DMUS_PLAYMODE_FIXEDTOCHORD and DMUS_PLAYMODE_FIXEDTOKEY, both of
* which store MIDI values in wMusicValue. With MusicToMIDI(), it is
* valid for all play modes.
* Ofcourse, DMUS_PLAYMODE_FIXED will never return this success code.
*/
#define DMUS_S_UP_OCTAVE MAKE_DMHRESULTSUCCESS(0x213)
/* DMUS_S_DOWN_OCTAVE
*
* Returned from IDirectMusicPerformance::MIDIToMusic(), and
* IDirectMusicPerformance::MusicToMIDI(), this indicates
* that the note conversion generated a note value that is above 127,
* so it has been bumped down one or more octaves to be in the proper
* MIDI range of 0 through 127.
* Note that this is valid for MIDIToMusic() when using play modes
* DMUS_PLAYMODE_FIXEDTOCHORD and DMUS_PLAYMODE_FIXEDTOKEY, both of
* which store MIDI values in wMusicValue. With MusicToMIDI(), it is
* valid for all play modes.
* Ofcourse, DMUS_PLAYMODE_FIXED will never return this success code.
*/
#define DMUS_S_DOWN_OCTAVE MAKE_DMHRESULTSUCCESS(0x214)
/* DMUS_S_NOBUFFERCONTROL
*
* Although the audio output from the port will be routed to the
* same device as the given DirectSound buffer, buffer controls
* such as pan and volume will not affect the output.
*
*/
#define DMUS_S_NOBUFFERCONTROL MAKE_DMHRESULTSUCCESS(0x215)
/* DMUS_S_GARBAGE_COLLECTED
*
* The requested operation was not performed because during CollectGarbage
* the loader determined that the object had been released.
*/
#define DMUS_S_GARBAGE_COLLECTED MAKE_DMHRESULTSUCCESS(0x216)
/* DMUS_E_DRIVER_FAILED
*
* An unexpected error was returned from a device driver, indicating
* possible failure of the driver or hardware.
*/
#define DMUS_E_DRIVER_FAILED MAKE_DMHRESULTERROR(0x0101)
/* DMUS_E_PORTS_OPEN
*
* The requested operation cannot be performed while there are
* instantiated ports in any process in the system.
*/
#define DMUS_E_PORTS_OPEN MAKE_DMHRESULTERROR(0x0102)
/* DMUS_E_DEVICE_IN_USE
*
* The requested device is already in use (possibly by a non-DirectMusic
* client) and cannot be opened again.
*/
#define DMUS_E_DEVICE_IN_USE MAKE_DMHRESULTERROR(0x0103)
/* DMUS_E_INSUFFICIENTBUFFER
*
* Buffer is not large enough for requested operation.
*/
#define DMUS_E_INSUFFICIENTBUFFER MAKE_DMHRESULTERROR(0x0104)
/* DMUS_E_BUFFERNOTSET
*
* No buffer was prepared for the download data.
*/
#define DMUS_E_BUFFERNOTSET MAKE_DMHRESULTERROR(0x0105)
/* DMUS_E_BUFFERNOTAVAILABLE
*
* Download failed due to inability to access or create download buffer.
*/
#define DMUS_E_BUFFERNOTAVAILABLE MAKE_DMHRESULTERROR(0x0106)
/* DMUS_E_NOTADLSCOL
*
* Error parsing DLS collection. File is corrupt.
*/
#define DMUS_E_NOTADLSCOL MAKE_DMHRESULTERROR(0x0108)
/* DMUS_E_INVALIDOFFSET
*
* Wave chunks in DLS collection file are at incorrect offsets.
*/
#define DMUS_E_INVALIDOFFSET MAKE_DMHRESULTERROR(0x0109)
/* DMUS_E_ALREADY_LOADED
*
* Second attempt to load a DLS collection that is currently open.
*/
#define DMUS_E_ALREADY_LOADED MAKE_DMHRESULTERROR(0x0111)
/* DMUS_E_INVALIDPOS
*
* Error reading wave data from DLS collection. Indicates bad file.
*/
#define DMUS_E_INVALIDPOS MAKE_DMHRESULTERROR(0x0113)
/* DMUS_E_INVALIDPATCH
*
* There is no instrument in the collection that matches patch number.
*/
#define DMUS_E_INVALIDPATCH MAKE_DMHRESULTERROR(0x0114)
/* DMUS_E_CANNOTSEEK
*
* The IStream* doesn't support Seek().
*/
#define DMUS_E_CANNOTSEEK MAKE_DMHRESULTERROR(0x0115)
/* DMUS_E_CANNOTWRITE
*
* The IStream* doesn't support Write().
*/
#define DMUS_E_CANNOTWRITE MAKE_DMHRESULTERROR(0x0116)
/* DMUS_E_CHUNKNOTFOUND
*
* The RIFF parser doesn't contain a required chunk while parsing file.
*/
#define DMUS_E_CHUNKNOTFOUND MAKE_DMHRESULTERROR(0x0117)
/* DMUS_E_INVALID_DOWNLOADID
*
* Invalid download id was used in the process of creating a download buffer.
*/
#define DMUS_E_INVALID_DOWNLOADID MAKE_DMHRESULTERROR(0x0119)
/* DMUS_E_NOT_DOWNLOADED_TO_PORT
*
* Tried to unload an object that was not downloaded or previously unloaded.
*/
#define DMUS_E_NOT_DOWNLOADED_TO_PORT MAKE_DMHRESULTERROR(0x0120)
/* DMUS_E_ALREADY_DOWNLOADED
*
* Buffer was already downloaded to synth.
*/
#define DMUS_E_ALREADY_DOWNLOADED MAKE_DMHRESULTERROR(0x0121)
/* DMUS_E_UNKNOWN_PROPERTY
*
* The specified property item was not recognized by the target object.
*/
#define DMUS_E_UNKNOWN_PROPERTY MAKE_DMHRESULTERROR(0x0122)
/* DMUS_E_SET_UNSUPPORTED
*
* The specified property item may not be set on the target object.
*/
#define DMUS_E_SET_UNSUPPORTED MAKE_DMHRESULTERROR(0x0123)
/* DMUS_E_GET_UNSUPPORTED
*
* The specified property item may not be retrieved from the target object.
*/
#define DMUS_E_GET_UNSUPPORTED MAKE_DMHRESULTERROR(0x0124)
/* DMUS_E_NOTMONO
*
* Wave chunk has more than one interleaved channel. DLS format requires MONO.
*/
#define DMUS_E_NOTMONO MAKE_DMHRESULTERROR(0x0125)
/* DMUS_E_BADARTICULATION
*
* Invalid articulation chunk in DLS collection.
*/
#define DMUS_E_BADARTICULATION MAKE_DMHRESULTERROR(0x0126)
/* DMUS_E_BADINSTRUMENT
*
* Invalid instrument chunk in DLS collection.
*/
#define DMUS_E_BADINSTRUMENT MAKE_DMHRESULTERROR(0x0127)
/* DMUS_E_BADWAVELINK
*
* Wavelink chunk in DLS collection points to invalid wave.
*/
#define DMUS_E_BADWAVELINK MAKE_DMHRESULTERROR(0x0128)
/* DMUS_E_NOARTICULATION
*
* Articulation missing from instrument in DLS collection.
*/
#define DMUS_E_NOARTICULATION MAKE_DMHRESULTERROR(0x0129)
/* DMUS_E_NOTPCM
*
* Downoaded DLS wave is not in PCM format.
*/
#define DMUS_E_NOTPCM MAKE_DMHRESULTERROR(0x012A)
/* DMUS_E_BADWAVE
*
* Bad wave chunk in DLS collection
*/
#define DMUS_E_BADWAVE MAKE_DMHRESULTERROR(0x012B)
/* DMUS_E_BADOFFSETTABLE
*
* Offset Table for download buffer has errors.
*/
#define DMUS_E_BADOFFSETTABLE MAKE_DMHRESULTERROR(0x012C)
/* DMUS_E_UNKNOWNDOWNLOAD
*
* Attempted to download unknown data type.
*/
#define DMUS_E_UNKNOWNDOWNLOAD MAKE_DMHRESULTERROR(0x012D)
/* DMUS_E_NOSYNTHSINK
*
* The operation could not be completed because no sink was connected to
* the synthesizer.
*/
#define DMUS_E_NOSYNTHSINK MAKE_DMHRESULTERROR(0x012E)
/* DMUS_E_ALREADYOPEN
*
* An attempt was made to open the software synthesizer while it was already
* open.
* ASSERT?
*/
#define DMUS_E_ALREADYOPEN MAKE_DMHRESULTERROR(0x012F)
/* DMUS_E_ALREADYCLOSE
*
* An attempt was made to close the software synthesizer while it was already
* open.
* ASSERT?
*/
#define DMUS_E_ALREADYCLOSED MAKE_DMHRESULTERROR(0x0130)
/* DMUS_E_SYNTHNOTCONFIGURED
*
* The operation could not be completed because the software synth has not
* yet been fully configured.
* ASSERT?
*/
#define DMUS_E_SYNTHNOTCONFIGURED MAKE_DMHRESULTERROR(0x0131)
/* DMUS_E_SYNTHACTIVE
*
* The operation cannot be carried out while the synthesizer is active.
*/
#define DMUS_E_SYNTHACTIVE MAKE_DMHRESULTERROR(0x0132)
/* DMUS_E_CANNOTREAD
*
* An error occurred while attempting to read from the IStream* object.
*/
#define DMUS_E_CANNOTREAD MAKE_DMHRESULTERROR(0x0133)
/* DMUS_E_DMUSIC_RELEASED
*
* The operation cannot be performed because the final instance of the
* DirectMusic object was released. Ports cannot be used after final
* release of the DirectMusic object.
*/
#define DMUS_E_DMUSIC_RELEASED MAKE_DMHRESULTERROR(0x0134)
/* DMUS_E_BUFFER_EMPTY
*
* There was no data in the referenced buffer.
*/
#define DMUS_E_BUFFER_EMPTY MAKE_DMHRESULTERROR(0x0135)
/* DMUS_E_BUFFER_FULL
*
* There is insufficient space to insert the given event into the buffer.
*/
#define DMUS_E_BUFFER_FULL MAKE_DMHRESULTERROR(0x0136)
/* DMUS_E_PORT_NOT_CAPTURE
*
* The given operation could not be carried out because the port is a
* capture port.
*/
#define DMUS_E_PORT_NOT_CAPTURE MAKE_DMHRESULTERROR(0x0137)
/* DMUS_E_PORT_NOT_RENDER
*
* The given operation could not be carried out because the port is a
* render port.
*/
#define DMUS_E_PORT_NOT_RENDER MAKE_DMHRESULTERROR(0x0138)
/* DMUS_E_DSOUND_NOT_SET
*
* The port could not be created because no DirectSound has been specified.
* Specify a DirectSound interface via the IDirectMusic::SetDirectSound
* method; pass NULL to have DirectMusic manage usage of DirectSound.
*/
#define DMUS_E_DSOUND_NOT_SET MAKE_DMHRESULTERROR(0x0139)
/* DMUS_E_ALREADY_ACTIVATED
*
* The operation cannot be carried out while the port is active.
*/
#define DMUS_E_ALREADY_ACTIVATED MAKE_DMHRESULTERROR(0x013A)
/* DMUS_E_INVALIDBUFFER
*
* Invalid DirectSound buffer was handed to port.
*/
#define DMUS_E_INVALIDBUFFER MAKE_DMHRESULTERROR(0x013B)
/* DMUS_E_WAVEFORMATNOTSUPPORTED
*
* Invalid buffer format was handed to the synth sink.
*/
#define DMUS_E_WAVEFORMATNOTSUPPORTED MAKE_DMHRESULTERROR(0x013C)
/* DMUS_E_SYNTHINACTIVE
*
* The operation cannot be carried out while the synthesizer is inactive.
*/
#define DMUS_E_SYNTHINACTIVE MAKE_DMHRESULTERROR(0x013D)
/* DMUS_E_DSOUND_ALREADY_SET
*
* IDirectMusic::SetDirectSound has already been called. It may not be
* changed while in use.
*/
#define DMUS_E_DSOUND_ALREADY_SET MAKE_DMHRESULTERROR(0x013E)
/* DMUS_E_INVALID_EVENT
*
* The given event is invalid (either it is not a valid MIDI message
* or it makes use of running status). The event cannot be packed
* into the buffer.
*/
#define DMUS_E_INVALID_EVENT MAKE_DMHRESULTERROR(0x013F)
/* DMUS_E_UNSUPPORTED_STREAM
*
* The IStream* object does not contain data supported by the loading object.
*/
#define DMUS_E_UNSUPPORTED_STREAM MAKE_DMHRESULTERROR(0x0150)
/* DMUS_E_ALREADY_INITED
*
* The object has already been initialized.
*/
#define DMUS_E_ALREADY_INITED MAKE_DMHRESULTERROR(0x0151)
/* DMUS_E_INVALID_BAND
*
* The file does not contain a valid band.
*/
#define DMUS_E_INVALID_BAND MAKE_DMHRESULTERROR(0x0152)
/* DMUS_E_TRACK_HDR_NOT_FIRST_CK
*
* The IStream* object's data does not have a track header as the first chunk,
* and therefore can not be read by the segment object.
*/
#define DMUS_E_TRACK_HDR_NOT_FIRST_CK MAKE_DMHRESULTERROR(0x0155)
/* DMUS_E_TOOL_HDR_NOT_FIRST_CK
*
* The IStream* object's data does not have a tool header as the first chunk,
* and therefore can not be read by the graph object.
*/
#define DMUS_E_TOOL_HDR_NOT_FIRST_CK MAKE_DMHRESULTERROR(0x0156)
/* DMUS_E_INVALID_TRACK_HDR
*
* The IStream* object's data contains an invalid track header (ckid is 0 and
* fccType is NULL,) and therefore can not be read by the segment object.
*/
#define DMUS_E_INVALID_TRACK_HDR MAKE_DMHRESULTERROR(0x0157)
/* DMUS_E_INVALID_TOOL_HDR
*
* The IStream* object's data contains an invalid tool header (ckid is 0 and
* fccType is NULL,) and therefore can not be read by the graph object.
*/
#define DMUS_E_INVALID_TOOL_HDR MAKE_DMHRESULTERROR(0x0158)
/* DMUS_E_ALL_TOOLS_FAILED
*
* The graph object was unable to load all tools from the IStream* object data.
* This may be due to errors in the stream, or the tools being incorrectly
* registered on the client.
*/
#define DMUS_E_ALL_TOOLS_FAILED MAKE_DMHRESULTERROR(0x0159)
/* DMUS_E_ALL_TRACKS_FAILED
*
* The segment object was unable to load all tracks from the IStream* object data.
* This may be due to errors in the stream, or the tracks being incorrectly
* registered on the client.
*/
#define DMUS_E_ALL_TRACKS_FAILED MAKE_DMHRESULTERROR(0x0160)
/* DMUS_E_NOT_FOUND
*
* The requested item was not contained by the object.
*/
#define DMUS_E_NOT_FOUND MAKE_DMHRESULTERROR(0x0161)
/* DMUS_E_NOT_INIT
*
* A required object is not initialized or failed to initialize.
*/
#define DMUS_E_NOT_INIT MAKE_DMHRESULTERROR(0x0162)
/* DMUS_E_TYPE_DISABLED
*
* The requested parameter type is currently disabled. Parameter types may
* be enabled and disabled by certain calls to SetParam().
*/
#define DMUS_E_TYPE_DISABLED MAKE_DMHRESULTERROR(0x0163)
/* DMUS_E_TYPE_UNSUPPORTED
*
* The requested parameter type is not supported on the object.
*/
#define DMUS_E_TYPE_UNSUPPORTED MAKE_DMHRESULTERROR(0x0164)
/* DMUS_E_TIME_PAST
*
* The time is in the past, and the operation can not succeed.
*/
#define DMUS_E_TIME_PAST MAKE_DMHRESULTERROR(0x0165)
/* DMUS_E_TRACK_NOT_FOUND
*
* The requested track is not contained by the segment.
*/
#define DMUS_E_TRACK_NOT_FOUND MAKE_DMHRESULTERROR(0x0166)
/* DMUS_E_TRACK_NO_CLOCKTIME_SUPPORT
*
* The track does not support clock time playback or getparam.
*/
#define DMUS_E_TRACK_NO_CLOCKTIME_SUPPORT MAKE_DMHRESULTERROR(0x0167)
/* DMUS_E_NO_MASTER_CLOCK
*
* There is no master clock in the performance. Be sure to call
* IDirectMusicPerformance::Init().
*/
#define DMUS_E_NO_MASTER_CLOCK MAKE_DMHRESULTERROR(0x0170)
/* DMUS_E_LOADER_NOCLASSID
*
* The class id field is required and missing in the DMUS_OBJECTDESC.
*/
#define DMUS_E_LOADER_NOCLASSID MAKE_DMHRESULTERROR(0x0180)
/* DMUS_E_LOADER_BADPATH
*
* The requested file path is invalid.
*/
#define DMUS_E_LOADER_BADPATH MAKE_DMHRESULTERROR(0x0181)
/* DMUS_E_LOADER_FAILEDOPEN
*
* File open failed - either file doesn't exist or is locked.
*/
#define DMUS_E_LOADER_FAILEDOPEN MAKE_DMHRESULTERROR(0x0182)
/* DMUS_E_LOADER_FORMATNOTSUPPORTED
*
* Search data type is not supported.
*/
#define DMUS_E_LOADER_FORMATNOTSUPPORTED MAKE_DMHRESULTERROR(0x0183)
/* DMUS_E_LOADER_FAILEDCREATE
*
* Unable to find or create object.
*/
#define DMUS_E_LOADER_FAILEDCREATE MAKE_DMHRESULTERROR(0x0184)
/* DMUS_E_LOADER_OBJECTNOTFOUND
*
* Object was not found.
*/
#define DMUS_E_LOADER_OBJECTNOTFOUND MAKE_DMHRESULTERROR(0x0185)
/* DMUS_E_LOADER_NOFILENAME
*
* The file name is missing from the DMUS_OBJECTDESC.
*/
#define DMUS_E_LOADER_NOFILENAME MAKE_DMHRESULTERROR(0x0186)
/* DMUS_E_INVALIDFILE
*
* The file requested is not a valid file.
*/
#define DMUS_E_INVALIDFILE MAKE_DMHRESULTERROR(0x0200)
/* DMUS_E_ALREADY_EXISTS
*
* The tool is already contained in the graph. Create a new instance.
*/
#define DMUS_E_ALREADY_EXISTS MAKE_DMHRESULTERROR(0x0201)
/* DMUS_E_OUT_OF_RANGE
*
* Value is out of range, for instance the requested length is longer than
* the segment.
*/
#define DMUS_E_OUT_OF_RANGE MAKE_DMHRESULTERROR(0x0202)
/* DMUS_E_SEGMENT_INIT_FAILED
*
* Segment initialization failed, most likely due to a critical memory situation.
*/
#define DMUS_E_SEGMENT_INIT_FAILED MAKE_DMHRESULTERROR(0x0203)
/* DMUS_E_ALREADY_SENT
*
* The DMUS_PMSG has already been sent to the performance object via
* IDirectMusicPerformance::SendPMsg().
*/
#define DMUS_E_ALREADY_SENT MAKE_DMHRESULTERROR(0x0204)
/* DMUS_E_CANNOT_FREE
*
* The DMUS_PMSG was either not allocated by the performance via
* IDirectMusicPerformance::AllocPMsg(), or it was already freed via
* IDirectMusicPerformance::FreePMsg().
*/
#define DMUS_E_CANNOT_FREE MAKE_DMHRESULTERROR(0x0205)
/* DMUS_E_CANNOT_OPEN_PORT
*
* The default system port could not be opened.
*/
#define DMUS_E_CANNOT_OPEN_PORT MAKE_DMHRESULTERROR(0x0206)
/* DMUS_E_CANNOT_CONVERT
*
* A call to MIDIToMusic() or MusicToMIDI() resulted in an error because
* the requested conversion could not happen. This usually occurs when the
* provided DMUS_CHORD_KEY structure has an invalid chord or scale pattern.
*/
#define DMUS_E_CANNOT_CONVERT MAKE_DMHRESULTERROR(0x0207)
/* misspelling in previous versions of DirectX preserved for backward compatibility */
#define DMUS_E_CONNOT_CONVERT DMUS_E_CANNOT_CONVERT
/* DMUS_E_DESCEND_CHUNK_FAIL
*
* DMUS_E_DESCEND_CHUNK_FAIL is returned when the end of the file
* was reached before the desired chunk was found.
*/
#define DMUS_E_DESCEND_CHUNK_FAIL MAKE_DMHRESULTERROR(0x0210)
/* DMUS_E_NOT_LOADED
*
* An attempt to use this object failed because it first needs to
* be loaded.
*/
#define DMUS_E_NOT_LOADED MAKE_DMHRESULTERROR(0x0211)
/* DMUS_E_SCRIPT_LANGUAGE_INCOMPATIBLE
*
* The activeX scripting engine for the script's language is not compatible with
* DirectMusic.
*
*/
#define DMUS_E_SCRIPT_LANGUAGE_INCOMPATIBLE MAKE_DMHRESULTERROR(0x0213)
/* DMUS_E_SCRIPT_UNSUPPORTED_VARTYPE
*
* A varient was used that had a type that is not supported by DirectMusic.
*
*/
#define DMUS_E_SCRIPT_UNSUPPORTED_VARTYPE MAKE_DMHRESULTERROR(0x0214)
/* DMUS_E_SCRIPT_ERROR_IN_SCRIPT
*
* An error was encountered while parsing or executing the script.
* The pErrorInfo parameter (if supplied) was filled with information about the error.
*/
#define DMUS_E_SCRIPT_ERROR_IN_SCRIPT MAKE_DMHRESULTERROR(0x0215)
/* DMUS_E_SCRIPT_CANTLOAD_OLEAUT32
*
* Loading of oleaut32.dll failed. VBScript and other activeX scripting languages
* require use of oleaut32.dll. On platforms where oleaut32.dll is not present, only
* the DirectMusicScript language, which doesn't require oleaut32.dll can be used.
*/
#define DMUS_E_SCRIPT_CANTLOAD_OLEAUT32 MAKE_DMHRESULTERROR(0x0216)
/* DMUS_E_SCRIPT_LOADSCRIPT_ERROR
*
* An error occured while parsing a script loaded using LoadScript. The script that
* was loaded contains an error.
*/
#define DMUS_E_SCRIPT_LOADSCRIPT_ERROR MAKE_DMHRESULTERROR(0x0217)
/* DMUS_E_SCRIPT_INVALID_FILE
*
* The script file is invalid.
*/
#define DMUS_E_SCRIPT_INVALID_FILE MAKE_DMHRESULTERROR(0x0218)
/* DMUS_E_INVALID_SCRIPTTRACK
*
* The file contains an invalid script track.
*/
#define DMUS_E_INVALID_SCRIPTTRACK MAKE_DMHRESULTERROR(0x0219)
/* DMUS_E_SCRIPT_VARIABLE_NOT_FOUND
*
* The script does not contain a variable with the specified name.
*/
#define DMUS_E_SCRIPT_VARIABLE_NOT_FOUND MAKE_DMHRESULTERROR(0x021A)
/* DMUS_E_SCRIPT_ROUTINE_NOT_FOUND
*
* The script does not contain a routine with the specified name.
*/
#define DMUS_E_SCRIPT_ROUTINE_NOT_FOUND MAKE_DMHRESULTERROR(0x021B)
/* DMUS_E_SCRIPT_CONTENT_READONLY
*
* Scripts variables for content referenced or embedded in a script cannot be set.
*/
#define DMUS_E_SCRIPT_CONTENT_READONLY MAKE_DMHRESULTERROR(0x021C)
/* DMUS_E_SCRIPT_NOT_A_REFERENCE
*
* Attempt was made to set a script's variable by reference to a value that was
* not an object type.
*/
#define DMUS_E_SCRIPT_NOT_A_REFERENCE MAKE_DMHRESULTERROR(0x021D)
/* DMUS_E_SCRIPT_VALUE_NOT_SUPPORTED
*
* Attempt was made to set a script's variable by value to an object that does
* not support a default value property.
*/
#define DMUS_E_SCRIPT_VALUE_NOT_SUPPORTED MAKE_DMHRESULTERROR(0x021E)
/* DMUS_E_INVALID_SEGMENTTRIGGERTRACK
*
* The file contains an invalid segment trigger track.
*/
#define DMUS_E_INVALID_SEGMENTTRIGGERTRACK MAKE_DMHRESULTERROR(0x0220)
/* DMUS_E_INVALID_LYRICSTRACK
*
* The file contains an invalid lyrics track.
*/
#define DMUS_E_INVALID_LYRICSTRACK MAKE_DMHRESULTERROR(0x0221)
/* DMUS_E_INVALID_PARAMCONTROLTRACK
*
* The file contains an invalid parameter control track.
*/
#define DMUS_E_INVALID_PARAMCONTROLTRACK MAKE_DMHRESULTERROR(0x0222)
/* DMUS_E_AUDIOVBSCRIPT_SYNTAXERROR
*
* A script written in AudioVBScript could not be read because it contained a statement that
* is not allowed by the AudioVBScript language.
*/
#define DMUS_E_AUDIOVBSCRIPT_SYNTAXERROR MAKE_DMHRESULTERROR(0x0223)
/* DMUS_E_AUDIOVBSCRIPT_RUNTIMEERROR
*
* A script routine written in AudioVBScript failed because an invalid operation occurred. For example,
* adding the number 3 to a segment object would produce this error. So would attempting to call a routine
* that doesn't exist.
*/
#define DMUS_E_AUDIOVBSCRIPT_RUNTIMEERROR MAKE_DMHRESULTERROR(0x0224)
/* DMUS_E_AUDIOVBSCRIPT_OPERATIONFAILURE
*
* A script routine written in AudioVBScript failed because a function outside of a script failed to complete.
* For example, a call to PlaySegment that fails to play because of low memory would return this error.
*/
#define DMUS_E_AUDIOVBSCRIPT_OPERATIONFAILURE MAKE_DMHRESULTERROR(0x0225)
/* DMUS_E_AUDIOPATHS_NOT_VALID
*
* The Performance has set up some PChannels using the AssignPChannel command, which
* makes it not capable of supporting audio paths.
*/
#define DMUS_E_AUDIOPATHS_NOT_VALID MAKE_DMHRESULTERROR(0x0226)
/* DMUS_E_AUDIOPATHS_IN_USE
*
* This is the inverse of the previous error.
* The Performance has set up some audio paths, which makes is incompatible
* with the calls to allocate pchannels, etc.
*/
#define DMUS_E_AUDIOPATHS_IN_USE MAKE_DMHRESULTERROR(0x0227)
/* DMUS_E_NO_AUDIOPATH_CONFIG
*
* A segment was asked for its embedded audio path configuration,
* but there isn't any.
*/
#define DMUS_E_NO_AUDIOPATH_CONFIG MAKE_DMHRESULTERROR(0x0228)
/* DMUS_E_AUDIOPATH_INACTIVE
*
* An audiopath is inactive, perhaps because closedown was called.
*/
#define DMUS_E_AUDIOPATH_INACTIVE MAKE_DMHRESULTERROR(0x0229)
/* DMUS_E_AUDIOPATH_NOBUFFER
*
* An audiopath failed to create because a requested buffer could not be created.
*/
#define DMUS_E_AUDIOPATH_NOBUFFER MAKE_DMHRESULTERROR(0x022A)
/* DMUS_E_AUDIOPATH_NOPORT
*
* An audiopath could not be used for playback because it lacked port assignments.
*/
#define DMUS_E_AUDIOPATH_NOPORT MAKE_DMHRESULTERROR(0x022B)
/* DMUS_E_NO_AUDIOPATH
*
* Attempt was made to play segment in audiopath mode and there was no audiopath.
*/
#define DMUS_E_NO_AUDIOPATH MAKE_DMHRESULTERROR(0x022C)
/* DMUS_E_INVALIDCHUNK
*
* Invalid data was found in a RIFF file chunk.
*/
#define DMUS_E_INVALIDCHUNK MAKE_DMHRESULTERROR(0x022D)
/* DMUS_E_AUDIOPATH_NOGLOBALFXBUFFER
*
* Attempt was made to create an audiopath that sends to a global effects buffer which did not exist.
*/
#define DMUS_E_AUDIOPATH_NOGLOBALFXBUFFER MAKE_DMHRESULTERROR(0x022E)
/* DMUS_E_INVALID_CONTAINER_OBJECT
*
* The file does not contain a valid container object.
*/
#define DMUS_E_INVALID_CONTAINER_OBJECT MAKE_DMHRESULTERROR(0x022F)
#endif

View File

@ -0,0 +1,166 @@
/************************************************************************
* *
* dmksctrl.h -- Definition of IKsControl *
* *
* Copyright (c) Microsoft Corporation. All rights reserved. *
* *
* This header file contains the definition of IKsControl, which *
* duplicates definitions from ks.h and ksproxy.h. Your code should *
* include ks.h and ksproxy.h directly if you have them (they are *
* provided in the Windows 98 DDK and will be in the Windows NT 5 *
* SDK). *
* *
************************************************************************/
#ifndef _DMKSCTRL_
#define _DMKSCTRL_
#if _MSC_VER >= 1200
#pragma warning(push)
#endif
#pragma warning(disable:4201) /* Disable warnings on anonymous unions */
#include <pshpack8.h>
#include <objbase.h>
#if !defined(_NTRTL_)
#ifndef DEFINE_GUIDEX
#define DEFINE_GUIDEX(name) EXTERN_C const CDECL GUID name
#endif /* !defined(DEFINE_GUIDEX) */
#ifndef STATICGUIDOF
#define STATICGUIDOF(guid) STATIC_##guid
#endif /* !defined(STATICGUIDOF) */
#endif /* !defined(_NTRTL_) */
#ifndef STATIC_IID_IKsControl
#define STATIC_IID_IKsControl\
0x28F54685L, 0x06FD, 0x11D2, 0xB2, 0x7A, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
#endif /* STATIC_IID_IKsControl */
/*
* Warning: This will prevent the rest of ks.h from being pulled in if ks.h is
* included after dmksctrl.h. Make sure you do not include both headers in
* the same source file.
*/
#ifndef _KS_
#define _KS_
#if (defined(_MSC_EXTENSIONS) || defined(__cplusplus)) && !defined(CINTERFACE)
typedef struct {
union {
struct {
GUID Set;
ULONG Id;
ULONG Flags;
};
LONGLONG Alignment;
};
} KSIDENTIFIER, *PKSIDENTIFIER;
#else
typedef struct {
union {
struct {
GUID Set;
ULONG Id;
ULONG Flags;
} Data;
LONGLONG Alignment;
};
} KSIDENTIFIER, *PKSIDENTIFIER;
#endif
typedef KSIDENTIFIER KSPROPERTY, *PKSPROPERTY, KSMETHOD, *PKSMETHOD, KSEVENT, *PKSEVENT;
#define KSMETHOD_TYPE_NONE 0x00000000
#define KSMETHOD_TYPE_READ 0x00000001
#define KSMETHOD_TYPE_WRITE 0x00000002
#define KSMETHOD_TYPE_MODIFY 0x00000003
#define KSMETHOD_TYPE_SOURCE 0x00000004
#define KSMETHOD_TYPE_SEND 0x00000001
#define KSMETHOD_TYPE_SETSUPPORT 0x00000100
#define KSMETHOD_TYPE_BASICSUPPORT 0x00000200
#define KSPROPERTY_TYPE_GET 0x00000001
#define KSPROPERTY_TYPE_SET 0x00000002
#define KSPROPERTY_TYPE_SETSUPPORT 0x00000100
#define KSPROPERTY_TYPE_BASICSUPPORT 0x00000200
#define KSPROPERTY_TYPE_RELATIONS 0x00000400
#define KSPROPERTY_TYPE_SERIALIZESET 0x00000800
#define KSPROPERTY_TYPE_UNSERIALIZESET 0x00001000
#define KSPROPERTY_TYPE_SERIALIZERAW 0x00002000
#define KSPROPERTY_TYPE_UNSERIALIZERAW 0x00004000
#define KSPROPERTY_TYPE_SERIALIZESIZE 0x00008000
#define KSPROPERTY_TYPE_DEFAULTVALUES 0x00010000
#define KSPROPERTY_TYPE_TOPOLOGY 0x10000000
#endif /* _KS_ */
#ifndef _IKsControl_
#define _IKsControl_
#ifdef DECLARE_INTERFACE_
#undef INTERFACE
#define INTERFACE IKsControl
DECLARE_INTERFACE_(IKsControl, IUnknown)
{
/* IUnknown */
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/*IKsControl*/
STDMETHOD(KsProperty)(
THIS_
IN PKSPROPERTY Property,
IN ULONG PropertyLength,
IN OUT LPVOID PropertyData,
IN ULONG DataLength,
OUT ULONG* BytesReturned
) PURE;
STDMETHOD(KsMethod)(
THIS_
IN PKSMETHOD Method,
IN ULONG MethodLength,
IN OUT LPVOID MethodData,
IN ULONG DataLength,
OUT ULONG* BytesReturned
) PURE;
STDMETHOD(KsEvent)(
THIS_
IN PKSEVENT Event OPTIONAL,
IN ULONG EventLength,
IN OUT LPVOID EventData,
IN ULONG DataLength,
OUT ULONG* BytesReturned
) PURE;
};
#endif /* DECLARE_INTERFACE_ */
#endif /* _IKsControl_ */
#include <poppack.h>
DEFINE_GUID(IID_IKsControl, 0x28F54685, 0x06FD, 0x11D2, 0xB2, 0x7A, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96);
/* These formats are in ksmedia.h
*/
#ifndef _KSMEDIA_
DEFINE_GUID(KSDATAFORMAT_SUBTYPE_MIDI, 0x1D262760L, 0xE957, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00);
DEFINE_GUID(KSDATAFORMAT_SUBTYPE_DIRECTMUSIC, 0x1a82f8bc, 0x3f8b, 0x11d2, 0xb7, 0x74, 0x00, 0x60, 0x08, 0x33, 0x16, 0xc1);
#endif
#if _MSC_VER >= 1200
#pragma warning(pop)
#endif
#endif /* _DMKSCTRL */

View File

@ -0,0 +1,280 @@
/************************************************************************
* *
* dmplugin.h -- This module contains the API for plugins for the *
* DirectMusic performance layer *
* *
* Copyright (c) Microsoft Corporation. All rights reserved. *
* *
************************************************************************/
#ifndef _DMPLUGIN_
#define _DMPLUGIN_
#include <windows.h>
#define COM_NO_WINDOWS_H
#include <objbase.h>
#include <mmsystem.h>
#include <dmusici.h>
#include <pshpack8.h>
#ifdef __cplusplus
extern "C" {
#endif
interface IDirectMusicTrack;
interface IDirectMusicTool;
interface IDirectMusicTool8;
interface IDirectMusicTrack8;
interface IDirectMusicPerformance;
interface IDirectMusicPerformance8;
interface IDirectMusicSegment;
interface IDirectMusicSegment8;
interface IDirectMusicSegmentState;
interface IDirectMusicSegmentState8;
interface IDirectMusicGraph;
#ifndef __cplusplus
typedef interface IDirectMusicTrack IDirectMusicTrack;
typedef interface IDirectMusicTool IDirectMusicTool;
typedef interface IDirectMusicTool8 IDirectMusicTool8;
typedef interface IDirectMusicTrack8 IDirectMusicTrack8;
typedef interface IDirectMusicPerformance IDirectMusicPerformance;
typedef interface IDirectMusicPerformance8 IDirectMusicPerformance8;
typedef interface IDirectMusicSegment IDirectMusicSegment;
typedef interface IDirectMusicSegment8 IDirectMusicSegment8;
typedef interface IDirectMusicSegmentState IDirectMusicSegmentState;
typedef interface IDirectMusicSegmentState8 IDirectMusicSegmentState8;
typedef interface IDirectMusicGraph IDirectMusicGraph;
#endif
typedef struct _DMUS_PMSG DMUS_PMSG;
typedef long MUSIC_TIME;
/* Registry location for tools */
#define DMUS_REGSTR_PATH_TOOLS "Software\\Microsoft\\DirectMusic\\Tools"
/*////////////////////////////////////////////////////////////////////
// IDirectMusicTool */
#undef INTERFACE
#define INTERFACE IDirectMusicTool
DECLARE_INTERFACE_(IDirectMusicTool, IUnknown)
{
/* IUnknown */
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/* IDirectMusicTool */
STDMETHOD(Init) (THIS_ IDirectMusicGraph* pGraph) PURE;
STDMETHOD(GetMsgDeliveryType) (THIS_ DWORD* pdwDeliveryType ) PURE;
STDMETHOD(GetMediaTypeArraySize)(THIS_ DWORD* pdwNumElements ) PURE;
STDMETHOD(GetMediaTypes) (THIS_ DWORD** padwMediaTypes,
DWORD dwNumElements) PURE;
STDMETHOD(ProcessPMsg) (THIS_ IDirectMusicPerformance* pPerf,
DMUS_PMSG* pPMSG) PURE;
STDMETHOD(Flush) (THIS_ IDirectMusicPerformance* pPerf,
DMUS_PMSG* pPMSG,
REFERENCE_TIME rtTime) PURE;
};
/*////////////////////////////////////////////////////////////////////
// IDirectMusicTool8 */
#undef INTERFACE
#define INTERFACE IDirectMusicTool8
DECLARE_INTERFACE_(IDirectMusicTool8, IDirectMusicTool)
{
/* IUnknown */
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/* IDirectMusicTool */
STDMETHOD(Init) (THIS_ IDirectMusicGraph* pGraph) PURE;
STDMETHOD(GetMsgDeliveryType) (THIS_ DWORD* pdwDeliveryType ) PURE;
STDMETHOD(GetMediaTypeArraySize)(THIS_ DWORD* pdwNumElements ) PURE;
STDMETHOD(GetMediaTypes) (THIS_ DWORD** padwMediaTypes,
DWORD dwNumElements) PURE;
STDMETHOD(ProcessPMsg) (THIS_ IDirectMusicPerformance* pPerf,
DMUS_PMSG* pPMSG) PURE;
STDMETHOD(Flush) (THIS_ IDirectMusicPerformance* pPerf,
DMUS_PMSG* pPMSG,
REFERENCE_TIME rtTime) PURE;
/* IDirectMusicTool8 */
STDMETHOD(Clone) (THIS_ IDirectMusicTool ** ppTool) PURE;
};
/* The following flags are sent in the IDirectMusicTrack::Play() method */
/* inside the dwFlags parameter */
typedef enum enumDMUS_TRACKF_FLAGS
{
DMUS_TRACKF_SEEK = 1, /* set on a seek */
DMUS_TRACKF_LOOP = 2, /* set on a loop (repeat) */
DMUS_TRACKF_START = 4, /* set on first call to Play */
DMUS_TRACKF_FLUSH = 8, /* set when this call is in response to a flush on the perfomance */
DMUS_TRACKF_DIRTY = 0x10, /* set when the track should consider any cached values from a previous call to GetParam to be invalidated */
/* The following flags are DX8 only. */
DMUS_TRACKF_NOTIFY_OFF = 0x20, /* tells track not to send notifications. */
DMUS_TRACKF_PLAY_OFF = 0x40, /* tells track not to play anything (but can still send notifications.) */
DMUS_TRACKF_LOOPEND = 0x80, /* set when the end of range is also a loop end. */
DMUS_TRACKF_STOP = 0x100, /* set when the end of range is also end of playing this segment. */
DMUS_TRACKF_RECOMPOSE = 0x200, /* set to indicate the track should compose. */
DMUS_TRACKF_CLOCK = 0x400, /* set when time parameters are in reference (clock) time. Only valid for PlayEx(). */
} DMUS_TRACKF_FLAGS;
/* The following flags are sent in the IDirectMusicTrack8::GetParamEx() and SetParamEx() methods */
/* inside the dwFlags parameter */
#define DMUS_TRACK_PARAMF_CLOCK 0x01 /* set when the time is measured is in reference (clock) time */
/*////////////////////////////////////////////////////////////////////
// IDirectMusicTrack */
#undef INTERFACE
#define INTERFACE IDirectMusicTrack
DECLARE_INTERFACE_(IDirectMusicTrack, IUnknown)
{
/* IUnknown */
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/* IDirectMusicTrack */
STDMETHOD(Init) (THIS_ IDirectMusicSegment* pSegment) PURE;
STDMETHOD(InitPlay) (THIS_ IDirectMusicSegmentState* pSegmentState,
IDirectMusicPerformance* pPerformance,
void** ppStateData,
DWORD dwVirtualTrackID,
DWORD dwFlags) PURE;
STDMETHOD(EndPlay) (THIS_ void* pStateData) PURE;
STDMETHOD(Play) (THIS_ void* pStateData,
MUSIC_TIME mtStart,
MUSIC_TIME mtEnd,
MUSIC_TIME mtOffset,
DWORD dwFlags,
IDirectMusicPerformance* pPerf,
IDirectMusicSegmentState* pSegSt,
DWORD dwVirtualID) PURE;
STDMETHOD(GetParam) (THIS_ REFGUID rguidType,
MUSIC_TIME mtTime,
MUSIC_TIME* pmtNext,
void* pParam) PURE;
STDMETHOD(SetParam) (THIS_ REFGUID rguidType,
MUSIC_TIME mtTime,
void* pParam) PURE;
STDMETHOD(IsParamSupported) (THIS_ REFGUID rguidType) PURE;
STDMETHOD(AddNotificationType) (THIS_ REFGUID rguidNotificationType) PURE;
STDMETHOD(RemoveNotificationType) (THIS_ REFGUID rguidNotificationType) PURE;
STDMETHOD(Clone) (THIS_ MUSIC_TIME mtStart,
MUSIC_TIME mtEnd,
IDirectMusicTrack** ppTrack) PURE;
};
/*////////////////////////////////////////////////////////////////////
// IDirectMusicTrack8 */
#undef INTERFACE
#define INTERFACE IDirectMusicTrack8
DECLARE_INTERFACE_(IDirectMusicTrack8, IDirectMusicTrack)
{
/* IUnknown */
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/* IDirectMusicTrack */
STDMETHOD(Init) (THIS_ IDirectMusicSegment* pSegment) PURE;
STDMETHOD(InitPlay) (THIS_ IDirectMusicSegmentState* pSegmentState,
IDirectMusicPerformance* pPerformance,
void** ppStateData,
DWORD dwVirtualTrackID,
DWORD dwFlags) PURE;
STDMETHOD(EndPlay) (THIS_ void* pStateData) PURE;
STDMETHOD(Play) (THIS_ void* pStateData,
MUSIC_TIME mtStart,
MUSIC_TIME mtEnd,
MUSIC_TIME mtOffset,
DWORD dwFlags,
IDirectMusicPerformance* pPerf,
IDirectMusicSegmentState* pSegSt,
DWORD dwVirtualID) PURE;
STDMETHOD(GetParam) (THIS_ REFGUID rguidType,
MUSIC_TIME mtTime,
MUSIC_TIME* pmtNext,
void* pParam) PURE;
STDMETHOD(SetParam) (THIS_ REFGUID rguidType,
MUSIC_TIME mtTime,
void* pParam) PURE;
STDMETHOD(IsParamSupported) (THIS_ REFGUID rguidType) PURE;
STDMETHOD(AddNotificationType) (THIS_ REFGUID rguidNotificationType) PURE;
STDMETHOD(RemoveNotificationType) (THIS_ REFGUID rguidNotificationType) PURE;
STDMETHOD(Clone) (THIS_ MUSIC_TIME mtStart,
MUSIC_TIME mtEnd,
IDirectMusicTrack** ppTrack) PURE;
/* IDirectMusicTrack8 */
STDMETHOD(PlayEx) (THIS_ void* pStateData,
REFERENCE_TIME rtStart,
REFERENCE_TIME rtEnd,
REFERENCE_TIME rtOffset,
DWORD dwFlags,
IDirectMusicPerformance* pPerf,
IDirectMusicSegmentState* pSegSt,
DWORD dwVirtualID) PURE;
STDMETHOD(GetParamEx) (THIS_ REFGUID rguidType, /* Command type. */
REFERENCE_TIME rtTime, /* Time, in ref time if dwFlags == DMUS_TRACK_PARAMF_CLOCK. Otherwise, music time. */
REFERENCE_TIME* prtNext, /* Time of next parameter, relative to rtTime, in music or clock time units. */
void* pParam, /* Pointer to the parameter data. */
void * pStateData, /* State data for track instance. */
DWORD dwFlags) PURE; /* Control flags. */
STDMETHOD(SetParamEx) (THIS_ REFGUID rguidType,
REFERENCE_TIME rtTime,
void* pParam, /* Pointer to the parameter data. */
void * pStateData, /* State data for track instance. */
DWORD dwFlags) PURE; /* Control flags. */
STDMETHOD(Compose) (THIS_ IUnknown* pContext, /* Context for composition */
DWORD dwTrackGroup,
IDirectMusicTrack** ppResultTrack) PURE;
STDMETHOD(Join) (THIS_ IDirectMusicTrack* pNewTrack,
MUSIC_TIME mtJoin,
IUnknown* pContext, /* Context for joining */
DWORD dwTrackGroup,
IDirectMusicTrack** ppResultTrack) PURE;
};
/* CLSID's */
DEFINE_GUID(CLSID_DirectMusicTempoTrack,0xd2ac2885, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(CLSID_DirectMusicSeqTrack,0xd2ac2886, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(CLSID_DirectMusicSysExTrack,0xd2ac2887, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(CLSID_DirectMusicTimeSigTrack,0xd2ac2888, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(CLSID_DirectMusicChordTrack,0xd2ac288b, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(CLSID_DirectMusicCommandTrack,0xd2ac288c, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(CLSID_DirectMusicStyleTrack,0xd2ac288d, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(CLSID_DirectMusicMotifTrack,0xd2ac288e, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(CLSID_DirectMusicSignPostTrack,0xf17e8672, 0xc3b4, 0x11d1, 0x87, 0xb, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(CLSID_DirectMusicBandTrack,0xd2ac2894, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(CLSID_DirectMusicChordMapTrack,0xd2ac2896, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(CLSID_DirectMusicMuteTrack,0xd2ac2898, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
/* New CLSID's for DX8 */
DEFINE_GUID(CLSID_DirectMusicScriptTrack,0x4108fa85, 0x3586, 0x11d3, 0x8b, 0xd7, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xb6); /* {4108FA85-3586-11d3-8BD7-00600893B1B6} */
DEFINE_GUID(CLSID_DirectMusicMarkerTrack,0x55a8fd00, 0x4288, 0x11d3, 0x9b, 0xd1, 0x8a, 0xd, 0x61, 0xc8, 0x88, 0x35);
DEFINE_GUID(CLSID_DirectMusicSegmentTriggerTrack, 0xbae4d665, 0x4ea1, 0x11d3, 0x8b, 0xda, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xb6); /* {BAE4D665-4EA1-11d3-8BDA-00600893B1B6} */
DEFINE_GUID(CLSID_DirectMusicLyricsTrack, 0x995c1cf5, 0x54ff, 0x11d3, 0x8b, 0xda, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xb6); /* {995C1CF5-54FF-11d3-8BDA-00600893B1B6} */
DEFINE_GUID(CLSID_DirectMusicParamControlTrack, 0x4be0537b, 0x5c19, 0x11d3, 0x8b, 0xdc, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xb6); /* {4BE0537B-5C19-11d3-8BDC-00600893B1B6} */
DEFINE_GUID(CLSID_DirectMusicWaveTrack,0xeed36461, 0x9ea5, 0x11d3, 0x9b, 0xd1, 0x0, 0x80, 0xc7, 0x15, 0xa, 0x74);
/* IID's */
DEFINE_GUID(IID_IDirectMusicTrack, 0xf96029a1, 0x4282, 0x11d2, 0x87, 0x17, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(IID_IDirectMusicTool,0xd2ac28ba, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
/* Interface IDs for DX8 */
/* changed interfaces (GUID only) */
DEFINE_GUID(IID_IDirectMusicTool8, 0xe674303, 0x3b05, 0x11d3, 0x9b, 0xd1, 0xf9, 0xe7, 0xf0, 0xa0, 0x15, 0x36);
DEFINE_GUID(IID_IDirectMusicTrack8, 0xe674304, 0x3b05, 0x11d3, 0x9b, 0xd1, 0xf9, 0xe7, 0xf0, 0xa0, 0x15, 0x36);
#ifdef __cplusplus
}; /* extern "C" */
#endif
#include <poppack.h>
#endif /* #ifndef _DMPLUGIN_ */

View File

@ -0,0 +1,41 @@
/***************************************************************************
* *
* DMusBuff.h -- This module defines the buffer format for DirectMusic *
* Shared file between user mode and kernel mode components *
* *
* Copyright (c) 1998, Microsoft Corp. All rights reserved. *
* *
***************************************************************************/
#ifndef _DMusBuff_
#define _DMusBuff_
/* Format of DirectMusic events in a buffer
*
* A buffer contains 1 or more events, each with the following header.
* Immediately following the header is the event data. The header+data
* size is rounded to the nearest quadword (8 bytes).
*/
#include <pshpack4.h> /* Do not pad at end - that's where the data is */
typedef struct _DMUS_EVENTHEADER *LPDMUS_EVENTHEADER;
typedef struct _DMUS_EVENTHEADER
{
DWORD cbEvent; /* Unrounded bytes in event */
DWORD dwChannelGroup; /* Channel group of event */
REFERENCE_TIME rtDelta; /* Delta from start time of entire buffer */
DWORD dwFlags; /* Flags DMUS_EVENT_xxx */
} DMUS_EVENTHEADER;
#include <poppack.h>
#define DMUS_EVENT_STRUCTURED 0x00000001 /* Unstructured data (SysEx, etc.) */
/* The number of bytes to allocate for an event with 'cb' data bytes.
*/
#define QWORD_ALIGN(x) (((x) + 7) & ~7)
#define DMUS_EVENT_SIZE(cb) QWORD_ALIGN(sizeof(DMUS_EVENTHEADER) + cb)
#endif /* _DMusBuff_ */

View File

@ -0,0 +1,784 @@
/************************************************************************
* *
* dmusicc.h -- This module defines the DirectMusic core API's *
* *
* Copyright (c) Microsoft Corporation. All rights reserved. *
* *
************************************************************************/
#ifndef _DMUSICC_
#define _DMUSICC_
#include <windows.h>
#define COM_NO_WINDOWS_H
#include <objbase.h>
#include <mmsystem.h>
#include "dls1.h"
#include "dmerror.h"
#include "dmdls.h"
#include "dsound.h"
#include "dmusbuff.h"
#include <pshpack8.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef ULONGLONG SAMPLE_TIME;
typedef ULONGLONG SAMPLE_POSITION;
typedef SAMPLE_TIME *LPSAMPLE_TIME;
#define DMUS_MAX_DESCRIPTION 128
#define DMUS_MAX_DRIVER 128
typedef struct _DMUS_BUFFERDESC *LPDMUS_BUFFERDESC;
typedef struct _DMUS_BUFFERDESC
{
DWORD dwSize;
DWORD dwFlags;
GUID guidBufferFormat;
DWORD cbBuffer;
} DMUS_BUFFERDESC;
/* DMUS_EFFECT_ flags are used in the dwEffectFlags fields of both DMUS_PORTCAPS
* and DMUS_PORTPARAMS.
*/
#define DMUS_EFFECT_NONE 0x00000000
#define DMUS_EFFECT_REVERB 0x00000001
#define DMUS_EFFECT_CHORUS 0x00000002
#define DMUS_EFFECT_DELAY 0x00000004
/* For DMUS_PORTCAPS dwClass
*/
#define DMUS_PC_INPUTCLASS (0)
#define DMUS_PC_OUTPUTCLASS (1)
/* For DMUS_PORTCAPS dwFlags
*/
#define DMUS_PC_DLS (0x00000001) // Supports DLS downloading and DLS level 1.
#define DMUS_PC_EXTERNAL (0x00000002) // External MIDI module.
#define DMUS_PC_SOFTWARESYNTH (0x00000004) // Software synthesizer.
#define DMUS_PC_MEMORYSIZEFIXED (0x00000008) // Memory size is fixed.
#define DMUS_PC_GMINHARDWARE (0x00000010) // GM sound set is built in, no need to download.
#define DMUS_PC_GSINHARDWARE (0x00000020) // GS sound set is built in.
#define DMUS_PC_XGINHARDWARE (0x00000040) // XG sound set is built in.
#define DMUS_PC_DIRECTSOUND (0x00000080) // Connects to DirectSound via a DirectSound buffer.
#define DMUS_PC_SHAREABLE (0x00000100) // Synth can be actively shared by multiple apps at once.
#define DMUS_PC_DLS2 (0x00000200) // Supports DLS2 instruments.
#define DMUS_PC_AUDIOPATH (0x00000400) // Multiple outputs can be connected to DirectSound for audiopaths.
#define DMUS_PC_WAVE (0x00000800) // Supports streaming and one shot waves.
#define DMUS_PC_SYSTEMMEMORY (0x7FFFFFFF) // Sample memory is system memory.
typedef struct _DMUS_PORTCAPS
{
DWORD dwSize;
DWORD dwFlags;
GUID guidPort;
DWORD dwClass;
DWORD dwType;
DWORD dwMemorySize;
DWORD dwMaxChannelGroups;
DWORD dwMaxVoices;
DWORD dwMaxAudioChannels;
DWORD dwEffectFlags;
WCHAR wszDescription[DMUS_MAX_DESCRIPTION];
} DMUS_PORTCAPS;
typedef DMUS_PORTCAPS *LPDMUS_PORTCAPS;
/* Values for DMUS_PORTCAPS dwType. This field indicates the underlying
* driver type of the port.
*/
#define DMUS_PORT_WINMM_DRIVER (0)
#define DMUS_PORT_USER_MODE_SYNTH (1)
#define DMUS_PORT_KERNEL_MODE (2)
/* These flags (set in dwValidParams) indicate which other members of the */
/* DMUS_PORTPARAMS are valid. */
/* */
#define DMUS_PORTPARAMS_VOICES 0x00000001
#define DMUS_PORTPARAMS_CHANNELGROUPS 0x00000002
#define DMUS_PORTPARAMS_AUDIOCHANNELS 0x00000004
#define DMUS_PORTPARAMS_SAMPLERATE 0x00000008
#define DMUS_PORTPARAMS_EFFECTS 0x00000020
#define DMUS_PORTPARAMS_SHARE 0x00000040
#define DMUS_PORTPARAMS_FEATURES 0x00000080 /* DirectX 8.0 and above */
typedef struct _DMUS_PORTPARAMS
{
DWORD dwSize;
DWORD dwValidParams;
DWORD dwVoices;
DWORD dwChannelGroups;
DWORD dwAudioChannels;
DWORD dwSampleRate;
DWORD dwEffectFlags;
BOOL fShare;
} DMUS_PORTPARAMS7;
typedef struct _DMUS_PORTPARAMS8
{
DWORD dwSize;
DWORD dwValidParams;
DWORD dwVoices;
DWORD dwChannelGroups;
DWORD dwAudioChannels;
DWORD dwSampleRate;
DWORD dwEffectFlags;
BOOL fShare;
DWORD dwFeatures;
} DMUS_PORTPARAMS8;
#define DMUS_PORT_FEATURE_AUDIOPATH 0x00000001 /* Supports audiopath connection to DirectSound buffers. */
#define DMUS_PORT_FEATURE_STREAMING 0x00000002 /* Supports streaming waves through the synth. */
typedef DMUS_PORTPARAMS8 DMUS_PORTPARAMS;
typedef DMUS_PORTPARAMS *LPDMUS_PORTPARAMS;
typedef struct _DMUS_SYNTHSTATS *LPDMUS_SYNTHSTATS;
typedef struct _DMUS_SYNTHSTATS8 *LPDMUS_SYNTHSTATS8;
typedef struct _DMUS_SYNTHSTATS
{
DWORD dwSize; /* Size in bytes of the structure */
DWORD dwValidStats; /* Flags indicating which fields below are valid. */
DWORD dwVoices; /* Average number of voices playing. */
DWORD dwTotalCPU; /* Total CPU usage as percent * 100. */
DWORD dwCPUPerVoice; /* CPU per voice as percent * 100. */
DWORD dwLostNotes; /* Number of notes lost in 1 second. */
DWORD dwFreeMemory; /* Free memory in bytes */
long lPeakVolume; /* Decibel level * 100. */
} DMUS_SYNTHSTATS;
typedef struct _DMUS_SYNTHSTATS8
{
DWORD dwSize; /* Size in bytes of the structure */
DWORD dwValidStats; /* Flags indicating which fields below are valid. */
DWORD dwVoices; /* Average number of voices playing. */
DWORD dwTotalCPU; /* Total CPU usage as percent * 100. */
DWORD dwCPUPerVoice; /* CPU per voice as percent * 100. */
DWORD dwLostNotes; /* Number of notes lost in 1 second. */
DWORD dwFreeMemory; /* Free memory in bytes */
long lPeakVolume; /* Decibel level * 100. */
DWORD dwSynthMemUse; /* Memory used by synth wave data */
} DMUS_SYNTHSTATS8;
#define DMUS_SYNTHSTATS_VOICES (1 << 0)
#define DMUS_SYNTHSTATS_TOTAL_CPU (1 << 1)
#define DMUS_SYNTHSTATS_CPU_PER_VOICE (1 << 2)
#define DMUS_SYNTHSTATS_LOST_NOTES (1 << 3)
#define DMUS_SYNTHSTATS_PEAK_VOLUME (1 << 4)
#define DMUS_SYNTHSTATS_FREE_MEMORY (1 << 5)
#define DMUS_SYNTHSTATS_SYSTEMMEMORY DMUS_PC_SYSTEMMEMORY
typedef struct _DMUS_WAVES_REVERB_PARAMS
{
float fInGain; /* Input gain in dB (to avoid output overflows) */
float fReverbMix; /* Reverb mix in dB. 0dB means 100% wet reverb (no direct signal)
Negative values gives less wet signal.
The coeficients are calculated so that the overall output level stays
(approximately) constant regardless of the ammount of reverb mix. */
float fReverbTime; /* The reverb decay time, in milliseconds. */
float fHighFreqRTRatio; /* The ratio of the high frequencies to the global reverb time.
Unless very 'splashy-bright' reverbs are wanted, this should be set to
a value < 1.0.
For example if dRevTime==1000ms and dHighFreqRTRatio=0.1 than the
decay time for high frequencies will be 100ms.*/
} DMUS_WAVES_REVERB_PARAMS;
/* Note: Default values for Reverb are:
fInGain = 0.0dB (no change in level)
fReverbMix = -10.0dB (a reasonable reverb mix)
fReverbTime = 1000.0ms (one second global reverb time)
fHighFreqRTRatio = 0.001 (the ratio of the high frequencies to the global reverb time)
*/
typedef enum
{
DMUS_CLOCK_SYSTEM = 0,
DMUS_CLOCK_WAVE = 1
} DMUS_CLOCKTYPE;
#define DMUS_CLOCKF_GLOBAL 0x00000001
typedef struct _DMUS_CLOCKINFO7 *LPDMUS_CLOCKINFO7;
typedef struct _DMUS_CLOCKINFO7
{
DWORD dwSize;
DMUS_CLOCKTYPE ctType;
GUID guidClock; /* Identifies this time source */
WCHAR wszDescription[DMUS_MAX_DESCRIPTION];
} DMUS_CLOCKINFO7;
typedef struct _DMUS_CLOCKINFO8 *LPDMUS_CLOCKINFO8;
typedef struct _DMUS_CLOCKINFO8
{
DWORD dwSize;
DMUS_CLOCKTYPE ctType;
GUID guidClock; /* Identifies this time source */
WCHAR wszDescription[DMUS_MAX_DESCRIPTION];
DWORD dwFlags;
} DMUS_CLOCKINFO8;
typedef DMUS_CLOCKINFO8 DMUS_CLOCKINFO;
typedef DMUS_CLOCKINFO *LPDMUS_CLOCKINFO;
/* Default bus identifiers
*
* The first 17 are direct mappings to the destinations defined in both
* the MMA DLS Level 2 specification and the Microsoft Multi-Channel audio
* specification.
*/
#define DSBUSID_FIRST_SPKR_LOC 0
#define DSBUSID_FRONT_LEFT 0
#define DSBUSID_LEFT 0 /* Front left is also just left */
#define DSBUSID_FRONT_RIGHT 1
#define DSBUSID_RIGHT 1 /* Ditto front right */
#define DSBUSID_FRONT_CENTER 2
#define DSBUSID_LOW_FREQUENCY 3
#define DSBUSID_BACK_LEFT 4
#define DSBUSID_BACK_RIGHT 5
#define DSBUSID_FRONT_LEFT_OF_CENTER 6
#define DSBUSID_FRONT_RIGHT_OF_CENTER 7
#define DSBUSID_BACK_CENTER 8
#define DSBUSID_SIDE_LEFT 9
#define DSBUSID_SIDE_RIGHT 10
#define DSBUSID_TOP_CENTER 11
#define DSBUSID_TOP_FRONT_LEFT 12
#define DSBUSID_TOP_FRONT_CENTER 13
#define DSBUSID_TOP_FRONT_RIGHT 14
#define DSBUSID_TOP_BACK_LEFT 15
#define DSBUSID_TOP_BACK_CENTER 16
#define DSBUSID_TOP_BACK_RIGHT 17
#define DSBUSID_LAST_SPKR_LOC 17
#define DSBUSID_IS_SPKR_LOC(id) ( ((id) >= DSBUSID_FIRST_SPKR_LOC) && ((id) <= DSBUSID_LAST_SPKR_LOC) )
/* These bus identifiers are for the standard DLS effect sends
*/
#define DSBUSID_REVERB_SEND 64
#define DSBUSID_CHORUS_SEND 65
/* Dynamic bus identifiers start here. See the documentation for how
* synthesizers map the output of voices to static and dynamic
* bus identifiers.
*/
#define DSBUSID_DYNAMIC_0 512
/* Null bus, used to identify busses that have no function mapping.
*/
#define DSBUSID_NULL 0xFFFFFFFF
interface IDirectMusic;
interface IDirectMusic8;
interface IDirectMusicBuffer;
interface IDirectMusicPort;
interface IDirectMusicThru;
interface IReferenceClock;
#ifndef __cplusplus
typedef interface IDirectMusic IDirectMusic;
typedef interface IDirectMusic8 IDirectMusic8;
typedef interface IDirectMusicPort IDirectMusicPort;
typedef interface IDirectMusicBuffer IDirectMusicBuffer;
typedef interface IDirectMusicThru IDirectMusicThru;
typedef interface IReferenceClock IReferenceClock;
#endif /* C++ */
typedef IDirectMusic *LPDIRECTMUSIC;
typedef IDirectMusic8 *LPDIRECTMUSIC8;
typedef IDirectMusicPort *LPDIRECTMUSICPORT;
typedef IDirectMusicBuffer *LPDIRECTMUSICBUFFER;
#undef INTERFACE
#define INTERFACE IDirectMusic
DECLARE_INTERFACE_(IDirectMusic, IUnknown)
{
/* IUnknown */
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/* IDirectMusic */
STDMETHOD(EnumPort) (THIS_ DWORD dwIndex,
LPDMUS_PORTCAPS pPortCaps) PURE;
STDMETHOD(CreateMusicBuffer) (THIS_ LPDMUS_BUFFERDESC pBufferDesc,
LPDIRECTMUSICBUFFER *ppBuffer,
LPUNKNOWN pUnkOuter) PURE;
STDMETHOD(CreatePort) (THIS_ REFCLSID rclsidPort,
LPDMUS_PORTPARAMS pPortParams,
LPDIRECTMUSICPORT *ppPort,
LPUNKNOWN pUnkOuter) PURE;
STDMETHOD(EnumMasterClock) (THIS_ DWORD dwIndex,
LPDMUS_CLOCKINFO lpClockInfo) PURE;
STDMETHOD(GetMasterClock) (THIS_ LPGUID pguidClock,
IReferenceClock **ppReferenceClock) PURE;
STDMETHOD(SetMasterClock) (THIS_ REFGUID rguidClock) PURE;
STDMETHOD(Activate) (THIS_ BOOL fEnable) PURE;
STDMETHOD(GetDefaultPort) (THIS_ LPGUID pguidPort) PURE;
STDMETHOD(SetDirectSound) (THIS_ LPDIRECTSOUND pDirectSound,
HWND hWnd) PURE;
};
#undef INTERFACE
#define INTERFACE IDirectMusic8
DECLARE_INTERFACE_(IDirectMusic8, IDirectMusic)
{
/* IUnknown */
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/* IDirectMusic */
STDMETHOD(EnumPort) (THIS_ DWORD dwIndex,
LPDMUS_PORTCAPS pPortCaps) PURE;
STDMETHOD(CreateMusicBuffer) (THIS_ LPDMUS_BUFFERDESC pBufferDesc,
LPDIRECTMUSICBUFFER *ppBuffer,
LPUNKNOWN pUnkOuter) PURE;
STDMETHOD(CreatePort) (THIS_ REFCLSID rclsidPort,
LPDMUS_PORTPARAMS pPortParams,
LPDIRECTMUSICPORT *ppPort,
LPUNKNOWN pUnkOuter) PURE;
STDMETHOD(EnumMasterClock) (THIS_ DWORD dwIndex,
LPDMUS_CLOCKINFO lpClockInfo) PURE;
STDMETHOD(GetMasterClock) (THIS_ LPGUID pguidClock,
IReferenceClock **ppReferenceClock) PURE;
STDMETHOD(SetMasterClock) (THIS_ REFGUID rguidClock) PURE;
STDMETHOD(Activate) (THIS_ BOOL fEnable) PURE;
STDMETHOD(GetDefaultPort) (THIS_ LPGUID pguidPort) PURE;
STDMETHOD(SetDirectSound) (THIS_ LPDIRECTSOUND pDirectSound,
HWND hWnd) PURE;
/* IDirectMusic8 */
STDMETHOD(SetExternalMasterClock)
(THIS_ IReferenceClock *pClock) PURE;
};
#undef INTERFACE
#define INTERFACE IDirectMusicBuffer
DECLARE_INTERFACE_(IDirectMusicBuffer, IUnknown)
{
/* IUnknown */
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/* IDirectMusicBuffer */
STDMETHOD(Flush) (THIS) PURE;
STDMETHOD(TotalTime) (THIS_ LPREFERENCE_TIME prtTime) PURE;
STDMETHOD(PackStructured) (THIS_ REFERENCE_TIME rt,
DWORD dwChannelGroup,
DWORD dwChannelMessage) PURE;
STDMETHOD(PackUnstructured) (THIS_ REFERENCE_TIME rt,
DWORD dwChannelGroup,
DWORD cb,
LPBYTE lpb) PURE;
STDMETHOD(ResetReadPtr) (THIS) PURE;
STDMETHOD(GetNextEvent) (THIS_ LPREFERENCE_TIME prt,
LPDWORD pdwChannelGroup,
LPDWORD pdwLength,
LPBYTE *ppData) PURE;
STDMETHOD(GetRawBufferPtr) (THIS_ LPBYTE *ppData) PURE;
STDMETHOD(GetStartTime) (THIS_ LPREFERENCE_TIME prt) PURE;
STDMETHOD(GetUsedBytes) (THIS_ LPDWORD pcb) PURE;
STDMETHOD(GetMaxBytes) (THIS_ LPDWORD pcb) PURE;
STDMETHOD(GetBufferFormat) (THIS_ LPGUID pGuidFormat) PURE;
STDMETHOD(SetStartTime) (THIS_ REFERENCE_TIME rt) PURE;
STDMETHOD(SetUsedBytes) (THIS_ DWORD cb) PURE;
};
typedef IDirectMusicBuffer IDirectMusicBuffer8;
typedef IDirectMusicBuffer8 *LPDIRECTMUSICBUFFER8;
#undef INTERFACE
#define INTERFACE IDirectMusicInstrument
DECLARE_INTERFACE_(IDirectMusicInstrument, IUnknown)
{
/* IUnknown */
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/* IDirectMusicInstrument */
STDMETHOD(GetPatch) (THIS_ DWORD* pdwPatch) PURE;
STDMETHOD(SetPatch) (THIS_ DWORD dwPatch) PURE;
};
typedef IDirectMusicInstrument IDirectMusicInstrument8;
typedef IDirectMusicInstrument8 *LPDIRECTMUSICINSTRUMENT8;
#undef INTERFACE
#define INTERFACE IDirectMusicDownloadedInstrument
DECLARE_INTERFACE_(IDirectMusicDownloadedInstrument, IUnknown)
{
/* IUnknown */
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/* IDirectMusicDownloadedInstrument */
/* None at this time */
};
typedef IDirectMusicDownloadedInstrument IDirectMusicDownloadedInstrument8;
typedef IDirectMusicDownloadedInstrument8 *LPDIRECTMUSICDOWNLOADEDINSTRUMENT8;
#undef INTERFACE
#define INTERFACE IDirectMusicCollection
DECLARE_INTERFACE_(IDirectMusicCollection, IUnknown)
{
/* IUnknown */
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/* IDirectMusicCollection */
STDMETHOD(GetInstrument) (THIS_ DWORD dwPatch,
IDirectMusicInstrument** ppInstrument) PURE;
STDMETHOD(EnumInstrument) (THIS_ DWORD dwIndex,
DWORD* pdwPatch,
LPWSTR pwszName,
DWORD dwNameLen) PURE;
};
typedef IDirectMusicCollection IDirectMusicCollection8;
typedef IDirectMusicCollection8 *LPDIRECTMUSICCOLLECTION8;
#undef INTERFACE
#define INTERFACE IDirectMusicDownload
DECLARE_INTERFACE_(IDirectMusicDownload , IUnknown)
{
/* IUnknown */
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/* IDirectMusicDownload */
STDMETHOD(GetBuffer) (THIS_ void** ppvBuffer,
DWORD* pdwSize) PURE;
};
typedef IDirectMusicDownload IDirectMusicDownload8;
typedef IDirectMusicDownload8 *LPDIRECTMUSICDOWNLOAD8;
#undef INTERFACE
#define INTERFACE IDirectMusicPortDownload
DECLARE_INTERFACE_(IDirectMusicPortDownload, IUnknown)
{
/* IUnknown */
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/* IDirectMusicPortDownload */
STDMETHOD(GetBuffer) (THIS_ DWORD dwDLId,
IDirectMusicDownload** ppIDMDownload) PURE;
STDMETHOD(AllocateBuffer) (THIS_ DWORD dwSize,
IDirectMusicDownload** ppIDMDownload) PURE;
STDMETHOD(GetDLId) (THIS_ DWORD* pdwStartDLId,
DWORD dwCount) PURE;
STDMETHOD(GetAppend) (THIS_ DWORD* pdwAppend) PURE;
STDMETHOD(Download) (THIS_ IDirectMusicDownload* pIDMDownload) PURE;
STDMETHOD(Unload) (THIS_ IDirectMusicDownload* pIDMDownload) PURE;
};
typedef IDirectMusicPortDownload IDirectMusicPortDownload8;
typedef IDirectMusicPortDownload8 *LPDIRECTMUSICPORTDOWNLOAD8;
/* Standard values for voice priorities. Numerically higher priorities are higher in priority.
* These priorities are used to set the voice priority for all voices on a channel. They are
* used in the dwPriority parameter of IDirectMusicPort::GetPriority and returned in the
* lpwPriority parameter of pdwPriority.
*
* These priorities are shared with DirectSound.
*/
#ifndef _DIRECTAUDIO_PRIORITIES_DEFINED_
#define _DIRECTAUDIO_PRIORITIES_DEFINED_
#define DAUD_CRITICAL_VOICE_PRIORITY (0xF0000000)
#define DAUD_HIGH_VOICE_PRIORITY (0xC0000000)
#define DAUD_STANDARD_VOICE_PRIORITY (0x80000000)
#define DAUD_LOW_VOICE_PRIORITY (0x40000000)
#define DAUD_PERSIST_VOICE_PRIORITY (0x10000000)
/* These are the default priorities assigned if not overridden. By default priorities are
* equal across channel groups (e.g. channel 5 on channel group 1 has the same priority as
* channel 5 on channel group 2).
*
* In accordance with DLS level 1, channel 10 has the highest priority, followed by 1 through 16
* except for 10.
*/
#define DAUD_CHAN1_VOICE_PRIORITY_OFFSET (0x0000000E)
#define DAUD_CHAN2_VOICE_PRIORITY_OFFSET (0x0000000D)
#define DAUD_CHAN3_VOICE_PRIORITY_OFFSET (0x0000000C)
#define DAUD_CHAN4_VOICE_PRIORITY_OFFSET (0x0000000B)
#define DAUD_CHAN5_VOICE_PRIORITY_OFFSET (0x0000000A)
#define DAUD_CHAN6_VOICE_PRIORITY_OFFSET (0x00000009)
#define DAUD_CHAN7_VOICE_PRIORITY_OFFSET (0x00000008)
#define DAUD_CHAN8_VOICE_PRIORITY_OFFSET (0x00000007)
#define DAUD_CHAN9_VOICE_PRIORITY_OFFSET (0x00000006)
#define DAUD_CHAN10_VOICE_PRIORITY_OFFSET (0x0000000F)
#define DAUD_CHAN11_VOICE_PRIORITY_OFFSET (0x00000005)
#define DAUD_CHAN12_VOICE_PRIORITY_OFFSET (0x00000004)
#define DAUD_CHAN13_VOICE_PRIORITY_OFFSET (0x00000003)
#define DAUD_CHAN14_VOICE_PRIORITY_OFFSET (0x00000002)
#define DAUD_CHAN15_VOICE_PRIORITY_OFFSET (0x00000001)
#define DAUD_CHAN16_VOICE_PRIORITY_OFFSET (0x00000000)
#define DAUD_CHAN1_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN1_VOICE_PRIORITY_OFFSET)
#define DAUD_CHAN2_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN2_VOICE_PRIORITY_OFFSET)
#define DAUD_CHAN3_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN3_VOICE_PRIORITY_OFFSET)
#define DAUD_CHAN4_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN4_VOICE_PRIORITY_OFFSET)
#define DAUD_CHAN5_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN5_VOICE_PRIORITY_OFFSET)
#define DAUD_CHAN6_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN6_VOICE_PRIORITY_OFFSET)
#define DAUD_CHAN7_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN7_VOICE_PRIORITY_OFFSET)
#define DAUD_CHAN8_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN8_VOICE_PRIORITY_OFFSET)
#define DAUD_CHAN9_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN9_VOICE_PRIORITY_OFFSET)
#define DAUD_CHAN10_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN10_VOICE_PRIORITY_OFFSET)
#define DAUD_CHAN11_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN11_VOICE_PRIORITY_OFFSET)
#define DAUD_CHAN12_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN12_VOICE_PRIORITY_OFFSET)
#define DAUD_CHAN13_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN13_VOICE_PRIORITY_OFFSET)
#define DAUD_CHAN14_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN14_VOICE_PRIORITY_OFFSET)
#define DAUD_CHAN15_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN15_VOICE_PRIORITY_OFFSET)
#define DAUD_CHAN16_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN16_VOICE_PRIORITY_OFFSET)
#endif /* _DIRECTAUDIO_PRIORITIES_DEFINED_ */
#undef INTERFACE
#define INTERFACE IDirectMusicPort
DECLARE_INTERFACE_(IDirectMusicPort, IUnknown)
{
/* IUnknown */
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/* IDirectMusicPort */
/* */
STDMETHOD(PlayBuffer) (THIS_ LPDIRECTMUSICBUFFER pBuffer) PURE;
STDMETHOD(SetReadNotificationHandle) (THIS_ HANDLE hEvent) PURE;
STDMETHOD(Read) (THIS_ LPDIRECTMUSICBUFFER pBuffer) PURE;
STDMETHOD(DownloadInstrument) (THIS_ IDirectMusicInstrument *pInstrument,
IDirectMusicDownloadedInstrument **ppDownloadedInstrument,
DMUS_NOTERANGE *pNoteRanges,
DWORD dwNumNoteRanges) PURE;
STDMETHOD(UnloadInstrument) (THIS_ IDirectMusicDownloadedInstrument *pDownloadedInstrument) PURE;
STDMETHOD(GetLatencyClock) (THIS_ IReferenceClock **ppClock) PURE;
STDMETHOD(GetRunningStats) (THIS_ LPDMUS_SYNTHSTATS pStats) PURE;
STDMETHOD(Compact) (THIS) PURE;
STDMETHOD(GetCaps) (THIS_ LPDMUS_PORTCAPS pPortCaps) PURE;
STDMETHOD(DeviceIoControl) (THIS_ DWORD dwIoControlCode,
LPVOID lpInBuffer,
DWORD nInBufferSize,
LPVOID lpOutBuffer,
DWORD nOutBufferSize,
LPDWORD lpBytesReturned,
LPOVERLAPPED lpOverlapped) PURE;
STDMETHOD(SetNumChannelGroups) (THIS_ DWORD dwChannelGroups) PURE;
STDMETHOD(GetNumChannelGroups) (THIS_ LPDWORD pdwChannelGroups) PURE;
STDMETHOD(Activate) (THIS_ BOOL fActive) PURE;
STDMETHOD(SetChannelPriority) (THIS_ DWORD dwChannelGroup, DWORD dwChannel, DWORD dwPriority) PURE;
STDMETHOD(GetChannelPriority) (THIS_ DWORD dwChannelGroup, DWORD dwChannel, LPDWORD pdwPriority) PURE;
STDMETHOD(SetDirectSound) (THIS_ LPDIRECTSOUND pDirectSound, LPDIRECTSOUNDBUFFER pDirectSoundBuffer) PURE;
STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX pWaveFormatEx, LPDWORD pdwWaveFormatExSize, LPDWORD pdwBufferSize) PURE;
};
typedef IDirectMusicPort IDirectMusicPort8;
typedef IDirectMusicPort8 *LPDIRECTMUSICPORT8;
#undef INTERFACE
#define INTERFACE IDirectMusicThru
DECLARE_INTERFACE_(IDirectMusicThru, IUnknown)
{
/* IUnknown */
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/* IDirectMusicThru
*/
STDMETHOD(ThruChannel) (THIS_ DWORD dwSourceChannelGroup,
DWORD dwSourceChannel,
DWORD dwDestinationChannelGroup,
DWORD dwDestinationChannel,
LPDIRECTMUSICPORT pDestinationPort) PURE;
};
typedef IDirectMusicThru IDirectMusicThru8;
typedef IDirectMusicThru8 *LPDIRECTMUSICTHRU8;
#ifndef __IReferenceClock_INTERFACE_DEFINED__
#define __IReferenceClock_INTERFACE_DEFINED__
DEFINE_GUID(IID_IReferenceClock,0x56a86897,0x0ad4,0x11ce,0xb0,0x3a,0x00,0x20,0xaf,0x0b,0xa7,0x70);
#undef INTERFACE
#define INTERFACE IReferenceClock
DECLARE_INTERFACE_(IReferenceClock, IUnknown)
{
/* IUnknown */
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/* IReferenceClock */
/* */
/* get the time now */
STDMETHOD(GetTime) (THIS_ REFERENCE_TIME *pTime) PURE;
/* ask for an async notification that a time has elapsed */
STDMETHOD(AdviseTime) (THIS_ REFERENCE_TIME baseTime, /* base time */
REFERENCE_TIME streamTime, /* stream offset time */
HANDLE hEvent, /* advise via this event */
DWORD * pdwAdviseCookie) PURE; /* where your cookie goes */
/* ask for an async periodic notification that a time has elapsed */
STDMETHOD(AdvisePeriodic) (THIS_ REFERENCE_TIME startTime, /* starting at this time */
REFERENCE_TIME periodTime, /* time between notifications */
HANDLE hSemaphore, /* advise via a semaphore */
DWORD * pdwAdviseCookie) PURE; /* where your cookie goes */
/* cancel a request for notification */
STDMETHOD(Unadvise) (THIS_ DWORD dwAdviseCookie) PURE;
};
#endif /* __IReferenceClock_INTERFACE_DEFINED__ */
DEFINE_GUID(CLSID_DirectMusic,0x636b9f10,0x0c7d,0x11d1,0x95,0xb2,0x00,0x20,0xaf,0xdc,0x74,0x21);
DEFINE_GUID(CLSID_DirectMusicCollection,0x480ff4b0, 0x28b2, 0x11d1, 0xbe, 0xf7, 0x0, 0xc0, 0x4f, 0xbf, 0x8f, 0xef);
DEFINE_GUID(CLSID_DirectMusicSynth,0x58C2B4D0,0x46E7,0x11D1,0x89,0xAC,0x00,0xA0,0xC9,0x05,0x41,0x29);
DEFINE_GUID(IID_IDirectMusic,0x6536115a,0x7b2d,0x11d2,0xba,0x18,0x00,0x00,0xf8,0x75,0xac,0x12);
DEFINE_GUID(IID_IDirectMusicBuffer,0xd2ac2878, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(IID_IDirectMusicPort, 0x08f2d8c9,0x37c2,0x11d2,0xb9,0xf9,0x00,0x00,0xf8,0x75,0xac,0x12);
DEFINE_GUID(IID_IDirectMusicThru, 0xced153e7, 0x3606, 0x11d2, 0xb9, 0xf9, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
DEFINE_GUID(IID_IDirectMusicPortDownload,0xd2ac287a, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(IID_IDirectMusicDownload,0xd2ac287b, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(IID_IDirectMusicCollection,0xd2ac287c, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(IID_IDirectMusicInstrument,0xd2ac287d, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(IID_IDirectMusicDownloadedInstrument,0xd2ac287e, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
/* Alternate interface ID for IID_IDirectMusic, available in DX7 release and after. */
DEFINE_GUID(IID_IDirectMusic2,0x6fc2cae1, 0xbc78, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
DEFINE_GUID(IID_IDirectMusic8,0x2d3629f7,0x813d,0x4939,0x85,0x08,0xf0,0x5c,0x6b,0x75,0xfd,0x97);
#define IID_IDirectMusicThru8 IID_IDirectMusicThru
#define IID_IDirectMusicPortDownload8 IID_IDirectMusicPortDownload
#define IID_IDirectMusicDownload8 IID_IDirectMusicDownload
#define IID_IDirectMusicCollection8 IID_IDirectMusicCollection
#define IID_IDirectMusicInstrument8 IID_IDirectMusicInstrument
#define IID_IDirectMusicDownloadedInstrument8 IID_IDirectMusicDownloadedInstrument
#define IID_IDirectMusicPort8 IID_IDirectMusicPort
/* Property Query GUID_DMUS_PROP_GM_Hardware - Local GM set, no need to download
* Property Query GUID_DMUS_PROP_GS_Hardware - Local GS set, no need to download
* Property Query GUID_DMUS_PROP_XG_Hardware - Local XG set, no need to download
* Property Query GUID_DMUS_PROP_DLS1 - Support DLS level 1
* Property Query GUID_DMUS_PROP_INSTRUMENT2 - Support new INSTRUMENT2 download format
* Property Query GUID_DMUS_PROP_XG_Capable - Support minimum requirements of XG
* Property Query GUID_DMUS_PROP_GS_Capable - Support minimum requirements of GS
* Property Query GUID_DMUS_PROP_SynthSink_DSOUND - Synthsink talks to DirectSound
* Property Query GUID_DMUS_PROP_SynthSink_WAVE - Synthsink talks to Wave device
*
* Item 0: Supported
* Returns a DWORD which is non-zero if the feature is supported
*/
DEFINE_GUID(GUID_DMUS_PROP_GM_Hardware, 0x178f2f24, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
DEFINE_GUID(GUID_DMUS_PROP_GS_Hardware, 0x178f2f25, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
DEFINE_GUID(GUID_DMUS_PROP_XG_Hardware, 0x178f2f26, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
DEFINE_GUID(GUID_DMUS_PROP_XG_Capable, 0x6496aba1, 0x61b0, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
DEFINE_GUID(GUID_DMUS_PROP_GS_Capable, 0x6496aba2, 0x61b0, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
DEFINE_GUID(GUID_DMUS_PROP_DLS1, 0x178f2f27, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
DEFINE_GUID(GUID_DMUS_PROP_DLS2, 0xf14599e5, 0x4689, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
DEFINE_GUID(GUID_DMUS_PROP_INSTRUMENT2, 0x865fd372, 0x9f67, 0x11d2, 0x87, 0x2a, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(GUID_DMUS_PROP_SynthSink_DSOUND,0xaa97844, 0xc877, 0x11d1, 0x87, 0xc, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(GUID_DMUS_PROP_SynthSink_WAVE,0xaa97845, 0xc877, 0x11d1, 0x87, 0xc, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
DEFINE_GUID(GUID_DMUS_PROP_SampleMemorySize, 0x178f2f28, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
DEFINE_GUID(GUID_DMUS_PROP_SamplePlaybackRate, 0x2a91f713, 0xa4bf, 0x11d2, 0xbb, 0xdf, 0x0, 0x60, 0x8, 0x33, 0xdb, 0xd8);
/* Property Get/Set GUID_DMUS_PROP_WriteLatency
*
* Item 0: Synth buffer write latency, in milliseconds
* Get/Set SynthSink latency, the average time after the play head that the next buffer gets written.
*/
DEFINE_GUID(GUID_DMUS_PROP_WriteLatency,0x268a0fa0, 0x60f2, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
/* Property Get/Set GUID_DMUS_PROP_WritePeriod
*
* Item 0: Synth buffer write period, in milliseconds
* Get/Set SynthSink buffer write period, time span between successive writes.
*/
DEFINE_GUID(GUID_DMUS_PROP_WritePeriod,0x268a0fa1, 0x60f2, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
/* Property Get GUID_DMUS_PROP_MemorySize
*
* Item 0: Memory size
* Returns a DWORD containing the total number of bytes of sample RAM
*/
DEFINE_GUID(GUID_DMUS_PROP_MemorySize, 0x178f2f28, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
/* Property Set GUID_DMUS_PROP_WavesReverb
*
* Item 0: DMUS_WAVES_REVERB structure
* Sets reverb parameters
*/
DEFINE_GUID(GUID_DMUS_PROP_WavesReverb,0x4cb5622, 0x32e5, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
/* Property Set GUID_DMUS_PROP_Effects
*
* Item 0: DWORD with effects flags.
* Get/Set effects bits, same as dwEffectFlags in DMUS_PORTPARAMS and DMUS_PORTCAPS:
* DMUS_EFFECT_NONE
* DMUS_EFFECT_REVERB
* DMUS_EFFECT_CHORUS
*/
DEFINE_GUID(GUID_DMUS_PROP_Effects, 0xcda8d611, 0x684a, 0x11d2, 0x87, 0x1e, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
/* Property Set GUID_DMUS_PROP_LegacyCaps
*
* Item 0: The MIDINCAPS or MIDIOUTCAPS which describes the port's underlying WinMM device. This property is only supported
* by ports which wrap WinMM devices.
*/
DEFINE_GUID(GUID_DMUS_PROP_LegacyCaps,0xcfa7cdc2, 0x00a1, 0x11d2, 0xaa, 0xd5, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
/* Property Set GUID_DMUS_PROP_Volume
*
* Item 0: A long which contains an offset, in 1/100 dB, to be added to the final volume
*
*/
DEFINE_GUID(GUID_DMUS_PROP_Volume, 0xfedfae25L, 0xe46e, 0x11d1, 0xaa, 0xce, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
/* Min and Max values for setting volume with GUID_DMUS_PROP_Volume */
#define DMUS_VOLUME_MAX 2000 /* +20 dB */
#define DMUS_VOLUME_MIN -20000 /* -200 dB */
#ifdef __cplusplus
}; /* extern "C" */
#endif
#include <poppack.h>
#endif /* #ifndef _DMUSICC_ */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,193 @@
/************************************************************************
* *
* dmusics.h -- Definitions for created a DirectMusic software synth *
* *
* Copyright (c) Microsoft Corporation. All rights reserved. *
* *
************************************************************************/
#ifndef _DMUSICS_
#define _DMUSICS_
#include "dmusicc.h"
/* Software synths are enumerated from under this registry key.
*/
#define REGSTR_PATH_SOFTWARESYNTHS "Software\\Microsoft\\DirectMusic\\SoftwareSynths"
interface IDirectMusicSynth;
interface IDirectMusicSynthSink;
#ifndef __cplusplus
typedef interface IDirectMusicSynth IDirectMusicSynth;
typedef interface IDirectMusicSynthSink IDirectMusicSynthSink;
#endif
#ifndef _DMUS_VOICE_STATE_DEFINED
#define _DMUS_VOICE_STATE_DEFINED
typedef struct _DMUS_VOICE_STATE
{
BOOL bExists;
SAMPLE_POSITION spPosition;
} DMUS_VOICE_STATE;
#endif /* _DMUS_VOICE_STATE_DEFINED */
/* IDirectMusicSynth::Refresh
*
* This is the last buffer of the stream. It may be a partial block.
*/
#define REFRESH_F_LASTBUFFER 0x00000001
#undef INTERFACE
#define INTERFACE IDirectMusicSynth
DECLARE_INTERFACE_(IDirectMusicSynth, IUnknown)
{
/* IUnknown */
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/* IDirectMusicSynth */
STDMETHOD(Open) (THIS_ LPDMUS_PORTPARAMS pPortParams) PURE;
STDMETHOD(Close) (THIS) PURE;
STDMETHOD(SetNumChannelGroups) (THIS_ DWORD dwGroups) PURE;
STDMETHOD(Download) (THIS_ LPHANDLE phDownload,
LPVOID pvData,
LPBOOL pbFree ) PURE;
STDMETHOD(Unload) (THIS_ HANDLE hDownload,
HRESULT ( CALLBACK *lpFreeHandle)(HANDLE,HANDLE),
HANDLE hUserData ) PURE;
STDMETHOD(PlayBuffer) (THIS_ REFERENCE_TIME rt,
LPBYTE pbBuffer,
DWORD cbBuffer) PURE;
STDMETHOD(GetRunningStats) (THIS_ LPDMUS_SYNTHSTATS pStats) PURE;
STDMETHOD(GetPortCaps) (THIS_ LPDMUS_PORTCAPS pCaps) PURE;
STDMETHOD(SetMasterClock) (THIS_ IReferenceClock *pClock) PURE;
STDMETHOD(GetLatencyClock) (THIS_ IReferenceClock **ppClock) PURE;
STDMETHOD(Activate) (THIS_ BOOL fEnable) PURE;
STDMETHOD(SetSynthSink) (THIS_ IDirectMusicSynthSink *pSynthSink) PURE;
STDMETHOD(Render) (THIS_ short *pBuffer,
DWORD dwLength,
LONGLONG llPosition) PURE;
STDMETHOD(SetChannelPriority) (THIS_ DWORD dwChannelGroup,
DWORD dwChannel,
DWORD dwPriority) PURE;
STDMETHOD(GetChannelPriority) (THIS_ DWORD dwChannelGroup,
DWORD dwChannel,
LPDWORD pdwPriority) PURE;
STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX pWaveFormatEx,
LPDWORD pdwWaveFormatExSize) PURE;
STDMETHOD(GetAppend) (THIS_ DWORD* pdwAppend) PURE;
};
#undef INTERFACE
#define INTERFACE IDirectMusicSynth8
DECLARE_INTERFACE_(IDirectMusicSynth8, IDirectMusicSynth)
{
/* IUnknown */
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/* IDirectMusicSynth */
STDMETHOD(Open) (THIS_ LPDMUS_PORTPARAMS pPortParams) PURE;
STDMETHOD(Close) (THIS) PURE;
STDMETHOD(SetNumChannelGroups) (THIS_ DWORD dwGroups) PURE;
STDMETHOD(Download) (THIS_ LPHANDLE phDownload,
LPVOID pvData,
LPBOOL pbFree ) PURE;
STDMETHOD(Unload) (THIS_ HANDLE hDownload,
HRESULT ( CALLBACK *lpFreeHandle)(HANDLE,HANDLE),
HANDLE hUserData ) PURE;
STDMETHOD(PlayBuffer) (THIS_ REFERENCE_TIME rt,
LPBYTE pbBuffer,
DWORD cbBuffer) PURE;
STDMETHOD(GetRunningStats) (THIS_ LPDMUS_SYNTHSTATS pStats) PURE;
STDMETHOD(GetPortCaps) (THIS_ LPDMUS_PORTCAPS pCaps) PURE;
STDMETHOD(SetMasterClock) (THIS_ IReferenceClock *pClock) PURE;
STDMETHOD(GetLatencyClock) (THIS_ IReferenceClock **ppClock) PURE;
STDMETHOD(Activate) (THIS_ BOOL fEnable) PURE;
STDMETHOD(SetSynthSink) (THIS_ IDirectMusicSynthSink *pSynthSink) PURE;
STDMETHOD(Render) (THIS_ short *pBuffer,
DWORD dwLength,
LONGLONG llPosition) PURE;
STDMETHOD(SetChannelPriority) (THIS_ DWORD dwChannelGroup,
DWORD dwChannel,
DWORD dwPriority) PURE;
STDMETHOD(GetChannelPriority) (THIS_ DWORD dwChannelGroup,
DWORD dwChannel,
LPDWORD pdwPriority) PURE;
STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX pWaveFormatEx,
LPDWORD pdwWaveFormatExSize) PURE;
STDMETHOD(GetAppend) (THIS_ DWORD* pdwAppend) PURE;
/* IDirectMusicSynth8 */
STDMETHOD(PlayVoice) (THIS_ REFERENCE_TIME rt,
DWORD dwVoiceId,
DWORD dwChannelGroup,
DWORD dwChannel,
DWORD dwDLId,
long prPitch, /* PREL not defined here */
long vrVolume, /* VREL not defined here */
SAMPLE_TIME stVoiceStart,
SAMPLE_TIME stLoopStart,
SAMPLE_TIME stLoopEnd) PURE;
STDMETHOD(StopVoice) (THIS_ REFERENCE_TIME rt,
DWORD dwVoiceId ) PURE;
STDMETHOD(GetVoiceState) (THIS_ DWORD dwVoice[],
DWORD cbVoice,
DMUS_VOICE_STATE dwVoiceState[] ) PURE;
STDMETHOD(Refresh) (THIS_ DWORD dwDownloadID,
DWORD dwFlags) PURE;
STDMETHOD(AssignChannelToBuses) (THIS_ DWORD dwChannelGroup,
DWORD dwChannel,
LPDWORD pdwBuses,
DWORD cBuses) PURE;
};
#undef INTERFACE
#define INTERFACE IDirectMusicSynthSink
DECLARE_INTERFACE_(IDirectMusicSynthSink, IUnknown)
{
/* IUnknown */
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/* IDirectMusicSynthSink */
STDMETHOD(Init) (THIS_ IDirectMusicSynth *pSynth) PURE;
STDMETHOD(SetMasterClock) (THIS_ IReferenceClock *pClock) PURE;
STDMETHOD(GetLatencyClock) (THIS_ IReferenceClock **ppClock) PURE;
STDMETHOD(Activate) (THIS_ BOOL fEnable) PURE;
STDMETHOD(SampleToRefTime) (THIS_ LONGLONG llSampleTime,
REFERENCE_TIME *prfTime) PURE;
STDMETHOD(RefTimeToSample) (THIS_ REFERENCE_TIME rfTime,
LONGLONG *pllSampleTime) PURE;
STDMETHOD(SetDirectSound) (THIS_ LPDIRECTSOUND pDirectSound,
LPDIRECTSOUNDBUFFER pDirectSoundBuffer) PURE;
STDMETHOD(GetDesiredBufferSize) (THIS_ LPDWORD pdwBufferSizeInSamples) PURE;
};
DEFINE_GUID(IID_IDirectMusicSynth, 0x9823661, 0x5c85, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
DEFINE_GUID(IID_IDirectMusicSynth8,0x53cab625, 0x2711, 0x4c9f, 0x9d, 0xe7, 0x1b, 0x7f, 0x92, 0x5f, 0x6f, 0xc8);
DEFINE_GUID(IID_IDirectMusicSynthSink,0x9823663, 0x5c85, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
/* Property Set GUID_DMUS_PROP_SetSynthSink
*
* Item 0: An IUnknown on which the port can QueryInterface for a user-mode synth sink.
*/
DEFINE_GUID(GUID_DMUS_PROP_SetSynthSink,0x0a3a5ba5, 0x37b6, 0x11d2, 0xb9, 0xf9, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
/* Property Set GUID_DMUS_PROP_SinkUsesDSound
*
* Item 0: A DWORD boolean indicating whether or not the sink requires an IDirectSound interface. The
* default is FALSE if this property item is not implemented by the sink.
*/
DEFINE_GUID(GUID_DMUS_PROP_SinkUsesDSound, 0xbe208857, 0x8952, 0x11d2, 0xba, 0x1c, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
#endif

View File

@ -0,0 +1,392 @@
/*==========================================================================;
*
* Copyright (C) 2000-2002 Microsoft Corporation. All Rights Reserved.
*
* File: dpaddr.h
* Content: DirectPlayAddress include file
***************************************************************************/
#ifndef __DIRECTPLAYADDRESS__
#define __DIRECTPLAYADDRESS__
#include <ole2.h> // for DECLARE_INTERFACE_ and HRESULT
#ifdef __cplusplus
extern "C" {
#endif
#include "dplay8.h"
/****************************************************************************
*
* DirectPlay8Address CLSIDs
*
****************************************************************************/
// {934A9523-A3CA-4bc5-ADA0-D6D95D979421}
DEFINE_GUID(CLSID_DirectPlay8Address,
0x934a9523, 0xa3ca, 0x4bc5, 0xad, 0xa0, 0xd6, 0xd9, 0x5d, 0x97, 0x94, 0x21);
/****************************************************************************
*
* DirectPlay8Address Interface IIDs
*
****************************************************************************/
typedef REFIID DPNAREFIID;
// {83783300-4063-4c8a-9DB3-82830A7FEB31}
DEFINE_GUID(IID_IDirectPlay8Address,
0x83783300, 0x4063, 0x4c8a, 0x9d, 0xb3, 0x82, 0x83, 0xa, 0x7f, 0xeb, 0x31);
// {E5A0E990-2BAD-430b-87DA-A142CF75DE58}
DEFINE_GUID(IID_IDirectPlay8AddressIP,
0xe5a0e990, 0x2bad, 0x430b, 0x87, 0xda, 0xa1, 0x42, 0xcf, 0x75, 0xde, 0x58);
/****************************************************************************
*
* DirectPlay8Address Interface Pointer definitions
*
****************************************************************************/
typedef struct IDirectPlay8Address *PDIRECTPLAY8ADDRESS, *LPDIRECTPLAY8ADDRESS;
typedef struct IDirectPlay8AddressIP *PDIRECTPLAY8ADDRESSIP, *LPDIRECTPLAY8ADDRESSIP;
/****************************************************************************
*
* DirectPlay8Address Forward Declarations For External Types
*
****************************************************************************/
typedef struct sockaddr SOCKADDR;
/****************************************************************************
*
* DirectPlay8Address Constants
*
****************************************************************************/
//
// Asynchronous operation flags
//
#define DPNA_DATATYPE_STRING 0x00000001
#define DPNA_DATATYPE_DWORD 0x00000002
#define DPNA_DATATYPE_GUID 0x00000003
#define DPNA_DATATYPE_BINARY 0x00000004
#define DPNA_DATATYPE_STRING_ANSI 0x00000005
#define DPNA_DPNSVR_PORT 6073
#define DPNA_INDEX_INVALID 0xFFFFFFFF
/****************************************************************************
*
* DirectPlay8Address Address Elements
*
****************************************************************************/
#define DPNA_SEPARATOR_KEYVALUE L'='
#define DPNA_SEPARATOR_USERDATA L'#'
#define DPNA_SEPARATOR_COMPONENT L';'
#define DPNA_ESCAPECHAR L'%'
// Header
#define DPNA_HEADER L"x-directplay:/"
// key names for address components
#define DPNA_KEY_NAT_RESOLVER L"natresolver"
#define DPNA_KEY_NAT_RESOLVER_USER_STRING L"natresolveruserstring"
#define DPNA_KEY_APPLICATION_INSTANCE L"applicationinstance"
#define DPNA_KEY_DEVICE L"device"
#define DPNA_KEY_HOSTNAME L"hostname"
#define DPNA_KEY_PORT L"port"
#define DPNA_KEY_NAMEINFO L"nameinfo"
#define DPNA_KEY_PROCESSOR L"processor"
#define DPNA_KEY_PROGRAM L"program"
#define DPNA_KEY_PROVIDER L"provider"
#define DPNA_KEY_SCOPE L"scope"
#define DPNA_KEY_TRAVERSALMODE L"traversalmode"
#define DPNA_KEY_BAUD L"baud"
#define DPNA_KEY_FLOWCONTROL L"flowcontrol"
#define DPNA_KEY_PARITY L"parity"
#define DPNA_KEY_PHONENUMBER L"phonenumber"
#define DPNA_KEY_STOPBITS L"stopbits"
// values for baud rate
#define DPNA_BAUD_RATE_9600 9600
#define DPNA_BAUD_RATE_14400 14400
#define DPNA_BAUD_RATE_19200 19200
#define DPNA_BAUD_RATE_38400 38400
#define DPNA_BAUD_RATE_56000 56000
#define DPNA_BAUD_RATE_57600 57600
#define DPNA_BAUD_RATE_115200 115200
// values for stop bits
#define DPNA_STOP_BITS_ONE L"1"
#define DPNA_STOP_BITS_ONE_FIVE L"1.5"
#define DPNA_STOP_BITS_TWO L"2"
// values for parity
#define DPNA_PARITY_NONE L"NONE"
#define DPNA_PARITY_EVEN L"EVEN"
#define DPNA_PARITY_ODD L"ODD"
#define DPNA_PARITY_MARK L"MARK"
#define DPNA_PARITY_SPACE L"SPACE"
// values for flow control
#define DPNA_FLOW_CONTROL_NONE L"NONE"
#define DPNA_FLOW_CONTROL_XONXOFF L"XONXOFF"
#define DPNA_FLOW_CONTROL_RTS L"RTS"
#define DPNA_FLOW_CONTROL_DTR L"DTR"
#define DPNA_FLOW_CONTROL_RTSDTR L"RTSDTR"
// values for traversal mode
#define DPNA_TRAVERSALMODE_NONE 0
#define DPNA_TRAVERSALMODE_PORTREQUIRED 1
#define DPNA_TRAVERSALMODE_PORTRECOMMENDED 2
// Shortcut values
//
// These can be used instead of the corresponding CLSID_DP8SP_XXXX guids
//
#define DPNA_VALUE_TCPIPPROVIDER L"IP"
#define DPNA_VALUE_IPXPROVIDER L"IPX"
#define DPNA_VALUE_MODEMPROVIDER L"MODEM"
#define DPNA_VALUE_SERIALPROVIDER L"SERIAL"
//// ANSI DEFINITIONS
// Header
#define DPNA_HEADER_A "x-directplay:/"
#define DPNA_SEPARATOR_KEYVALUE_A '='
#define DPNA_SEPARATOR_USERDATA_A '#'
#define DPNA_SEPARATOR_COMPONENT_A ';'
#define DPNA_ESCAPECHAR_A '%'
// key names for address components
#define DPNA_KEY_NAT_RESOLVER_A "natresolver"
#define DPNA_KEY_NAT_RESOLVER_USER_STRING_A "natresolveruserstring"
#define DPNA_KEY_APPLICATION_INSTANCE_A "applicationinstance"
#define DPNA_KEY_DEVICE_A "device"
#define DPNA_KEY_HOSTNAME_A "hostname"
#define DPNA_KEY_PORT_A "port"
#define DPNA_KEY_NAMEINFO_A "nameinfo"
#define DPNA_KEY_PROCESSOR_A "processor"
#define DPNA_KEY_PROGRAM_A "program"
#define DPNA_KEY_PROVIDER_A "provider"
#define DPNA_KEY_SCOPE_A "scope"
#define DPNA_KEY_TRAVERSALMODE_A "traversalmode"
#define DPNA_KEY_BAUD_A "baud"
#define DPNA_KEY_FLOWCONTROL_A "flowcontrol"
#define DPNA_KEY_PARITY_A "parity"
#define DPNA_KEY_PHONENUMBER_A "phonenumber"
#define DPNA_KEY_STOPBITS_A "stopbits"
// values for stop bits
#define DPNA_STOP_BITS_ONE_A "1"
#define DPNA_STOP_BITS_ONE_FIVE_A "1.5"
#define DPNA_STOP_BITS_TWO_A "2"
// values for parity
#define DPNA_PARITY_NONE_A "NONE"
#define DPNA_PARITY_EVEN_A "EVEN"
#define DPNA_PARITY_ODD_A "ODD"
#define DPNA_PARITY_MARK_A "MARK"
#define DPNA_PARITY_SPACE_A "SPACE"
// values for flow control
#define DPNA_FLOW_CONTROL_NONE_A "NONE"
#define DPNA_FLOW_CONTROL_XONXOFF_A "XONXOFF"
#define DPNA_FLOW_CONTROL_RTS_A "RTS"
#define DPNA_FLOW_CONTROL_DTR_A "DTR"
#define DPNA_FLOW_CONTROL_RTSDTR_A "RTSDTR"
// Shortcut values
//
// These can be used instead of the corresponding CLSID_DP8SP_XXXX guids
//
#define DPNA_VALUE_TCPIPPROVIDER_A "IP"
#define DPNA_VALUE_IPXPROVIDER_A "IPX"
#define DPNA_VALUE_MODEMPROVIDER_A "MODEM"
#define DPNA_VALUE_SERIALPROVIDER_A "SERIAL"
/****************************************************************************
*
* DirectPlay8Address Functions
*
****************************************************************************/
/*
*
* This function is no longer supported. It is recommended that CoCreateInstance be used to create
* DirectPlay8 address objects.
*
* HRESULT WINAPI DirectPlay8AddressCreate( const GUID * pcIID, void **ppvInterface, IUnknown *pUnknown);
*
*/
/****************************************************************************
*
* DirectPlay8Address Application Interfaces
*
****************************************************************************/
//
// COM definition for IDirectPlay8Address Generic Interface
//
#undef INTERFACE // External COM Implementation
#define INTERFACE IDirectPlay8Address
DECLARE_INTERFACE_(IDirectPlay8Address,IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD(QueryInterface) (THIS_ DPNAREFIID, LPVOID *) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/*** IDirectPlay8Address methods ***/
STDMETHOD(BuildFromURLW)(THIS_ WCHAR *pwszSourceURL ) PURE;
STDMETHOD(BuildFromURLA)(THIS_ CHAR *pszSourceURL ) PURE;
STDMETHOD(Duplicate)(THIS_ PDIRECTPLAY8ADDRESS *ppdpaNewAddress ) PURE;
STDMETHOD(SetEqual)(THIS_ PDIRECTPLAY8ADDRESS pdpaAddress ) PURE;
STDMETHOD(IsEqual)(THIS_ PDIRECTPLAY8ADDRESS pdpaAddress ) PURE;
STDMETHOD(Clear)(THIS ) PURE;
STDMETHOD(GetURLW)(THIS_ WCHAR *pwszURL, PDWORD pdwNumChars ) PURE;
STDMETHOD(GetURLA)(THIS_ CHAR *pszURL, PDWORD pdwNumChars) PURE;
STDMETHOD(GetSP)(THIS_ GUID *pguidSP ) PURE;
STDMETHOD(GetUserData)(THIS_ void *pvUserData, PDWORD pdwBufferSize) PURE;
STDMETHOD(SetSP)(THIS_ const GUID * const pguidSP ) PURE;
STDMETHOD(SetUserData)(THIS_ const void * const pvUserData, const DWORD dwDataSize) PURE;
STDMETHOD(GetNumComponents)(THIS_ PDWORD pdwNumComponents ) PURE;
STDMETHOD(GetComponentByName)(THIS_ const WCHAR * const pwszName, void *pvBuffer, PDWORD pdwBufferSize, PDWORD pdwDataType ) PURE;
STDMETHOD(GetComponentByIndex)(THIS_ const DWORD dwComponentID, WCHAR * pwszName, PDWORD pdwNameLen, void *pvBuffer, PDWORD pdwBufferSize, PDWORD pdwDataType ) PURE;
STDMETHOD(AddComponent)(THIS_ const WCHAR * const pwszName, const void * const lpvData, const DWORD dwDataSize, const DWORD dwDataType ) PURE;
STDMETHOD(GetDevice)(THIS_ GUID * ) PURE;
STDMETHOD(SetDevice)(THIS_ const GUID * const) PURE;
STDMETHOD(BuildFromDPADDRESS)( THIS_ LPVOID pvAddress, DWORD dwDataSize ) PURE;
};
//
// COM definition for IDirectPlay8AddressIP Generic Interface
//
#undef INTERFACE // External COM Implementation
#define INTERFACE IDirectPlay8AddressIP
DECLARE_INTERFACE_(IDirectPlay8AddressIP,IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD(QueryInterface) (THIS_ DPNAREFIID, PVOID *) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/*** IDirectPlay8AddressIP methods ***/
// Constructs a IDirectPlay8 TCP Address from a SOCKADDR structure
STDMETHOD(BuildFromSockAddr)(THIS_ const SOCKADDR * const ) PURE;
// Constructs a TCP Address from a string (hostname) and port
STDMETHOD(BuildAddress)(THIS_ const WCHAR * const wszAddress, const USHORT usPort ) PURE;
// Builds a local TCP Address
STDMETHOD(BuildLocalAddress)(THIS_ const GUID * const pguidAdapter, const USHORT usPort ) PURE;
// Gets the address from the structure in SOCKADR format
STDMETHOD(GetSockAddress)(THIS_ SOCKADDR *, PDWORD ) PURE;
// Gets the local afddress
STDMETHOD(GetLocalAddress)(THIS_ GUID *pguidAdapter, USHORT *pusPort ) PURE;
// Gets the remote address
STDMETHOD(GetAddress)(THIS_ WCHAR *wszAddress, PDWORD pdwAddressLength, USHORT *psPort ) PURE;
};
/****************************************************************************
*
* IDirectPlay8 application interface macros
*
****************************************************************************/
#if !defined(__cplusplus) || defined(CINTERFACE)
#define IDirectPlay8Address_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectPlay8Address_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirectPlay8Address_Release(p) (p)->lpVtbl->Release(p)
#define IDirectPlay8Address_BuildFromURLW(p,a) (p)->lpVtbl->BuildFromURLW(p,a)
#define IDirectPlay8Address_BuildFromURLA(p,a) (p)->lpVtbl->BuildFromURLA(p,a)
#define IDirectPlay8Address_Duplicate(p,a) (p)->lpVtbl->Duplicate(p,a)
#define IDirectPlay8Address_SetEqual(p,a) (p)->lpVtbl->SetEqual(p,a)
#define IDirectPlay8Address_IsEqual(p,a) (p)->lpVtbl->IsEqual(p,a)
#define IDirectPlay8Address_Clear(p) (p)->lpVtbl->Clear(p)
#define IDirectPlay8Address_GetURLW(p,a,b) (p)->lpVtbl->GetURLW(p,a,b)
#define IDirectPlay8Address_GetURLA(p,a,b) (p)->lpVtbl->GetURLA(p,a,b)
#define IDirectPlay8Address_GetSP(p,a) (p)->lpVtbl->GetSP(p,a)
#define IDirectPlay8Address_GetUserData(p,a,b) (p)->lpVtbl->GetUserData(p,a,b)
#define IDirectPlay8Address_SetSP(p,a) (p)->lpVtbl->SetSP(p,a)
#define IDirectPlay8Address_SetUserData(p,a,b) (p)->lpVtbl->SetUserData(p,a,b)
#define IDirectPlay8Address_GetNumComponents(p,a) (p)->lpVtbl->GetNumComponents(p,a)
#define IDirectPlay8Address_GetComponentByName(p,a,b,c,d) (p)->lpVtbl->GetComponentByName(p,a,b,c,d)
#define IDirectPlay8Address_GetComponentByIndex(p,a,b,c,d,e,f) (p)->lpVtbl->GetComponentByIndex(p,a,b,c,d,e,f)
#define IDirectPlay8Address_AddComponent(p,a,b,c,d) (p)->lpVtbl->AddComponent(p,a,b,c,d)
#define IDirectPlay8Address_SetDevice(p,a) (p)->lpVtbl->SetDevice(p,a)
#define IDirectPlay8Address_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a)
#define IDirectPlay8Address_BuildFromDirectPlay4Address(p,a,b) (p)->lpVtbl->BuildFromDirectPlay4Address(p,a,b)
#define IDirectPlay8AddressIP_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectPlay8AddressIP_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirectPlay8AddressIP_Release(p) (p)->lpVtbl->Release(p)
#define IDirectPlay8AddressIP_BuildFromSockAddr(p,a) (p)->lpVtbl->BuildFromSockAddr(p,a)
#define IDirectPlay8AddressIP_BuildAddress(p,a,b) (p)->lpVtbl->BuildAddress(p,a,b)
#define IDirectPlay8AddressIP_BuildLocalAddress(p,a,b) (p)->lpVtbl->BuildLocalAddress(p,a,b)
#define IDirectPlay8AddressIP_GetSockAddress(p,a,b) (p)->lpVtbl->GetSockAddress(p,a,b)
#define IDirectPlay8AddressIP_GetLocalAddress(p,a,b) (p)->lpVtbl->GetLocalAddress(p,a,b)
#define IDirectPlay8AddressIP_GetAddress(p,a,b,c) (p)->lpVtbl->GetAddress(p,a,b,c)
#else /* C++ */
#define IDirectPlay8Address_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirectPlay8Address_AddRef(p) (p)->AddRef()
#define IDirectPlay8Address_Release(p) (p)->Release()
#define IDirectPlay8Address_BuildFromURLW(p,a) (p)->BuildFromURLW(a)
#define IDirectPlay8Address_BuildFromURLA(p,a) (p)->BuildFromURLA(a)
#define IDirectPlay8Address_Duplicate(p,a) (p)->Duplicate(a)
#define IDirectPlay8Address_SetEqual(p,a) (p)->SetEqual(a)
#define IDirectPlay8Address_IsEqual(p,a) (p)->IsEqual(a)
#define IDirectPlay8Address_Clear(p) (p)->Clear()
#define IDirectPlay8Address_GetURLW(p,a,b) (p)->GetURLW(a,b)
#define IDirectPlay8Address_GetURLA(p,a,b) (p)->GetURLA(a,b)
#define IDirectPlay8Address_GetSP(p,a) (p)->GetSP(a)
#define IDirectPlay8Address_GetUserData(p,a,b) (p)->GetUserData(a,b)
#define IDirectPlay8Address_SetSP(p,a) (p)->SetSP(a)
#define IDirectPlay8Address_SetUserData(p,a,b) (p)->SetUserData(a,b)
#define IDirectPlay8Address_GetNumComponents(p,a) (p)->GetNumComponents(a)
#define IDirectPlay8Address_GetComponentByName(p,a,b,c,d) (p)->GetComponentByName(a,b,c,d)
#define IDirectPlay8Address_GetComponentByIndex(p,a,b,c,d,e,f) (p)->GetComponentByIndex(a,b,c,d,e,f)
#define IDirectPlay8Address_AddComponent(p,a,b,c,d) (p)->AddComponent(a,b,c,d)
#define IDirectPlay8Address_SetDevice(p,a) (p)->SetDevice(a)
#define IDirectPlay8Address_GetDevice(p,a) (p)->GetDevice(a)
#define IDirectPlay8Address_BuildFromDirectPlay4Address(p,a,b) (p)->BuildFromDirectPlay4Address(a,b)
#define IDirectPlay8AddressIP_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirectPlay8AddressIP_AddRef(p) (p)->AddRef()
#define IDirectPlay8AddressIP_Release(p) (p)->Release()
#define IDirectPlay8AddressIP_BuildFromSockAddr(p,a) (p)->BuildFromSockAddr(a)
#define IDirectPlay8AddressIP_BuildAddress(p,a,b) (p)->BuildAddress(a,b)
#define IDirectPlay8AddressIP_BuildLocalAddress(p,a,b) (p)->BuildLocalAddress(a,b)
#define IDirectPlay8AddressIP_GetSockAddress(p,a,b) (p)->GetSockAddress(a,b)
#define IDirectPlay8AddressIP_GetLocalAddress(p,a,b) (p)->GetLocalAddress(a,b)
#define IDirectPlay8AddressIP_GetAddress(p,a,b,c) (p)->GetAddress(a,b,c)
#endif
#ifdef __cplusplus
}
#endif
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,853 @@
/*==========================================================================;
*
* Copyright (C) 1996-1997 Microsoft Corporation. All Rights Reserved.
*
* File: dplobby.h
* Content: DirectPlayLobby include file
***************************************************************************/
#ifndef __DPLOBBY_INCLUDED__
#define __DPLOBBY_INCLUDED__
#include "dplay.h"
/* avoid warnings at Level 4 */
#pragma warning(disable:4201)
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/*
* GUIDS used by DirectPlay objects
*/
/* {AF465C71-9588-11cf-A020-00AA006157AC} */
DEFINE_GUID(IID_IDirectPlayLobby, 0xaf465c71, 0x9588, 0x11cf, 0xa0, 0x20, 0x0, 0xaa, 0x0, 0x61, 0x57, 0xac);
/* {26C66A70-B367-11cf-A024-00AA006157AC} */
DEFINE_GUID(IID_IDirectPlayLobbyA, 0x26c66a70, 0xb367, 0x11cf, 0xa0, 0x24, 0x0, 0xaa, 0x0, 0x61, 0x57, 0xac);
/* {0194C220-A303-11d0-9C4F-00A0C905425E} */
DEFINE_GUID(IID_IDirectPlayLobby2, 0x194c220, 0xa303, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
/* {1BB4AF80-A303-11d0-9C4F-00A0C905425E} */
DEFINE_GUID(IID_IDirectPlayLobby2A, 0x1bb4af80, 0xa303, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
/* {2DB72490-652C-11d1-A7A8-0000F803ABFC} */
DEFINE_GUID(IID_IDirectPlayLobby3, 0x2db72490, 0x652c, 0x11d1, 0xa7, 0xa8, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc);
/* {2DB72491-652C-11d1-A7A8-0000F803ABFC} */
DEFINE_GUID(IID_IDirectPlayLobby3A, 0x2db72491, 0x652c, 0x11d1, 0xa7, 0xa8, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc);
/* {2FE8F810-B2A5-11d0-A787-0000F803ABFC} */
DEFINE_GUID(CLSID_DirectPlayLobby, 0x2fe8f810, 0xb2a5, 0x11d0, 0xa7, 0x87, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc);
/****************************************************************************
*
* IDirectPlayLobby Structures
*
* Various structures used to invoke DirectPlayLobby.
*
****************************************************************************/
typedef struct IDirectPlayLobby FAR *LPDIRECTPLAYLOBBY;
typedef struct IDirectPlayLobby FAR *LPDIRECTPLAYLOBBYA;
typedef struct IDirectPlayLobby IDirectPlayLobbyA;
typedef struct IDirectPlayLobby2 FAR *LPDIRECTPLAYLOBBY2;
typedef struct IDirectPlayLobby2 FAR *LPDIRECTPLAYLOBBY2A;
typedef struct IDirectPlayLobby2 IDirectPlayLobby2A;
typedef struct IDirectPlayLobby3 FAR *LPDIRECTPLAYLOBBY3;
typedef struct IDirectPlayLobby3 FAR *LPDIRECTPLAYLOBBY3A;
typedef struct IDirectPlayLobby3 IDirectPlayLobby3A;
/*
* DPLAPPINFO
* Used to hold information about a registered DirectPlay
* application
*/
typedef struct DPLAPPINFO
{
DWORD dwSize; // Size of this structure
GUID guidApplication; // GUID of the Application
union
{
LPSTR lpszAppNameA; // Pointer to the Application Name
LPWSTR lpszAppName;
};
} DPLAPPINFO, FAR *LPDPLAPPINFO;
/*
* LPCDPLAPPINFO
* A constant pointer to DPLAPPINFO
*/
typedef const DPLAPPINFO FAR *LPCDPLAPPINFO;
/*
* DPCOMPOUNDADDRESSELEMENT
*
* An array of these is passed to CreateCompoundAddresses()
*/
typedef struct DPCOMPOUNDADDRESSELEMENT
{
GUID guidDataType;
DWORD dwDataSize;
LPVOID lpData;
} DPCOMPOUNDADDRESSELEMENT, FAR *LPDPCOMPOUNDADDRESSELEMENT;
/*
* LPCDPCOMPOUNDADDRESSELEMENT
* A constant pointer to DPCOMPOUNDADDRESSELEMENT
*/
typedef const DPCOMPOUNDADDRESSELEMENT FAR *LPCDPCOMPOUNDADDRESSELEMENT;
/*
* LPDPAPPLICATIONDESC
* Used to register a DirectPlay application
*/
typedef struct DPAPPLICATIONDESC
{
DWORD dwSize;
DWORD dwFlags;
union
{
LPSTR lpszApplicationNameA;
LPWSTR lpszApplicationName;
};
GUID guidApplication;
union
{
LPSTR lpszFilenameA;
LPWSTR lpszFilename;
};
union
{
LPSTR lpszCommandLineA;
LPWSTR lpszCommandLine;
};
union
{
LPSTR lpszPathA;
LPWSTR lpszPath;
};
union
{
LPSTR lpszCurrentDirectoryA;
LPWSTR lpszCurrentDirectory;
};
LPSTR lpszDescriptionA;
LPWSTR lpszDescriptionW;
} DPAPPLICATIONDESC, *LPDPAPPLICATIONDESC;
/*
* LPDPAPPLICATIONDESC2
* Used to register a DirectPlay application
*/
typedef struct DPAPPLICATIONDESC2
{
DWORD dwSize;
DWORD dwFlags;
union
{
LPSTR lpszApplicationNameA;
LPWSTR lpszApplicationName;
};
GUID guidApplication;
union
{
LPSTR lpszFilenameA;
LPWSTR lpszFilename;
};
union
{
LPSTR lpszCommandLineA;
LPWSTR lpszCommandLine;
};
union
{
LPSTR lpszPathA;
LPWSTR lpszPath;
};
union
{
LPSTR lpszCurrentDirectoryA;
LPWSTR lpszCurrentDirectory;
};
LPSTR lpszDescriptionA;
LPWSTR lpszDescriptionW;
union
{
LPSTR lpszAppLauncherNameA;
LPWSTR lpszAppLauncherName;
};
} DPAPPLICATIONDESC2, *LPDPAPPLICATIONDESC2;
/****************************************************************************
*
* Enumeration Method Callback Prototypes
*
****************************************************************************/
/*
* Callback for EnumAddress()
*/
typedef BOOL (FAR PASCAL *LPDPENUMADDRESSCALLBACK)(
REFGUID guidDataType,
DWORD dwDataSize,
LPCVOID lpData,
LPVOID lpContext);
/*
* Callback for EnumAddressTypes()
*/
typedef BOOL (FAR PASCAL *LPDPLENUMADDRESSTYPESCALLBACK)(
REFGUID guidDataType,
LPVOID lpContext,
DWORD dwFlags);
/*
* Callback for EnumLocalApplications()
*/
typedef BOOL (FAR PASCAL * LPDPLENUMLOCALAPPLICATIONSCALLBACK)(
LPCDPLAPPINFO lpAppInfo,
LPVOID lpContext,
DWORD dwFlags);
/****************************************************************************
*
* DirectPlayLobby API Prototypes
*
****************************************************************************/
#ifdef UNICODE
#define DirectPlayLobbyCreate DirectPlayLobbyCreateW
#else
#define DirectPlayLobbyCreate DirectPlayLobbyCreateA
#endif /* UNICODE */
extern HRESULT WINAPI DirectPlayLobbyCreateW(LPGUID, LPDIRECTPLAYLOBBY *, IUnknown *, LPVOID, DWORD );
extern HRESULT WINAPI DirectPlayLobbyCreateA(LPGUID, LPDIRECTPLAYLOBBYA *, IUnknown *, LPVOID, DWORD );
/****************************************************************************
*
* IDirectPlayLobby (and IDirectPlayLobbyA) Interface
*
****************************************************************************/
#undef INTERFACE
#define INTERFACE IDirectPlayLobby
DECLARE_INTERFACE_( IDirectPlayLobby, IUnknown )
{
/* IUnknown Methods */
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/* IDirectPlayLobby Methods */
STDMETHOD(Connect) (THIS_ DWORD, LPDIRECTPLAY2 *, IUnknown FAR *) PURE;
STDMETHOD(CreateAddress) (THIS_ REFGUID, REFGUID, LPCVOID, DWORD, LPVOID, LPDWORD) PURE;
STDMETHOD(EnumAddress) (THIS_ LPDPENUMADDRESSCALLBACK, LPCVOID, DWORD, LPVOID) PURE;
STDMETHOD(EnumAddressTypes) (THIS_ LPDPLENUMADDRESSTYPESCALLBACK, REFGUID, LPVOID, DWORD) PURE;
STDMETHOD(EnumLocalApplications)(THIS_ LPDPLENUMLOCALAPPLICATIONSCALLBACK, LPVOID, DWORD) PURE;
STDMETHOD(GetConnectionSettings)(THIS_ DWORD, LPVOID, LPDWORD) PURE;
STDMETHOD(ReceiveLobbyMessage) (THIS_ DWORD, DWORD, LPDWORD, LPVOID, LPDWORD) PURE;
STDMETHOD(RunApplication) (THIS_ DWORD, LPDWORD, LPDPLCONNECTION, HANDLE) PURE;
STDMETHOD(SendLobbyMessage) (THIS_ DWORD, DWORD, LPVOID, DWORD) PURE;
STDMETHOD(SetConnectionSettings)(THIS_ DWORD, DWORD, LPDPLCONNECTION) PURE;
STDMETHOD(SetLobbyMessageEvent) (THIS_ DWORD, DWORD, HANDLE) PURE;
};
/****************************************************************************
*
* IDirectPlayLobby2 (and IDirectPlayLobby2A) Interface
*
****************************************************************************/
#undef INTERFACE
#define INTERFACE IDirectPlayLobby2
DECLARE_INTERFACE_( IDirectPlayLobby2, IDirectPlayLobby )
{
/* IUnknown Methods */
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/* IDirectPlayLobby Methods */
STDMETHOD(Connect) (THIS_ DWORD, LPDIRECTPLAY2 *, IUnknown FAR *) PURE;
STDMETHOD(CreateAddress) (THIS_ REFGUID, REFGUID, LPCVOID, DWORD, LPVOID, LPDWORD) PURE;
STDMETHOD(EnumAddress) (THIS_ LPDPENUMADDRESSCALLBACK, LPCVOID, DWORD, LPVOID) PURE;
STDMETHOD(EnumAddressTypes) (THIS_ LPDPLENUMADDRESSTYPESCALLBACK, REFGUID, LPVOID, DWORD) PURE;
STDMETHOD(EnumLocalApplications)(THIS_ LPDPLENUMLOCALAPPLICATIONSCALLBACK, LPVOID, DWORD) PURE;
STDMETHOD(GetConnectionSettings)(THIS_ DWORD, LPVOID, LPDWORD) PURE;
STDMETHOD(ReceiveLobbyMessage) (THIS_ DWORD, DWORD, LPDWORD, LPVOID, LPDWORD) PURE;
STDMETHOD(RunApplication) (THIS_ DWORD, LPDWORD, LPDPLCONNECTION, HANDLE) PURE;
STDMETHOD(SendLobbyMessage) (THIS_ DWORD, DWORD, LPVOID, DWORD) PURE;
STDMETHOD(SetConnectionSettings)(THIS_ DWORD, DWORD, LPDPLCONNECTION) PURE;
STDMETHOD(SetLobbyMessageEvent) (THIS_ DWORD, DWORD, HANDLE) PURE;
/* IDirectPlayLobby2 Methods */
STDMETHOD(CreateCompoundAddress)(THIS_ LPCDPCOMPOUNDADDRESSELEMENT,DWORD,LPVOID,LPDWORD) PURE;
};
/****************************************************************************
*
* IDirectPlayLobby3 (and IDirectPlayLobby3A) Interface
*
****************************************************************************/
#undef INTERFACE
#define INTERFACE IDirectPlayLobby3
DECLARE_INTERFACE_( IDirectPlayLobby3, IDirectPlayLobby )
{
/* IUnknown Methods */
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/* IDirectPlayLobby Methods */
STDMETHOD(Connect) (THIS_ DWORD, LPDIRECTPLAY2 *, IUnknown FAR *) PURE;
STDMETHOD(CreateAddress) (THIS_ REFGUID, REFGUID, LPCVOID, DWORD, LPVOID, LPDWORD) PURE;
STDMETHOD(EnumAddress) (THIS_ LPDPENUMADDRESSCALLBACK, LPCVOID, DWORD, LPVOID) PURE;
STDMETHOD(EnumAddressTypes) (THIS_ LPDPLENUMADDRESSTYPESCALLBACK, REFGUID, LPVOID, DWORD) PURE;
STDMETHOD(EnumLocalApplications)(THIS_ LPDPLENUMLOCALAPPLICATIONSCALLBACK, LPVOID, DWORD) PURE;
STDMETHOD(GetConnectionSettings)(THIS_ DWORD, LPVOID, LPDWORD) PURE;
STDMETHOD(ReceiveLobbyMessage) (THIS_ DWORD, DWORD, LPDWORD, LPVOID, LPDWORD) PURE;
STDMETHOD(RunApplication) (THIS_ DWORD, LPDWORD, LPDPLCONNECTION, HANDLE) PURE;
STDMETHOD(SendLobbyMessage) (THIS_ DWORD, DWORD, LPVOID, DWORD) PURE;
STDMETHOD(SetConnectionSettings)(THIS_ DWORD, DWORD, LPDPLCONNECTION) PURE;
STDMETHOD(SetLobbyMessageEvent) (THIS_ DWORD, DWORD, HANDLE) PURE;
/* IDirectPlayLobby2 Methods */
STDMETHOD(CreateCompoundAddress)(THIS_ LPCDPCOMPOUNDADDRESSELEMENT,DWORD,LPVOID,LPDWORD) PURE;
/* IDirectPlayLobby3 Methods */
STDMETHOD(ConnectEx) (THIS_ DWORD, REFIID, LPVOID *, IUnknown FAR *) PURE;
STDMETHOD(RegisterApplication) (THIS_ DWORD, LPVOID) PURE;
STDMETHOD(UnregisterApplication)(THIS_ DWORD, REFGUID) PURE;
STDMETHOD(WaitForConnectionSettings)(THIS_ DWORD) PURE;
};
/****************************************************************************
*
* IDirectPlayLobby interface macros
*
****************************************************************************/
#if !defined(__cplusplus) || defined(CINTERFACE)
#define IDirectPlayLobby_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectPlayLobby_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirectPlayLobby_Release(p) (p)->lpVtbl->Release(p)
#define IDirectPlayLobby_Connect(p,a,b,c) (p)->lpVtbl->Connect(p,a,b,c)
#define IDirectPlayLobby_ConnectEx(p,a,b,c,d) (p)->lpVtbl->ConnectEx(p,a,b,c,d)
#define IDirectPlayLobby_CreateAddress(p,a,b,c,d,e,f) (p)->lpVtbl->CreateAddress(p,a,b,c,d,e,f)
#define IDirectPlayLobby_CreateCompoundAddress(p,a,b,c,d) (p)->lpVtbl->CreateCompoundAddress(p,a,b,c,d)
#define IDirectPlayLobby_EnumAddress(p,a,b,c,d) (p)->lpVtbl->EnumAddress(p,a,b,c,d)
#define IDirectPlayLobby_EnumAddressTypes(p,a,b,c,d) (p)->lpVtbl->EnumAddressTypes(p,a,b,c,d)
#define IDirectPlayLobby_EnumLocalApplications(p,a,b,c) (p)->lpVtbl->EnumLocalApplications(p,a,b,c)
#define IDirectPlayLobby_GetConnectionSettings(p,a,b,c) (p)->lpVtbl->GetConnectionSettings(p,a,b,c)
#define IDirectPlayLobby_ReceiveLobbyMessage(p,a,b,c,d,e) (p)->lpVtbl->ReceiveLobbyMessage(p,a,b,c,d,e)
#define IDirectPlayLobby_RegisterApplication(p,a,b) (p)->lpVtbl->RegisterApplication(p,a,b)
#define IDirectPlayLobby_RunApplication(p,a,b,c,d) (p)->lpVtbl->RunApplication(p,a,b,c,d)
#define IDirectPlayLobby_SendLobbyMessage(p,a,b,c,d) (p)->lpVtbl->SendLobbyMessage(p,a,b,c,d)
#define IDirectPlayLobby_SetConnectionSettings(p,a,b,c) (p)->lpVtbl->SetConnectionSettings(p,a,b,c)
#define IDirectPlayLobby_SetLobbyMessageEvent(p,a,b,c) (p)->lpVtbl->SetLobbyMessageEvent(p,a,b,c)
#define IDirectPlayLobby_UnregisterApplication(p,a,b) (p)->lpVtbl->UnregisterApplication(p,a,b)
#define IDirectPlayLobby_WaitForConnectionSettings(p,a) (p)->lpVtbl->WaitForConnectionSettings(p,a)
#else /* C++ */
#define IDirectPlayLobby_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirectPlayLobby_AddRef(p) (p)->AddRef()
#define IDirectPlayLobby_Release(p) (p)->Release()
#define IDirectPlayLobby_Connect(p,a,b,c) (p)->Connect(a,b,c)
#define IDirectPlayLobby_ConnectEx(p,a,b,c,d) (p)->ConnectEx(a,b,c,d)
#define IDirectPlayLobby_CreateAddress(p,a,b,c,d,e,f) (p)->CreateAddress(a,b,c,d,e,f)
#define IDirectPlayLobby_CreateCompoundAddress(p,a,b,c,d) (p)->CreateCompoundAddress(a,b,c,d)
#define IDirectPlayLobby_EnumAddress(p,a,b,c,d) (p)->EnumAddress(a,b,c,d)
#define IDirectPlayLobby_EnumAddressTypes(p,a,b,c,d) (p)->EnumAddressTypes(a,b,c,d)
#define IDirectPlayLobby_EnumLocalApplications(p,a,b,c) (p)->EnumLocalApplications(a,b,c)
#define IDirectPlayLobby_GetConnectionSettings(p,a,b,c) (p)->GetConnectionSettings(a,b,c)
#define IDirectPlayLobby_ReceiveLobbyMessage(p,a,b,c,d,e) (p)->ReceiveLobbyMessage(a,b,c,d,e)
#define IDirectPlayLobby_RegisterApplication(p,a,b) (p)->RegisterApplication(a,b)
#define IDirectPlayLobby_RunApplication(p,a,b,c,d) (p)->RunApplication(a,b,c,d)
#define IDirectPlayLobby_SendLobbyMessage(p,a,b,c,d) (p)->SendLobbyMessage(a,b,c,d)
#define IDirectPlayLobby_SetConnectionSettings(p,a,b,c) (p)->SetConnectionSettings(a,b,c)
#define IDirectPlayLobby_SetLobbyMessageEvent(p,a,b,c) (p)->SetLobbyMessageEvent(a,b,c)
#define IDirectPlayLobby_UnregisterApplication(p,a,b) (p)->UnregisterApplication(a,b)
#define IDirectPlayLobby_WaitForConnectionSettings(p,a) (p)->WaitForConnectionSettings(a)
#endif
/****************************************************************************
*
* DirectPlayLobby Flags
*
****************************************************************************/
/*
* This flag is used by IDirectPlayLobby->WaitForConnectionSettings to
* cancel a current wait that is in progress.
*/
#define DPLWAIT_CANCEL 0x00000001
/*
* This is a message flag used by ReceiveLobbyMessage. It can be
* returned in the dwMessageFlags parameter to indicate a message from
* the system.
*/
#define DPLMSG_SYSTEM 0x00000001
/*
* This is a message flag used by ReceiveLobbyMessage and SendLobbyMessage.
* It is used to indicate that the message is a standard lobby message.
* DPLMSG_SETPROPERTY, DPLMSG_SETPROPERTYRESPONSE, DPLMSG_GETPROPERTY,
* DPLMSG_GETPROPERTYRESPONSE
*/
#define DPLMSG_STANDARD 0x00000002
/*
* Lobbyable Application registration flags
*/
/*
* Applications registered with this flag will not show up when
* applications are enumerated in the lobby. This application
* will only be able to be launched by a lobby client that already
* knows about the application.
*/
#define DPLAPP_NOENUM 0x80000000
/*
* Applications registered with this flag want voice to automatically
* be enabled for their application. All players will be launched into
* an 'n'-way voice conference when the application is started. The
* user will be able to enable this flag for existing non-voice
* directplay applications.
*/
#define DPLAPP_AUTOVOICE 0x00000001
/*
* Applications that do their own voice conferencing should register with
* this flag to avoid allowing the user to enable other voice chat
* capabilites during the same session. This is to avoid users forcing
* the DPLAPP_AUTOVOICE flag for the application.
*/
#define DPLAPP_SELFVOICE 0x00000002
/****************************************************************************
*
* DirectPlayLobby messages and message data structures
*
* All system messages have a dwMessageFlags value of DPLMSG_SYSTEM returned
* from a call to ReceiveLobbyMessage.
*
* All standard messages have a dwMessageFlags value of DPLMSG_STANDARD returned
* from a call to ReceiveLobbyMessage.
*
****************************************************************************/
/*
* DPLMSG_GENERIC
* Generic message structure used to identify the message type.
*/
typedef struct _DPLMSG_GENERIC
{
DWORD dwType; // Message type
} DPLMSG_GENERIC, FAR *LPDPLMSG_GENERIC;
/*
* DPLMSG_SYSTEMMESSAGE
* Generic message format for all system messages --
* DPLSYS_CONNECTIONSETTINGSREAD, DPLSYS_DPLYCONNECTSUCCEEDED,
* DPLSYS_DPLAYCONNECTFAILED, DPLSYS_APPTERMINATED, DPLSYS_NEWCONNECTIONSETTINGS
*/
typedef struct _DPLMSG_SYSTEMMESSAGE
{
DWORD dwType; // Message type
GUID guidInstance; // Instance GUID of the dplay session the message corresponds to
} DPLMSG_SYSTEMMESSAGE, FAR *LPDPLMSG_SYSTEMMESSAGE;
/*
* DPLMSG_SETPROPERTY
* Standard message sent by an application to a lobby to set a
* property
*/
typedef struct _DPLMSG_SETPROPERTY
{
DWORD dwType; // Message type
DWORD dwRequestID; // Request ID (DPL_NOCONFIRMATION if no confirmation desired)
GUID guidPlayer; // Player GUID
GUID guidPropertyTag; // Property GUID
DWORD dwDataSize; // Size of data
DWORD dwPropertyData[1]; // Buffer containing data
} DPLMSG_SETPROPERTY, FAR *LPDPLMSG_SETPROPERTY;
#define DPL_NOCONFIRMATION 0
/*
* DPLMSG_SETPROPERTYRESPONSE
* Standard message returned by a lobby to confirm a
* DPLMSG_SETPROPERTY message.
*/
typedef struct _DPLMSG_SETPROPERTYRESPONSE
{
DWORD dwType; // Message type
DWORD dwRequestID; // Request ID
GUID guidPlayer; // Player GUID
GUID guidPropertyTag; // Property GUID
HRESULT hr; // Return Code
} DPLMSG_SETPROPERTYRESPONSE, FAR *LPDPLMSG_SETPROPERTYRESPONSE;
/*
* DPLMSG_GETPROPERTY
* Standard message sent by an application to a lobby to request
* the current value of a property
*/
typedef struct _DPLMSG_GETPROPERTY
{
DWORD dwType; // Message type
DWORD dwRequestID; // Request ID
GUID guidPlayer; // Player GUID
GUID guidPropertyTag; // Property GUID
} DPLMSG_GETPROPERTY, FAR *LPDPLMSG_GETPROPERTY;
/*
* DPLMSG_GETPROPERTYRESPONSE
* Standard message returned by a lobby in response to a
* DPLMSG_GETPROPERTY message.
*/
typedef struct _DPLMSG_GETPROPERTYRESPONSE
{
DWORD dwType; // Message type
DWORD dwRequestID; // Request ID
GUID guidPlayer; // Player GUID
GUID guidPropertyTag; // Property GUID
HRESULT hr; // Return Code
DWORD dwDataSize; // Size of data
DWORD dwPropertyData[1]; // Buffer containing data
} DPLMSG_GETPROPERTYRESPONSE, FAR *LPDPLMSG_GETPROPERTYRESPONSE;
/*
* DPLMSG_NEWSESSIONHOST
* Standard message returned by a lobby in response to a
* the session host migrating to a new client
*/
typedef struct _DPLMSG_NEWSESSIONHOST
{
DWORD dwType; // Message type
GUID guidInstance; // GUID Instance of the session
} DPLMSG_NEWSESSIONHOST, FAR *LPDPLMSG_NEWSESSIONHOST;
/******************************************
*
* DirectPlay Lobby message dwType values
*
*****************************************/
/*
* The application has read the connection settings.
* It is now O.K. for the lobby client to release
* its IDirectPlayLobby interface.
*/
#define DPLSYS_CONNECTIONSETTINGSREAD 0x00000001
/*
* The application's call to DirectPlayConnect failed
*/
#define DPLSYS_DPLAYCONNECTFAILED 0x00000002
/*
* The application has created a DirectPlay session.
*/
#define DPLSYS_DPLAYCONNECTSUCCEEDED 0x00000003
/*
* The application has terminated.
*/
#define DPLSYS_APPTERMINATED 0x00000004
/*
* The message is a DPLMSG_SETPROPERTY message.
*/
#define DPLSYS_SETPROPERTY 0x00000005
/*
* The message is a DPLMSG_SETPROPERTYRESPONSE message.
*/
#define DPLSYS_SETPROPERTYRESPONSE 0x00000006
/*
* The message is a DPLMSG_GETPROPERTY message.
*/
#define DPLSYS_GETPROPERTY 0x00000007
/*
* The message is a DPLMSG_GETPROPERTYRESPONSE message.
*/
#define DPLSYS_GETPROPERTYRESPONSE 0x00000008
/*
* The message is a DPLMSG_NEWSESSIONHOST message.
*/
#define DPLSYS_NEWSESSIONHOST 0x00000009
/*
* New connection settings are available.
*/
#define DPLSYS_NEWCONNECTIONSETTINGS 0x0000000A
/*
* The Lobby Client has released the DirectPlayLobby Interface
*/
#define DPLSYS_LOBBYCLIENTRELEASE 0x0000000B
/****************************************************************************
*
* DirectPlay defined property GUIDs and associated data structures
*
****************************************************************************/
/*
* DPLPROPERTY_MessagesSupported
*
* Request whether the lobby supports standard. Lobby with respond with either
* TRUE or FALSE or may not respond at all.
*
* Property data is a single BOOL with TRUE or FALSE
*/
// {762CCDA1-D916-11d0-BA39-00C04FD7ED67}
DEFINE_GUID(DPLPROPERTY_MessagesSupported,
0x762ccda1, 0xd916, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67);
/*
* DPLPROPERTY_LobbyGuid
*
* Request the GUID that identifies the lobby software that the application
* is communicating with.
*
* Property data is a single GUID.
*/
// {F56920A0-D218-11d0-BA39-00C04FD7ED67}
DEFINE_GUID(DPLPROPERTY_LobbyGuid,
0xf56920a0, 0xd218, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67);
/*
* DPLPROPERTY_PlayerGuid
*
* Request the GUID that identifies the player on this machine for sending
* property data back to the lobby.
*
* Property data is the DPLDATA_PLAYERDATA structure
*/
// {B4319322-D20D-11d0-BA39-00C04FD7ED67}
DEFINE_GUID(DPLPROPERTY_PlayerGuid,
0xb4319322, 0xd20d, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67);
/*
* DPLDATA_PLAYERGUID
*
* Data structure to hold the GUID of the player and player creation flags
* from the lobby.
*/
typedef struct _DPLDATA_PLAYERGUID
{
GUID guidPlayer;
DWORD dwPlayerFlags;
} DPLDATA_PLAYERGUID, FAR *LPDPLDATA_PLAYERGUID;
/*
* DPLPROPERTY_PlayerScore
*
* Used to send an array of long integers to the lobby indicating the
* score of a player.
*
* Property data is the DPLDATA_PLAYERSCORE structure.
*/
// {48784000-D219-11d0-BA39-00C04FD7ED67}
DEFINE_GUID(DPLPROPERTY_PlayerScore,
0x48784000, 0xd219, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67);
/*
* DPLDATA_PLAYERSCORE
*
* Data structure to hold an array of long integers representing a player score.
* Application must allocate enough memory to hold all the scores.
*/
typedef struct _DPLDATA_PLAYERSCORE
{
DWORD dwScoreCount;
LONG Score[1];
} DPLDATA_PLAYERSCORE, FAR *LPDPLDATA_PLAYERSCORE;
/****************************************************************************
*
* DirectPlay Address ID's
*
****************************************************************************/
/* DirectPlay Address
*
* A DirectPlay address consists of multiple chunks of data, each tagged
* with a GUID signifying the type of data in the chunk. The chunk also
* has a length so that unknown chunk types can be skipped.
*
* The EnumAddress() function is used to parse these address data chunks.
*/
/*
* DPADDRESS
*
* Header for block of address data elements
*/
typedef struct _DPADDRESS
{
GUID guidDataType;
DWORD dwDataSize;
} DPADDRESS;
typedef DPADDRESS FAR *LPDPADDRESS;
/*
* DPAID_TotalSize
*
* Chunk is a DWORD containing size of entire DPADDRESS structure
*/
// {1318F560-912C-11d0-9DAA-00A0C90A43CB}
DEFINE_GUID(DPAID_TotalSize,
0x1318f560, 0x912c, 0x11d0, 0x9d, 0xaa, 0x0, 0xa0, 0xc9, 0xa, 0x43, 0xcb);
/*
* DPAID_ServiceProvider
*
* Chunk is a GUID describing the service provider that created the chunk.
* All addresses must contain this chunk.
*/
// {07D916C0-E0AF-11cf-9C4E-00A0C905425E}
DEFINE_GUID(DPAID_ServiceProvider,
0x7d916c0, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
/*
* DPAID_LobbyProvider
*
* Chunk is a GUID describing the lobby provider that created the chunk.
* All addresses must contain this chunk.
*/
// {59B95640-9667-11d0-A77D-0000F803ABFC}
DEFINE_GUID(DPAID_LobbyProvider,
0x59b95640, 0x9667, 0x11d0, 0xa7, 0x7d, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc);
/*
* DPAID_Phone and DPAID_PhoneW
*
* Chunk is a string containing a phone number (i.e. "1-800-555-1212")
* in ANSI or UNICODE format
*/
// {78EC89A0-E0AF-11cf-9C4E-00A0C905425E}
DEFINE_GUID(DPAID_Phone,
0x78ec89a0, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
// {BA5A7A70-9DBF-11d0-9CC1-00A0C905425E}
DEFINE_GUID(DPAID_PhoneW,
0xba5a7a70, 0x9dbf, 0x11d0, 0x9c, 0xc1, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
/*
* DPAID_Modem and DPAID_ModemW
*
* Chunk is a string containing a modem name registered with TAPI
* in ANSI or UNICODE format
*/
// {F6DCC200-A2FE-11d0-9C4F-00A0C905425E}
DEFINE_GUID(DPAID_Modem,
0xf6dcc200, 0xa2fe, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
// {01FD92E0-A2FF-11d0-9C4F-00A0C905425E}
DEFINE_GUID(DPAID_ModemW,
0x1fd92e0, 0xa2ff, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
/*
* DPAID_Inet and DPAID_InetW
*
* Chunk is a string containing a TCP/IP host name or an IP address
* (i.e. "dplay.microsoft.com" or "137.55.100.173") in ANSI or UNICODE format
*/
// {C4A54DA0-E0AF-11cf-9C4E-00A0C905425E}
DEFINE_GUID(DPAID_INet,
0xc4a54da0, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
// {E63232A0-9DBF-11d0-9CC1-00A0C905425E}
DEFINE_GUID(DPAID_INetW,
0xe63232a0, 0x9dbf, 0x11d0, 0x9c, 0xc1, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
/*
* DPAID_InetPort
*
* Chunk is the port number used for creating the apps TCP and UDP sockets.
* WORD value (i.e. 47624).
*/
// {E4524541-8EA5-11d1-8A96-006097B01411}
DEFINE_GUID(DPAID_INetPort,
0xe4524541, 0x8ea5, 0x11d1, 0x8a, 0x96, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11);
#ifdef BIGMESSAGEDEFENSE
#endif
/*
* DPCOMPORTADDRESS
*
* Used to specify com port settings. The constants that define baud rate,
* stop bits and parity are defined in WINBASE.H. The constants for flow
* control are given below.
*/
#define DPCPA_NOFLOW 0 // no flow control
#define DPCPA_XONXOFFFLOW 1 // software flow control
#define DPCPA_RTSFLOW 2 // hardware flow control with RTS
#define DPCPA_DTRFLOW 3 // hardware flow control with DTR
#define DPCPA_RTSDTRFLOW 4 // hardware flow control with RTS and DTR
typedef struct _DPCOMPORTADDRESS
{
DWORD dwComPort; // COM port to use (1-4)
DWORD dwBaudRate; // baud rate (100-256k)
DWORD dwStopBits; // no. stop bits (1-2)
DWORD dwParity; // parity (none, odd, even, mark)
DWORD dwFlowControl; // flow control (none, xon/xoff, rts, dtr)
} DPCOMPORTADDRESS;
typedef DPCOMPORTADDRESS FAR *LPDPCOMPORTADDRESS;
/*
* DPAID_ComPort
*
* Chunk contains a DPCOMPORTADDRESS structure defining the serial port.
*/
// {F2F0CE00-E0AF-11cf-9C4E-00A0C905425E}
DEFINE_GUID(DPAID_ComPort,
0xf2f0ce00, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
/****************************************************************************
*
* dplobby 1.0 obsolete definitions
* Included for compatibility only.
*
****************************************************************************/
#define DPLAD_SYSTEM DPLMSG_SYSTEM
#ifdef __cplusplus
};
#endif /* __cplusplus */
#pragma warning(default:4201)
#endif /* __DPLOBBY_INCLUDED__ */

View File

@ -0,0 +1,407 @@
/*==========================================================================
*
* Copyright (C) 2000 Microsoft Corporation. All Rights Reserved.
*
* File: DPLobby.h
* Content: DirectPlay8 Lobby Include File
*
***************************************************************************/
#ifndef __DPLOBBY_H__
#define __DPLOBBY_H__
#include <ole2.h>
#ifdef __cplusplus
extern "C" {
#endif
/****************************************************************************
*
* DirectPlay8Lobby CLSIDs
*
****************************************************************************/
// {667955AD-6B3B-43ca-B949-BC69B5BAFF7F}
DEFINE_GUID(CLSID_DirectPlay8LobbiedApplication,
0x667955ad, 0x6b3b, 0x43ca, 0xb9, 0x49, 0xbc, 0x69, 0xb5, 0xba, 0xff, 0x7f);
// {3B2B6775-70B6-45af-8DEA-A209C69559F3}
DEFINE_GUID(CLSID_DirectPlay8LobbyClient,
0x3b2b6775, 0x70b6, 0x45af, 0x8d, 0xea, 0xa2, 0x9, 0xc6, 0x95, 0x59, 0xf3);
/****************************************************************************
*
* DirectPlay8Lobby Interface IIDs
*
****************************************************************************/
// {819074A3-016C-11d3-AE14-006097B01411}
DEFINE_GUID(IID_IDirectPlay8LobbiedApplication,
0x819074a3, 0x16c, 0x11d3, 0xae, 0x14, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11);
// {819074A2-016C-11d3-AE14-006097B01411}
DEFINE_GUID(IID_IDirectPlay8LobbyClient,
0x819074a2, 0x16c, 0x11d3, 0xae, 0x14, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11);
/****************************************************************************
*
* DirectPlay8Lobby Interface Pointer
*
****************************************************************************/
typedef struct IDirectPlay8LobbiedApplication *PDIRECTPLAY8LOBBIEDAPPLICATION;
typedef struct IDirectPlay8LobbyClient *PDIRECTPLAY8LOBBYCLIENT;
/****************************************************************************
*
* DirectPlay8 Lobby Message IDs
*
****************************************************************************/
#define DPL_MSGID_LOBBY 0x8000
#define DPL_MSGID_RECEIVE (0x0001 | DPL_MSGID_LOBBY)
#define DPL_MSGID_CONNECT (0x0002 | DPL_MSGID_LOBBY)
#define DPL_MSGID_DISCONNECT (0x0003 | DPL_MSGID_LOBBY)
#define DPL_MSGID_SESSION_STATUS (0x0004 | DPL_MSGID_LOBBY)
#define DPL_MSGID_CONNECTION_SETTINGS (0x0005 | DPL_MSGID_LOBBY)
/****************************************************************************
*
* DirectPlay8Lobby Constants
*
****************************************************************************/
//
// Specifies that operation should be performed on all open connections
//
#define DPLHANDLE_ALLCONNECTIONS 0xFFFFFFFF
//
// The associated game session has suceeded in connecting / hosting
//
#define DPLSESSION_CONNECTED 0x0001
// The associated game session failed connecting / hosting
//
#define DPLSESSION_COULDNOTCONNECT 0x0002
//
// The associated game session has disconnected
//
#define DPLSESSION_DISCONNECTED 0x0003
//
// The associated game session has terminated
//
#define DPLSESSION_TERMINATED 0x0004
//
// The associated game session's host has migrated
//
#define DPLSESSION_HOSTMIGRATED 0x0005
//
// The associated game session's host has migrated to the local client
//
#define DPLSESSION_HOSTMIGRATEDHERE 0x0006
/****************************************************************************
*
* DirectPlay8 Lobby Flags
*
****************************************************************************/
//
// Do not automatically make the lobby app unavailable when a connection is established
//
#define DPLAVAILABLE_ALLOWMULTIPLECONNECT 0x0001
//
// Launch a new instance of the application to connect to
//
#define DPLCONNECT_LAUNCHNEW 0x0001
//
// Launch a new instance of the application if one is not waiting
//
#define DPLCONNECT_LAUNCHNOTFOUND 0x0002
//
// When starting the associated game session, start it as a host
//
#define DPLCONNECTSETTINGS_HOST 0x0001
//
// Disable parameter validation
//
#define DPLINITIALIZE_DISABLEPARAMVAL 0x0001
/****************************************************************************
*
* DirectPlay8Lobby Structures (Non-Message)
*
****************************************************************************/
//
// Information on a registered game
//
typedef struct _DPL_APPLICATION_INFO {
GUID guidApplication; // GUID of the application
PWSTR pwszApplicationName; // Name of the application
DWORD dwNumRunning; // # of instances of this application running
DWORD dwNumWaiting; // # of instances of this application waiting
DWORD dwFlags; // Flags
} DPL_APPLICATION_INFO, *PDPL_APPLICATION_INFO;
//
// Settings to be used for connecting / hosting a game session
//
typedef struct _DPL_CONNECTION_SETTINGS {
DWORD dwSize; // Size of this structure
DWORD dwFlags; // Connection settings flags (DPLCONNECTSETTINGS_...)
DPN_APPLICATION_DESC dpnAppDesc; // Application desc for the associated DirectPlay session
IDirectPlay8Address *pdp8HostAddress; // Address of host to connect to
IDirectPlay8Address **ppdp8DeviceAddresses; // Address of device to connect from / host on
DWORD cNumDeviceAddresses; // # of addresses specified in ppdp8DeviceAddresses
PWSTR pwszPlayerName; // Name to give the player
} DPL_CONNECTION_SETTINGS, *PDPL_CONNECTION_SETTINGS;
//
// Information for performing a lobby connect
// (ConnectApplication)
//
typedef struct _DPL_CONNECT_INFO {
DWORD dwSize; // Size of this structure
DWORD dwFlags; // Flags (DPLCONNECT_...)
GUID guidApplication; // GUID of application to launch
PDPL_CONNECTION_SETTINGS pdplConnectionSettings;
// Settings application should use
PVOID pvLobbyConnectData; // User defined data block
DWORD dwLobbyConnectDataSize;
// Size of user defined data block
} DPL_CONNECT_INFO, *PDPL_CONNECT_INFO;
//
// Information for registering an application
// (RegisterApplication)
//
typedef struct _DPL_PROGRAM_DESC {
DWORD dwSize;
DWORD dwFlags;
GUID guidApplication; // Application GUID
PWSTR pwszApplicationName; // Unicode application name
PWSTR pwszCommandLine; // Unicode command line arguments
PWSTR pwszCurrentDirectory; // Unicode current directory
PWSTR pwszDescription; // Unicode application description
PWSTR pwszExecutableFilename; // Unicode filename of application executable
PWSTR pwszExecutablePath; // Unicode path of application executable
PWSTR pwszLauncherFilename; // Unicode filename of launcher executable
PWSTR pwszLauncherPath; // Unicode path of launcher executable
} DPL_PROGRAM_DESC, *PDPL_PROGRAM_DESC;
/****************************************************************************
*
* DirectPlay8 Lobby Message Structures
*
****************************************************************************/
//
// A connection was established
// (DPL_MSGID_CONNECT)
//
typedef struct _DPL_MESSAGE_CONNECT
{
DWORD dwSize; // Size of this structure
DPNHANDLE hConnectId; // Handle of new connection
PDPL_CONNECTION_SETTINGS pdplConnectionSettings; // Connection settings for this connection
PVOID pvLobbyConnectData; // User defined lobby data block
DWORD dwLobbyConnectDataSize; // Size of user defined lobby data block
PVOID pvConnectionContext; // Context value for this connection (user set)
} DPL_MESSAGE_CONNECT, *PDPL_MESSAGE_CONNECT;
//
// Connection settings have been updated
// (DPL_MSGID_CONNECTION_SETTINGS)
//
typedef struct _DPL_MESSAGE_CONNECTION_SETTINGS
{
DWORD dwSize; // Size of this structure
DPNHANDLE hSender; // Handle of the connection for these settings
PDPL_CONNECTION_SETTINGS pdplConnectionSettings; // Connection settings
PVOID pvConnectionContext; // Context value for this connection
} DPL_MESSAGE_CONNECTION_SETTINGS, *PDPL_MESSAGE_CONNECTION_SETTINGS;
//
// A connection has been disconnected
// (DPL_MSGID_DISCONNECT)
//
typedef struct _DPL_MESSAGE_DISCONNECT
{
DWORD dwSize; // Size of this structure
DPNHANDLE hDisconnectId; // Handle of the connection that was terminated
HRESULT hrReason; // Reason the connection was broken
PVOID pvConnectionContext; // Context value for this connection
} DPL_MESSAGE_DISCONNECT, *PDPL_MESSAGE_DISCONNECT;
//
// Data was received through a connection
// (DPL_MSGID_RECEIVE)
//
typedef struct _DPL_MESSAGE_RECEIVE
{
DWORD dwSize; // Size of this structure
DPNHANDLE hSender; // Handle of the connection that is from
BYTE *pBuffer; // Contents of the message
DWORD dwBufferSize; // Size of the message context
PVOID pvConnectionContext; // Context value for this connection
} DPL_MESSAGE_RECEIVE, *PDPL_MESSAGE_RECEIVE;
//
// Current status of the associated connection
// (DPL_MSGID_SESSION_STATUS)
//
typedef struct _DPL_MESSAGE_SESSION_STATUS
{
DWORD dwSize; // Size of this structure
DPNHANDLE hSender; // Handle of the connection that this is from
DWORD dwStatus; // Status (DPLSESSION_...)
PVOID pvConnectionContext; // Context value for this connection
} DPL_MESSAGE_SESSION_STATUS, *PDPL_MESSAGE_SESSION_STATUS;
/****************************************************************************
*
* DirectPlay8Lobby Create
*
****************************************************************************/
/*
* This function is no longer supported. It is recommended that CoCreateInstance be used to create
* DirectPlay8 lobby objects.
*
* extern HRESULT WINAPI DirectPlay8LobbyCreate( const GUID * pcIID, void **ppvInterface, IUnknown *pUnknown);
*
*/
/****************************************************************************
*
* DirectPlay8 Functions
*
****************************************************************************/
//
// COM definition for DirectPlayLobbyClient
//
#undef INTERFACE // External COM Implementation
#define INTERFACE IDirectPlay8LobbyClient
DECLARE_INTERFACE_(IDirectPlay8LobbyClient,IUnknown)
{
// IUnknown methods
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
// IDirectPlayLobbyClient methods
STDMETHOD(Initialize) (THIS_ const PVOID pvUserContext,const PFNDPNMESSAGEHANDLER pfn,const DWORD dwFlags) PURE;
STDMETHOD(EnumLocalPrograms) (THIS_ GUID *const pGuidApplication,BYTE *const pEnumData,DWORD *const pdwEnumData,DWORD *const pdwItems, const DWORD dwFlags) PURE;
STDMETHOD(ConnectApplication) (THIS_ DPL_CONNECT_INFO *const pdplConnectionInfo,const PVOID pvConnectionContext,DPNHANDLE *const hApplication,const DWORD dwTimeOut,const DWORD dwFlags) PURE;
STDMETHOD(Send) (THIS_ const DPNHANDLE hConnection,BYTE *const pBuffer,const DWORD pBufferSize,const DWORD dwFlags) PURE;
STDMETHOD(ReleaseApplication) (THIS_ const DPNHANDLE hConnection, const DWORD dwFlags ) PURE;
STDMETHOD(Close) (THIS_ const DWORD dwFlags ) PURE;
STDMETHOD(GetConnectionSettings) (THIS_ const DPNHANDLE hConnection, DPL_CONNECTION_SETTINGS * const pdplSessionInfo, DWORD *pdwInfoSize, const DWORD dwFlags ) PURE;
STDMETHOD(SetConnectionSettings) (THIS_ const DPNHANDLE hConnection, const DPL_CONNECTION_SETTINGS * const pdplSessionInfo, const DWORD dwFlags ) PURE;
};
//
// COM definition for DirectPlayLobbiedApplication
//
#undef INTERFACE // External COM Implementation
#define INTERFACE IDirectPlay8LobbiedApplication
DECLARE_INTERFACE_(IDirectPlay8LobbiedApplication,IUnknown)
{
// IUnknown methods
STDMETHOD(QueryInterface) (THIS_ REFIID riid,LPVOID *ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
// IDirectPlayLobbiedApplication methods
STDMETHOD(Initialize) (THIS_ const PVOID pvUserContext,const PFNDPNMESSAGEHANDLER pfn,DPNHANDLE * const pdpnhConnection, const DWORD dwFlags) PURE;
STDMETHOD(RegisterProgram) (THIS_ PDPL_PROGRAM_DESC pdplProgramDesc,const DWORD dwFlags) PURE;
STDMETHOD(UnRegisterProgram) (THIS_ GUID *pguidApplication,const DWORD dwFlags) PURE;
STDMETHOD(Send) (THIS_ const DPNHANDLE hConnection,BYTE *const pBuffer,const DWORD pBufferSize,const DWORD dwFlags) PURE;
STDMETHOD(SetAppAvailable) (THIS_ const BOOL fAvailable, const DWORD dwFlags ) PURE;
STDMETHOD(UpdateStatus) (THIS_ const DPNHANDLE hConnection, const DWORD dwStatus, const DWORD dwFlags ) PURE;
STDMETHOD(Close) (THIS_ const DWORD dwFlags ) PURE;
STDMETHOD(GetConnectionSettings) (THIS_ const DPNHANDLE hConnection, DPL_CONNECTION_SETTINGS * const pdplSessionInfo, DWORD *pdwInfoSize, const DWORD dwFlags ) PURE;
STDMETHOD(SetConnectionSettings) (THIS_ const DPNHANDLE hConnection, const DPL_CONNECTION_SETTINGS * const pdplSessionInfo, const DWORD dwFlags ) PURE;
};
/****************************************************************************
*
* DirectPlayLobby Interface Macros
*
****************************************************************************/
#if !defined(__cplusplus) || defined(CINTERFACE)
#define IDirectPlay8LobbyClient_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectPlay8LobbyClient_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirectPlay8LobbyClient_Release(p) (p)->lpVtbl->Release(p)
#define IDirectPlay8LobbyClient_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c)
#define IDirectPlay8LobbyClient_EnumLocalPrograms(p,a,b,c,d,e) (p)->lpVtbl->EnumLocalPrograms(p,a,b,c,d,e)
#define IDirectPlay8LobbyClient_ConnectApplication(p,a,b,c,d,e) (p)->lpVtbl->ConnectApplication(p,a,b,c,d,e)
#define IDirectPlay8LobbyClient_Send(p,a,b,c,d) (p)->lpVtbl->Send(p,a,b,c,d)
#define IDirectPlay8LobbyClient_ReleaseApplication(p,a,b) (p)->lpVtbl->ReleaseApplication(p,a,b)
#define IDirectPlay8LobbyClient_Close(p,a) (p)->lpVtbl->Close(p,a)
#define IDirectPlay8LobbyClient_GetConnectionSettings(p,a,b,c,d) (p)->lpVtbl->GetConnectionSettings(p,a,b,c,d)
#define IDirectPlay8LobbyClient_SetConnectionSettings(p,a,b,c) (p)->lpVtbl->SetConnectionSettings(p,a,b,c)
#define IDirectPlay8LobbiedApplication_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectPlay8LobbiedApplication_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirectPlay8LobbiedApplication_Release(p) (p)->lpVtbl->Release(p)
#define IDirectPlay8LobbiedApplication_Initialize(p,a,b,c,d) (p)->lpVtbl->Initialize(p,a,b,c,d)
#define IDirectPlay8LobbiedApplication_RegisterProgram(p,a,b) (p)->lpVtbl->RegisterProgram(p,a,b)
#define IDirectPlay8LobbiedApplication_UnRegisterProgram(p,a,b) (p)->lpVtbl->UnRegisterProgram(p,a,b)
#define IDirectPlay8LobbiedApplication_Send(p,a,b,c,d) (p)->lpVtbl->Send(p,a,b,c,d)
#define IDirectPlay8LobbiedApplication_SetAppAvailable(p,a,b) (p)->lpVtbl->SetAppAvailable(p,a,b)
#define IDirectPlay8LobbiedApplication_UpdateStatus(p,a,b,c) (p)->lpVtbl->UpdateStatus(p,a,b,c)
#define IDirectPlay8LobbiedApplication_Close(p,a) (p)->lpVtbl->Close(p,a)
#define IDirectPlay8LobbiedApplication_GetConnectionSettings(p,a,b,c,d) (p)->lpVtbl->GetConnectionSettings(p,a,b,c,d)
#define IDirectPlay8LobbiedApplication_SetConnectionSettings(p,a,b,c) (p)->lpVtbl->SetConnectionSettings(p,a,b,c)
#else /* C++ */
#define IDirectPlay8LobbyClient_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirectPlay8LobbyClient_AddRef(p) (p)->AddRef()
#define IDirectPlay8LobbyClient_Release(p) (p)->Release()
#define IDirectPlay8LobbyClient_Initialize(p,a,b,c) (p)->Initialize(a,b,c)
#define IDirectPlay8LobbyClient_EnumLocalPrograms(p,a,b,c,d,e) (p)->EnumLocalPrograms(a,b,c,d,e)
#define IDirectPlay8LobbyClient_ConnectApplication(p,a,b,c,d,e) (p)->ConnectApplication(a,b,c,d,e)
#define IDirectPlay8LobbyClient_Send(p,a,b,c,d) (p)->Send(a,b,c,d)
#define IDirectPlay8LobbyClient_ReleaseApplication(p,a,b) (p)->ReleaseApplication(a,b)
#define IDirectPlay8LobbyClient_Close(p,a) (p)->Close(a)
#define IDirectPlay8LobbyClient_GetConnectionSettings(p,a,b,c,d) (p)->GetConnectionSettings(a,b,c,d)
#define IDirectPlay8LobbyClient_SetConnectionSettings(p,a,b,c) (p)->SetConnectionSettings(a,b,c)
#define IDirectPlay8LobbiedApplication_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirectPlay8LobbiedApplication_AddRef(p) (p)->AddRef()
#define IDirectPlay8LobbiedApplication_Release(p) (p)->Release()
#define IDirectPlay8LobbiedApplication_Initialize(p,a,b,c,d) (p)->Initialize(a,b,c,d)
#define IDirectPlay8LobbiedApplication_RegisterProgram(p,a,b) (p)->RegisterProgram(a,b)
#define IDirectPlay8LobbiedApplication_UnRegisterProgram(p,a,b) (p)->UnRegisterProgram(a,b)
#define IDirectPlay8LobbiedApplication_Send(p,a,b,c,d) (p)->Send(a,b,c,d)
#define IDirectPlay8LobbiedApplication_SetAppAvailable(p,a,b) (p)->SetAppAvailable(a,b)
#define IDirectPlay8LobbiedApplication_UpdateStatus(p,a,b,c) (p)->UpdateStatus(a,b,c)
#define IDirectPlay8LobbiedApplication_Close(p,a) (p)->Close(a)
#define IDirectPlay8LobbiedApplication_GetConnectionSettings(p,a,b,c,d) (p)->GetConnectionSettings(a,b,c,d)
#define IDirectPlay8LobbiedApplication_SetConnectionSettings(p,a,b,c) (p)->SetConnectionSettings(a,b,c)
#endif
#ifdef __cplusplus
}
#endif
#endif // __DPLOBBY_H__

View File

@ -0,0 +1,318 @@
/***************************************************************************
*
* Copyright (C) 2001-2002 Microsoft Corporation. All Rights Reserved.
*
* File: dpnathlp.h
*
* Content: Header for using DirectPlayNATHelp interface.
*
*
* NOTE: This interface is deprecated and should no longer be used.
*
*
***************************************************************************/
#ifndef __DPNATHLP_H__
#define __DPNATHLP_H__
#include <ole2.h> // for DECLARE_INTERFACE and HRESULT
#ifndef DPNATHLP_EXPORTS
#define DPNATHLPAPI DECLSPEC_IMPORT
#else
#define DPNATHLPAPI
#endif
#ifdef __cplusplus
extern "C" {
#endif
/****************************************************************************
*
* DirectPlay NAT Helper object class IDs
*
****************************************************************************/
// {B9C2E9C4-68C1-4d42-A7A1-E76A26982AD6}
DEFINE_GUID(CLSID_DirectPlayNATHelpUPnP,
0xb9c2e9c4, 0x68c1, 0x4d42, 0xa7, 0xa1, 0xe7, 0x6a, 0x26, 0x98, 0x2a, 0xd6);
// {963AB779-16A1-477c-A36D-CB5E711938F7}
DEFINE_GUID(CLSID_DirectPlayNATHelpPAST,
0x963ab779, 0x16a1, 0x477c, 0xa3, 0x6d, 0xcb, 0x5e, 0x71, 0x19, 0x38, 0xf7);
/****************************************************************************
*
* DirectPlay NAT Helper interface ID
*
****************************************************************************/
// {154940B6-2278-4a2f-9101-9BA9F431F603}
DEFINE_GUID(IID_IDirectPlayNATHelp,
0x154940b6, 0x2278, 0x4a2f, 0x91, 0x1, 0x9b, 0xa9, 0xf4, 0x31, 0xf6, 0x3);
/****************************************************************************
*
* DirectPlay NAT Helper interface pointer definitions
*
****************************************************************************/
typedef struct IDirectPlayNATHelp *PDIRECTPLAYNATHELP;
/****************************************************************************
*
* DirectPlay NAT Helper data types
*
****************************************************************************/
//
// Handles used to identify specific port binding groups. If multiple ports
// are registered at the same time, the DPNHHANDLE refers to all ports.
//
typedef DWORD_PTR DPNHHANDLE, * PDPNHHANDLE;
/****************************************************************************
*
* DirectPlay NAT Helper constants
*
****************************************************************************/
#define DPNH_MAX_SIMULTANEOUS_PORTS 16 // up to 16 ports may be specified in a single RegisterPorts call
/****************************************************************************
*
* DirectPlay NAT Helper API flags
*
****************************************************************************/
//
// Flags that can be passed to Initialize
//
#define DPNHINITIALIZE_DISABLEGATEWAYSUPPORT 0x01 // disables Internet gateway traversal support (cannot be specified with DPNHINITIALIZE_DISABLELOCALFIREWALLSUPPORT)
#define DPNHINITIALIZE_DISABLELOCALFIREWALLSUPPORT 0x02 // disables local firewall traversal support (cannot be specified with DPNHINITIALIZE_DISABLEGATEWAYSUPPORT)
//
// Flags that can be passed to GetCaps.
//
#define DPNHGETCAPS_UPDATESERVERSTATUS 0x01 // automatically extend expiring leases and detect changes in server status
//
// Flags that can be passed to RegisterPorts.
//
#define DPNHREGISTERPORTS_TCP 0x01 // request TCP ports instead of UDP
#define DPNHREGISTERPORTS_FIXEDPORTS 0x02 // asks the server to use the same port numbers on the public interface
#define DPNHREGISTERPORTS_SHAREDPORTS 0x04 // requests that the server allow the UDP fixed ports to be shared with other clients (must be specified with DPNHREGISTERPORTS_FIXEDPORTS and cannot be specified with DPNHREGISTERPORTS_TCP)
//
// Flags that can be passed to GetRegisteredAddresses.
//
#define DPNHGETREGISTEREDADDRESSES_LOCALFIREWALLREMAPONLY 0x01 // retrieve the public address for the local firewall only, even if mapped on remote Internet gateway
//
// Flags that can be passed to QueryAddress.
//
#define DPNHQUERYADDRESS_TCP 0x01 // request a TCP port instead of UDP
#define DPNHQUERYADDRESS_CACHEFOUND 0x02 // cache the discovered address if found
#define DPNHQUERYADDRESS_CACHENOTFOUND 0x04 // cache the fact that no address was found, if that is the case
#define DPNHQUERYADDRESS_CHECKFORPRIVATEBUTUNMAPPED 0x08 // determine if the address is behind the same Internet gateway, but not mapped on that Internet gateway
/****************************************************************************
*
* DirectPlay NAT Helper structure flags
*
****************************************************************************/
//
// DPNHCAPS flags
//
#define DPNHCAPSFLAG_LOCALFIREWALLPRESENT 0x01 // at least one network connection has a local firewall present
#define DPNHCAPSFLAG_GATEWAYPRESENT 0x02 // at least one network connection has an Internet gateway present
#define DPNHCAPSFLAG_GATEWAYISLOCAL 0x04 // a detected Internet gateway is local (i.e. the public address is another network interface on the same machine)
#define DPNHCAPSFLAG_PUBLICADDRESSAVAILABLE 0x08 // at least one server has a valid public address for registered mappings
#define DPNHCAPSFLAG_NOTALLSUPPORTACTIVENOTIFY 0x10 // at least one available server does not support an active-notification mechanisms and must be polled
/****************************************************************************
*
* DirectPlay NAT Helper structures
*
****************************************************************************/
typedef struct _DPNHCAPS
{
DWORD dwSize; // size of this structure, must be filled in prior to calling GetCaps
DWORD dwFlags; // flags indicating capabilities of Internet gateway server(s)
DWORD dwNumRegisteredPorts; // number of ports currently registered, including multiple ports registered at the same time (so this may not be equal to the number of DPNHHANDLEs given out)
DWORD dwMinLeaseTimeRemaining; // approximate time remaining, in milliseconds, for the lease that will expire soonest
DWORD dwRecommendedGetCapsInterval; // recommended time, in milliseconds, after which GetCaps should be called again (with DPNHGETCAPS_UPDATESERVERSTATUS flag)
} DPNHCAPS, * PDPNHCAPS;
/****************************************************************************
*
* Address type flags (returned by GetRegisteredAddresses)
*
****************************************************************************/
#define DPNHADDRESSTYPE_TCP 0x01 // the mappings are for TCP ports instead of UDP
#define DPNHADDRESSTYPE_FIXEDPORTS 0x02 // the mappings are for ports which are the same on the Internet gateway
#define DPNHADDRESSTYPE_SHAREDPORTS 0x04 // the mappings are for shared UDP fixed ports
#define DPNHADDRESSTYPE_LOCALFIREWALL 0x08 // the addresses are opened on a local firewall
#define DPNHADDRESSTYPE_GATEWAY 0x10 // the addresses are registered with an Internet gateway
#define DPNHADDRESSTYPE_GATEWAYISLOCAL 0x20 // the Internet gateway is local (i.e. the public address is another network interface on the same machine)
/****************************************************************************
*
* DirectPlay NAT Helper DLL exported functions
*
****************************************************************************/
typedef HRESULT (WINAPI * PFN_DIRECTPLAYNATHELPCREATE)(const GUID * pIID, void ** ppvInterface);
/****************************************************************************
*
* DirectPlay NAT Helper application interfaces
*
****************************************************************************/
#undef INTERFACE
#define INTERFACE IDirectPlayNATHelp
DECLARE_INTERFACE_(IDirectPlayNATHelp, IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/*** IDirectPlayNATHelp methods ***/
STDMETHOD(Initialize) (THIS_ const DWORD dwFlags) PURE;
STDMETHOD(Close) (THIS_ const DWORD dwFlags) PURE;
STDMETHOD(GetCaps) (THIS_ DPNHCAPS * const dpnhcaps, const DWORD dwFlags) PURE;
STDMETHOD(RegisterPorts) (THIS_ const SOCKADDR * const aLocalAddresses, const DWORD dwAddressesSize, const DWORD dwNumAddresses, const DWORD dwLeaseTime, DPNHHANDLE * const phRegisteredPorts, const DWORD dwFlags) PURE;
STDMETHOD(GetRegisteredAddresses) (THIS_ const DPNHHANDLE hRegisteredPorts, SOCKADDR * const paPublicAddresses, DWORD * const pdwPublicAddressesSize, DWORD * const pdwAddressTypeFlags, DWORD * const pdwLeaseTimeRemaining, const DWORD dwFlags) PURE;
STDMETHOD(DeregisterPorts) (THIS_ const DPNHHANDLE hRegisteredPorts, const DWORD dwFlags) PURE;
STDMETHOD(QueryAddress) (THIS_ const SOCKADDR * const pSourceAddress, const SOCKADDR * const pQueryAddress, SOCKADDR * const pResponseAddress, const int iAddressesSize, const DWORD dwFlags) PURE;
STDMETHOD(SetAlertEvent) (THIS_ const HANDLE hEvent, const DWORD dwFlags) PURE;
STDMETHOD(SetAlertIOCompletionPort) (THIS_ const HANDLE hIOCompletionPort, const DWORD dwCompletionKey, const DWORD dwNumConcurrentThreads, const DWORD dwFlags) PURE;
STDMETHOD(ExtendRegisteredPortsLease) (THIS_ const DPNHHANDLE hRegisteredPorts, const DWORD dwLeaseTime, const DWORD dwFlags) PURE;
};
/****************************************************************************
*
* DirectPlay NAT Helper application interface macros
*
****************************************************************************/
#if (! defined(__cplusplus) || defined(CINTERFACE))
#define IDirectPlayNATHelp_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectPlayNATHelp_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirectPlayNATHelp_Release(p) (p)->lpVtbl->Release(p)
#define IDirectPlayNATHelp_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
#define IDirectPlayNATHelp_Close(p,a) (p)->lpVtbl->Close(p,a)
#define IDirectPlayNATHelp_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b)
#define IDirectPlayNATHelp_RegisterPorts(p,a,b,c,d,e,f) (p)->lpVtbl->RegisterPorts(p,a,b,c,d,e,f)
#define IDirectPlayNATHelp_GetRegisteredAddresses(p,a,b,c,d,e,f) (p)->lpVtbl->GetRegisteredAddresses(p,a,b,c,d,e,f)
#define IDirectPlayNATHelp_DeregisterPorts(p,a,b) (p)->lpVtbl->DeregisterPorts(p,a,b)
#define IDirectPlayNATHelp_QueryAddress(p,a,b,c,d,e) (p)->lpVtbl->QueryAddress(p,a,b,c,d,e)
#define IDirectPlayNATHelp_SetAlertEvent(p,a,b) (p)->lpVtbl->SetAlertEvent(p,a,b)
#define IDirectPlayNATHelp_SetAlertIOCompletionPort(p,a,b,c,d) (p)->lpVtbl->SetAlertIOCompletionPort(p,a,b,c,d)
#define IDirectPlayNATHelp_ExtendRegisteredPortsLease(p,a,b,c) (p)->lpVtbl->ExtendRegisteredPortsLease(p,a,b,c)
#else // C++
#define IDirectPlayNATHelp_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirectPlayNATHelp_AddRef(p) (p)->AddRef()
#define IDirectPlayNATHelp_Release(p) (p)->Release()
#define IDirectPlayNATHelp_Initialize(p,a) (p)->Initialize(a)
#define IDirectPlayNATHelp_Close(p,a) (p)->Close(a)
#define IDirectPlayNATHelp_GetCaps(p,a,b) (p)->GetCaps(a,b)
#define IDirectPlayNATHelp_RegisterPorts(p,a,b,c,d,e,f) (p)->RegisterPorts(a,b,c,d,e,f)
#define IDirectPlayNATHelp_GetRegisteredAddresses(p,a,b,c,d,e,f) (p)->GetRegisteredAddresses(a,b,c,d,e,f)
#define IDirectPlayNATHelp_DeregisterPorts(p,a,b) (p)->DeregisterPorts(a,b)
#define IDirectPlayNATHelp_QueryAddress(p,a,b,c,d,e) (p)->QueryAddress(a,b,c,d,e)
#define IDirectPlayNATHelp_SetAlertEvent(p,a,b) (p)->SetAlertEvent(a,b)
#define IDirectPlayNATHelp_SetAlertIOCompletionPort(p,a,b,c,d) (p)->SetAlertIOCompletionPort(a,b,c,d)
#define IDirectPlayNATHelp_ExtendRegisteredPortsLease(p,a,b,c) (p)->ExtendRegisteredPortsLease(a,b,c)
#endif
/****************************************************************************
*
* DirectPlay NAT Helper return codes
*
* Errors are represented by negative values and cannot be combined.
*
****************************************************************************/
#define _DPNH_FACILITY_CODE 0x015
#define _DPNH_HRESULT_BASE 0xF000
#define MAKE_DPNHSUCCESS(code) MAKE_HRESULT(0, _DPNH_FACILITY_CODE, (code + _DPNH_HRESULT_BASE))
#define MAKE_DPNHFAILURE(code) MAKE_HRESULT(1, _DPNH_FACILITY_CODE, (code + _DPNH_HRESULT_BASE))
#define DPNH_OK S_OK
#define DPNHSUCCESS_ADDRESSESCHANGED MAKE_DPNHSUCCESS(0x10)
#define DPNHERR_ALREADYINITIALIZED MAKE_DPNHFAILURE(0x10)
#define DPNHERR_BUFFERTOOSMALL MAKE_DPNHFAILURE(0x20)
#define DPNHERR_GENERIC E_FAIL
#define DPNHERR_INVALIDFLAGS MAKE_DPNHFAILURE(0x30)
#define DPNHERR_INVALIDOBJECT MAKE_DPNHFAILURE(0x40)
#define DPNHERR_INVALIDPARAM E_INVALIDARG
#define DPNHERR_INVALIDPOINTER E_POINTER
#define DPNHERR_NOMAPPING MAKE_DPNHFAILURE(0x50)
#define DPNHERR_NOMAPPINGBUTPRIVATE MAKE_DPNHFAILURE(0x60)
#define DPNHERR_NOTINITIALIZED MAKE_DPNHFAILURE(0x70)
#define DPNHERR_OUTOFMEMORY E_OUTOFMEMORY
#define DPNHERR_PORTALREADYREGISTERED MAKE_DPNHFAILURE(0x80)
#define DPNHERR_PORTUNAVAILABLE MAKE_DPNHFAILURE(0x90)
#define DPNHERR_REENTRANT MAKE_DPNHFAILURE(0x95)
#define DPNHERR_SERVERNOTAVAILABLE MAKE_DPNHFAILURE(0xA0)
#define DPNHERR_UPDATESERVERSTATUS MAKE_DPNHFAILURE(0xC0)
#ifdef __cplusplus
}
#endif
#endif // __DPNATHLP_H__

View File

@ -0,0 +1,195 @@
/*==========================================================================;
*
* Copyright (c) Microsoft Corporation. All rights reserved.
*
* File: dsconf.h
* Content: DirectSound configuration interface include file
*
**************************************************************************/
#ifndef __DSCONF_INCLUDED__
#define __DSCONF_INCLUDED__
#ifndef __DSOUND_INCLUDED__
#error dsound.h not included
#endif // __DSOUND_INCLUDED__
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
// DirectSound Private Component GUID {11AB3EC0-25EC-11d1-A4D8-00C04FC28ACA}
DEFINE_GUID(CLSID_DirectSoundPrivate, 0x11ab3ec0, 0x25ec, 0x11d1, 0xa4, 0xd8, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca);
//
// DirectSound Device Properties {84624F82-25EC-11d1-A4D8-00C04FC28ACA}
//
DEFINE_GUID(DSPROPSETID_DirectSoundDevice, 0x84624f82, 0x25ec, 0x11d1, 0xa4, 0xd8, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca);
typedef enum
{
DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A = 1,
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1 = 2,
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1 = 3,
DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W = 4,
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A = 5,
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W = 6,
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A = 7,
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W = 8,
} DSPROPERTY_DIRECTSOUNDDEVICE;
#if DIRECTSOUND_VERSION >= 0x0700
#ifdef UNICODE
#define DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W
#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W
#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W
#else // UNICODE
#define DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A
#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A
#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A
#endif // UNICODE
#else // DIRECTSOUND_VERSION >= 0x0700
#define DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A
#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1
#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1
#endif // DIRECTSOUND_VERSION >= 0x0700
typedef enum
{
DIRECTSOUNDDEVICE_TYPE_EMULATED,
DIRECTSOUNDDEVICE_TYPE_VXD,
DIRECTSOUNDDEVICE_TYPE_WDM
} DIRECTSOUNDDEVICE_TYPE;
typedef enum
{
DIRECTSOUNDDEVICE_DATAFLOW_RENDER,
DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE
} DIRECTSOUNDDEVICE_DATAFLOW;
typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA
{
LPSTR DeviceName; // waveIn/waveOut device name
DIRECTSOUNDDEVICE_DATAFLOW DataFlow; // Data flow (i.e. waveIn or waveOut)
GUID DeviceId; // DirectSound device id
} DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA;
typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA
{
LPWSTR DeviceName; // waveIn/waveOut device name
DIRECTSOUNDDEVICE_DATAFLOW DataFlow; // Data flow (i.e. waveIn or waveOut)
GUID DeviceId; // DirectSound device id
} DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA;
#ifdef UNICODE
#define DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_DATA DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA
#define PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA
#else // UNICODE
#define DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_DATA DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA
#define PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA
#endif // UNICODE
typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA
{
GUID DeviceId; // DirectSound device id
CHAR DescriptionA[0x100]; // Device description (ANSI)
WCHAR DescriptionW[0x100]; // Device description (Unicode)
CHAR ModuleA[MAX_PATH]; // Device driver module (ANSI)
WCHAR ModuleW[MAX_PATH]; // Device driver module (Unicode)
DIRECTSOUNDDEVICE_TYPE Type; // Device type
DIRECTSOUNDDEVICE_DATAFLOW DataFlow; // Device dataflow
ULONG WaveDeviceId; // Wave device id
ULONG Devnode; // Devnode (or DevInst)
} DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA;
typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA
{
DIRECTSOUNDDEVICE_TYPE Type; // Device type
DIRECTSOUNDDEVICE_DATAFLOW DataFlow; // Device dataflow
GUID DeviceId; // DirectSound device id
LPSTR Description; // Device description
LPSTR Module; // Device driver module
LPSTR Interface; // Device interface
ULONG WaveDeviceId; // Wave device id
} DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA;
typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA
{
DIRECTSOUNDDEVICE_TYPE Type; // Device type
DIRECTSOUNDDEVICE_DATAFLOW DataFlow; // Device dataflow
GUID DeviceId; // DirectSound device id
LPWSTR Description; // Device description
LPWSTR Module; // Device driver module
LPWSTR Interface; // Device interface
ULONG WaveDeviceId; // Wave device id
} DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA;
#if DIRECTSOUND_VERSION >= 0x0700
#ifdef UNICODE
#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA
#define PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA
#else // UNICODE
#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA
#define PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA
#endif // UNICODE
#else // DIRECTSOUND_VERSION >= 0x0700
#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA
#define PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA
#endif // DIRECTSOUND_VERSION >= 0x0700
typedef BOOL (CALLBACK *LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK1)(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA, LPVOID);
typedef BOOL (CALLBACK *LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKA)(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA, LPVOID);
typedef BOOL (CALLBACK *LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKW)(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA, LPVOID);
#if DIRECTSOUND_VERSION >= 0x0700
#ifdef UNICODE
#define LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKW
#else // UNICODE
#define LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKA
#endif // UNICODE
#else // DIRECTSOUND_VERSION >= 0x0700
#define LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK1
#endif // DIRECTSOUND_VERSION >= 0x0700
typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA
{
LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK1 Callback; // Callback function pointer
LPVOID Context; // Callback function context argument
} DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA;
typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA
{
LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKA Callback; // Callback function pointer
LPVOID Context; // Callback function context argument
} DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA;
typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA
{
LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKW Callback; // Callback function pointer
LPVOID Context; // Callback function context argument
} DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA;
#if DIRECTSOUND_VERSION >= 0x0700
#ifdef UNICODE
#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA
#define PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA
#else // UNICODE
#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA
#define PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA
#endif // UNICODE
#else // DIRECTSOUND_VERSION >= 0x0700
#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA
#define PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA
#endif // DIRECTSOUND_VERSION >= 0x0700
#ifdef __cplusplus
}
#endif // __cplusplus
#endif // __DSCONF_INCLUDED__

View File

@ -0,0 +1,286 @@
/*==========================================================================
*
* Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
*
* File: dsetup.h
* Content: DirectXSetup, error codes and flags
***************************************************************************/
#ifndef __DSETUP_H__
#define __DSETUP_H__
#include <windows.h> // windows stuff
#ifdef _WIN32
#define COM_NO_WINDOWS_H
#include <objbase.h>
#else
#endif
#ifdef __cplusplus
extern "C" {
#endif
#define FOURCC_VERS mmioFOURCC('v','e','r','s')
// DSETUP Error Codes, must remain compatible with previous setup.
#define DSETUPERR_SUCCESS_RESTART 1
#define DSETUPERR_SUCCESS 0
#define DSETUPERR_BADWINDOWSVERSION -1
#define DSETUPERR_SOURCEFILENOTFOUND -2
#define DSETUPERR_NOCOPY -5
#define DSETUPERR_OUTOFDISKSPACE -6
#define DSETUPERR_CANTFINDINF -7
#define DSETUPERR_CANTFINDDIR -8
#define DSETUPERR_INTERNAL -9
#define DSETUPERR_UNKNOWNOS -11
#define DSETUPERR_NEWERVERSION -14
#define DSETUPERR_NOTADMIN -15
#define DSETUPERR_UNSUPPORTEDPROCESSOR -16
#define DSETUPERR_MISSINGCAB_MANAGEDDX -17
#define DSETUPERR_NODOTNETFRAMEWORKINSTALLED -18
#define DSETUPERR_CABDOWNLOADFAIL -19
#define DSETUPERR_DXCOMPONENTFILEINUSE -20
#define DSETUPERR_UNTRUSTEDCABINETFILE -21
// DSETUP flags. DirectX 5.0 apps should use these flags only.
#define DSETUP_DDRAWDRV 0x00000008 /* install DirectDraw Drivers */
#define DSETUP_DSOUNDDRV 0x00000010 /* install DirectSound Drivers */
#define DSETUP_DXCORE 0x00010000 /* install DirectX runtime */
#define DSETUP_DIRECTX (DSETUP_DXCORE|DSETUP_DDRAWDRV|DSETUP_DSOUNDDRV)
#define DSETUP_MANAGEDDX 0x00004000 /* OBSOLETE. install managed DirectX */
#define DSETUP_TESTINSTALL 0x00020000 /* just test install, don't do anything */
// These OBSOLETE flags are here for compatibility with pre-DX5 apps only.
// They are present to allow DX3 apps to be recompiled with DX5 and still work.
// DO NOT USE THEM for DX5. They will go away in future DX releases.
#define DSETUP_DDRAW 0x00000001 /* OBSOLETE. install DirectDraw */
#define DSETUP_DSOUND 0x00000002 /* OBSOLETE. install DirectSound */
#define DSETUP_DPLAY 0x00000004 /* OBSOLETE. install DirectPlay */
#define DSETUP_DPLAYSP 0x00000020 /* OBSOLETE. install DirectPlay Providers */
#define DSETUP_DVIDEO 0x00000040 /* OBSOLETE. install DirectVideo */
#define DSETUP_D3D 0x00000200 /* OBSOLETE. install Direct3D */
#define DSETUP_DINPUT 0x00000800 /* OBSOLETE. install DirectInput */
#define DSETUP_DIRECTXSETUP 0x00001000 /* OBSOLETE. install DirectXSetup DLL's */
#define DSETUP_NOUI 0x00002000 /* OBSOLETE. install DirectX with NO UI */
#define DSETUP_PROMPTFORDRIVERS 0x10000000 /* OBSOLETE. prompt when replacing display/audio drivers */
#define DSETUP_RESTOREDRIVERS 0x20000000 /* OBSOLETE. restore display/audio drivers */
//******************************************************************
// DirectX Setup Callback mechanism
//******************************************************************
// DSETUP Message Info Codes, passed to callback as Reason parameter.
#define DSETUP_CB_MSG_NOMESSAGE 0
#define DSETUP_CB_MSG_INTERNAL_ERROR 10
#define DSETUP_CB_MSG_BEGIN_INSTALL 13
#define DSETUP_CB_MSG_BEGIN_INSTALL_RUNTIME 14
#define DSETUP_CB_MSG_PROGRESS 18
#define DSETUP_CB_MSG_WARNING_DISABLED_COMPONENT 19
typedef struct _DSETUP_CB_PROGRESS
{
DWORD dwPhase;
DWORD dwInPhaseMaximum;
DWORD dwInPhaseProgress;
DWORD dwOverallMaximum;
DWORD dwOverallProgress;
} DSETUP_CB_PROGRESS;
enum _DSETUP_CB_PROGRESS_PHASE
{
DSETUP_INITIALIZING,
DSETUP_EXTRACTING,
DSETUP_COPYING,
DSETUP_FINALIZING
};
#ifdef _WIN32
//
// Data Structures
//
#ifndef UNICODE_ONLY
typedef struct _DIRECTXREGISTERAPPA {
DWORD dwSize;
DWORD dwFlags;
LPSTR lpszApplicationName;
LPGUID lpGUID;
LPSTR lpszFilename;
LPSTR lpszCommandLine;
LPSTR lpszPath;
LPSTR lpszCurrentDirectory;
} DIRECTXREGISTERAPPA, *PDIRECTXREGISTERAPPA, *LPDIRECTXREGISTERAPPA;
typedef struct _DIRECTXREGISTERAPP2A {
DWORD dwSize;
DWORD dwFlags;
LPSTR lpszApplicationName;
LPGUID lpGUID;
LPSTR lpszFilename;
LPSTR lpszCommandLine;
LPSTR lpszPath;
LPSTR lpszCurrentDirectory;
LPSTR lpszLauncherName;
} DIRECTXREGISTERAPP2A, *PDIRECTXREGISTERAPP2A, *LPDIRECTXREGISTERAPP2A;
#endif //!UNICODE_ONLY
#ifndef ANSI_ONLY
typedef struct _DIRECTXREGISTERAPPW {
DWORD dwSize;
DWORD dwFlags;
LPWSTR lpszApplicationName;
LPGUID lpGUID;
LPWSTR lpszFilename;
LPWSTR lpszCommandLine;
LPWSTR lpszPath;
LPWSTR lpszCurrentDirectory;
} DIRECTXREGISTERAPPW, *PDIRECTXREGISTERAPPW, *LPDIRECTXREGISTERAPPW;
typedef struct _DIRECTXREGISTERAPP2W {
DWORD dwSize;
DWORD dwFlags;
LPWSTR lpszApplicationName;
LPGUID lpGUID;
LPWSTR lpszFilename;
LPWSTR lpszCommandLine;
LPWSTR lpszPath;
LPWSTR lpszCurrentDirectory;
LPWSTR lpszLauncherName;
} DIRECTXREGISTERAPP2W, *PDIRECTXREGISTERAPP2W, *LPDIRECTXREGISTERAPP2W;
#endif //!ANSI_ONLY
#ifdef UNICODE
typedef DIRECTXREGISTERAPPW DIRECTXREGISTERAPP;
typedef PDIRECTXREGISTERAPPW PDIRECTXREGISTERAPP;
typedef LPDIRECTXREGISTERAPPW LPDIRECTXREGISTERAPP;
typedef DIRECTXREGISTERAPP2W DIRECTXREGISTERAPP2;
typedef PDIRECTXREGISTERAPP2W PDIRECTXREGISTERAPP2;
typedef LPDIRECTXREGISTERAPP2W LPDIRECTXREGISTERAPP2;
#else
typedef DIRECTXREGISTERAPPA DIRECTXREGISTERAPP;
typedef PDIRECTXREGISTERAPPA PDIRECTXREGISTERAPP;
typedef LPDIRECTXREGISTERAPPA LPDIRECTXREGISTERAPP;
typedef DIRECTXREGISTERAPP2A DIRECTXREGISTERAPP2;
typedef PDIRECTXREGISTERAPP2A PDIRECTXREGISTERAPP2;
typedef LPDIRECTXREGISTERAPP2A LPDIRECTXREGISTERAPP2;
#endif // UNICODE
//
// API
//
#ifndef UNICODE_ONLY
INT
WINAPI
DirectXSetupA(
HWND hWnd,
LPSTR lpszRootPath,
DWORD dwFlags
);
#endif //!UNICODE_ONLY
#ifndef ANSI_ONLY
INT
WINAPI
DirectXSetupW(
HWND hWnd,
LPWSTR lpszRootPath,
DWORD dwFlags
);
#endif //!ANSI_ONLY
#ifdef UNICODE
#define DirectXSetup DirectXSetupW
#else
#define DirectXSetup DirectXSetupA
#endif // !UNICODE
#ifndef UNICODE_ONLY
INT
WINAPI
DirectXRegisterApplicationA(
HWND hWnd,
LPVOID lpDXRegApp
);
#endif //!UNICODE_ONLY
#ifndef ANSI_ONLY
INT
WINAPI
DirectXRegisterApplicationW(
HWND hWnd,
LPVOID lpDXRegApp
);
#endif //!ANSI_ONLY
#ifdef UNICODE
#define DirectXRegisterApplication DirectXRegisterApplicationW
#else
#define DirectXRegisterApplication DirectXRegisterApplicationA
#endif // !UNICODE
INT
WINAPI
DirectXUnRegisterApplication(
HWND hWnd,
LPGUID lpGUID
);
//
// Function Pointers
//
#ifdef UNICODE
typedef INT (WINAPI * LPDIRECTXSETUP)(HWND, LPWSTR, DWORD);
typedef INT (WINAPI * LPDIRECTXREGISTERAPPLICATION)(HWND, LPVOID);
#else
typedef INT (WINAPI * LPDIRECTXSETUP)(HWND, LPSTR, DWORD);
typedef INT (WINAPI * LPDIRECTXREGISTERAPPLICATION)(HWND, LPVOID);
#endif // UNICODE
typedef DWORD (FAR PASCAL * DSETUP_CALLBACK)(DWORD Reason,
DWORD MsgType, /* Same as flags to MessageBox */
LPSTR szMessage,
LPSTR szName,
void *pInfo);
INT WINAPI DirectXSetupSetCallback(DSETUP_CALLBACK Callback);
INT WINAPI DirectXSetupGetVersion(DWORD *lpdwVersion, DWORD *lpdwMinorVersion);
INT WINAPI DirectXSetupShowEULA(HWND hWndParent);
#ifndef UNICODE_ONLY
UINT
WINAPI
DirectXSetupGetEULAA(
LPSTR lpszEULA,
UINT cchEULA,
WORD LangID
);
#endif //!UNICODE_ONLY
#ifndef ANSI_ONLY
UINT
WINAPI
DirectXSetupGetEULAW(
LPWSTR lpszEULA,
UINT cchEULA,
WORD LangID
);
#endif //!ANSI_ONLY
#ifdef UNICODE
#define DirectXSetupGetEULA DirectXSetupGetEULAW
typedef UINT (WINAPI * LPDIRECTXSETUPGETEULA)(LPWSTR, UINT, WORD);
#else
#define DirectXSetupGetEULA DirectXSetupGetEULAA
typedef UINT (WINAPI * LPDIRECTXSETUPGETEULA)(LPSTR, UINT, WORD);
#endif // !UNICODE
#endif // WIN32
#ifdef __cplusplus
};
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,857 @@
/*==========================================================================;
*
* Copyright (C) 1999 Microsoft Corporation. All Rights Reserved.
*
* File: dpvoice.h
* Content: DirectPlayVoice include file
***************************************************************************/
#ifndef __DVOICE__
#define __DVOICE__
#include <ole2.h> // for DECLARE_INTERFACE and HRESULT
#include <mmsystem.h>
#include <mmreg.h>
#include <msacm.h>
#include "dsound.h"
#ifdef __cplusplus
extern "C" {
#endif
/****************************************************************************
*
* DirectPlayVoice CLSIDs
*
****************************************************************************/
// {B9F3EB85-B781-4ac1-8D90-93A05EE37D7D}
DEFINE_GUID(CLSID_DirectPlayVoiceClient,
0xb9f3eb85, 0xb781, 0x4ac1, 0x8d, 0x90, 0x93, 0xa0, 0x5e, 0xe3, 0x7d, 0x7d);
// {D3F5B8E6-9B78-4a4c-94EA-CA2397B663D3}
DEFINE_GUID(CLSID_DirectPlayVoiceServer,
0xd3f5b8e6, 0x9b78, 0x4a4c, 0x94, 0xea, 0xca, 0x23, 0x97, 0xb6, 0x63, 0xd3);
// {0F0F094B-B01C-4091-A14D-DD0CD807711A}
DEFINE_GUID(CLSID_DirectPlayVoiceTest,
0xf0f094b, 0xb01c, 0x4091, 0xa1, 0x4d, 0xdd, 0xc, 0xd8, 0x7, 0x71, 0x1a);
/****************************************************************************
*
* DirectPlayVoice Interface IIDs
*
****************************************************************************/
// {1DFDC8EA-BCF7-41d6-B295-AB64B3B23306}
DEFINE_GUID(IID_IDirectPlayVoiceClient,
0x1dfdc8ea, 0xbcf7, 0x41d6, 0xb2, 0x95, 0xab, 0x64, 0xb3, 0xb2, 0x33, 0x6);
// {FAA1C173-0468-43b6-8A2A-EA8A4F2076C9}
DEFINE_GUID(IID_IDirectPlayVoiceServer,
0xfaa1c173, 0x468, 0x43b6, 0x8a, 0x2a, 0xea, 0x8a, 0x4f, 0x20, 0x76, 0xc9);
// {D26AF734-208B-41da-8224-E0CE79810BE1}
DEFINE_GUID(IID_IDirectPlayVoiceTest,
0xd26af734, 0x208b, 0x41da, 0x82, 0x24, 0xe0, 0xce, 0x79, 0x81, 0xb, 0xe1);
/****************************************************************************
*
* DirectPlayVoice Compression Type GUIDs
*
****************************************************************************/
// MS-ADPCM 32.8 kbit/s
//
// {699B52C1-A885-46a8-A308-97172419ADC7}
DEFINE_GUID(DPVCTGUID_ADPCM,
0x699b52c1, 0xa885, 0x46a8, 0xa3, 0x8, 0x97, 0x17, 0x24, 0x19, 0xad, 0xc7);
// Microsoft GSM 6.10 13 kbit/s
//
// {24768C60-5A0D-11d3-9BE4-525400D985E7}
DEFINE_GUID(DPVCTGUID_GSM,
0x24768c60, 0x5a0d, 0x11d3, 0x9b, 0xe4, 0x52, 0x54, 0x0, 0xd9, 0x85, 0xe7);
// MS-PCM 64 kbit/s
//
// {8DE12FD4-7CB3-48ce-A7E8-9C47A22E8AC5}
DEFINE_GUID(DPVCTGUID_NONE,
0x8de12fd4, 0x7cb3, 0x48ce, 0xa7, 0xe8, 0x9c, 0x47, 0xa2, 0x2e, 0x8a, 0xc5);
// Voxware SC03 3.2kbit/s
//
// {7D82A29B-2242-4f82-8F39-5D1153DF3E41}
DEFINE_GUID(DPVCTGUID_SC03,
0x7d82a29b, 0x2242, 0x4f82, 0x8f, 0x39, 0x5d, 0x11, 0x53, 0xdf, 0x3e, 0x41);
// Voxware SC06 6.4kbit/s
//
// {53DEF900-7168-4633-B47F-D143916A13C7}
DEFINE_GUID(DPVCTGUID_SC06,
0x53def900, 0x7168, 0x4633, 0xb4, 0x7f, 0xd1, 0x43, 0x91, 0x6a, 0x13, 0xc7);
// TrueSpeech(TM) 8.6 kbit/s
//
// {D7954361-5A0B-11d3-9BE4-525400D985E7}
DEFINE_GUID(DPVCTGUID_TRUESPEECH,
0xd7954361, 0x5a0b, 0x11d3, 0x9b, 0xe4, 0x52, 0x54, 0x0, 0xd9, 0x85, 0xe7);
// Voxware VR12 1.4kbit/s
//
// {FE44A9FE-8ED4-48bf-9D66-1B1ADFF9FF6D}
DEFINE_GUID(DPVCTGUID_VR12,
0xfe44a9fe, 0x8ed4, 0x48bf, 0x9d, 0x66, 0x1b, 0x1a, 0xdf, 0xf9, 0xff, 0x6d);
// Define the default compression type
#define DPVCTGUID_DEFAULT DPVCTGUID_SC03
/****************************************************************************
*
* DirectPlayVoice Interface Pointer definitions
*
****************************************************************************/
typedef struct IDirectPlayVoiceClient FAR *LPDIRECTPLAYVOICECLIENT, *PDIRECTPLAYVOICECLIENT;
typedef struct IDirectPlayVoiceServer FAR *LPDIRECTPLAYVOICESERVER, *PDIRECTPLAYVOICESERVER;
typedef struct IDirectPlayVoiceTest FAR *LPDIRECTPLAYVOICETEST, *PDIRECTPLAYVOICETEST;
/****************************************************************************
*
* DirectPlayVoice Callback Functions
*
****************************************************************************/
typedef HRESULT (FAR PASCAL *PDVMESSAGEHANDLER)(
PVOID pvUserContext,
DWORD dwMessageType,
LPVOID lpMessage
);
typedef PDVMESSAGEHANDLER LPDVMESSAGEHANDLER;
/****************************************************************************
*
* DirectPlayVoice Datatypes (Non-Structure / Non-Message)
*
****************************************************************************/
typedef DWORD DVID, *LPDVID, *PDVID;
/****************************************************************************
*
* DirectPlayVoice Message Types
*
****************************************************************************/
#define DVMSGID_BASE 0x0000
#define DVMSGID_MINBASE (DVMSGID_CREATEVOICEPLAYER)
#define DVMSGID_CREATEVOICEPLAYER (DVMSGID_BASE+0x0001)
#define DVMSGID_DELETEVOICEPLAYER (DVMSGID_BASE+0x0002)
#define DVMSGID_SESSIONLOST (DVMSGID_BASE+0x0003)
#define DVMSGID_PLAYERVOICESTART (DVMSGID_BASE+0x0004)
#define DVMSGID_PLAYERVOICESTOP (DVMSGID_BASE+0x0005)
#define DVMSGID_RECORDSTART (DVMSGID_BASE+0x0006)
#define DVMSGID_RECORDSTOP (DVMSGID_BASE+0x0007)
#define DVMSGID_CONNECTRESULT (DVMSGID_BASE+0x0008)
#define DVMSGID_DISCONNECTRESULT (DVMSGID_BASE+0x0009)
#define DVMSGID_INPUTLEVEL (DVMSGID_BASE+0x000A)
#define DVMSGID_OUTPUTLEVEL (DVMSGID_BASE+0x000B)
#define DVMSGID_HOSTMIGRATED (DVMSGID_BASE+0x000C)
#define DVMSGID_SETTARGETS (DVMSGID_BASE+0x000D)
#define DVMSGID_PLAYEROUTPUTLEVEL (DVMSGID_BASE+0x000E)
#define DVMSGID_LOSTFOCUS (DVMSGID_BASE+0x0010)
#define DVMSGID_GAINFOCUS (DVMSGID_BASE+0x0011)
#define DVMSGID_LOCALHOSTSETUP (DVMSGID_BASE+0x0012)
#define DVMSGID_MAXBASE (DVMSGID_LOCALHOSTSETUP)
/****************************************************************************
*
* DirectPlayVoice Constants
*
****************************************************************************/
//
// Buffer Aggresiveness Value Ranges
//
#define DVBUFFERAGGRESSIVENESS_MIN 0x00000001
#define DVBUFFERAGGRESSIVENESS_MAX 0x00000064
#define DVBUFFERAGGRESSIVENESS_DEFAULT 0x00000000
//
// Buffer Quality Value Ranges
//
#define DVBUFFERQUALITY_MIN 0x00000001
#define DVBUFFERQUALITY_MAX 0x00000064
#define DVBUFFERQUALITY_DEFAULT 0x00000000
#define DVID_SYS 0
//
// Used to identify the session host in client/server
//
#define DVID_SERVERPLAYER 1
//
// Used to target all players
//
#define DVID_ALLPLAYERS 0
//
// Used to identify the main buffer
//
#define DVID_REMAINING 0xFFFFFFFF
//
// Input level range
//
#define DVINPUTLEVEL_MIN 0x00000000
#define DVINPUTLEVEL_MAX 0x00000063 // 99 decimal
#define DVNOTIFYPERIOD_MINPERIOD 20
#define DVPLAYBACKVOLUME_DEFAULT DSBVOLUME_MAX
#define DVRECORDVOLUME_LAST 0x00000001
//
// Use the default value
//
#define DVTHRESHOLD_DEFAULT 0xFFFFFFFF
//
// Threshold Ranges
//
#define DVTHRESHOLD_MIN 0x00000000
#define DVTHRESHOLD_MAX 0x00000063 // 99 decimal
//
// Threshold field is not used
//
#define DVTHRESHOLD_UNUSED 0xFFFFFFFE
//
// Session Types
//
#define DVSESSIONTYPE_PEER 0x00000001
#define DVSESSIONTYPE_MIXING 0x00000002
#define DVSESSIONTYPE_FORWARDING 0x00000003
#define DVSESSIONTYPE_ECHO 0x00000004
/****************************************************************************
*
* DirectPlayVoice Flags
*
****************************************************************************/
//
// Enable automatic adjustment of the recording volume
//
#define DVCLIENTCONFIG_AUTORECORDVOLUME 0x00000008
//
// Enable automatic voice activation
//
#define DVCLIENTCONFIG_AUTOVOICEACTIVATED 0x00000020
//
// Enable echo suppression
//
#define DVCLIENTCONFIG_ECHOSUPPRESSION 0x08000000
//
// Voice Activation manual mode
//
#define DVCLIENTCONFIG_MANUALVOICEACTIVATED 0x00000004
//
// Only playback voices that have buffers created for them
//
#define DVCLIENTCONFIG_MUTEGLOBAL 0x00000010
//
// Mute the playback
//
#define DVCLIENTCONFIG_PLAYBACKMUTE 0x00000002
//
// Mute the recording
//
#define DVCLIENTCONFIG_RECORDMUTE 0x00000001
//
// Complete the operation before returning
//
#define DVFLAGS_SYNC 0x00000001
//
// Just check to see if wizard has been run, and if so what it's results were
//
#define DVFLAGS_QUERYONLY 0x00000002
//
// Shutdown the voice session without migrating the host
//
#define DVFLAGS_NOHOSTMIGRATE 0x00000008
//
// Allow the back button to be enabled in the wizard
//
#define DVFLAGS_ALLOWBACK 0x00000010
//
// Disable host migration in the voice session
//
#define DVSESSION_NOHOSTMIGRATION 0x00000001
//
// Server controlled targetting
//
#define DVSESSION_SERVERCONTROLTARGET 0x00000002
//
// Use DirectSound Normal Mode instead of priority
//
#define DVSOUNDCONFIG_NORMALMODE 0x00000001
//
// Automatically select the microphone
//
#define DVSOUNDCONFIG_AUTOSELECT 0x00000002
//
// Run in half duplex mode
//
#define DVSOUNDCONFIG_HALFDUPLEX 0x00000004
//
// No volume controls are available for the recording device
//
#define DVSOUNDCONFIG_NORECVOLAVAILABLE 0x00000010
//
// Disable capture sharing
//
#define DVSOUNDCONFIG_NOFOCUS 0x20000000
//
// Set system conversion quality to high
//
#define DVSOUNDCONFIG_SETCONVERSIONQUALITY 0x00000008
//
// Enable strict focus mode
//
#define DVSOUNDCONFIG_STRICTFOCUS 0x40000000
//
// Player is in half duplex mode
//
#define DVPLAYERCAPS_HALFDUPLEX 0x00000001
//
// Specifies that player is the local player
//
#define DVPLAYERCAPS_LOCAL 0x00000002
/****************************************************************************
*
* DirectPlayVoice Structures (Non-Message)
*
****************************************************************************/
//
// DirectPlayVoice Caps
// (GetCaps / SetCaps)
//
typedef struct
{
DWORD dwSize; // Size of this structure
DWORD dwFlags; // Caps flags
} DVCAPS, *LPDVCAPS, *PDVCAPS;
//
// DirectPlayVoice Client Configuration
// (Connect / GetClientConfig)
//
typedef struct
{
DWORD dwSize; // Size of this structure
DWORD dwFlags; // Flags for client config (DVCLIENTCONFIG_...)
LONG lRecordVolume; // Recording volume
LONG lPlaybackVolume; // Playback volume
DWORD dwThreshold; // Voice Activation Threshold
DWORD dwBufferQuality; // Buffer quality
DWORD dwBufferAggressiveness; // Buffer aggressiveness
DWORD dwNotifyPeriod; // Period of notification messages (ms)
} DVCLIENTCONFIG, *LPDVCLIENTCONFIG, *PDVCLIENTCONFIG;
//
// DirectPlayVoice Compression Type Information
// (GetCompressionTypes)
//
typedef struct
{
DWORD dwSize; // Size of this structure
GUID guidType; // GUID that identifies this compression type
LPWSTR lpszName; // String name of this compression type
LPWSTR lpszDescription; // Description for this compression type
DWORD dwFlags; // Flags for this compression type
DWORD dwMaxBitsPerSecond; // Maximum # of bit/s this compression type uses
} DVCOMPRESSIONINFO, *LPDVCOMPRESSIONINFO, *PDVCOMPRESSIONINFO;
//
// DirectPlayVoice Session Description
// (Host / GetSessionDesc)
//
typedef struct
{
DWORD dwSize; // Size of this structure
DWORD dwFlags; // Session flags (DVSESSION_...)
DWORD dwSessionType; // Session type (DVSESSIONTYPE_...)
GUID guidCT; // Compression Type to use
DWORD dwBufferQuality; // Buffer quality
DWORD dwBufferAggressiveness; // Buffer aggresiveness
} DVSESSIONDESC, *LPDVSESSIONDESC, *PDVSESSIONDESC;
//
// DirectPlayVoice Client Sound Device Configuration
// (Connect / GetSoundDeviceConfig)
//
typedef struct
{
DWORD dwSize; // Size of this structure
DWORD dwFlags; // Flags for sound config (DVSOUNDCONFIG_...)
GUID guidPlaybackDevice; // GUID of the playback device to use
LPDIRECTSOUND lpdsPlaybackDevice; // DirectSound Object to use (optional)
GUID guidCaptureDevice; // GUID of the capture device to use
LPDIRECTSOUNDCAPTURE lpdsCaptureDevice; // DirectSoundCapture Object to use (optional)
HWND hwndAppWindow; // HWND of your application's top-level window
LPDIRECTSOUNDBUFFER lpdsMainBuffer; // DirectSoundBuffer to use for playback (optional)
DWORD dwMainBufferFlags; // Flags to pass to Play() on the main buffer
DWORD dwMainBufferPriority; // Priority to set when calling Play() on the main buffer
} DVSOUNDDEVICECONFIG, *LPDVSOUNDDEVICECONFIG, *PDVSOUNDDEVICECONFIG;
/****************************************************************************
*
* DirectPlayVoice message handler call back structures
*
****************************************************************************/
//
// Result of the Connect() call. (If it wasn't called Async)
// (DVMSGID_CONNECTRESULT)
//
typedef struct
{
DWORD dwSize; // Size of this structure
HRESULT hrResult; // Result of the Connect() call
} DVMSG_CONNECTRESULT, *LPDVMSG_CONNECTRESULT, *PDVMSG_CONNECTRESULT;
//
// A new player has entered the voice session
// (DVMSGID_CREATEVOICEPLAYER)
//
typedef struct
{
DWORD dwSize; // Size of this structure
DVID dvidPlayer; // DVID of the player who joined
DWORD dwFlags; // Player flags (DVPLAYERCAPS_...)
PVOID pvPlayerContext; // Context value for this player (user set)
} DVMSG_CREATEVOICEPLAYER, *LPDVMSG_CREATEVOICEPLAYER, *PDVMSG_CREATEVOICEPLAYER;
//
// A player has left the voice session
// (DVMSGID_DELETEVOICEPLAYER)
//
typedef struct
{
DWORD dwSize; // Size of this structure
DVID dvidPlayer; // DVID of the player who left
PVOID pvPlayerContext; // Context value for the player
} DVMSG_DELETEVOICEPLAYER, *LPDVMSG_DELETEVOICEPLAYER, *PDVMSG_DELETEVOICEPLAYER;
//
// Result of the Disconnect() call. (If it wasn't called Async)
// (DVMSGID_DISCONNECTRESULT)
//
typedef struct
{
DWORD dwSize; // Size of this structure
HRESULT hrResult; // Result of the Disconnect() call
} DVMSG_DISCONNECTRESULT, *LPDVMSG_DISCONNECTRESULT, *PDVMSG_DISCONNECTRESULT;
//
// The voice session host has migrated.
// (DVMSGID_HOSTMIGRATED)
//
typedef struct
{
DWORD dwSize; // Size of this structure
DVID dvidNewHostID; // DVID of the player who is now the host
LPDIRECTPLAYVOICESERVER pdvServerInterface;
// Pointer to the new host object (if local player is now host)
} DVMSG_HOSTMIGRATED, *LPDVMSG_HOSTMIGRATED, *PDVMSG_HOSTMIGRATED;
//
// The current input level / recording volume on the local machine
// (DVMSGID_INPUTLEVEL)
//
typedef struct
{
DWORD dwSize; // Size of this structure
DWORD dwPeakLevel; // Current peak level of the audio
LONG lRecordVolume; // Current recording volume
PVOID pvLocalPlayerContext; // Context value for the local player
} DVMSG_INPUTLEVEL, *LPDVMSG_INPUTLEVEL, *PDVMSG_INPUTLEVEL;
//
// The local client is about to become the new host
// (DVMSGID_LOCALHOSTSETUP)
//
typedef struct
{
DWORD dwSize; // Size of this structure
PVOID pvContext; // Context value to be passed to Initialize() of new host object
PDVMESSAGEHANDLER pMessageHandler; // Message handler to be used by new host object
} DVMSG_LOCALHOSTSETUP, *LPDVMSG_LOCALHOSTSETUP, *PDVMSG_LOCALHOSTSETUP;
//
// The current output level for the combined output of all incoming streams.
// (DVMSGID_OUTPUTLEVEL)
//
typedef struct
{
DWORD dwSize; // Size of this structure
DWORD dwPeakLevel; // Current peak level of the output
LONG lOutputVolume; // Current playback volume
PVOID pvLocalPlayerContext; // Context value for the local player
} DVMSG_OUTPUTLEVEL, *LPDVMSG_OUTPUTLEVEL, *PDVMSG_OUTPUTLEVEL;
//
// The current peak level of an individual player's incoming audio stream as it is
// being played back.
// (DVMSGID_PLAYEROUTPUTLEVEL)
//
typedef struct
{
DWORD dwSize; // Size of this structure
DVID dvidSourcePlayerID; // DVID of the player
DWORD dwPeakLevel; // Peak level of the player's stream
PVOID pvPlayerContext; // Context value for the player
} DVMSG_PLAYEROUTPUTLEVEL, *LPDVMSG_PLAYEROUTPUTLEVEL, *PDVMSG_PLAYEROUTPUTLEVEL;
//
// An audio stream from the specified player has started playing back on the local client.
// (DVMSGID_PLAYERVOICESTART).
//
typedef struct
{
DWORD dwSize; // Size of this structure
DVID dvidSourcePlayerID; // DVID of the Player
PVOID pvPlayerContext; // Context value for this player
} DVMSG_PLAYERVOICESTART, *LPDVMSG_PLAYERVOICESTART, *PDVMSG_PLAYERVOICESTART;
//
// The audio stream from the specified player has stopped playing back on the local client.
// (DVMSGID_PLAYERVOICESTOP)
//
typedef struct
{
DWORD dwSize; // Size of this structure
DVID dvidSourcePlayerID; // DVID of the player
PVOID pvPlayerContext; // Context value for this player
} DVMSG_PLAYERVOICESTOP, *LPDVMSG_PLAYERVOICESTOP, *PDVMSG_PLAYERVOICESTOP;
//
// Transmission has started on the local machine
// (DVMSGID_RECORDSTART)
//
typedef struct
{
DWORD dwSize; // Size of this structure
DWORD dwPeakLevel; // Peak level that caused transmission to start
PVOID pvLocalPlayerContext; // Context value for the local player
} DVMSG_RECORDSTART, *LPDVMSG_RECORDSTART, *PDVMSG_RECORDSTART;
//
// Transmission has stopped on the local machine
// (DVMSGID_RECORDSTOP)
//
typedef struct
{
DWORD dwSize; // Size of this structure
DWORD dwPeakLevel; // Peak level that caused transmission to stop
PVOID pvLocalPlayerContext; // Context value for the local player
} DVMSG_RECORDSTOP, *LPDVMSG_RECORDSTOP, *PDVMSG_RECORDSTOP;
//
// The voice session has been lost
// (DVMSGID_SESSIONLOST)
//
typedef struct
{
DWORD dwSize; // Size of this structure
HRESULT hrResult; // Reason the session was disconnected
} DVMSG_SESSIONLOST, *LPDVMSG_SESSIONLOST, *PDVMSG_SESSIONLOST;
//
// The target list has been updated for the local client
// (DVMSGID_SETTARGETS)
//
typedef struct
{
DWORD dwSize; // Size of this structure
DWORD dwNumTargets; // # of targets
PDVID pdvidTargets; // An array of DVIDs specifying the current targets
} DVMSG_SETTARGETS, *LPDVMSG_SETTARGETS, *PDVMSG_SETTARGETS;
/****************************************************************************
*
* DirectPlayVoice Functions
*
****************************************************************************/
/*
*
* This function is no longer supported. It is recommended that CoCreateInstance be used to create
* DirectPlay voice objects.
*
* extern HRESULT WINAPI DirectPlayVoiceCreate( const GUID * pcIID, void **ppvInterface, IUnknown *pUnknown);
*
*/
/****************************************************************************
*
* DirectPlay8 Application Interfaces
*
****************************************************************************/
#undef INTERFACE
#define INTERFACE IDirectPlayVoiceClient
DECLARE_INTERFACE_( IDirectPlayVoiceClient, IUnknown )
{
/*** IUnknown methods ***/
STDMETHOD(QueryInterface)(THIS_ REFIID riid, PVOID *ppvObj) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IDirectPlayVoiceClient methods ***/
STDMETHOD_(HRESULT, Initialize) (THIS_ LPUNKNOWN, PDVMESSAGEHANDLER, PVOID, PDWORD, DWORD ) PURE;
STDMETHOD_(HRESULT, Connect) (THIS_ PDVSOUNDDEVICECONFIG, PDVCLIENTCONFIG, DWORD ) PURE;
STDMETHOD_(HRESULT, Disconnect) (THIS_ DWORD ) PURE;
STDMETHOD_(HRESULT, GetSessionDesc)(THIS_ PDVSESSIONDESC ) PURE;
STDMETHOD_(HRESULT, GetClientConfig)(THIS_ PDVCLIENTCONFIG ) PURE;
STDMETHOD_(HRESULT, SetClientConfig)(THIS_ PDVCLIENTCONFIG ) PURE;
STDMETHOD_(HRESULT, GetCaps) (THIS_ PDVCAPS ) PURE;
STDMETHOD_(HRESULT, GetCompressionTypes)( THIS_ PVOID, PDWORD, PDWORD, DWORD ) PURE;
STDMETHOD_(HRESULT, SetTransmitTargets)( THIS_ PDVID, DWORD, DWORD ) PURE;
STDMETHOD_(HRESULT, GetTransmitTargets)( THIS_ PDVID, PDWORD, DWORD ) PURE;
STDMETHOD_(HRESULT, Create3DSoundBuffer)( THIS_ DVID, LPDIRECTSOUNDBUFFER, DWORD, DWORD, LPDIRECTSOUND3DBUFFER * ) PURE;
STDMETHOD_(HRESULT, Delete3DSoundBuffer)( THIS_ DVID, LPDIRECTSOUND3DBUFFER * ) PURE;
STDMETHOD_(HRESULT, SetNotifyMask)( THIS_ PDWORD, DWORD ) PURE;
STDMETHOD_(HRESULT, GetSoundDeviceConfig)( THIS_ PDVSOUNDDEVICECONFIG, PDWORD ) PURE;
};
#undef INTERFACE
#define INTERFACE IDirectPlayVoiceServer
DECLARE_INTERFACE_( IDirectPlayVoiceServer, IUnknown )
{
/*** IUnknown methods ***/
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/*** IDirectPlayVoiceServer methods ***/
STDMETHOD_(HRESULT, Initialize) (THIS_ LPUNKNOWN, PDVMESSAGEHANDLER, PVOID, LPDWORD, DWORD ) PURE;
STDMETHOD_(HRESULT, StartSession) (THIS_ PDVSESSIONDESC, DWORD ) PURE;
STDMETHOD_(HRESULT, StopSession) (THIS_ DWORD ) PURE;
STDMETHOD_(HRESULT, GetSessionDesc)(THIS_ PDVSESSIONDESC ) PURE;
STDMETHOD_(HRESULT, SetSessionDesc)(THIS_ PDVSESSIONDESC ) PURE;
STDMETHOD_(HRESULT, GetCaps) (THIS_ PDVCAPS ) PURE;
STDMETHOD_(HRESULT, GetCompressionTypes)( THIS_ PVOID, PDWORD, PDWORD, DWORD ) PURE;
STDMETHOD_(HRESULT, SetTransmitTargets)( THIS_ DVID, PDVID, DWORD, DWORD ) PURE;
STDMETHOD_(HRESULT, GetTransmitTargets)( THIS_ DVID, PDVID, PDWORD, DWORD ) PURE;
STDMETHOD_(HRESULT, SetNotifyMask)( THIS_ PDWORD, DWORD ) PURE;
};
#undef INTERFACE
#define INTERFACE IDirectPlayVoiceTest
DECLARE_INTERFACE_( IDirectPlayVoiceTest, IUnknown )
{
/*** IUnknown methods ***/
STDMETHOD(QueryInterface) (THIS_ REFIID riid, PVOID * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/*** IDirectPlayVoiceTest methods ***/
STDMETHOD_(HRESULT, CheckAudioSetup) (THIS_ const GUID *, const GUID * , HWND, DWORD ) PURE;
};
#if !defined(__cplusplus) || defined(CINTERFACE)
#define IDirectPlayVoiceClient_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectPlayVoiceClient_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirectPlayVoiceClient_Release(p) (p)->lpVtbl->Release(p)
#define IDirectPlayVoiceClient_Initialize(p,a,b,c,d,e) (p)->lpVtbl->Initialize(p,a,b,c,d,e)
#define IDirectPlayVoiceClient_Connect(p,a,b,c) (p)->lpVtbl->Connect(p,a,b,c)
#define IDirectPlayVoiceClient_Disconnect(p,a) (p)->lpVtbl->Disconnect(p,a)
#define IDirectPlayVoiceClient_GetSessionDesc(p,a) (p)->lpVtbl->GetSessionDesc(p,a)
#define IDirectPlayVoiceClient_GetClientConfig(p,a) (p)->lpVtbl->GetClientConfig(p,a)
#define IDirectPlayVoiceClient_SetClientConfig(p,a) (p)->lpVtbl->SetClientConfig(p,a)
#define IDirectPlayVoiceClient_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
#define IDirectPlayVoiceClient_GetCompressionTypes(p,a,b,c,d) (p)->lpVtbl->GetCompressionTypes(p,a,b,c,d)
#define IDirectPlayVoiceClient_SetTransmitTargets(p,a,b,c) (p)->lpVtbl->SetTransmitTargets(p,a,b,c)
#define IDirectPlayVoiceClient_GetTransmitTargets(p,a,b,c) (p)->lpVtbl->GetTransmitTargets(p,a,b,c)
#define IDirectPlayVoiceClient_Create3DSoundBuffer(p,a,b,c,d,e) (p)->lpVtbl->Create3DSoundBuffer(p,a,b,c,d,e)
#define IDirectPlayVoiceClient_Delete3DSoundBuffer(p,a,b) (p)->lpVtbl->Delete3DSoundBuffer(p,a,b)
#define IDirectPlayVoiceClient_SetNotifyMask(p,a,b) (p)->lpVtbl->SetNotifyMask(p,a,b)
#define IDirectPlayVoiceClient_GetSoundDeviceConfig(p,a,b) (p)->lpVtbl->GetSoundDeviceConfig(p,a,b)
#define IDirectPlayVoiceServer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectPlayVoiceServer_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirectPlayVoiceServer_Release(p) (p)->lpVtbl->Release(p)
#define IDirectPlayVoiceServer_Initialize(p,a,b,c,d,e) (p)->lpVtbl->Initialize(p,a,b,c,d,e)
#define IDirectPlayVoiceServer_StartSession(p,a,b) (p)->lpVtbl->StartSession(p,a,b)
#define IDirectPlayVoiceServer_StopSession(p,a) (p)->lpVtbl->StopSession(p,a)
#define IDirectPlayVoiceServer_GetSessionDesc(p,a) (p)->lpVtbl->GetSessionDesc(p,a)
#define IDirectPlayVoiceServer_SetSessionDesc(p,a) (p)->lpVtbl->SetSessionDesc(p,a)
#define IDirectPlayVoiceServer_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
#define IDirectPlayVoiceServer_GetCompressionTypes(p,a,b,c,d) (p)->lpVtbl->GetCompressionTypes(p,a,b,c,d)
#define IDirectPlayVoiceServer_SetTransmitTargets(p,a,b,c,d) (p)->lpVtbl->SetTransmitTargets(p,a,b,c,d)
#define IDirectPlayVoiceServer_GetTransmitTargets(p,a,b,c,d) (p)->lpVtbl->GetTransmitTargets(p,a,b,c,d)
#define IDirectPlayVoiceServer_SetNotifyMask(p,a,b) (p)->lpVtbl->SetNotifyMask(p,a,b)
#define IDirectPlayVoiceTest_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectPlayVoiceTest_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirectPlayVoiceTest_Release(p) (p)->lpVtbl->Release(p)
#define IDirectPlayVoiceTest_CheckAudioSetup(p,a,b,c,d) (p)->lpVtbl->CheckAudioSetup(p,a,b,c,d)
#else /* C++ */
#define IDirectPlayVoiceClient_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirectPlayVoiceClient_AddRef(p) (p)->AddRef()
#define IDirectPlayVoiceClient_Release(p) (p)->Release()
#define IDirectPlayVoiceClient_Initialize(p,a,b,c,d,e) (p)->Initialize(a,b,c,d,e)
#define IDirectPlayVoiceClient_Connect(p,a,b,c) (p)->Connect(a,b,c)
#define IDirectPlayVoiceClient_Disconnect(p,a) (p)->Disconnect(a)
#define IDirectPlayVoiceClient_GetSessionDesc(p,a) (p)->GetSessionDesc(a)
#define IDirectPlayVoiceClient_GetClientConfig(p,a) (p)->GetClientConfig(a)
#define IDirectPlayVoiceClient_SetClientConfig(p,a) (p)->SetClientConfig(a)
#define IDirectPlayVoiceClient_GetCaps(p,a) (p)->GetCaps(a)
#define IDirectPlayVoiceClient_GetCompressionTypes(p,a,b,c,d) (p)->GetCompressionTypes(a,b,c,d)
#define IDirectPlayVoiceClient_SetTransmitTargets(p,a,b,c) (p)->SetTransmitTargets(a,b,c)
#define IDirectPlayVoiceClient_GetTransmitTargets(p,a,b,c) (p)->GetTransmitTargets(a,b,c)
#define IDirectPlayVoiceClient_Create3DSoundBuffer(p,a,b,c,d,e) (p)->Create3DSoundBuffer(a,b,c,d,e)
#define IDirectPlayVoiceClient_Delete3DSoundBuffer(p,a,b) (p)->Delete3DSoundBuffer(a,b)
#define IDirectPlayVoiceClient_SetNotifyMask(p,a,b) (p)->SetNotifyMask(a,b)
#define IDirectPlayVoiceClient_GetSoundDeviceConfig(p,a,b) (p)->GetSoundDeviceConfig(a,b)
#define IDirectPlayVoiceServer_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirectPlayVoiceServer_AddRef(p) (p)->AddRef()
#define IDirectPlayVoiceServer_Release(p) (p)->Release()
#define IDirectPlayVoiceServer_Initialize(p,a,b,c,d,e) (p)->Initialize(a,b,c,d,e)
#define IDirectPlayVoiceServer_StartSession(p,a,b) (p)->StartSession(a,b)
#define IDirectPlayVoiceServer_StopSession(p,a) (p)->StopSession(a)
#define IDirectPlayVoiceServer_GetSessionDesc(p,a) (p)->GetSessionDesc(a)
#define IDirectPlayVoiceServer_SetSessionDesc(p,a) (p)->SetSessionDesc(a)
#define IDirectPlayVoiceServer_GetCaps(p,a) (p)->GetCaps(a)
#define IDirectPlayVoiceServer_GetCompressionTypes(p,a,b,c,d) (p)->GetCompressionTypes(a,b,c,d)
#define IDirectPlayVoiceServer_SetTransmitTargets(p,a,b,c,d) (p)->SetTransmitTargets(a,b,c,d)
#define IDirectPlayVoiceServer_GetTransmitTargets(p,a,b,c,d) (p)->GetTransmitTargets(a,b,c,d)
#define IDirectPlayVoiceServer_SetNotifyMask(p,a,b) (p)->SetNotifyMask(a,b)
#define IDirectPlayVoiceTest_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirectPlayVoiceTest_AddRef(p) (p)->AddRef()
#define IDirectPlayVoiceTest_Release(p) (p)->Release()
#define IDirectPlayVoiceTest_CheckAudioSetup(p,a,b,c,d) (p)->CheckAudioSetup(a,b,c,d)
#endif
/****************************************************************************
*
* DIRECTPLAYVOICE ERRORS
*
* Errors are represented by negative values and cannot be combined.
*
****************************************************************************/
#define _FACDPV 0x15
#define MAKE_DVHRESULT( code ) MAKE_HRESULT( 1, _FACDPV, code )
#define DV_OK S_OK
#define DV_FULLDUPLEX MAKE_HRESULT( 0, _FACDPV, 0x0005 )
#define DV_HALFDUPLEX MAKE_HRESULT( 0, _FACDPV, 0x000A )
#define DV_PENDING MAKE_HRESULT( 0, _FACDPV, 0x0010 )
#define DVERR_BUFFERTOOSMALL MAKE_DVHRESULT( 0x001E )
#define DVERR_EXCEPTION MAKE_DVHRESULT( 0x004A )
#define DVERR_GENERIC E_FAIL
#define DVERR_INVALIDFLAGS MAKE_DVHRESULT( 0x0078 )
#define DVERR_INVALIDOBJECT MAKE_DVHRESULT( 0x0082 )
#define DVERR_INVALIDPARAM E_INVALIDARG
#define DVERR_INVALIDPLAYER MAKE_DVHRESULT( 0x0087 )
#define DVERR_INVALIDGROUP MAKE_DVHRESULT( 0x0091 )
#define DVERR_INVALIDHANDLE MAKE_DVHRESULT( 0x0096 )
#define DVERR_OUTOFMEMORY E_OUTOFMEMORY
#define DVERR_PENDING DV_PENDING
#define DVERR_NOTSUPPORTED E_NOTIMPL
#define DVERR_NOINTERFACE E_NOINTERFACE
#define DVERR_SESSIONLOST MAKE_DVHRESULT( 0x012C )
#define DVERR_NOVOICESESSION MAKE_DVHRESULT( 0x012E )
#define DVERR_CONNECTIONLOST MAKE_DVHRESULT( 0x0168 )
#define DVERR_NOTINITIALIZED MAKE_DVHRESULT( 0x0169 )
#define DVERR_CONNECTED MAKE_DVHRESULT( 0x016A )
#define DVERR_NOTCONNECTED MAKE_DVHRESULT( 0x016B )
#define DVERR_CONNECTABORTING MAKE_DVHRESULT( 0x016E )
#define DVERR_NOTALLOWED MAKE_DVHRESULT( 0x016F )
#define DVERR_INVALIDTARGET MAKE_DVHRESULT( 0x0170 )
#define DVERR_TRANSPORTNOTHOST MAKE_DVHRESULT( 0x0171 )
#define DVERR_COMPRESSIONNOTSUPPORTED MAKE_DVHRESULT( 0x0172 )
#define DVERR_ALREADYPENDING MAKE_DVHRESULT( 0x0173 )
#define DVERR_SOUNDINITFAILURE MAKE_DVHRESULT( 0x0174 )
#define DVERR_TIMEOUT MAKE_DVHRESULT( 0x0175 )
#define DVERR_CONNECTABORTED MAKE_DVHRESULT( 0x0176 )
#define DVERR_NO3DSOUND MAKE_DVHRESULT( 0x0177 )
#define DVERR_ALREADYBUFFERED MAKE_DVHRESULT( 0x0178 )
#define DVERR_NOTBUFFERED MAKE_DVHRESULT( 0x0179 )
#define DVERR_HOSTING MAKE_DVHRESULT( 0x017A )
#define DVERR_NOTHOSTING MAKE_DVHRESULT( 0x017B )
#define DVERR_INVALIDDEVICE MAKE_DVHRESULT( 0x017C )
#define DVERR_RECORDSYSTEMERROR MAKE_DVHRESULT( 0x017D )
#define DVERR_PLAYBACKSYSTEMERROR MAKE_DVHRESULT( 0x017E )
#define DVERR_SENDERROR MAKE_DVHRESULT( 0x017F )
#define DVERR_USERCANCEL MAKE_DVHRESULT( 0x0180 )
#define DVERR_RUNSETUP MAKE_DVHRESULT( 0x0183 )
#define DVERR_INCOMPATIBLEVERSION MAKE_DVHRESULT( 0x0184 )
#define DVERR_INITIALIZED MAKE_DVHRESULT( 0x0187 )
#define DVERR_INVALIDPOINTER E_POINTER
#define DVERR_NOTRANSPORT MAKE_DVHRESULT( 0x0188 )
#define DVERR_NOCALLBACK MAKE_DVHRESULT( 0x0189 )
#define DVERR_TRANSPORTNOTINIT MAKE_DVHRESULT( 0x018A )
#define DVERR_TRANSPORTNOSESSION MAKE_DVHRESULT( 0x018B )
#define DVERR_TRANSPORTNOPLAYER MAKE_DVHRESULT( 0x018C )
#define DVERR_USERBACK MAKE_DVHRESULT( 0x018D )
#define DVERR_NORECVOLAVAILABLE MAKE_DVHRESULT( 0x018E )
#define DVERR_INVALIDBUFFER MAKE_DVHRESULT( 0x018F )
#define DVERR_LOCKEDBUFFER MAKE_DVHRESULT( 0x0190 )
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,966 @@
/*==========================================================================;
*
* Copyright (C) Microsoft Corporation. All Rights Reserved.
*
* File: dvp.h
* Content: DirectDrawVideoPort include file
*
***************************************************************************/
#ifndef __DVP_INCLUDED__
#define __DVP_INCLUDED__
/*
* GUIDS used by DirectDrawVideoPort objects
*/
#if defined( _WIN32 ) && (!defined( _NO_COM ) || defined( DEFINE_GUID ))
DEFINE_GUID( IID_IDDVideoPortContainer, 0x6C142760,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
DEFINE_GUID( IID_IDirectDrawVideoPort, 0xB36D93E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56 );
DEFINE_GUID( IID_IDirectDrawVideoPortNotify, 0xA655FB94,0x0589,0x4E57,0xB3,0x33,0x56,0x7A,0x89,0x46,0x8C,0x88);
DEFINE_GUID( DDVPTYPE_E_HREFH_VREFH, 0x54F39980L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
DEFINE_GUID( DDVPTYPE_E_HREFH_VREFL, 0x92783220L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
DEFINE_GUID( DDVPTYPE_E_HREFL_VREFH, 0xA07A02E0L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
DEFINE_GUID( DDVPTYPE_E_HREFL_VREFL, 0xE09C77E0L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
DEFINE_GUID( DDVPTYPE_CCIR656, 0xFCA326A0L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
DEFINE_GUID( DDVPTYPE_BROOKTREE, 0x1352A560L,0xDA61,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
DEFINE_GUID( DDVPTYPE_PHILIPS, 0x332CF160L,0xDA61,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
#endif
#ifndef GUID_DEFS_ONLY
#if defined( _WIN32 ) && !defined( _NO_COM )
#define COM_NO_WINDOWS_H
#include <objbase.h>
#else
#define IUnknown void
#endif
/*
* These definitions are required to allow polymorphic structure members (i.e. those
* that are referred to both as DWORDs and as pointers) to resolve into a type
* of correct size to hold the largest of those two types (i.e. pointer) on 64 bit
* systems. For 32 bit environments, ULONG_PTR resolves to a DWORD.
*/
#ifndef MAXULONG_PTR
#define ULONG_PTR DWORD
#endif //MAXULONG_PTR
#ifdef __cplusplus
extern "C" {
#endif
/*============================================================================
*
* DirectDraw Structures
*
* Various structures used to invoke DirectDraw.
*
*==========================================================================*/
struct IDirectDraw;
struct IDirectDrawSurface;
struct IDirectDrawPalette;
struct IDirectDrawClipper;
typedef struct IDDVideoPortContainer FAR *LPDDVIDEOPORTCONTAINER;
typedef struct IDirectDrawVideoPort FAR *LPDIRECTDRAWVIDEOPORT;
typedef struct IDirectDrawVideoPortNotify FAR *LPDIRECTDRAWVIDEOPORTNOTIFY;
typedef struct _DDVIDEOPORTCONNECT FAR *LPDDVIDEOPORTCONNECT;
typedef struct _DDVIDEOPORTCAPS FAR *LPDDVIDEOPORTCAPS;
typedef struct _DDVIDEOPORTDESC FAR *LPDDVIDEOPORTDESC;
typedef struct _DDVIDEOPORTINFO FAR *LPDDVIDEOPORTINFO;
typedef struct _DDVIDEOPORTBANDWIDTH FAR *LPDDVIDEOPORTBANDWIDTH;
typedef struct _DDVIDEOPORTSTATUS FAR *LPDDVIDEOPORTSTATUS;
typedef struct _DDVIDEOPORTNOTIFY FAR *LPDDVIDEOPORTNOTIFY;
typedef struct IDDVideoPortContainerVtbl DDVIDEOPORTCONTAINERCALLBACKS;
typedef struct IDirectDrawVideoPortVtbl DIRECTDRAWVIDEOPORTCALLBACKS;
typedef struct IDirectDrawVideoPortNotifyVtbl DIRECTDRAWVIDEOPORTNOTIFYCALLBACKS;
/*
* API's
*/
typedef HRESULT (FAR PASCAL * LPDDENUMVIDEOCALLBACK)(LPDDVIDEOPORTCAPS, LPVOID);
/*
* INTERACES FOLLOW:
* IDirectDrawVideoPort
* IVideoPort
*/
/*
* IDirectDrawVideoPortContainer
*/
#if defined( _WIN32 ) && !defined( _NO_COM )
#undef INTERFACE
#define INTERFACE IDDVideoPortContainer
DECLARE_INTERFACE_( IDDVideoPortContainer, IUnknown )
{
/*** IUnknown methods ***/
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/*** IDirectDrawVideoPort methods ***/
STDMETHOD(CreateVideoPort)(THIS_ DWORD, LPDDVIDEOPORTDESC, LPDIRECTDRAWVIDEOPORT FAR *, IUnknown FAR *) PURE;
STDMETHOD(EnumVideoPorts)(THIS_ DWORD, LPDDVIDEOPORTCAPS, LPVOID,LPDDENUMVIDEOCALLBACK ) PURE;
STDMETHOD(GetVideoPortConnectInfo)(THIS_ DWORD, LPDWORD, LPDDVIDEOPORTCONNECT ) PURE;
STDMETHOD(QueryVideoPortStatus)(THIS_ DWORD, LPDDVIDEOPORTSTATUS ) PURE;
};
#if !defined(__cplusplus) || defined(CINTERFACE)
#define IVideoPortContainer_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
#define IVideoPortContainer_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IVideoPortContainer_Release(p) (p)->lpVtbl->Release(p)
#define IVideoPortContainer_CreateVideoPort(p, a, b, c, d) (p)->lpVtbl->CreateVideoPort(p, a, b, c, d)
#define IVideoPortContainer_EnumVideoPorts(p, a, b, c, d) (p)->lpVtbl->EnumVideoPorts(p, a, b, c, d)
#define IVideoPortContainer_GetVideoPortConnectInfo(p, a, b, c) (p)->lpVtbl->GetVideoPortConnectInfo(p, a, b, c)
#define IVideoPortContainer_QueryVideoPortStatus(p, a, b) (p)->lpVtbl->QueryVideoPortStatus(p, a, b)
#else
#define IVideoPortContainer_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
#define IVideoPortContainer_AddRef(p) (p)->AddRef()
#define IVideoPortContainer_Release(p) (p)->Release()
#define IVideoPortContainer_CreateVideoPort(p, a, b, c, d) (p)->CreateVideoPort(a, b, c, d)
#define IVideoPortContainer_EnumVideoPorts(p, a, b, c, d) (p)->EnumVideoPorts(a, b, c, d)
#define IVideoPortContainer_GetVideoPortConnectInfo(p, a, b, c) (p)->GetVideoPortConnectInfo(a, b, c)
#define IVideoPortContainer_QueryVideoPortStatus(p, a, b) (p)->QueryVideoPortStatus(a, b)
#endif
#endif
/*
* IDirectDrawVideoPort
*/
#if defined( _WIN32 ) && !defined( _NO_COM )
#undef INTERFACE
#define INTERFACE IDirectDrawVideoPort
DECLARE_INTERFACE_( IDirectDrawVideoPort, IUnknown )
{
/*** IUnknown methods ***/
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/*** IVideoPort methods ***/
STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE;
STDMETHOD(GetBandwidthInfo)(THIS_ LPDDPIXELFORMAT, DWORD, DWORD, DWORD, LPDDVIDEOPORTBANDWIDTH) PURE;
STDMETHOD(GetColorControls)(THIS_ LPDDCOLORCONTROL) PURE;
STDMETHOD(GetInputFormats)(THIS_ LPDWORD, LPDDPIXELFORMAT, DWORD) PURE;
STDMETHOD(GetOutputFormats)(THIS_ LPDDPIXELFORMAT, LPDWORD, LPDDPIXELFORMAT, DWORD) PURE;
STDMETHOD(GetFieldPolarity)(THIS_ LPBOOL) PURE;
STDMETHOD(GetVideoLine)(THIS_ LPDWORD) PURE;
STDMETHOD(GetVideoSignalStatus)(THIS_ LPDWORD) PURE;
STDMETHOD(SetColorControls)(THIS_ LPDDCOLORCONTROL) PURE;
STDMETHOD(SetTargetSurface)(THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE;
STDMETHOD(StartVideo)(THIS_ LPDDVIDEOPORTINFO) PURE;
STDMETHOD(StopVideo)(THIS) PURE;
STDMETHOD(UpdateVideo)(THIS_ LPDDVIDEOPORTINFO) PURE;
STDMETHOD(WaitForSync)(THIS_ DWORD, DWORD, DWORD) PURE;
};
#if !defined(__cplusplus) || defined(CINTERFACE)
#define IVideoPort_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IVideoPort_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IVideoPort_Release(p) (p)->lpVtbl->Release(p)
#define IVideoPort_SetTargetSurface(p,a,b) (p)->lpVtbl->SetTargetSurface(p,a,b)
#define IVideoPort_Flip(p,a,b) (p)->lpVtbl->Flip(p,a,b)
#define IVideoPort_GetBandwidthInfo(p,a,b,c,d,e) (p)->lpVtbl->GetBandwidthInfo(p,a,b,c,d,e)
#define IVideoPort_GetColorControls(p,a) (p)->lpVtbl->GetColorControls(p,a)
#define IVideoPort_GetInputFormats(p,a,b,c) (p)->lpVtbl->GetInputFormats(p,a,b,c)
#define IVideoPort_GetOutputFormats(p,a,b,c,d) (p)->lpVtbl->GetOutputFormats(p,a,b,c,d)
#define IVideoPort_GetFieldPolarity(p,a) (p)->lpVtbl->GetFieldPolarity(p,a)
#define IVideoPort_GetVideoLine(p,a) (p)->lpVtbl->GetVideoLine(p,a)
#define IVideoPort_GetVideoSignalStatus(p,a) (p)->lpVtbl->GetVideoSignalStatus(p,a)
#define IVideoPort_SetColorControls(p,a) (p)->lpVtbl->SetColorControls(p,a)
#define IVideoPort_StartVideo(p,a) (p)->lpVtbl->StartVideo(p,a)
#define IVideoPort_StopVideo(p) (p)->lpVtbl->StopVideo(p)
#define IVideoPort_UpdateVideo(p,a) (p)->lpVtbl->UpdateVideo(p,a)
#define IVideoPort_WaitForSync(p,a,b,c) (p)->lpVtbl->WaitForSync(p,a,b,c)
#else
#define IVideoPort_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IVideoPort_AddRef(p) (p)->AddRef()
#define IVideoPort_Release(p) (p)->Release()
#define IVideoPort_SetTargetSurface(p,a,b) (p)->SetTargetSurface(a,b)
#define IVideoPort_Flip(p,a,b) (p)->Flip(a,b)
#define IVideoPort_GetBandwidthInfo(p,a,b,c,d,e) (p)->GetBandwidthInfo(a,b,c,d,e)
#define IVideoPort_GetColorControls(p,a) (p)->GetColorControls(a)
#define IVideoPort_GetInputFormats(p,a,b,c) (p)->GetInputFormats(a,b,c)
#define IVideoPort_GetOutputFormats(p,a,b,c,d) (p)->GetOutputFormats(a,b,c,d)
#define IVideoPort_GetFieldPolarity(p,a) (p)->GetFieldPolarity(a)
#define IVideoPort_GetVideoLine(p,a) (p)->GetVideoLine(a)
#define IVideoPort_GetVideoSignalStatus(p,a) (p)->GetVideoSignalStatus(a)
#define IVideoPort_SetColorControls(p,a) (p)->SetColorControls(a)
#define IVideoPort_StartVideo(p,a) (p)->StartVideo(a)
#define IVideoPort_StopVideo(p) (p)->StopVideo()
#define IVideoPort_UpdateVideo(p,a) (p)->UpdateVideo(a)
#define IVideoPort_WaitForSync(p,a,b,c) (p)->WaitForSync(a,b,c)
#endif
#endif
/*
* IDirectDrawVideoPort
*/
#if defined( _WIN32 ) && !defined( _NO_COM )
#undef INTERFACE
#define INTERFACE IDirectDrawVideoPortNotify
DECLARE_INTERFACE_( IDirectDrawVideoPortNotify, IUnknown )
{
/*** IUnknown methods ***/
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/*** IVideoPort methods ***/
STDMETHOD(AcquireNotification)(THIS_ HANDLE *, LPDDVIDEOPORTNOTIFY) PURE;
STDMETHOD(ReleaseNotification)(THIS_ HANDLE) PURE;
};
#if !defined(__cplusplus) || defined(CINTERFACE)
#define IVideoPortNotify_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IVideoPortNotify_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IVideoPortNotify_Release(p) (p)->lpVtbl->Release(p)
#define IVideoPortNotify_AcquireNotification(p,a,b) (p)->lpVtbl->AcquireNotification(p,a,b)
#define IVideoPortNotify_ReleaseNotification(p,a) (p)->lpVtbl->ReleaseNotification(p,a)
#else
#define IVideoPortNotify_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IVideoPortNotify_AddRef(p) (p)->AddRef()
#define IVideoPortNotify_Release(p) (p)->Release()
#define IVideoPortNotify_AcquireNotification(p,a,b) (p)->lpVtbl->AcquireNotification(a,b)
#define IVideoPortNotify_ReleaseNotification(p,a) (p)->lpVtbl->ReleaseNotification(a)
#endif
#endif
/*
* DDVIDEOPORTCONNECT
*/
typedef struct _DDVIDEOPORTCONNECT
{
DWORD dwSize; // size of the DDVIDEOPORTCONNECT structure
DWORD dwPortWidth; // Width of the video port
GUID guidTypeID; // Description of video port connection
DWORD dwFlags; // Connection flags
ULONG_PTR dwReserved1; // Reserved, set to zero.
} DDVIDEOPORTCONNECT;
/*
* DDVIDEOPORTCAPS
*/
typedef struct _DDVIDEOPORTCAPS
{
DWORD dwSize; // size of the DDVIDEOPORTCAPS structure
DWORD dwFlags; // indicates which fields contain data
DWORD dwMaxWidth; // max width of the video port field
DWORD dwMaxVBIWidth; // max width of the VBI data
DWORD dwMaxHeight; // max height of the video port field
DWORD dwVideoPortID; // Video port ID (0 - (dwMaxVideoPorts -1))
DWORD dwCaps; // Video port capabilities
DWORD dwFX; // More video port capabilities
DWORD dwNumAutoFlipSurfaces; // Max number of autoflippable surfaces allowed
DWORD dwAlignVideoPortBoundary; // Byte restriction of placement within the surface
DWORD dwAlignVideoPortPrescaleWidth;// Byte restriction of width after prescaling
DWORD dwAlignVideoPortCropBoundary; // Byte restriction of left cropping
DWORD dwAlignVideoPortCropWidth; // Byte restriction of cropping width
DWORD dwPreshrinkXStep; // Width can be shrunk in steps of 1/x
DWORD dwPreshrinkYStep; // Height can be shrunk in steps of 1/x
DWORD dwNumVBIAutoFlipSurfaces; // Max number of VBI autoflippable surfaces allowed
DWORD dwNumPreferredAutoflip; // Optimal number of autoflippable surfaces for hardware
WORD wNumFilterTapsX; // Number of taps the prescaler uses in the X direction (0 - no prescale, 1 - replication, etc.)
WORD wNumFilterTapsY; // Number of taps the prescaler uses in the Y direction (0 - no prescale, 1 - replication, etc.)
} DDVIDEOPORTCAPS;
/*
* The dwMaxWidth and dwMaxVBIWidth members are valid
*/
#define DDVPD_WIDTH 0x00000001l
/*
* The dwMaxHeight member is valid
*/
#define DDVPD_HEIGHT 0x00000002l
/*
* The dwVideoPortID member is valid
*/
#define DDVPD_ID 0x00000004l
/*
* The dwCaps member is valid
*/
#define DDVPD_CAPS 0x00000008l
/*
* The dwFX member is valid
*/
#define DDVPD_FX 0x00000010l
/*
* The dwNumAutoFlipSurfaces member is valid
*/
#define DDVPD_AUTOFLIP 0x00000020l
/*
* All of the alignment members are valid
*/
#define DDVPD_ALIGN 0x00000040l
/*
* The dwNumPreferredAutoflip member is valid
*/
#define DDVPD_PREFERREDAUTOFLIP 0x00000080l
/*
* The wNumFilterTapsX and wNumFilterTapsY fields are valid
*/
#define DDVPD_FILTERQUALITY 0x00000100l
/*
* DDVIDEOPORTDESC
*/
typedef struct _DDVIDEOPORTDESC
{
DWORD dwSize; // size of the DDVIDEOPORTDESC structure
DWORD dwFieldWidth; // width of the video port field
DWORD dwVBIWidth; // width of the VBI data
DWORD dwFieldHeight; // height of the video port field
DWORD dwMicrosecondsPerField; // Microseconds per video field
DWORD dwMaxPixelsPerSecond; // Maximum pixel rate per second
DWORD dwVideoPortID; // Video port ID (0 - (dwMaxVideoPorts -1))
DWORD dwReserved1; // Reserved for future use - set to zero (struct padding)
DDVIDEOPORTCONNECT VideoPortType; // Description of video port connection
ULONG_PTR dwReserved2; // Reserved for future use - set to zero
ULONG_PTR dwReserved3; // Reserved for future use - set to zero
} DDVIDEOPORTDESC;
/*
* DDVIDEOPORTINFO
*/
typedef struct _DDVIDEOPORTINFO
{
DWORD dwSize; // Size of the structure
DWORD dwOriginX; // Placement of the video data within the surface.
DWORD dwOriginY; // Placement of the video data within the surface.
DWORD dwVPFlags; // Video port options
RECT rCrop; // Cropping rectangle (optional).
DWORD dwPrescaleWidth; // Determines pre-scaling/zooming in the X direction (optional).
DWORD dwPrescaleHeight; // Determines pre-scaling/zooming in the Y direction (optional).
LPDDPIXELFORMAT lpddpfInputFormat; // Video format written to the video port
LPDDPIXELFORMAT lpddpfVBIInputFormat; // Input format of the VBI data
LPDDPIXELFORMAT lpddpfVBIOutputFormat;// Output format of the data
DWORD dwVBIHeight; // Specifies the number of lines of data within the vertical blanking interval.
ULONG_PTR dwReserved1; // Reserved for future use - set to zero
ULONG_PTR dwReserved2; // Reserved for future use - set to zero
} DDVIDEOPORTINFO;
/*
* DDVIDEOPORTBANDWIDTH
*/
typedef struct _DDVIDEOPORTBANDWIDTH
{
DWORD dwSize; // Size of the structure
DWORD dwCaps;
DWORD dwOverlay; // Zoom factor at which overlay is supported
DWORD dwColorkey; // Zoom factor at which overlay w/ colorkey is supported
DWORD dwYInterpolate; // Zoom factor at which overlay w/ Y interpolation is supported
DWORD dwYInterpAndColorkey; // Zoom factor at which ovelray w/ Y interpolation and colorkeying is supported
ULONG_PTR dwReserved1; // Reserved for future use - set to zero
ULONG_PTR dwReserved2; // Reserved for future use - set to zero
} DDVIDEOPORTBANDWIDTH;
/*
* DDVIDEOPORTSTATUS
*/
typedef struct _DDVIDEOPORTSTATUS
{
DWORD dwSize; // Size of the structure
BOOL bInUse; // TRUE if video port is currently being used
DWORD dwFlags; // Currently not used
DWORD dwReserved1; // Reserved for future use
DDVIDEOPORTCONNECT VideoPortType; // Information about the connection
ULONG_PTR dwReserved2; // Reserved for future use
ULONG_PTR dwReserved3; // Reserved for future use
} DDVIDEOPORTSTATUS;
/*
* DDVIDEOPORTNOTIFY
*/
typedef struct _DDVIDEOPORTNOTIFY
{
LARGE_INTEGER ApproximateTimeStamp; // Timestamp in the event notification
LONG lField; // 0 if even, 1 if odd, -1 if unknown
UINT dwSurfaceIndex; // Index in the surface chain of the surface that received the sample
LONG lDone; // Call InterlockedIncrement on this when done with sample
} DDVIDEOPORTNOTIFY;
/*============================================================================
*
* Video Port Flags
*
* All flags are bit flags.
*
*==========================================================================*/
/****************************************************************************
*
* VIDEOPORT DDVIDEOPORTCONNECT FLAGS
*
****************************************************************************/
/*
* When this is set by the driver and passed to the client, this
* indicates that the video port is capable of double clocking the data.
* When this is set by the client, this indicates that the video port
* should enable double clocking. This flag is only valid with external
* syncs.
*/
#define DDVPCONNECT_DOUBLECLOCK 0x00000001l
/*
* When this is set by the driver and passed to the client, this
* indicates that the video port is capable of using an external VACT
* signal. When this is set by the client, this indicates that the
* video port should use the external VACT signal.
*/
#define DDVPCONNECT_VACT 0x00000002l
/*
* When this is set by the driver and passed to the client, this
* indicates that the video port is capable of treating even fields
* like odd fields and visa versa. When this is set by the client,
* this indicates that the video port should treat even fields like odd
* fields.
*/
#define DDVPCONNECT_INVERTPOLARITY 0x00000004l
/*
* Indicates that any data written to the video port during the VREF
* period will not be written into the frame buffer. This flag is read only.
*/
#define DDVPCONNECT_DISCARDSVREFDATA 0x00000008l
/*
* When this is set be the driver and passed to the client, this
* indicates that the device will write half lines into the frame buffer
* if half lines are provided by the decoder. If this is set by the client,
* this indicates that the decoder will be supplying half lines.
*/
#define DDVPCONNECT_HALFLINE 0x00000010l
/*
* Indicates that the signal is interlaced. This flag is only
* set by the client.
*/
#define DDVPCONNECT_INTERLACED 0x00000020l
/*
* Indicates that video port is shareable and that this video port
* will use the even fields. This flag is only set by the client.
*/
#define DDVPCONNECT_SHAREEVEN 0x00000040l
/*
* Indicates that video port is shareable and that this video port
* will use the odd fields. This flag is only set by the client.
*/
#define DDVPCONNECT_SHAREODD 0x00000080l
/****************************************************************************
*
* VIDEOPORT DDVIDEOPORTDESC CAPS
*
****************************************************************************/
/*
* Flip can be performed automatically to avoid tearing.
*/
#define DDVPCAPS_AUTOFLIP 0x00000001l
/*
* Supports interlaced video
*/
#define DDVPCAPS_INTERLACED 0x00000002l
/*
* Supports non-interlaced video
*/
#define DDVPCAPS_NONINTERLACED 0x00000004l
/*
* Indicates that the device can return whether the current field
* of an interlaced signal is even or odd.
*/
#define DDVPCAPS_READBACKFIELD 0x00000008l
/*
* Indicates that the device can return the current line of video
* being written into the frame buffer.
*/
#define DDVPCAPS_READBACKLINE 0x00000010l
/*
* Allows two gen-locked video streams to share a single video port,
* where one stream uses the even fields and the other uses the odd
* fields. Separate parameters (including address, scaling,
* cropping, etc.) are maintained for both fields.)
*/
#define DDVPCAPS_SHAREABLE 0x00000020l
/*
* Even fields of video can be automatically discarded.
*/
#define DDVPCAPS_SKIPEVENFIELDS 0x00000040l
/*
* Odd fields of video can be automatically discarded.
*/
#define DDVPCAPS_SKIPODDFIELDS 0x00000080l
/*
* Indicates that the device is capable of driving the graphics
* VSYNC with the video port VSYNC.
*/
#define DDVPCAPS_SYNCMASTER 0x00000100l
/*
* Indicates that data within the vertical blanking interval can
* be written to a different surface.
*/
#define DDVPCAPS_VBISURFACE 0x00000200l
/*
* Indicates that the video port can perform color operations
* on the incoming data before it is written to the frame buffer.
*/
#define DDVPCAPS_COLORCONTROL 0x00000400l
/*
* Indicates that the video port can accept VBI data in a different
* width or format than the regular video data.
*/
#define DDVPCAPS_OVERSAMPLEDVBI 0x00000800l
/*
* Indicates that the video port can write data directly to system memory
*/
#define DDVPCAPS_SYSTEMMEMORY 0x00001000l
/*
* Indicates that the VBI and video portions of the video stream can
* be controlled by an independent processes.
*/
#define DDVPCAPS_VBIANDVIDEOINDEPENDENT 0x00002000l
/*
* Indicates that the video port contains high quality hardware
* de-interlacing hardware that should be used instead of the
* bob/weave algorithms.
*/
#define DDVPCAPS_HARDWAREDEINTERLACE 0x00004000l
/****************************************************************************
*
* VIDEOPORT DDVIDEOPORTDESC FX
*
****************************************************************************/
/*
* Limited cropping is available to crop out the vertical interval data.
*/
#define DDVPFX_CROPTOPDATA 0x00000001l
/*
* Incoming data can be cropped in the X direction before it is written
* to the surface.
*/
#define DDVPFX_CROPX 0x00000002l
/*
* Incoming data can be cropped in the Y direction before it is written
* to the surface.
*/
#define DDVPFX_CROPY 0x00000004l
/*
* Supports interleaving interlaced fields in memory.
*/
#define DDVPFX_INTERLEAVE 0x00000008l
/*
* Supports mirroring left to right as the video data is written
* into the frame buffer.
*/
#define DDVPFX_MIRRORLEFTRIGHT 0x00000010l
/*
* Supports mirroring top to bottom as the video data is written
* into the frame buffer.
*/
#define DDVPFX_MIRRORUPDOWN 0x00000020l
/*
* Data can be arbitrarily shrunk in the X direction before it
* is written to the surface.
*/
#define DDVPFX_PRESHRINKX 0x00000040l
/*
* Data can be arbitrarily shrunk in the Y direction before it
* is written to the surface.
*/
#define DDVPFX_PRESHRINKY 0x00000080l
/*
* Data can be binary shrunk (1/2, 1/4, 1/8, etc.) in the X
* direction before it is written to the surface.
*/
#define DDVPFX_PRESHRINKXB 0x00000100l
/*
* Data can be binary shrunk (1/2, 1/4, 1/8, etc.) in the Y
* direction before it is written to the surface.
*/
#define DDVPFX_PRESHRINKYB 0x00000200l
/*
* Data can be shrunk in increments of 1/x in the X direction
* (where X is specified in the DDVIDEOPORTCAPS.dwPreshrinkXStep)
* before it is written to the surface.
*/
#define DDVPFX_PRESHRINKXS 0x00000400l
/*
* Data can be shrunk in increments of 1/x in the Y direction
* (where X is specified in the DDVIDEOPORTCAPS.dwPreshrinkYStep)
* before it is written to the surface.
*/
#define DDVPFX_PRESHRINKYS 0x00000800l
/*
* Data can be arbitrarily stretched in the X direction before
* it is written to the surface.
*/
#define DDVPFX_PRESTRETCHX 0x00001000l
/*
* Data can be arbitrarily stretched in the Y direction before
* it is written to the surface.
*/
#define DDVPFX_PRESTRETCHY 0x00002000l
/*
* Data can be integer stretched in the X direction before it is
* written to the surface.
*/
#define DDVPFX_PRESTRETCHXN 0x00004000l
/*
* Data can be integer stretched in the Y direction before it is
* written to the surface.
*/
#define DDVPFX_PRESTRETCHYN 0x00008000l
/*
* Indicates that data within the vertical blanking interval can
* be converted independently of the remaining video data.
*/
#define DDVPFX_VBICONVERT 0x00010000l
/*
* Indicates that scaling can be disabled for data within the
* vertical blanking interval.
*/
#define DDVPFX_VBINOSCALE 0x00020000l
/*
* Indicates that the video data can ignore the left and right
* cropping coordinates when cropping oversampled VBI data.
*/
#define DDVPFX_IGNOREVBIXCROP 0x00040000l
/*
* Indicates that interleaving can be disabled for data within the
* vertical blanking interval.
*/
#define DDVPFX_VBINOINTERLEAVE 0x00080000l
/****************************************************************************
*
* VIDEOPORT DDVIDEOPORTINFO FLAGS
*
****************************************************************************/
/*
* Perform automatic flipping. Auto-flipping is performed between
* the overlay surface that was attached to the video port using
* IDirectDrawVideoPort::AttachSurface and the overlay surfaces that
* are attached to the surface via the IDirectDrawSurface::AttachSurface
* method. The flip order is the order in which the overlay surfaces
* were. attached.
*/
#define DDVP_AUTOFLIP 0x00000001l
/*
* Perform conversion using the ddpfOutputFormat information.
*/
#define DDVP_CONVERT 0x00000002l
/*
* Perform cropping using the specified rectangle.
*/
#define DDVP_CROP 0x00000004l
/*
* Indicates that interlaced fields should be interleaved in memory.
*/
#define DDVP_INTERLEAVE 0x00000008l
/*
* Indicates that the data should be mirrored left to right as it's
* written into the frame buffer.
*/
#define DDVP_MIRRORLEFTRIGHT 0x00000010l
/*
* Indicates that the data should be mirrored top to bottom as it's
* written into the frame buffer.
*/
#define DDVP_MIRRORUPDOWN 0x00000020l
/*
* Perform pre-scaling/zooming based on the pre-scale parameters.
*/
#define DDVP_PRESCALE 0x00000040l
/*
* Ignore input of even fields.
*/
#define DDVP_SKIPEVENFIELDS 0x00000080l
/*
* Ignore input of odd fields.
*/
#define DDVP_SKIPODDFIELDS 0x00000100l
/*
* Drive the graphics VSYNCs using the video port VYSNCs.
*/
#define DDVP_SYNCMASTER 0x00000200l
/*
* The ddpfVBIOutputFormatFormat member contains data that should be used
* to convert the data within the vertical blanking interval.
*/
#define DDVP_VBICONVERT 0x00000400l
/*
* Indicates that data within the vertical blanking interval
* should not be scaled.
*/
#define DDVP_VBINOSCALE 0x00000800l
/*
* Indicates that these bob/weave decisions should not be
* overriden by other interfaces.
*/
#define DDVP_OVERRIDEBOBWEAVE 0x00001000l
/*
* Indicates that the video data should ignore the left and right
* cropping coordinates when cropping the VBI data.
*/
#define DDVP_IGNOREVBIXCROP 0x00002000l
/*
* Indicates that interleaving can be disabled for data within the
* vertical blanking interval.
*/
#define DDVP_VBINOINTERLEAVE 0x00004000l
/*
* Indicates that the video port should use the hardware
* de-interlacing hardware.
*/
#define DDVP_HARDWAREDEINTERLACE 0x00008000l
/****************************************************************************
*
* DIRIRECTDRAWVIDEOPORT GETINPUTFORMAT/GETOUTPUTFORMAT FLAGS
*
****************************************************************************/
/*
* Return formats for the video data
*/
#define DDVPFORMAT_VIDEO 0x00000001l
/*
* Return formats for the VBI data
*/
#define DDVPFORMAT_VBI 0x00000002l
/****************************************************************************
*
* DIRIRECTDRAWVIDEOPORT SETTARGETSURFACE FLAGS
*
****************************************************************************/
/*
* Surface should receive video data (and VBI data if a surface
* is not explicitly attached for that purpose)
*/
#define DDVPTARGET_VIDEO 0x00000001l
/*
* Surface should receive VBI data
*/
#define DDVPTARGET_VBI 0x00000002l
/****************************************************************************
*
* DIRIRECTDRAWVIDEOPORT WAITFORSYNC FLAGS
*
****************************************************************************/
/*
* Waits until the beginning of the next VSYNC
*/
#define DDVPWAIT_BEGIN 0x00000001l
/*
* Waits until the end of the next/current VSYNC
*/
#define DDVPWAIT_END 0x00000002l
/*
* Waits until the beginning of the specified line
*/
#define DDVPWAIT_LINE 0x00000003l
/****************************************************************************
*
* DIRECTDRAWVIDEOPORT FLIP FLAGS
*
****************************************************************************/
/*
* Flips the normal video surface
*/
#define DDVPFLIP_VIDEO 0x00000001l
/*
* Flips the VBI surface
*/
#define DDVPFLIP_VBI 0x00000002l
/****************************************************************************
*
* DIRIRECTDRAWVIDEOPORT GETVIDEOSIGNALSTATUS VALUES
*
****************************************************************************/
/*
* No video signal is present at the video port
*/
#define DDVPSQ_NOSIGNAL 0x00000001l
/*
* A valid video signal is present at the video port
*/
#define DDVPSQ_SIGNALOK 0x00000002l
/****************************************************************************
*
* VIDEOPORTBANDWIDTH Flags
*
****************************************************************************/
/*
* The specified height/width refer to the size of the video port data
* written into memory, after prescaling has occured.
*/
#define DDVPB_VIDEOPORT 0x00000001l
/*
* The specified height/width refer to the source size of the overlay.
*/
#define DDVPB_OVERLAY 0x00000002l
/*
* This is a query for the device to return which caps this device requires.
*/
#define DDVPB_TYPE 0x00000004l
/****************************************************************************
*
* VIDEOPORTBANDWIDTH Caps
*
****************************************************************************/
/*
* The bandwidth for this device is dependant on the overlay source size.
*/
#define DDVPBCAPS_SOURCE 0x00000001l
/*
* The bandwidth for this device is dependant on the overlay destination
* size.
*/
#define DDVPBCAPS_DESTINATION 0x00000002l
/****************************************************************************
*
* DDVIDEOPORTCONTAINER CreateVideoPort flags
*
****************************************************************************/
/*
* The process only wants to control the VBI portion of the video stream.
*/
#define DDVPCREATE_VBIONLY 0x00000001l
/*
* The process only wants to control the non-VBI (video) portion of
* the video stream.
*/
#define DDVPCREATE_VIDEOONLY 0x00000002l
/****************************************************************************
*
* DDVIDEOPORTSTATUS flags
*
****************************************************************************/
/*
* The video port interface is only controlling the VBI portion of the
* video stream
*/
#define DDVPSTATUS_VBIONLY 0x00000001l
/*
* The video port interface is only controlling the video portion of the
* video stream
*/
#define DDVPSTATUS_VIDEOONLY 0x00000002l
#ifdef __cplusplus
};
#endif
#endif // GUID_DEFS_ONLY
#endif

View File

@ -0,0 +1,98 @@
/*==========================================================================;
*
* Copyright (C) Microsoft Corporation. All Rights Reserved.
*
* File: dx7todx8.h
* Content: DX7 to DX8 Direct3D aliases to aid porting DX7 apps to DX8
*
***************************************************************************/
#ifndef _DX7TODX8_H_
///////////////////////////////////////////////////////////////////////////////
//
// d3d8types.h
//
///////////////////////////////////////////////////////////////////////////////
#define D3DTRANSFORMSTATE_WORLD D3DTS_WORLD
#define D3DTRANSFORMSTATE_VIEW D3DTS_VIEW
#define D3DTRANSFORMSTATE_PROJECTION D3DTS_PROJECTION
#define D3DTRANSFORMSTATE_WORLD1 D3DTS_WORLD1
#define D3DTRANSFORMSTATE_WORLD2 D3DTS_WORLD2
#define D3DTRANSFORMSTATE_WORLD3 D3DTS_WORLD3
#define D3DTRANSFORMSTATE_TEXTURE0 D3DTS_TEXTURE0
#define D3DTRANSFORMSTATE_TEXTURE1 D3DTS_TEXTURE1
#define D3DTRANSFORMSTATE_TEXTURE2 D3DTS_TEXTURE2
#define D3DTRANSFORMSTATE_TEXTURE3 D3DTS_TEXTURE3
#define D3DTRANSFORMSTATE_TEXTURE4 D3DTS_TEXTURE4
#define D3DTRANSFORMSTATE_TEXTURE5 D3DTS_TEXTURE5
#define D3DTRANSFORMSTATE_TEXTURE6 D3DTS_TEXTURE6
#define D3DTRANSFORMSTATE_TEXTURE7 D3DTS_TEXTURE7
#define D3DTRANSFORMSTATE_FORCE_DWORD D3DTS_FORCE_DWORD
#define D3DRENDERSTATE_ZENABLE D3DRS_ZENABLE
#define D3DRENDERSTATE_FILLMODE D3DRS_FILLMODE
#define D3DRENDERSTATE_SHADEMODE D3DRS_SHADEMODE
#define D3DRENDERSTATE_LINEPATTERN D3DRS_LINEPATTERN
#define D3DRENDERSTATE_ZWRITEENABLE D3DRS_ZWRITEENABLE
#define D3DRENDERSTATE_ALPHATESTENABLE D3DRS_ALPHATESTENABLE
#define D3DRENDERSTATE_LASTPIXEL D3DRS_LASTPIXEL
#define D3DRENDERSTATE_SRCBLEND D3DRS_SRCBLEND
#define D3DRENDERSTATE_DESTBLEND D3DRS_DESTBLEND
#define D3DRENDERSTATE_CULLMODE D3DRS_CULLMODE
#define D3DRENDERSTATE_ZFUNC D3DRS_ZFUNC
#define D3DRENDERSTATE_ALPHAREF D3DRS_ALPHAREF
#define D3DRENDERSTATE_ALPHAFUNC D3DRS_ALPHAFUNC
#define D3DRENDERSTATE_DITHERENABLE D3DRS_DITHERENABLE
#define D3DRENDERSTATE_ALPHABLENDENABLE D3DRS_ALPHABLENDENABLE
#define D3DRENDERSTATE_FOGENABLE D3DRS_FOGENABLE
#define D3DRENDERSTATE_SPECULARENABLE D3DRS_SPECULARENABLE
#define D3DRENDERSTATE_ZVISIBLE D3DRS_ZVISIBLE
#define D3DRENDERSTATE_FOGCOLOR D3DRS_FOGCOLOR
#define D3DRENDERSTATE_FOGTABLEMODE D3DRS_FOGTABLEMODE
#define D3DRENDERSTATE_FOGSTART D3DRS_FOGSTART
#define D3DRENDERSTATE_FOGEND D3DRS_FOGEND
#define D3DRENDERSTATE_FOGDENSITY D3DRS_FOGDENSITY
#define D3DRENDERSTATE_EDGEANTIALIAS D3DRS_EDGEANTIALIAS
#define D3DRENDERSTATE_ZBIAS D3DRS_ZBIAS
#define D3DRENDERSTATE_RANGEFOGENABLE D3DRS_RANGEFOGENABLE
#define D3DRENDERSTATE_STENCILENABLE D3DRS_STENCILENABLE
#define D3DRENDERSTATE_STENCILFAIL D3DRS_STENCILFAIL
#define D3DRENDERSTATE_STENCILZFAIL D3DRS_STENCILZFAIL
#define D3DRENDERSTATE_STENCILPASS D3DRS_STENCILPASS
#define D3DRENDERSTATE_STENCILFUNC D3DRS_STENCILFUNC
#define D3DRENDERSTATE_STENCILREF D3DRS_STENCILREF
#define D3DRENDERSTATE_STENCILMASK D3DRS_STENCILMASK
#define D3DRENDERSTATE_STENCILWRITEMASK D3DRS_STENCILWRITEMASK
#define D3DRENDERSTATE_TEXTUREFACTOR D3DRS_TEXTUREFACTOR
#define D3DRENDERSTATE_WRAP0 D3DRS_WRAP0
#define D3DRENDERSTATE_WRAP1 D3DRS_WRAP1
#define D3DRENDERSTATE_WRAP2 D3DRS_WRAP2
#define D3DRENDERSTATE_WRAP3 D3DRS_WRAP3
#define D3DRENDERSTATE_WRAP4 D3DRS_WRAP4
#define D3DRENDERSTATE_WRAP5 D3DRS_WRAP5
#define D3DRENDERSTATE_WRAP6 D3DRS_WRAP6
#define D3DRENDERSTATE_WRAP7 D3DRS_WRAP7
#define D3DRENDERSTATE_CLIPPING D3DRS_CLIPPING
#define D3DRENDERSTATE_LIGHTING D3DRS_LIGHTING
#define D3DRENDERSTATE_EXTENTS D3DRS_EXTENTS
#define D3DRENDERSTATE_AMBIENT D3DRS_AMBIENT
#define D3DRENDERSTATE_FOGVERTEXMODE D3DRS_FOGVERTEXMODE
#define D3DRENDERSTATE_COLORVERTEX D3DRS_COLORVERTEX
#define D3DRENDERSTATE_LOCALVIEWER D3DRS_LOCALVIEWER
#define D3DRENDERSTATE_NORMALIZENORMALS D3DRS_NORMALIZENORMALS
#define D3DRENDERSTATE_DIFFUSEMATERIALSOURCE D3DRS_DIFFUSEMATERIALSOURCE
#define D3DRENDERSTATE_SPECULARMATERIALSOURCE D3DRS_SPECULARMATERIALSOURCE
#define D3DRENDERSTATE_AMBIENTMATERIALSOURCE D3DRS_AMBIENTMATERIALSOURCE
#define D3DRENDERSTATE_EMISSIVEMATERIALSOURCE D3DRS_EMISSIVEMATERIALSOURCE
#define D3DRENDERSTATE_VERTEXBLEND D3DRS_VERTEXBLEND
#define D3DRENDERSTATE_CLIPPLANEENABLE D3DRS_CLIPPLANEENABLE
#define RGBA_MAKE D3DCOLOR_RGBA
#define RGB_MAKE D3DCOLOR_XRGB
#define D3DRGBA D3DCOLOR_COLORVALUE
#define D3DRGB(_r,_g,_b) D3DCOLOR_COLORVALUE(_r,_g,_b,1.f)
#define _DX7TODX8_H_
#endif //_DX7TODX8_H_

View File

@ -0,0 +1,187 @@
/*==========================================================================;
*
* Copyright (C) Microsoft Corporation. All Rights Reserved.
*
* File: dxdiag.h
* Content: DirectX Diagnostic Tool include file
*
****************************************************************************/
#ifndef _DXDIAG_H_
#define _DXDIAG_H_
#include <ole2.h> // for DECLARE_INTERFACE_ and HRESULT
// This identifier is passed to IDxDiagProvider::Initialize in order to ensure that an
// application was built against the correct header files. This number is
// incremented whenever a header (or other) change would require applications
// to be rebuilt. If the version doesn't match, IDxDiagProvider::Initialize will fail.
// (The number itself has no meaning.)
#define DXDIAG_DX9_SDK_VERSION 111
#ifdef __cplusplus
extern "C" {
#endif
/****************************************************************************
*
* DxDiag Errors
*
****************************************************************************/
#define DXDIAG_E_INSUFFICIENT_BUFFER ((HRESULT)0x8007007AL) // HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)
/****************************************************************************
*
* DxDiag CLSIDs
*
****************************************************************************/
// {A65B8071-3BFE-4213-9A5B-491DA4461CA7}
DEFINE_GUID(CLSID_DxDiagProvider,
0xA65B8071, 0x3BFE, 0x4213, 0x9A, 0x5B, 0x49, 0x1D, 0xA4, 0x46, 0x1C, 0xA7);
/****************************************************************************
*
* DxDiag Interface IIDs
*
****************************************************************************/
// {9C6B4CB0-23F8-49CC-A3ED-45A55000A6D2}
DEFINE_GUID(IID_IDxDiagProvider,
0x9C6B4CB0, 0x23F8, 0x49CC, 0xA3, 0xED, 0x45, 0xA5, 0x50, 0x00, 0xA6, 0xD2);
// {0x7D0F462F-0x4064-0x4862-BC7F-933E5058C10F}
DEFINE_GUID(IID_IDxDiagContainer,
0x7D0F462F, 0x4064, 0x4862, 0xBC, 0x7F, 0x93, 0x3E, 0x50, 0x58, 0xC1, 0x0F);
/****************************************************************************
*
* DxDiag Interface Pointer definitions
*
****************************************************************************/
typedef struct IDxDiagProvider *LPDXDIAGPROVIDER, *PDXDIAGPROVIDER;
typedef struct IDxDiagContainer *LPDXDIAGCONTAINER, *PDXDIAGCONTAINER;
/****************************************************************************
*
* DxDiag Structures
*
****************************************************************************/
typedef struct _DXDIAG_INIT_PARAMS
{
DWORD dwSize; // Size of this structure.
DWORD dwDxDiagHeaderVersion; // Pass in DXDIAG_DX9_SDK_VERSION. This verifies
// the header and dll are correctly matched.
BOOL bAllowWHQLChecks; // If true, allow dxdiag to check if drivers are
// digital signed as logo'd by WHQL which may
// connect via internet to update WHQL certificates.
VOID* pReserved; // Reserved. Must be NULL.
} DXDIAG_INIT_PARAMS;
/****************************************************************************
*
* DxDiag Application Interfaces
*
****************************************************************************/
//
// COM definition for IDxDiagProvider
//
#undef INTERFACE // External COM Implementation
#define INTERFACE IDxDiagProvider
DECLARE_INTERFACE_(IDxDiagProvider,IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/*** IDxDiagProvider methods ***/
STDMETHOD(Initialize) (THIS_ DXDIAG_INIT_PARAMS* pParams) PURE;
STDMETHOD(GetRootContainer) (THIS_ IDxDiagContainer **ppInstance) PURE;
};
//
// COM definition for IDxDiagContainer
//
#undef INTERFACE // External COM Implementation
#define INTERFACE IDxDiagContainer
DECLARE_INTERFACE_(IDxDiagContainer,IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/*** IDxDiagContainer methods ***/
STDMETHOD(GetNumberOfChildContainers) (THIS_ DWORD *pdwCount) PURE;
STDMETHOD(EnumChildContainerNames) (THIS_ DWORD dwIndex, LPWSTR pwszContainer, DWORD cchContainer) PURE;
STDMETHOD(GetChildContainer) (THIS_ LPCWSTR pwszContainer, IDxDiagContainer **ppInstance) PURE;
STDMETHOD(GetNumberOfProps) (THIS_ DWORD *pdwCount) PURE;
STDMETHOD(EnumPropNames) (THIS_ DWORD dwIndex, LPWSTR pwszPropName, DWORD cchPropName) PURE;
STDMETHOD(GetProp) (THIS_ LPCWSTR pwszPropName, VARIANT *pvarProp) PURE;
};
/****************************************************************************
*
* DxDiag application interface macros
*
****************************************************************************/
#if !defined(__cplusplus) || defined(CINTERFACE)
#define IDxDiagProvider_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDxDiagProvider_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDxDiagProvider_Release(p) (p)->lpVtbl->Release(p)
#define IDxDiagProvider_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
#define IDxDiagProvider_GetRootContainer(p,a) (p)->lpVtbl->GetRootContainer(p,a)
#define IDxDiagContainer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDxDiagContainer_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDxDiagContainer_Release(p) (p)->lpVtbl->Release(p)
#define IDxDiagContainer_GetNumberOfChildContainers(p,a) (p)->lpVtbl->GetNumberOfChildContainers(p,a)
#define IDxDiagContainer_EnumChildContainerNames(p,a,b,c) (p)->lpVtbl->EnumChildContainerNames(p,a,b,c)
#define IDxDiagContainer_GetChildContainer(p,a,b) (p)->lpVtbl->GetChildContainer(p,a,b)
#define IDxDiagContainer_GetNumberOfProps(p,a) (p)->lpVtbl->GetNumberOfProps(p,a)
#define IDxDiagContainer_EnumProps(p,a,b) (p)->lpVtbl->EnumProps(p,a,b,c)
#define IDxDiagContainer_GetProp(p,a,b) (p)->lpVtbl->GetProp(p,a,b)
#else /* C++ */
#define IDxDiagProvider_QueryInterface(p,a,b) (p)->QueryInterface(p,a,b)
#define IDxDiagProvider_AddRef(p) (p)->AddRef(p)
#define IDxDiagProvider_Release(p) (p)->Release(p)
#define IDxDiagProvider_Initialize(p,a,b) (p)->Initialize(p,a,b)
#define IDxDiagProvider_GetRootContainer(p,a) (p)->GetRootContainer(p,a)
#define IDxDiagContainer_QueryInterface(p,a,b) (p)->QueryInterface(p,a,b)
#define IDxDiagContainer_AddRef(p) (p)->AddRef(p)
#define IDxDiagContainer_Release(p) (p)->Release(p)
#define IDxDiagContainer_GetNumberOfChildContainers(p,a) (p)->GetNumberOfChildContainers(p,a)
#define IDxDiagContainer_EnumChildContainerNames(p,a,b,c) (p)->EnumChildContainerNames(p,a,b,c)
#define IDxDiagContainer_GetChildContainer(p,a,b) (p)->GetChildContainer(p,a,b)
#define IDxDiagContainer_GetNumberOfProps(p,a) (p)->GetNumberOfProps(p,a)
#define IDxDiagContainer_EnumProps(p,a,b) (p)->EnumProps(p,a,b,c)
#define IDxDiagContainer_GetProp(p,a,b) (p)->GetProp(p,a,b)
#endif
#ifdef __cplusplus
}
#endif
#endif /* _DXDIAG_H_ */

View File

@ -0,0 +1,99 @@
/*==========================================================================;
*
*
* File: dxerr8.h
* Content: DirectX Error Library Include File
*
****************************************************************************/
#ifndef _DXERR8_H_
#define _DXERR8_H_
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
//
// DXGetErrorString8
//
// Desc: Converts a DirectX HRESULT to a string
//
// Args: HRESULT hr Can be any error code from
// D3D8 D3DX8 DDRAW DPLAY8 DMUSIC DSOUND DINPUT DSHOW
//
// Return: Converted string
//
const char* WINAPI DXGetErrorString8A(HRESULT hr);
const WCHAR* WINAPI DXGetErrorString8W(HRESULT hr);
#ifdef UNICODE
#define DXGetErrorString8 DXGetErrorString8W
#else
#define DXGetErrorString8 DXGetErrorString8A
#endif
//
// DXGetErrorDescription8
//
// Desc: Returns a string description of a DirectX HRESULT
//
// Args: HRESULT hr Can be any error code from
// D3D8 D3DX8 DDRAW DPLAY8 DMUSIC DSOUND DINPUT DSHOW
//
// Return: String description
//
const char* WINAPI DXGetErrorDescription8A(HRESULT hr);
const WCHAR* WINAPI DXGetErrorDescription8W(HRESULT hr);
#ifdef UNICODE
#define DXGetErrorDescription8 DXGetErrorDescription8W
#else
#define DXGetErrorDescription8 DXGetErrorDescription8A
#endif
//
// DXTrace
//
// Desc: Outputs a formatted error message to the debug stream
//
// Args: CHAR* strFile The current file, typically passed in using the
// __FILE__ macro.
// DWORD dwLine The current line number, typically passed in using the
// __LINE__ macro.
// HRESULT hr An HRESULT that will be traced to the debug stream.
// CHAR* strMsg A string that will be traced to the debug stream (may be NULL)
// BOOL bPopMsgBox If TRUE, then a message box will popup also containing the passed info.
//
// Return: The hr that was passed in.
//
HRESULT WINAPI DXTraceA( const char* strFile, DWORD dwLine, HRESULT hr, const char* strMsg, BOOL bPopMsgBox );
HRESULT WINAPI DXTraceW( const char* strFile, DWORD dwLine, HRESULT hr, const WCHAR* strMsg, BOOL bPopMsgBox );
#ifdef UNICODE
#define DXTrace DXTraceW
#else
#define DXTrace DXTraceA
#endif
//
// Helper macros
//
#if defined(DEBUG) | defined(_DEBUG)
#define DXTRACE_MSG(str) DXTrace( __FILE__, (DWORD)__LINE__, 0, str, FALSE )
#define DXTRACE_ERR(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, TRUE )
#define DXTRACE_ERR_NOMSGBOX(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, FALSE )
#else
#define DXTRACE_MSG(str) (0L)
#define DXTRACE_ERR(str,hr) (hr)
#define DXTRACE_ERR_NOMSGBOX(str,hr) (hr)
#endif
#ifdef __cplusplus
}
#endif //__cplusplus
#endif // _DXERR8_H_

View File

@ -0,0 +1,99 @@
/*==========================================================================;
*
*
* File: dxerr9.h
* Content: DirectX Error Library Include File
*
****************************************************************************/
#ifndef _DXERR9_H_
#define _DXERR9_H_
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
//
// DXGetErrorString9
//
// Desc: Converts a DirectX 9 or earlier HRESULT to a string
//
// Args: HRESULT hr Can be any error code from
// D3D9 D3DX9 D3D8 D3DX8 DDRAW DPLAY8 DMUSIC DSOUND DINPUT DSHOW
//
// Return: Converted string
//
const char* WINAPI DXGetErrorString9A(HRESULT hr);
const WCHAR* WINAPI DXGetErrorString9W(HRESULT hr);
#ifdef UNICODE
#define DXGetErrorString9 DXGetErrorString9W
#else
#define DXGetErrorString9 DXGetErrorString9A
#endif
//
// DXGetErrorDescription9
//
// Desc: Returns a string description of a DirectX 9 or earlier HRESULT
//
// Args: HRESULT hr Can be any error code from
// D3D9 D3DX9 D3D8 D3DX8 DDRAW DPLAY8 DMUSIC DSOUND DINPUT DSHOW
//
// Return: String description
//
const char* WINAPI DXGetErrorDescription9A(HRESULT hr);
const WCHAR* WINAPI DXGetErrorDescription9W(HRESULT hr);
#ifdef UNICODE
#define DXGetErrorDescription9 DXGetErrorDescription9W
#else
#define DXGetErrorDescription9 DXGetErrorDescription9A
#endif
//
// DXTrace
//
// Desc: Outputs a formatted error message to the debug stream
//
// Args: CHAR* strFile The current file, typically passed in using the
// __FILE__ macro.
// DWORD dwLine The current line number, typically passed in using the
// __LINE__ macro.
// HRESULT hr An HRESULT that will be traced to the debug stream.
// CHAR* strMsg A string that will be traced to the debug stream (may be NULL)
// BOOL bPopMsgBox If TRUE, then a message box will popup also containing the passed info.
//
// Return: The hr that was passed in.
//
HRESULT WINAPI DXTraceA( const char* strFile, DWORD dwLine, HRESULT hr, const char* strMsg, BOOL bPopMsgBox );
HRESULT WINAPI DXTraceW( const char* strFile, DWORD dwLine, HRESULT hr, const WCHAR* strMsg, BOOL bPopMsgBox );
#ifdef UNICODE
#define DXTrace DXTraceW
#else
#define DXTrace DXTraceA
#endif
//
// Helper macros
//
#if defined(DEBUG) | defined(_DEBUG)
#define DXTRACE_MSG(str) DXTrace( __FILE__, (DWORD)__LINE__, 0, str, FALSE )
#define DXTRACE_ERR(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, FALSE )
#define DXTRACE_ERR_MSGBOX(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, TRUE )
#else
#define DXTRACE_MSG(str) (0L)
#define DXTRACE_ERR(str,hr) (hr)
#define DXTRACE_ERR_MSGBOX(str,hr) (hr)
#endif
#ifdef __cplusplus
}
#endif //__cplusplus
#endif // _DXERR9_H_

View File

@ -0,0 +1,240 @@
/***************************************************************************
*
* Copyright (C) 1998-1999 Microsoft Corporation. All Rights Reserved.
*
* File: dxfile.h
*
* Content: DirectX File public header file
*
***************************************************************************/
#ifndef __DXFILE_H__
#define __DXFILE_H__
#ifdef __cplusplus
extern "C" {
#endif
typedef DWORD DXFILEFORMAT;
#define DXFILEFORMAT_BINARY 0
#define DXFILEFORMAT_TEXT 1
#define DXFILEFORMAT_COMPRESSED 2
typedef DWORD DXFILELOADOPTIONS;
#define DXFILELOAD_FROMFILE 0x00L
#define DXFILELOAD_FROMRESOURCE 0x01L
#define DXFILELOAD_FROMMEMORY 0x02L
#define DXFILELOAD_FROMSTREAM 0x04L
#define DXFILELOAD_FROMURL 0x08L
typedef struct _DXFILELOADRESOURCE {
HMODULE hModule;
LPCTSTR lpName;
LPCTSTR lpType;
}DXFILELOADRESOURCE, *LPDXFILELOADRESOURCE;
typedef struct _DXFILELOADMEMORY {
LPVOID lpMemory;
DWORD dSize;
}DXFILELOADMEMORY, *LPDXFILELOADMEMORY;
/*
* DirectX File object types.
*/
#ifndef WIN_TYPES
#define WIN_TYPES(itype, ptype) typedef interface itype *LP##ptype, **LPLP##ptype
#endif
WIN_TYPES(IDirectXFile, DIRECTXFILE);
WIN_TYPES(IDirectXFileEnumObject, DIRECTXFILEENUMOBJECT);
WIN_TYPES(IDirectXFileSaveObject, DIRECTXFILESAVEOBJECT);
WIN_TYPES(IDirectXFileObject, DIRECTXFILEOBJECT);
WIN_TYPES(IDirectXFileData, DIRECTXFILEDATA);
WIN_TYPES(IDirectXFileDataReference, DIRECTXFILEDATAREFERENCE);
WIN_TYPES(IDirectXFileBinary, DIRECTXFILEBINARY);
/*
* API for creating IDirectXFile interface.
*/
STDAPI DirectXFileCreate(LPDIRECTXFILE *lplpDirectXFile);
/*
* The methods for IUnknown
*/
#define IUNKNOWN_METHODS(kind) \
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) kind; \
STDMETHOD_(ULONG, AddRef) (THIS) kind; \
STDMETHOD_(ULONG, Release) (THIS) kind
/*
* The methods for IDirectXFileObject
*/
#define IDIRECTXFILEOBJECT_METHODS(kind) \
STDMETHOD(GetName) (THIS_ LPSTR, LPDWORD) kind; \
STDMETHOD(GetId) (THIS_ LPGUID) kind
/*
* DirectX File interfaces.
*/
#undef INTERFACE
#define INTERFACE IDirectXFile
DECLARE_INTERFACE_(IDirectXFile, IUnknown)
{
IUNKNOWN_METHODS(PURE);
STDMETHOD(CreateEnumObject) (THIS_ LPVOID, DXFILELOADOPTIONS,
LPDIRECTXFILEENUMOBJECT *) PURE;
STDMETHOD(CreateSaveObject) (THIS_ LPCSTR, DXFILEFORMAT,
LPDIRECTXFILESAVEOBJECT *) PURE;
STDMETHOD(RegisterTemplates) (THIS_ LPVOID, DWORD) PURE;
};
#undef INTERFACE
#define INTERFACE IDirectXFileEnumObject
DECLARE_INTERFACE_(IDirectXFileEnumObject, IUnknown)
{
IUNKNOWN_METHODS(PURE);
STDMETHOD(GetNextDataObject) (THIS_ LPDIRECTXFILEDATA *) PURE;
STDMETHOD(GetDataObjectById) (THIS_ REFGUID, LPDIRECTXFILEDATA *) PURE;
STDMETHOD(GetDataObjectByName) (THIS_ LPCSTR, LPDIRECTXFILEDATA *) PURE;
};
#undef INTERFACE
#define INTERFACE IDirectXFileSaveObject
DECLARE_INTERFACE_(IDirectXFileSaveObject, IUnknown)
{
IUNKNOWN_METHODS(PURE);
STDMETHOD(SaveTemplates) (THIS_ DWORD, const GUID **) PURE;
STDMETHOD(CreateDataObject) (THIS_ REFGUID, LPCSTR, const GUID *,
DWORD, LPVOID, LPDIRECTXFILEDATA *) PURE;
STDMETHOD(SaveData) (THIS_ LPDIRECTXFILEDATA) PURE;
};
#undef INTERFACE
#define INTERFACE IDirectXFileObject
DECLARE_INTERFACE_(IDirectXFileObject, IUnknown)
{
IUNKNOWN_METHODS(PURE);
IDIRECTXFILEOBJECT_METHODS(PURE);
};
#undef INTERFACE
#define INTERFACE IDirectXFileData
DECLARE_INTERFACE_(IDirectXFileData, IDirectXFileObject)
{
IUNKNOWN_METHODS(PURE);
IDIRECTXFILEOBJECT_METHODS(PURE);
STDMETHOD(GetData) (THIS_ LPCSTR, DWORD *, void **) PURE;
STDMETHOD(GetType) (THIS_ const GUID **) PURE;
STDMETHOD(GetNextObject) (THIS_ LPDIRECTXFILEOBJECT *) PURE;
STDMETHOD(AddDataObject) (THIS_ LPDIRECTXFILEDATA) PURE;
STDMETHOD(AddDataReference) (THIS_ LPCSTR, const GUID *) PURE;
STDMETHOD(AddBinaryObject) (THIS_ LPCSTR, const GUID *, LPCSTR, LPVOID, DWORD) PURE;
};
#undef INTERFACE
#define INTERFACE IDirectXFileDataReference
DECLARE_INTERFACE_(IDirectXFileDataReference, IDirectXFileObject)
{
IUNKNOWN_METHODS(PURE);
IDIRECTXFILEOBJECT_METHODS(PURE);
STDMETHOD(Resolve) (THIS_ LPDIRECTXFILEDATA *) PURE;
};
#undef INTERFACE
#define INTERFACE IDirectXFileBinary
DECLARE_INTERFACE_(IDirectXFileBinary, IDirectXFileObject)
{
IUNKNOWN_METHODS(PURE);
IDIRECTXFILEOBJECT_METHODS(PURE);
STDMETHOD(GetSize) (THIS_ DWORD *) PURE;
STDMETHOD(GetMimeType) (THIS_ LPCSTR *) PURE;
STDMETHOD(Read) (THIS_ LPVOID, DWORD, LPDWORD) PURE;
};
/*
* DirectXFile Object Class Id (for CoCreateInstance())
*/
DEFINE_GUID(CLSID_CDirectXFile, 0x4516ec43, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3);
/*
* DirectX File Interface GUIDs.
*/
DEFINE_GUID(IID_IDirectXFile, 0x3d82ab40, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(IID_IDirectXFileEnumObject, 0x3d82ab41, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(IID_IDirectXFileSaveObject, 0x3d82ab42, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(IID_IDirectXFileObject, 0x3d82ab43, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(IID_IDirectXFileData, 0x3d82ab44, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(IID_IDirectXFileDataReference, 0x3d82ab45, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
DEFINE_GUID(IID_IDirectXFileBinary, 0x3d82ab46, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
/*
* DirectX File Header template's GUID.
*/
DEFINE_GUID(TID_DXFILEHeader, 0x3d82ab43, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
/*
* DirectX File errors.
*/
#define _FACDD 0x876
#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code )
#define DXFILE_OK 0
#define DXFILEERR_BADOBJECT MAKE_DDHRESULT(850)
#define DXFILEERR_BADVALUE MAKE_DDHRESULT(851)
#define DXFILEERR_BADTYPE MAKE_DDHRESULT(852)
#define DXFILEERR_BADSTREAMHANDLE MAKE_DDHRESULT(853)
#define DXFILEERR_BADALLOC MAKE_DDHRESULT(854)
#define DXFILEERR_NOTFOUND MAKE_DDHRESULT(855)
#define DXFILEERR_NOTDONEYET MAKE_DDHRESULT(856)
#define DXFILEERR_FILENOTFOUND MAKE_DDHRESULT(857)
#define DXFILEERR_RESOURCENOTFOUND MAKE_DDHRESULT(858)
#define DXFILEERR_URLNOTFOUND MAKE_DDHRESULT(859)
#define DXFILEERR_BADRESOURCE MAKE_DDHRESULT(860)
#define DXFILEERR_BADFILETYPE MAKE_DDHRESULT(861)
#define DXFILEERR_BADFILEVERSION MAKE_DDHRESULT(862)
#define DXFILEERR_BADFILEFLOATSIZE MAKE_DDHRESULT(863)
#define DXFILEERR_BADFILECOMPRESSIONTYPE MAKE_DDHRESULT(864)
#define DXFILEERR_BADFILE MAKE_DDHRESULT(865)
#define DXFILEERR_PARSEERROR MAKE_DDHRESULT(866)
#define DXFILEERR_NOTEMPLATE MAKE_DDHRESULT(867)
#define DXFILEERR_BADARRAYSIZE MAKE_DDHRESULT(868)
#define DXFILEERR_BADDATAREFERENCE MAKE_DDHRESULT(869)
#define DXFILEERR_INTERNALERROR MAKE_DDHRESULT(870)
#define DXFILEERR_NOMOREOBJECTS MAKE_DDHRESULT(871)
#define DXFILEERR_BADINTRINSICS MAKE_DDHRESULT(872)
#define DXFILEERR_NOMORESTREAMHANDLES MAKE_DDHRESULT(873)
#define DXFILEERR_NOMOREDATA MAKE_DDHRESULT(874)
#define DXFILEERR_BADCACHEFILE MAKE_DDHRESULT(875)
#define DXFILEERR_NOINTERNET MAKE_DDHRESULT(876)
#ifdef __cplusplus
};
#endif
#endif /* _DXFILE_H_ */


View File

@ -0,0 +1,18 @@
/*==========================================================================;
*
*
* File: dxsdkver.h
* Content: DirectX SDK Version Include File
*
****************************************************************************/
#ifndef _DXSDKVER_H_
#define _DXSDKVER_H_
#define _DXSDK_PRODUCT_MAJOR 9
#define _DXSDK_PRODUCT_MINOR 12
#define _DXSDK_BUILD_MAJOR 589
#define _DXSDK_BUILD_MINOR 0000
#endif // _DXSDKVER_H_

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,250 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 7.00.0486 */
/* Compiler settings for gameux.idl:
Oicf, W1, Zp8, env=Win32 (32b run)
protocol : dce , ms_ext, c_ext, robust
error checks: allocation ref bounds_check enum stub_data
VC __declspec() decoration level:
__declspec(uuid()), __declspec(selectany), __declspec(novtable)
DECLSPEC_UUID(), MIDL_INTERFACE()
*/
//@@MIDL_FILE_HEADING( )
#pragma warning( disable: 4049 ) /* more than 64k source lines */
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCSAL_H_VERSION__
#define __REQUIRED_RPCSAL_H_VERSION__ 100
#endif
#include "rpc.h"
#include "rpcndr.h"
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif // __RPCNDR_H_VERSION__
#ifndef COM_NO_WINDOWS_H
#include "windows.h"
#include "ole2.h"
#endif /*COM_NO_WINDOWS_H*/
#ifndef __gameux_h__
#define __gameux_h__
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
/* Forward Declarations */
#ifndef __IGameExplorer_FWD_DEFINED__
#define __IGameExplorer_FWD_DEFINED__
typedef interface IGameExplorer IGameExplorer;
#endif /* __IGameExplorer_FWD_DEFINED__ */
#ifndef __GameExplorer_FWD_DEFINED__
#define __GameExplorer_FWD_DEFINED__
#ifdef __cplusplus
typedef class GameExplorer GameExplorer;
#else
typedef struct GameExplorer GameExplorer;
#endif /* __cplusplus */
#endif /* __GameExplorer_FWD_DEFINED__ */
/* header files for imported files */
#include "oaidl.h"
#include "ocidl.h"
#include "shobjidl.h"
#ifdef __cplusplus
extern "C"{
#endif
/* interface __MIDL_itf_gameux_0000_0000 */
/* [local] */
#define ID_GDF_XML __GDF_XML
#define ID_GDF_THUMBNAIL __GDF_THUMBNAIL
#define ID_ICON_ICO __ICON_ICO
#define ID_GDF_XML_STR L"__GDF_XML"
#define ID_GDF_THUMBNAIL_STR L"__GDF_THUMBNAIL"
typedef /* [v1_enum] */
enum GAME_INSTALL_SCOPE
{ GIS_NOT_INSTALLED = 1,
GIS_CURRENT_USER = 2,
GIS_ALL_USERS = 3
} GAME_INSTALL_SCOPE;
extern RPC_IF_HANDLE __MIDL_itf_gameux_0000_0000_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_gameux_0000_0000_v0_0_s_ifspec;
#ifndef __IGameExplorer_INTERFACE_DEFINED__
#define __IGameExplorer_INTERFACE_DEFINED__
/* interface IGameExplorer */
/* [unique][helpstring][uuid][object] */
EXTERN_C const IID IID_IGameExplorer;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("E7B2FB72-D728-49B3-A5F2-18EBF5F1349E")
IGameExplorer : public IUnknown
{
public:
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE AddGame(
/* [in] */ __RPC__in BSTR bstrGDFBinaryPath,
/* [in] */ __RPC__in BSTR bstrGameInstallDirectory,
/* [in] */ GAME_INSTALL_SCOPE installScope,
/* [out][in] */ __RPC__inout GUID *pguidInstanceID) = 0;
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE RemoveGame(
/* [in] */ GUID guidInstanceID) = 0;
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE UpdateGame(
/* [in] */ GUID guidInstanceID) = 0;
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE VerifyAccess(
/* [in] */ __RPC__in BSTR bstrGDFBinaryPath,
/* [out] */ __RPC__out BOOL *pfHasAccess) = 0;
};
#else /* C style interface */
typedef struct IGameExplorerVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IGameExplorer * This,
/* [in] */ __RPC__in REFIID riid,
/* [iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IGameExplorer * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IGameExplorer * This);
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *AddGame )(
IGameExplorer * This,
/* [in] */ __RPC__in BSTR bstrGDFBinaryPath,
/* [in] */ __RPC__in BSTR bstrGameInstallDirectory,
/* [in] */ GAME_INSTALL_SCOPE installScope,
/* [out][in] */ __RPC__inout GUID *pguidInstanceID);
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *RemoveGame )(
IGameExplorer * This,
/* [in] */ GUID guidInstanceID);
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *UpdateGame )(
IGameExplorer * This,
/* [in] */ GUID guidInstanceID);
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *VerifyAccess )(
IGameExplorer * This,
/* [in] */ __RPC__in BSTR bstrGDFBinaryPath,
/* [out] */ __RPC__out BOOL *pfHasAccess);
END_INTERFACE
} IGameExplorerVtbl;
interface IGameExplorer
{
CONST_VTBL struct IGameExplorerVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IGameExplorer_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IGameExplorer_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IGameExplorer_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IGameExplorer_AddGame(This,bstrGDFBinaryPath,bstrGameInstallDirectory,installScope,pguidInstanceID) \
( (This)->lpVtbl -> AddGame(This,bstrGDFBinaryPath,bstrGameInstallDirectory,installScope,pguidInstanceID) )
#define IGameExplorer_RemoveGame(This,guidInstanceID) \
( (This)->lpVtbl -> RemoveGame(This,guidInstanceID) )
#define IGameExplorer_UpdateGame(This,guidInstanceID) \
( (This)->lpVtbl -> UpdateGame(This,guidInstanceID) )
#define IGameExplorer_VerifyAccess(This,bstrGDFBinaryPath,pfHasAccess) \
( (This)->lpVtbl -> VerifyAccess(This,bstrGDFBinaryPath,pfHasAccess) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IGameExplorer_INTERFACE_DEFINED__ */
#ifndef __gameuxLib_LIBRARY_DEFINED__
#define __gameuxLib_LIBRARY_DEFINED__
/* library gameuxLib */
/* [helpstring][version][uuid] */
EXTERN_C const IID LIBID_gameuxLib;
EXTERN_C const CLSID CLSID_GameExplorer;
#ifdef __cplusplus
class DECLSPEC_UUID("9A5EA990-3034-4D6F-9128-01F3C61022BC")
GameExplorer;
#endif
#endif /* __gameuxLib_LIBRARY_DEFINED__ */
/* Additional Prototypes for ALL interfaces */
unsigned long __RPC_USER BSTR_UserSize( unsigned long *, unsigned long , BSTR * );
unsigned char * __RPC_USER BSTR_UserMarshal( unsigned long *, unsigned char *, BSTR * );
unsigned char * __RPC_USER BSTR_UserUnmarshal(unsigned long *, unsigned char *, BSTR * );
void __RPC_USER BSTR_UserFree( unsigned long *, BSTR * );
/* end of Additional Prototypes */
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,484 @@
//=============================================================================
//
// multimon.h -- Stub module that fakes multiple monitor apis on Win32 OSes
// without them.
//
// By using this header your code will get back default values from
// GetSystemMetrics() for new metrics, and the new multimonitor APIs
// will act like only one display is present on a Win32 OS without
// multimonitor APIs.
//
// Exactly one source must include this with COMPILE_MULTIMON_STUBS defined.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//=============================================================================
#ifdef __cplusplus
extern "C" { // Assume C declarations for C++
#endif // __cplusplus
//
// If we are building with Win95/NT4 headers, we need to declare
// the multimonitor-related metrics and APIs ourselves.
//
#ifndef SM_CMONITORS
#define SM_XVIRTUALSCREEN 76
#define SM_YVIRTUALSCREEN 77
#define SM_CXVIRTUALSCREEN 78
#define SM_CYVIRTUALSCREEN 79
#define SM_CMONITORS 80
#define SM_SAMEDISPLAYFORMAT 81
// HMONITOR is already declared if WINVER >= 0x0500 in windef.h
// This is for components built with an older version number.
//
#if !defined(HMONITOR_DECLARED) && (WINVER < 0x0500)
DECLARE_HANDLE(HMONITOR);
#define HMONITOR_DECLARED
#endif
#define MONITOR_DEFAULTTONULL 0x00000000
#define MONITOR_DEFAULTTOPRIMARY 0x00000001
#define MONITOR_DEFAULTTONEAREST 0x00000002
#define MONITORINFOF_PRIMARY 0x00000001
typedef struct tagMONITORINFO
{
DWORD cbSize;
RECT rcMonitor;
RECT rcWork;
DWORD dwFlags;
} MONITORINFO, *LPMONITORINFO;
#ifndef CCHDEVICENAME
#define CCHDEVICENAME 32
#endif
#ifdef __cplusplus
typedef struct tagMONITORINFOEXA : public tagMONITORINFO
{
CHAR szDevice[CCHDEVICENAME];
} MONITORINFOEXA, *LPMONITORINFOEXA;
typedef struct tagMONITORINFOEXW : public tagMONITORINFO
{
WCHAR szDevice[CCHDEVICENAME];
} MONITORINFOEXW, *LPMONITORINFOEXW;
#ifdef UNICODE
typedef MONITORINFOEXW MONITORINFOEX;
typedef LPMONITORINFOEXW LPMONITORINFOEX;
#else
typedef MONITORINFOEXA MONITORINFOEX;
typedef LPMONITORINFOEXA LPMONITORINFOEX;
#endif // UNICODE
#else // ndef __cplusplus
typedef struct tagMONITORINFOEXA
{
MONITORINFO;
CHAR szDevice[CCHDEVICENAME];
} MONITORINFOEXA, *LPMONITORINFOEXA;
typedef struct tagMONITORINFOEXW
{
MONITORINFO;
WCHAR szDevice[CCHDEVICENAME];
} MONITORINFOEXW, *LPMONITORINFOEXW;
#ifdef UNICODE
typedef MONITORINFOEXW MONITORINFOEX;
typedef LPMONITORINFOEXW LPMONITORINFOEX;
#else
typedef MONITORINFOEXA MONITORINFOEX;
typedef LPMONITORINFOEXA LPMONITORINFOEX;
#endif // UNICODE
#endif
typedef BOOL (CALLBACK* MONITORENUMPROC)(HMONITOR, HDC, LPRECT, LPARAM);
#ifndef DISPLAY_DEVICE_ATTACHED_TO_DESKTOP
typedef struct _DISPLAY_DEVICEA {
DWORD cb;
CHAR DeviceName[32];
CHAR DeviceString[128];
DWORD StateFlags;
CHAR DeviceID[128];
CHAR DeviceKey[128];
} DISPLAY_DEVICEA, *PDISPLAY_DEVICEA, *LPDISPLAY_DEVICEA;
typedef struct _DISPLAY_DEVICEW {
DWORD cb;
WCHAR DeviceName[32];
WCHAR DeviceString[128];
DWORD StateFlags;
WCHAR DeviceID[128];
WCHAR DeviceKey[128];
} DISPLAY_DEVICEW, *PDISPLAY_DEVICEW, *LPDISPLAY_DEVICEW;
#ifdef UNICODE
typedef DISPLAY_DEVICEW DISPLAY_DEVICE;
typedef PDISPLAY_DEVICEW PDISPLAY_DEVICE;
typedef LPDISPLAY_DEVICEW LPDISPLAY_DEVICE;
#else
typedef DISPLAY_DEVICEA DISPLAY_DEVICE;
typedef PDISPLAY_DEVICEA PDISPLAY_DEVICE;
typedef LPDISPLAY_DEVICEA LPDISPLAY_DEVICE;
#endif // UNICODE
#define DISPLAY_DEVICE_ATTACHED_TO_DESKTOP 0x00000001
#define DISPLAY_DEVICE_MULTI_DRIVER 0x00000002
#define DISPLAY_DEVICE_PRIMARY_DEVICE 0x00000004
#define DISPLAY_DEVICE_MIRRORING_DRIVER 0x00000008
#define DISPLAY_DEVICE_VGA_COMPATIBLE 0x00000010
#endif
#endif // SM_CMONITORS
#undef GetMonitorInfo
#undef GetSystemMetrics
#undef MonitorFromWindow
#undef MonitorFromRect
#undef MonitorFromPoint
#undef EnumDisplayMonitors
#undef EnumDisplayDevices
//
// Define COMPILE_MULTIMON_STUBS to compile the stubs;
// otherwise, you get the declarations.
//
#ifdef COMPILE_MULTIMON_STUBS
//-----------------------------------------------------------------------------
//
// Implement the API stubs.
//
//-----------------------------------------------------------------------------
#ifndef MULTIMON_FNS_DEFINED
int (WINAPI* g_pfnGetSystemMetrics)(int) = NULL;
HMONITOR (WINAPI* g_pfnMonitorFromWindow)(HWND, DWORD) = NULL;
HMONITOR (WINAPI* g_pfnMonitorFromRect)(LPCRECT, DWORD) = NULL;
HMONITOR (WINAPI* g_pfnMonitorFromPoint)(POINT, DWORD) = NULL;
BOOL (WINAPI* g_pfnGetMonitorInfo)(HMONITOR, LPMONITORINFO) = NULL;
BOOL (WINAPI* g_pfnEnumDisplayMonitors)(HDC, LPCRECT, MONITORENUMPROC, LPARAM) = NULL;
BOOL (WINAPI* g_pfnEnumDisplayDevices)(PVOID, DWORD, PDISPLAY_DEVICE,DWORD) = NULL;
BOOL g_fMultiMonInitDone = FALSE;
BOOL g_fMultimonPlatformNT = FALSE;
#endif
BOOL IsPlatformNT()
{
OSVERSIONINFOA osvi = {0};
osvi.dwOSVersionInfoSize = sizeof(osvi);
GetVersionExA((OSVERSIONINFOA*)&osvi);
return (VER_PLATFORM_WIN32_NT == osvi.dwPlatformId);
}
BOOL InitMultipleMonitorStubs(void)
{
HMODULE hUser32;
if (g_fMultiMonInitDone)
{
return g_pfnGetMonitorInfo != NULL;
}
g_fMultimonPlatformNT = IsPlatformNT();
hUser32 = GetModuleHandle(TEXT("USER32"));
if (hUser32 &&
(*(FARPROC*)&g_pfnGetSystemMetrics = GetProcAddress(hUser32,"GetSystemMetrics")) != NULL &&
(*(FARPROC*)&g_pfnMonitorFromWindow = GetProcAddress(hUser32,"MonitorFromWindow")) != NULL &&
(*(FARPROC*)&g_pfnMonitorFromRect = GetProcAddress(hUser32,"MonitorFromRect")) != NULL &&
(*(FARPROC*)&g_pfnMonitorFromPoint = GetProcAddress(hUser32,"MonitorFromPoint")) != NULL &&
(*(FARPROC*)&g_pfnEnumDisplayMonitors = GetProcAddress(hUser32,"EnumDisplayMonitors")) != NULL &&
#ifdef UNICODE
(*(FARPROC*)&g_pfnEnumDisplayDevices = GetProcAddress(hUser32,"EnumDisplayDevicesW")) != NULL &&
(*(FARPROC*)&g_pfnGetMonitorInfo = g_fMultimonPlatformNT ? GetProcAddress(hUser32,"GetMonitorInfoW") :
GetProcAddress(hUser32,"GetMonitorInfoA")) != NULL
#else
(*(FARPROC*)&g_pfnGetMonitorInfo = GetProcAddress(hUser32,"GetMonitorInfoA")) != NULL &&
(*(FARPROC*)&g_pfnEnumDisplayDevices = GetProcAddress(hUser32,"EnumDisplayDevicesA")) != NULL
#endif
) {
g_fMultiMonInitDone = TRUE;
return TRUE;
}
else
{
g_pfnGetSystemMetrics = NULL;
g_pfnMonitorFromWindow = NULL;
g_pfnMonitorFromRect = NULL;
g_pfnMonitorFromPoint = NULL;
g_pfnGetMonitorInfo = NULL;
g_pfnEnumDisplayMonitors = NULL;
g_pfnEnumDisplayDevices = NULL;
g_fMultiMonInitDone = TRUE;
return FALSE;
}
}
//-----------------------------------------------------------------------------
//
// fake implementations of Monitor APIs that work with the primary display
// no special parameter validation is made since these run in client code
//
//-----------------------------------------------------------------------------
int WINAPI
xGetSystemMetrics(int nIndex)
{
if (InitMultipleMonitorStubs())
return g_pfnGetSystemMetrics(nIndex);
switch (nIndex)
{
case SM_CMONITORS:
case SM_SAMEDISPLAYFORMAT:
return 1;
case SM_XVIRTUALSCREEN:
case SM_YVIRTUALSCREEN:
return 0;
case SM_CXVIRTUALSCREEN:
nIndex = SM_CXSCREEN;
break;
case SM_CYVIRTUALSCREEN:
nIndex = SM_CYSCREEN;
break;
}
return GetSystemMetrics(nIndex);
}
#define xPRIMARY_MONITOR ((HMONITOR)0x12340042)
HMONITOR WINAPI
xMonitorFromPoint(POINT ptScreenCoords, DWORD dwFlags)
{
if (InitMultipleMonitorStubs())
return g_pfnMonitorFromPoint(ptScreenCoords, dwFlags);
if ((dwFlags & (MONITOR_DEFAULTTOPRIMARY | MONITOR_DEFAULTTONEAREST)) ||
((ptScreenCoords.x >= 0) &&
(ptScreenCoords.x < GetSystemMetrics(SM_CXSCREEN)) &&
(ptScreenCoords.y >= 0) &&
(ptScreenCoords.y < GetSystemMetrics(SM_CYSCREEN))))
{
return xPRIMARY_MONITOR;
}
return NULL;
}
HMONITOR WINAPI
xMonitorFromRect(LPCRECT lprcScreenCoords, DWORD dwFlags)
{
if (InitMultipleMonitorStubs())
return g_pfnMonitorFromRect(lprcScreenCoords, dwFlags);
if ((dwFlags & (MONITOR_DEFAULTTOPRIMARY | MONITOR_DEFAULTTONEAREST)) ||
((lprcScreenCoords->right > 0) &&
(lprcScreenCoords->bottom > 0) &&
(lprcScreenCoords->left < GetSystemMetrics(SM_CXSCREEN)) &&
(lprcScreenCoords->top < GetSystemMetrics(SM_CYSCREEN))))
{
return xPRIMARY_MONITOR;
}
return NULL;
}
HMONITOR WINAPI
xMonitorFromWindow(HWND hWnd, DWORD dwFlags)
{
WINDOWPLACEMENT wp;
if (InitMultipleMonitorStubs())
return g_pfnMonitorFromWindow(hWnd, dwFlags);
if (dwFlags & (MONITOR_DEFAULTTOPRIMARY | MONITOR_DEFAULTTONEAREST))
return xPRIMARY_MONITOR;
if (IsIconic(hWnd) ?
GetWindowPlacement(hWnd, &wp) :
GetWindowRect(hWnd, &wp.rcNormalPosition)) {
return xMonitorFromRect(&wp.rcNormalPosition, dwFlags);
}
return NULL;
}
BOOL WINAPI
xGetMonitorInfo(HMONITOR hMonitor, LPMONITORINFO lpMonitorInfo)
{
RECT rcWork;
if (InitMultipleMonitorStubs())
{
BOOL f = g_pfnGetMonitorInfo(hMonitor, lpMonitorInfo);
#ifdef UNICODE
if (f && !g_fMultimonPlatformNT && (lpMonitorInfo->cbSize >= sizeof(MONITORINFOEX)))
{
MultiByteToWideChar(CP_ACP, 0,
(LPSTR)((MONITORINFOEX*)lpMonitorInfo)->szDevice, -1,
((MONITORINFOEX*)lpMonitorInfo)->szDevice, (sizeof(((MONITORINFOEX*)lpMonitorInfo)->szDevice)/sizeof(TCHAR)));
}
#endif
return f;
}
if ((hMonitor == xPRIMARY_MONITOR) &&
lpMonitorInfo &&
(lpMonitorInfo->cbSize >= sizeof(MONITORINFO)) &&
SystemParametersInfoA(SPI_GETWORKAREA, 0, &rcWork, 0))
{
lpMonitorInfo->rcMonitor.left = 0;
lpMonitorInfo->rcMonitor.top = 0;
lpMonitorInfo->rcMonitor.right = GetSystemMetrics(SM_CXSCREEN);
lpMonitorInfo->rcMonitor.bottom = GetSystemMetrics(SM_CYSCREEN);
lpMonitorInfo->rcWork = rcWork;
lpMonitorInfo->dwFlags = MONITORINFOF_PRIMARY;
if (lpMonitorInfo->cbSize >= sizeof(MONITORINFOEX))
{
#ifdef UNICODE
MultiByteToWideChar(CP_ACP, 0, "DISPLAY", -1, ((MONITORINFOEX*)lpMonitorInfo)->szDevice, (sizeof(((MONITORINFOEX*)lpMonitorInfo)->szDevice)/sizeof(TCHAR)));
#else // UNICODE
lstrcpy(((MONITORINFOEX*)lpMonitorInfo)->szDevice, TEXT("DISPLAY"));
#endif // UNICODE
}
return TRUE;
}
return FALSE;
}
BOOL WINAPI
xEnumDisplayMonitors(
HDC hdcOptionalForPainting,
LPCRECT lprcEnumMonitorsThatIntersect,
MONITORENUMPROC lpfnEnumProc,
LPARAM dwData)
{
RECT rcLimit;
if (InitMultipleMonitorStubs()) {
return g_pfnEnumDisplayMonitors(
hdcOptionalForPainting,
lprcEnumMonitorsThatIntersect,
lpfnEnumProc,
dwData);
}
if (!lpfnEnumProc)
return FALSE;
rcLimit.left = 0;
rcLimit.top = 0;
rcLimit.right = GetSystemMetrics(SM_CXSCREEN);
rcLimit.bottom = GetSystemMetrics(SM_CYSCREEN);
if (hdcOptionalForPainting)
{
RECT rcClip;
POINT ptOrg;
switch (GetClipBox(hdcOptionalForPainting, &rcClip))
{
default:
if (!GetDCOrgEx(hdcOptionalForPainting, &ptOrg))
return FALSE;
OffsetRect(&rcLimit, -ptOrg.x, -ptOrg.y);
if (IntersectRect(&rcLimit, &rcLimit, &rcClip) &&
(!lprcEnumMonitorsThatIntersect ||
IntersectRect(&rcLimit, &rcLimit, lprcEnumMonitorsThatIntersect))) {
break;
}
//fall thru
case NULLREGION:
return TRUE;
case ERROR:
return FALSE;
}
} else {
if ( lprcEnumMonitorsThatIntersect &&
!IntersectRect(&rcLimit, &rcLimit, lprcEnumMonitorsThatIntersect)) {
return TRUE;
}
}
return lpfnEnumProc(
xPRIMARY_MONITOR,
hdcOptionalForPainting,
&rcLimit,
dwData);
}
BOOL WINAPI
xEnumDisplayDevices(
PVOID Unused,
DWORD iDevNum,
PDISPLAY_DEVICE lpDisplayDevice,
DWORD dwFlags)
{
if (InitMultipleMonitorStubs())
return g_pfnEnumDisplayDevices(Unused, iDevNum, lpDisplayDevice, dwFlags);
if (Unused != NULL)
return FALSE;
if (iDevNum != 0)
return FALSE;
if (lpDisplayDevice == NULL || lpDisplayDevice->cb < sizeof(DISPLAY_DEVICE))
return FALSE;
#ifdef UNICODE
MultiByteToWideChar(CP_ACP, 0, "DISPLAY", -1, lpDisplayDevice->DeviceName, (sizeof(lpDisplayDevice->DeviceName)/sizeof(TCHAR)));
MultiByteToWideChar(CP_ACP, 0, "DISPLAY", -1, lpDisplayDevice->DeviceString, (sizeof(lpDisplayDevice->DeviceName)/sizeof(TCHAR)));
#else // UNICODE
lstrcpy((LPTSTR)lpDisplayDevice->DeviceName, TEXT("DISPLAY"));
lstrcpy((LPTSTR)lpDisplayDevice->DeviceString, TEXT("DISPLAY"));
#endif // UNICODE
lpDisplayDevice->StateFlags = DISPLAY_DEVICE_ATTACHED_TO_DESKTOP | DISPLAY_DEVICE_PRIMARY_DEVICE;
return TRUE;
}
#undef xPRIMARY_MONITOR
#undef COMPILE_MULTIMON_STUBS
#else // COMPILE_MULTIMON_STUBS
extern int WINAPI xGetSystemMetrics(int);
extern HMONITOR WINAPI xMonitorFromWindow(HWND, DWORD);
extern HMONITOR WINAPI xMonitorFromRect(LPCRECT, DWORD);
extern HMONITOR WINAPI xMonitorFromPoint(POINT, DWORD);
extern BOOL WINAPI xGetMonitorInfo(HMONITOR, LPMONITORINFO);
extern BOOL WINAPI xEnumDisplayMonitors(HDC, LPCRECT, MONITORENUMPROC, LPARAM);
extern BOOL WINAPI xEnumDisplayDevices(PVOID, DWORD, PDISPLAY_DEVICE, DWORD);
#endif // COMPILE_MULTIMON_STUBS
//
// build defines that replace the regular APIs with our versions
//
#define GetSystemMetrics xGetSystemMetrics
#define MonitorFromWindow xMonitorFromWindow
#define MonitorFromRect xMonitorFromRect
#define MonitorFromPoint xMonitorFromPoint
#define GetMonitorInfo xGetMonitorInfo
#define EnumDisplayMonitors xEnumDisplayMonitors
#define EnumDisplayDevices xEnumDisplayDevices
#ifdef __cplusplus
}
#endif // __cplusplus

View File

@ -0,0 +1,223 @@
/***************************************************************************
*
* Copyright (C) 1998-1999 Microsoft Corporation. All Rights Reserved.
*
* File: rmxfguid.h
*
* Content: Defines GUIDs of D3DRM's templates.
*
***************************************************************************/
#ifndef __RMXFGUID_H_
#define __RMXFGUID_H_
/* {2B957100-9E9A-11cf-AB39-0020AF71E433} */
DEFINE_GUID(TID_D3DRMInfo,
0x2b957100, 0x9e9a, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
/* {3D82AB44-62DA-11cf-AB39-0020AF71E433} */
DEFINE_GUID(TID_D3DRMMesh,
0x3d82ab44, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
/* {3D82AB5E-62DA-11cf-AB39-0020AF71E433} */
DEFINE_GUID(TID_D3DRMVector,
0x3d82ab5e, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
/* {3D82AB5F-62DA-11cf-AB39-0020AF71E433} */
DEFINE_GUID(TID_D3DRMMeshFace,
0x3d82ab5f, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
/* {3D82AB4D-62DA-11cf-AB39-0020AF71E433} */
DEFINE_GUID(TID_D3DRMMaterial,
0x3d82ab4d, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
/* {35FF44E1-6C7C-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMMaterialArray,
0x35ff44e1, 0x6c7c, 0x11cf, 0x8F, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {3D82AB46-62DA-11cf-AB39-0020AF71E433} */
DEFINE_GUID(TID_D3DRMFrame,
0x3d82ab46, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
/* {F6F23F41-7686-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMFrameTransformMatrix,
0xf6f23f41, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {F6F23F42-7686-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMMeshMaterialList,
0xf6f23f42, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {F6F23F40-7686-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMMeshTextureCoords,
0xf6f23f40, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {F6F23F43-7686-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMMeshNormals,
0xf6f23f43, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {F6F23F44-7686-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMCoords2d,
0xf6f23f44, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {F6F23F45-7686-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMMatrix4x4,
0xf6f23f45, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {3D82AB4F-62DA-11cf-AB39-0020AF71E433} */
DEFINE_GUID(TID_D3DRMAnimation,
0x3d82ab4f, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
/* {3D82AB50-62DA-11cf-AB39-0020AF71E433} */
DEFINE_GUID(TID_D3DRMAnimationSet,
0x3d82ab50, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
/* {10DD46A8-775B-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMAnimationKey,
0x10dd46a8, 0x775b, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3);
/* {10DD46A9-775B-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMFloatKeys,
0x10dd46a9, 0x775b, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3);
/* {01411840-7786-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMMaterialAmbientColor,
0x01411840, 0x7786, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3);
/* {01411841-7786-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMMaterialDiffuseColor,
0x01411841, 0x7786, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3);
/* {01411842-7786-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMMaterialSpecularColor,
0x01411842, 0x7786, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3);
/* {D3E16E80-7835-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMMaterialEmissiveColor,
0xd3e16e80, 0x7835, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {01411843-7786-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMMaterialPower,
0x01411843, 0x7786, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3);
/* {35FF44E0-6C7C-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMColorRGBA,
0x35ff44e0, 0x6c7c, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3);
/* {D3E16E81-7835-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMColorRGB,
0xd3e16e81, 0x7835, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {A42790E0-7810-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMGuid,
0xa42790e0, 0x7810, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {A42790E1-7810-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMTextureFilename,
0xa42790e1, 0x7810, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {A42790E2-7810-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMTextureReference,
0xa42790e2, 0x7810, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {1630B820-7842-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMIndexedColor,
0x1630b820, 0x7842, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {1630B821-7842-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMMeshVertexColors,
0x1630b821, 0x7842, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {4885AE60-78E8-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMMaterialWrap,
0x4885ae60, 0x78e8, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {537DA6A0-CA37-11d0-941C-0080C80CFA7B} */
DEFINE_GUID(TID_D3DRMBoolean,
0x537da6a0, 0xca37, 0x11d0, 0x94, 0x1c, 0x0, 0x80, 0xc8, 0xc, 0xfa, 0x7b);
/* {ED1EC5C0-C0A8-11d0-941C-0080C80CFA7B} */
DEFINE_GUID(TID_D3DRMMeshFaceWraps,
0xed1ec5c0, 0xc0a8, 0x11d0, 0x94, 0x1c, 0x0, 0x80, 0xc8, 0xc, 0xfa, 0x7b);
/* {4885AE63-78E8-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMBoolean2d,
0x4885ae63, 0x78e8, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {F406B180-7B3B-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMTimedFloatKeys,
0xf406b180, 0x7b3b, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {E2BF56C0-840F-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMAnimationOptions,
0xe2bf56c0, 0x840f, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {E2BF56C1-840F-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMFramePosition,
0xe2bf56c1, 0x840f, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {E2BF56C2-840F-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMFrameVelocity,
0xe2bf56c2, 0x840f, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {E2BF56C3-840F-11cf-8F52-0040333594A3} */
DEFINE_GUID(TID_D3DRMFrameRotation,
0xe2bf56c3, 0x840f, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3);
/* {3D82AB4A-62DA-11cf-AB39-0020AF71E433} */
DEFINE_GUID(TID_D3DRMLight,
0x3d82ab4a, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
/* {3D82AB51-62DA-11cf-AB39-0020AF71E433} */
DEFINE_GUID(TID_D3DRMCamera,
0x3d82ab51, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
/* {E5745280-B24F-11cf-9DD5-00AA00A71A2F} */
DEFINE_GUID(TID_D3DRMAppData,
0xe5745280, 0xb24f, 0x11cf, 0x9d, 0xd5, 0x0, 0xaa, 0x0, 0xa7, 0x1a, 0x2f);
/* {AED22740-B31F-11cf-9DD5-00AA00A71A2F} */
DEFINE_GUID(TID_D3DRMLightUmbra,
0xaed22740, 0xb31f, 0x11cf, 0x9d, 0xd5, 0x0, 0xaa, 0x0, 0xa7, 0x1a, 0x2f);
/* {AED22742-B31F-11cf-9DD5-00AA00A71A2F} */
DEFINE_GUID(TID_D3DRMLightRange,
0xaed22742, 0xb31f, 0x11cf, 0x9d, 0xd5, 0x0, 0xaa, 0x0, 0xa7, 0x1a, 0x2f);
/* {AED22741-B31F-11cf-9DD5-00AA00A71A2F} */
DEFINE_GUID(TID_D3DRMLightPenumbra,
0xaed22741, 0xb31f, 0x11cf, 0x9d, 0xd5, 0x0, 0xaa, 0x0, 0xa7, 0x1a, 0x2f);
/* {A8A98BA0-C5E5-11cf-B941-0080C80CFA7B} */
DEFINE_GUID(TID_D3DRMLightAttenuation,
0xa8a98ba0, 0xc5e5, 0x11cf, 0xb9, 0x41, 0x0, 0x80, 0xc8, 0xc, 0xfa, 0x7b);
/* {3A23EEA0-94B1-11d0-AB39-0020AF71E433} */
DEFINE_GUID(TID_D3DRMInlineData,
0x3a23eea0, 0x94b1, 0x11d0, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
/* {3A23EEA1-94B1-11d0-AB39-0020AF71E433} */
DEFINE_GUID(TID_D3DRMUrl,
0x3a23eea1, 0x94b1, 0x11d0, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33);
/* {8A63C360-997D-11d0-941C-0080C80CFA7B} */
DEFINE_GUID(TID_D3DRMProgressiveMesh,
0x8A63C360, 0x997D, 0x11d0, 0x94, 0x1C, 0x0, 0x80, 0xC8, 0x0C, 0xFA, 0x7B);
/* {98116AA0-BDBA-11d1-82C0-00A0C9697271} */
DEFINE_GUID(TID_D3DRMExternalVisual,
0x98116AA0, 0xBDBA, 0x11d1, 0x82, 0xC0, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x71);
/* {7F0F21E0-BFE1-11d1-82C0-00A0C9697271} */
DEFINE_GUID(TID_D3DRMStringProperty,
0x7f0f21e0, 0xbfe1, 0x11d1, 0x82, 0xc0, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x71);
/* {7F0F21E1-BFE1-11d1-82C0-00A0C9697271} */
DEFINE_GUID(TID_D3DRMPropertyBag,
0x7f0f21e1, 0xbfe1, 0x11d1, 0x82, 0xc0, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x71);
// {7F5D5EA0-D53A-11d1-82C0-00A0C9697271}
DEFINE_GUID(TID_D3DRMRightHanded,
0x7f5d5ea0, 0xd53a, 0x11d1, 0x82, 0xc0, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x71);
#endif /* __RMXFGUID_H_ */

View File

@ -0,0 +1,339 @@
/* D3DRM XFile templates in binary form */
#ifndef _RMXFTMPL_H_
#define _RMXFTMPL_H_
unsigned char D3DRM_XTEMPLATES[] = {
0x78, 0x6f, 0x66, 0x20, 0x30, 0x33, 0x30, 0x32, 0x62,
0x69, 0x6e, 0x20, 0x30, 0x30, 0x36, 0x34, 0x1f, 0, 0x1,
0, 0x6, 0, 0, 0, 0x48, 0x65, 0x61, 0x64, 0x65,
0x72, 0xa, 0, 0x5, 0, 0x43, 0xab, 0x82, 0x3d, 0xda,
0x62, 0xcf, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4,
0x33, 0x28, 0, 0x1, 0, 0x5, 0, 0, 0, 0x6d,
0x61, 0x6a, 0x6f, 0x72, 0x14, 0, 0x28, 0, 0x1, 0,
0x5, 0, 0, 0, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x14,
0, 0x29, 0, 0x1, 0, 0x5, 0, 0, 0, 0x66,
0x6c, 0x61, 0x67, 0x73, 0x14, 0, 0xb, 0, 0x1f, 0,
0x1, 0, 0x6, 0, 0, 0, 0x56, 0x65, 0x63, 0x74,
0x6f, 0x72, 0xa, 0, 0x5, 0, 0x5e, 0xab, 0x82, 0x3d,
0xda, 0x62, 0xcf, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71,
0xe4, 0x33, 0x2a, 0, 0x1, 0, 0x1, 0, 0, 0,
0x78, 0x14, 0, 0x2a, 0, 0x1, 0, 0x1, 0, 0,
0, 0x79, 0x14, 0, 0x2a, 0, 0x1, 0, 0x1, 0,
0, 0, 0x7a, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1,
0, 0x8, 0, 0, 0, 0x43, 0x6f, 0x6f, 0x72, 0x64,
0x73, 0x32, 0x64, 0xa, 0, 0x5, 0, 0x44, 0x3f, 0xf2,
0xf6, 0x86, 0x76, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33,
0x35, 0x94, 0xa3, 0x2a, 0, 0x1, 0, 0x1, 0, 0,
0, 0x75, 0x14, 0, 0x2a, 0, 0x1, 0, 0x1, 0,
0, 0, 0x76, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1,
0, 0x9, 0, 0, 0, 0x4d, 0x61, 0x74, 0x72, 0x69,
0x78, 0x34, 0x78, 0x34, 0xa, 0, 0x5, 0, 0x45, 0x3f,
0xf2, 0xf6, 0x86, 0x76, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40,
0x33, 0x35, 0x94, 0xa3, 0x34, 0, 0x2a, 0, 0x1, 0,
0x6, 0, 0, 0, 0x6d, 0x61, 0x74, 0x72, 0x69, 0x78,
0xe, 0, 0x3, 0, 0x10, 0, 0, 0, 0xf, 0,
0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0, 0x9, 0,
0, 0, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42,
0x41, 0xa, 0, 0x5, 0, 0xe0, 0x44, 0xff, 0x35, 0x7c,
0x6c, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94,
0xa3, 0x2a, 0, 0x1, 0, 0x3, 0, 0, 0, 0x72,
0x65, 0x64, 0x14, 0, 0x2a, 0, 0x1, 0, 0x5, 0,
0, 0, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x14, 0, 0x2a,
0, 0x1, 0, 0x4, 0, 0, 0, 0x62, 0x6c, 0x75,
0x65, 0x14, 0, 0x2a, 0, 0x1, 0, 0x5, 0, 0,
0, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x14, 0, 0xb, 0,
0x1f, 0, 0x1, 0, 0x8, 0, 0, 0, 0x43, 0x6f,
0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42, 0xa, 0, 0x5, 0,
0x81, 0x6e, 0xe1, 0xd3, 0x35, 0x78, 0xcf, 0x11, 0x8f, 0x52,
0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x2a, 0, 0x1, 0,
0x3, 0, 0, 0, 0x72, 0x65, 0x64, 0x14, 0, 0x2a,
0, 0x1, 0, 0x5, 0, 0, 0, 0x67, 0x72, 0x65,
0x65, 0x6e, 0x14, 0, 0x2a, 0, 0x1, 0, 0x4, 0,
0, 0, 0x62, 0x6c, 0x75, 0x65, 0x14, 0, 0xb, 0,
0x1f, 0, 0x1, 0, 0xc, 0, 0, 0, 0x49, 0x6e,
0x64, 0x65, 0x78, 0x65, 0x64, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
0xa, 0, 0x5, 0, 0x20, 0xb8, 0x30, 0x16, 0x42, 0x78,
0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3,
0x29, 0, 0x1, 0, 0x5, 0, 0, 0, 0x69, 0x6e,
0x64, 0x65, 0x78, 0x14, 0, 0x1, 0, 0x9, 0, 0,
0, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42, 0x41,
0x1, 0, 0xa, 0, 0, 0, 0x69, 0x6e, 0x64, 0x65,
0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x14, 0, 0xb, 0,
0x1f, 0, 0x1, 0, 0x7, 0, 0, 0, 0x42, 0x6f,
0x6f, 0x6c, 0x65, 0x61, 0x6e, 0xa, 0, 0x5, 0, 0xa0,
0xa6, 0x7d, 0x53, 0x37, 0xca, 0xd0, 0x11, 0x94, 0x1c, 0,
0x80, 0xc8, 0xc, 0xfa, 0x7b, 0x29, 0, 0x1, 0, 0x9,
0, 0, 0, 0x74, 0x72, 0x75, 0x65, 0x66, 0x61, 0x6c,
0x73, 0x65, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0,
0x9, 0, 0, 0, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61,
0x6e, 0x32, 0x64, 0xa, 0, 0x5, 0, 0x63, 0xae, 0x85,
0x48, 0xe8, 0x78, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33,
0x35, 0x94, 0xa3, 0x1, 0, 0x7, 0, 0, 0, 0x42,
0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x1, 0, 0x1, 0,
0, 0, 0x75, 0x14, 0, 0x1, 0, 0x7, 0, 0,
0, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x1, 0,
0x1, 0, 0, 0, 0x76, 0x14, 0, 0xb, 0, 0x1f,
0, 0x1, 0, 0xc, 0, 0, 0, 0x4d, 0x61, 0x74,
0x65, 0x72, 0x69, 0x61, 0x6c, 0x57, 0x72, 0x61, 0x70, 0xa,
0, 0x5, 0, 0x60, 0xae, 0x85, 0x48, 0xe8, 0x78, 0xcf,
0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x1,
0, 0x7, 0, 0, 0, 0x42, 0x6f, 0x6f, 0x6c, 0x65,
0x61, 0x6e, 0x1, 0, 0x1, 0, 0, 0, 0x75, 0x14,
0, 0x1, 0, 0x7, 0, 0, 0, 0x42, 0x6f, 0x6f,
0x6c, 0x65, 0x61, 0x6e, 0x1, 0, 0x1, 0, 0, 0,
0x76, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0, 0xf,
0, 0, 0, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65,
0x46, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0xa, 0,
0x5, 0, 0xe1, 0x90, 0x27, 0xa4, 0x10, 0x78, 0xcf, 0x11,
0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x31, 0,
0x1, 0, 0x8, 0, 0, 0, 0x66, 0x69, 0x6c, 0x65,
0x6e, 0x61, 0x6d, 0x65, 0x14, 0, 0xb, 0, 0x1f, 0,
0x1, 0, 0x8, 0, 0, 0, 0x4d, 0x61, 0x74, 0x65,
0x72, 0x69, 0x61, 0x6c, 0xa, 0, 0x5, 0, 0x4d, 0xab,
0x82, 0x3d, 0xda, 0x62, 0xcf, 0x11, 0xab, 0x39, 0, 0x20,
0xaf, 0x71, 0xe4, 0x33, 0x1, 0, 0x9, 0, 0, 0,
0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42, 0x41, 0x1,
0, 0x9, 0, 0, 0, 0x66, 0x61, 0x63, 0x65, 0x43,
0x6f, 0x6c, 0x6f, 0x72, 0x14, 0, 0x2a, 0, 0x1, 0,
0x5, 0, 0, 0, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x14,
0, 0x1, 0, 0x8, 0, 0, 0, 0x43, 0x6f, 0x6c,
0x6f, 0x72, 0x52, 0x47, 0x42, 0x1, 0, 0xd, 0, 0,
0, 0x73, 0x70, 0x65, 0x63, 0x75, 0x6c, 0x61, 0x72, 0x43,
0x6f, 0x6c, 0x6f, 0x72, 0x14, 0, 0x1, 0, 0x8, 0,
0, 0, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42,
0x1, 0, 0xd, 0, 0, 0, 0x65, 0x6d, 0x69, 0x73,
0x73, 0x69, 0x76, 0x65, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x14,
0, 0xe, 0, 0x12, 0, 0x12, 0, 0x12, 0, 0xf,
0, 0xb, 0, 0x1f, 0, 0x1, 0, 0x8, 0, 0,
0, 0x4d, 0x65, 0x73, 0x68, 0x46, 0x61, 0x63, 0x65, 0xa,
0, 0x5, 0, 0x5f, 0xab, 0x82, 0x3d, 0xda, 0x62, 0xcf,
0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33, 0x29,
0, 0x1, 0, 0x12, 0, 0, 0, 0x6e, 0x46, 0x61,
0x63, 0x65, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x49, 0x6e,
0x64, 0x69, 0x63, 0x65, 0x73, 0x14, 0, 0x34, 0, 0x29,
0, 0x1, 0, 0x11, 0, 0, 0, 0x66, 0x61, 0x63,
0x65, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x49, 0x6e, 0x64,
0x69, 0x63, 0x65, 0x73, 0xe, 0, 0x1, 0, 0x12, 0,
0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65, 0x56, 0x65, 0x72,
0x74, 0x65, 0x78, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73,
0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0,
0xd, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68, 0x46, 0x61,
0x63, 0x65, 0x57, 0x72, 0x61, 0x70, 0x73, 0xa, 0, 0x5,
0, 0xc0, 0xc5, 0x1e, 0xed, 0xa8, 0xc0, 0xd0, 0x11, 0x94,
0x1c, 0, 0x80, 0xc8, 0xc, 0xfa, 0x7b, 0x29, 0, 0x1,
0, 0xf, 0, 0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65,
0x57, 0x72, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73,
0x14, 0, 0x34, 0, 0x1, 0, 0x9, 0, 0, 0,
0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x32, 0x64, 0x1,
0, 0xe, 0, 0, 0, 0x66, 0x61, 0x63, 0x65, 0x57,
0x72, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0xe,
0, 0x1, 0, 0xf, 0, 0, 0, 0x6e, 0x46, 0x61,
0x63, 0x65, 0x57, 0x72, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75,
0x65, 0x73, 0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0,
0x1, 0, 0x11, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68,
0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6f, 0x6f,
0x72, 0x64, 0x73, 0xa, 0, 0x5, 0, 0x40, 0x3f, 0xf2,
0xf6, 0x86, 0x76, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33,
0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0xe, 0, 0,
0, 0x6e, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43,
0x6f, 0x6f, 0x72, 0x64, 0x73, 0x14, 0, 0x34, 0, 0x1,
0, 0x8, 0, 0, 0, 0x43, 0x6f, 0x6f, 0x72, 0x64,
0x73, 0x32, 0x64, 0x1, 0, 0xd, 0, 0, 0, 0x74,
0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6f, 0x6f, 0x72,
0x64, 0x73, 0xe, 0, 0x1, 0, 0xe, 0, 0, 0,
0x6e, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6f,
0x6f, 0x72, 0x64, 0x73, 0xf, 0, 0x14, 0, 0xb, 0,
0x1f, 0, 0x1, 0, 0x10, 0, 0, 0, 0x4d, 0x65,
0x73, 0x68, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c,
0x4c, 0x69, 0x73, 0x74, 0xa, 0, 0x5, 0, 0x42, 0x3f,
0xf2, 0xf6, 0x86, 0x76, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40,
0x33, 0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0xa, 0,
0, 0, 0x6e, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61,
0x6c, 0x73, 0x14, 0, 0x29, 0, 0x1, 0, 0xc, 0,
0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65, 0x49, 0x6e, 0x64,
0x65, 0x78, 0x65, 0x73, 0x14, 0, 0x34, 0, 0x29, 0,
0x1, 0, 0xb, 0, 0, 0, 0x66, 0x61, 0x63, 0x65,
0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0xe, 0, 0x1,
0, 0xc, 0, 0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65,
0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0xf, 0, 0x14,
0, 0xe, 0, 0x1, 0, 0x8, 0, 0, 0, 0x4d,
0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0xf, 0, 0xb,
0, 0x1f, 0, 0x1, 0, 0xb, 0, 0, 0, 0x4d,
0x65, 0x73, 0x68, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x73,
0xa, 0, 0x5, 0, 0x43, 0x3f, 0xf2, 0xf6, 0x86, 0x76,
0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3,
0x29, 0, 0x1, 0, 0x8, 0, 0, 0, 0x6e, 0x4e,
0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x73, 0x14, 0, 0x34, 0,
0x1, 0, 0x6, 0, 0, 0, 0x56, 0x65, 0x63, 0x74,
0x6f, 0x72, 0x1, 0, 0x7, 0, 0, 0, 0x6e, 0x6f,
0x72, 0x6d, 0x61, 0x6c, 0x73, 0xe, 0, 0x1, 0, 0x8,
0, 0, 0, 0x6e, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c,
0x73, 0xf, 0, 0x14, 0, 0x29, 0, 0x1, 0, 0xc,
0, 0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65, 0x4e, 0x6f,
0x72, 0x6d, 0x61, 0x6c, 0x73, 0x14, 0, 0x34, 0, 0x1,
0, 0x8, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68, 0x46,
0x61, 0x63, 0x65, 0x1, 0, 0xb, 0, 0, 0, 0x66,
0x61, 0x63, 0x65, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x73,
0xe, 0, 0x1, 0, 0xc, 0, 0, 0, 0x6e, 0x46,
0x61, 0x63, 0x65, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x73,
0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0,
0x10, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68, 0x56, 0x65,
0x72, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x73,
0xa, 0, 0x5, 0, 0x21, 0xb8, 0x30, 0x16, 0x42, 0x78,
0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3,
0x29, 0, 0x1, 0, 0xd, 0, 0, 0, 0x6e, 0x56,
0x65, 0x72, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
0x73, 0x14, 0, 0x34, 0, 0x1, 0, 0xc, 0, 0,
0, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x43, 0x6f,
0x6c, 0x6f, 0x72, 0x1, 0, 0xc, 0, 0, 0, 0x76,
0x65, 0x72, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
0x73, 0xe, 0, 0x1, 0, 0xd, 0, 0, 0, 0x6e,
0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f,
0x72, 0x73, 0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0,
0x1, 0, 0x4, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68,
0xa, 0, 0x5, 0, 0x44, 0xab, 0x82, 0x3d, 0xda, 0x62,
0xcf, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33,
0x29, 0, 0x1, 0, 0x9, 0, 0, 0, 0x6e, 0x56,
0x65, 0x72, 0x74, 0x69, 0x63, 0x65, 0x73, 0x14, 0, 0x34,
0, 0x1, 0, 0x6, 0, 0, 0, 0x56, 0x65, 0x63,
0x74, 0x6f, 0x72, 0x1, 0, 0x8, 0, 0, 0, 0x76,
0x65, 0x72, 0x74, 0x69, 0x63, 0x65, 0x73, 0xe, 0, 0x1,
0, 0x9, 0, 0, 0, 0x6e, 0x56, 0x65, 0x72, 0x74,
0x69, 0x63, 0x65, 0x73, 0xf, 0, 0x14, 0, 0x29, 0,
0x1, 0, 0x6, 0, 0, 0, 0x6e, 0x46, 0x61, 0x63,
0x65, 0x73, 0x14, 0, 0x34, 0, 0x1, 0, 0x8, 0,
0, 0, 0x4d, 0x65, 0x73, 0x68, 0x46, 0x61, 0x63, 0x65,
0x1, 0, 0x5, 0, 0, 0, 0x66, 0x61, 0x63, 0x65,
0x73, 0xe, 0, 0x1, 0, 0x6, 0, 0, 0, 0x6e,
0x46, 0x61, 0x63, 0x65, 0x73, 0xf, 0, 0x14, 0, 0xe,
0, 0x12, 0, 0x12, 0, 0x12, 0, 0xf, 0, 0xb,
0, 0x1f, 0, 0x1, 0, 0x14, 0, 0, 0, 0x46,
0x72, 0x61, 0x6d, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66,
0x6f, 0x72, 0x6d, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0xa,
0, 0x5, 0, 0x41, 0x3f, 0xf2, 0xf6, 0x86, 0x76, 0xcf,
0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x1,
0, 0x9, 0, 0, 0, 0x4d, 0x61, 0x74, 0x72, 0x69,
0x78, 0x34, 0x78, 0x34, 0x1, 0, 0xb, 0, 0, 0,
0x66, 0x72, 0x61, 0x6d, 0x65, 0x4d, 0x61, 0x74, 0x72, 0x69,
0x78, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0, 0x5,
0, 0, 0, 0x46, 0x72, 0x61, 0x6d, 0x65, 0xa, 0,
0x5, 0, 0x46, 0xab, 0x82, 0x3d, 0xda, 0x62, 0xcf, 0x11,
0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33, 0xe, 0,
0x12, 0, 0x12, 0, 0x12, 0, 0xf, 0, 0xb, 0,
0x1f, 0, 0x1, 0, 0x9, 0, 0, 0, 0x46, 0x6c,
0x6f, 0x61, 0x74, 0x4b, 0x65, 0x79, 0x73, 0xa, 0, 0x5,
0, 0xa9, 0x46, 0xdd, 0x10, 0x5b, 0x77, 0xcf, 0x11, 0x8f,
0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x29, 0, 0x1,
0, 0x7, 0, 0, 0, 0x6e, 0x56, 0x61, 0x6c, 0x75,
0x65, 0x73, 0x14, 0, 0x34, 0, 0x2a, 0, 0x1, 0,
0x6, 0, 0, 0, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73,
0xe, 0, 0x1, 0, 0x7, 0, 0, 0, 0x6e, 0x56,
0x61, 0x6c, 0x75, 0x65, 0x73, 0xf, 0, 0x14, 0, 0xb,
0, 0x1f, 0, 0x1, 0, 0xe, 0, 0, 0, 0x54,
0x69, 0x6d, 0x65, 0x64, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4b,
0x65, 0x79, 0x73, 0xa, 0, 0x5, 0, 0x80, 0xb1, 0x6,
0xf4, 0x3b, 0x7b, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33,
0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0x4, 0, 0,
0, 0x74, 0x69, 0x6d, 0x65, 0x14, 0, 0x1, 0, 0x9,
0, 0, 0, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4b, 0x65,
0x79, 0x73, 0x1, 0, 0x6, 0, 0, 0, 0x74, 0x66,
0x6b, 0x65, 0x79, 0x73, 0x14, 0, 0xb, 0, 0x1f, 0,
0x1, 0, 0xc, 0, 0, 0, 0x41, 0x6e, 0x69, 0x6d,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0xa, 0,
0x5, 0, 0xa8, 0x46, 0xdd, 0x10, 0x5b, 0x77, 0xcf, 0x11,
0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x29, 0,
0x1, 0, 0x7, 0, 0, 0, 0x6b, 0x65, 0x79, 0x54,
0x79, 0x70, 0x65, 0x14, 0, 0x29, 0, 0x1, 0, 0x5,
0, 0, 0, 0x6e, 0x4b, 0x65, 0x79, 0x73, 0x14, 0,
0x34, 0, 0x1, 0, 0xe, 0, 0, 0, 0x54, 0x69,
0x6d, 0x65, 0x64, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4b, 0x65,
0x79, 0x73, 0x1, 0, 0x4, 0, 0, 0, 0x6b, 0x65,
0x79, 0x73, 0xe, 0, 0x1, 0, 0x5, 0, 0, 0,
0x6e, 0x4b, 0x65, 0x79, 0x73, 0xf, 0, 0x14, 0, 0xb,
0, 0x1f, 0, 0x1, 0, 0x10, 0, 0, 0, 0x41,
0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0xa, 0, 0x5, 0, 0xc0,
0x56, 0xbf, 0xe2, 0xf, 0x84, 0xcf, 0x11, 0x8f, 0x52, 0,
0x40, 0x33, 0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0xa,
0, 0, 0, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f,
0x73, 0x65, 0x64, 0x14, 0, 0x29, 0, 0x1, 0, 0xf,
0, 0, 0, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f,
0x6e, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x14, 0,
0xb, 0, 0x1f, 0, 0x1, 0, 0x9, 0, 0, 0,
0x41, 0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa,
0, 0x5, 0, 0x4f, 0xab, 0x82, 0x3d, 0xda, 0x62, 0xcf,
0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33, 0xe,
0, 0x12, 0, 0x12, 0, 0x12, 0, 0xf, 0, 0xb,
0, 0x1f, 0, 0x1, 0, 0xc, 0, 0, 0, 0x41,
0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65,
0x74, 0xa, 0, 0x5, 0, 0x50, 0xab, 0x82, 0x3d, 0xda,
0x62, 0xcf, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4,
0x33, 0xe, 0, 0x1, 0, 0x9, 0, 0, 0, 0x41,
0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xf, 0,
0xb, 0, 0x1f, 0, 0x1, 0, 0xa, 0, 0, 0,
0x49, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x44, 0x61, 0x74, 0x61,
0xa, 0, 0x5, 0, 0xa0, 0xee, 0x23, 0x3a, 0xb1, 0x94,
0xd0, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33,
0xe, 0, 0x1, 0, 0x6, 0, 0, 0, 0x42, 0x49,
0x4e, 0x41, 0x52, 0x59, 0xf, 0, 0xb, 0, 0x1f, 0,
0x1, 0, 0x3, 0, 0, 0, 0x55, 0x72, 0x6c, 0xa,
0, 0x5, 0, 0xa1, 0xee, 0x23, 0x3a, 0xb1, 0x94, 0xd0,
0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33, 0x29,
0, 0x1, 0, 0x5, 0, 0, 0, 0x6e, 0x55, 0x72,
0x6c, 0x73, 0x14, 0, 0x34, 0, 0x31, 0, 0x1, 0,
0x4, 0, 0, 0, 0x75, 0x72, 0x6c, 0x73, 0xe, 0,
0x1, 0, 0x5, 0, 0, 0, 0x6e, 0x55, 0x72, 0x6c,
0x73, 0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1,
0, 0xf, 0, 0, 0, 0x50, 0x72, 0x6f, 0x67, 0x72,
0x65, 0x73, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x65, 0x73, 0x68,
0xa, 0, 0x5, 0, 0x60, 0xc3, 0x63, 0x8a, 0x7d, 0x99,
0xd0, 0x11, 0x94, 0x1c, 0, 0x80, 0xc8, 0xc, 0xfa, 0x7b,
0xe, 0, 0x1, 0, 0x3, 0, 0, 0, 0x55, 0x72,
0x6c, 0x13, 0, 0x1, 0, 0xa, 0, 0, 0, 0x49,
0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x44, 0x61, 0x74, 0x61, 0xf,
0, 0xb, 0, 0x1f, 0, 0x1, 0, 0x4, 0, 0,
0, 0x47, 0x75, 0x69, 0x64, 0xa, 0, 0x5, 0, 0xe0,
0x90, 0x27, 0xa4, 0x10, 0x78, 0xcf, 0x11, 0x8f, 0x52, 0,
0x40, 0x33, 0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0x5,
0, 0, 0, 0x64, 0x61, 0x74, 0x61, 0x31, 0x14, 0,
0x28, 0, 0x1, 0, 0x5, 0, 0, 0, 0x64, 0x61,
0x74, 0x61, 0x32, 0x14, 0, 0x28, 0, 0x1, 0, 0x5,
0, 0, 0, 0x64, 0x61, 0x74, 0x61, 0x33, 0x14, 0,
0x34, 0, 0x2d, 0, 0x1, 0, 0x5, 0, 0, 0,
0x64, 0x61, 0x74, 0x61, 0x34, 0xe, 0, 0x3, 0, 0x8,
0, 0, 0, 0xf, 0, 0x14, 0, 0xb, 0, 0x1f,
0, 0x1, 0, 0xe, 0, 0, 0, 0x53, 0x74, 0x72,
0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74,
0x79, 0xa, 0, 0x5, 0, 0xe0, 0x21, 0xf, 0x7f, 0xe1,
0xbf, 0xd1, 0x11, 0x82, 0xc0, 0, 0xa0, 0xc9, 0x69, 0x72,
0x71, 0x31, 0, 0x1, 0, 0x3, 0, 0, 0, 0x6b,
0x65, 0x79, 0x14, 0, 0x31, 0, 0x1, 0, 0x5, 0,
0, 0, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x14, 0, 0xb,
0, 0x1f, 0, 0x1, 0, 0xb, 0, 0, 0, 0x50,
0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x42, 0x61, 0x67,
0xa, 0, 0x5, 0, 0xe1, 0x21, 0xf, 0x7f, 0xe1, 0xbf,
0xd1, 0x11, 0x82, 0xc0, 0, 0xa0, 0xc9, 0x69, 0x72, 0x71,
0xe, 0, 0x1, 0, 0xe, 0, 0, 0, 0x53, 0x74,
0x72, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72,
0x74, 0x79, 0xf, 0, 0xb, 0, 0x1f, 0, 0x1, 0,
0xe, 0, 0, 0, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e,
0x61, 0x6c, 0x56, 0x69, 0x73, 0x75, 0x61, 0x6c, 0xa, 0,
0x5, 0, 0xa0, 0x6a, 0x11, 0x98, 0xba, 0xbd, 0xd1, 0x11,
0x82, 0xc0, 0, 0xa0, 0xc9, 0x69, 0x72, 0x71, 0x1, 0,
0x4, 0, 0, 0, 0x47, 0x75, 0x69, 0x64, 0x1, 0,
0x12, 0, 0, 0, 0x67, 0x75, 0x69, 0x64, 0x45, 0x78,
0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x69, 0x73, 0x75,
0x61, 0x6c, 0x14, 0, 0xe, 0, 0x12, 0, 0x12, 0,
0x12, 0, 0xf, 0, 0xb, 0, 0x1f, 0, 0x1, 0,
0xb, 0, 0, 0, 0x52, 0x69, 0x67, 0x68, 0x74, 0x48,
0x61, 0x6e, 0x64, 0x65, 0x64, 0xa, 0, 0x5, 0, 0xa0,
0x5e, 0x5d, 0x7f, 0x3a, 0xd5, 0xd1, 0x11, 0x82, 0xc0, 0,
0xa0, 0xc9, 0x69, 0x72, 0x71, 0x29, 0, 0x1, 0, 0xc,
0, 0, 0, 0x62, 0x52, 0x69, 0x67, 0x68, 0x74, 0x48,
0x61, 0x6e, 0x64, 0x65, 0x64, 0x14, 0, 0xb, 0
};
#define D3DRM_XTEMPLATE_BYTES 3278
#endif /* _RMXFTMPL_H_ */

View File

@ -0,0 +1,386 @@
/****************************************************************\
* *
* rpcsal.h - markers for documenting the semantics of RPC APIs *
* *
* Version 1.0 *
* *
* Copyright (c) 2004 Microsoft Corporation. All rights reserved. *
* *
\****************************************************************/
// -------------------------------------------------------------------------------
// Introduction
//
// rpcsal.h provides a set of annotations to describe how RPC functions use their
// parameters - the assumptions it makes about them, adn the guarantees it makes
// upon finishing. These annotations are similar to those found in specstrings.h,
// but are designed to be used by the MIDL compiler when it generates annotations
// enabled header files.
//
// IDL authors do not need to annotate their functions declarations. The MIDL compiler
// will interpret the IDL directives and use one of the annotations contained
// in this header. This documentation is intended to help those trying to understand
// the MIDL-generated header files or those who maintain their own copies of these files.
//
// -------------------------------------------------------------------------------
// Differences between rpcsal.h and specstrings.h
//
// There are a few important differences between the annotations found in rpcsal.h and
// those in specstrings.h:
//
// 1. [in] parameters are not marked as read-only. They may be used for scratch space
// at the server and changes will not affect the client.
// 2. String versions of each macro alleviates the need for a special type definition
//
// -------------------------------------------------------------------------------
// Interpreting RPC Annotations
//
// These annotations are interpreted precisely in the same way as those in specstrings.h.
// Please refer to that header for information related to general usage in annotations.
//
// To construct an RPC annotation, concatenate the appropriate value from each category
// along with a leading __RPC_. A typical annotation looks like "__RPC__in_string".
//
// |----------------------------------------------------------------------------------|
// | RPC Annotations |
// |------------|------------|---------|--------|----------|----------|---------------|
// | Level | Usage | Size | Output | Optional | String | Parameters |
// |------------|------------|---------|--------|----------|----------|---------------|
// | <> | <> | <> | <> | <> | <> | <> |
// | _deref | _in | _ecount | _full | _opt | _string | (size) |
// | _deref_opt | _out | _bcount | _part | | | (size,length) |
// | | _inout | | | | | |
// | | | | | | | |
// |------------|------------|---------|--------|----------|----------|---------------|
//
// Level: Describes the buffer pointer's level of indirection from the parameter or
// return value 'p'.
//
// <> : p is the buffer pointer.
// _deref : *p is the buffer pointer. p must not be NULL.
// _deref_opt : *p may be the buffer pointer. p may be NULL, in which case the rest of
// the annotation is ignored.
//
// Usage: Describes how the function uses the buffer.
//
// <> : The buffer is not accessed. If used on the return value or with _deref, the
// function will provide the buffer, and it will be uninitialized at exit.
// Otherwise, the caller must provide the buffer. This should only be used
// for alloc and free functions.
// _in : The function will only read from the buffer. The caller must provide the
// buffer and initialize it. Cannot be used with _deref.
// _out : The function will only write to the buffer. If used on the return value or
// with _deref, the function will provide the buffer and initialize it.
// Otherwise, the caller must provide the buffer, and the function will
// initialize it.
// _inout : The function may freely read from and write to the buffer. The caller must
// provide the buffer and initialize it. If used with _deref, the buffer may
// be reallocated by the function.
//
// Size: Describes the total size of the buffer. This may be less than the space actually
// allocated for the buffer, in which case it describes the accessible amount.
//
// <> : No buffer size is given. If the type specifies the buffer size (such as
// with LPSTR and LPWSTR), that amount is used. Otherwise, the buffer is one
// element long. Must be used with _in, _out, or _inout.
// _ecount : The buffer size is an explicit element count.
// _bcount : The buffer size is an explicit byte count.
//
// Output: Describes how much of the buffer will be initialized by the function. For
// _inout buffers, this also describes how much is initialized at entry. Omit this
// category for _in buffers; they must be fully initialized by the caller.
//
// <> : The type specifies how much is initialized. For instance, a function initializing
// an LPWSTR must NULL-terminate the string.
// _full : The function initializes the entire buffer.
// _part : The function initializes part of the buffer, and explicitly indicates how much.
//
// Optional: Describes if the buffer itself is optional.
//
// <> : The pointer to the buffer must not be NULL.
// _opt : The pointer to the buffer might be NULL. It will be checked before being dereferenced.
//
// String: Describes if the buffer is NULL terminated
//
// <> : The buffer is not assumed to be NULL terminated
// _string : The buffer is assumed to be NULL terminated once it has been initialized
//
// Parameters: Gives explicit counts for the size and length of the buffer.
//
// <> : There is no explicit count. Use when neither _ecount nor _bcount is used.
// (size) : Only the buffer's total size is given. Use with _ecount or _bcount but not _part.
// (size,length) : The buffer's total size and initialized length are given. Use with _ecount_part
// and _bcount_part.
//
// Notes:
//
// 1. Specifying two buffer annotations on a single parameter results in unspecified behavior
// (e.g. __RPC__in_bcount(5) __RPC__out_bcount(6)
//
// 2. The size of the buffer and the amount that has been initialized are separate concepts.
// Specify the size using _ecount or _bcount. Specify the amount that is initialized using
// _full, _part, or _string. As a special case, a single element buffer does not need
// _ecount, _bcount, _full, or _part
//
// 3. The count may be less than the total size of the buffer in which case it describes the
// accessible portion.
//
// 4. "__RPC__opt" and "__RPC_deref" are not valid annotations.
//
// 5. The placement of _opt when using _deref is important:
// __RPC__deref_opt_... : Input may be NULL
// __RPC__deref_..._opt : Output may be NULL
// __RPC__deref_opt_..._opt : Both input and output may be NULL
//
#pragma once
#include <specstrings.h>
#ifndef __RPCSAL_H_VERSION__
#define __RPCSAL_H_VERSION__ ( 100 )
#endif // __RPCSAL_H_VERSION__
#ifdef __REQUIRED_RPCSAL_H_VERSION__
#if ( __RPCSAL_H_VERSION__ < __REQUIRED_RPCSAL_H_VERSION__ )
#error incorrect <rpcsal.h> version. Use the header that matches with the MIDL compiler.
#endif
#endif
#ifdef __cplusplus
extern "C" {
#endif // #ifdef __cplusplus
#if (_MSC_VER >= 1000) && !defined(__midl) && defined(_PREFAST_)
// [in]
#define __RPC__in __pre __valid
#define __RPC__in_string __RPC__in __pre __nullterminated
#define __RPC__in_ecount(size) __RPC__in __pre __elem_readableTo(size)
#define __RPC__in_ecount_full(size) __RPC__in_ecount(size)
#define __RPC__in_ecount_full_string(size) __RPC__in_ecount_full(size) __pre __nullterminated
#define __RPC__in_ecount_part(size, length) __RPC__in_ecount(length) __pre __elem_writableTo(size)
#define __RPC__in_ecount_full_opt(size) __RPC__in_ecount_full(size) __pre __exceptthat __maybenull
#define __RPC__in_ecount_full_opt_string(size) __RPC__in_ecount_full_opt(size) __pre __nullterminated
#define __RPC__in_ecount_part_opt(size, length) __RPC__in_ecount_part(size, length) __pre __exceptthat __maybenull
#define __RPC__deref_in __RPC__in __deref __notnull
#define __RPC__deref_in_string __RPC__in __pre __deref __nullterminated
#define __RPC__deref_in_opt __RPC__deref_in __deref __exceptthat __maybenull
#define __RPC__deref_opt_in __RPC__in __exceptthat __maybenull
#define __RPC__deref_opt_in_opt __RPC__deref_opt_in __pre __deref __exceptthat __maybenull
#define __RPC__deref_in_ecount(size) __RPC__in __pre __deref __elem_readableTo(size)
#define __RPC__deref_in_ecount_part(size, length) __RPC__deref_in_ecount(size) __pre __deref __elem_readableTo(length)
#define __RPC__deref_in_ecount_full(size) __RPC__deref_in_ecount_part(size, size)
#define __RPC__deref_in_ecount_full_opt(size) __RPC__deref_in_ecount_full(size) __pre __deref __exceptthat __maybenull
#define __RPC__deref_in_ecount_full_opt_string(size) __RPC__deref_in_ecount_full_opt(size) __pre __deref __nullterminated
#define __RPC__deref_in_ecount_full_string(size) __RPC__deref_in_ecount_full(size) __pre __deref __nullterminated
#define __RPC__deref_in_ecount_opt(size) __RPC__deref_in_ecount(size) __pre __deref __exceptthat __maybenull
#define __RPC__deref_in_ecount_opt_string(size) __RPC__deref_in_ecount_opt(size) __pre __deref __nullterminated
#define __RPC__deref_in_ecount_part_opt(size, length) __RPC__deref_in_ecount_opt(size) __pre __deref __elem_readableTo(length)
// [out]
#define __RPC__out __out
#define __RPC__out_ecount(size) __out_ecount(size) __post __elem_writableTo(size)
#define __RPC__out_ecount_string(size) __RPC__out_ecount(size) __post __nullterminated
#define __RPC__out_ecount_part(size, length) __RPC__out_ecount(size) __post __elem_readableTo(length)
#define __RPC__out_ecount_full(size) __RPC__out_ecount_part(size, size)
#define __RPC__out_ecount_full_string(size) __RPC__out_ecount_full(size) __post __nullterminated
// [in,out]
#define __RPC__inout __inout
#define __RPC__inout_string __RPC__inout __pre __nullterminated __post __nullterminated
#define __RPC__inout_ecount(size) __inout_ecount(size)
#define __RPC__inout_ecount_part(size, length) __inout_ecount_part(size, length)
#define __RPC__inout_ecount_full(size) __RPC__inout_ecount_part(size, size)
#define __RPC__inout_ecount_full_string(size) __RPC__inout_ecount_full(size) __pre __nullterminated __post __nullterminated
// [in,unique]
#define __RPC__in_opt __RPC__in __pre __exceptthat __maybenull
#define __RPC__in_opt_string __RPC__in_opt __pre __nullterminated
#define __RPC__in_ecount_opt(size) __RPC__in_ecount(size) __pre __exceptthat __maybenull
#define __RPC__in_ecount_opt_string(size) __RPC__in_ecount_opt(size) __pre __nullterminated
// [in,out,unique]
#define __RPC__inout_opt __inout_opt
#define __RPC__inout_ecount_opt(size) __inout_ecount_opt(size)
#define __RPC__inout_ecount_part_opt(size, length) __inout_ecount_part_opt(size, length)
#define __RPC__inout_ecount_full_opt(size) __RPC__inout_ecount_part_opt(size, size)
#define __RPC__inout_ecount_full_opt_string(size) __RPC__inout_ecount_full_opt(size) __pre __nullterminated __post __nullterminated
// [out] **
#define __RPC__deref_out __deref_out
#define __RPC__deref_out_string __RPC__deref_out __post __deref __nullterminated
// Removed "__post __deref __exceptthat __maybenull" so return values from QueryInterface and the like can be trusted without an explicit NULL check.
// This is a temporary fix until midl.exe can be rev'd to produce more accurate annotations.
#define __RPC__deref_out_opt __RPC__deref_out
#define __RPC__deref_out_opt_string __RPC__deref_out_opt __post __deref __nullterminated __pre __deref __null
#define __RPC__deref_out_ecount(size) __deref_out_ecount(size) __post __deref __elem_writableTo(size)
#define __RPC__deref_out_ecount_part(size, length) __RPC__deref_out_ecount(size) __post __deref __elem_readableTo(length)
#define __RPC__deref_out_ecount_full(size) __RPC__deref_out_ecount_part(size,size)
#define __RPC__deref_out_ecount_full_string(size) __RPC__deref_out_ecount_full(size) __post __deref __nullterminated
// [in,out] **, second pointer decoration.
#define __RPC__deref_inout __deref_inout
#define __RPC__deref_inout_string __RPC__deref_inout __pre __deref __nullterminated __post __deref __nullterminated
#define __RPC__deref_inout_opt __deref_inout_opt
#define __RPC__deref_inout_opt_string __RPC__deref_inout_opt __deref __nullterminated
#define __RPC__deref_inout_ecount_opt(size) __deref_inout_ecount_opt(size)
#define __RPC__deref_inout_ecount_part_opt(size, length) __deref_inout_ecount_part_opt(size , length)
#define __RPC__deref_inout_ecount_full_opt(size) __RPC__deref_inout_ecount_part_opt(size, size)
#define __RPC__deref_inout_ecount_full(size) __deref_inout_ecount_full(size)
#define __RPC__deref_inout_ecount_full_string(size) __RPC__deref_inout_ecount_full(size) __post __deref __nullterminated
#define __RPC__deref_inout_ecount_full_opt_string(size) __RPC__deref_inout_ecount_full_opt(size) __pre __deref __nullterminated __post __deref __nullterminated
// #define __RPC_out_opt out_opt is not allowed in rpc
// [in,out,unique]
#define __RPC__deref_opt_inout __deref_opt_inout
#define __RPC__deref_opt_inout_ecount(size) __deref_opt_inout_ecount(size)
#define __RPC__deref_opt_inout_string __RPC__deref_opt_inout __pre __deref __nullterminated __post __deref __nullterminated
#define __RPC__deref_opt_inout_ecount_part(size, length) __deref_opt_inout_ecount_part(size, length)
#define __RPC__deref_opt_inout_ecount_full(size) __deref_opt_inout_ecount_full(size)
#define __RPC__deref_opt_inout_ecount_full_string(size) __RPC__deref_opt_inout_ecount_full(size) __pre __deref __nullterminated __post __deref __nullterminated
// We don't need to specify __pre __deref __exceptthat __maybenull : this is default behavior. While this might not hold in SAL 1.1 syntax, SAL team
// believes it's OK. We can revisit if SAL 1.1 can survive.
#define __RPC__deref_out_ecount_opt(size) __RPC__out_ecount(size) __post __deref __exceptthat __maybenull __pre __deref __null
#define __RPC__deref_out_ecount_part_opt(size, length) __RPC__deref_out_ecount_part(size, length) __post __deref __exceptthat __maybenull __pre __deref __null
#define __RPC__deref_out_ecount_full_opt(size) __RPC__deref_out_ecount_part_opt(size, size) __pre __deref __null
#define __RPC__deref_out_ecount_full_opt_string(size) __RPC__deref_out_ecount_part_opt(size, size) __post __deref __nullterminated __pre __deref __null
#define __RPC__deref_opt_inout_opt __deref_opt_inout_opt
#define __RPC__deref_opt_inout_opt_string __RPC__deref_opt_inout_opt __pre __deref __nullterminated __post __deref __nullterminated
#define __RPC__deref_opt_inout_ecount_opt(size) __deref_opt_inout_ecount_opt(size)
#define __RPC__deref_opt_inout_ecount_part_opt(size, length) __deref_opt_inout_ecount_part_opt(size, length)
#define __RPC__deref_opt_inout_ecount_full_opt(size) __RPC__deref_opt_inout_ecount_part_opt(size, size)
#define __RPC__deref_opt_inout_ecount_full_opt_string(size) __RPC__deref_opt_inout_ecount_full_opt(size) __pre __deref __nullterminated __post __deref __nullterminated
#define __RPC_full_pointer __maybenull
#define __RPC_unique_pointer __maybenull
#define __RPC_ref_pointer __notnull
#define __RPC_string __nullterminated
#else // not prefast
#define RPC_range(min,max)
#define __RPC__in
#define __RPC__in_string
#define __RPC__in_opt_string
#define __RPC__deref_opt_in_opt
#define __RPC__opt_in_opt_string
#define __RPC__in_ecount(size)
#define __RPC__in_ecount_full(size)
#define __RPC__in_ecount_full_string(size)
#define __RPC__in_ecount_part(size, length)
#define __RPC__in_ecount_full_opt(size)
#define __RPC__in_ecount_full_opt_string(size)
#define __RPC__inout_ecount_full_opt_string(size)
#define __RPC__in_ecount_part_opt(size, length)
#define __RPC__deref_in
#define __RPC__deref_in_string
#define __RPC__deref_opt_in
#define __RPC__deref_in_opt
#define __RPC__deref_in_ecount(size)
#define __RPC__deref_in_ecount_part(size, length)
#define __RPC__deref_in_ecount_full(size)
#define __RPC__deref_in_ecount_full_opt(size)
#define __RPC__deref_in_ecount_full_string(size)
#define __RPC__deref_in_ecount_full_opt_string(size)
#define __RPC__deref_in_ecount_opt(size)
#define __RPC__deref_in_ecount_opt_string(size)
#define __RPC__deref_in_ecount_part_opt(size, length)
// [out]
#define __RPC__out
#define __RPC__out_ecount(size)
#define __RPC__out_ecount_part(size, length)
#define __RPC__out_ecount_full(size)
#define __RPC__out_ecount_full_string(size)
// [in,out]
#define __RPC__inout
#define __RPC__inout_string
#define __RPC__opt_inout
#define __RPC__inout_ecount(size)
#define __RPC__inout_ecount_part(size, length)
#define __RPC__inout_ecount_full(size)
#define __RPC__inout_ecount_full_string(size)
// [in,unique]
#define __RPC__in_opt
#define __RPC__in_ecount_opt(size)
// [in,out,unique]
#define __RPC__inout_opt
#define __RPC__inout_ecount_opt(size)
#define __RPC__inout_ecount_part_opt(size, length)
#define __RPC__inout_ecount_full_opt(size)
#define __RPC__inout_ecount_full_string(size)
// [out] **
#define __RPC__deref_out
#define __RPC__deref_out_string
#define __RPC__deref_out_opt
#define __RPC__deref_out_opt_string
#define __RPC__deref_out_ecount(size)
#define __RPC__deref_out_ecount_part(size, length)
#define __RPC__deref_out_ecount_full(size)
#define __RPC__deref_out_ecount_full_string(size)
// [in,out] **, second pointer decoration.
#define __RPC__deref_inout
#define __RPC__deref_inout_string
#define __RPC__deref_inout_opt
#define __RPC__deref_inout_opt_string
#define __RPC__deref_inout_ecount_full(size)
#define __RPC__deref_inout_ecount_full_string(size)
#define __RPC__deref_inout_ecount_opt(size)
#define __RPC__deref_inout_ecount_part_opt(size, length)
#define __RPC__deref_inout_ecount_full_opt(size)
#define __RPC__deref_inout_ecount_full_opt_string(size)
// #define __RPC_out_opt out_opt is not allowed in rpc
// [in,out,unique]
#define __RPC__deref_opt_inout
#define __RPC__deref_opt_inout_string
#define __RPC__deref_opt_inout_ecount(size)
#define __RPC__deref_opt_inout_ecount_part(size, length)
#define __RPC__deref_opt_inout_ecount_full(size)
#define __RPC__deref_opt_inout_ecount_full_string(size)
#define __RPC__deref_out_ecount_opt(size)
#define __RPC__deref_out_ecount_part_opt(size, length)
#define __RPC__deref_out_ecount_full_opt(size)
#define __RPC__deref_out_ecount_full_opt_string(size)
#define __RPC__deref_opt_inout_opt
#define __RPC__deref_opt_inout_opt_string
#define __RPC__deref_opt_inout_ecount_opt(size)
#define __RPC__deref_opt_inout_ecount_part_opt(size, length)
#define __RPC__deref_opt_inout_ecount_full_opt(size)
#define __RPC__deref_opt_inout_ecount_full_opt_string(size)
#define __RPC_full_pointer
#define __RPC_unique_pointer
#define __RPC_ref_pointer
#define __RPC_string
#endif
#ifdef __cplusplus
}
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,398 @@
/***************************************************************************
*
* Copyright (C) Microsoft Corporation. All Rights Reserved.
*
* File: xact2wb.h
* Content: XACT 2 wave bank definitions.
*
****************************************************************************/
#ifndef __XACTWB_H__
#define __XACTWB_H__
#ifdef _XBOX
# include <xauddefs.h>
#else
# include <math.h>
#endif
#include <xact.h>
#pragma warning(push)
#pragma warning(disable:4201)
#pragma warning(disable:4214) // nonstandard extension used : bit field types other than int
#pragma pack(push, 1)
#ifdef _M_PPCBE
#pragma bitfield_order(push, lsb_to_msb)
#endif
#define WAVEBANK_HEADER_SIGNATURE 'DNBW'
#define WAVEBANK_HEADER_VERSION XACT_CONTENT_VERSION // Current tool version
#define WAVEBANK_BANKNAME_LENGTH 64 // Wave bank friendly name length, in characters
#define WAVEBANK_ENTRYNAME_LENGTH 64 // Wave bank entry friendly name length, in characters
#define WAVEBANK_MAX_DATA_SEGMENT_SIZE 0xFFFFFFFF // Maximum wave bank data segment size, in bytes
#define WAVEBANK_MAX_COMPACT_DATA_SEGMENT_SIZE 0x001FFFFF // Maximum compact wave bank data segment size, in bytes
typedef DWORD WAVEBANKOFFSET;
//
// Bank flags
//
#define WAVEBANK_TYPE_BUFFER 0x00000000 // In-memory buffer
#define WAVEBANK_TYPE_STREAMING 0x00000001 // Streaming
#define WAVEBANK_TYPE_MASK 0x00000001
#define WAVEBANK_FLAGS_ENTRYNAMES 0x00010000 // Bank includes entry names
#define WAVEBANK_FLAGS_COMPACT 0x00020000 // Bank uses compact format
#define WAVEBANK_FLAGS_SYNC_DISABLED 0x00040000 // Bank is disabled for audition sync
#define WAVEBANK_FLAGS_MASK 0x00070000
//
// Entry flags
//
#define WAVEBANKENTRY_FLAGS_READAHEAD 0x00000001 // Enable stream read-ahead
#define WAVEBANKENTRY_FLAGS_LOOPCACHE 0x00000002 // One or more looping sounds use this wave
#define WAVEBANKENTRY_FLAGS_REMOVELOOPTAIL 0x00000004 // Remove data after the end of the loop region
#define WAVEBANKENTRY_FLAGS_IGNORELOOP 0x00000008 // Used internally when the loop region can't be used
#define WAVEBANKENTRY_FLAGS_MASK 0x00000008
//
// Entry wave format identifiers
//
#define WAVEBANKMINIFORMAT_TAG_PCM 0x0 // PCM data
#define WAVEBANKMINIFORMAT_TAG_XMA 0x1 // XMA data
#define WAVEBANKMINIFORMAT_TAG_ADPCM 0x2 // ADPCM data
#define WAVEBANKMINIFORMAT_BITDEPTH_8 0x0 // 8-bit data (PCM only)
#define WAVEBANKMINIFORMAT_BITDEPTH_16 0x1 // 16-bit data (PCM only)
//
// Arbitrary fixed sizes
//
#define WAVEBANKENTRY_XMASTREAMS_MAX 3 // enough for 5.1 channel audio
#define WAVEBANKENTRY_XMACHANNELS_MAX 6 // enough for 5.1 channel audio (cf. XAUDIOCHANNEL_SOURCEMAX)
//
// DVD data sizes
//
#define WAVEBANK_DVD_SECTOR_SIZE 2048
#define WAVEBANK_DVD_BLOCK_SIZE (WAVEBANK_DVD_SECTOR_SIZE * 16)
//
// Bank alignment presets
//
#define WAVEBANK_ALIGNMENT_MIN 4 // Minimum alignment
#define WAVEBANK_ALIGNMENT_DVD WAVEBANK_DVD_SECTOR_SIZE // DVD-optimized alignment
//
// Wave bank segment identifiers
//
typedef enum WAVEBANKSEGIDX
{
WAVEBANK_SEGIDX_BANKDATA = 0, // Bank data
WAVEBANK_SEGIDX_ENTRYMETADATA, // Entry meta-data
WAVEBANK_SEGIDX_ENTRYNAMES, // Entry friendly names
WAVEBANK_SEGIDX_EXTRA, // Storage for extra metadata defined by the wave entry
WAVEBANK_SEGIDX_ENTRYWAVEDATA, // Entry wave data
WAVEBANK_SEGIDX_COUNT
} WAVEBANKSEGIDX, *LPWAVEBANKSEGIDX;
typedef const WAVEBANKSEGIDX *LPCWAVEBANKSEGIDX;
//
// Endianness
//
#ifdef __cplusplus
namespace XACTWaveBank
{
__inline void SwapBytes(DWORD &dw)
{
#ifdef _X86_
__asm
{
mov edi, dw
mov eax, [edi]
bswap eax
mov [edi], eax
}
#else // _X86_
dw = _byteswap_ulong(dw);
#endif // _X86_
}
__inline void SwapBytes(WORD &w)
{
#ifdef _X86_
__asm
{
mov edi, w
mov ax, [edi]
xchg ah, al
mov [edi], ax
}
#else // _X86_
w = _byteswap_ushort(w);
#endif // _X86_
}
}
#endif // __cplusplus
//
// Wave bank region
//
typedef struct WAVEBANKREGION
{
DWORD dwOffset; // Region offset, in bytes
DWORD dwLength; // Region length, in bytes
#ifdef __cplusplus
void SwapBytes(void)
{
XACTWaveBank::SwapBytes(dwOffset);
XACTWaveBank::SwapBytes(dwLength);
}
#endif // __cplusplus
} WAVEBANKREGION, *LPWAVEBANKREGION;
typedef const WAVEBANKREGION *LPCWAVEBANKREGION;
//
// Wave bank file header
//
typedef struct WAVEBANKHEADER
{
DWORD dwSignature; // File signature
DWORD dwVersion; // Version of the tool that created the file
WAVEBANKREGION Segments[WAVEBANK_SEGIDX_COUNT]; // Segment lookup table
#ifdef __cplusplus
void SwapBytes(void)
{
XACTWaveBank::SwapBytes(dwSignature);
XACTWaveBank::SwapBytes(dwVersion);
for(int i = 0; i < WAVEBANK_SEGIDX_COUNT; i++)
{
Segments[i].SwapBytes();
}
}
#endif // __cplusplus
} WAVEBANKHEADER, *LPWAVEBANKHEADER;
typedef const WAVEBANKHEADER *LPCWAVEBANKHEADER;
//
// Entry compressed data format
//
typedef union WAVEBANKMINIWAVEFORMAT
{
struct
{
DWORD wFormatTag : 2; // Format tag
DWORD nChannels : 3; // Channel count (1 - 6)
DWORD nSamplesPerSec : 18; // Sampling rate
DWORD wBlockAlign : 8; // Block alignment
DWORD wBitsPerSample : 1; // Bits per sample (8 vs. 16, PCM only)
};
DWORD dwValue;
#ifdef __cplusplus
void SwapBytes(void)
{
XACTWaveBank::SwapBytes(dwValue);
}
WORD BitsPerSample() const
{
return wBitsPerSample == WAVEBANKMINIFORMAT_BITDEPTH_16 ? 16 : 8;
}
#define ADPCM_MINIWAVEFORMAT_BLOCKALIGN_CONVERSION_OFFSET 22
DWORD BlockAlign() const
{
return wFormatTag != WAVEBANKMINIFORMAT_TAG_ADPCM ? wBlockAlign :
(wBlockAlign + ADPCM_MINIWAVEFORMAT_BLOCKALIGN_CONVERSION_OFFSET) * nChannels;
}
#endif // __cplusplus
} WAVEBANKMINIWAVEFORMAT, *LPWAVEBANKMINIWAVEFORMAT;
typedef const WAVEBANKMINIWAVEFORMAT *LPCWAVEBANKMINIWAVEFORMAT;
//
// Entry meta-data
//
typedef struct WAVEBANKENTRY
{
union
{
struct
{
// Entry flags
DWORD dwFlags : 4;
// Duration of the wave, in units of one sample.
// For instance, a ten second long wave sampled
// at 48KHz would have a duration of 480,000.
// This value is not affected by the number of
// channels, the number of bits per sample, or the
// compression format of the wave.
DWORD Duration : 28;
};
DWORD dwFlagsAndDuration;
};
WAVEBANKMINIWAVEFORMAT Format; // Entry format
WAVEBANKREGION PlayRegion; // Region within the wave data segment that contains this entry
union
{
WAVEBANKREGION LoopRegion; // Region within the wave data that should loop
// XMA loop region
// Note: this is not the same memory layout as the XMA loop region
// passed to the XMA driver--it is more compact. The named values
// map correctly and there are enough bits to store the entire
// range of values that XMA considers valid, with one exception:
// valid values for nSubframeSkip are 1, 2, 3, or 4. In order to
// store this in two bits, XACT subtracts 1 from the value, then adds
struct
{
DWORD dwStartOffset; // loop start offset (in bits)
DWORD nSubframeSkip : 2; // needed by XMA decoder. Valid values for XMA are 1-4; XACT converts to 0-3 for storage. Add 1 to this value before passing to driver.
DWORD nSubframeEnd : 2; // needed by XMA decoder
DWORD dwEndOffset : 28; // loop end offset (in bits)
} XMALoopRegion[ WAVEBANKENTRY_XMASTREAMS_MAX ];
// The last element in the union is an array that aliases the
// entire union so we can byte-reverse the whole thing.
WAVEBANKREGION LoopRegionAlias[ WAVEBANKENTRY_XMASTREAMS_MAX ];
};
#ifdef __cplusplus
void SwapBytes(void)
{
XACTWaveBank::SwapBytes(dwFlagsAndDuration);
Format.SwapBytes();
PlayRegion.SwapBytes();
for( int i = 0; i < WAVEBANKENTRY_XMASTREAMS_MAX; ++i )
{
LoopRegionAlias[i].SwapBytes();
}
}
#endif // __cplusplus
} WAVEBANKENTRY, *LPWAVEBANKENTRY;
typedef const WAVEBANKENTRY *LPCWAVEBANKENTRY;
//
// Compact entry meta-data
//
typedef struct WAVEBANKENTRYCOMPACT
{
DWORD dwOffset : 21; // Data offset, in sectors
DWORD dwLengthDeviation : 11; // Data length deviation, in bytes
#ifdef __cplusplus
void SwapBytes(void)
{
XACTWaveBank::SwapBytes(*(LPDWORD)this);
}
#endif // __cplusplus
} WAVEBANKENTRYCOMPACT, *LPWAVEBANKENTRYCOMPACT;
typedef const WAVEBANKENTRYCOMPACT *LPCWAVEBANKENTRYCOMPACT;
//
// Bank data segment
//
typedef struct WAVEBANKDATA
{
DWORD dwFlags; // Bank flags
DWORD dwEntryCount; // Number of entries in the bank
CHAR szBankName[WAVEBANK_BANKNAME_LENGTH]; // Bank friendly name
DWORD dwEntryMetaDataElementSize; // Size of each entry meta-data element, in bytes
DWORD dwEntryNameElementSize; // Size of each entry name element, in bytes
DWORD dwAlignment; // Entry alignment, in bytes
WAVEBANKMINIWAVEFORMAT CompactFormat; // Format data for compact bank
FILETIME BuildTime; // Build timestamp
#ifdef __cplusplus
void SwapBytes(void)
{
XACTWaveBank::SwapBytes(dwFlags);
XACTWaveBank::SwapBytes(dwEntryCount);
XACTWaveBank::SwapBytes(dwEntryMetaDataElementSize);
XACTWaveBank::SwapBytes(dwEntryNameElementSize);
XACTWaveBank::SwapBytes(dwAlignment);
CompactFormat.SwapBytes();
XACTWaveBank::SwapBytes(BuildTime.dwLowDateTime);
XACTWaveBank::SwapBytes(BuildTime.dwHighDateTime);
}
#endif // __cplusplus
} WAVEBANKDATA, *LPWAVEBANKDATA;
typedef const WAVEBANKDATA *LPCWAVEBANKDATA;
#ifdef _M_PPCBE
#pragma bitfield_order(pop)
#endif
#pragma warning(pop)
#pragma pack(pop)
#endif // __XACTWB_H__

View File

@ -0,0 +1,210 @@
/*-========================================================================-_
| - XACT3D - |
| Copyright (c) Microsoft Corporation. All rights reserved. |
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
|VERSION: 0.1 MODEL: Unmanaged User-mode |
|CONTRACT: N / A EXCEPT: No Exceptions |
|PARENT: N / A MINREQ: Win2000, Xbox360 |
|PROJECT: XACT3D DIALECT: MS Visual C++ 7.0 |
|>------------------------------------------------------------------------<|
| DUTY: XACT 3D support |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
NOTES:
1. See X3DAudio.h for information regarding X3DAudio types. */
#ifndef __XACT3D_H__
#define __XACT3D_H__
//--------------<D-E-F-I-N-I-T-I-O-N-S>-------------------------------------//
#include <x3daudio.h>
#include <xact.h>
// Supported speaker positions, represented as azimuth angles.
//
// Here's a picture of the azimuth angles for the 8 cardinal points,
// seen from above. The emitter's base position is at the origin 0.
//
// FRONT
// | 0 <-- azimuth
// |
// 7pi/4 \ | / pi/4
// \ | /
// LEFT \|/ RIGHT
// 3pi/2-------0-------pi/2
// /|\
// / | \
// 5pi/4 / | \ 3pi/4
// |
// | pi
// BACK
//
#define LEFT_AZIMUTH (3*X3DAUDIO_PI/2)
#define RIGHT_AZIMUTH (X3DAUDIO_PI/2)
#define FRONT_LEFT_AZIMUTH (7*X3DAUDIO_PI/4)
#define FRONT_RIGHT_AZIMUTH (X3DAUDIO_PI/4)
#define FRONT_CENTER_AZIMUTH 0.0f
#define LOW_FREQUENCY_AZIMUTH X3DAUDIO_2PI
#define BACK_LEFT_AZIMUTH (5*X3DAUDIO_PI/4)
#define BACK_RIGHT_AZIMUTH (3*X3DAUDIO_PI/4)
#define BACK_CENTER_AZIMUTH X3DAUDIO_PI
#define FRONT_LEFT_OF_CENTER_AZIMUTH (15*X3DAUDIO_PI/8)
#define FRONT_RIGHT_OF_CENTER_AZIMUTH (X3DAUDIO_PI/8)
//--------------<D-A-T-A---T-Y-P-E-S>---------------------------------------//
// Supported emitter channel layouts:
static const float aStereoLayout[] =
{
LEFT_AZIMUTH,
RIGHT_AZIMUTH
};
static const float a2Point1Layout[] =
{
LEFT_AZIMUTH,
RIGHT_AZIMUTH,
LOW_FREQUENCY_AZIMUTH
};
static const float aQuadLayout[] =
{
FRONT_LEFT_AZIMUTH,
FRONT_RIGHT_AZIMUTH,
BACK_LEFT_AZIMUTH,
BACK_RIGHT_AZIMUTH
};
static const float a5Point1Layout[] =
{
FRONT_LEFT_AZIMUTH,
FRONT_RIGHT_AZIMUTH,
FRONT_CENTER_AZIMUTH,
LOW_FREQUENCY_AZIMUTH,
BACK_LEFT_AZIMUTH,
BACK_RIGHT_AZIMUTH
};
static const float a7Point1Layout[] =
{
FRONT_LEFT_AZIMUTH,
FRONT_RIGHT_AZIMUTH,
FRONT_CENTER_AZIMUTH,
LOW_FREQUENCY_AZIMUTH,
BACK_LEFT_AZIMUTH,
BACK_RIGHT_AZIMUTH,
LEFT_AZIMUTH,
RIGHT_AZIMUTH
};
//--------------<F-U-N-C-T-I-O-N-S>-----------------------------------------//
////
// DESCRIPTION:
// Initializes the 3D API's:
//
// REMARKS:
// This method only needs to be called once
//
// PARAMETERS:
// SpeakerChannelMask - [in] speaker geometry configuration on the final mix, specifies assignment of channels to speaker positions, defined as per WAVEFORMATEXTENSIBLE.dwChannelMask, must be != 0
// Currently only SPEAKER_STEREO and SPEAKER_5POINT1 is supported by X3DAudio.
// pEngine - [in] pointer to the XACT engine
// X3DInstance - [out] Handle to the X3DAudio instance
//
// RETURN VALUE:
// HResult error code
////
EXTERN_C HRESULT inline XACT3DInitialize (UINT32 SpeakerChannelMask, IXACTEngine* pEngine, X3DAUDIO_HANDLE X3DInstance)
{
XACTVARIABLEINDEX xactSpeedOfSoundID = pEngine->GetGlobalVariableIndex("SpeedOfSound");
XACTVARIABLEVALUE nSpeedOfSound;
HRESULT hr = pEngine->GetGlobalVariable(xactSpeedOfSoundID, &nSpeedOfSound);
if (SUCCEEDED(hr)) {
X3DAudioInitialize(SpeakerChannelMask, nSpeedOfSound, X3DInstance);
}
return hr;
}
////
// DESCRIPTION:
// Calculates DSP settings with respect to 3D parameters:
//
// REMARKS:
// The number of bits set in SpeakerChannelMask should equal the number of
// channels expected on the final mix.
//
// PARAMETERS:
// X3DInstance - [in] X3DAudio instance (returned from XACT3DInitialize)
// pListener - [in] point of 3D audio reception
// pEmitter - [in] 3D audio source
// pDSPSettings - [out] receives calculation results, applied to an XACT cue via XACT3DApply
//
// RETURN VALUE:
// HResult error code
////
EXTERN_C HRESULT inline XACT3DCalculate (X3DAUDIO_HANDLE X3DInstance, const X3DAUDIO_LISTENER* pListener, X3DAUDIO_EMITTER* pEmitter, X3DAUDIO_DSP_SETTINGS* pDSPSettings)
{
HRESULT hr = S_OK;
if (pEmitter->ChannelCount > 1 && pEmitter->pChannelAzimuths == NULL) {
pEmitter->ChannelRadius = 1.0f;
switch (pEmitter->ChannelCount) {
case 2: pEmitter->pChannelAzimuths = (float*)&aStereoLayout[0]; break;
case 3: pEmitter->pChannelAzimuths = (float*)&a2Point1Layout[0]; break;
case 4: pEmitter->pChannelAzimuths = (float*)&aQuadLayout[0]; break;
case 6: pEmitter->pChannelAzimuths = (float*)&a5Point1Layout[0]; break;
case 8: pEmitter->pChannelAzimuths = (float*)&a7Point1Layout[0]; break;
default: hr = E_FAIL; break;
}
}
if(SUCCEEDED(hr))
{
static X3DAUDIO_DISTANCE_CURVE_POINT DefaultCurvePoints[2] = { 0.0f, 1.0f, 1.0f, 1.0f };
static X3DAUDIO_DISTANCE_CURVE DefaultCurve = { (X3DAUDIO_DISTANCE_CURVE_POINT*)&DefaultCurvePoints[0], 2 };
if (pEmitter->pVolumeCurve == NULL) {
pEmitter->pVolumeCurve = &DefaultCurve;
}
if (pEmitter->pLFECurve == NULL) {
pEmitter->pLFECurve = &DefaultCurve;
}
X3DAudioCalculate(X3DInstance, pListener, pEmitter, X3DAUDIO_CALCULATE_MATRIX | X3DAUDIO_CALCULATE_DOPPLER | X3DAUDIO_CALCULATE_EMITTER_ANGLE, pDSPSettings);
}
return hr;
}
////
// DESCRIPTION:
// Applies a 3D calculation returned by XACT3DCalculate to a cue:
//
// PARAMETERS:
// pDSPSettings - [in] calculation results generated by XACT3DCalculate
// pCue - [in] cue to which to apply pDSPSettings
//
// RETURN VALUE:
// HResult error code
////
EXTERN_C HRESULT inline XACT3DApply (X3DAUDIO_DSP_SETTINGS* pDSPSettings, IXACTCue* pCue)
{
HRESULT hr = pCue->SetMatrixCoefficients(pDSPSettings->SrcChannelCount, pDSPSettings->DstChannelCount, pDSPSettings->pMatrixCoefficients);
if (SUCCEEDED(hr)) {
XACTVARIABLEINDEX xactDistanceID = pCue->GetVariableIndex("Distance");
hr = pCue->SetVariable(xactDistanceID, pDSPSettings->EmitterToListenerDistance);
}
if (SUCCEEDED(hr)) {
XACTVARIABLEINDEX xactDopplerID = pCue->GetVariableIndex("DopplerPitchScalar");
hr = pCue->SetVariable(xactDopplerID, pDSPSettings->DopplerFactor);
}
if (SUCCEEDED(hr)) {
XACTVARIABLEINDEX xactOrientationID = pCue->GetVariableIndex("OrientationAngle");
hr = pCue->SetVariable(xactOrientationID, pDSPSettings->EmitterToListenerAngle * (180.0f / X3DAUDIO_PI));
}
return hr;
}
#endif // __XACT3D_H__
//---------------------------------<-EOF->----------------------------------//

View File

@ -0,0 +1,127 @@
/* crypto/aes/aes.h -*- mode:C; c-file-style: "eay" -*- */
/* ====================================================================
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* openssl-core@openssl.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
*/
#ifndef HEADER_AES_H
#define HEADER_AES_H
#include <openssl/opensslconf.h>
#ifdef OPENSSL_NO_AES
#error AES is disabled.
#endif
#define AES_ENCRYPT 1
#define AES_DECRYPT 0
/* Because array size can't be a const in C, the following two are macros.
Both sizes are in bytes. */
#define AES_MAXNR 14
#define AES_BLOCK_SIZE 16
#ifdef __cplusplus
extern "C" {
#endif
/* This should be a hidden type, but EVP requires that the size be known */
struct aes_key_st {
#ifdef AES_LONG
unsigned long rd_key[4 *(AES_MAXNR + 1)];
#else
unsigned int rd_key[4 *(AES_MAXNR + 1)];
#endif
int rounds;
};
typedef struct aes_key_st AES_KEY;
const char *AES_options(void);
int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
AES_KEY *key);
int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
AES_KEY *key);
void AES_encrypt(const unsigned char *in, unsigned char *out,
const AES_KEY *key);
void AES_decrypt(const unsigned char *in, unsigned char *out,
const AES_KEY *key);
void AES_ecb_encrypt(const unsigned char *in, unsigned char *out,
const AES_KEY *key, const int enc);
void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
const unsigned long length, const AES_KEY *key,
unsigned char *ivec, const int enc);
void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,
const unsigned long length, const AES_KEY *key,
unsigned char *ivec, int *num, const int enc);
void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out,
const unsigned long length, const AES_KEY *key,
unsigned char *ivec, int *num, const int enc);
void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out,
const unsigned long length, const AES_KEY *key,
unsigned char *ivec, int *num, const int enc);
void AES_cfbr_encrypt_block(const unsigned char *in,unsigned char *out,
const int nbits,const AES_KEY *key,
unsigned char *ivec,const int enc);
void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out,
const unsigned long length, const AES_KEY *key,
unsigned char *ivec, int *num);
void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out,
const unsigned long length, const AES_KEY *key,
unsigned char ivec[AES_BLOCK_SIZE],
unsigned char ecount_buf[AES_BLOCK_SIZE],
unsigned int *num);
#ifdef __cplusplus
}
#endif
#endif /* !HEADER_AES_H */

View File

@ -0,0 +1,94 @@
#define APPLINK_STDIN 1
#define APPLINK_STDOUT 2
#define APPLINK_STDERR 3
#define APPLINK_FPRINTF 4
#define APPLINK_FGETS 5
#define APPLINK_FREAD 6
#define APPLINK_FWRITE 7
#define APPLINK_FSETMOD 8
#define APPLINK_FEOF 9
#define APPLINK_FCLOSE 10 /* should not be used */
#define APPLINK_FOPEN 11 /* solely for completeness */
#define APPLINK_FSEEK 12
#define APPLINK_FTELL 13
#define APPLINK_FFLUSH 14
#define APPLINK_FERROR 15
#define APPLINK_CLEARERR 16
#define APPLINK_FILENO 17 /* to be used with below */
#define APPLINK_OPEN 18 /* formally can't be used, as flags can vary */
#define APPLINK_READ 19
#define APPLINK_WRITE 20
#define APPLINK_LSEEK 21
#define APPLINK_CLOSE 22
#define APPLINK_MAX 22 /* always same as last macro */
#ifndef APPMACROS_ONLY
#include <stdio.h>
#include <io.h>
#include <fcntl.h>
static void *app_stdin(void) { return stdin; }
static void *app_stdout(void) { return stdout; }
static void *app_stderr(void) { return stderr; }
static int app_feof(FILE *fp) { return feof(fp); }
static int app_ferror(FILE *fp) { return ferror(fp); }
static void app_clearerr(FILE *fp) { clearerr(fp); }
static int app_fileno(FILE *fp) { return _fileno(fp); }
static int app_fsetmod(FILE *fp,char mod)
{ return _setmode (_fileno(fp),mod=='b'?_O_BINARY:_O_TEXT); }
#ifdef __cplusplus
extern "C" {
#endif
__declspec(dllexport)
void **
#if defined(__BORLANDC__)
__stdcall /* __stdcall appears to be the only way to get the name
* decoration right with Borland C. Otherwise it works
* purely incidentally, as we pass no parameters. */
#else
__cdecl
#endif
OPENSSL_Applink(void)
{ static int once=1;
static void *OPENSSL_ApplinkTable[APPLINK_MAX+1]={(void *)APPLINK_MAX};
if (once)
{ OPENSSL_ApplinkTable[APPLINK_STDIN] = app_stdin;
OPENSSL_ApplinkTable[APPLINK_STDOUT] = app_stdout;
OPENSSL_ApplinkTable[APPLINK_STDERR] = app_stderr;
OPENSSL_ApplinkTable[APPLINK_FPRINTF] = fprintf;
OPENSSL_ApplinkTable[APPLINK_FGETS] = fgets;
OPENSSL_ApplinkTable[APPLINK_FREAD] = fread;
OPENSSL_ApplinkTable[APPLINK_FWRITE] = fwrite;
OPENSSL_ApplinkTable[APPLINK_FSETMOD] = app_fsetmod;
OPENSSL_ApplinkTable[APPLINK_FEOF] = app_feof;
OPENSSL_ApplinkTable[APPLINK_FCLOSE] = fclose;
OPENSSL_ApplinkTable[APPLINK_FOPEN] = fopen;
OPENSSL_ApplinkTable[APPLINK_FSEEK] = fseek;
OPENSSL_ApplinkTable[APPLINK_FTELL] = ftell;
OPENSSL_ApplinkTable[APPLINK_FFLUSH] = fflush;
OPENSSL_ApplinkTable[APPLINK_FERROR] = app_ferror;
OPENSSL_ApplinkTable[APPLINK_CLEARERR] = app_clearerr;
OPENSSL_ApplinkTable[APPLINK_FILENO] = app_fileno;
OPENSSL_ApplinkTable[APPLINK_OPEN] = _open;
OPENSSL_ApplinkTable[APPLINK_READ] = _read;
OPENSSL_ApplinkTable[APPLINK_WRITE] = _write;
OPENSSL_ApplinkTable[APPLINK_LSEEK] = _lseek;
OPENSSL_ApplinkTable[APPLINK_CLOSE] = _close;
once = 0;
}
return OPENSSL_ApplinkTable;
}
#ifdef __cplusplus
}
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,571 @@
/* crypto/asn1/asn1_mac.h */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
#ifndef HEADER_ASN1_MAC_H
#define HEADER_ASN1_MAC_H
#include <openssl/asn1.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef ASN1_MAC_ERR_LIB
#define ASN1_MAC_ERR_LIB ERR_LIB_ASN1
#endif
#define ASN1_MAC_H_err(f,r,line) \
ERR_PUT_error(ASN1_MAC_ERR_LIB,(f),(r),__FILE__,(line))
#define M_ASN1_D2I_vars(a,type,func) \
ASN1_const_CTX c; \
type ret=NULL; \
\
c.pp=(const unsigned char **)pp; \
c.q= *(const unsigned char **)pp; \
c.error=ERR_R_NESTED_ASN1_ERROR; \
if ((a == NULL) || ((*a) == NULL)) \
{ if ((ret=(type)func()) == NULL) \
{ c.line=__LINE__; goto err; } } \
else ret=(*a);
#define M_ASN1_D2I_Init() \
c.p= *(const unsigned char **)pp; \
c.max=(length == 0)?0:(c.p+length);
#define M_ASN1_D2I_Finish_2(a) \
if (!asn1_const_Finish(&c)) \
{ c.line=__LINE__; goto err; } \
*(const unsigned char **)pp=c.p; \
if (a != NULL) (*a)=ret; \
return(ret);
#define M_ASN1_D2I_Finish(a,func,e) \
M_ASN1_D2I_Finish_2(a); \
err:\
ASN1_MAC_H_err((e),c.error,c.line); \
asn1_add_error(*(const unsigned char **)pp,(int)(c.q- *pp)); \
if ((ret != NULL) && ((a == NULL) || (*a != ret))) func(ret); \
return(NULL)
#define M_ASN1_D2I_start_sequence() \
if (!asn1_GetSequence(&c,&length)) \
{ c.line=__LINE__; goto err; }
/* Begin reading ASN1 without a surrounding sequence */
#define M_ASN1_D2I_begin() \
c.slen = length;
/* End reading ASN1 with no check on length */
#define M_ASN1_D2I_Finish_nolen(a, func, e) \
*pp=c.p; \
if (a != NULL) (*a)=ret; \
return(ret); \
err:\
ASN1_MAC_H_err((e),c.error,c.line); \
asn1_add_error(*pp,(int)(c.q- *pp)); \
if ((ret != NULL) && ((a == NULL) || (*a != ret))) func(ret); \
return(NULL)
#define M_ASN1_D2I_end_sequence() \
(((c.inf&1) == 0)?(c.slen <= 0): \
(c.eos=ASN1_const_check_infinite_end(&c.p,c.slen)))
/* Don't use this with d2i_ASN1_BOOLEAN() */
#define M_ASN1_D2I_get(b, func) \
c.q=c.p; \
if (func(&(b),&c.p,c.slen) == NULL) \
{c.line=__LINE__; goto err; } \
c.slen-=(c.p-c.q);
/* Don't use this with d2i_ASN1_BOOLEAN() */
#define M_ASN1_D2I_get_x(type,b,func) \
c.q=c.p; \
if (((D2I_OF(type))func)(&(b),&c.p,c.slen) == NULL) \
{c.line=__LINE__; goto err; } \
c.slen-=(c.p-c.q);
/* use this instead () */
#define M_ASN1_D2I_get_int(b,func) \
c.q=c.p; \
if (func(&(b),&c.p,c.slen) < 0) \
{c.line=__LINE__; goto err; } \
c.slen-=(c.p-c.q);
#define M_ASN1_D2I_get_opt(b,func,type) \
if ((c.slen != 0) && ((M_ASN1_next & (~V_ASN1_CONSTRUCTED)) \
== (V_ASN1_UNIVERSAL|(type)))) \
{ \
M_ASN1_D2I_get(b,func); \
}
#define M_ASN1_D2I_get_imp(b,func, type) \
M_ASN1_next=(_tmp& V_ASN1_CONSTRUCTED)|type; \
c.q=c.p; \
if (func(&(b),&c.p,c.slen) == NULL) \
{c.line=__LINE__; M_ASN1_next_prev = _tmp; goto err; } \
c.slen-=(c.p-c.q);\
M_ASN1_next_prev=_tmp;
#define M_ASN1_D2I_get_IMP_opt(b,func,tag,type) \
if ((c.slen != 0) && ((M_ASN1_next & (~V_ASN1_CONSTRUCTED)) == \
(V_ASN1_CONTEXT_SPECIFIC|(tag)))) \
{ \
unsigned char _tmp = M_ASN1_next; \
M_ASN1_D2I_get_imp(b,func, type);\
}
#define M_ASN1_D2I_get_set(r,func,free_func) \
M_ASN1_D2I_get_imp_set(r,func,free_func, \
V_ASN1_SET,V_ASN1_UNIVERSAL);
#define M_ASN1_D2I_get_set_type(type,r,func,free_func) \
M_ASN1_D2I_get_imp_set_type(type,r,func,free_func, \
V_ASN1_SET,V_ASN1_UNIVERSAL);
#define M_ASN1_D2I_get_set_opt(r,func,free_func) \
if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \
V_ASN1_CONSTRUCTED|V_ASN1_SET)))\
{ M_ASN1_D2I_get_set(r,func,free_func); }
#define M_ASN1_D2I_get_set_opt_type(type,r,func,free_func) \
if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \
V_ASN1_CONSTRUCTED|V_ASN1_SET)))\
{ M_ASN1_D2I_get_set_type(type,r,func,free_func); }
#define M_ASN1_I2D_len_SET_opt(a,f) \
if ((a != NULL) && (sk_num(a) != 0)) \
M_ASN1_I2D_len_SET(a,f);
#define M_ASN1_I2D_put_SET_opt(a,f) \
if ((a != NULL) && (sk_num(a) != 0)) \
M_ASN1_I2D_put_SET(a,f);
#define M_ASN1_I2D_put_SEQUENCE_opt(a,f) \
if ((a != NULL) && (sk_num(a) != 0)) \
M_ASN1_I2D_put_SEQUENCE(a,f);
#define M_ASN1_I2D_put_SEQUENCE_opt_type(type,a,f) \
if ((a != NULL) && (sk_##type##_num(a) != 0)) \
M_ASN1_I2D_put_SEQUENCE_type(type,a,f);
#define M_ASN1_D2I_get_IMP_set_opt(b,func,free_func,tag) \
if ((c.slen != 0) && \
(M_ASN1_next == \
(V_ASN1_CONTEXT_SPECIFIC|V_ASN1_CONSTRUCTED|(tag))))\
{ \
M_ASN1_D2I_get_imp_set(b,func,free_func,\
tag,V_ASN1_CONTEXT_SPECIFIC); \
}
#define M_ASN1_D2I_get_IMP_set_opt_type(type,b,func,free_func,tag) \
if ((c.slen != 0) && \
(M_ASN1_next == \
(V_ASN1_CONTEXT_SPECIFIC|V_ASN1_CONSTRUCTED|(tag))))\
{ \
M_ASN1_D2I_get_imp_set_type(type,b,func,free_func,\
tag,V_ASN1_CONTEXT_SPECIFIC); \
}
#define M_ASN1_D2I_get_seq(r,func,free_func) \
M_ASN1_D2I_get_imp_set(r,func,free_func,\
V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL);
#define M_ASN1_D2I_get_seq_type(type,r,func,free_func) \
M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,\
V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL)
#define M_ASN1_D2I_get_seq_opt(r,func,free_func) \
if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \
V_ASN1_CONSTRUCTED|V_ASN1_SEQUENCE)))\
{ M_ASN1_D2I_get_seq(r,func,free_func); }
#define M_ASN1_D2I_get_seq_opt_type(type,r,func,free_func) \
if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \
V_ASN1_CONSTRUCTED|V_ASN1_SEQUENCE)))\
{ M_ASN1_D2I_get_seq_type(type,r,func,free_func); }
#define M_ASN1_D2I_get_IMP_set(r,func,free_func,x) \
M_ASN1_D2I_get_imp_set(r,func,free_func,\
x,V_ASN1_CONTEXT_SPECIFIC);
#define M_ASN1_D2I_get_IMP_set_type(type,r,func,free_func,x) \
M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,\
x,V_ASN1_CONTEXT_SPECIFIC);
#define M_ASN1_D2I_get_imp_set(r,func,free_func,a,b) \
c.q=c.p; \
if (d2i_ASN1_SET(&(r),&c.p,c.slen,(char *(*)())func,\
(void (*)())free_func,a,b) == NULL) \
{ c.line=__LINE__; goto err; } \
c.slen-=(c.p-c.q);
#define M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,a,b) \
c.q=c.p; \
if (d2i_ASN1_SET_OF_##type(&(r),&c.p,c.slen,func,\
free_func,a,b) == NULL) \
{ c.line=__LINE__; goto err; } \
c.slen-=(c.p-c.q);
#define M_ASN1_D2I_get_set_strings(r,func,a,b) \
c.q=c.p; \
if (d2i_ASN1_STRING_SET(&(r),&c.p,c.slen,a,b) == NULL) \
{ c.line=__LINE__; goto err; } \
c.slen-=(c.p-c.q);
#define M_ASN1_D2I_get_EXP_opt(r,func,tag) \
if ((c.slen != 0L) && (M_ASN1_next == \
(V_ASN1_CONSTRUCTED|V_ASN1_CONTEXT_SPECIFIC|tag))) \
{ \
int Tinf,Ttag,Tclass; \
long Tlen; \
\
c.q=c.p; \
Tinf=ASN1_get_object(&c.p,&Tlen,&Ttag,&Tclass,c.slen); \
if (Tinf & 0x80) \
{ c.error=ERR_R_BAD_ASN1_OBJECT_HEADER; \
c.line=__LINE__; goto err; } \
if (Tinf == (V_ASN1_CONSTRUCTED+1)) \
Tlen = c.slen - (c.p - c.q) - 2; \
if (func(&(r),&c.p,Tlen) == NULL) \
{ c.line=__LINE__; goto err; } \
if (Tinf == (V_ASN1_CONSTRUCTED+1)) { \
Tlen = c.slen - (c.p - c.q); \
if(!ASN1_const_check_infinite_end(&c.p, Tlen)) \
{ c.error=ERR_R_MISSING_ASN1_EOS; \
c.line=__LINE__; goto err; } \
}\
c.slen-=(c.p-c.q); \
}
#define M_ASN1_D2I_get_EXP_set_opt(r,func,free_func,tag,b) \
if ((c.slen != 0) && (M_ASN1_next == \
(V_ASN1_CONSTRUCTED|V_ASN1_CONTEXT_SPECIFIC|tag))) \
{ \
int Tinf,Ttag,Tclass; \
long Tlen; \
\
c.q=c.p; \
Tinf=ASN1_get_object(&c.p,&Tlen,&Ttag,&Tclass,c.slen); \
if (Tinf & 0x80) \
{ c.error=ERR_R_BAD_ASN1_OBJECT_HEADER; \
c.line=__LINE__; goto err; } \
if (Tinf == (V_ASN1_CONSTRUCTED+1)) \
Tlen = c.slen - (c.p - c.q) - 2; \
if (d2i_ASN1_SET(&(r),&c.p,Tlen,(char *(*)())func, \
(void (*)())free_func, \
b,V_ASN1_UNIVERSAL) == NULL) \
{ c.line=__LINE__; goto err; } \
if (Tinf == (V_ASN1_CONSTRUCTED+1)) { \
Tlen = c.slen - (c.p - c.q); \
if(!ASN1_check_infinite_end(&c.p, Tlen)) \
{ c.error=ERR_R_MISSING_ASN1_EOS; \
c.line=__LINE__; goto err; } \
}\
c.slen-=(c.p-c.q); \
}
#define M_ASN1_D2I_get_EXP_set_opt_type(type,r,func,free_func,tag,b) \
if ((c.slen != 0) && (M_ASN1_next == \
(V_ASN1_CONSTRUCTED|V_ASN1_CONTEXT_SPECIFIC|tag))) \
{ \
int Tinf,Ttag,Tclass; \
long Tlen; \
\
c.q=c.p; \
Tinf=ASN1_get_object(&c.p,&Tlen,&Ttag,&Tclass,c.slen); \
if (Tinf & 0x80) \
{ c.error=ERR_R_BAD_ASN1_OBJECT_HEADER; \
c.line=__LINE__; goto err; } \
if (Tinf == (V_ASN1_CONSTRUCTED+1)) \
Tlen = c.slen - (c.p - c.q) - 2; \
if (d2i_ASN1_SET_OF_##type(&(r),&c.p,Tlen,func, \
free_func,b,V_ASN1_UNIVERSAL) == NULL) \
{ c.line=__LINE__; goto err; } \
if (Tinf == (V_ASN1_CONSTRUCTED+1)) { \
Tlen = c.slen - (c.p - c.q); \
if(!ASN1_check_infinite_end(&c.p, Tlen)) \
{ c.error=ERR_R_MISSING_ASN1_EOS; \
c.line=__LINE__; goto err; } \
}\
c.slen-=(c.p-c.q); \
}
/* New macros */
#define M_ASN1_New_Malloc(ret,type) \
if ((ret=(type *)OPENSSL_malloc(sizeof(type))) == NULL) \
{ c.line=__LINE__; goto err2; }
#define M_ASN1_New(arg,func) \
if (((arg)=func()) == NULL) return(NULL)
#define M_ASN1_New_Error(a) \
/* err: ASN1_MAC_H_err((a),ERR_R_NESTED_ASN1_ERROR,c.line); \
return(NULL);*/ \
err2: ASN1_MAC_H_err((a),ERR_R_MALLOC_FAILURE,c.line); \
return(NULL)
/* BIG UGLY WARNING! This is so damn ugly I wanna puke. Unfortunately,
some macros that use ASN1_const_CTX still insist on writing in the input
stream. ARGH! ARGH! ARGH! Let's get rid of this macro package.
Please? -- Richard Levitte */
#define M_ASN1_next (*((unsigned char *)(c.p)))
#define M_ASN1_next_prev (*((unsigned char *)(c.q)))
/*************************************************/
#define M_ASN1_I2D_vars(a) int r=0,ret=0; \
unsigned char *p; \
if (a == NULL) return(0)
/* Length Macros */
#define M_ASN1_I2D_len(a,f) ret+=f(a,NULL)
#define M_ASN1_I2D_len_IMP_opt(a,f) if (a != NULL) M_ASN1_I2D_len(a,f)
#define M_ASN1_I2D_len_SET(a,f) \
ret+=i2d_ASN1_SET(a,NULL,f,V_ASN1_SET,V_ASN1_UNIVERSAL,IS_SET);
#define M_ASN1_I2D_len_SET_type(type,a,f) \
ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,V_ASN1_SET, \
V_ASN1_UNIVERSAL,IS_SET);
#define M_ASN1_I2D_len_SEQUENCE(a,f) \
ret+=i2d_ASN1_SET(a,NULL,f,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL, \
IS_SEQUENCE);
#define M_ASN1_I2D_len_SEQUENCE_type(type,a,f) \
ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,V_ASN1_SEQUENCE, \
V_ASN1_UNIVERSAL,IS_SEQUENCE)
#define M_ASN1_I2D_len_SEQUENCE_opt(a,f) \
if ((a != NULL) && (sk_num(a) != 0)) \
M_ASN1_I2D_len_SEQUENCE(a,f);
#define M_ASN1_I2D_len_SEQUENCE_opt_type(type,a,f) \
if ((a != NULL) && (sk_##type##_num(a) != 0)) \
M_ASN1_I2D_len_SEQUENCE_type(type,a,f);
#define M_ASN1_I2D_len_IMP_SET(a,f,x) \
ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC,IS_SET);
#define M_ASN1_I2D_len_IMP_SET_type(type,a,f,x) \
ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \
V_ASN1_CONTEXT_SPECIFIC,IS_SET);
#define M_ASN1_I2D_len_IMP_SET_opt(a,f,x) \
if ((a != NULL) && (sk_num(a) != 0)) \
ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \
IS_SET);
#define M_ASN1_I2D_len_IMP_SET_opt_type(type,a,f,x) \
if ((a != NULL) && (sk_##type##_num(a) != 0)) \
ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \
V_ASN1_CONTEXT_SPECIFIC,IS_SET);
#define M_ASN1_I2D_len_IMP_SEQUENCE(a,f,x) \
ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \
IS_SEQUENCE);
#define M_ASN1_I2D_len_IMP_SEQUENCE_opt(a,f,x) \
if ((a != NULL) && (sk_num(a) != 0)) \
ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \
IS_SEQUENCE);
#define M_ASN1_I2D_len_IMP_SEQUENCE_opt_type(type,a,f,x) \
if ((a != NULL) && (sk_##type##_num(a) != 0)) \
ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \
V_ASN1_CONTEXT_SPECIFIC, \
IS_SEQUENCE);
#define M_ASN1_I2D_len_EXP_opt(a,f,mtag,v) \
if (a != NULL)\
{ \
v=f(a,NULL); \
ret+=ASN1_object_size(1,v,mtag); \
}
#define M_ASN1_I2D_len_EXP_SET_opt(a,f,mtag,tag,v) \
if ((a != NULL) && (sk_num(a) != 0))\
{ \
v=i2d_ASN1_SET(a,NULL,f,tag,V_ASN1_UNIVERSAL,IS_SET); \
ret+=ASN1_object_size(1,v,mtag); \
}
#define M_ASN1_I2D_len_EXP_SEQUENCE_opt(a,f,mtag,tag,v) \
if ((a != NULL) && (sk_num(a) != 0))\
{ \
v=i2d_ASN1_SET(a,NULL,f,tag,V_ASN1_UNIVERSAL, \
IS_SEQUENCE); \
ret+=ASN1_object_size(1,v,mtag); \
}
#define M_ASN1_I2D_len_EXP_SEQUENCE_opt_type(type,a,f,mtag,tag,v) \
if ((a != NULL) && (sk_##type##_num(a) != 0))\
{ \
v=i2d_ASN1_SET_OF_##type(a,NULL,f,tag, \
V_ASN1_UNIVERSAL, \
IS_SEQUENCE); \
ret+=ASN1_object_size(1,v,mtag); \
}
/* Put Macros */
#define M_ASN1_I2D_put(a,f) f(a,&p)
#define M_ASN1_I2D_put_IMP_opt(a,f,t) \
if (a != NULL) \
{ \
unsigned char *q=p; \
f(a,&p); \
*q=(V_ASN1_CONTEXT_SPECIFIC|t|(*q&V_ASN1_CONSTRUCTED));\
}
#define M_ASN1_I2D_put_SET(a,f) i2d_ASN1_SET(a,&p,f,V_ASN1_SET,\
V_ASN1_UNIVERSAL,IS_SET)
#define M_ASN1_I2D_put_SET_type(type,a,f) \
i2d_ASN1_SET_OF_##type(a,&p,f,V_ASN1_SET,V_ASN1_UNIVERSAL,IS_SET)
#define M_ASN1_I2D_put_IMP_SET(a,f,x) i2d_ASN1_SET(a,&p,f,x,\
V_ASN1_CONTEXT_SPECIFIC,IS_SET)
#define M_ASN1_I2D_put_IMP_SET_type(type,a,f,x) \
i2d_ASN1_SET_OF_##type(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC,IS_SET)
#define M_ASN1_I2D_put_IMP_SEQUENCE(a,f,x) i2d_ASN1_SET(a,&p,f,x,\
V_ASN1_CONTEXT_SPECIFIC,IS_SEQUENCE)
#define M_ASN1_I2D_put_SEQUENCE(a,f) i2d_ASN1_SET(a,&p,f,V_ASN1_SEQUENCE,\
V_ASN1_UNIVERSAL,IS_SEQUENCE)
#define M_ASN1_I2D_put_SEQUENCE_type(type,a,f) \
i2d_ASN1_SET_OF_##type(a,&p,f,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL, \
IS_SEQUENCE)
#define M_ASN1_I2D_put_SEQUENCE_opt(a,f) \
if ((a != NULL) && (sk_num(a) != 0)) \
M_ASN1_I2D_put_SEQUENCE(a,f);
#define M_ASN1_I2D_put_IMP_SET_opt(a,f,x) \
if ((a != NULL) && (sk_num(a) != 0)) \
{ i2d_ASN1_SET(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC, \
IS_SET); }
#define M_ASN1_I2D_put_IMP_SET_opt_type(type,a,f,x) \
if ((a != NULL) && (sk_##type##_num(a) != 0)) \
{ i2d_ASN1_SET_OF_##type(a,&p,f,x, \
V_ASN1_CONTEXT_SPECIFIC, \
IS_SET); }
#define M_ASN1_I2D_put_IMP_SEQUENCE_opt(a,f,x) \
if ((a != NULL) && (sk_num(a) != 0)) \
{ i2d_ASN1_SET(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC, \
IS_SEQUENCE); }
#define M_ASN1_I2D_put_IMP_SEQUENCE_opt_type(type,a,f,x) \
if ((a != NULL) && (sk_##type##_num(a) != 0)) \
{ i2d_ASN1_SET_OF_##type(a,&p,f,x, \
V_ASN1_CONTEXT_SPECIFIC, \
IS_SEQUENCE); }
#define M_ASN1_I2D_put_EXP_opt(a,f,tag,v) \
if (a != NULL) \
{ \
ASN1_put_object(&p,1,v,tag,V_ASN1_CONTEXT_SPECIFIC); \
f(a,&p); \
}
#define M_ASN1_I2D_put_EXP_SET_opt(a,f,mtag,tag,v) \
if ((a != NULL) && (sk_num(a) != 0)) \
{ \
ASN1_put_object(&p,1,v,mtag,V_ASN1_CONTEXT_SPECIFIC); \
i2d_ASN1_SET(a,&p,f,tag,V_ASN1_UNIVERSAL,IS_SET); \
}
#define M_ASN1_I2D_put_EXP_SEQUENCE_opt(a,f,mtag,tag,v) \
if ((a != NULL) && (sk_num(a) != 0)) \
{ \
ASN1_put_object(&p,1,v,mtag,V_ASN1_CONTEXT_SPECIFIC); \
i2d_ASN1_SET(a,&p,f,tag,V_ASN1_UNIVERSAL,IS_SEQUENCE); \
}
#define M_ASN1_I2D_put_EXP_SEQUENCE_opt_type(type,a,f,mtag,tag,v) \
if ((a != NULL) && (sk_##type##_num(a) != 0)) \
{ \
ASN1_put_object(&p,1,v,mtag,V_ASN1_CONTEXT_SPECIFIC); \
i2d_ASN1_SET_OF_##type(a,&p,f,tag,V_ASN1_UNIVERSAL, \
IS_SEQUENCE); \
}
#define M_ASN1_I2D_seq_total() \
r=ASN1_object_size(1,ret,V_ASN1_SEQUENCE); \
if (pp == NULL) return(r); \
p= *pp; \
ASN1_put_object(&p,1,ret,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL)
#define M_ASN1_I2D_INF_seq_start(tag,ctx) \
*(p++)=(V_ASN1_CONSTRUCTED|(tag)|(ctx)); \
*(p++)=0x80
#define M_ASN1_I2D_INF_seq_end() *(p++)=0x00; *(p++)=0x00
#define M_ASN1_I2D_finish() *pp=p; \
return(r);
int asn1_GetSequence(ASN1_const_CTX *c, long *length);
void asn1_add_error(const unsigned char *address,int offset);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,886 @@
/* asn1t.h */
/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
* project 2000.
*/
/* ====================================================================
* Copyright (c) 2000 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* licensing@OpenSSL.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
#ifndef HEADER_ASN1T_H
#define HEADER_ASN1T_H
#include <stddef.h>
#include <openssl/e_os2.h>
#include <openssl/asn1.h>
#ifdef OPENSSL_BUILD_SHLIBCRYPTO
# undef OPENSSL_EXTERN
# define OPENSSL_EXTERN OPENSSL_EXPORT
#endif
/* ASN1 template defines, structures and functions */
#ifdef __cplusplus
extern "C" {
#endif
#ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
/* Macro to obtain ASN1_ADB pointer from a type (only used internally) */
#define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)(iptr))
/* Macros for start and end of ASN1_ITEM definition */
#define ASN1_ITEM_start(itname) \
OPENSSL_GLOBAL const ASN1_ITEM itname##_it = {
#define ASN1_ITEM_end(itname) \
};
#else
/* Macro to obtain ASN1_ADB pointer from a type (only used internally) */
#define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)(iptr()))
/* Macros for start and end of ASN1_ITEM definition */
#define ASN1_ITEM_start(itname) \
const ASN1_ITEM * itname##_it(void) \
{ \
static const ASN1_ITEM local_it = { \
#define ASN1_ITEM_end(itname) \
}; \
return &local_it; \
}
#endif
/* Macros to aid ASN1 template writing */
#define ASN1_ITEM_TEMPLATE(tname) \
static const ASN1_TEMPLATE tname##_item_tt
#define ASN1_ITEM_TEMPLATE_END(tname) \
;\
ASN1_ITEM_start(tname) \
ASN1_ITYPE_PRIMITIVE,\
-1,\
&tname##_item_tt,\
0,\
NULL,\
0,\
#tname \
ASN1_ITEM_end(tname)
/* This is a ASN1 type which just embeds a template */
/* This pair helps declare a SEQUENCE. We can do:
*
* ASN1_SEQUENCE(stname) = {
* ... SEQUENCE components ...
* } ASN1_SEQUENCE_END(stname)
*
* This will produce an ASN1_ITEM called stname_it
* for a structure called stname.
*
* If you want the same structure but a different
* name then use:
*
* ASN1_SEQUENCE(itname) = {
* ... SEQUENCE components ...
* } ASN1_SEQUENCE_END_name(stname, itname)
*
* This will create an item called itname_it using
* a structure called stname.
*/
#define ASN1_SEQUENCE(tname) \
static const ASN1_TEMPLATE tname##_seq_tt[]
#define ASN1_SEQUENCE_END(stname) ASN1_SEQUENCE_END_name(stname, stname)
#define ASN1_SEQUENCE_END_name(stname, tname) \
;\
ASN1_ITEM_start(tname) \
ASN1_ITYPE_SEQUENCE,\
V_ASN1_SEQUENCE,\
tname##_seq_tt,\
sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
NULL,\
sizeof(stname),\
#stname \
ASN1_ITEM_end(tname)
#define ASN1_NDEF_SEQUENCE(tname) \
ASN1_SEQUENCE(tname)
#define ASN1_SEQUENCE_cb(tname, cb) \
static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \
ASN1_SEQUENCE(tname)
#define ASN1_BROKEN_SEQUENCE(tname) \
static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_BROKEN, 0, 0, 0, 0}; \
ASN1_SEQUENCE(tname)
#define ASN1_SEQUENCE_ref(tname, cb, lck) \
static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_REFCOUNT, offsetof(tname, references), lck, cb, 0}; \
ASN1_SEQUENCE(tname)
#define ASN1_SEQUENCE_enc(tname, enc, cb) \
static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_ENCODING, 0, 0, cb, offsetof(tname, enc)}; \
ASN1_SEQUENCE(tname)
#define ASN1_NDEF_SEQUENCE_END(tname) \
;\
ASN1_ITEM_start(tname) \
ASN1_ITYPE_NDEF_SEQUENCE,\
V_ASN1_SEQUENCE,\
tname##_seq_tt,\
sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
NULL,\
sizeof(tname),\
#tname \
ASN1_ITEM_end(tname)
#define ASN1_BROKEN_SEQUENCE_END(stname) ASN1_SEQUENCE_END_ref(stname, stname)
#define ASN1_SEQUENCE_END_enc(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname)
#define ASN1_SEQUENCE_END_cb(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname)
#define ASN1_SEQUENCE_END_ref(stname, tname) \
;\
ASN1_ITEM_start(tname) \
ASN1_ITYPE_SEQUENCE,\
V_ASN1_SEQUENCE,\
tname##_seq_tt,\
sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
&tname##_aux,\
sizeof(stname),\
#stname \
ASN1_ITEM_end(tname)
/* This pair helps declare a CHOICE type. We can do:
*
* ASN1_CHOICE(chname) = {
* ... CHOICE options ...
* ASN1_CHOICE_END(chname)
*
* This will produce an ASN1_ITEM called chname_it
* for a structure called chname. The structure
* definition must look like this:
* typedef struct {
* int type;
* union {
* ASN1_SOMETHING *opt1;
* ASN1_SOMEOTHER *opt2;
* } value;
* } chname;
*
* the name of the selector must be 'type'.
* to use an alternative selector name use the
* ASN1_CHOICE_END_selector() version.
*/
#define ASN1_CHOICE(tname) \
static const ASN1_TEMPLATE tname##_ch_tt[]
#define ASN1_CHOICE_cb(tname, cb) \
static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \
ASN1_CHOICE(tname)
#define ASN1_CHOICE_END(stname) ASN1_CHOICE_END_name(stname, stname)
#define ASN1_CHOICE_END_name(stname, tname) ASN1_CHOICE_END_selector(stname, tname, type)
#define ASN1_CHOICE_END_selector(stname, tname, selname) \
;\
ASN1_ITEM_start(tname) \
ASN1_ITYPE_CHOICE,\
offsetof(stname,selname) ,\
tname##_ch_tt,\
sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
NULL,\
sizeof(stname),\
#stname \
ASN1_ITEM_end(tname)
#define ASN1_CHOICE_END_cb(stname, tname, selname) \
;\
ASN1_ITEM_start(tname) \
ASN1_ITYPE_CHOICE,\
offsetof(stname,selname) ,\
tname##_ch_tt,\
sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
&tname##_aux,\
sizeof(stname),\
#stname \
ASN1_ITEM_end(tname)
/* This helps with the template wrapper form of ASN1_ITEM */
#define ASN1_EX_TEMPLATE_TYPE(flags, tag, name, type) { \
(flags), (tag), 0,\
#name, ASN1_ITEM_ref(type) }
/* These help with SEQUENCE or CHOICE components */
/* used to declare other types */
#define ASN1_EX_TYPE(flags, tag, stname, field, type) { \
(flags), (tag), offsetof(stname, field),\
#field, ASN1_ITEM_ref(type) }
/* used when the structure is combined with the parent */
#define ASN1_EX_COMBINE(flags, tag, type) { \
(flags)|ASN1_TFLG_COMBINE, (tag), 0, NULL, ASN1_ITEM_ref(type) }
/* implicit and explicit helper macros */
#define ASN1_IMP_EX(stname, field, type, tag, ex) \
ASN1_EX_TYPE(ASN1_TFLG_IMPLICIT | ex, tag, stname, field, type)
#define ASN1_EXP_EX(stname, field, type, tag, ex) \
ASN1_EX_TYPE(ASN1_TFLG_EXPLICIT | ex, tag, stname, field, type)
/* Any defined by macros: the field used is in the table itself */
#ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
#define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) }
#define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) }
#else
#define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, tblname##_adb }
#define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, tblname##_adb }
#endif
/* Plain simple type */
#define ASN1_SIMPLE(stname, field, type) ASN1_EX_TYPE(0,0, stname, field, type)
/* OPTIONAL simple type */
#define ASN1_OPT(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL, 0, stname, field, type)
/* IMPLICIT tagged simple type */
#define ASN1_IMP(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, 0)
/* IMPLICIT tagged OPTIONAL simple type */
#define ASN1_IMP_OPT(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL)
/* Same as above but EXPLICIT */
#define ASN1_EXP(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, 0)
#define ASN1_EXP_OPT(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL)
/* SEQUENCE OF type */
#define ASN1_SEQUENCE_OF(stname, field, type) \
ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, stname, field, type)
/* OPTIONAL SEQUENCE OF */
#define ASN1_SEQUENCE_OF_OPT(stname, field, type) \
ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type)
/* Same as above but for SET OF */
#define ASN1_SET_OF(stname, field, type) \
ASN1_EX_TYPE(ASN1_TFLG_SET_OF, 0, stname, field, type)
#define ASN1_SET_OF_OPT(stname, field, type) \
ASN1_EX_TYPE(ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type)
/* Finally compound types of SEQUENCE, SET, IMPLICIT, EXPLICIT and OPTIONAL */
#define ASN1_IMP_SET_OF(stname, field, type, tag) \
ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF)
#define ASN1_EXP_SET_OF(stname, field, type, tag) \
ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF)
#define ASN1_IMP_SET_OF_OPT(stname, field, type, tag) \
ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL)
#define ASN1_EXP_SET_OF_OPT(stname, field, type, tag) \
ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL)
#define ASN1_IMP_SEQUENCE_OF(stname, field, type, tag) \
ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF)
#define ASN1_IMP_SEQUENCE_OF_OPT(stname, field, type, tag) \
ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL)
#define ASN1_EXP_SEQUENCE_OF(stname, field, type, tag) \
ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF)
#define ASN1_EXP_SEQUENCE_OF_OPT(stname, field, type, tag) \
ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL)
/* EXPLICIT OPTIONAL using indefinite length constructed form */
#define ASN1_NDEF_EXP_OPT(stname, field, type, tag) \
ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_NDEF)
/* Macros for the ASN1_ADB structure */
#define ASN1_ADB(name) \
static const ASN1_ADB_TABLE name##_adbtbl[]
#ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
#define ASN1_ADB_END(name, flags, field, app_table, def, none) \
;\
static const ASN1_ADB name##_adb = {\
flags,\
offsetof(name, field),\
app_table,\
name##_adbtbl,\
sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
def,\
none\
}
#else
#define ASN1_ADB_END(name, flags, field, app_table, def, none) \
;\
static const ASN1_ITEM *name##_adb(void) \
{ \
static const ASN1_ADB internal_adb = \
{\
flags,\
offsetof(name, field),\
app_table,\
name##_adbtbl,\
sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
def,\
none\
}; \
return (const ASN1_ITEM *) &internal_adb; \
} \
void dummy_function(void)
#endif
#define ADB_ENTRY(val, template) {val, template}
#define ASN1_ADB_TEMPLATE(name) \
static const ASN1_TEMPLATE name##_tt
/* This is the ASN1 template structure that defines
* a wrapper round the actual type. It determines the
* actual position of the field in the value structure,
* various flags such as OPTIONAL and the field name.
*/
struct ASN1_TEMPLATE_st {
unsigned long flags; /* Various flags */
long tag; /* tag, not used if no tagging */
unsigned long offset; /* Offset of this field in structure */
#ifndef NO_ASN1_FIELD_NAMES
const char *field_name; /* Field name */
#endif
ASN1_ITEM_EXP *item; /* Relevant ASN1_ITEM or ASN1_ADB */
};
/* Macro to extract ASN1_ITEM and ASN1_ADB pointer from ASN1_TEMPLATE */
#define ASN1_TEMPLATE_item(t) (t->item_ptr)
#define ASN1_TEMPLATE_adb(t) (t->item_ptr)
typedef struct ASN1_ADB_TABLE_st ASN1_ADB_TABLE;
typedef struct ASN1_ADB_st ASN1_ADB;
struct ASN1_ADB_st {
unsigned long flags; /* Various flags */
unsigned long offset; /* Offset of selector field */
STACK_OF(ASN1_ADB_TABLE) **app_items; /* Application defined items */
const ASN1_ADB_TABLE *tbl; /* Table of possible types */
long tblcount; /* Number of entries in tbl */
const ASN1_TEMPLATE *default_tt; /* Type to use if no match */
const ASN1_TEMPLATE *null_tt; /* Type to use if selector is NULL */
};
struct ASN1_ADB_TABLE_st {
long value; /* NID for an object or value for an int */
const ASN1_TEMPLATE tt; /* item for this value */
};
/* template flags */
/* Field is optional */
#define ASN1_TFLG_OPTIONAL (0x1)
/* Field is a SET OF */
#define ASN1_TFLG_SET_OF (0x1 << 1)
/* Field is a SEQUENCE OF */
#define ASN1_TFLG_SEQUENCE_OF (0x2 << 1)
/* Special case: this refers to a SET OF that
* will be sorted into DER order when encoded *and*
* the corresponding STACK will be modified to match
* the new order.
*/
#define ASN1_TFLG_SET_ORDER (0x3 << 1)
/* Mask for SET OF or SEQUENCE OF */
#define ASN1_TFLG_SK_MASK (0x3 << 1)
/* These flags mean the tag should be taken from the
* tag field. If EXPLICIT then the underlying type
* is used for the inner tag.
*/
/* IMPLICIT tagging */
#define ASN1_TFLG_IMPTAG (0x1 << 3)
/* EXPLICIT tagging, inner tag from underlying type */
#define ASN1_TFLG_EXPTAG (0x2 << 3)
#define ASN1_TFLG_TAG_MASK (0x3 << 3)
/* context specific IMPLICIT */
#define ASN1_TFLG_IMPLICIT ASN1_TFLG_IMPTAG|ASN1_TFLG_CONTEXT
/* context specific EXPLICIT */
#define ASN1_TFLG_EXPLICIT ASN1_TFLG_EXPTAG|ASN1_TFLG_CONTEXT
/* If tagging is in force these determine the
* type of tag to use. Otherwise the tag is
* determined by the underlying type. These
* values reflect the actual octet format.
*/
/* Universal tag */
#define ASN1_TFLG_UNIVERSAL (0x0<<6)
/* Application tag */
#define ASN1_TFLG_APPLICATION (0x1<<6)
/* Context specific tag */
#define ASN1_TFLG_CONTEXT (0x2<<6)
/* Private tag */
#define ASN1_TFLG_PRIVATE (0x3<<6)
#define ASN1_TFLG_TAG_CLASS (0x3<<6)
/* These are for ANY DEFINED BY type. In this case
* the 'item' field points to an ASN1_ADB structure
* which contains a table of values to decode the
* relevant type
*/
#define ASN1_TFLG_ADB_MASK (0x3<<8)
#define ASN1_TFLG_ADB_OID (0x1<<8)
#define ASN1_TFLG_ADB_INT (0x1<<9)
/* This flag means a parent structure is passed
* instead of the field: this is useful is a
* SEQUENCE is being combined with a CHOICE for
* example. Since this means the structure and
* item name will differ we need to use the
* ASN1_CHOICE_END_name() macro for example.
*/
#define ASN1_TFLG_COMBINE (0x1<<10)
/* This flag when present in a SEQUENCE OF, SET OF
* or EXPLICIT causes indefinite length constructed
* encoding to be used if required.
*/
#define ASN1_TFLG_NDEF (0x1<<11)
/* This is the actual ASN1 item itself */
struct ASN1_ITEM_st {
char itype; /* The item type, primitive, SEQUENCE, CHOICE or extern */
long utype; /* underlying type */
const ASN1_TEMPLATE *templates; /* If SEQUENCE or CHOICE this contains the contents */
long tcount; /* Number of templates if SEQUENCE or CHOICE */
const void *funcs; /* functions that handle this type */
long size; /* Structure size (usually)*/
#ifndef NO_ASN1_FIELD_NAMES
const char *sname; /* Structure name */
#endif
};
/* These are values for the itype field and
* determine how the type is interpreted.
*
* For PRIMITIVE types the underlying type
* determines the behaviour if items is NULL.
*
* Otherwise templates must contain a single
* template and the type is treated in the
* same way as the type specified in the template.
*
* For SEQUENCE types the templates field points
* to the members, the size field is the
* structure size.
*
* For CHOICE types the templates field points
* to each possible member (typically a union)
* and the 'size' field is the offset of the
* selector.
*
* The 'funcs' field is used for application
* specific functions.
*
* For COMPAT types the funcs field gives a
* set of functions that handle this type, this
* supports the old d2i, i2d convention.
*
* The EXTERN type uses a new style d2i/i2d.
* The new style should be used where possible
* because it avoids things like the d2i IMPLICIT
* hack.
*
* MSTRING is a multiple string type, it is used
* for a CHOICE of character strings where the
* actual strings all occupy an ASN1_STRING
* structure. In this case the 'utype' field
* has a special meaning, it is used as a mask
* of acceptable types using the B_ASN1 constants.
*
* NDEF_SEQUENCE is the same as SEQUENCE except
* that it will use indefinite length constructed
* encoding if requested.
*
*/
#define ASN1_ITYPE_PRIMITIVE 0x0
#define ASN1_ITYPE_SEQUENCE 0x1
#define ASN1_ITYPE_CHOICE 0x2
#define ASN1_ITYPE_COMPAT 0x3
#define ASN1_ITYPE_EXTERN 0x4
#define ASN1_ITYPE_MSTRING 0x5
#define ASN1_ITYPE_NDEF_SEQUENCE 0x6
/* Cache for ASN1 tag and length, so we
* don't keep re-reading it for things
* like CHOICE
*/
struct ASN1_TLC_st{
char valid; /* Values below are valid */
int ret; /* return value */
long plen; /* length */
int ptag; /* class value */
int pclass; /* class value */
int hdrlen; /* header length */
};
/* Typedefs for ASN1 function pointers */
typedef ASN1_VALUE * ASN1_new_func(void);
typedef void ASN1_free_func(ASN1_VALUE *a);
typedef ASN1_VALUE * ASN1_d2i_func(ASN1_VALUE **a, const unsigned char ** in, long length);
typedef int ASN1_i2d_func(ASN1_VALUE * a, unsigned char **in);
typedef int ASN1_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, const ASN1_ITEM *it,
int tag, int aclass, char opt, ASN1_TLC *ctx);
typedef int ASN1_ex_i2d(ASN1_VALUE **pval, unsigned char **out, const ASN1_ITEM *it, int tag, int aclass);
typedef int ASN1_ex_new_func(ASN1_VALUE **pval, const ASN1_ITEM *it);
typedef void ASN1_ex_free_func(ASN1_VALUE **pval, const ASN1_ITEM *it);
typedef int ASN1_primitive_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, const ASN1_ITEM *it);
typedef int ASN1_primitive_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len, int utype, char *free_cont, const ASN1_ITEM *it);
typedef struct ASN1_COMPAT_FUNCS_st {
ASN1_new_func *asn1_new;
ASN1_free_func *asn1_free;
ASN1_d2i_func *asn1_d2i;
ASN1_i2d_func *asn1_i2d;
} ASN1_COMPAT_FUNCS;
typedef struct ASN1_EXTERN_FUNCS_st {
void *app_data;
ASN1_ex_new_func *asn1_ex_new;
ASN1_ex_free_func *asn1_ex_free;
ASN1_ex_free_func *asn1_ex_clear;
ASN1_ex_d2i *asn1_ex_d2i;
ASN1_ex_i2d *asn1_ex_i2d;
} ASN1_EXTERN_FUNCS;
typedef struct ASN1_PRIMITIVE_FUNCS_st {
void *app_data;
unsigned long flags;
ASN1_ex_new_func *prim_new;
ASN1_ex_free_func *prim_free;
ASN1_ex_free_func *prim_clear;
ASN1_primitive_c2i *prim_c2i;
ASN1_primitive_i2c *prim_i2c;
} ASN1_PRIMITIVE_FUNCS;
/* This is the ASN1_AUX structure: it handles various
* miscellaneous requirements. For example the use of
* reference counts and an informational callback.
*
* The "informational callback" is called at various
* points during the ASN1 encoding and decoding. It can
* be used to provide minor customisation of the structures
* used. This is most useful where the supplied routines
* *almost* do the right thing but need some extra help
* at a few points. If the callback returns zero then
* it is assumed a fatal error has occurred and the
* main operation should be abandoned.
*
* If major changes in the default behaviour are required
* then an external type is more appropriate.
*/
typedef int ASN1_aux_cb(int operation, ASN1_VALUE **in, const ASN1_ITEM *it);
typedef struct ASN1_AUX_st {
void *app_data;
int flags;
int ref_offset; /* Offset of reference value */
int ref_lock; /* Lock type to use */
ASN1_aux_cb *asn1_cb;
int enc_offset; /* Offset of ASN1_ENCODING structure */
} ASN1_AUX;
/* Flags in ASN1_AUX */
/* Use a reference count */
#define ASN1_AFLG_REFCOUNT 1
/* Save the encoding of structure (useful for signatures) */
#define ASN1_AFLG_ENCODING 2
/* The Sequence length is invalid */
#define ASN1_AFLG_BROKEN 4
/* operation values for asn1_cb */
#define ASN1_OP_NEW_PRE 0
#define ASN1_OP_NEW_POST 1
#define ASN1_OP_FREE_PRE 2
#define ASN1_OP_FREE_POST 3
#define ASN1_OP_D2I_PRE 4
#define ASN1_OP_D2I_POST 5
#define ASN1_OP_I2D_PRE 6
#define ASN1_OP_I2D_POST 7
/* Macro to implement a primitive type */
#define IMPLEMENT_ASN1_TYPE(stname) IMPLEMENT_ASN1_TYPE_ex(stname, stname, 0)
#define IMPLEMENT_ASN1_TYPE_ex(itname, vname, ex) \
ASN1_ITEM_start(itname) \
ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
ASN1_ITEM_end(itname)
/* Macro to implement a multi string type */
#define IMPLEMENT_ASN1_MSTRING(itname, mask) \
ASN1_ITEM_start(itname) \
ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
ASN1_ITEM_end(itname)
/* Macro to implement an ASN1_ITEM in terms of old style funcs */
#define IMPLEMENT_COMPAT_ASN1(sname) IMPLEMENT_COMPAT_ASN1_type(sname, V_ASN1_SEQUENCE)
#define IMPLEMENT_COMPAT_ASN1_type(sname, tag) \
static const ASN1_COMPAT_FUNCS sname##_ff = { \
(ASN1_new_func *)sname##_new, \
(ASN1_free_func *)sname##_free, \
(ASN1_d2i_func *)d2i_##sname, \
(ASN1_i2d_func *)i2d_##sname, \
}; \
ASN1_ITEM_start(sname) \
ASN1_ITYPE_COMPAT, \
tag, \
NULL, \
0, \
&sname##_ff, \
0, \
#sname \
ASN1_ITEM_end(sname)
#define IMPLEMENT_EXTERN_ASN1(sname, tag, fptrs) \
ASN1_ITEM_start(sname) \
ASN1_ITYPE_EXTERN, \
tag, \
NULL, \
0, \
&fptrs, \
0, \
#sname \
ASN1_ITEM_end(sname)
/* Macro to implement standard functions in terms of ASN1_ITEM structures */
#define IMPLEMENT_ASN1_FUNCTIONS(stname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, stname, stname)
#define IMPLEMENT_ASN1_FUNCTIONS_name(stname, itname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, itname)
#define IMPLEMENT_ASN1_FUNCTIONS_ENCODE_name(stname, itname) \
IMPLEMENT_ASN1_FUNCTIONS_ENCODE_fname(stname, itname, itname)
#define IMPLEMENT_ASN1_ALLOC_FUNCTIONS(stname) \
IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, stname, stname)
#define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname) \
stname *fname##_new(void) \
{ \
return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
} \
void fname##_free(stname *a) \
{ \
ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
}
#define IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, fname) \
IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \
IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname)
#define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \
stname *d2i_##fname(stname **a, const unsigned char **in, long len) \
{ \
return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
} \
int i2d_##fname(stname *a, unsigned char **out) \
{ \
return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
}
#define IMPLEMENT_ASN1_NDEF_FUNCTION(stname) \
int i2d_##stname##_NDEF(stname *a, unsigned char **out) \
{ \
return ASN1_item_ndef_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(stname));\
}
/* This includes evil casts to remove const: they will go away when full
* ASN1 constification is done.
*/
#define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \
stname *d2i_##fname(stname **a, const unsigned char **in, long len) \
{ \
return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
} \
int i2d_##fname(const stname *a, unsigned char **out) \
{ \
return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
}
#define IMPLEMENT_ASN1_DUP_FUNCTION(stname) \
stname * stname##_dup(stname *x) \
{ \
return ASN1_item_dup(ASN1_ITEM_rptr(stname), x); \
}
#define IMPLEMENT_ASN1_FUNCTIONS_const(name) \
IMPLEMENT_ASN1_FUNCTIONS_const_fname(name, name, name)
#define IMPLEMENT_ASN1_FUNCTIONS_const_fname(stname, itname, fname) \
IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \
IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname)
/* external definitions for primitive types */
DECLARE_ASN1_ITEM(ASN1_BOOLEAN)
DECLARE_ASN1_ITEM(ASN1_TBOOLEAN)
DECLARE_ASN1_ITEM(ASN1_FBOOLEAN)
DECLARE_ASN1_ITEM(ASN1_SEQUENCE)
DECLARE_ASN1_ITEM(CBIGNUM)
DECLARE_ASN1_ITEM(BIGNUM)
DECLARE_ASN1_ITEM(LONG)
DECLARE_ASN1_ITEM(ZLONG)
DECLARE_STACK_OF(ASN1_VALUE)
/* Functions used internally by the ASN1 code */
int ASN1_item_ex_new(ASN1_VALUE **pval, const ASN1_ITEM *it);
void ASN1_item_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it);
int ASN1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt);
int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it);
void ASN1_template_free(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt);
int ASN1_template_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, const ASN1_TEMPLATE *tt);
int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, const ASN1_ITEM *it,
int tag, int aclass, char opt, ASN1_TLC *ctx);
int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out, const ASN1_ITEM *it, int tag, int aclass);
int ASN1_template_i2d(ASN1_VALUE **pval, unsigned char **out, const ASN1_TEMPLATE *tt);
void ASN1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it);
int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, const ASN1_ITEM *it);
int asn1_ex_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len, int utype, char *free_cont, const ASN1_ITEM *it);
int asn1_get_choice_selector(ASN1_VALUE **pval, const ASN1_ITEM *it);
int asn1_set_choice_selector(ASN1_VALUE **pval, int value, const ASN1_ITEM *it);
ASN1_VALUE ** asn1_get_field_ptr(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt);
const ASN1_TEMPLATE *asn1_do_adb(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt, int nullerr);
int asn1_do_lock(ASN1_VALUE **pval, int op, const ASN1_ITEM *it);
void asn1_enc_init(ASN1_VALUE **pval, const ASN1_ITEM *it);
void asn1_enc_free(ASN1_VALUE **pval, const ASN1_ITEM *it);
int asn1_enc_restore(int *len, unsigned char **out, ASN1_VALUE **pval, const ASN1_ITEM *it);
int asn1_enc_save(ASN1_VALUE **pval, const unsigned char *in, int inlen, const ASN1_ITEM *it);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,770 @@
/* crypto/bio/bio.h */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
#ifndef HEADER_BIO_H
#define HEADER_BIO_H
#include <openssl/e_os2.h>
#ifndef OPENSSL_NO_FP_API
# include <stdio.h>
#endif
#include <stdarg.h>
#include <openssl/crypto.h>
#ifdef __cplusplus
extern "C" {
#endif
/* These are the 'types' of BIOs */
#define BIO_TYPE_NONE 0
#define BIO_TYPE_MEM (1|0x0400)
#define BIO_TYPE_FILE (2|0x0400)
#define BIO_TYPE_FD (4|0x0400|0x0100)
#define BIO_TYPE_SOCKET (5|0x0400|0x0100)
#define BIO_TYPE_NULL (6|0x0400)
#define BIO_TYPE_SSL (7|0x0200)
#define BIO_TYPE_MD (8|0x0200) /* passive filter */
#define BIO_TYPE_BUFFER (9|0x0200) /* filter */
#define BIO_TYPE_CIPHER (10|0x0200) /* filter */
#define BIO_TYPE_BASE64 (11|0x0200) /* filter */
#define BIO_TYPE_CONNECT (12|0x0400|0x0100) /* socket - connect */
#define BIO_TYPE_ACCEPT (13|0x0400|0x0100) /* socket for accept */
#define BIO_TYPE_PROXY_CLIENT (14|0x0200) /* client proxy BIO */
#define BIO_TYPE_PROXY_SERVER (15|0x0200) /* server proxy BIO */
#define BIO_TYPE_NBIO_TEST (16|0x0200) /* server proxy BIO */
#define BIO_TYPE_NULL_FILTER (17|0x0200)
#define BIO_TYPE_BER (18|0x0200) /* BER -> bin filter */
#define BIO_TYPE_BIO (19|0x0400) /* (half a) BIO pair */
#define BIO_TYPE_LINEBUFFER (20|0x0200) /* filter */
#define BIO_TYPE_DGRAM (21|0x0400|0x0100)
#define BIO_TYPE_DESCRIPTOR 0x0100 /* socket, fd, connect or accept */
#define BIO_TYPE_FILTER 0x0200
#define BIO_TYPE_SOURCE_SINK 0x0400
/* BIO_FILENAME_READ|BIO_CLOSE to open or close on free.
* BIO_set_fp(in,stdin,BIO_NOCLOSE); */
#define BIO_NOCLOSE 0x00
#define BIO_CLOSE 0x01
/* These are used in the following macros and are passed to
* BIO_ctrl() */
#define BIO_CTRL_RESET 1 /* opt - rewind/zero etc */
#define BIO_CTRL_EOF 2 /* opt - are we at the eof */
#define BIO_CTRL_INFO 3 /* opt - extra tit-bits */
#define BIO_CTRL_SET 4 /* man - set the 'IO' type */
#define BIO_CTRL_GET 5 /* man - get the 'IO' type */
#define BIO_CTRL_PUSH 6 /* opt - internal, used to signify change */
#define BIO_CTRL_POP 7 /* opt - internal, used to signify change */
#define BIO_CTRL_GET_CLOSE 8 /* man - set the 'close' on free */
#define BIO_CTRL_SET_CLOSE 9 /* man - set the 'close' on free */
#define BIO_CTRL_PENDING 10 /* opt - is their more data buffered */
#define BIO_CTRL_FLUSH 11 /* opt - 'flush' buffered output */
#define BIO_CTRL_DUP 12 /* man - extra stuff for 'duped' BIO */
#define BIO_CTRL_WPENDING 13 /* opt - number of bytes still to write */
/* callback is int cb(BIO *bio,state,ret); */
#define BIO_CTRL_SET_CALLBACK 14 /* opt - set callback function */
#define BIO_CTRL_GET_CALLBACK 15 /* opt - set callback function */
#define BIO_CTRL_SET_FILENAME 30 /* BIO_s_file special */
/* dgram BIO stuff */
#define BIO_CTRL_DGRAM_CONNECT 31 /* BIO dgram special */
#define BIO_CTRL_DGRAM_SET_CONNECTED 32 /* allow for an externally
* connected socket to be
* passed in */
#define BIO_CTRL_DGRAM_SET_RECV_TIMEOUT 33 /* setsockopt, essentially */
#define BIO_CTRL_DGRAM_GET_RECV_TIMEOUT 34 /* getsockopt, essentially */
#define BIO_CTRL_DGRAM_SET_SEND_TIMEOUT 35 /* setsockopt, essentially */
#define BIO_CTRL_DGRAM_GET_SEND_TIMEOUT 36 /* getsockopt, essentially */
#define BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP 37 /* flag whether the last */
#define BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP 38 /* I/O operation tiemd out */
/* #ifdef IP_MTU_DISCOVER */
#define BIO_CTRL_DGRAM_MTU_DISCOVER 39 /* set DF bit on egress packets */
/* #endif */
#define BIO_CTRL_DGRAM_QUERY_MTU 40 /* as kernel for current MTU */
#define BIO_CTRL_DGRAM_GET_MTU 41 /* get cached value for MTU */
#define BIO_CTRL_DGRAM_SET_MTU 42 /* set cached value for
* MTU. want to use this
* if asking the kernel
* fails */
#define BIO_CTRL_DGRAM_MTU_EXCEEDED 43 /* check whether the MTU
* was exceed in the
* previous write
* operation */
#define BIO_CTRL_DGRAM_SET_PEER 44 /* Destination for the data */
/* modifiers */
#define BIO_FP_READ 0x02
#define BIO_FP_WRITE 0x04
#define BIO_FP_APPEND 0x08
#define BIO_FP_TEXT 0x10
#define BIO_FLAGS_READ 0x01
#define BIO_FLAGS_WRITE 0x02
#define BIO_FLAGS_IO_SPECIAL 0x04
#define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
#define BIO_FLAGS_SHOULD_RETRY 0x08
#ifndef BIO_FLAGS_UPLINK
/* "UPLINK" flag denotes file descriptors provided by application.
It defaults to 0, as most platforms don't require UPLINK interface. */
#define BIO_FLAGS_UPLINK 0
#endif
/* Used in BIO_gethostbyname() */
#define BIO_GHBN_CTRL_HITS 1
#define BIO_GHBN_CTRL_MISSES 2
#define BIO_GHBN_CTRL_CACHE_SIZE 3
#define BIO_GHBN_CTRL_GET_ENTRY 4
#define BIO_GHBN_CTRL_FLUSH 5
/* Mostly used in the SSL BIO */
/* Not used anymore
* #define BIO_FLAGS_PROTOCOL_DELAYED_READ 0x10
* #define BIO_FLAGS_PROTOCOL_DELAYED_WRITE 0x20
* #define BIO_FLAGS_PROTOCOL_STARTUP 0x40
*/
#define BIO_FLAGS_BASE64_NO_NL 0x100
/* This is used with memory BIOs: it means we shouldn't free up or change the
* data in any way.
*/
#define BIO_FLAGS_MEM_RDONLY 0x200
#define BIO_set_flags(b,f) ((b)->flags|=(f))
#define BIO_get_flags(b) ((b)->flags)
#define BIO_set_retry_special(b) \
((b)->flags|=(BIO_FLAGS_IO_SPECIAL|BIO_FLAGS_SHOULD_RETRY))
#define BIO_set_retry_read(b) \
((b)->flags|=(BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY))
#define BIO_set_retry_write(b) \
((b)->flags|=(BIO_FLAGS_WRITE|BIO_FLAGS_SHOULD_RETRY))
/* These are normally used internally in BIOs */
#define BIO_clear_flags(b,f) ((b)->flags&= ~(f))
#define BIO_clear_retry_flags(b) \
((b)->flags&= ~(BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
#define BIO_get_retry_flags(b) \
((b)->flags&(BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
/* These should be used by the application to tell why we should retry */
#define BIO_should_read(a) ((a)->flags & BIO_FLAGS_READ)
#define BIO_should_write(a) ((a)->flags & BIO_FLAGS_WRITE)
#define BIO_should_io_special(a) ((a)->flags & BIO_FLAGS_IO_SPECIAL)
#define BIO_retry_type(a) ((a)->flags & BIO_FLAGS_RWS)
#define BIO_should_retry(a) ((a)->flags & BIO_FLAGS_SHOULD_RETRY)
/* The next three are used in conjunction with the
* BIO_should_io_special() condition. After this returns true,
* BIO *BIO_get_retry_BIO(BIO *bio, int *reason); will walk the BIO
* stack and return the 'reason' for the special and the offending BIO.
* Given a BIO, BIO_get_retry_reason(bio) will return the code. */
/* Returned from the SSL bio when the certificate retrieval code had an error */
#define BIO_RR_SSL_X509_LOOKUP 0x01
/* Returned from the connect BIO when a connect would have blocked */
#define BIO_RR_CONNECT 0x02
/* Returned from the accept BIO when an accept would have blocked */
#define BIO_RR_ACCEPT 0x03
/* These are passed by the BIO callback */
#define BIO_CB_FREE 0x01
#define BIO_CB_READ 0x02
#define BIO_CB_WRITE 0x03
#define BIO_CB_PUTS 0x04
#define BIO_CB_GETS 0x05
#define BIO_CB_CTRL 0x06
/* The callback is called before and after the underling operation,
* The BIO_CB_RETURN flag indicates if it is after the call */
#define BIO_CB_RETURN 0x80
#define BIO_CB_return(a) ((a)|BIO_CB_RETURN))
#define BIO_cb_pre(a) (!((a)&BIO_CB_RETURN))
#define BIO_cb_post(a) ((a)&BIO_CB_RETURN)
#define BIO_set_callback(b,cb) ((b)->callback=(cb))
#define BIO_set_callback_arg(b,arg) ((b)->cb_arg=(char *)(arg))
#define BIO_get_callback_arg(b) ((b)->cb_arg)
#define BIO_get_callback(b) ((b)->callback)
#define BIO_method_name(b) ((b)->method->name)
#define BIO_method_type(b) ((b)->method->type)
typedef struct bio_st BIO;
typedef void bio_info_cb(struct bio_st *, int, const char *, int, long, long);
#ifndef OPENSSL_SYS_WIN16
typedef struct bio_method_st
{
int type;
const char *name;
int (*bwrite)(BIO *, const char *, int);
int (*bread)(BIO *, char *, int);
int (*bputs)(BIO *, const char *);
int (*bgets)(BIO *, char *, int);
long (*ctrl)(BIO *, int, long, void *);
int (*create)(BIO *);
int (*destroy)(BIO *);
long (*callback_ctrl)(BIO *, int, bio_info_cb *);
} BIO_METHOD;
#else
typedef struct bio_method_st
{
int type;
const char *name;
int (_far *bwrite)();
int (_far *bread)();
int (_far *bputs)();
int (_far *bgets)();
long (_far *ctrl)();
int (_far *create)();
int (_far *destroy)();
long (_far *callback_ctrl)();
} BIO_METHOD;
#endif
struct bio_st
{
BIO_METHOD *method;
/* bio, mode, argp, argi, argl, ret */
long (*callback)(struct bio_st *,int,const char *,int, long,long);
char *cb_arg; /* first argument for the callback */
int init;
int shutdown;
int flags; /* extra storage */
int retry_reason;
int num;
void *ptr;
struct bio_st *next_bio; /* used by filter BIOs */
struct bio_st *prev_bio; /* used by filter BIOs */
int references;
unsigned long num_read;
unsigned long num_write;
CRYPTO_EX_DATA ex_data;
};
DECLARE_STACK_OF(BIO)
typedef struct bio_f_buffer_ctx_struct
{
/* BIO *bio; */ /* this is now in the BIO struct */
int ibuf_size; /* how big is the input buffer */
int obuf_size; /* how big is the output buffer */
char *ibuf; /* the char array */
int ibuf_len; /* how many bytes are in it */
int ibuf_off; /* write/read offset */
char *obuf; /* the char array */
int obuf_len; /* how many bytes are in it */
int obuf_off; /* write/read offset */
} BIO_F_BUFFER_CTX;
/* connect BIO stuff */
#define BIO_CONN_S_BEFORE 1
#define BIO_CONN_S_GET_IP 2
#define BIO_CONN_S_GET_PORT 3
#define BIO_CONN_S_CREATE_SOCKET 4
#define BIO_CONN_S_CONNECT 5
#define BIO_CONN_S_OK 6
#define BIO_CONN_S_BLOCKED_CONNECT 7
#define BIO_CONN_S_NBIO 8
/*#define BIO_CONN_get_param_hostname BIO_ctrl */
#define BIO_C_SET_CONNECT 100
#define BIO_C_DO_STATE_MACHINE 101
#define BIO_C_SET_NBIO 102
#define BIO_C_SET_PROXY_PARAM 103
#define BIO_C_SET_FD 104
#define BIO_C_GET_FD 105
#define BIO_C_SET_FILE_PTR 106
#define BIO_C_GET_FILE_PTR 107
#define BIO_C_SET_FILENAME 108
#define BIO_C_SET_SSL 109
#define BIO_C_GET_SSL 110
#define BIO_C_SET_MD 111
#define BIO_C_GET_MD 112
#define BIO_C_GET_CIPHER_STATUS 113
#define BIO_C_SET_BUF_MEM 114
#define BIO_C_GET_BUF_MEM_PTR 115
#define BIO_C_GET_BUFF_NUM_LINES 116
#define BIO_C_SET_BUFF_SIZE 117
#define BIO_C_SET_ACCEPT 118
#define BIO_C_SSL_MODE 119
#define BIO_C_GET_MD_CTX 120
#define BIO_C_GET_PROXY_PARAM 121
#define BIO_C_SET_BUFF_READ_DATA 122 /* data to read first */
#define BIO_C_GET_CONNECT 123
#define BIO_C_GET_ACCEPT 124
#define BIO_C_SET_SSL_RENEGOTIATE_BYTES 125
#define BIO_C_GET_SSL_NUM_RENEGOTIATES 126
#define BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT 127
#define BIO_C_FILE_SEEK 128
#define BIO_C_GET_CIPHER_CTX 129
#define BIO_C_SET_BUF_MEM_EOF_RETURN 130/*return end of input value*/
#define BIO_C_SET_BIND_MODE 131
#define BIO_C_GET_BIND_MODE 132
#define BIO_C_FILE_TELL 133
#define BIO_C_GET_SOCKS 134
#define BIO_C_SET_SOCKS 135
#define BIO_C_SET_WRITE_BUF_SIZE 136/* for BIO_s_bio */
#define BIO_C_GET_WRITE_BUF_SIZE 137
#define BIO_C_MAKE_BIO_PAIR 138
#define BIO_C_DESTROY_BIO_PAIR 139
#define BIO_C_GET_WRITE_GUARANTEE 140
#define BIO_C_GET_READ_REQUEST 141
#define BIO_C_SHUTDOWN_WR 142
#define BIO_C_NREAD0 143
#define BIO_C_NREAD 144
#define BIO_C_NWRITE0 145
#define BIO_C_NWRITE 146
#define BIO_C_RESET_READ_REQUEST 147
#define BIO_set_app_data(s,arg) BIO_set_ex_data(s,0,arg)
#define BIO_get_app_data(s) BIO_get_ex_data(s,0)
/* BIO_s_connect() and BIO_s_socks4a_connect() */
#define BIO_set_conn_hostname(b,name) BIO_ctrl(b,BIO_C_SET_CONNECT,0,(char *)name)
#define BIO_set_conn_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,1,(char *)port)
#define BIO_set_conn_ip(b,ip) BIO_ctrl(b,BIO_C_SET_CONNECT,2,(char *)ip)
#define BIO_set_conn_int_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,3,(char *)port)
#define BIO_get_conn_hostname(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,0)
#define BIO_get_conn_port(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,1)
#define BIO_get_conn_ip(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,2)
#define BIO_get_conn_int_port(b) BIO_int_ctrl(b,BIO_C_GET_CONNECT,3)
#define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL)
/* BIO_s_accept_socket() */
#define BIO_set_accept_port(b,name) BIO_ctrl(b,BIO_C_SET_ACCEPT,0,(char *)name)
#define BIO_get_accept_port(b) BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,0)
/* #define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) */
#define BIO_set_nbio_accept(b,n) BIO_ctrl(b,BIO_C_SET_ACCEPT,1,(n)?"a":NULL)
#define BIO_set_accept_bios(b,bio) BIO_ctrl(b,BIO_C_SET_ACCEPT,2,(char *)bio)
#define BIO_BIND_NORMAL 0
#define BIO_BIND_REUSEADDR_IF_UNUSED 1
#define BIO_BIND_REUSEADDR 2
#define BIO_set_bind_mode(b,mode) BIO_ctrl(b,BIO_C_SET_BIND_MODE,mode,NULL)
#define BIO_get_bind_mode(b,mode) BIO_ctrl(b,BIO_C_GET_BIND_MODE,0,NULL)
#define BIO_do_connect(b) BIO_do_handshake(b)
#define BIO_do_accept(b) BIO_do_handshake(b)
#define BIO_do_handshake(b) BIO_ctrl(b,BIO_C_DO_STATE_MACHINE,0,NULL)
/* BIO_s_proxy_client() */
#define BIO_set_url(b,url) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,0,(char *)(url))
#define BIO_set_proxies(b,p) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,1,(char *)(p))
/* BIO_set_nbio(b,n) */
#define BIO_set_filter_bio(b,s) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,2,(char *)(s))
/* BIO *BIO_get_filter_bio(BIO *bio); */
#define BIO_set_proxy_cb(b,cb) BIO_callback_ctrl(b,BIO_C_SET_PROXY_PARAM,3,(void *(*cb)()))
#define BIO_set_proxy_header(b,sk) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,4,(char *)sk)
#define BIO_set_no_connect_return(b,bool) BIO_int_ctrl(b,BIO_C_SET_PROXY_PARAM,5,bool)
#define BIO_get_proxy_header(b,skp) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,0,(char *)skp)
#define BIO_get_proxies(b,pxy_p) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,1,(char *)(pxy_p))
#define BIO_get_url(b,url) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,2,(char *)(url))
#define BIO_get_no_connect_return(b) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,5,NULL)
#define BIO_set_fd(b,fd,c) BIO_int_ctrl(b,BIO_C_SET_FD,c,fd)
#define BIO_get_fd(b,c) BIO_ctrl(b,BIO_C_GET_FD,0,(char *)c)
#define BIO_set_fp(b,fp,c) BIO_ctrl(b,BIO_C_SET_FILE_PTR,c,(char *)fp)
#define BIO_get_fp(b,fpp) BIO_ctrl(b,BIO_C_GET_FILE_PTR,0,(char *)fpp)
#define BIO_seek(b,ofs) (int)BIO_ctrl(b,BIO_C_FILE_SEEK,ofs,NULL)
#define BIO_tell(b) (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL)
/* name is cast to lose const, but might be better to route through a function
so we can do it safely */
#ifdef CONST_STRICT
/* If you are wondering why this isn't defined, its because CONST_STRICT is
* purely a compile-time kludge to allow const to be checked.
*/
int BIO_read_filename(BIO *b,const char *name);
#else
#define BIO_read_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \
BIO_CLOSE|BIO_FP_READ,(char *)name)
#endif
#define BIO_write_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \
BIO_CLOSE|BIO_FP_WRITE,name)
#define BIO_append_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \
BIO_CLOSE|BIO_FP_APPEND,name)
#define BIO_rw_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \
BIO_CLOSE|BIO_FP_READ|BIO_FP_WRITE,name)
/* WARNING WARNING, this ups the reference count on the read bio of the
* SSL structure. This is because the ssl read BIO is now pointed to by
* the next_bio field in the bio. So when you free the BIO, make sure
* you are doing a BIO_free_all() to catch the underlying BIO. */
#define BIO_set_ssl(b,ssl,c) BIO_ctrl(b,BIO_C_SET_SSL,c,(char *)ssl)
#define BIO_get_ssl(b,sslp) BIO_ctrl(b,BIO_C_GET_SSL,0,(char *)sslp)
#define BIO_set_ssl_mode(b,client) BIO_ctrl(b,BIO_C_SSL_MODE,client,NULL)
#define BIO_set_ssl_renegotiate_bytes(b,num) \
BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,NULL);
#define BIO_get_num_renegotiates(b) \
BIO_ctrl(b,BIO_C_GET_SSL_NUM_RENEGOTIATES,0,NULL);
#define BIO_set_ssl_renegotiate_timeout(b,seconds) \
BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,NULL);
/* defined in evp.h */
/* #define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,1,(char *)md) */
#define BIO_get_mem_data(b,pp) BIO_ctrl(b,BIO_CTRL_INFO,0,(char *)pp)
#define BIO_set_mem_buf(b,bm,c) BIO_ctrl(b,BIO_C_SET_BUF_MEM,c,(char *)bm)
#define BIO_get_mem_ptr(b,pp) BIO_ctrl(b,BIO_C_GET_BUF_MEM_PTR,0,(char *)pp)
#define BIO_set_mem_eof_return(b,v) \
BIO_ctrl(b,BIO_C_SET_BUF_MEM_EOF_RETURN,v,NULL)
/* For the BIO_f_buffer() type */
#define BIO_get_buffer_num_lines(b) BIO_ctrl(b,BIO_C_GET_BUFF_NUM_LINES,0,NULL)
#define BIO_set_buffer_size(b,size) BIO_ctrl(b,BIO_C_SET_BUFF_SIZE,size,NULL)
#define BIO_set_read_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,0)
#define BIO_set_write_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,1)
#define BIO_set_buffer_read_data(b,buf,num) BIO_ctrl(b,BIO_C_SET_BUFF_READ_DATA,num,buf)
/* Don't use the next one unless you know what you are doing :-) */
#define BIO_dup_state(b,ret) BIO_ctrl(b,BIO_CTRL_DUP,0,(char *)(ret))
#define BIO_reset(b) (int)BIO_ctrl(b,BIO_CTRL_RESET,0,NULL)
#define BIO_eof(b) (int)BIO_ctrl(b,BIO_CTRL_EOF,0,NULL)
#define BIO_set_close(b,c) (int)BIO_ctrl(b,BIO_CTRL_SET_CLOSE,(c),NULL)
#define BIO_get_close(b) (int)BIO_ctrl(b,BIO_CTRL_GET_CLOSE,0,NULL)
#define BIO_pending(b) (int)BIO_ctrl(b,BIO_CTRL_PENDING,0,NULL)
#define BIO_wpending(b) (int)BIO_ctrl(b,BIO_CTRL_WPENDING,0,NULL)
/* ...pending macros have inappropriate return type */
size_t BIO_ctrl_pending(BIO *b);
size_t BIO_ctrl_wpending(BIO *b);
#define BIO_flush(b) (int)BIO_ctrl(b,BIO_CTRL_FLUSH,0,NULL)
#define BIO_get_info_callback(b,cbp) (int)BIO_ctrl(b,BIO_CTRL_GET_CALLBACK,0, \
cbp)
#define BIO_set_info_callback(b,cb) (int)BIO_callback_ctrl(b,BIO_CTRL_SET_CALLBACK,cb)
/* For the BIO_f_buffer() type */
#define BIO_buffer_get_num_lines(b) BIO_ctrl(b,BIO_CTRL_GET,0,NULL)
/* For BIO_s_bio() */
#define BIO_set_write_buf_size(b,size) (int)BIO_ctrl(b,BIO_C_SET_WRITE_BUF_SIZE,size,NULL)
#define BIO_get_write_buf_size(b,size) (size_t)BIO_ctrl(b,BIO_C_GET_WRITE_BUF_SIZE,size,NULL)
#define BIO_make_bio_pair(b1,b2) (int)BIO_ctrl(b1,BIO_C_MAKE_BIO_PAIR,0,b2)
#define BIO_destroy_bio_pair(b) (int)BIO_ctrl(b,BIO_C_DESTROY_BIO_PAIR,0,NULL)
#define BIO_shutdown_wr(b) (int)BIO_ctrl(b, BIO_C_SHUTDOWN_WR, 0, NULL)
/* macros with inappropriate type -- but ...pending macros use int too: */
#define BIO_get_write_guarantee(b) (int)BIO_ctrl(b,BIO_C_GET_WRITE_GUARANTEE,0,NULL)
#define BIO_get_read_request(b) (int)BIO_ctrl(b,BIO_C_GET_READ_REQUEST,0,NULL)
size_t BIO_ctrl_get_write_guarantee(BIO *b);
size_t BIO_ctrl_get_read_request(BIO *b);
int BIO_ctrl_reset_read_request(BIO *b);
/* ctrl macros for dgram */
#define BIO_ctrl_dgram_connect(b,peer) \
(int)BIO_ctrl(b,BIO_CTRL_DGRAM_CONNECT,0, (char *)peer)
#define BIO_ctrl_set_connected(b, state, peer) \
(int)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_CONNECTED, state, (char *)peer)
#define BIO_dgram_recv_timedout(b) \
(int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP, 0, NULL)
#define BIO_dgram_send_timedout(b) \
(int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP, 0, NULL)
#define BIO_dgram_set_peer(b,peer) \
(int)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_PEER, 0, (char *)peer)
/* These two aren't currently implemented */
/* int BIO_get_ex_num(BIO *bio); */
/* void BIO_set_ex_free_func(BIO *bio,int idx,void (*cb)()); */
int BIO_set_ex_data(BIO *bio,int idx,void *data);
void *BIO_get_ex_data(BIO *bio,int idx);
int BIO_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
unsigned long BIO_number_read(BIO *bio);
unsigned long BIO_number_written(BIO *bio);
# ifndef OPENSSL_NO_FP_API
# if defined(OPENSSL_SYS_WIN16) && defined(_WINDLL)
BIO_METHOD *BIO_s_file_internal(void);
BIO *BIO_new_file_internal(char *filename, char *mode);
BIO *BIO_new_fp_internal(FILE *stream, int close_flag);
# define BIO_s_file BIO_s_file_internal
# define BIO_new_file BIO_new_file_internal
# define BIO_new_fp BIO_new_fp_internal
# else /* FP_API */
BIO_METHOD *BIO_s_file(void );
BIO *BIO_new_file(const char *filename, const char *mode);
BIO *BIO_new_fp(FILE *stream, int close_flag);
# define BIO_s_file_internal BIO_s_file
# define BIO_new_file_internal BIO_new_file
# define BIO_new_fp_internal BIO_s_file
# endif /* FP_API */
# endif
BIO * BIO_new(BIO_METHOD *type);
int BIO_set(BIO *a,BIO_METHOD *type);
int BIO_free(BIO *a);
void BIO_vfree(BIO *a);
int BIO_read(BIO *b, void *data, int len);
int BIO_gets(BIO *bp,char *buf, int size);
int BIO_write(BIO *b, const void *data, int len);
int BIO_puts(BIO *bp,const char *buf);
int BIO_indent(BIO *b,int indent,int max);
long BIO_ctrl(BIO *bp,int cmd,long larg,void *parg);
long BIO_callback_ctrl(BIO *b, int cmd, void (*fp)(struct bio_st *, int, const char *, int, long, long));
char * BIO_ptr_ctrl(BIO *bp,int cmd,long larg);
long BIO_int_ctrl(BIO *bp,int cmd,long larg,int iarg);
BIO * BIO_push(BIO *b,BIO *append);
BIO * BIO_pop(BIO *b);
void BIO_free_all(BIO *a);
BIO * BIO_find_type(BIO *b,int bio_type);
BIO * BIO_next(BIO *b);
BIO * BIO_get_retry_BIO(BIO *bio, int *reason);
int BIO_get_retry_reason(BIO *bio);
BIO * BIO_dup_chain(BIO *in);
int BIO_nread0(BIO *bio, char **buf);
int BIO_nread(BIO *bio, char **buf, int num);
int BIO_nwrite0(BIO *bio, char **buf);
int BIO_nwrite(BIO *bio, char **buf, int num);
#ifndef OPENSSL_SYS_WIN16
long BIO_debug_callback(BIO *bio,int cmd,const char *argp,int argi,
long argl,long ret);
#else
long _far _loadds BIO_debug_callback(BIO *bio,int cmd,const char *argp,int argi,
long argl,long ret);
#endif
BIO_METHOD *BIO_s_mem(void);
BIO *BIO_new_mem_buf(void *buf, int len);
BIO_METHOD *BIO_s_socket(void);
BIO_METHOD *BIO_s_connect(void);
BIO_METHOD *BIO_s_accept(void);
BIO_METHOD *BIO_s_fd(void);
#ifndef OPENSSL_SYS_OS2
BIO_METHOD *BIO_s_log(void);
#endif
BIO_METHOD *BIO_s_bio(void);
BIO_METHOD *BIO_s_null(void);
BIO_METHOD *BIO_f_null(void);
BIO_METHOD *BIO_f_buffer(void);
#ifdef OPENSSL_SYS_VMS
BIO_METHOD *BIO_f_linebuffer(void);
#endif
BIO_METHOD *BIO_f_nbio_test(void);
#ifndef OPENSSL_NO_DGRAM
BIO_METHOD *BIO_s_datagram(void);
#endif
/* BIO_METHOD *BIO_f_ber(void); */
int BIO_sock_should_retry(int i);
int BIO_sock_non_fatal_error(int error);
int BIO_dgram_non_fatal_error(int error);
int BIO_fd_should_retry(int i);
int BIO_fd_non_fatal_error(int error);
int BIO_dump_cb(int (*cb)(const void *data, size_t len, void *u),
void *u, const char *s, int len);
int BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u),
void *u, const char *s, int len, int indent);
int BIO_dump(BIO *b,const char *bytes,int len);
int BIO_dump_indent(BIO *b,const char *bytes,int len,int indent);
#ifndef OPENSSL_NO_FP_API
int BIO_dump_fp(FILE *fp, const char *s, int len);
int BIO_dump_indent_fp(FILE *fp, const char *s, int len, int indent);
#endif
struct hostent *BIO_gethostbyname(const char *name);
/* We might want a thread-safe interface too:
* struct hostent *BIO_gethostbyname_r(const char *name,
* struct hostent *result, void *buffer, size_t buflen);
* or something similar (caller allocates a struct hostent,
* pointed to by "result", and additional buffer space for the various
* substructures; if the buffer does not suffice, NULL is returned
* and an appropriate error code is set).
*/
int BIO_sock_error(int sock);
int BIO_socket_ioctl(int fd, long type, void *arg);
int BIO_socket_nbio(int fd,int mode);
int BIO_get_port(const char *str, unsigned short *port_ptr);
int BIO_get_host_ip(const char *str, unsigned char *ip);
int BIO_get_accept_socket(char *host_port,int mode);
int BIO_accept(int sock,char **ip_port);
int BIO_sock_init(void );
void BIO_sock_cleanup(void);
int BIO_set_tcp_ndelay(int sock,int turn_on);
BIO *BIO_new_socket(int sock, int close_flag);
BIO *BIO_new_dgram(int fd, int close_flag);
BIO *BIO_new_fd(int fd, int close_flag);
BIO *BIO_new_connect(char *host_port);
BIO *BIO_new_accept(char *host_port);
int BIO_new_bio_pair(BIO **bio1, size_t writebuf1,
BIO **bio2, size_t writebuf2);
/* If successful, returns 1 and in *bio1, *bio2 two BIO pair endpoints.
* Otherwise returns 0 and sets *bio1 and *bio2 to NULL.
* Size 0 uses default value.
*/
void BIO_copy_next_retry(BIO *b);
/*long BIO_ghbn_ctrl(int cmd,int iarg,char *parg);*/
#ifdef __GNUC__
# define __bio_h__attr__ __attribute__
#else
# define __bio_h__attr__(x)
#endif
int BIO_printf(BIO *bio, const char *format, ...)
__bio_h__attr__((__format__(__printf__,2,3)));
int BIO_vprintf(BIO *bio, const char *format, va_list args)
__bio_h__attr__((__format__(__printf__,2,0)));
int BIO_snprintf(char *buf, size_t n, const char *format, ...)
__bio_h__attr__((__format__(__printf__,3,4)));
int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args)
__bio_h__attr__((__format__(__printf__,3,0)));
#undef __bio_h__attr__
/* BEGIN ERROR CODES */
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
void ERR_load_BIO_strings(void);
/* Error codes for the BIO functions. */
/* Function codes. */
#define BIO_F_ACPT_STATE 100
#define BIO_F_BIO_ACCEPT 101
#define BIO_F_BIO_BER_GET_HEADER 102
#define BIO_F_BIO_CALLBACK_CTRL 131
#define BIO_F_BIO_CTRL 103
#define BIO_F_BIO_GETHOSTBYNAME 120
#define BIO_F_BIO_GETS 104
#define BIO_F_BIO_GET_ACCEPT_SOCKET 105
#define BIO_F_BIO_GET_HOST_IP 106
#define BIO_F_BIO_GET_PORT 107
#define BIO_F_BIO_MAKE_PAIR 121
#define BIO_F_BIO_NEW 108
#define BIO_F_BIO_NEW_FILE 109
#define BIO_F_BIO_NEW_MEM_BUF 126
#define BIO_F_BIO_NREAD 123
#define BIO_F_BIO_NREAD0 124
#define BIO_F_BIO_NWRITE 125
#define BIO_F_BIO_NWRITE0 122
#define BIO_F_BIO_PUTS 110
#define BIO_F_BIO_READ 111
#define BIO_F_BIO_SOCK_INIT 112
#define BIO_F_BIO_WRITE 113
#define BIO_F_BUFFER_CTRL 114
#define BIO_F_CONN_CTRL 127
#define BIO_F_CONN_STATE 115
#define BIO_F_FILE_CTRL 116
#define BIO_F_FILE_READ 130
#define BIO_F_LINEBUFFER_CTRL 129
#define BIO_F_MEM_READ 128
#define BIO_F_MEM_WRITE 117
#define BIO_F_SSL_NEW 118
#define BIO_F_WSASTARTUP 119
/* Reason codes. */
#define BIO_R_ACCEPT_ERROR 100
#define BIO_R_BAD_FOPEN_MODE 101
#define BIO_R_BAD_HOSTNAME_LOOKUP 102
#define BIO_R_BROKEN_PIPE 124
#define BIO_R_CONNECT_ERROR 103
#define BIO_R_EOF_ON_MEMORY_BIO 127
#define BIO_R_ERROR_SETTING_NBIO 104
#define BIO_R_ERROR_SETTING_NBIO_ON_ACCEPTED_SOCKET 105
#define BIO_R_ERROR_SETTING_NBIO_ON_ACCEPT_SOCKET 106
#define BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET 107
#define BIO_R_INVALID_ARGUMENT 125
#define BIO_R_INVALID_IP_ADDRESS 108
#define BIO_R_IN_USE 123
#define BIO_R_KEEPALIVE 109
#define BIO_R_NBIO_CONNECT_ERROR 110
#define BIO_R_NO_ACCEPT_PORT_SPECIFIED 111
#define BIO_R_NO_HOSTNAME_SPECIFIED 112
#define BIO_R_NO_PORT_DEFINED 113
#define BIO_R_NO_PORT_SPECIFIED 114
#define BIO_R_NO_SUCH_FILE 128
#define BIO_R_NULL_PARAMETER 115
#define BIO_R_TAG_MISMATCH 116
#define BIO_R_UNABLE_TO_BIND_SOCKET 117
#define BIO_R_UNABLE_TO_CREATE_SOCKET 118
#define BIO_R_UNABLE_TO_LISTEN_SOCKET 119
#define BIO_R_UNINITIALIZED 120
#define BIO_R_UNSUPPORTED_METHOD 121
#define BIO_R_WRITE_TO_READ_ONLY_BIO 126
#define BIO_R_WSASTARTUP 122
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,127 @@
/* crypto/bf/blowfish.h */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
#ifndef HEADER_BLOWFISH_H
#define HEADER_BLOWFISH_H
#include <openssl/e_os2.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef OPENSSL_NO_BF
#error BF is disabled.
#endif
#define BF_ENCRYPT 1
#define BF_DECRYPT 0
/*
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* ! BF_LONG has to be at least 32 bits wide. If it's wider, then !
* ! BF_LONG_LOG2 has to be defined along. !
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
*/
#if defined(OPENSSL_SYS_WIN16) || defined(__LP32__)
#define BF_LONG unsigned long
#elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__)
#define BF_LONG unsigned long
#define BF_LONG_LOG2 3
/*
* _CRAY note. I could declare short, but I have no idea what impact
* does it have on performance on none-T3E machines. I could declare
* int, but at least on C90 sizeof(int) can be chosen at compile time.
* So I've chosen long...
* <appro@fy.chalmers.se>
*/
#else
#define BF_LONG unsigned int
#endif
#define BF_ROUNDS 16
#define BF_BLOCK 8
typedef struct bf_key_st
{
BF_LONG P[BF_ROUNDS+2];
BF_LONG S[4*256];
} BF_KEY;
void BF_set_key(BF_KEY *key, int len, const unsigned char *data);
void BF_encrypt(BF_LONG *data,const BF_KEY *key);
void BF_decrypt(BF_LONG *data,const BF_KEY *key);
void BF_ecb_encrypt(const unsigned char *in, unsigned char *out,
const BF_KEY *key, int enc);
void BF_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,
const BF_KEY *schedule, unsigned char *ivec, int enc);
void BF_cfb64_encrypt(const unsigned char *in, unsigned char *out, long length,
const BF_KEY *schedule, unsigned char *ivec, int *num, int enc);
void BF_ofb64_encrypt(const unsigned char *in, unsigned char *out, long length,
const BF_KEY *schedule, unsigned char *ivec, int *num);
const char *BF_options(void);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,827 @@
/* crypto/bn/bn.h */
/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
/* ====================================================================
* Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
*
* Portions of the attached software ("Contribution") are developed by
* SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project.
*
* The Contribution is licensed pursuant to the Eric Young open source
* license provided above.
*
* The binary polynomial arithmetic software is originally written by
* Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems Laboratories.
*
*/
#ifndef HEADER_BN_H
#define HEADER_BN_H
#include <openssl/e_os2.h>
#ifndef OPENSSL_NO_FP_API
#include <stdio.h> /* FILE */
#endif
#include <openssl/ossl_typ.h>
#ifdef __cplusplus
extern "C" {
#endif
/* These preprocessor symbols control various aspects of the bignum headers and
* library code. They're not defined by any "normal" configuration, as they are
* intended for development and testing purposes. NB: defining all three can be
* useful for debugging application code as well as openssl itself.
*
* BN_DEBUG - turn on various debugging alterations to the bignum code
* BN_DEBUG_RAND - uses random poisoning of unused words to trip up
* mismanagement of bignum internals. You must also define BN_DEBUG.
*/
/* #define BN_DEBUG */
/* #define BN_DEBUG_RAND */
#define BN_MUL_COMBA
#define BN_SQR_COMBA
#define BN_RECURSION
/* This next option uses the C libraries (2 word)/(1 word) function.
* If it is not defined, I use my C version (which is slower).
* The reason for this flag is that when the particular C compiler
* library routine is used, and the library is linked with a different
* compiler, the library is missing. This mostly happens when the
* library is built with gcc and then linked using normal cc. This would
* be a common occurrence because gcc normally produces code that is
* 2 times faster than system compilers for the big number stuff.
* For machines with only one compiler (or shared libraries), this should
* be on. Again this in only really a problem on machines
* using "long long's", are 32bit, and are not using my assembler code. */
#if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WINDOWS) || \
defined(OPENSSL_SYS_WIN32) || defined(linux)
# ifndef BN_DIV2W
# define BN_DIV2W
# endif
#endif
/* assuming long is 64bit - this is the DEC Alpha
* unsigned long long is only 64 bits :-(, don't define
* BN_LLONG for the DEC Alpha */
#ifdef SIXTY_FOUR_BIT_LONG
#define BN_ULLONG unsigned long long
#define BN_ULONG unsigned long
#define BN_LONG long
#define BN_BITS 128
#define BN_BYTES 8
#define BN_BITS2 64
#define BN_BITS4 32
#define BN_MASK (0xffffffffffffffffffffffffffffffffLL)
#define BN_MASK2 (0xffffffffffffffffL)
#define BN_MASK2l (0xffffffffL)
#define BN_MASK2h (0xffffffff00000000L)
#define BN_MASK2h1 (0xffffffff80000000L)
#define BN_TBIT (0x8000000000000000L)
#define BN_DEC_CONV (10000000000000000000UL)
#define BN_DEC_FMT1 "%lu"
#define BN_DEC_FMT2 "%019lu"
#define BN_DEC_NUM 19
#endif
/* This is where the long long data type is 64 bits, but long is 32.
* For machines where there are 64bit registers, this is the mode to use.
* IRIX, on R4000 and above should use this mode, along with the relevant
* assembler code :-). Do NOT define BN_LLONG.
*/
#ifdef SIXTY_FOUR_BIT
#undef BN_LLONG
#undef BN_ULLONG
#define BN_ULONG unsigned long long
#define BN_LONG long long
#define BN_BITS 128
#define BN_BYTES 8
#define BN_BITS2 64
#define BN_BITS4 32
#define BN_MASK2 (0xffffffffffffffffLL)
#define BN_MASK2l (0xffffffffL)
#define BN_MASK2h (0xffffffff00000000LL)
#define BN_MASK2h1 (0xffffffff80000000LL)
#define BN_TBIT (0x8000000000000000LL)
#define BN_DEC_CONV (10000000000000000000ULL)
#define BN_DEC_FMT1 "%llu"
#define BN_DEC_FMT2 "%019llu"
#define BN_DEC_NUM 19
#endif
#ifdef THIRTY_TWO_BIT
#ifdef BN_LLONG
# if defined(OPENSSL_SYS_WIN32) && !defined(__GNUC__)
# define BN_ULLONG unsigned __int64
# else
# define BN_ULLONG unsigned long long
# endif
#endif
#define BN_ULONG unsigned long
#define BN_LONG long
#define BN_BITS 64
#define BN_BYTES 4
#define BN_BITS2 32
#define BN_BITS4 16
#ifdef OPENSSL_SYS_WIN32
/* VC++ doesn't like the LL suffix */
#define BN_MASK (0xffffffffffffffffL)
#else
#define BN_MASK (0xffffffffffffffffLL)
#endif
#define BN_MASK2 (0xffffffffL)
#define BN_MASK2l (0xffff)
#define BN_MASK2h1 (0xffff8000L)
#define BN_MASK2h (0xffff0000L)
#define BN_TBIT (0x80000000L)
#define BN_DEC_CONV (1000000000L)
#define BN_DEC_FMT1 "%lu"
#define BN_DEC_FMT2 "%09lu"
#define BN_DEC_NUM 9
#endif
#ifdef SIXTEEN_BIT
#ifndef BN_DIV2W
#define BN_DIV2W
#endif
#define BN_ULLONG unsigned long
#define BN_ULONG unsigned short
#define BN_LONG short
#define BN_BITS 32
#define BN_BYTES 2
#define BN_BITS2 16
#define BN_BITS4 8
#define BN_MASK (0xffffffff)
#define BN_MASK2 (0xffff)
#define BN_MASK2l (0xff)
#define BN_MASK2h1 (0xff80)
#define BN_MASK2h (0xff00)
#define BN_TBIT (0x8000)
#define BN_DEC_CONV (100000)
#define BN_DEC_FMT1 "%u"
#define BN_DEC_FMT2 "%05u"
#define BN_DEC_NUM 5
#endif
#ifdef EIGHT_BIT
#ifndef BN_DIV2W
#define BN_DIV2W
#endif
#define BN_ULLONG unsigned short
#define BN_ULONG unsigned char
#define BN_LONG char
#define BN_BITS 16
#define BN_BYTES 1
#define BN_BITS2 8
#define BN_BITS4 4
#define BN_MASK (0xffff)
#define BN_MASK2 (0xff)
#define BN_MASK2l (0xf)
#define BN_MASK2h1 (0xf8)
#define BN_MASK2h (0xf0)
#define BN_TBIT (0x80)
#define BN_DEC_CONV (100)
#define BN_DEC_FMT1 "%u"
#define BN_DEC_FMT2 "%02u"
#define BN_DEC_NUM 2
#endif
#define BN_DEFAULT_BITS 1280
#define BN_FLG_MALLOCED 0x01
#define BN_FLG_STATIC_DATA 0x02
#define BN_FLG_EXP_CONSTTIME 0x04 /* avoid leaking exponent information through timings
* (BN_mod_exp_mont() will call BN_mod_exp_mont_consttime) */
#ifndef OPENSSL_NO_DEPRECATED
#define BN_FLG_FREE 0x8000 /* used for debuging */
#endif
#define BN_set_flags(b,n) ((b)->flags|=(n))
#define BN_get_flags(b,n) ((b)->flags&(n))
/* get a clone of a BIGNUM with changed flags, for *temporary* use only
* (the two BIGNUMs cannot not be used in parallel!) */
#define BN_with_flags(dest,b,n) ((dest)->d=(b)->d, \
(dest)->top=(b)->top, \
(dest)->dmax=(b)->dmax, \
(dest)->neg=(b)->neg, \
(dest)->flags=(((dest)->flags & BN_FLG_MALLOCED) \
| ((b)->flags & ~BN_FLG_MALLOCED) \
| BN_FLG_STATIC_DATA \
| (n)))
/* Already declared in ossl_typ.h */
#if 0
typedef struct bignum_st BIGNUM;
/* Used for temp variables (declaration hidden in bn_lcl.h) */
typedef struct bignum_ctx BN_CTX;
typedef struct bn_blinding_st BN_BLINDING;
typedef struct bn_mont_ctx_st BN_MONT_CTX;
typedef struct bn_recp_ctx_st BN_RECP_CTX;
typedef struct bn_gencb_st BN_GENCB;
#endif
struct bignum_st
{
BN_ULONG *d; /* Pointer to an array of 'BN_BITS2' bit chunks. */
int top; /* Index of last used d +1. */
/* The next are internal book keeping for bn_expand. */
int dmax; /* Size of the d array. */
int neg; /* one if the number is negative */
int flags;
};
/* Used for montgomery multiplication */
struct bn_mont_ctx_st
{
int ri; /* number of bits in R */
BIGNUM RR; /* used to convert to montgomery form */
BIGNUM N; /* The modulus */
BIGNUM Ni; /* R*(1/R mod N) - N*Ni = 1
* (Ni is only stored for bignum algorithm) */
BN_ULONG n0; /* least significant word of Ni */
int flags;
};
/* Used for reciprocal division/mod functions
* It cannot be shared between threads
*/
struct bn_recp_ctx_st
{
BIGNUM N; /* the divisor */
BIGNUM Nr; /* the reciprocal */
int num_bits;
int shift;
int flags;
};
/* Used for slow "generation" functions. */
struct bn_gencb_st
{
unsigned int ver; /* To handle binary (in)compatibility */
void *arg; /* callback-specific data */
union
{
/* if(ver==1) - handles old style callbacks */
void (*cb_1)(int, int, void *);
/* if(ver==2) - new callback style */
int (*cb_2)(int, int, BN_GENCB *);
} cb;
};
/* Wrapper function to make using BN_GENCB easier, */
int BN_GENCB_call(BN_GENCB *cb, int a, int b);
/* Macro to populate a BN_GENCB structure with an "old"-style callback */
#define BN_GENCB_set_old(gencb, callback, cb_arg) { \
BN_GENCB *tmp_gencb = (gencb); \
tmp_gencb->ver = 1; \
tmp_gencb->arg = (cb_arg); \
tmp_gencb->cb.cb_1 = (callback); }
/* Macro to populate a BN_GENCB structure with a "new"-style callback */
#define BN_GENCB_set(gencb, callback, cb_arg) { \
BN_GENCB *tmp_gencb = (gencb); \
tmp_gencb->ver = 2; \
tmp_gencb->arg = (cb_arg); \
tmp_gencb->cb.cb_2 = (callback); }
#define BN_prime_checks 0 /* default: select number of iterations
based on the size of the number */
/* number of Miller-Rabin iterations for an error rate of less than 2^-80
* for random 'b'-bit input, b >= 100 (taken from table 4.4 in the Handbook
* of Applied Cryptography [Menezes, van Oorschot, Vanstone; CRC Press 1996];
* original paper: Damgaard, Landrock, Pomerance: Average case error estimates
* for the strong probable prime test. -- Math. Comp. 61 (1993) 177-194) */
#define BN_prime_checks_for_size(b) ((b) >= 1300 ? 2 : \
(b) >= 850 ? 3 : \
(b) >= 650 ? 4 : \
(b) >= 550 ? 5 : \
(b) >= 450 ? 6 : \
(b) >= 400 ? 7 : \
(b) >= 350 ? 8 : \
(b) >= 300 ? 9 : \
(b) >= 250 ? 12 : \
(b) >= 200 ? 15 : \
(b) >= 150 ? 18 : \
/* b >= 100 */ 27)
#define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
/* Note that BN_abs_is_word didn't work reliably for w == 0 until 0.9.8 */
#define BN_abs_is_word(a,w) ((((a)->top == 1) && ((a)->d[0] == (BN_ULONG)(w))) || \
(((w) == 0) && ((a)->top == 0)))
#define BN_is_zero(a) ((a)->top == 0)
#define BN_is_one(a) (BN_abs_is_word((a),1) && !(a)->neg)
#define BN_is_word(a,w) (BN_abs_is_word((a),(w)) && (!(w) || !(a)->neg))
#define BN_is_odd(a) (((a)->top > 0) && ((a)->d[0] & 1))
#define BN_one(a) (BN_set_word((a),1))
#define BN_zero_ex(a) \
do { \
BIGNUM *_tmp_bn = (a); \
_tmp_bn->top = 0; \
_tmp_bn->neg = 0; \
} while(0)
#ifdef OPENSSL_NO_DEPRECATED
#define BN_zero(a) BN_zero_ex(a)
#else
#define BN_zero(a) (BN_set_word((a),0))
#endif
const BIGNUM *BN_value_one(void);
char * BN_options(void);
BN_CTX *BN_CTX_new(void);
#ifndef OPENSSL_NO_DEPRECATED
void BN_CTX_init(BN_CTX *c);
#endif
void BN_CTX_free(BN_CTX *c);
void BN_CTX_start(BN_CTX *ctx);
BIGNUM *BN_CTX_get(BN_CTX *ctx);
void BN_CTX_end(BN_CTX *ctx);
int BN_rand(BIGNUM *rnd, int bits, int top,int bottom);
int BN_pseudo_rand(BIGNUM *rnd, int bits, int top,int bottom);
int BN_rand_range(BIGNUM *rnd, BIGNUM *range);
int BN_pseudo_rand_range(BIGNUM *rnd, BIGNUM *range);
int BN_num_bits(const BIGNUM *a);
int BN_num_bits_word(BN_ULONG);
BIGNUM *BN_new(void);
void BN_init(BIGNUM *);
void BN_clear_free(BIGNUM *a);
BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b);
void BN_swap(BIGNUM *a, BIGNUM *b);
BIGNUM *BN_bin2bn(const unsigned char *s,int len,BIGNUM *ret);
int BN_bn2bin(const BIGNUM *a, unsigned char *to);
BIGNUM *BN_mpi2bn(const unsigned char *s,int len,BIGNUM *ret);
int BN_bn2mpi(const BIGNUM *a, unsigned char *to);
int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
int BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
int BN_sqr(BIGNUM *r, const BIGNUM *a,BN_CTX *ctx);
/** BN_set_negative sets sign of a BIGNUM
* \param b pointer to the BIGNUM object
* \param n 0 if the BIGNUM b should be positive and a value != 0 otherwise
*/
void BN_set_negative(BIGNUM *b, int n);
/** BN_is_negative returns 1 if the BIGNUM is negative
* \param a pointer to the BIGNUM object
* \return 1 if a < 0 and 0 otherwise
*/
#define BN_is_negative(a) ((a)->neg != 0)
int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d,
BN_CTX *ctx);
#define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx);
int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx);
int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m);
int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx);
int BN_mod_sub_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m);
int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
const BIGNUM *m, BN_CTX *ctx);
int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);
int BN_mod_lshift1(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);
int BN_mod_lshift1_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *m);
int BN_mod_lshift(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m, BN_CTX *ctx);
int BN_mod_lshift_quick(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m);
BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w);
BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w);
int BN_mul_word(BIGNUM *a, BN_ULONG w);
int BN_add_word(BIGNUM *a, BN_ULONG w);
int BN_sub_word(BIGNUM *a, BN_ULONG w);
int BN_set_word(BIGNUM *a, BN_ULONG w);
BN_ULONG BN_get_word(const BIGNUM *a);
int BN_cmp(const BIGNUM *a, const BIGNUM *b);
void BN_free(BIGNUM *a);
int BN_is_bit_set(const BIGNUM *a, int n);
int BN_lshift(BIGNUM *r, const BIGNUM *a, int n);
int BN_lshift1(BIGNUM *r, const BIGNUM *a);
int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,BN_CTX *ctx);
int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
const BIGNUM *m,BN_CTX *ctx);
int BN_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont);
int BN_mod_exp_mont_word(BIGNUM *r, BN_ULONG a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
int BN_mod_exp2_mont(BIGNUM *r, const BIGNUM *a1, const BIGNUM *p1,
const BIGNUM *a2, const BIGNUM *p2,const BIGNUM *m,
BN_CTX *ctx,BN_MONT_CTX *m_ctx);
int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
const BIGNUM *m,BN_CTX *ctx);
int BN_mask_bits(BIGNUM *a,int n);
#ifndef OPENSSL_NO_FP_API
int BN_print_fp(FILE *fp, const BIGNUM *a);
#endif
#ifdef HEADER_BIO_H
int BN_print(BIO *fp, const BIGNUM *a);
#else
int BN_print(void *fp, const BIGNUM *a);
#endif
int BN_reciprocal(BIGNUM *r, const BIGNUM *m, int len, BN_CTX *ctx);
int BN_rshift(BIGNUM *r, const BIGNUM *a, int n);
int BN_rshift1(BIGNUM *r, const BIGNUM *a);
void BN_clear(BIGNUM *a);
BIGNUM *BN_dup(const BIGNUM *a);
int BN_ucmp(const BIGNUM *a, const BIGNUM *b);
int BN_set_bit(BIGNUM *a, int n);
int BN_clear_bit(BIGNUM *a, int n);
char * BN_bn2hex(const BIGNUM *a);
char * BN_bn2dec(const BIGNUM *a);
int BN_hex2bn(BIGNUM **a, const char *str);
int BN_dec2bn(BIGNUM **a, const char *str);
int BN_gcd(BIGNUM *r,const BIGNUM *a,const BIGNUM *b,BN_CTX *ctx);
int BN_kronecker(const BIGNUM *a,const BIGNUM *b,BN_CTX *ctx); /* returns -2 for error */
BIGNUM *BN_mod_inverse(BIGNUM *ret,
const BIGNUM *a, const BIGNUM *n,BN_CTX *ctx);
BIGNUM *BN_mod_sqrt(BIGNUM *ret,
const BIGNUM *a, const BIGNUM *n,BN_CTX *ctx);
/* Deprecated versions */
#ifndef OPENSSL_NO_DEPRECATED
BIGNUM *BN_generate_prime(BIGNUM *ret,int bits,int safe,
const BIGNUM *add, const BIGNUM *rem,
void (*callback)(int,int,void *),void *cb_arg);
int BN_is_prime(const BIGNUM *p,int nchecks,
void (*callback)(int,int,void *),
BN_CTX *ctx,void *cb_arg);
int BN_is_prime_fasttest(const BIGNUM *p,int nchecks,
void (*callback)(int,int,void *),BN_CTX *ctx,void *cb_arg,
int do_trial_division);
#endif /* !defined(OPENSSL_NO_DEPRECATED) */
/* Newer versions */
int BN_generate_prime_ex(BIGNUM *ret,int bits,int safe, const BIGNUM *add,
const BIGNUM *rem, BN_GENCB *cb);
int BN_is_prime_ex(const BIGNUM *p,int nchecks, BN_CTX *ctx, BN_GENCB *cb);
int BN_is_prime_fasttest_ex(const BIGNUM *p,int nchecks, BN_CTX *ctx,
int do_trial_division, BN_GENCB *cb);
BN_MONT_CTX *BN_MONT_CTX_new(void );
void BN_MONT_CTX_init(BN_MONT_CTX *ctx);
int BN_mod_mul_montgomery(BIGNUM *r,const BIGNUM *a,const BIGNUM *b,
BN_MONT_CTX *mont, BN_CTX *ctx);
#define BN_to_montgomery(r,a,mont,ctx) BN_mod_mul_montgomery(\
(r),(a),&((mont)->RR),(mont),(ctx))
int BN_from_montgomery(BIGNUM *r,const BIGNUM *a,
BN_MONT_CTX *mont, BN_CTX *ctx);
void BN_MONT_CTX_free(BN_MONT_CTX *mont);
int BN_MONT_CTX_set(BN_MONT_CTX *mont,const BIGNUM *mod,BN_CTX *ctx);
BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to,BN_MONT_CTX *from);
BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, int lock,
const BIGNUM *mod, BN_CTX *ctx);
/* BN_BLINDING flags */
#define BN_BLINDING_NO_UPDATE 0x00000001
#define BN_BLINDING_NO_RECREATE 0x00000002
BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, BIGNUM *mod);
void BN_BLINDING_free(BN_BLINDING *b);
int BN_BLINDING_update(BN_BLINDING *b,BN_CTX *ctx);
int BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx);
int BN_BLINDING_invert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx);
int BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BLINDING *b, BN_CTX *);
int BN_BLINDING_invert_ex(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b, BN_CTX *);
unsigned long BN_BLINDING_get_thread_id(const BN_BLINDING *);
void BN_BLINDING_set_thread_id(BN_BLINDING *, unsigned long);
unsigned long BN_BLINDING_get_flags(const BN_BLINDING *);
void BN_BLINDING_set_flags(BN_BLINDING *, unsigned long);
BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b,
const BIGNUM *e, BIGNUM *m, BN_CTX *ctx,
int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx),
BN_MONT_CTX *m_ctx);
#ifndef OPENSSL_NO_DEPRECATED
void BN_set_params(int mul,int high,int low,int mont);
int BN_get_params(int which); /* 0, mul, 1 high, 2 low, 3 mont */
#endif
void BN_RECP_CTX_init(BN_RECP_CTX *recp);
BN_RECP_CTX *BN_RECP_CTX_new(void);
void BN_RECP_CTX_free(BN_RECP_CTX *recp);
int BN_RECP_CTX_set(BN_RECP_CTX *recp,const BIGNUM *rdiv,BN_CTX *ctx);
int BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y,
BN_RECP_CTX *recp,BN_CTX *ctx);
int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx);
int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m,
BN_RECP_CTX *recp, BN_CTX *ctx);
/* Functions for arithmetic over binary polynomials represented by BIGNUMs.
*
* The BIGNUM::neg property of BIGNUMs representing binary polynomials is
* ignored.
*
* Note that input arguments are not const so that their bit arrays can
* be expanded to the appropriate size if needed.
*/
int BN_GF2m_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); /*r = a + b*/
#define BN_GF2m_sub(r, a, b) BN_GF2m_add(r, a, b)
int BN_GF2m_mod(BIGNUM *r, const BIGNUM *a, const BIGNUM *p); /*r=a mod p*/
int BN_GF2m_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
const BIGNUM *p, BN_CTX *ctx); /* r = (a * b) mod p */
int BN_GF2m_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
BN_CTX *ctx); /* r = (a * a) mod p */
int BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *b, const BIGNUM *p,
BN_CTX *ctx); /* r = (1 / b) mod p */
int BN_GF2m_mod_div(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
const BIGNUM *p, BN_CTX *ctx); /* r = (a / b) mod p */
int BN_GF2m_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
const BIGNUM *p, BN_CTX *ctx); /* r = (a ^ b) mod p */
int BN_GF2m_mod_sqrt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
BN_CTX *ctx); /* r = sqrt(a) mod p */
int BN_GF2m_mod_solve_quad(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
BN_CTX *ctx); /* r^2 + r = a mod p */
#define BN_GF2m_cmp(a, b) BN_ucmp((a), (b))
/* Some functions allow for representation of the irreducible polynomials
* as an unsigned int[], say p. The irreducible f(t) is then of the form:
* t^p[0] + t^p[1] + ... + t^p[k]
* where m = p[0] > p[1] > ... > p[k] = 0.
*/
int BN_GF2m_mod_arr(BIGNUM *r, const BIGNUM *a, const unsigned int p[]);
/* r = a mod p */
int BN_GF2m_mod_mul_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
const unsigned int p[], BN_CTX *ctx); /* r = (a * b) mod p */
int BN_GF2m_mod_sqr_arr(BIGNUM *r, const BIGNUM *a, const unsigned int p[],
BN_CTX *ctx); /* r = (a * a) mod p */
int BN_GF2m_mod_inv_arr(BIGNUM *r, const BIGNUM *b, const unsigned int p[],
BN_CTX *ctx); /* r = (1 / b) mod p */
int BN_GF2m_mod_div_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
const unsigned int p[], BN_CTX *ctx); /* r = (a / b) mod p */
int BN_GF2m_mod_exp_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
const unsigned int p[], BN_CTX *ctx); /* r = (a ^ b) mod p */
int BN_GF2m_mod_sqrt_arr(BIGNUM *r, const BIGNUM *a,
const unsigned int p[], BN_CTX *ctx); /* r = sqrt(a) mod p */
int BN_GF2m_mod_solve_quad_arr(BIGNUM *r, const BIGNUM *a,
const unsigned int p[], BN_CTX *ctx); /* r^2 + r = a mod p */
int BN_GF2m_poly2arr(const BIGNUM *a, unsigned int p[], int max);
int BN_GF2m_arr2poly(const unsigned int p[], BIGNUM *a);
/* faster mod functions for the 'NIST primes'
* 0 <= a < p^2 */
int BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
int BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
int BN_nist_mod_256(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
int BN_nist_mod_384(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
int BN_nist_mod_521(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
const BIGNUM *BN_get0_nist_prime_192(void);
const BIGNUM *BN_get0_nist_prime_224(void);
const BIGNUM *BN_get0_nist_prime_256(void);
const BIGNUM *BN_get0_nist_prime_384(void);
const BIGNUM *BN_get0_nist_prime_521(void);
/* library internal functions */
#define bn_expand(a,bits) ((((((bits+BN_BITS2-1))/BN_BITS2)) <= (a)->dmax)?\
(a):bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2))
#define bn_wexpand(a,words) (((words) <= (a)->dmax)?(a):bn_expand2((a),(words)))
BIGNUM *bn_expand2(BIGNUM *a, int words);
#ifndef OPENSSL_NO_DEPRECATED
BIGNUM *bn_dup_expand(const BIGNUM *a, int words); /* unused */
#endif
/* Bignum consistency macros
* There is one "API" macro, bn_fix_top(), for stripping leading zeroes from
* bignum data after direct manipulations on the data. There is also an
* "internal" macro, bn_check_top(), for verifying that there are no leading
* zeroes. Unfortunately, some auditing is required due to the fact that
* bn_fix_top() has become an overabused duct-tape because bignum data is
* occasionally passed around in an inconsistent state. So the following
* changes have been made to sort this out;
* - bn_fix_top()s implementation has been moved to bn_correct_top()
* - if BN_DEBUG isn't defined, bn_fix_top() maps to bn_correct_top(), and
* bn_check_top() is as before.
* - if BN_DEBUG *is* defined;
* - bn_check_top() tries to pollute unused words even if the bignum 'top' is
* consistent. (ed: only if BN_DEBUG_RAND is defined)
* - bn_fix_top() maps to bn_check_top() rather than "fixing" anything.
* The idea is to have debug builds flag up inconsistent bignums when they
* occur. If that occurs in a bn_fix_top(), we examine the code in question; if
* the use of bn_fix_top() was appropriate (ie. it follows directly after code
* that manipulates the bignum) it is converted to bn_correct_top(), and if it
* was not appropriate, we convert it permanently to bn_check_top() and track
* down the cause of the bug. Eventually, no internal code should be using the
* bn_fix_top() macro. External applications and libraries should try this with
* their own code too, both in terms of building against the openssl headers
* with BN_DEBUG defined *and* linking with a version of OpenSSL built with it
* defined. This not only improves external code, it provides more test
* coverage for openssl's own code.
*/
#ifdef BN_DEBUG
/* We only need assert() when debugging */
#include <assert.h>
#ifdef BN_DEBUG_RAND
/* To avoid "make update" cvs wars due to BN_DEBUG, use some tricks */
#ifndef RAND_pseudo_bytes
int RAND_pseudo_bytes(unsigned char *buf,int num);
#define BN_DEBUG_TRIX
#endif
#define bn_pollute(a) \
do { \
const BIGNUM *_bnum1 = (a); \
if(_bnum1->top < _bnum1->dmax) { \
unsigned char _tmp_char; \
/* We cast away const without the compiler knowing, any \
* *genuinely* constant variables that aren't mutable \
* wouldn't be constructed with top!=dmax. */ \
BN_ULONG *_not_const; \
memcpy(&_not_const, &_bnum1->d, sizeof(BN_ULONG*)); \
RAND_pseudo_bytes(&_tmp_char, 1); \
memset((unsigned char *)(_not_const + _bnum1->top), _tmp_char, \
(_bnum1->dmax - _bnum1->top) * sizeof(BN_ULONG)); \
} \
} while(0)
#ifdef BN_DEBUG_TRIX
#undef RAND_pseudo_bytes
#endif
#else
#define bn_pollute(a)
#endif
#define bn_check_top(a) \
do { \
const BIGNUM *_bnum2 = (a); \
if (_bnum2 != NULL) { \
assert((_bnum2->top == 0) || \
(_bnum2->d[_bnum2->top - 1] != 0)); \
bn_pollute(_bnum2); \
} \
} while(0)
#define bn_fix_top(a) bn_check_top(a)
#else /* !BN_DEBUG */
#define bn_pollute(a)
#define bn_check_top(a)
#define bn_fix_top(a) bn_correct_top(a)
#endif
#define bn_correct_top(a) \
{ \
BN_ULONG *ftl; \
if ((a)->top > 0) \
{ \
for (ftl= &((a)->d[(a)->top-1]); (a)->top > 0; (a)->top--) \
if (*(ftl--)) break; \
} \
bn_pollute(a); \
}
BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, int num, BN_ULONG w);
BN_ULONG bn_mul_words(BN_ULONG *rp, const BN_ULONG *ap, int num, BN_ULONG w);
void bn_sqr_words(BN_ULONG *rp, const BN_ULONG *ap, int num);
BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d);
BN_ULONG bn_add_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,int num);
BN_ULONG bn_sub_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,int num);
/* Primes from RFC 2409 */
BIGNUM *get_rfc2409_prime_768(BIGNUM *bn);
BIGNUM *get_rfc2409_prime_1024(BIGNUM *bn);
/* Primes from RFC 3526 */
BIGNUM *get_rfc3526_prime_1536(BIGNUM *bn);
BIGNUM *get_rfc3526_prime_2048(BIGNUM *bn);
BIGNUM *get_rfc3526_prime_3072(BIGNUM *bn);
BIGNUM *get_rfc3526_prime_4096(BIGNUM *bn);
BIGNUM *get_rfc3526_prime_6144(BIGNUM *bn);
BIGNUM *get_rfc3526_prime_8192(BIGNUM *bn);
int BN_bntest_rand(BIGNUM *rnd, int bits, int top,int bottom);
/* BEGIN ERROR CODES */
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
void ERR_load_BN_strings(void);
/* Error codes for the BN functions. */
/* Function codes. */
#define BN_F_BNRAND 127
#define BN_F_BN_BLINDING_CONVERT_EX 100
#define BN_F_BN_BLINDING_CREATE_PARAM 128
#define BN_F_BN_BLINDING_INVERT_EX 101
#define BN_F_BN_BLINDING_NEW 102
#define BN_F_BN_BLINDING_UPDATE 103
#define BN_F_BN_BN2DEC 104
#define BN_F_BN_BN2HEX 105
#define BN_F_BN_CTX_GET 116
#define BN_F_BN_CTX_NEW 106
#define BN_F_BN_CTX_START 129
#define BN_F_BN_DIV 107
#define BN_F_BN_DIV_RECP 130
#define BN_F_BN_EXP 123
#define BN_F_BN_EXPAND2 108
#define BN_F_BN_EXPAND_INTERNAL 120
#define BN_F_BN_GF2M_MOD 131
#define BN_F_BN_GF2M_MOD_EXP 132
#define BN_F_BN_GF2M_MOD_MUL 133
#define BN_F_BN_GF2M_MOD_SOLVE_QUAD 134
#define BN_F_BN_GF2M_MOD_SOLVE_QUAD_ARR 135
#define BN_F_BN_GF2M_MOD_SQR 136
#define BN_F_BN_GF2M_MOD_SQRT 137
#define BN_F_BN_MOD_EXP2_MONT 118
#define BN_F_BN_MOD_EXP_MONT 109
#define BN_F_BN_MOD_EXP_MONT_CONSTTIME 124
#define BN_F_BN_MOD_EXP_MONT_WORD 117
#define BN_F_BN_MOD_EXP_RECP 125
#define BN_F_BN_MOD_EXP_SIMPLE 126
#define BN_F_BN_MOD_INVERSE 110
#define BN_F_BN_MOD_LSHIFT_QUICK 119
#define BN_F_BN_MOD_MUL_RECIPROCAL 111
#define BN_F_BN_MOD_SQRT 121
#define BN_F_BN_MPI2BN 112
#define BN_F_BN_NEW 113
#define BN_F_BN_RAND 114
#define BN_F_BN_RAND_RANGE 122
#define BN_F_BN_USUB 115
/* Reason codes. */
#define BN_R_ARG2_LT_ARG3 100
#define BN_R_BAD_RECIPROCAL 101
#define BN_R_BIGNUM_TOO_LONG 114
#define BN_R_CALLED_WITH_EVEN_MODULUS 102
#define BN_R_DIV_BY_ZERO 103
#define BN_R_ENCODING_ERROR 104
#define BN_R_EXPAND_ON_STATIC_BIGNUM_DATA 105
#define BN_R_INPUT_NOT_REDUCED 110
#define BN_R_INVALID_LENGTH 106
#define BN_R_INVALID_RANGE 115
#define BN_R_NOT_A_SQUARE 111
#define BN_R_NOT_INITIALIZED 107
#define BN_R_NO_INVERSE 108
#define BN_R_NO_SOLUTION 116
#define BN_R_P_IS_NOT_PRIME 112
#define BN_R_TOO_MANY_ITERATIONS 113
#define BN_R_TOO_MANY_TEMPORARY_VARIABLES 109
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,118 @@
/* crypto/buffer/buffer.h */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
#ifndef HEADER_BUFFER_H
#define HEADER_BUFFER_H
#include <openssl/ossl_typ.h>
#ifdef __cplusplus
extern "C" {
#endif
#include <stddef.h>
#if !defined(NO_SYS_TYPES_H)
#include <sys/types.h>
#endif
/* Already declared in ossl_typ.h */
/* typedef struct buf_mem_st BUF_MEM; */
struct buf_mem_st
{
int length; /* current number of bytes */
char *data;
int max; /* size of buffer */
};
BUF_MEM *BUF_MEM_new(void);
void BUF_MEM_free(BUF_MEM *a);
int BUF_MEM_grow(BUF_MEM *str, int len);
int BUF_MEM_grow_clean(BUF_MEM *str, int len);
char * BUF_strdup(const char *str);
char * BUF_strndup(const char *str, size_t siz);
void * BUF_memdup(const void *data, size_t siz);
/* safe string functions */
size_t BUF_strlcpy(char *dst,const char *src,size_t siz);
size_t BUF_strlcat(char *dst,const char *src,size_t siz);
/* BEGIN ERROR CODES */
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
void ERR_load_BUF_strings(void);
/* Error codes for the BUF functions. */
/* Function codes. */
#define BUF_F_BUF_MEMDUP 103
#define BUF_F_BUF_MEM_GROW 100
#define BUF_F_BUF_MEM_GROW_CLEAN 105
#define BUF_F_BUF_MEM_NEW 101
#define BUF_F_BUF_STRDUP 102
#define BUF_F_BUF_STRNDUP 104
/* Reason codes. */
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,105 @@
/* crypto/cast/cast.h */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
#ifndef HEADER_CAST_H
#define HEADER_CAST_H
#ifdef __cplusplus
extern "C" {
#endif
#include <openssl/opensslconf.h>
#ifdef OPENSSL_NO_CAST
#error CAST is disabled.
#endif
#define CAST_ENCRYPT 1
#define CAST_DECRYPT 0
#define CAST_LONG unsigned long
#define CAST_BLOCK 8
#define CAST_KEY_LENGTH 16
typedef struct cast_key_st
{
CAST_LONG data[32];
int short_key; /* Use reduced rounds for short key */
} CAST_KEY;
void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data);
void CAST_ecb_encrypt(const unsigned char *in,unsigned char *out,CAST_KEY *key,
int enc);
void CAST_encrypt(CAST_LONG *data,CAST_KEY *key);
void CAST_decrypt(CAST_LONG *data,CAST_KEY *key);
void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,
CAST_KEY *ks, unsigned char *iv, int enc);
void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out,
long length, CAST_KEY *schedule, unsigned char *ivec,
int *num, int enc);
void CAST_ofb64_encrypt(const unsigned char *in, unsigned char *out,
long length, CAST_KEY *schedule, unsigned char *ivec,
int *num);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,66 @@
#ifndef HEADER_COMP_H
#define HEADER_COMP_H
#include <openssl/crypto.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct comp_ctx_st COMP_CTX;
typedef struct comp_method_st
{
int type; /* NID for compression library */
const char *name; /* A text string to identify the library */
int (*init)(COMP_CTX *ctx);
void (*finish)(COMP_CTX *ctx);
int (*compress)(COMP_CTX *ctx,
unsigned char *out, unsigned int olen,
unsigned char *in, unsigned int ilen);
int (*expand)(COMP_CTX *ctx,
unsigned char *out, unsigned int olen,
unsigned char *in, unsigned int ilen);
/* The following two do NOTHING, but are kept for backward compatibility */
long (*ctrl)(void);
long (*callback_ctrl)(void);
} COMP_METHOD;
struct comp_ctx_st
{
COMP_METHOD *meth;
unsigned long compress_in;
unsigned long compress_out;
unsigned long expand_in;
unsigned long expand_out;
CRYPTO_EX_DATA ex_data;
};
COMP_CTX *COMP_CTX_new(COMP_METHOD *meth);
void COMP_CTX_free(COMP_CTX *ctx);
int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen,
unsigned char *in, int ilen);
int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen,
unsigned char *in, int ilen);
COMP_METHOD *COMP_rle(void );
COMP_METHOD *COMP_zlib(void );
/* BEGIN ERROR CODES */
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
void ERR_load_COMP_strings(void);
/* Error codes for the COMP functions. */
/* Function codes. */
/* Reason codes. */
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,253 @@
/* crypto/conf/conf.h */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
#ifndef HEADER_CONF_H
#define HEADER_CONF_H
#include <openssl/bio.h>
#include <openssl/lhash.h>
#include <openssl/stack.h>
#include <openssl/safestack.h>
#include <openssl/e_os2.h>
#include <openssl/ossl_typ.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct
{
char *section;
char *name;
char *value;
} CONF_VALUE;
DECLARE_STACK_OF(CONF_VALUE)
DECLARE_STACK_OF(CONF_MODULE)
DECLARE_STACK_OF(CONF_IMODULE)
struct conf_st;
struct conf_method_st;
typedef struct conf_method_st CONF_METHOD;
struct conf_method_st
{
const char *name;
CONF *(*create)(CONF_METHOD *meth);
int (*init)(CONF *conf);
int (*destroy)(CONF *conf);
int (*destroy_data)(CONF *conf);
int (*load_bio)(CONF *conf, BIO *bp, long *eline);
int (*dump)(const CONF *conf, BIO *bp);
int (*is_number)(const CONF *conf, char c);
int (*to_int)(const CONF *conf, char c);
int (*load)(CONF *conf, const char *name, long *eline);
};
/* Module definitions */
typedef struct conf_imodule_st CONF_IMODULE;
typedef struct conf_module_st CONF_MODULE;
/* DSO module function typedefs */
typedef int conf_init_func(CONF_IMODULE *md, const CONF *cnf);
typedef void conf_finish_func(CONF_IMODULE *md);
#define CONF_MFLAGS_IGNORE_ERRORS 0x1
#define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2
#define CONF_MFLAGS_SILENT 0x4
#define CONF_MFLAGS_NO_DSO 0x8
#define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10
int CONF_set_default_method(CONF_METHOD *meth);
void CONF_set_nconf(CONF *conf,LHASH *hash);
LHASH *CONF_load(LHASH *conf,const char *file,long *eline);
#ifndef OPENSSL_NO_FP_API
LHASH *CONF_load_fp(LHASH *conf, FILE *fp,long *eline);
#endif
LHASH *CONF_load_bio(LHASH *conf, BIO *bp,long *eline);
STACK_OF(CONF_VALUE) *CONF_get_section(LHASH *conf,const char *section);
char *CONF_get_string(LHASH *conf,const char *group,const char *name);
long CONF_get_number(LHASH *conf,const char *group,const char *name);
void CONF_free(LHASH *conf);
int CONF_dump_fp(LHASH *conf, FILE *out);
int CONF_dump_bio(LHASH *conf, BIO *out);
void OPENSSL_config(const char *config_name);
void OPENSSL_no_config(void);
/* New conf code. The semantics are different from the functions above.
If that wasn't the case, the above functions would have been replaced */
struct conf_st
{
CONF_METHOD *meth;
void *meth_data;
LHASH *data;
};
CONF *NCONF_new(CONF_METHOD *meth);
CONF_METHOD *NCONF_default(void);
CONF_METHOD *NCONF_WIN32(void);
#if 0 /* Just to give you an idea of what I have in mind */
CONF_METHOD *NCONF_XML(void);
#endif
void NCONF_free(CONF *conf);
void NCONF_free_data(CONF *conf);
int NCONF_load(CONF *conf,const char *file,long *eline);
#ifndef OPENSSL_NO_FP_API
int NCONF_load_fp(CONF *conf, FILE *fp,long *eline);
#endif
int NCONF_load_bio(CONF *conf, BIO *bp,long *eline);
STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf,const char *section);
char *NCONF_get_string(const CONF *conf,const char *group,const char *name);
int NCONF_get_number_e(const CONF *conf,const char *group,const char *name,
long *result);
int NCONF_dump_fp(const CONF *conf, FILE *out);
int NCONF_dump_bio(const CONF *conf, BIO *out);
#if 0 /* The following function has no error checking,
and should therefore be avoided */
long NCONF_get_number(CONF *conf,char *group,char *name);
#else
#define NCONF_get_number(c,g,n,r) NCONF_get_number_e(c,g,n,r)
#endif
/* Module functions */
int CONF_modules_load(const CONF *cnf, const char *appname,
unsigned long flags);
int CONF_modules_load_file(const char *filename, const char *appname,
unsigned long flags);
void CONF_modules_unload(int all);
void CONF_modules_finish(void);
void CONF_modules_free(void);
int CONF_module_add(const char *name, conf_init_func *ifunc,
conf_finish_func *ffunc);
const char *CONF_imodule_get_name(const CONF_IMODULE *md);
const char *CONF_imodule_get_value(const CONF_IMODULE *md);
void *CONF_imodule_get_usr_data(const CONF_IMODULE *md);
void CONF_imodule_set_usr_data(CONF_IMODULE *md, void *usr_data);
CONF_MODULE *CONF_imodule_get_module(const CONF_IMODULE *md);
unsigned long CONF_imodule_get_flags(const CONF_IMODULE *md);
void CONF_imodule_set_flags(CONF_IMODULE *md, unsigned long flags);
void *CONF_module_get_usr_data(CONF_MODULE *pmod);
void CONF_module_set_usr_data(CONF_MODULE *pmod, void *usr_data);
char *CONF_get1_default_config_file(void);
int CONF_parse_list(const char *list, int sep, int nospc,
int (*list_cb)(const char *elem, int len, void *usr), void *arg);
void OPENSSL_load_builtin_modules(void);
/* BEGIN ERROR CODES */
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
void ERR_load_CONF_strings(void);
/* Error codes for the CONF functions. */
/* Function codes. */
#define CONF_F_CONF_DUMP_FP 104
#define CONF_F_CONF_LOAD 100
#define CONF_F_CONF_LOAD_BIO 102
#define CONF_F_CONF_LOAD_FP 103
#define CONF_F_CONF_MODULES_LOAD 116
#define CONF_F_DEF_LOAD 120
#define CONF_F_DEF_LOAD_BIO 121
#define CONF_F_MODULE_INIT 115
#define CONF_F_MODULE_LOAD_DSO 117
#define CONF_F_MODULE_RUN 118
#define CONF_F_NCONF_DUMP_BIO 105
#define CONF_F_NCONF_DUMP_FP 106
#define CONF_F_NCONF_GET_NUMBER 107
#define CONF_F_NCONF_GET_NUMBER_E 112
#define CONF_F_NCONF_GET_SECTION 108
#define CONF_F_NCONF_GET_STRING 109
#define CONF_F_NCONF_LOAD 113
#define CONF_F_NCONF_LOAD_BIO 110
#define CONF_F_NCONF_LOAD_FP 114
#define CONF_F_NCONF_NEW 111
#define CONF_F_STR_COPY 101
/* Reason codes. */
#define CONF_R_ERROR_LOADING_DSO 110
#define CONF_R_MISSING_CLOSE_SQUARE_BRACKET 100
#define CONF_R_MISSING_EQUAL_SIGN 101
#define CONF_R_MISSING_FINISH_FUNCTION 111
#define CONF_R_MISSING_INIT_FUNCTION 112
#define CONF_R_MODULE_INITIALIZATION_ERROR 109
#define CONF_R_NO_CLOSE_BRACE 102
#define CONF_R_NO_CONF 105
#define CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE 106
#define CONF_R_NO_SECTION 107
#define CONF_R_NO_SUCH_FILE 114
#define CONF_R_NO_VALUE 108
#define CONF_R_UNABLE_TO_CREATE_NEW_SECTION 103
#define CONF_R_UNKNOWN_MODULE_NAME 113
#define CONF_R_VARIABLE_HAS_NO_VALUE 104
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,89 @@
/* conf_api.h */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
#ifndef HEADER_CONF_API_H
#define HEADER_CONF_API_H
#include <openssl/lhash.h>
#include <openssl/conf.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Up until OpenSSL 0.9.5a, this was new_section */
CONF_VALUE *_CONF_new_section(CONF *conf, const char *section);
/* Up until OpenSSL 0.9.5a, this was get_section */
CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section);
/* Up until OpenSSL 0.9.5a, this was CONF_get_section */
STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf,
const char *section);
int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value);
char *_CONF_get_string(const CONF *conf, const char *section,
const char *name);
long _CONF_get_number(const CONF *conf, const char *section, const char *name);
int _CONF_new_data(CONF *conf);
void _CONF_free_data(CONF *conf);
#ifdef __cplusplus
}
#endif
#endif

Some files were not shown because too many files have changed in this diff Show More