diff --git a/Doc/dxwnd_manual.odt b/Doc/dxwnd_manual.odt index 680c4af..1826b5a 100644 Binary files a/Doc/dxwnd_manual.odt and b/Doc/dxwnd_manual.odt differ diff --git a/Include/D3D10_1 - Copia.h b/Include/D3D10_1 - Copia.h deleted file mode 100644 index 17a8ec5..0000000 --- a/Include/D3D10_1 - Copia.h +++ /dev/null @@ -1,1775 +0,0 @@ - - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 7.00.0555 */ -/* @@MIDL_FILE_HEADING( ) */ - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 475 -#endif - -/* verify that the 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 -#endif // __RPCNDR_H_VERSION__ - -#ifndef COM_NO_WINDOWS_H -#include "windows.h" -#include "ole2.h" -#endif /*COM_NO_WINDOWS_H*/ - -#ifndef __d3d10_1_h__ -#define __d3d10_1_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __ID3D10BlendState1_FWD_DEFINED__ -#define __ID3D10BlendState1_FWD_DEFINED__ -typedef interface ID3D10BlendState1 ID3D10BlendState1; -#endif /* __ID3D10BlendState1_FWD_DEFINED__ */ - - -#ifndef __ID3D10ShaderResourceView1_FWD_DEFINED__ -#define __ID3D10ShaderResourceView1_FWD_DEFINED__ -typedef interface ID3D10ShaderResourceView1 ID3D10ShaderResourceView1; -#endif /* __ID3D10ShaderResourceView1_FWD_DEFINED__ */ - - -#ifndef __ID3D10Device1_FWD_DEFINED__ -#define __ID3D10Device1_FWD_DEFINED__ -typedef interface ID3D10Device1 ID3D10Device1; -#endif /* __ID3D10Device1_FWD_DEFINED__ */ - - -/* header files for imported files */ -#include "oaidl.h" -#include "ocidl.h" - -#ifdef __cplusplus -extern "C"{ -#endif - - -/* interface __MIDL_itf_d3d10_1_0000_0000 */ -/* [local] */ - -#if defined( __d3d10_h__ ) && !defined( D3D10_ARBITRARY_HEADER_ORDERING ) -#error d3d10.h is included before d3d10_1.h, and it will confuse tools that honor SAL annotations. \ -If possibly targeting d3d10.1, include d3d10_1.h instead of d3d10.h, or ensure d3d10_1.h is included before d3d10.h -#endif -#ifndef _D3D10_1_CONSTANTS -#define _D3D10_1_CONSTANTS -#define D3D10_1_DEFAULT_SAMPLE_MASK ( 0xffffffff ) - -#define D3D10_1_FLOAT16_FUSED_TOLERANCE_IN_ULP ( 0.6 ) -#define D3D10_1_FLOAT32_TO_INTEGER_TOLERANCE_IN_ULP ( 0.6f ) -#define D3D10_1_GS_INPUT_REGISTER_COUNT ( 32 ) - -#define D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT ( 32 ) - -#define D3D10_1_IA_VERTEX_INPUT_STRUCTURE_ELEMENTS_COMPONENTS ( 128 ) - -#define D3D10_1_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT ( 32 ) - -#define D3D10_1_PS_OUTPUT_MASK_REGISTER_COMPONENTS ( 1 ) - -#define D3D10_1_PS_OUTPUT_MASK_REGISTER_COMPONENT_BIT_COUNT ( 32 ) - -#define D3D10_1_PS_OUTPUT_MASK_REGISTER_COUNT ( 1 ) - -#define D3D10_1_SHADER_MAJOR_VERSION ( 4 ) - -#define D3D10_1_SHADER_MINOR_VERSION ( 1 ) - -#define D3D10_1_SO_BUFFER_MAX_STRIDE_IN_BYTES ( 2048 ) - -#define D3D10_1_SO_BUFFER_MAX_WRITE_WINDOW_IN_BYTES ( 256 ) - -#define D3D10_1_SO_BUFFER_SLOT_COUNT ( 4 ) - -#define D3D10_1_SO_MULTIPLE_BUFFER_ELEMENTS_PER_BUFFER ( 1 ) - -#define D3D10_1_SO_SINGLE_BUFFER_COMPONENT_LIMIT ( 64 ) - -#define D3D10_1_STANDARD_VERTEX_ELEMENT_COUNT ( 32 ) - -#define D3D10_1_SUBPIXEL_FRACTIONAL_BIT_COUNT ( 8 ) - -#define D3D10_1_VS_INPUT_REGISTER_COUNT ( 32 ) - -#define D3D10_1_VS_OUTPUT_REGISTER_COUNT ( 32 ) - -#endif -#include "d3d10.h" // - -typedef -enum D3D10_FEATURE_LEVEL1 - { D3D10_FEATURE_LEVEL_10_0 = 0xa000, - D3D10_FEATURE_LEVEL_10_1 = 0xa100, - D3D10_FEATURE_LEVEL_9_1 = 0x9100, - D3D10_FEATURE_LEVEL_9_2 = 0x9200, - D3D10_FEATURE_LEVEL_9_3 = 0x9300 - } D3D10_FEATURE_LEVEL1; - -typedef struct D3D10_RENDER_TARGET_BLEND_DESC1 - { - BOOL BlendEnable; - D3D10_BLEND SrcBlend; - D3D10_BLEND DestBlend; - D3D10_BLEND_OP BlendOp; - D3D10_BLEND SrcBlendAlpha; - D3D10_BLEND DestBlendAlpha; - D3D10_BLEND_OP BlendOpAlpha; - UINT8 RenderTargetWriteMask; - } D3D10_RENDER_TARGET_BLEND_DESC1; - -typedef struct D3D10_BLEND_DESC1 - { - BOOL AlphaToCoverageEnable; - BOOL IndependentBlendEnable; - D3D10_RENDER_TARGET_BLEND_DESC1 RenderTarget[ 8 ]; - } D3D10_BLEND_DESC1; - - - -extern RPC_IF_HANDLE __MIDL_itf_d3d10_1_0000_0000_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_d3d10_1_0000_0000_v0_0_s_ifspec; - -#ifndef __ID3D10BlendState1_INTERFACE_DEFINED__ -#define __ID3D10BlendState1_INTERFACE_DEFINED__ - -/* interface ID3D10BlendState1 */ -/* [unique][local][object][uuid] */ - - -EXTERN_C const IID IID_ID3D10BlendState1; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("EDAD8D99-8A35-4d6d-8566-2EA276CDE161") - ID3D10BlendState1 : public ID3D10BlendState - { - public: - virtual void STDMETHODCALLTYPE GetDesc1( - /* [annotation] */ - __out D3D10_BLEND_DESC1 *pDesc) = 0; - - }; - -#else /* C style interface */ - - typedef struct ID3D10BlendState1Vtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ID3D10BlendState1 * This, - /* [in] */ REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ID3D10BlendState1 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ID3D10BlendState1 * This); - - void ( STDMETHODCALLTYPE *GetDevice )( - ID3D10BlendState1 * This, - /* [annotation] */ - __out ID3D10Device **ppDevice); - - HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( - ID3D10BlendState1 * This, - /* [annotation] */ - __in REFGUID guid, - /* [annotation] */ - __inout UINT *pDataSize, - /* [annotation] */ - __out_bcount_opt(*pDataSize) void *pData); - - HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( - ID3D10BlendState1 * This, - /* [annotation] */ - __in REFGUID guid, - /* [annotation] */ - __in UINT DataSize, - /* [annotation] */ - __in_bcount_opt(DataSize) const void *pData); - - HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( - ID3D10BlendState1 * This, - /* [annotation] */ - __in REFGUID guid, - /* [annotation] */ - __in_opt const IUnknown *pData); - - void ( STDMETHODCALLTYPE *GetDesc )( - ID3D10BlendState1 * This, - /* [annotation] */ - __out D3D10_BLEND_DESC *pDesc); - - void ( STDMETHODCALLTYPE *GetDesc1 )( - ID3D10BlendState1 * This, - /* [annotation] */ - __out D3D10_BLEND_DESC1 *pDesc); - - END_INTERFACE - } ID3D10BlendState1Vtbl; - - interface ID3D10BlendState1 - { - CONST_VTBL struct ID3D10BlendState1Vtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ID3D10BlendState1_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ID3D10BlendState1_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ID3D10BlendState1_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ID3D10BlendState1_GetDevice(This,ppDevice) \ - ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) - -#define ID3D10BlendState1_GetPrivateData(This,guid,pDataSize,pData) \ - ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) - -#define ID3D10BlendState1_SetPrivateData(This,guid,DataSize,pData) \ - ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) - -#define ID3D10BlendState1_SetPrivateDataInterface(This,guid,pData) \ - ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) - - -#define ID3D10BlendState1_GetDesc(This,pDesc) \ - ( (This)->lpVtbl -> GetDesc(This,pDesc) ) - - -#define ID3D10BlendState1_GetDesc1(This,pDesc) \ - ( (This)->lpVtbl -> GetDesc1(This,pDesc) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ID3D10BlendState1_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_d3d10_1_0000_0001 */ -/* [local] */ - -typedef struct D3D10_TEXCUBE_ARRAY_SRV1 - { - UINT MostDetailedMip; - UINT MipLevels; - UINT First2DArrayFace; - UINT NumCubes; - } D3D10_TEXCUBE_ARRAY_SRV1; - -typedef D3D_SRV_DIMENSION D3D10_SRV_DIMENSION1; - -typedef struct D3D10_SHADER_RESOURCE_VIEW_DESC1 - { - DXGI_FORMAT Format; - D3D10_SRV_DIMENSION1 ViewDimension; - union - { - D3D10_BUFFER_SRV Buffer; - D3D10_TEX1D_SRV Texture1D; - D3D10_TEX1D_ARRAY_SRV Texture1DArray; - D3D10_TEX2D_SRV Texture2D; - D3D10_TEX2D_ARRAY_SRV Texture2DArray; - D3D10_TEX2DMS_SRV Texture2DMS; - D3D10_TEX2DMS_ARRAY_SRV Texture2DMSArray; - D3D10_TEX3D_SRV Texture3D; - D3D10_TEXCUBE_SRV TextureCube; - D3D10_TEXCUBE_ARRAY_SRV1 TextureCubeArray; - } ; - } D3D10_SHADER_RESOURCE_VIEW_DESC1; - - - -extern RPC_IF_HANDLE __MIDL_itf_d3d10_1_0000_0001_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_d3d10_1_0000_0001_v0_0_s_ifspec; - -#ifndef __ID3D10ShaderResourceView1_INTERFACE_DEFINED__ -#define __ID3D10ShaderResourceView1_INTERFACE_DEFINED__ - -/* interface ID3D10ShaderResourceView1 */ -/* [unique][local][object][uuid] */ - - -EXTERN_C const IID IID_ID3D10ShaderResourceView1; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("9B7E4C87-342C-4106-A19F-4F2704F689F0") - ID3D10ShaderResourceView1 : public ID3D10ShaderResourceView - { - public: - virtual void STDMETHODCALLTYPE GetDesc1( - /* [annotation] */ - __out D3D10_SHADER_RESOURCE_VIEW_DESC1 *pDesc) = 0; - - }; - -#else /* C style interface */ - - typedef struct ID3D10ShaderResourceView1Vtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ID3D10ShaderResourceView1 * This, - /* [in] */ REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ID3D10ShaderResourceView1 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ID3D10ShaderResourceView1 * This); - - void ( STDMETHODCALLTYPE *GetDevice )( - ID3D10ShaderResourceView1 * This, - /* [annotation] */ - __out ID3D10Device **ppDevice); - - HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( - ID3D10ShaderResourceView1 * This, - /* [annotation] */ - __in REFGUID guid, - /* [annotation] */ - __inout UINT *pDataSize, - /* [annotation] */ - __out_bcount_opt(*pDataSize) void *pData); - - HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( - ID3D10ShaderResourceView1 * This, - /* [annotation] */ - __in REFGUID guid, - /* [annotation] */ - __in UINT DataSize, - /* [annotation] */ - __in_bcount_opt(DataSize) const void *pData); - - HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( - ID3D10ShaderResourceView1 * This, - /* [annotation] */ - __in REFGUID guid, - /* [annotation] */ - __in_opt const IUnknown *pData); - - void ( STDMETHODCALLTYPE *GetResource )( - ID3D10ShaderResourceView1 * This, - /* [annotation] */ - __out ID3D10Resource **ppResource); - - void ( STDMETHODCALLTYPE *GetDesc )( - ID3D10ShaderResourceView1 * This, - /* [annotation] */ - __out D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc); - - void ( STDMETHODCALLTYPE *GetDesc1 )( - ID3D10ShaderResourceView1 * This, - /* [annotation] */ - __out D3D10_SHADER_RESOURCE_VIEW_DESC1 *pDesc); - - END_INTERFACE - } ID3D10ShaderResourceView1Vtbl; - - interface ID3D10ShaderResourceView1 - { - CONST_VTBL struct ID3D10ShaderResourceView1Vtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ID3D10ShaderResourceView1_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ID3D10ShaderResourceView1_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ID3D10ShaderResourceView1_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ID3D10ShaderResourceView1_GetDevice(This,ppDevice) \ - ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) - -#define ID3D10ShaderResourceView1_GetPrivateData(This,guid,pDataSize,pData) \ - ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) - -#define ID3D10ShaderResourceView1_SetPrivateData(This,guid,DataSize,pData) \ - ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) - -#define ID3D10ShaderResourceView1_SetPrivateDataInterface(This,guid,pData) \ - ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) - - -#define ID3D10ShaderResourceView1_GetResource(This,ppResource) \ - ( (This)->lpVtbl -> GetResource(This,ppResource) ) - - -#define ID3D10ShaderResourceView1_GetDesc(This,pDesc) \ - ( (This)->lpVtbl -> GetDesc(This,pDesc) ) - - -#define ID3D10ShaderResourceView1_GetDesc1(This,pDesc) \ - ( (This)->lpVtbl -> GetDesc1(This,pDesc) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ID3D10ShaderResourceView1_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_d3d10_1_0000_0002 */ -/* [local] */ - -typedef -enum D3D10_STANDARD_MULTISAMPLE_QUALITY_LEVELS - { D3D10_STANDARD_MULTISAMPLE_PATTERN = 0xffffffff, - D3D10_CENTER_MULTISAMPLE_PATTERN = 0xfffffffe - } D3D10_STANDARD_MULTISAMPLE_QUALITY_LEVELS; - - - -extern RPC_IF_HANDLE __MIDL_itf_d3d10_1_0000_0002_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_d3d10_1_0000_0002_v0_0_s_ifspec; - -#ifndef __ID3D10Device1_INTERFACE_DEFINED__ -#define __ID3D10Device1_INTERFACE_DEFINED__ - -/* interface ID3D10Device1 */ -/* [unique][local][object][uuid] */ - - -EXTERN_C const IID IID_ID3D10Device1; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("9B7E4C8F-342C-4106-A19F-4F2704F689F0") - ID3D10Device1 : public ID3D10Device - { - public: - virtual HRESULT STDMETHODCALLTYPE CreateShaderResourceView1( - /* [annotation] */ - __in ID3D10Resource *pResource, - /* [annotation] */ - __in_opt const D3D10_SHADER_RESOURCE_VIEW_DESC1 *pDesc, - /* [annotation] */ - __out_opt ID3D10ShaderResourceView1 **ppSRView) = 0; - - virtual HRESULT STDMETHODCALLTYPE CreateBlendState1( - /* [annotation] */ - __in const D3D10_BLEND_DESC1 *pBlendStateDesc, - /* [annotation] */ - __out_opt ID3D10BlendState1 **ppBlendState) = 0; - - virtual D3D10_FEATURE_LEVEL1 STDMETHODCALLTYPE GetFeatureLevel( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct ID3D10Device1Vtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ID3D10Device1 * This, - /* [in] */ REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ID3D10Device1 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ID3D10Device1 * This); - - void ( STDMETHODCALLTYPE *VSSetConstantBuffers )( - ID3D10Device1 * This, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, - /* [annotation] */ - __in_ecount(NumBuffers) ID3D10Buffer *const *ppConstantBuffers); - - void ( STDMETHODCALLTYPE *PSSetShaderResources )( - ID3D10Device1 * This, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, - /* [annotation] */ - __in_ecount(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews); - - void ( STDMETHODCALLTYPE *PSSetShader )( - ID3D10Device1 * This, - /* [annotation] */ - __in_opt ID3D10PixelShader *pPixelShader); - - void ( STDMETHODCALLTYPE *PSSetSamplers )( - ID3D10Device1 * This, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, - /* [annotation] */ - __in_ecount(NumSamplers) ID3D10SamplerState *const *ppSamplers); - - void ( STDMETHODCALLTYPE *VSSetShader )( - ID3D10Device1 * This, - /* [annotation] */ - __in_opt ID3D10VertexShader *pVertexShader); - - void ( STDMETHODCALLTYPE *DrawIndexed )( - ID3D10Device1 * This, - /* [annotation] */ - __in UINT IndexCount, - /* [annotation] */ - __in UINT StartIndexLocation, - /* [annotation] */ - __in INT BaseVertexLocation); - - void ( STDMETHODCALLTYPE *Draw )( - ID3D10Device1 * This, - /* [annotation] */ - __in UINT VertexCount, - /* [annotation] */ - __in UINT StartVertexLocation); - - void ( STDMETHODCALLTYPE *PSSetConstantBuffers )( - ID3D10Device1 * This, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, - /* [annotation] */ - __in_ecount(NumBuffers) ID3D10Buffer *const *ppConstantBuffers); - - void ( STDMETHODCALLTYPE *IASetInputLayout )( - ID3D10Device1 * This, - /* [annotation] */ - __in_opt ID3D10InputLayout *pInputLayout); - - void ( STDMETHODCALLTYPE *IASetVertexBuffers )( - ID3D10Device1 * This, - /* [annotation] */ - __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, - /* [annotation] */ - __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers, - /* [annotation] */ - __in_ecount(NumBuffers) ID3D10Buffer *const *ppVertexBuffers, - /* [annotation] */ - __in_ecount(NumBuffers) const UINT *pStrides, - /* [annotation] */ - __in_ecount(NumBuffers) const UINT *pOffsets); - - void ( STDMETHODCALLTYPE *IASetIndexBuffer )( - ID3D10Device1 * This, - /* [annotation] */ - __in_opt ID3D10Buffer *pIndexBuffer, - /* [annotation] */ - __in DXGI_FORMAT Format, - /* [annotation] */ - __in UINT Offset); - - void ( STDMETHODCALLTYPE *DrawIndexedInstanced )( - ID3D10Device1 * This, - /* [annotation] */ - __in UINT IndexCountPerInstance, - /* [annotation] */ - __in UINT InstanceCount, - /* [annotation] */ - __in UINT StartIndexLocation, - /* [annotation] */ - __in INT BaseVertexLocation, - /* [annotation] */ - __in UINT StartInstanceLocation); - - void ( STDMETHODCALLTYPE *DrawInstanced )( - ID3D10Device1 * This, - /* [annotation] */ - __in UINT VertexCountPerInstance, - /* [annotation] */ - __in UINT InstanceCount, - /* [annotation] */ - __in UINT StartVertexLocation, - /* [annotation] */ - __in UINT StartInstanceLocation); - - void ( STDMETHODCALLTYPE *GSSetConstantBuffers )( - ID3D10Device1 * This, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, - /* [annotation] */ - __in_ecount(NumBuffers) ID3D10Buffer *const *ppConstantBuffers); - - void ( STDMETHODCALLTYPE *GSSetShader )( - ID3D10Device1 * This, - /* [annotation] */ - __in_opt ID3D10GeometryShader *pShader); - - void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )( - ID3D10Device1 * This, - /* [annotation] */ - __in D3D10_PRIMITIVE_TOPOLOGY Topology); - - void ( STDMETHODCALLTYPE *VSSetShaderResources )( - ID3D10Device1 * This, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, - /* [annotation] */ - __in_ecount(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews); - - void ( STDMETHODCALLTYPE *VSSetSamplers )( - ID3D10Device1 * This, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, - /* [annotation] */ - __in_ecount(NumSamplers) ID3D10SamplerState *const *ppSamplers); - - void ( STDMETHODCALLTYPE *SetPredication )( - ID3D10Device1 * This, - /* [annotation] */ - __in_opt ID3D10Predicate *pPredicate, - /* [annotation] */ - __in BOOL PredicateValue); - - void ( STDMETHODCALLTYPE *GSSetShaderResources )( - ID3D10Device1 * This, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, - /* [annotation] */ - __in_ecount(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews); - - void ( STDMETHODCALLTYPE *GSSetSamplers )( - ID3D10Device1 * This, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, - /* [annotation] */ - __in_ecount(NumSamplers) ID3D10SamplerState *const *ppSamplers); - - void ( STDMETHODCALLTYPE *OMSetRenderTargets )( - ID3D10Device1 * This, - /* [annotation] */ - __in_range( 0, D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews, - /* [annotation] */ - __in_ecount_opt(NumViews) ID3D10RenderTargetView *const *ppRenderTargetViews, - /* [annotation] */ - __in_opt ID3D10DepthStencilView *pDepthStencilView); - - void ( STDMETHODCALLTYPE *OMSetBlendState )( - ID3D10Device1 * This, - /* [annotation] */ - __in_opt ID3D10BlendState *pBlendState, - /* [annotation] */ - __in const FLOAT BlendFactor[ 4 ], - /* [annotation] */ - __in UINT SampleMask); - - void ( STDMETHODCALLTYPE *OMSetDepthStencilState )( - ID3D10Device1 * This, - /* [annotation] */ - __in_opt ID3D10DepthStencilState *pDepthStencilState, - /* [annotation] */ - __in UINT StencilRef); - - void ( STDMETHODCALLTYPE *SOSetTargets )( - ID3D10Device1 * This, - /* [annotation] */ - __in_range( 0, D3D10_SO_BUFFER_SLOT_COUNT) UINT NumBuffers, - /* [annotation] */ - __in_ecount_opt(NumBuffers) ID3D10Buffer *const *ppSOTargets, - /* [annotation] */ - __in_ecount_opt(NumBuffers) const UINT *pOffsets); - - void ( STDMETHODCALLTYPE *DrawAuto )( - ID3D10Device1 * This); - - void ( STDMETHODCALLTYPE *RSSetState )( - ID3D10Device1 * This, - /* [annotation] */ - __in_opt ID3D10RasterizerState *pRasterizerState); - - void ( STDMETHODCALLTYPE *RSSetViewports )( - ID3D10Device1 * This, - /* [annotation] */ - __in_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, - /* [annotation] */ - __in_ecount_opt(NumViewports) const D3D10_VIEWPORT *pViewports); - - void ( STDMETHODCALLTYPE *RSSetScissorRects )( - ID3D10Device1 * This, - /* [annotation] */ - __in_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, - /* [annotation] */ - __in_ecount_opt(NumRects) const D3D10_RECT *pRects); - - void ( STDMETHODCALLTYPE *CopySubresourceRegion )( - ID3D10Device1 * This, - /* [annotation] */ - __in ID3D10Resource *pDstResource, - /* [annotation] */ - __in UINT DstSubresource, - /* [annotation] */ - __in UINT DstX, - /* [annotation] */ - __in UINT DstY, - /* [annotation] */ - __in UINT DstZ, - /* [annotation] */ - __in ID3D10Resource *pSrcResource, - /* [annotation] */ - __in UINT SrcSubresource, - /* [annotation] */ - __in_opt const D3D10_BOX *pSrcBox); - - void ( STDMETHODCALLTYPE *CopyResource )( - ID3D10Device1 * This, - /* [annotation] */ - __in ID3D10Resource *pDstResource, - /* [annotation] */ - __in ID3D10Resource *pSrcResource); - - void ( STDMETHODCALLTYPE *UpdateSubresource )( - ID3D10Device1 * This, - /* [annotation] */ - __in ID3D10Resource *pDstResource, - /* [annotation] */ - __in UINT DstSubresource, - /* [annotation] */ - __in_opt const D3D10_BOX *pDstBox, - /* [annotation] */ - __in const void *pSrcData, - /* [annotation] */ - __in UINT SrcRowPitch, - /* [annotation] */ - __in UINT SrcDepthPitch); - - void ( STDMETHODCALLTYPE *ClearRenderTargetView )( - ID3D10Device1 * This, - /* [annotation] */ - __in ID3D10RenderTargetView *pRenderTargetView, - /* [annotation] */ - __in const FLOAT ColorRGBA[ 4 ]); - - void ( STDMETHODCALLTYPE *ClearDepthStencilView )( - ID3D10Device1 * This, - /* [annotation] */ - __in ID3D10DepthStencilView *pDepthStencilView, - /* [annotation] */ - __in UINT ClearFlags, - /* [annotation] */ - __in FLOAT Depth, - /* [annotation] */ - __in UINT8 Stencil); - - void ( STDMETHODCALLTYPE *GenerateMips )( - ID3D10Device1 * This, - /* [annotation] */ - __in ID3D10ShaderResourceView *pShaderResourceView); - - void ( STDMETHODCALLTYPE *ResolveSubresource )( - ID3D10Device1 * This, - /* [annotation] */ - __in ID3D10Resource *pDstResource, - /* [annotation] */ - __in UINT DstSubresource, - /* [annotation] */ - __in ID3D10Resource *pSrcResource, - /* [annotation] */ - __in UINT SrcSubresource, - /* [annotation] */ - __in DXGI_FORMAT Format); - - void ( STDMETHODCALLTYPE *VSGetConstantBuffers )( - ID3D10Device1 * This, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, - /* [annotation] */ - __out_ecount(NumBuffers) ID3D10Buffer **ppConstantBuffers); - - void ( STDMETHODCALLTYPE *PSGetShaderResources )( - ID3D10Device1 * This, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, - /* [annotation] */ - __out_ecount(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews); - - void ( STDMETHODCALLTYPE *PSGetShader )( - ID3D10Device1 * This, - /* [annotation] */ - __out ID3D10PixelShader **ppPixelShader); - - void ( STDMETHODCALLTYPE *PSGetSamplers )( - ID3D10Device1 * This, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, - /* [annotation] */ - __out_ecount(NumSamplers) ID3D10SamplerState **ppSamplers); - - void ( STDMETHODCALLTYPE *VSGetShader )( - ID3D10Device1 * This, - /* [annotation] */ - __out ID3D10VertexShader **ppVertexShader); - - void ( STDMETHODCALLTYPE *PSGetConstantBuffers )( - ID3D10Device1 * This, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, - /* [annotation] */ - __out_ecount(NumBuffers) ID3D10Buffer **ppConstantBuffers); - - void ( STDMETHODCALLTYPE *IAGetInputLayout )( - ID3D10Device1 * This, - /* [annotation] */ - __out ID3D10InputLayout **ppInputLayout); - - void ( STDMETHODCALLTYPE *IAGetVertexBuffers )( - ID3D10Device1 * This, - /* [annotation] */ - __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, - /* [annotation] */ - __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers, - /* [annotation] */ - __out_ecount_opt(NumBuffers) ID3D10Buffer **ppVertexBuffers, - /* [annotation] */ - __out_ecount_opt(NumBuffers) UINT *pStrides, - /* [annotation] */ - __out_ecount_opt(NumBuffers) UINT *pOffsets); - - void ( STDMETHODCALLTYPE *IAGetIndexBuffer )( - ID3D10Device1 * This, - /* [annotation] */ - __out_opt ID3D10Buffer **pIndexBuffer, - /* [annotation] */ - __out_opt DXGI_FORMAT *Format, - /* [annotation] */ - __out_opt UINT *Offset); - - void ( STDMETHODCALLTYPE *GSGetConstantBuffers )( - ID3D10Device1 * This, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, - /* [annotation] */ - __out_ecount(NumBuffers) ID3D10Buffer **ppConstantBuffers); - - void ( STDMETHODCALLTYPE *GSGetShader )( - ID3D10Device1 * This, - /* [annotation] */ - __out ID3D10GeometryShader **ppGeometryShader); - - void ( STDMETHODCALLTYPE *IAGetPrimitiveTopology )( - ID3D10Device1 * This, - /* [annotation] */ - __out D3D10_PRIMITIVE_TOPOLOGY *pTopology); - - void ( STDMETHODCALLTYPE *VSGetShaderResources )( - ID3D10Device1 * This, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, - /* [annotation] */ - __out_ecount(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews); - - void ( STDMETHODCALLTYPE *VSGetSamplers )( - ID3D10Device1 * This, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, - /* [annotation] */ - __out_ecount(NumSamplers) ID3D10SamplerState **ppSamplers); - - void ( STDMETHODCALLTYPE *GetPredication )( - ID3D10Device1 * This, - /* [annotation] */ - __out_opt ID3D10Predicate **ppPredicate, - /* [annotation] */ - __out_opt BOOL *pPredicateValue); - - void ( STDMETHODCALLTYPE *GSGetShaderResources )( - ID3D10Device1 * This, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, - /* [annotation] */ - __out_ecount(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews); - - void ( STDMETHODCALLTYPE *GSGetSamplers )( - ID3D10Device1 * This, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, - /* [annotation] */ - __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, - /* [annotation] */ - __out_ecount(NumSamplers) ID3D10SamplerState **ppSamplers); - - void ( STDMETHODCALLTYPE *OMGetRenderTargets )( - ID3D10Device1 * This, - /* [annotation] */ - __in_range( 0, D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews, - /* [annotation] */ - __out_ecount_opt(NumViews) ID3D10RenderTargetView **ppRenderTargetViews, - /* [annotation] */ - __out_opt ID3D10DepthStencilView **ppDepthStencilView); - - void ( STDMETHODCALLTYPE *OMGetBlendState )( - ID3D10Device1 * This, - /* [annotation] */ - __out_opt ID3D10BlendState **ppBlendState, - /* [annotation] */ - __out_opt FLOAT BlendFactor[ 4 ], - /* [annotation] */ - __out_opt UINT *pSampleMask); - - void ( STDMETHODCALLTYPE *OMGetDepthStencilState )( - ID3D10Device1 * This, - /* [annotation] */ - __out_opt ID3D10DepthStencilState **ppDepthStencilState, - /* [annotation] */ - __out_opt UINT *pStencilRef); - - void ( STDMETHODCALLTYPE *SOGetTargets )( - ID3D10Device1 * This, - /* [annotation] */ - __in_range( 0, D3D10_SO_BUFFER_SLOT_COUNT ) UINT NumBuffers, - /* [annotation] */ - __out_ecount_opt(NumBuffers) ID3D10Buffer **ppSOTargets, - /* [annotation] */ - __out_ecount_opt(NumBuffers) UINT *pOffsets); - - void ( STDMETHODCALLTYPE *RSGetState )( - ID3D10Device1 * This, - /* [annotation] */ - __out ID3D10RasterizerState **ppRasterizerState); - - void ( STDMETHODCALLTYPE *RSGetViewports )( - ID3D10Device1 * This, - /* [annotation] */ - __inout /*_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *NumViewports, - /* [annotation] */ - __out_ecount_opt(*NumViewports) D3D10_VIEWPORT *pViewports); - - void ( STDMETHODCALLTYPE *RSGetScissorRects )( - ID3D10Device1 * This, - /* [annotation] */ - __inout /*_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *NumRects, - /* [annotation] */ - __out_ecount_opt(*NumRects) D3D10_RECT *pRects); - - HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( - ID3D10Device1 * This); - - HRESULT ( STDMETHODCALLTYPE *SetExceptionMode )( - ID3D10Device1 * This, - UINT RaiseFlags); - - UINT ( STDMETHODCALLTYPE *GetExceptionMode )( - ID3D10Device1 * This); - - HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( - ID3D10Device1 * This, - /* [annotation] */ - __in REFGUID guid, - /* [annotation] */ - __inout UINT *pDataSize, - /* [annotation] */ - __out_bcount_opt(*pDataSize) void *pData); - - HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( - ID3D10Device1 * This, - /* [annotation] */ - __in REFGUID guid, - /* [annotation] */ - __in UINT DataSize, - /* [annotation] */ - __in_bcount_opt(DataSize) const void *pData); - - HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( - ID3D10Device1 * This, - /* [annotation] */ - __in REFGUID guid, - /* [annotation] */ - __in_opt const IUnknown *pData); - - void ( STDMETHODCALLTYPE *ClearState )( - ID3D10Device1 * This); - - void ( STDMETHODCALLTYPE *Flush )( - ID3D10Device1 * This); - - HRESULT ( STDMETHODCALLTYPE *CreateBuffer )( - ID3D10Device1 * This, - /* [annotation] */ - __in const D3D10_BUFFER_DESC *pDesc, - /* [annotation] */ - __in_opt const D3D10_SUBRESOURCE_DATA *pInitialData, - /* [annotation] */ - __out_opt ID3D10Buffer **ppBuffer); - - HRESULT ( STDMETHODCALLTYPE *CreateTexture1D )( - ID3D10Device1 * This, - /* [annotation] */ - __in const D3D10_TEXTURE1D_DESC *pDesc, - /* [annotation] */ - __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D10_SUBRESOURCE_DATA *pInitialData, - /* [annotation] */ - __out ID3D10Texture1D **ppTexture1D); - - HRESULT ( STDMETHODCALLTYPE *CreateTexture2D )( - ID3D10Device1 * This, - /* [annotation] */ - __in const D3D10_TEXTURE2D_DESC *pDesc, - /* [annotation] */ - __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D10_SUBRESOURCE_DATA *pInitialData, - /* [annotation] */ - __out ID3D10Texture2D **ppTexture2D); - - HRESULT ( STDMETHODCALLTYPE *CreateTexture3D )( - ID3D10Device1 * This, - /* [annotation] */ - __in const D3D10_TEXTURE3D_DESC *pDesc, - /* [annotation] */ - __in_xcount_opt(pDesc->MipLevels) const D3D10_SUBRESOURCE_DATA *pInitialData, - /* [annotation] */ - __out ID3D10Texture3D **ppTexture3D); - - HRESULT ( STDMETHODCALLTYPE *CreateShaderResourceView )( - ID3D10Device1 * This, - /* [annotation] */ - __in ID3D10Resource *pResource, - /* [annotation] */ - __in_opt const D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc, - /* [annotation] */ - __out_opt ID3D10ShaderResourceView **ppSRView); - - HRESULT ( STDMETHODCALLTYPE *CreateRenderTargetView )( - ID3D10Device1 * This, - /* [annotation] */ - __in ID3D10Resource *pResource, - /* [annotation] */ - __in_opt const D3D10_RENDER_TARGET_VIEW_DESC *pDesc, - /* [annotation] */ - __out_opt ID3D10RenderTargetView **ppRTView); - - HRESULT ( STDMETHODCALLTYPE *CreateDepthStencilView )( - ID3D10Device1 * This, - /* [annotation] */ - __in ID3D10Resource *pResource, - /* [annotation] */ - __in_opt const D3D10_DEPTH_STENCIL_VIEW_DESC *pDesc, - /* [annotation] */ - __out_opt ID3D10DepthStencilView **ppDepthStencilView); - - HRESULT ( STDMETHODCALLTYPE *CreateInputLayout )( - ID3D10Device1 * This, - /* [annotation] */ - __in_ecount(NumElements) const D3D10_INPUT_ELEMENT_DESC *pInputElementDescs, - /* [annotation] */ - __in_range( 0, D3D10_1_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT ) UINT NumElements, - /* [annotation] */ - __in const void *pShaderBytecodeWithInputSignature, - /* [annotation] */ - __in SIZE_T BytecodeLength, - /* [annotation] */ - __out_opt ID3D10InputLayout **ppInputLayout); - - HRESULT ( STDMETHODCALLTYPE *CreateVertexShader )( - ID3D10Device1 * This, - /* [annotation] */ - __in const void *pShaderBytecode, - /* [annotation] */ - __in SIZE_T BytecodeLength, - /* [annotation] */ - __out_opt ID3D10VertexShader **ppVertexShader); - - HRESULT ( STDMETHODCALLTYPE *CreateGeometryShader )( - ID3D10Device1 * This, - /* [annotation] */ - __in const void *pShaderBytecode, - /* [annotation] */ - __in SIZE_T BytecodeLength, - /* [annotation] */ - __out_opt ID3D10GeometryShader **ppGeometryShader); - - HRESULT ( STDMETHODCALLTYPE *CreateGeometryShaderWithStreamOutput )( - ID3D10Device1 * This, - /* [annotation] */ - __in const void *pShaderBytecode, - /* [annotation] */ - __in SIZE_T BytecodeLength, - /* [annotation] */ - __in_ecount_opt(NumEntries) const D3D10_SO_DECLARATION_ENTRY *pSODeclaration, - /* [annotation] */ - __in_range( 0, D3D10_SO_SINGLE_BUFFER_COMPONENT_LIMIT ) UINT NumEntries, - /* [annotation] */ - __in UINT OutputStreamStride, - /* [annotation] */ - __out_opt ID3D10GeometryShader **ppGeometryShader); - - HRESULT ( STDMETHODCALLTYPE *CreatePixelShader )( - ID3D10Device1 * This, - /* [annotation] */ - __in const void *pShaderBytecode, - /* [annotation] */ - __in SIZE_T BytecodeLength, - /* [annotation] */ - __out_opt ID3D10PixelShader **ppPixelShader); - - HRESULT ( STDMETHODCALLTYPE *CreateBlendState )( - ID3D10Device1 * This, - /* [annotation] */ - __in const D3D10_BLEND_DESC *pBlendStateDesc, - /* [annotation] */ - __out_opt ID3D10BlendState **ppBlendState); - - HRESULT ( STDMETHODCALLTYPE *CreateDepthStencilState )( - ID3D10Device1 * This, - /* [annotation] */ - __in const D3D10_DEPTH_STENCIL_DESC *pDepthStencilDesc, - /* [annotation] */ - __out_opt ID3D10DepthStencilState **ppDepthStencilState); - - HRESULT ( STDMETHODCALLTYPE *CreateRasterizerState )( - ID3D10Device1 * This, - /* [annotation] */ - __in const D3D10_RASTERIZER_DESC *pRasterizerDesc, - /* [annotation] */ - __out_opt ID3D10RasterizerState **ppRasterizerState); - - HRESULT ( STDMETHODCALLTYPE *CreateSamplerState )( - ID3D10Device1 * This, - /* [annotation] */ - __in const D3D10_SAMPLER_DESC *pSamplerDesc, - /* [annotation] */ - __out_opt ID3D10SamplerState **ppSamplerState); - - HRESULT ( STDMETHODCALLTYPE *CreateQuery )( - ID3D10Device1 * This, - /* [annotation] */ - __in const D3D10_QUERY_DESC *pQueryDesc, - /* [annotation] */ - __out_opt ID3D10Query **ppQuery); - - HRESULT ( STDMETHODCALLTYPE *CreatePredicate )( - ID3D10Device1 * This, - /* [annotation] */ - __in const D3D10_QUERY_DESC *pPredicateDesc, - /* [annotation] */ - __out_opt ID3D10Predicate **ppPredicate); - - HRESULT ( STDMETHODCALLTYPE *CreateCounter )( - ID3D10Device1 * This, - /* [annotation] */ - __in const D3D10_COUNTER_DESC *pCounterDesc, - /* [annotation] */ - __out_opt ID3D10Counter **ppCounter); - - HRESULT ( STDMETHODCALLTYPE *CheckFormatSupport )( - ID3D10Device1 * This, - /* [annotation] */ - __in DXGI_FORMAT Format, - /* [annotation] */ - __out UINT *pFormatSupport); - - HRESULT ( STDMETHODCALLTYPE *CheckMultisampleQualityLevels )( - ID3D10Device1 * This, - /* [annotation] */ - __in DXGI_FORMAT Format, - /* [annotation] */ - __in UINT SampleCount, - /* [annotation] */ - __out UINT *pNumQualityLevels); - - void ( STDMETHODCALLTYPE *CheckCounterInfo )( - ID3D10Device1 * This, - /* [annotation] */ - __out D3D10_COUNTER_INFO *pCounterInfo); - - HRESULT ( STDMETHODCALLTYPE *CheckCounter )( - ID3D10Device1 * This, - /* [annotation] */ - __in const D3D10_COUNTER_DESC *pDesc, - /* [annotation] */ - __out D3D10_COUNTER_TYPE *pType, - /* [annotation] */ - __out UINT *pActiveCounters, - /* [annotation] */ - __out_ecount_opt(*pNameLength) LPSTR szName, - /* [annotation] */ - __inout_opt UINT *pNameLength, - /* [annotation] */ - __out_ecount_opt(*pUnitsLength) LPSTR szUnits, - /* [annotation] */ - __inout_opt UINT *pUnitsLength, - /* [annotation] */ - __out_ecount_opt(*pDescriptionLength) LPSTR szDescription, - /* [annotation] */ - __inout_opt UINT *pDescriptionLength); - - UINT ( STDMETHODCALLTYPE *GetCreationFlags )( - ID3D10Device1 * This); - - HRESULT ( STDMETHODCALLTYPE *OpenSharedResource )( - ID3D10Device1 * This, - /* [annotation] */ - __in HANDLE hResource, - /* [annotation] */ - __in REFIID ReturnedInterface, - /* [annotation] */ - __out_opt void **ppResource); - - void ( STDMETHODCALLTYPE *SetTextFilterSize )( - ID3D10Device1 * This, - /* [annotation] */ - __in UINT Width, - /* [annotation] */ - __in UINT Height); - - void ( STDMETHODCALLTYPE *GetTextFilterSize )( - ID3D10Device1 * This, - /* [annotation] */ - __out_opt UINT *pWidth, - /* [annotation] */ - __out_opt UINT *pHeight); - - HRESULT ( STDMETHODCALLTYPE *CreateShaderResourceView1 )( - ID3D10Device1 * This, - /* [annotation] */ - __in ID3D10Resource *pResource, - /* [annotation] */ - __in_opt const D3D10_SHADER_RESOURCE_VIEW_DESC1 *pDesc, - /* [annotation] */ - __out_opt ID3D10ShaderResourceView1 **ppSRView); - - HRESULT ( STDMETHODCALLTYPE *CreateBlendState1 )( - ID3D10Device1 * This, - /* [annotation] */ - __in const D3D10_BLEND_DESC1 *pBlendStateDesc, - /* [annotation] */ - __out_opt ID3D10BlendState1 **ppBlendState); - - D3D10_FEATURE_LEVEL1 ( STDMETHODCALLTYPE *GetFeatureLevel )( - ID3D10Device1 * This); - - END_INTERFACE - } ID3D10Device1Vtbl; - - interface ID3D10Device1 - { - CONST_VTBL struct ID3D10Device1Vtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ID3D10Device1_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ID3D10Device1_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ID3D10Device1_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ID3D10Device1_VSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ - ( (This)->lpVtbl -> VSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) - -#define ID3D10Device1_PSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ - ( (This)->lpVtbl -> PSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) - -#define ID3D10Device1_PSSetShader(This,pPixelShader) \ - ( (This)->lpVtbl -> PSSetShader(This,pPixelShader) ) - -#define ID3D10Device1_PSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ - ( (This)->lpVtbl -> PSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) - -#define ID3D10Device1_VSSetShader(This,pVertexShader) \ - ( (This)->lpVtbl -> VSSetShader(This,pVertexShader) ) - -#define ID3D10Device1_DrawIndexed(This,IndexCount,StartIndexLocation,BaseVertexLocation) \ - ( (This)->lpVtbl -> DrawIndexed(This,IndexCount,StartIndexLocation,BaseVertexLocation) ) - -#define ID3D10Device1_Draw(This,VertexCount,StartVertexLocation) \ - ( (This)->lpVtbl -> Draw(This,VertexCount,StartVertexLocation) ) - -#define ID3D10Device1_PSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ - ( (This)->lpVtbl -> PSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) - -#define ID3D10Device1_IASetInputLayout(This,pInputLayout) \ - ( (This)->lpVtbl -> IASetInputLayout(This,pInputLayout) ) - -#define ID3D10Device1_IASetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) \ - ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) ) - -#define ID3D10Device1_IASetIndexBuffer(This,pIndexBuffer,Format,Offset) \ - ( (This)->lpVtbl -> IASetIndexBuffer(This,pIndexBuffer,Format,Offset) ) - -#define ID3D10Device1_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ - ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) ) - -#define ID3D10Device1_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ - ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) ) - -#define ID3D10Device1_GSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ - ( (This)->lpVtbl -> GSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) - -#define ID3D10Device1_GSSetShader(This,pShader) \ - ( (This)->lpVtbl -> GSSetShader(This,pShader) ) - -#define ID3D10Device1_IASetPrimitiveTopology(This,Topology) \ - ( (This)->lpVtbl -> IASetPrimitiveTopology(This,Topology) ) - -#define ID3D10Device1_VSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ - ( (This)->lpVtbl -> VSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) - -#define ID3D10Device1_VSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ - ( (This)->lpVtbl -> VSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) - -#define ID3D10Device1_SetPredication(This,pPredicate,PredicateValue) \ - ( (This)->lpVtbl -> SetPredication(This,pPredicate,PredicateValue) ) - -#define ID3D10Device1_GSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ - ( (This)->lpVtbl -> GSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) - -#define ID3D10Device1_GSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ - ( (This)->lpVtbl -> GSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) - -#define ID3D10Device1_OMSetRenderTargets(This,NumViews,ppRenderTargetViews,pDepthStencilView) \ - ( (This)->lpVtbl -> OMSetRenderTargets(This,NumViews,ppRenderTargetViews,pDepthStencilView) ) - -#define ID3D10Device1_OMSetBlendState(This,pBlendState,BlendFactor,SampleMask) \ - ( (This)->lpVtbl -> OMSetBlendState(This,pBlendState,BlendFactor,SampleMask) ) - -#define ID3D10Device1_OMSetDepthStencilState(This,pDepthStencilState,StencilRef) \ - ( (This)->lpVtbl -> OMSetDepthStencilState(This,pDepthStencilState,StencilRef) ) - -#define ID3D10Device1_SOSetTargets(This,NumBuffers,ppSOTargets,pOffsets) \ - ( (This)->lpVtbl -> SOSetTargets(This,NumBuffers,ppSOTargets,pOffsets) ) - -#define ID3D10Device1_DrawAuto(This) \ - ( (This)->lpVtbl -> DrawAuto(This) ) - -#define ID3D10Device1_RSSetState(This,pRasterizerState) \ - ( (This)->lpVtbl -> RSSetState(This,pRasterizerState) ) - -#define ID3D10Device1_RSSetViewports(This,NumViewports,pViewports) \ - ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) ) - -#define ID3D10Device1_RSSetScissorRects(This,NumRects,pRects) \ - ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) ) - -#define ID3D10Device1_CopySubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,DstZ,pSrcResource,SrcSubresource,pSrcBox) \ - ( (This)->lpVtbl -> CopySubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,DstZ,pSrcResource,SrcSubresource,pSrcBox) ) - -#define ID3D10Device1_CopyResource(This,pDstResource,pSrcResource) \ - ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) ) - -#define ID3D10Device1_UpdateSubresource(This,pDstResource,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) \ - ( (This)->lpVtbl -> UpdateSubresource(This,pDstResource,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) ) - -#define ID3D10Device1_ClearRenderTargetView(This,pRenderTargetView,ColorRGBA) \ - ( (This)->lpVtbl -> ClearRenderTargetView(This,pRenderTargetView,ColorRGBA) ) - -#define ID3D10Device1_ClearDepthStencilView(This,pDepthStencilView,ClearFlags,Depth,Stencil) \ - ( (This)->lpVtbl -> ClearDepthStencilView(This,pDepthStencilView,ClearFlags,Depth,Stencil) ) - -#define ID3D10Device1_GenerateMips(This,pShaderResourceView) \ - ( (This)->lpVtbl -> GenerateMips(This,pShaderResourceView) ) - -#define ID3D10Device1_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ - ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) ) - -#define ID3D10Device1_VSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ - ( (This)->lpVtbl -> VSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) - -#define ID3D10Device1_PSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ - ( (This)->lpVtbl -> PSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) - -#define ID3D10Device1_PSGetShader(This,ppPixelShader) \ - ( (This)->lpVtbl -> PSGetShader(This,ppPixelShader) ) - -#define ID3D10Device1_PSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ - ( (This)->lpVtbl -> PSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) - -#define ID3D10Device1_VSGetShader(This,ppVertexShader) \ - ( (This)->lpVtbl -> VSGetShader(This,ppVertexShader) ) - -#define ID3D10Device1_PSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ - ( (This)->lpVtbl -> PSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) - -#define ID3D10Device1_IAGetInputLayout(This,ppInputLayout) \ - ( (This)->lpVtbl -> IAGetInputLayout(This,ppInputLayout) ) - -#define ID3D10Device1_IAGetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) \ - ( (This)->lpVtbl -> IAGetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) ) - -#define ID3D10Device1_IAGetIndexBuffer(This,pIndexBuffer,Format,Offset) \ - ( (This)->lpVtbl -> IAGetIndexBuffer(This,pIndexBuffer,Format,Offset) ) - -#define ID3D10Device1_GSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ - ( (This)->lpVtbl -> GSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) - -#define ID3D10Device1_GSGetShader(This,ppGeometryShader) \ - ( (This)->lpVtbl -> GSGetShader(This,ppGeometryShader) ) - -#define ID3D10Device1_IAGetPrimitiveTopology(This,pTopology) \ - ( (This)->lpVtbl -> IAGetPrimitiveTopology(This,pTopology) ) - -#define ID3D10Device1_VSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ - ( (This)->lpVtbl -> VSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) - -#define ID3D10Device1_VSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ - ( (This)->lpVtbl -> VSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) - -#define ID3D10Device1_GetPredication(This,ppPredicate,pPredicateValue) \ - ( (This)->lpVtbl -> GetPredication(This,ppPredicate,pPredicateValue) ) - -#define ID3D10Device1_GSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ - ( (This)->lpVtbl -> GSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) - -#define ID3D10Device1_GSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ - ( (This)->lpVtbl -> GSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) - -#define ID3D10Device1_OMGetRenderTargets(This,NumViews,ppRenderTargetViews,ppDepthStencilView) \ - ( (This)->lpVtbl -> OMGetRenderTargets(This,NumViews,ppRenderTargetViews,ppDepthStencilView) ) - -#define ID3D10Device1_OMGetBlendState(This,ppBlendState,BlendFactor,pSampleMask) \ - ( (This)->lpVtbl -> OMGetBlendState(This,ppBlendState,BlendFactor,pSampleMask) ) - -#define ID3D10Device1_OMGetDepthStencilState(This,ppDepthStencilState,pStencilRef) \ - ( (This)->lpVtbl -> OMGetDepthStencilState(This,ppDepthStencilState,pStencilRef) ) - -#define ID3D10Device1_SOGetTargets(This,NumBuffers,ppSOTargets,pOffsets) \ - ( (This)->lpVtbl -> SOGetTargets(This,NumBuffers,ppSOTargets,pOffsets) ) - -#define ID3D10Device1_RSGetState(This,ppRasterizerState) \ - ( (This)->lpVtbl -> RSGetState(This,ppRasterizerState) ) - -#define ID3D10Device1_RSGetViewports(This,NumViewports,pViewports) \ - ( (This)->lpVtbl -> RSGetViewports(This,NumViewports,pViewports) ) - -#define ID3D10Device1_RSGetScissorRects(This,NumRects,pRects) \ - ( (This)->lpVtbl -> RSGetScissorRects(This,NumRects,pRects) ) - -#define ID3D10Device1_GetDeviceRemovedReason(This) \ - ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) - -#define ID3D10Device1_SetExceptionMode(This,RaiseFlags) \ - ( (This)->lpVtbl -> SetExceptionMode(This,RaiseFlags) ) - -#define ID3D10Device1_GetExceptionMode(This) \ - ( (This)->lpVtbl -> GetExceptionMode(This) ) - -#define ID3D10Device1_GetPrivateData(This,guid,pDataSize,pData) \ - ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) - -#define ID3D10Device1_SetPrivateData(This,guid,DataSize,pData) \ - ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) - -#define ID3D10Device1_SetPrivateDataInterface(This,guid,pData) \ - ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) - -#define ID3D10Device1_ClearState(This) \ - ( (This)->lpVtbl -> ClearState(This) ) - -#define ID3D10Device1_Flush(This) \ - ( (This)->lpVtbl -> Flush(This) ) - -#define ID3D10Device1_CreateBuffer(This,pDesc,pInitialData,ppBuffer) \ - ( (This)->lpVtbl -> CreateBuffer(This,pDesc,pInitialData,ppBuffer) ) - -#define ID3D10Device1_CreateTexture1D(This,pDesc,pInitialData,ppTexture1D) \ - ( (This)->lpVtbl -> CreateTexture1D(This,pDesc,pInitialData,ppTexture1D) ) - -#define ID3D10Device1_CreateTexture2D(This,pDesc,pInitialData,ppTexture2D) \ - ( (This)->lpVtbl -> CreateTexture2D(This,pDesc,pInitialData,ppTexture2D) ) - -#define ID3D10Device1_CreateTexture3D(This,pDesc,pInitialData,ppTexture3D) \ - ( (This)->lpVtbl -> CreateTexture3D(This,pDesc,pInitialData,ppTexture3D) ) - -#define ID3D10Device1_CreateShaderResourceView(This,pResource,pDesc,ppSRView) \ - ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,ppSRView) ) - -#define ID3D10Device1_CreateRenderTargetView(This,pResource,pDesc,ppRTView) \ - ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,ppRTView) ) - -#define ID3D10Device1_CreateDepthStencilView(This,pResource,pDesc,ppDepthStencilView) \ - ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,ppDepthStencilView) ) - -#define ID3D10Device1_CreateInputLayout(This,pInputElementDescs,NumElements,pShaderBytecodeWithInputSignature,BytecodeLength,ppInputLayout) \ - ( (This)->lpVtbl -> CreateInputLayout(This,pInputElementDescs,NumElements,pShaderBytecodeWithInputSignature,BytecodeLength,ppInputLayout) ) - -#define ID3D10Device1_CreateVertexShader(This,pShaderBytecode,BytecodeLength,ppVertexShader) \ - ( (This)->lpVtbl -> CreateVertexShader(This,pShaderBytecode,BytecodeLength,ppVertexShader) ) - -#define ID3D10Device1_CreateGeometryShader(This,pShaderBytecode,BytecodeLength,ppGeometryShader) \ - ( (This)->lpVtbl -> CreateGeometryShader(This,pShaderBytecode,BytecodeLength,ppGeometryShader) ) - -#define ID3D10Device1_CreateGeometryShaderWithStreamOutput(This,pShaderBytecode,BytecodeLength,pSODeclaration,NumEntries,OutputStreamStride,ppGeometryShader) \ - ( (This)->lpVtbl -> CreateGeometryShaderWithStreamOutput(This,pShaderBytecode,BytecodeLength,pSODeclaration,NumEntries,OutputStreamStride,ppGeometryShader) ) - -#define ID3D10Device1_CreatePixelShader(This,pShaderBytecode,BytecodeLength,ppPixelShader) \ - ( (This)->lpVtbl -> CreatePixelShader(This,pShaderBytecode,BytecodeLength,ppPixelShader) ) - -#define ID3D10Device1_CreateBlendState(This,pBlendStateDesc,ppBlendState) \ - ( (This)->lpVtbl -> CreateBlendState(This,pBlendStateDesc,ppBlendState) ) - -#define ID3D10Device1_CreateDepthStencilState(This,pDepthStencilDesc,ppDepthStencilState) \ - ( (This)->lpVtbl -> CreateDepthStencilState(This,pDepthStencilDesc,ppDepthStencilState) ) - -#define ID3D10Device1_CreateRasterizerState(This,pRasterizerDesc,ppRasterizerState) \ - ( (This)->lpVtbl -> CreateRasterizerState(This,pRasterizerDesc,ppRasterizerState) ) - -#define ID3D10Device1_CreateSamplerState(This,pSamplerDesc,ppSamplerState) \ - ( (This)->lpVtbl -> CreateSamplerState(This,pSamplerDesc,ppSamplerState) ) - -#define ID3D10Device1_CreateQuery(This,pQueryDesc,ppQuery) \ - ( (This)->lpVtbl -> CreateQuery(This,pQueryDesc,ppQuery) ) - -#define ID3D10Device1_CreatePredicate(This,pPredicateDesc,ppPredicate) \ - ( (This)->lpVtbl -> CreatePredicate(This,pPredicateDesc,ppPredicate) ) - -#define ID3D10Device1_CreateCounter(This,pCounterDesc,ppCounter) \ - ( (This)->lpVtbl -> CreateCounter(This,pCounterDesc,ppCounter) ) - -#define ID3D10Device1_CheckFormatSupport(This,Format,pFormatSupport) \ - ( (This)->lpVtbl -> CheckFormatSupport(This,Format,pFormatSupport) ) - -#define ID3D10Device1_CheckMultisampleQualityLevels(This,Format,SampleCount,pNumQualityLevels) \ - ( (This)->lpVtbl -> CheckMultisampleQualityLevels(This,Format,SampleCount,pNumQualityLevels) ) - -#define ID3D10Device1_CheckCounterInfo(This,pCounterInfo) \ - ( (This)->lpVtbl -> CheckCounterInfo(This,pCounterInfo) ) - -#define ID3D10Device1_CheckCounter(This,pDesc,pType,pActiveCounters,szName,pNameLength,szUnits,pUnitsLength,szDescription,pDescriptionLength) \ - ( (This)->lpVtbl -> CheckCounter(This,pDesc,pType,pActiveCounters,szName,pNameLength,szUnits,pUnitsLength,szDescription,pDescriptionLength) ) - -#define ID3D10Device1_GetCreationFlags(This) \ - ( (This)->lpVtbl -> GetCreationFlags(This) ) - -#define ID3D10Device1_OpenSharedResource(This,hResource,ReturnedInterface,ppResource) \ - ( (This)->lpVtbl -> OpenSharedResource(This,hResource,ReturnedInterface,ppResource) ) - -#define ID3D10Device1_SetTextFilterSize(This,Width,Height) \ - ( (This)->lpVtbl -> SetTextFilterSize(This,Width,Height) ) - -#define ID3D10Device1_GetTextFilterSize(This,pWidth,pHeight) \ - ( (This)->lpVtbl -> GetTextFilterSize(This,pWidth,pHeight) ) - - -#define ID3D10Device1_CreateShaderResourceView1(This,pResource,pDesc,ppSRView) \ - ( (This)->lpVtbl -> CreateShaderResourceView1(This,pResource,pDesc,ppSRView) ) - -#define ID3D10Device1_CreateBlendState1(This,pBlendStateDesc,ppBlendState) \ - ( (This)->lpVtbl -> CreateBlendState1(This,pBlendStateDesc,ppBlendState) ) - -#define ID3D10Device1_GetFeatureLevel(This) \ - ( (This)->lpVtbl -> GetFeatureLevel(This) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ID3D10Device1_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_d3d10_1_0000_0003 */ -/* [local] */ - -#define D3D10_1_SDK_VERSION ( ( 0 + 0x20 ) ) - -#include "d3d10_1shader.h" - -/////////////////////////////////////////////////////////////////////////// -// D3D10CreateDevice1 -// ------------------ -// -// pAdapter -// If NULL, D3D10CreateDevice1 will choose the primary adapter and -// create a new instance from a temporarily created IDXGIFactory. -// If non-NULL, D3D10CreateDevice1 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 D3D10CreateDeviceAndSwapChain1. -// HardwareLevel -// Any of those documented for D3D10CreateDeviceAndSwapChain1. -// SDKVersion -// SDK version. Use the D3D10_1_SDK_VERSION macro. -// ppDevice -// Pointer to returned interface. -// -// Return Values -// Any of those documented for -// CreateDXGIFactory -// IDXGIFactory::EnumAdapters -// IDXGIAdapter::RegisterDriver -// D3D10CreateDevice1 -// -/////////////////////////////////////////////////////////////////////////// -typedef HRESULT (WINAPI* PFN_D3D10_CREATE_DEVICE1)(IDXGIAdapter *, - D3D10_DRIVER_TYPE, HMODULE, UINT, D3D10_FEATURE_LEVEL1, UINT, ID3D10Device1**); - -HRESULT WINAPI D3D10CreateDevice1( - IDXGIAdapter *pAdapter, - D3D10_DRIVER_TYPE DriverType, - HMODULE Software, - UINT Flags, - D3D10_FEATURE_LEVEL1 HardwareLevel, - UINT SDKVersion, - ID3D10Device1 **ppDevice); - -/////////////////////////////////////////////////////////////////////////// -// D3D10CreateDeviceAndSwapChain1 -// ------------------------------ -// -// ppAdapter -// If NULL, D3D10CreateDevice1 will choose the primary adapter and -// create a new instance from a temporarily created IDXGIFactory. -// If non-NULL, D3D10CreateDevice1 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 D3D10CreateDevice1. -// HardwareLevel -// Any of: -// D3D10_CREATE_LEVEL_10_0 -// D3D10_CREATE_LEVEL_10_1 -// SDKVersion -// SDK version. Use the D3D10_1_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 -// D3D10CreateDevice1 -// IDXGIFactory::CreateSwapChain -// -/////////////////////////////////////////////////////////////////////////// -typedef HRESULT (WINAPI* PFN_D3D10_CREATE_DEVICE_AND_SWAP_CHAIN1)(IDXGIAdapter *, - D3D10_DRIVER_TYPE, HMODULE, UINT, D3D10_FEATURE_LEVEL1, UINT, DXGI_SWAP_CHAIN_DESC *, IDXGISwapChain **, ID3D10Device1 **); - -HRESULT WINAPI D3D10CreateDeviceAndSwapChain1( - IDXGIAdapter *pAdapter, - D3D10_DRIVER_TYPE DriverType, - HMODULE Software, - UINT Flags, - D3D10_FEATURE_LEVEL1 HardwareLevel, - UINT SDKVersion, - DXGI_SWAP_CHAIN_DESC *pSwapChainDesc, - IDXGISwapChain **ppSwapChain, - ID3D10Device1 **ppDevice); -DEFINE_GUID(IID_ID3D10BlendState1,0xEDAD8D99,0x8A35,0x4d6d,0x85,0x66,0x2E,0xA2,0x76,0xCD,0xE1,0x61); -DEFINE_GUID(IID_ID3D10ShaderResourceView1,0x9B7E4C87,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); -DEFINE_GUID(IID_ID3D10Device1,0x9B7E4C8F,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); - - -extern RPC_IF_HANDLE __MIDL_itf_d3d10_1_0000_0003_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_d3d10_1_0000_0003_v0_0_s_ifspec; - -/* Additional Prototypes for ALL interfaces */ - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - diff --git a/Include/D3D10_1shader - Copia.h b/Include/D3D10_1shader - Copia.h deleted file mode 100644 index 2726f8f..0000000 --- a/Include/D3D10_1shader - Copia.h +++ /dev/null @@ -1,301 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// File: D3D10_1Shader.h -// Content: D3D10.1 Shader Types and APIs -// -////////////////////////////////////////////////////////////////////////////// - -#ifndef __D3D10_1SHADER_H__ -#define __D3D10_1SHADER_H__ - -#include "d3d10shader.h" - -//---------------------------------------------------------------------------- -// Shader debugging structures -//---------------------------------------------------------------------------- - -typedef enum _D3D10_SHADER_DEBUG_REGTYPE -{ - D3D10_SHADER_DEBUG_REG_INPUT, - D3D10_SHADER_DEBUG_REG_OUTPUT, - D3D10_SHADER_DEBUG_REG_CBUFFER, - D3D10_SHADER_DEBUG_REG_TBUFFER, - D3D10_SHADER_DEBUG_REG_TEMP, - D3D10_SHADER_DEBUG_REG_TEMPARRAY, - D3D10_SHADER_DEBUG_REG_TEXTURE, - D3D10_SHADER_DEBUG_REG_SAMPLER, - D3D10_SHADER_DEBUG_REG_IMMEDIATECBUFFER, - D3D10_SHADER_DEBUG_REG_LITERAL, - D3D10_SHADER_DEBUG_REG_UNUSED, - D3D11_SHADER_DEBUG_REG_INTERFACE_POINTERS, - D3D11_SHADER_DEBUG_REG_UAV, - D3D10_SHADER_DEBUG_REG_FORCE_DWORD = 0x7fffffff, -} D3D10_SHADER_DEBUG_REGTYPE; - -typedef enum _D3D10_SHADER_DEBUG_SCOPETYPE -{ - D3D10_SHADER_DEBUG_SCOPE_GLOBAL, - D3D10_SHADER_DEBUG_SCOPE_BLOCK, - D3D10_SHADER_DEBUG_SCOPE_FORLOOP, - D3D10_SHADER_DEBUG_SCOPE_STRUCT, - D3D10_SHADER_DEBUG_SCOPE_FUNC_PARAMS, - D3D10_SHADER_DEBUG_SCOPE_STATEBLOCK, - D3D10_SHADER_DEBUG_SCOPE_NAMESPACE, - D3D10_SHADER_DEBUG_SCOPE_ANNOTATION, - D3D10_SHADER_DEBUG_SCOPE_FORCE_DWORD = 0x7fffffff, -} D3D10_SHADER_DEBUG_SCOPETYPE; - -typedef enum _D3D10_SHADER_DEBUG_VARTYPE -{ - D3D10_SHADER_DEBUG_VAR_VARIABLE, - D3D10_SHADER_DEBUG_VAR_FUNCTION, - D3D10_SHADER_DEBUG_VAR_FORCE_DWORD = 0x7fffffff, -} D3D10_SHADER_DEBUG_VARTYPE; - -///////////////////////////////////////////////////////////////////// -// These are the serialized structures that get written to the file -///////////////////////////////////////////////////////////////////// - -typedef struct _D3D10_SHADER_DEBUG_TOKEN_INFO -{ - UINT File; // offset into file list - UINT Line; // line # - UINT Column; // column # - - UINT TokenLength; - UINT TokenId; // offset to LPCSTR of length TokenLength in string datastore -} D3D10_SHADER_DEBUG_TOKEN_INFO; - -// Variable list -typedef struct _D3D10_SHADER_DEBUG_VAR_INFO -{ - // Index into token list for declaring identifier - UINT TokenId; - D3D10_SHADER_VARIABLE_TYPE Type; - // register and component for this variable, only valid/necessary for arrays - UINT Register; - UINT Component; - // gives the original variable that declared this variable - UINT ScopeVar; - // this variable's offset in its ScopeVar - UINT ScopeVarOffset; -} D3D10_SHADER_DEBUG_VAR_INFO; - -typedef struct _D3D10_SHADER_DEBUG_INPUT_INFO -{ - // index into array of variables of variable to initialize - UINT Var; - // input, cbuffer, tbuffer - D3D10_SHADER_DEBUG_REGTYPE InitialRegisterSet; - // set to cbuffer or tbuffer slot, geometry shader input primitive #, - // identifying register for indexable temp, or -1 - UINT InitialBank; - // -1 if temp, otherwise gives register in register set - UINT InitialRegister; - // -1 if temp, otherwise gives component - UINT InitialComponent; - // initial value if literal - UINT InitialValue; -} D3D10_SHADER_DEBUG_INPUT_INFO; - -typedef struct _D3D10_SHADER_DEBUG_SCOPEVAR_INFO -{ - // Index into variable token - UINT TokenId; - - D3D10_SHADER_DEBUG_VARTYPE VarType; // variable or function (different namespaces) - D3D10_SHADER_VARIABLE_CLASS Class; - UINT Rows; // number of rows (matrices) - UINT Columns; // number of columns (vectors and matrices) - - // In an array of structures, one struct member scope is provided, and - // you'll have to add the array stride times the index to the variable - // index you find, then find that variable in this structure's list of - // variables. - - // gives a scope to look up struct members. -1 if not a struct - UINT StructMemberScope; - - // number of array indices - UINT uArrayIndices; // a[3][2][1] has 3 indices - // maximum array index for each index - // offset to UINT[uArrayIndices] in UINT datastore - UINT ArrayElements; // a[3][2][1] has {3, 2, 1} - // how many variables each array index moves - // offset to UINT[uArrayIndices] in UINT datastore - UINT ArrayStrides; // a[3][2][1] has {2, 1, 1} - - UINT uVariables; - // index of the first variable, later variables are offsets from this one - UINT uFirstVariable; -} D3D10_SHADER_DEBUG_SCOPEVAR_INFO; - -// scope data, this maps variable names to debug variables (useful for the watch window) -typedef struct _D3D10_SHADER_DEBUG_SCOPE_INFO -{ - D3D10_SHADER_DEBUG_SCOPETYPE ScopeType; - UINT Name; // offset to name of scope in strings list - UINT uNameLen; // length of name string - UINT uVariables; - UINT VariableData; // Offset to UINT[uVariables] indexing the Scope Variable list -} D3D10_SHADER_DEBUG_SCOPE_INFO; - -// instruction outputs -typedef struct _D3D10_SHADER_DEBUG_OUTPUTVAR -{ - // index variable being written to, if -1 it's not going to a variable - UINT Var; - // range data that the compiler expects to be true - UINT uValueMin, uValueMax; - INT iValueMin, iValueMax; - FLOAT fValueMin, fValueMax; - - BOOL bNaNPossible, bInfPossible; -} D3D10_SHADER_DEBUG_OUTPUTVAR; - -typedef struct _D3D10_SHADER_DEBUG_OUTPUTREG_INFO -{ - // Only temp, indexable temp, and output are valid here - D3D10_SHADER_DEBUG_REGTYPE OutputRegisterSet; - // -1 means no output - UINT OutputReg; - // if a temp array, identifier for which one - UINT TempArrayReg; - // -1 means masked out - UINT OutputComponents[4]; - D3D10_SHADER_DEBUG_OUTPUTVAR OutputVars[4]; - // when indexing the output, get the value of this register, then add - // that to uOutputReg. If uIndexReg is -1, then there is no index. - // find the variable whose register is the sum (by looking in the ScopeVar) - // and component matches, then set it. This should only happen for indexable - // temps and outputs. - UINT IndexReg; - UINT IndexComp; -} D3D10_SHADER_DEBUG_OUTPUTREG_INFO; - -// per instruction data -typedef struct _D3D10_SHADER_DEBUG_INST_INFO -{ - UINT Id; // Which instruction this is in the bytecode - UINT Opcode; // instruction type - - // 0, 1, or 2 - UINT uOutputs; - - // up to two outputs per instruction - D3D10_SHADER_DEBUG_OUTPUTREG_INFO pOutputs[2]; - - // index into the list of tokens for this instruction's token - UINT TokenId; - - // how many function calls deep this instruction is - UINT NestingLevel; - - // list of scopes from outer-most to inner-most - // Number of scopes - UINT Scopes; - UINT ScopeInfo; // Offset to UINT[uScopes] specifying indices of the ScopeInfo Array - - // list of variables accessed by this instruction - // Number of variables - UINT AccessedVars; - UINT AccessedVarsInfo; // Offset to UINT[AccessedVars] specifying indices of the ScopeVariableInfo Array -} D3D10_SHADER_DEBUG_INST_INFO; - -typedef struct _D3D10_SHADER_DEBUG_FILE_INFO -{ - UINT FileName; // Offset to LPCSTR for file name - UINT FileNameLen; // Length of file name - UINT FileData; // Offset to LPCSTR of length FileLen - UINT FileLen; // Length of file -} D3D10_SHADER_DEBUG_FILE_INFO; - -typedef struct _D3D10_SHADER_DEBUG_INFO -{ - UINT Size; // sizeof(D3D10_SHADER_DEBUG_INFO) - UINT Creator; // Offset to LPCSTR for compiler version - UINT EntrypointName; // Offset to LPCSTR for Entry point name - UINT ShaderTarget; // Offset to LPCSTR for shader target - UINT CompileFlags; // flags used to compile - UINT Files; // number of included files - UINT FileInfo; // Offset to D3D10_SHADER_DEBUG_FILE_INFO[Files] - UINT Instructions; // number of instructions - UINT InstructionInfo; // Offset to D3D10_SHADER_DEBUG_INST_INFO[Instructions] - UINT Variables; // number of variables - UINT VariableInfo; // Offset to D3D10_SHADER_DEBUG_VAR_INFO[Variables] - UINT InputVariables; // number of variables to initialize before running - UINT InputVariableInfo; // Offset to D3D10_SHADER_DEBUG_INPUT_INFO[InputVariables] - UINT Tokens; // number of tokens to initialize - UINT TokenInfo; // Offset to D3D10_SHADER_DEBUG_TOKEN_INFO[Tokens] - UINT Scopes; // number of scopes - UINT ScopeInfo; // Offset to D3D10_SHADER_DEBUG_SCOPE_INFO[Scopes] - UINT ScopeVariables; // number of variables declared - UINT ScopeVariableInfo; // Offset to D3D10_SHADER_DEBUG_SCOPEVAR_INFO[Scopes] - UINT UintOffset; // Offset to the UINT datastore, all UINT offsets are from this offset - UINT StringOffset; // Offset to the string datastore, all string offsets are from this offset -} D3D10_SHADER_DEBUG_INFO; - -//---------------------------------------------------------------------------- -// ID3D10ShaderReflection1: -//---------------------------------------------------------------------------- - -// -// Interface definitions -// - -typedef interface ID3D10ShaderReflection1 ID3D10ShaderReflection1; -typedef interface ID3D10ShaderReflection1 *LPD3D10SHADERREFLECTION1; - -// {C3457783-A846-47CE-9520-CEA6F66E7447} -DEFINE_GUID(IID_ID3D10ShaderReflection1, -0xc3457783, 0xa846, 0x47ce, 0x95, 0x20, 0xce, 0xa6, 0xf6, 0x6e, 0x74, 0x47); - -#undef INTERFACE -#define INTERFACE ID3D10ShaderReflection1 - -DECLARE_INTERFACE_(ID3D10ShaderReflection1, 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; - - STDMETHOD_(ID3D10ShaderReflectionVariable*, GetVariableByName)(THIS_ LPCSTR Name) PURE; - - STDMETHOD(GetResourceBindingDescByName)(THIS_ LPCSTR Name, D3D10_SHADER_INPUT_BIND_DESC *pDesc) PURE; - - STDMETHOD(GetMovInstructionCount)(THIS_ UINT* pCount) PURE; - STDMETHOD(GetMovcInstructionCount)(THIS_ UINT* pCount) PURE; - STDMETHOD(GetConversionInstructionCount)(THIS_ UINT* pCount) PURE; - STDMETHOD(GetBitwiseInstructionCount)(THIS_ UINT* pCount) PURE; - - STDMETHOD(GetGSInputPrimitive)(THIS_ D3D10_PRIMITIVE* pPrim) PURE; - STDMETHOD(IsLevel9Shader)(THIS_ BOOL* pbLevel9Shader) PURE; - STDMETHOD(IsSampleFrequencyShader)(THIS_ BOOL* pbSampleFrequency) PURE; -}; - -////////////////////////////////////////////////////////////////////////////// -// APIs ////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -#ifdef __cplusplus -extern "C" { -#endif //__cplusplus - -#ifdef __cplusplus -} -#endif //__cplusplus - -#endif //__D3D10_1SHADER_H__ - diff --git a/Include/TlHelp32.h b/Include/TlHelp32.h new file mode 100644 index 0000000..5167904 --- /dev/null +++ b/Include/TlHelp32.h @@ -0,0 +1,317 @@ +/*****************************************************************************\ +* * +* tlhelp32.h - WIN32 tool help functions, types, and definitions * +* * +* Version 1.0 * +* * +* NOTE: windows.h/winbase.h must be #included first * +* * +* Copyright (c) Microsoft Corp. All rights reserved. * +* * +\*****************************************************************************/ + +#ifndef _INC_TOOLHELP32 +#define _INC_TOOLHELP32 + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifdef __cplusplus +extern "C" { /* Assume C declarations for C++ */ +#endif /* __cplusplus */ + +#define MAX_MODULE_NAME32 255 + +/****** Shapshot function **********************************************/ + +HANDLE +WINAPI +CreateToolhelp32Snapshot( + DWORD dwFlags, + DWORD th32ProcessID + ); + +// +// The th32ProcessID argument is only used if TH32CS_SNAPHEAPLIST or +// TH32CS_SNAPMODULE is specified. th32ProcessID == 0 means the current +// process. +// +// NOTE that all of the snapshots are global except for the heap and module +// lists which are process specific. To enumerate the heap or module +// state for all WIN32 processes call with TH32CS_SNAPALL and the +// current process. Then for each process in the TH32CS_SNAPPROCESS +// list that isn't the current process, do a call with just +// TH32CS_SNAPHEAPLIST and/or TH32CS_SNAPMODULE. +// +// dwFlags +// +#define TH32CS_SNAPHEAPLIST 0x00000001 +#define TH32CS_SNAPPROCESS 0x00000002 +#define TH32CS_SNAPTHREAD 0x00000004 +#define TH32CS_SNAPMODULE 0x00000008 +#define TH32CS_SNAPMODULE32 0x00000010 +#define TH32CS_SNAPALL (TH32CS_SNAPHEAPLIST | TH32CS_SNAPPROCESS | TH32CS_SNAPTHREAD | TH32CS_SNAPMODULE) +#define TH32CS_INHERIT 0x80000000 +// +// Use CloseHandle to destroy the snapshot +// + +/****** heap walking ***************************************************/ + +typedef struct tagHEAPLIST32 +{ + SIZE_T dwSize; + DWORD th32ProcessID; // owning process + ULONG_PTR th32HeapID; // heap (in owning process's context!) + DWORD dwFlags; +} HEAPLIST32; +typedef HEAPLIST32 * PHEAPLIST32; +typedef HEAPLIST32 * LPHEAPLIST32; +// +// dwFlags +// +#define HF32_DEFAULT 1 // process's default heap +#define HF32_SHARED 2 // is shared heap + +BOOL +WINAPI +Heap32ListFirst( + HANDLE hSnapshot, + LPHEAPLIST32 lphl + ); + +BOOL +WINAPI +Heap32ListNext( + HANDLE hSnapshot, + LPHEAPLIST32 lphl + ); + +typedef struct tagHEAPENTRY32 +{ + SIZE_T dwSize; + HANDLE hHandle; // Handle of this heap block + ULONG_PTR dwAddress; // Linear address of start of block + SIZE_T dwBlockSize; // Size of block in bytes + DWORD dwFlags; + DWORD dwLockCount; + DWORD dwResvd; + DWORD th32ProcessID; // owning process + ULONG_PTR th32HeapID; // heap block is in +} HEAPENTRY32; +typedef HEAPENTRY32 * PHEAPENTRY32; +typedef HEAPENTRY32 * LPHEAPENTRY32; +// +// dwFlags +// +#define LF32_FIXED 0x00000001 +#define LF32_FREE 0x00000002 +#define LF32_MOVEABLE 0x00000004 + +BOOL +WINAPI +Heap32First( + LPHEAPENTRY32 lphe, + DWORD th32ProcessID, + ULONG_PTR th32HeapID + ); + +BOOL +WINAPI +Heap32Next( + LPHEAPENTRY32 lphe + ); + +BOOL +WINAPI +Toolhelp32ReadProcessMemory( + DWORD th32ProcessID, + LPCVOID lpBaseAddress, + LPVOID lpBuffer, + SIZE_T cbRead, + SIZE_T *lpNumberOfBytesRead + ); + +/***** Process walking *************************************************/ + +typedef struct tagPROCESSENTRY32W +{ + DWORD dwSize; + DWORD cntUsage; + DWORD th32ProcessID; // this process + ULONG_PTR th32DefaultHeapID; + DWORD th32ModuleID; // associated exe + DWORD cntThreads; + DWORD th32ParentProcessID; // this process's parent process + LONG pcPriClassBase; // Base priority of process's threads + DWORD dwFlags; + WCHAR szExeFile[MAX_PATH]; // Path +} PROCESSENTRY32W; +typedef PROCESSENTRY32W * PPROCESSENTRY32W; +typedef PROCESSENTRY32W * LPPROCESSENTRY32W; + +BOOL +WINAPI +Process32FirstW( + HANDLE hSnapshot, + LPPROCESSENTRY32W lppe + ); + +BOOL +WINAPI +Process32NextW( + HANDLE hSnapshot, + LPPROCESSENTRY32W lppe + ); + +typedef struct tagPROCESSENTRY32 +{ + DWORD dwSize; + DWORD cntUsage; + DWORD th32ProcessID; // this process + ULONG_PTR th32DefaultHeapID; + DWORD th32ModuleID; // associated exe + DWORD cntThreads; + DWORD th32ParentProcessID; // this process's parent process + LONG pcPriClassBase; // Base priority of process's threads + DWORD dwFlags; + CHAR szExeFile[MAX_PATH]; // Path +} PROCESSENTRY32; +typedef PROCESSENTRY32 * PPROCESSENTRY32; +typedef PROCESSENTRY32 * LPPROCESSENTRY32; + +BOOL +WINAPI +Process32First( + HANDLE hSnapshot, + LPPROCESSENTRY32 lppe + ); + +BOOL +WINAPI +Process32Next( + HANDLE hSnapshot, + LPPROCESSENTRY32 lppe + ); + +#ifdef UNICODE +#define Process32First Process32FirstW +#define Process32Next Process32NextW +#define PROCESSENTRY32 PROCESSENTRY32W +#define PPROCESSENTRY32 PPROCESSENTRY32W +#define LPPROCESSENTRY32 LPPROCESSENTRY32W +#endif // !UNICODE + +/***** Thread walking **************************************************/ + +typedef struct tagTHREADENTRY32 +{ + DWORD dwSize; + DWORD cntUsage; + DWORD th32ThreadID; // this thread + DWORD th32OwnerProcessID; // Process this thread is associated with + LONG tpBasePri; + LONG tpDeltaPri; + DWORD dwFlags; +} THREADENTRY32; +typedef THREADENTRY32 * PTHREADENTRY32; +typedef THREADENTRY32 * LPTHREADENTRY32; + +BOOL +WINAPI +Thread32First( + HANDLE hSnapshot, + LPTHREADENTRY32 lpte + ); + +BOOL +WINAPI +Thread32Next( + HANDLE hSnapshot, + LPTHREADENTRY32 lpte + ); + +/***** Module walking *************************************************/ + +typedef struct tagMODULEENTRY32W +{ + DWORD dwSize; + DWORD th32ModuleID; // This module + DWORD th32ProcessID; // owning process + DWORD GlblcntUsage; // Global usage count on the module + DWORD ProccntUsage; // Module usage count in th32ProcessID's context + BYTE * modBaseAddr; // Base address of module in th32ProcessID's context + DWORD modBaseSize; // Size in bytes of module starting at modBaseAddr + HMODULE hModule; // The hModule of this module in th32ProcessID's context + WCHAR szModule[MAX_MODULE_NAME32 + 1]; + WCHAR szExePath[MAX_PATH]; +} MODULEENTRY32W; +typedef MODULEENTRY32W * PMODULEENTRY32W; +typedef MODULEENTRY32W * LPMODULEENTRY32W; + +BOOL +WINAPI +Module32FirstW( + HANDLE hSnapshot, + LPMODULEENTRY32W lpme + ); + +BOOL +WINAPI +Module32NextW( + HANDLE hSnapshot, + LPMODULEENTRY32W lpme + ); + + +typedef struct tagMODULEENTRY32 +{ + DWORD dwSize; + DWORD th32ModuleID; // This module + DWORD th32ProcessID; // owning process + DWORD GlblcntUsage; // Global usage count on the module + DWORD ProccntUsage; // Module usage count in th32ProcessID's context + BYTE * modBaseAddr; // Base address of module in th32ProcessID's context + DWORD modBaseSize; // Size in bytes of module starting at modBaseAddr + HMODULE hModule; // The hModule of this module in th32ProcessID's context + char szModule[MAX_MODULE_NAME32 + 1]; + char szExePath[MAX_PATH]; +} MODULEENTRY32; +typedef MODULEENTRY32 * PMODULEENTRY32; +typedef MODULEENTRY32 * LPMODULEENTRY32; + +// +// NOTE CAREFULLY that the modBaseAddr and hModule fields are valid ONLY +// in th32ProcessID's process context. +// + +BOOL +WINAPI +Module32First( + HANDLE hSnapshot, + LPMODULEENTRY32 lpme + ); + +BOOL +WINAPI +Module32Next( + HANDLE hSnapshot, + LPMODULEENTRY32 lpme + ); + +#ifdef UNICODE +#define Module32First Module32FirstW +#define Module32Next Module32NextW +#define MODULEENTRY32 MODULEENTRY32W +#define PMODULEENTRY32 PMODULEENTRY32W +#define LPMODULEENTRY32 LPMODULEENTRY32W +#endif // !UNICODE + + +#ifdef __cplusplus +} +#endif + +#endif // _INC_TOOLHELP32 + diff --git a/Include/d3d9.wine.h b/Include/d3d9.wine.h new file mode 100644 index 0000000..08a048d --- /dev/null +++ b/Include/d3d9.wine.h @@ -0,0 +1,2045 @@ +/* + * Copyright (C) 2002-2003 Jason Edmeades + * Raphael Junqueira + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __WINE_D3D9_H +#define __WINE_D3D9_H + +#ifndef DIRECT3D_VERSION +#define DIRECT3D_VERSION 0x0900 +#endif + +#include + +#define COM_NO_WINDOWS_H +#include +#include +#include +#include + +/***************************************************************************** + * Behavior Flags for IDirect3D8::CreateDevice + */ +#define D3DCREATE_FPU_PRESERVE __MSABI_LONG(0x00000002) +#define D3DCREATE_MULTITHREADED __MSABI_LONG(0x00000004) +#define D3DCREATE_PUREDEVICE __MSABI_LONG(0x00000010) +#define D3DCREATE_SOFTWARE_VERTEXPROCESSING __MSABI_LONG(0x00000020) +#define D3DCREATE_HARDWARE_VERTEXPROCESSING __MSABI_LONG(0x00000040) +#define D3DCREATE_MIXED_VERTEXPROCESSING __MSABI_LONG(0x00000080) +#define D3DCREATE_DISABLE_DRIVER_MANAGEMENT __MSABI_LONG(0x00000100) +#define D3DCREATE_ADAPTERGROUP_DEVICE __MSABI_LONG(0x00000200) +#define D3DCREATE_DISABLE_DRIVER_MANAGEMENT_EX __MSABI_LONG(0x00000400) +#define D3DCREATE_NOWINDOWCHANGES __MSABI_LONG(0x00000800) +#define D3DCREATE_DISABLE_PSGP_THREADING __MSABI_LONG(0x00002000) +#define D3DCREATE_ENABLE_PRESENTSTATS __MSABI_LONG(0x00004000) +#define D3DCREATE_DISABLE_PRINTSCREEN __MSABI_LONG(0x00008000) +#define D3DCREATE_SCREENSAVER __MSABI_LONG(0x10000000) + +/***************************************************************************** + * Flags for SetPrivateData + */ +#define D3DSPD_IUNKNOWN __MSABI_LONG(0x00000001) + + +/***************************************************************************** + * #defines and error codes + */ +#define D3D_SDK_VERSION 32 +#define D3DADAPTER_DEFAULT 0 +#define D3DENUM_NO_WHQL_LEVEL __MSABI_LONG(0x00000002) +#define D3DPRESENT_BACK_BUFFERS_MAX __MSABI_LONG(3) +#define D3DSGR_NO_CALIBRATION __MSABI_LONG(0x00000000) +#define D3DSGR_CALIBRATE __MSABI_LONG(0x00000001) + +#define _FACD3D 0x876 +#define MAKE_D3DHRESULT( code ) MAKE_HRESULT( 1, _FACD3D, code ) +#define MAKE_D3DSTATUS( code ) MAKE_HRESULT( 0, _FACD3D, code ) + +/***************************************************************************** + * Direct3D Errors + */ +#define D3D_OK S_OK +#define D3DERR_WRONGTEXTUREFORMAT MAKE_D3DHRESULT(2072) +#define D3DERR_UNSUPPORTEDCOLOROPERATION MAKE_D3DHRESULT(2073) +#define D3DERR_UNSUPPORTEDCOLORARG MAKE_D3DHRESULT(2074) +#define D3DERR_UNSUPPORTEDALPHAOPERATION MAKE_D3DHRESULT(2075) +#define D3DERR_UNSUPPORTEDALPHAARG MAKE_D3DHRESULT(2076) +#define D3DERR_TOOMANYOPERATIONS MAKE_D3DHRESULT(2077) +#define D3DERR_CONFLICTINGTEXTUREFILTER MAKE_D3DHRESULT(2078) +#define D3DERR_UNSUPPORTEDFACTORVALUE MAKE_D3DHRESULT(2079) +#define D3DERR_CONFLICTINGRENDERSTATE MAKE_D3DHRESULT(2081) +#define D3DERR_UNSUPPORTEDTEXTUREFILTER MAKE_D3DHRESULT(2082) +#define D3DERR_CONFLICTINGTEXTUREPALETTE MAKE_D3DHRESULT(2086) +#define D3DERR_DRIVERINTERNALERROR MAKE_D3DHRESULT(2087) +#define D3DERR_NOTFOUND MAKE_D3DHRESULT(2150) +#define D3DERR_MOREDATA MAKE_D3DHRESULT(2151) +#define D3DERR_DEVICELOST MAKE_D3DHRESULT(2152) +#define D3DERR_DEVICENOTRESET MAKE_D3DHRESULT(2153) +#define D3DERR_NOTAVAILABLE MAKE_D3DHRESULT(2154) +#define D3DERR_OUTOFVIDEOMEMORY MAKE_D3DHRESULT(380) +#define D3DERR_INVALIDDEVICE MAKE_D3DHRESULT(2155) +#define D3DERR_INVALIDCALL MAKE_D3DHRESULT(2156) +#define D3DERR_DRIVERINVALIDCALL MAKE_D3DHRESULT(2157) +#define D3DERR_WASSTILLDRAWING MAKE_D3DHRESULT(540) +#define D3DOK_NOAUTOGEN MAKE_D3DSTATUS(2159) + +#define D3DERR_DEVICEREMOVED MAKE_D3DHRESULT(2160) +#define D3DERR_DEVICEHUNG MAKE_D3DHRESULT(2164) +#define S_NOT_RESIDENT MAKE_D3DSTATUS(2165) +#define S_RESIDENT_IN_SHARED_MEMORY MAKE_D3DSTATUS(2166) +#define S_PRESENT_MODE_CHANGED MAKE_D3DSTATUS(2167) +#define S_PRESENT_OCCLUDED MAKE_D3DSTATUS(2168) +#define D3DERR_UNSUPPORTEDOVERLAY MAKE_D3DHRESULT(2171) +#define D3DERR_UNSUPPORTEDOVERLAYFORMAT MAKE_D3DHRESULT(2172) +#define D3DERR_CANNOTPROTECTCONTENT MAKE_D3DHRESULT(2173) +#define D3DERR_UNSUPPORTEDCRYPTO MAKE_D3DHRESULT(2174) +#define D3DERR_PRESENT_STATISTICS_DISJOINT MAKE_D3DHRESULT(2180) + + +/***************************************************************************** + * Predeclare the interfaces + */ +DEFINE_GUID(IID_IDirect3D9, 0x81BDCBCA, 0x64D4, 0x426D, 0xAE, 0x8D, 0xAD, 0x1, 0x47, 0xF4, 0x27, 0x5C); +typedef struct IDirect3D9 *LPDIRECT3D9, *PDIRECT3D9; + +DEFINE_GUID(IID_IDirect3D9Ex, 0x02177241, 0x69FC, 0x400C, 0x8F, 0xF1, 0x93, 0xA4, 0x4D, 0xF6, 0x86, 0x1D); +typedef struct IDirect3D9Ex *LPDIRECT3D9EX, *PDIRECT3D9EX; + +DEFINE_GUID(IID_IDirect3DDevice9, 0xd0223b96, 0xbf7a, 0x43fd, 0x92, 0xbd, 0xa4, 0x3b, 0xd, 0x82, 0xb9, 0xeb); +typedef struct IDirect3DDevice9 *LPDIRECT3DDEVICE9; + +DEFINE_GUID(IID_IDirect3DDevice9Ex, 0xb18b10ce, 0x2649, 0x405a, 0x87, 0xf, 0x95, 0xf7, 0x77, 0xd4, 0x31, 0x3a); +typedef struct IDirect3DDevice9Ex *LPDIRECT3DDEVICE9EX, *PDIRECT3DDEVICE9EX; + +DEFINE_GUID(IID_IDirect3DResource9, 0x5eec05d, 0x8f7d, 0x4362, 0xb9, 0x99, 0xd1, 0xba, 0xf3, 0x57, 0xc7, 0x4); +typedef struct IDirect3DResource9 *LPDIRECT3DRESOURCE9, *PDIRECT3DRESOURCE9; + +DEFINE_GUID(IID_IDirect3DVertexBuffer9, 0xb64bb1b5, 0xfd70, 0x4df6, 0xbf, 0x91, 0x19, 0xd0, 0xa1, 0x24, 0x55, 0xe3); +typedef struct IDirect3DVertexBuffer9 *LPDIRECT3DVERTEXBUFFER9, *PDIRECT3DVERTEXBUFFER9; + +DEFINE_GUID(IID_IDirect3DVolume9, 0x24f416e6, 0x1f67, 0x4aa7, 0xb8, 0x8e, 0xd3, 0x3f, 0x6f, 0x31, 0x28, 0xa1); +typedef struct IDirect3DVolume9 *LPDIRECT3DVOLUME9, *PDIRECT3DVOLUME9; + +DEFINE_GUID(IID_IDirect3DSwapChain9, 0x794950f2, 0xadfc, 0x458a, 0x90, 0x5e, 0x10, 0xa1, 0xb, 0xb, 0x50, 0x3b); +typedef struct IDirect3DSwapChain9 *LPDIRECT3DSWAPCHAIN9, *PDIRECT3DSWAPCHAIN9; + +DEFINE_GUID(IID_IDirect3DSwapChain9Ex, 0x91886caf, 0x1c3d, 0x4d2e, 0xa0, 0xab, 0x3e, 0x4c, 0x7d, 0x8d, 0x33, 0x3); +typedef struct IDirect3DSwapChain9Ex *LPDIRECT3DSWAPCHAIN9EX, *PDIRECT3DSWAPCHAIN9EX; + +DEFINE_GUID(IID_IDirect3DSurface9, 0xcfbaf3a, 0x9ff6, 0x429a, 0x99, 0xb3, 0xa2, 0x79, 0x6a, 0xf8, 0xb8, 0x9b); +typedef struct IDirect3DSurface9 *LPDIRECT3DSURFACE9, *PDIRECT3DSURFACE9; + +DEFINE_GUID(IID_IDirect3DIndexBuffer9, 0x7c9dd65e, 0xd3f7, 0x4529, 0xac, 0xee, 0x78, 0x58, 0x30, 0xac, 0xde, 0x35); +typedef struct IDirect3DIndexBuffer9 *LPDIRECT3DINDEXBUFFER9, *PDIRECT3DINDEXBUFFER9; + +DEFINE_GUID(IID_IDirect3DBaseTexture9, 0x580ca87e, 0x1d3c, 0x4d54, 0x99, 0x1d, 0xb7, 0xd3, 0xe3, 0xc2, 0x98, 0xce); +typedef struct IDirect3DBaseTexture9 *LPDIRECT3DBASETEXTURE9, *PDIRECT3DBASETEXTURE9; + +DEFINE_GUID(IID_IDirect3DTexture9, 0x85c31227, 0x3de5, 0x4f00, 0x9b, 0x3a, 0xf1, 0x1a, 0xc3, 0x8c, 0x18, 0xb5); +typedef struct IDirect3DTexture9 *LPDIRECT3DTEXTURE9, *PDIRECT3DTEXTURE9; + +DEFINE_GUID(IID_IDirect3DCubeTexture9, 0xfff32f81, 0xd953, 0x473a, 0x92, 0x23, 0x93, 0xd6, 0x52, 0xab, 0xa9, 0x3f); +typedef struct IDirect3DCubeTexture9 *LPDIRECT3DCUBETEXTURE9, *PDIRECT3DCUBETEXTURE9; + +DEFINE_GUID(IID_IDirect3DVolumeTexture9, 0x2518526c, 0xe789, 0x4111, 0xa7, 0xb9, 0x47, 0xef, 0x32, 0x8d, 0x13, 0xe6); +typedef struct IDirect3DVolumeTexture9 *LPDIRECT3DVOLUMETEXTURE9, *PDIRECT3DVOLUMETEXTURE9; + +DEFINE_GUID(IID_IDirect3DVertexDeclaration9, 0xdd13c59c, 0x36fa, 0x4098, 0xa8, 0xfb, 0xc7, 0xed, 0x39, 0xdc, 0x85, 0x46); +typedef struct IDirect3DVertexDeclaration9 *LPDIRECT3DVERTEXDECLARATION9; + +DEFINE_GUID(IID_IDirect3DVertexShader9, 0xefc5557e, 0x6265, 0x4613, 0x8a, 0x94, 0x43, 0x85, 0x78, 0x89, 0xeb, 0x36); +typedef struct IDirect3DVertexShader9 *LPDIRECT3DVERTEXSHADER9; + +DEFINE_GUID(IID_IDirect3DPixelShader9, 0x6d3bdbdc, 0x5b02, 0x4415, 0xb8, 0x52, 0xce, 0x5e, 0x8b, 0xcc, 0xb2, 0x89); +typedef struct IDirect3DPixelShader9 *LPDIRECT3DPIXELSHADER9; + +DEFINE_GUID(IID_IDirect3DStateBlock9, 0xb07c4fe5, 0x310d, 0x4ba8, 0xa2, 0x3c, 0x4f, 0xf, 0x20, 0x6f, 0x21, 0x8b); +typedef struct IDirect3DStateBlock9 *LPDIRECT3DSTATEBLOCK9; + +DEFINE_GUID(IID_IDirect3DQuery9, 0xd9771460, 0xa695, 0x4f26, 0xbb, 0xd3, 0x27, 0xb8, 0x40, 0xb5, 0x41, 0xcc); +typedef struct IDirect3DQuery9 *LPDIRECT3DQUERY9, *PDIRECT3DQUERY9; + +/***************************************************************************** + * IDirect3D9 interface + */ +#undef INTERFACE +#define INTERFACE IDirect3D9 +DECLARE_INTERFACE_(IDirect3D9,IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3D9 methods ***/ + STDMETHOD(RegisterSoftwareDevice)(THIS_ void* pInitializeFunction) PURE; + STDMETHOD_(UINT, GetAdapterCount)(THIS) PURE; + STDMETHOD(GetAdapterIdentifier)(THIS_ UINT Adapter, DWORD Flags, D3DADAPTER_IDENTIFIER9* pIdentifier) PURE; + STDMETHOD_(UINT, GetAdapterModeCount)(THIS_ UINT Adapter, D3DFORMAT Format) PURE; + STDMETHOD(EnumAdapterModes)(THIS_ UINT Adapter, D3DFORMAT Format, UINT Mode, D3DDISPLAYMODE* pMode) PURE; + STDMETHOD(GetAdapterDisplayMode)(THIS_ UINT Adapter, D3DDISPLAYMODE* pMode) PURE; + STDMETHOD(CheckDeviceType)(THIS_ UINT iAdapter, D3DDEVTYPE DevType, D3DFORMAT DisplayFormat, D3DFORMAT BackBufferFormat, BOOL bWindowed) PURE; + STDMETHOD(CheckDeviceFormat)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat) PURE; + STDMETHOD(CheckDeviceMultiSampleType)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat, BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType, DWORD* pQualityLevels) PURE; + STDMETHOD(CheckDepthStencilMatch)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat) PURE; + STDMETHOD(CheckDeviceFormatConversion)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SourceFormat, D3DFORMAT TargetFormat) PURE; + STDMETHOD(GetDeviceCaps)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS9* pCaps) PURE; + STDMETHOD_(HMONITOR, GetAdapterMonitor)(THIS_ UINT Adapter) PURE; + STDMETHOD(CreateDevice)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, struct IDirect3DDevice9** ppReturnedDeviceInterface) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3D9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3D9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3D9_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3D9 methods ***/ +#define IDirect3D9_RegisterSoftwareDevice(p,a) (p)->lpVtbl->RegisterSoftwareDevice(p,a) +#define IDirect3D9_GetAdapterCount(p) (p)->lpVtbl->GetAdapterCount(p) +#define IDirect3D9_GetAdapterIdentifier(p,a,b,c) (p)->lpVtbl->GetAdapterIdentifier(p,a,b,c) +#define IDirect3D9_GetAdapterModeCount(p,a,b) (p)->lpVtbl->GetAdapterModeCount(p,a,b) +#define IDirect3D9_EnumAdapterModes(p,a,b,c,d) (p)->lpVtbl->EnumAdapterModes(p,a,b,c,d) +#define IDirect3D9_GetAdapterDisplayMode(p,a,b) (p)->lpVtbl->GetAdapterDisplayMode(p,a,b) +#define IDirect3D9_CheckDeviceType(p,a,b,c,d,e) (p)->lpVtbl->CheckDeviceType(p,a,b,c,d,e) +#define IDirect3D9_CheckDeviceFormat(p,a,b,c,d,e,f) (p)->lpVtbl->CheckDeviceFormat(p,a,b,c,d,e,f) +#define IDirect3D9_CheckDeviceMultiSampleType(p,a,b,c,d,e,f) (p)->lpVtbl->CheckDeviceMultiSampleType(p,a,b,c,d,e,f) +#define IDirect3D9_CheckDepthStencilMatch(p,a,b,c,d,e) (p)->lpVtbl->CheckDepthStencilMatch(p,a,b,c,d,e) +#define IDirect3D9_CheckDeviceFormatConversion(p,a,b,c,d) (p)->lpVtbl->CheckDeviceFormatConversion(p,a,b,c,d) +#define IDirect3D9_GetDeviceCaps(p,a,b,c) (p)->lpVtbl->GetDeviceCaps(p,a,b,c) +#define IDirect3D9_GetAdapterMonitor(p,a) (p)->lpVtbl->GetAdapterMonitor(p,a) +#define IDirect3D9_CreateDevice(p,a,b,c,d,e,f) (p)->lpVtbl->CreateDevice(p,a,b,c,d,e,f) +#else +/*** IUnknown methods ***/ +#define IDirect3D9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3D9_AddRef(p) (p)->AddRef() +#define IDirect3D9_Release(p) (p)->Release() +/*** IDirect3D9 methods ***/ +#define IDirect3D9_RegisterSoftwareDevice(p,a) (p)->RegisterSoftwareDevice(a) +#define IDirect3D9_GetAdapterCount(p) (p)->GetAdapterCount() +#define IDirect3D9_GetAdapterIdentifier(p,a,b,c) (p)->GetAdapterIdentifier(a,b,c) +#define IDirect3D9_GetAdapterModeCount(p,a,b) (p)->GetAdapterModeCount(a,b) +#define IDirect3D9_EnumAdapterModes(p,a,b,c,d) (p)->EnumAdapterModes(a,b,c,d) +#define IDirect3D9_GetAdapterDisplayMode(p,a,b) (p)->GetAdapterDisplayMode(a,b) +#define IDirect3D9_CheckDeviceType(p,a,b,c,d,e) (p)->CheckDeviceType(a,b,c,d,e) +#define IDirect3D9_CheckDeviceFormat(p,a,b,c,d,e,f) (p)->CheckDeviceFormat(a,b,c,d,e,f) +#define IDirect3D9_CheckDeviceMultiSampleType(p,a,b,c,d,e,f) (p)->CheckDeviceMultiSampleType(a,b,c,d,e,f) +#define IDirect3D9_CheckDepthStencilMatch(p,a,b,c,d,e) (p)->CheckDepthStencilMatch(a,b,c,d,e) +#define IDirect3D9_CheckDeviceFormatConversion(p,a,b,c,d) (p)->CheckDeviceFormatConversion(a,b,c,d) +#define IDirect3D9_GetDeviceCaps(p,a,b,c) (p)->GetDeviceCaps(a,b,c) +#define IDirect3D9_GetAdapterMonitor(p,a) (p)->GetAdapterMonitor(a) +#define IDirect3D9_CreateDevice(p,a,b,c,d,e,f) (p)->CreateDevice(a,b,c,d,e,f) +#endif + +/***************************************************************************** + * IDirect3D9Ex interface + */ +#define INTERFACE IDirect3D9Ex +DECLARE_INTERFACE_(IDirect3D9Ex,IDirect3D9) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3D9 methods ***/ + + /* Note: Microsoft's d3d9.h does not declare IDirect3D9Ex::RegisterSoftwareDevice . This would mean that + * the offsets of the other methods in the Vtable change too. This is wrong. In Microsoft's + * d3d9.dll, the offsets for the other functions are still compatible with IDirect3D9. + * This is probably because even in MS header IDirect3D9Ex inherits from IDirect3D9, which makes the + * C++ interface compatible, and nobody uses the C interface in Windows world. + */ + STDMETHOD(RegisterSoftwareDevice)(THIS_ void* pInitializeFunction) PURE; + + STDMETHOD_(UINT, GetAdapterCount)(THIS) PURE; + STDMETHOD(GetAdapterIdentifier)(THIS_ UINT Adapter, DWORD Flags, D3DADAPTER_IDENTIFIER9* pIdentifier) PURE; + STDMETHOD_(UINT, GetAdapterModeCount)(THIS_ UINT Adapter, D3DFORMAT Format) PURE; + STDMETHOD(EnumAdapterModes)(THIS_ UINT Adapter, D3DFORMAT Format, UINT Mode, D3DDISPLAYMODE* pMode) PURE; + STDMETHOD(GetAdapterDisplayMode)(THIS_ UINT Adapter, D3DDISPLAYMODE* pMode) PURE; + STDMETHOD(CheckDeviceType)(THIS_ UINT iAdapter, D3DDEVTYPE DevType, D3DFORMAT DisplayFormat, D3DFORMAT BackBufferFormat, BOOL bWindowed) PURE; + STDMETHOD(CheckDeviceFormat)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat) PURE; + STDMETHOD(CheckDeviceMultiSampleType)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat, BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType, DWORD* pQualityLevels) PURE; + STDMETHOD(CheckDepthStencilMatch)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat) PURE; + STDMETHOD(CheckDeviceFormatConversion)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SourceFormat, D3DFORMAT TargetFormat) PURE; + STDMETHOD(GetDeviceCaps)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS9* pCaps) PURE; + STDMETHOD_(HMONITOR, GetAdapterMonitor)(THIS_ UINT Adapter) PURE; + STDMETHOD(CreateDevice)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, struct IDirect3DDevice9** ppReturnedDeviceInterface) PURE; + /*** IDirect3D9Ex methods ***/ + //STDMETHOD_(UINT, GetAdapterModeCountEx)(THIS_ UINT Adapter, CONST D3DDISPLAYMODEFILTER *pFilter) PURE; + //STDMETHOD(EnumAdapterModesEx)(THIS_ UINT Adapter, CONST D3DDISPLAYMODEFILTER *pFilter, UINT Mode, D3DDISPLAYMODEEX* pMode) PURE; + STDMETHOD(GetAdapterDisplayModeEx)(THIS_ UINT Adapter, D3DDISPLAYMODEEX *pMode, D3DDISPLAYROTATION *pRotation); + STDMETHOD(CreateDeviceEx)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, D3DDISPLAYMODEEX* pFullscreenDisplayMode, struct IDirect3DDevice9Ex **ppReturnedDeviceInterface) PURE; + STDMETHOD(GetAdapterLUID)(THIS_ UINT Adatper, LUID *pLUID) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3D9Ex_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3D9Ex_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3D9Ex_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3D9 methods ***/ +#define IDirect3D9Ex_RegisterSoftwareDevice(p,a) (p)->lpVtbl->RegisterSoftwareDevice(p,a) +#define IDirect3D9Ex_GetAdapterCount(p) (p)->lpVtbl->GetAdapterCount(p) +#define IDirect3D9Ex_GetAdapterIdentifier(p,a,b,c) (p)->lpVtbl->GetAdapterIdentifier(p,a,b,c) +#define IDirect3D9Ex_GetAdapterModeCount(p,a,b) (p)->lpVtbl->GetAdapterModeCount(p,a,b) +#define IDirect3D9Ex_EnumAdapterModes(p,a,b,c,d) (p)->lpVtbl->EnumAdapterModes(p,a,b,c,d) +#define IDirect3D9Ex_GetAdapterDisplayMode(p,a,b) (p)->lpVtbl->GetAdapterDisplayMode(p,a,b) +#define IDirect3D9Ex_CheckDeviceType(p,a,b,c,d,e) (p)->lpVtbl->CheckDeviceType(p,a,b,c,d,e) +#define IDirect3D9Ex_CheckDeviceFormat(p,a,b,c,d,e,f) (p)->lpVtbl->CheckDeviceFormat(p,a,b,c,d,e,f) +#define IDirect3D9Ex_CheckDeviceMultiSampleType(p,a,b,c,d,e,f) (p)->lpVtbl->CheckDeviceMultiSampleType(p,a,b,c,d,e,f) +#define IDirect3D9Ex_CheckDepthStencilMatch(p,a,b,c,d,e) (p)->lpVtbl->CheckDepthStencilMatch(p,a,b,c,d,e) +#define IDirect3D9Ex_CheckDeviceFormatConversion(p,a,b,c,d) (p)->lpVtbl->CheckDeviceFormatConversion(p,a,b,c,d) +#define IDirect3D9Ex_GetDeviceCaps(p,a,b,c) (p)->lpVtbl->GetDeviceCaps(p,a,b,c) +#define IDirect3D9Ex_GetAdapterMonitor(p,a) (p)->lpVtbl->GetAdapterMonitor(p,a) +#define IDirect3D9Ex_CreateDevice(p,a,b,c,d,e,f) (p)->lpVtbl->CreateDevice(p,a,b,c,d,e,f) +/*** IDirect3D9Ex methods ***/ +#define IDirect3D9Ex_GetAdapterModeCountEx(p,a,b) (p)->lpVtbl->GetAdapterModeCountEx(p,a,b) +#define IDirect3D9Ex_EnumAdapterModesEx(p,a,b,c,d) (p)->lpVtbl->EnumAdapterModesEx(p,a,b,c,d) +#define IDirect3D9Ex_GetAdapterDisplayModeEx(p,a,b,c) (p)->lpVtbl->GetAdapterDisplayModeEx(p,a,b,c) +#define IDirect3D9Ex_CreateDeviceEx(p,a,b,c,d,e,f,g) (p)->lpVtbl->CreateDeviceEx(p,a,b,c,d,e,f,g) +#define IDirect3D9Ex_GetAdapterLUID(p,a,b) (p)->lpVtbl->GetAdapterLUID(p,a,b) +#else +/*** IUnknown methods ***/ +#define IDirect3D9Ex_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3D9Ex_AddRef(p) (p)->AddRef() +#define IDirect3D9Ex_Release(p) (p)->Release() +/*** IDirect3D9 methods ***/ +#define IDirect3D9Ex_RegisterSoftwareDevice(p,a) (p)->RegisterSoftwareDevice(a) +#define IDirect3D9Ex_GetAdapterCount(p) (p)->GetAdapterCount() +#define IDirect3D9Ex_GetAdapterIdentifier(p,a,b,c) (p)->GetAdapterIdentifier(a,b,c) +#define IDirect3D9Ex_GetAdapterModeCount(p,a,b) (p)->GetAdapterModeCount(a,b) +#define IDirect3D9Ex_EnumAdapterModes(p,a,b,c,d) (p)->EnumAdapterModes(a,b,c,d) +#define IDirect3D9Ex_GetAdapterDisplayMode(p,a,b) (p)->GetAdapterDisplayMode(a,b) +#define IDirect3D9Ex_CheckDeviceType(p,a,b,c,d,e) (p)->CheckDeviceType(a,b,c,d,e) +#define IDirect3D9Ex_CheckDeviceFormat(p,a,b,c,d,e,f) (p)->CheckDeviceFormat(a,b,c,d,e,f) +#define IDirect3D9Ex_CheckDeviceMultiSampleType(p,a,b,c,d,e,f) (p)->CheckDeviceMultiSampleType(a,b,c,d,e,f) +#define IDirect3D9Ex_CheckDepthStencilMatch(p,a,b,c,d,e) (p)->CheckDepthStencilMatch(a,b,c,d,e) +#define IDirect3D9Ex_CheckDeviceFormatConversion(p,a,b,c,d) (p)->CheckDeviceFormatConversion(a,b,c,d) +#define IDirect3D9Ex_GetDeviceCaps(p,a,b,c) (p)->GetDeviceCaps(a,b,c) +#define IDirect3D9Ex_GetAdapterMonitor(p,a) (p)->GetAdapterMonitor(a) +#define IDirect3D9Ex_CreateDevice(p,a,b,c,d,e,f) (p)->CreateDevice(a,b,c,d,e,f) +#endif + +/***************************************************************************** + * IDirect3DVolume9 interface + */ +#define INTERFACE IDirect3DVolume9 +DECLARE_INTERFACE_(IDirect3DVolume9,IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DVolume9 methods ***/ + STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid, void* pData, DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD(GetContainer)(THIS_ REFIID riid, void** ppContainer) PURE; + STDMETHOD(GetDesc)(THIS_ D3DVOLUME_DESC* pDesc) PURE; + STDMETHOD(LockBox)(THIS_ D3DLOCKED_BOX* pLockedVolume, CONST D3DBOX* pBox, DWORD Flags) PURE; + STDMETHOD(UnlockBox)(THIS) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DVolume9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DVolume9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DVolume9_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DVolume9 methods ***/ +#define IDirect3DVolume9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DVolume9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DVolume9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DVolume9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DVolume9_GetContainer(p,a,b) (p)->lpVtbl->GetContainer(p,a,b) +#define IDirect3DVolume9_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) +#define IDirect3DVolume9_LockBox(p,a,b,c) (p)->lpVtbl->LockBox(p,a,b,c) +#define IDirect3DVolume9_UnlockBox(p) (p)->lpVtbl->UnlockBox(p) +#else +/*** IUnknown methods ***/ +#define IDirect3DVolume9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DVolume9_AddRef(p) (p)->AddRef() +#define IDirect3DVolume9_Release(p) (p)->Release() +/*** IDirect3DVolume9 methods ***/ +#define IDirect3DVolume9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DVolume9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirect3DVolume9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirect3DVolume9_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirect3DVolume9_GetContainer(p,a,b) (p)->GetContainer(a,b) +#define IDirect3DVolume9_GetDesc(p,a) (p)->GetDesc(a) +#define IDirect3DVolume9_LockBox(p,a,b,c) (p)->LockBox(a,b,c) +#define IDirect3DVolume9_UnlockBox(p) (p)->UnlockBox() +#endif + +/***************************************************************************** + * IDirect3DSwapChain9 interface + */ +#define INTERFACE IDirect3DSwapChain9 +DECLARE_INTERFACE_(IDirect3DSwapChain9,IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DSwapChain9 methods ***/ + STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion, DWORD dwFlags) PURE; + STDMETHOD(GetFrontBufferData)(THIS_ struct IDirect3DSurface9* pDestSurface) PURE; + STDMETHOD(GetBackBuffer)(THIS_ UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, struct IDirect3DSurface9** ppBackBuffer) PURE; + STDMETHOD(GetRasterStatus)(THIS_ D3DRASTER_STATUS* pRasterStatus) PURE; + STDMETHOD(GetDisplayMode)(THIS_ D3DDISPLAYMODE* pMode) PURE; + STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(GetPresentParameters)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DSwapChain9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DSwapChain9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DSwapChain9_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DSwapChain9 methods ***/ +#define IDirect3DSwapChain9_Present(p,a,b,c,d,e) (p)->lpVtbl->Present(p,a,b,c,d,e) +#define IDirect3DSwapChain9_GetFrontBufferData(p,a) (p)->lpVtbl->GetFrontBufferData(p,a) +#define IDirect3DSwapChain9_GetBackBuffer(p,a,b,c) (p)->lpVtbl->GetBackBuffer(p,a,b,c) +#define IDirect3DSwapChain9_GetRasterStatus(p,a) (p)->lpVtbl->GetRasterStatus(p,a) +#define IDirect3DSwapChain9_GetDisplayMode(p,a) (p)->lpVtbl->GetDisplayMode(p,a) +#define IDirect3DSwapChain9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DSwapChain9_GetPresentParameters(p,a) (p)->lpVtbl->GetPresentParameters(p,a) +#else +/*** IUnknown methods ***/ +#define IDirect3DSwapChain9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DSwapChain9_AddRef(p) (p)->AddRef() +#define IDirect3DSwapChain9_Release(p) (p)->Release() +/*** IDirect3DSwapChain9 methods ***/ +#define IDirect3DSwapChain9_Present(p,a,b,c,d,e) (p)->Present(a,b,c,d,e) +#define IDirect3DSwapChain9_GetFrontBufferData(p,a) (p)->GetFrontBufferData(a) +#define IDirect3DSwapChain9_GetBackBuffer(p,a,b,c) (p)->GetBackBuffer(a,b,c) +#define IDirect3DSwapChain9_GetRasterStatus(p,a) (p)->GetRasterStatus(a) +#define IDirect3DSwapChain9_GetDisplayMode(p,a) (p)->GetDisplayMode(a) +#define IDirect3DSwapChain9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DSwapChain9_GetPresentParameters(p,a) (p)->GetPresentParameters(a) +#endif + +/***************************************************************************** + * IDirect3DResource9 interface + */ +#define INTERFACE IDirect3DResource9 +DECLARE_INTERFACE_(IDirect3DResource9,IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DResource9 methods ***/ + STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid, void* pData, DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; + STDMETHOD_(DWORD, GetPriority)(THIS) PURE; + STDMETHOD_(void, PreLoad)(THIS) PURE; + STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DResource9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DResource9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DResource9_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DResource9 methods ***/ +#define IDirect3DResource9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DResource9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DResource9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DResource9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DResource9_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) +#define IDirect3DResource9_GetPriority(p) (p)->lpVtbl->GetPriority(p) +#define IDirect3DResource9_PreLoad(p) (p)->lpVtbl->PreLoad(p) +#define IDirect3DResource9_GetType(p) (p)->lpVtbl->GetType(p) +#else +/*** IUnknown methods ***/ +#define IDirect3DResource9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DResource9_AddRef(p) (p)->AddRef() +#define IDirect3DResource9_Release(p) (p)->Release() +/*** IDirect3DResource9 methods ***/ +#define IDirect3DResource9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DResource9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirect3DResource9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirect3DResource9_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirect3DResource9_SetPriority(p,a) (p)->SetPriority(a) +#define IDirect3DResource9_GetPriority(p) (p)->GetPriority() +#define IDirect3DResource9_PreLoad(p) (p)->PreLoad() +#define IDirect3DResource9_GetType(p) (p)->GetType() +#endif + +/***************************************************************************** + * IDirect3DSurface9 interface + */ +#define INTERFACE IDirect3DSurface9 +DECLARE_INTERFACE_(IDirect3DSurface9,IDirect3DResource9) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DResource9 methods ***/ + STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid, void* pData, DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; + STDMETHOD_(DWORD, GetPriority)(THIS) PURE; + STDMETHOD_(void, PreLoad)(THIS) PURE; + STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; + /*** IDirect3DSurface9 methods ***/ + STDMETHOD(GetContainer)(THIS_ REFIID riid, void** ppContainer) PURE; + STDMETHOD(GetDesc)(THIS_ D3DSURFACE_DESC* pDesc) PURE; + STDMETHOD(LockRect)(THIS_ D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags) PURE; + STDMETHOD(UnlockRect)(THIS) PURE; + STDMETHOD(GetDC)(THIS_ HDC* phdc) PURE; + STDMETHOD(ReleaseDC)(THIS_ HDC hdc) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DSurface9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DSurface9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DSurface9_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DSurface9 methods: IDirect3DResource9 ***/ +#define IDirect3DSurface9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DSurface9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DSurface9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DSurface9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DSurface9_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) +#define IDirect3DSurface9_GetPriority(p) (p)->lpVtbl->GetPriority(p) +#define IDirect3DSurface9_PreLoad(p) (p)->lpVtbl->PreLoad(p) +#define IDirect3DSurface9_GetType(p) (p)->lpVtbl->GetType(p) +/*** IDirect3DSurface9 methods ***/ +#define IDirect3DSurface9_GetContainer(p,a,b) (p)->lpVtbl->GetContainer(p,a,b) +#define IDirect3DSurface9_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) +#define IDirect3DSurface9_LockRect(p,a,b,c) (p)->lpVtbl->LockRect(p,a,b,c) +#define IDirect3DSurface9_UnlockRect(p) (p)->lpVtbl->UnlockRect(p) +#define IDirect3DSurface9_GetDC(p,a) (p)->lpVtbl->GetDC(p,a) +#define IDirect3DSurface9_ReleaseDC(p,a) (p)->lpVtbl->ReleaseDC(p,a) +#else +/*** IUnknown methods ***/ +#define IDirect3DSurface9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DSurface9_AddRef(p) (p)->AddRef() +#define IDirect3DSurface9_Release(p) (p)->Release() +/*** IDirect3DSurface9 methods: IDirect3DResource9 ***/ +#define IDirect3DSurface9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DSurface9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirect3DSurface9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirect3DSurface9_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirect3DSurface9_SetPriority(p,a) (p)->SetPriority(a) +#define IDirect3DSurface9_GetPriority(p) (p)->GetPriority() +#define IDirect3DSurface9_PreLoad(p) (p)->PreLoad() +#define IDirect3DSurface9_GetType(p) (p)->GetType() +/*** IDirect3DSurface9 methods ***/ +#define IDirect3DSurface9_GetContainer(p,a,b) (p)->GetContainer(a,b) +#define IDirect3DSurface9_GetDesc(p,a) (p)->GetDesc(a) +#define IDirect3DSurface9_LockRect(p,a,b,c) (p)->LockRect(a,b,c) +#define IDirect3DSurface9_UnlockRect(p) (p)->UnlockRect() +#define IDirect3DSurface9_GetDC(p,a) (p)->GetDC(a) +#define IDirect3DSurface9_ReleaseDC(p,a) (p)->ReleaseDC(a) +#endif + +/***************************************************************************** + * IDirect3DVertexBuffer9 interface + */ +#define INTERFACE IDirect3DVertexBuffer9 +DECLARE_INTERFACE_(IDirect3DVertexBuffer9,IDirect3DResource9) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DResource9 methods ***/ + STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid, void* pData, DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; + STDMETHOD_(DWORD, GetPriority)(THIS) PURE; + STDMETHOD_(void, PreLoad)(THIS) PURE; + STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; + /*** IDirect3DVertexBuffer9 methods ***/ + STDMETHOD(Lock)(THIS_ UINT OffsetToLock, UINT SizeToLock, void** ppbData, DWORD Flags) PURE; + STDMETHOD(Unlock)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3DVERTEXBUFFER_DESC* pDesc) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DVertexBuffer9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DVertexBuffer9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DVertexBuffer9_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DVertexBuffer9 methods: IDirect3DResource9 ***/ +#define IDirect3DVertexBuffer9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DVertexBuffer9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DVertexBuffer9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DVertexBuffer9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DVertexBuffer9_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) +#define IDirect3DVertexBuffer9_GetPriority(p) (p)->lpVtbl->GetPriority(p) +#define IDirect3DVertexBuffer9_PreLoad(p) (p)->lpVtbl->PreLoad(p) +#define IDirect3DVertexBuffer9_GetType(p) (p)->lpVtbl->GetType(p) +/*** IDirect3DVertexBuffer9 methods ***/ +#define IDirect3DVertexBuffer9_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) +#define IDirect3DVertexBuffer9_Unlock(p) (p)->lpVtbl->Unlock(p) +#define IDirect3DVertexBuffer9_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) +#else +/*** IUnknown methods ***/ +#define IDirect3DVertexBuffer9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DVertexBuffer9_AddRef(p) (p)->AddRef() +#define IDirect3DVertexBuffer9_Release(p) (p)->Release() +/*** IDirect3DVertexBuffer9 methods: IDirect3DResource9 ***/ +#define IDirect3DVertexBuffer9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DVertexBuffer9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirect3DVertexBuffer9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirect3DVertexBuffer9_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirect3DVertexBuffer9_SetPriority(p,a) (p)->SetPriority(a) +#define IDirect3DVertexBuffer9_GetPriority(p) (p)->GetPriority() +#define IDirect3DVertexBuffer9_PreLoad(p) (p)->PreLoad() +#define IDirect3DVertexBuffer9_GetType(p) (p)->GetType() +/*** IDirect3DVertexBuffer9 methods ***/ +#define IDirect3DVertexBuffer9_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) +#define IDirect3DVertexBuffer9_Unlock(p) (p)->Unlock() +#define IDirect3DVertexBuffer9_GetDesc(p,a) (p)->GetDesc(a) +#endif + +/***************************************************************************** + * IDirect3DIndexBuffer9 interface + */ +#define INTERFACE IDirect3DIndexBuffer9 +DECLARE_INTERFACE_(IDirect3DIndexBuffer9,IDirect3DResource9) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DResource9 methods ***/ + STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid, void* pData, DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; + STDMETHOD_(DWORD, GetPriority)(THIS) PURE; + STDMETHOD_(void, PreLoad)(THIS) PURE; + STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; + /*** IDirect3DIndexBuffer9 methods ***/ + STDMETHOD(Lock)(THIS_ UINT OffsetToLock, UINT SizeToLock, void** ppbData, DWORD Flags) PURE; + STDMETHOD(Unlock)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3DINDEXBUFFER_DESC* pDesc) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DIndexBuffer9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DIndexBuffer9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DIndexBuffer9_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DIndexBuffer9 methods: IDirect3DResource9 ***/ +#define IDirect3DIndexBuffer9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DIndexBuffer9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DIndexBuffer9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DIndexBuffer9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DIndexBuffer9_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) +#define IDirect3DIndexBuffer9_GetPriority(p) (p)->lpVtbl->GetPriority(p) +#define IDirect3DIndexBuffer9_PreLoad(p) (p)->lpVtbl->PreLoad(p) +#define IDirect3DIndexBuffer9_GetType(p) (p)->lpVtbl->GetType(p) +/*** IDirect3DIndexBuffer9 methods ***/ +#define IDirect3DIndexBuffer9_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) +#define IDirect3DIndexBuffer9_Unlock(p) (p)->lpVtbl->Unlock(p) +#define IDirect3DIndexBuffer9_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) +#else +/*** IUnknown methods ***/ +#define IDirect3DIndexBuffer9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DIndexBuffer9_AddRef(p) (p)->AddRef() +#define IDirect3DIndexBuffer9_Release(p) (p)->Release() +/*** IDirect3DIndexBuffer9 methods: IDirect3DResource9 ***/ +#define IDirect3DIndexBuffer9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DIndexBuffer9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirect3DIndexBuffer9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirect3DIndexBuffer9_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirect3DIndexBuffer9_SetPriority(p,a) (p)->SetPriority(a) +#define IDirect3DIndexBuffer9_GetPriority(p) (p)->GetPriority() +#define IDirect3DIndexBuffer9_PreLoad(p) (p)->PreLoad() +#define IDirect3DIndexBuffer9_GetType(p) (p)->GetType() +/*** IDirect3DIndexBuffer9 methods ***/ +#define IDirect3DIndexBuffer9_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) +#define IDirect3DIndexBuffer9_Unlock(p) (p)->Unlock() +#define IDirect3DIndexBuffer9_GetDesc(p,a) (p)->GetDesc(a) +#endif + +/***************************************************************************** + * IDirect3DBaseTexture9 interface + */ +#define INTERFACE IDirect3DBaseTexture9 +DECLARE_INTERFACE_(IDirect3DBaseTexture9,IDirect3DResource9) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DResource9 methods ***/ + STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid, void* pData, DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; + STDMETHOD_(DWORD, GetPriority)(THIS) PURE; + STDMETHOD_(void, PreLoad)(THIS) PURE; + STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; + /*** IDirect3DBaseTexture9 methods ***/ + STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; + STDMETHOD_(DWORD, GetLOD)(THIS) PURE; + STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; + STDMETHOD(SetAutoGenFilterType)(THIS_ D3DTEXTUREFILTERTYPE FilterType) PURE; + STDMETHOD_(D3DTEXTUREFILTERTYPE, GetAutoGenFilterType)(THIS) PURE; + STDMETHOD_(void, GenerateMipSubLevels)(THIS) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DBaseTexture9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DBaseTexture9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DBaseTexture9_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DBaseTexture9 methods: IDirect3DResource9 ***/ +#define IDirect3DBaseTexture9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DBaseTexture9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DBaseTexture9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DBaseTexture9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DBaseTexture9_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) +#define IDirect3DBaseTexture9_GetPriority(p) (p)->lpVtbl->GetPriority(p) +#define IDirect3DBaseTexture9_PreLoad(p) (p)->lpVtbl->PreLoad(p) +#define IDirect3DBaseTexture9_GetType(p) (p)->lpVtbl->GetType(p) +/*** IDirect3DBaseTexture9 methods ***/ +#define IDirect3DBaseTexture9_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) +#define IDirect3DBaseTexture9_GetLOD(p) (p)->lpVtbl->GetLOD(p) +#define IDirect3DBaseTexture9_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) +#define IDirect3DBaseTexture9_SetAutoGenFilterType(p,a) (p)->lpVtbl->SetAutoGenFilterType(p,a) +#define IDirect3DBaseTexture9_GetAutoGenFilterType(p) (p)->lpVtbl->GetAutoGenFilterType(p) +#define IDirect3DBaseTexture9_GenerateMipSubLevels(p) (p)->lpVtbl->GenerateMipSubLevels(p) +#else +/*** IUnknown methods ***/ +#define IDirect3DBaseTexture9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DBaseTexture9_AddRef(p) (p)->AddRef() +#define IDirect3DBaseTexture9_Release(p) (p)->Release() +/*** IDirect3DBaseTexture9 methods: IDirect3DResource9 ***/ +#define IDirect3DBaseTexture9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DBaseTexture9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirect3DBaseTexture9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirect3DBaseTexture9_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirect3DBaseTexture9_SetPriority(p,a) (p)->SetPriority(a) +#define IDirect3DBaseTexture9_GetPriority(p) (p)->GetPriority() +#define IDirect3DBaseTexture9_PreLoad(p) (p)->PreLoad() +#define IDirect3DBaseTexture9_GetType(p) (p)->GetType() +/*** IDirect3DBaseTexture9 methods ***/ +#define IDirect3DBaseTexture9_SetLOD(p,a) (p)->SetLOD(a) +#define IDirect3DBaseTexture9_GetLOD(p) (p)->GetLOD() +#define IDirect3DBaseTexture9_GetLevelCount(p) (p)->GetLevelCount() +#define IDirect3DBaseTexture9_SetAutoGenFilterType(p,a) (p)->SetAutoGenFilterType(a) +#define IDirect3DBaseTexture9_GetAutoGenFilterType(p) (p)->GetAutoGenFilterType() +#define IDirect3DBaseTexture9_GenerateMipSubLevels(p) (p)->GenerateMipSubLevels() +#endif + +/***************************************************************************** + * IDirect3DCubeTexture9 interface + */ +#define INTERFACE IDirect3DCubeTexture9 +DECLARE_INTERFACE_(IDirect3DCubeTexture9,IDirect3DBaseTexture9) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DResource9 methods ***/ + STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid, void* pData, DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; + STDMETHOD_(DWORD, GetPriority)(THIS) PURE; + STDMETHOD_(void, PreLoad)(THIS) PURE; + STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; + /*** IDirect3DBaseTexture9 methods ***/ + STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; + STDMETHOD_(DWORD, GetLOD)(THIS) PURE; + STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; + STDMETHOD(SetAutoGenFilterType)(THIS_ D3DTEXTUREFILTERTYPE FilterType) PURE; + STDMETHOD_(D3DTEXTUREFILTERTYPE, GetAutoGenFilterType)(THIS) PURE; + STDMETHOD_(void, GenerateMipSubLevels)(THIS) PURE; + /*** IDirect3DCubeTexture9 methods ***/ + STDMETHOD(GetLevelDesc)(THIS_ UINT Level,D3DSURFACE_DESC* pDesc) PURE; + STDMETHOD(GetCubeMapSurface)(THIS_ D3DCUBEMAP_FACES FaceType, UINT Level, IDirect3DSurface9** ppCubeMapSurface) PURE; + STDMETHOD(LockRect)(THIS_ D3DCUBEMAP_FACES FaceType, UINT Level, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags) PURE; + STDMETHOD(UnlockRect)(THIS_ D3DCUBEMAP_FACES FaceType, UINT Level) PURE; + STDMETHOD(AddDirtyRect)(THIS_ D3DCUBEMAP_FACES FaceType, CONST RECT* pDirtyRect) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DCubeTexture9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DCubeTexture9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DCubeTexture9_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DCubeTexture9 methods: IDirect3DResource9 ***/ +#define IDirect3DCubeTexture9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DCubeTexture9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DCubeTexture9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DCubeTexture9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DCubeTexture9_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) +#define IDirect3DCubeTexture9_GetPriority(p) (p)->lpVtbl->GetPriority(p) +#define IDirect3DCubeTexture9_PreLoad(p) (p)->lpVtbl->PreLoad(p) +#define IDirect3DCubeTexture9_GetType(p) (p)->lpVtbl->GetType(p) +/*** IDirect3DCubeTexture9 methods: IDirect3DBaseTexture9 ***/ +#define IDirect3DCubeTexture9_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) +#define IDirect3DCubeTexture9_GetLOD(p) (p)->lpVtbl->GetLOD(p) +#define IDirect3DCubeTexture9_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) +#define IDirect3DCubeTexture9_SetAutoGenFilterType(p,a) (p)->lpVtbl->SetAutoGenFilterType(p,a) +#define IDirect3DCubeTexture9_GetAutoGenFilterType(p) (p)->lpVtbl->GetAutoGenFilterType(p) +#define IDirect3DCubeTexture9_GenerateMipSubLevels(p) (p)->lpVtbl->GenerateMipSubLevels(p) +/*** IDirect3DCubeTexture9 methods ***/ +#define IDirect3DCubeTexture9_GetLevelDesc(p,a,b) (p)->lpVtbl->GetLevelDesc(p,a,b) +#define IDirect3DCubeTexture9_GetCubeMapSurface(p,a,b,c) (p)->lpVtbl->GetCubeMapSurface(p,a,b,c) +#define IDirect3DCubeTexture9_LockRect(p,a,b,c,d,e) (p)->lpVtbl->LockRect(p,a,b,c,d,e) +#define IDirect3DCubeTexture9_UnlockRect(p,a,b) (p)->lpVtbl->UnlockRect(p,a,b) +#define IDirect3DCubeTexture9_AddDirtyRect(p,a,b) (p)->lpVtbl->AddDirtyRect(p,a,b) +#else +/*** IUnknown methods ***/ +#define IDirect3DCubeTexture9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DCubeTexture9_AddRef(p) (p)->AddRef() +#define IDirect3DCubeTexture9_Release(p) (p)->Release() +/*** IDirect3DCubeTexture9 methods: IDirect3DResource9 ***/ +#define IDirect3DCubeTexture9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DCubeTexture9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirect3DCubeTexture9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirect3DCubeTexture9_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirect3DCubeTexture9_SetPriority(p,a) (p)->SetPriority(a) +#define IDirect3DCubeTexture9_GetPriority(p) (p)->GetPriority() +#define IDirect3DCubeTexture9_PreLoad(p) (p)->PreLoad() +#define IDirect3DCubeTexture9_GetType(p) (p)->GetType() +/*** IDirect3DCubeTexture9 methods: IDirect3DBaseTexture9 ***/ +#define IDirect3DCubeTexture9_SetLOD(p,a) (p)->SetLOD(a) +#define IDirect3DCubeTexture9_GetLOD(p) (p)->GetLOD() +#define IDirect3DCubeTexture9_GetLevelCount(p) (p)->GetLevelCount() +#define IDirect3DCubeTexture9_SetAutoGenFilterType(p,a) (p)->SetAutoGenFilterType(a) +#define IDirect3DCubeTexture9_GetAutoGenFilterType(p) (p)->GetAutoGenFilterType() +#define IDirect3DCubeTexture9_GenerateMipSubLevels(p) (p)->GenerateMipSubLevels() +/*** IDirect3DCubeTexture9 methods ***/ +#define IDirect3DCubeTexture9_GetLevelDesc(p,a,b) (p)->GetLevelDesc(a,b) +#define IDirect3DCubeTexture9_GetCubeMapSurface(p,a,b,c) (p)->GetCubeMapSurface(a,b,c) +#define IDirect3DCubeTexture9_LockRect(p,a,b,c,d,e) (p)->LockRect(a,b,c,d,e) +#define IDirect3DCubeTexture9_UnlockRect(p,a,b) (p)->UnlockRect(a,b) +#define IDirect3DCubeTexture9_AddDirtyRect(p,a,b) (p)->AddDirtyRect(a,b) +#endif + +/***************************************************************************** + * IDirect3DTexture9 interface + */ +#define INTERFACE IDirect3DTexture9 +DECLARE_INTERFACE_(IDirect3DTexture9,IDirect3DBaseTexture9) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DResource9 methods ***/ + STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid, void* pData, DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; + STDMETHOD_(DWORD, GetPriority)(THIS) PURE; + STDMETHOD_(void, PreLoad)(THIS) PURE; + STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; + /*** IDirect3DBaseTexture9 methods ***/ + STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; + STDMETHOD_(DWORD, GetLOD)(THIS) PURE; + STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; + STDMETHOD(SetAutoGenFilterType)(THIS_ D3DTEXTUREFILTERTYPE FilterType) PURE; + STDMETHOD_(D3DTEXTUREFILTERTYPE, GetAutoGenFilterType)(THIS) PURE; + STDMETHOD_(void, GenerateMipSubLevels)(THIS) PURE; + /*** IDirect3DTexture9 methods ***/ + STDMETHOD(GetLevelDesc)(THIS_ UINT Level, D3DSURFACE_DESC* pDesc) PURE; + STDMETHOD(GetSurfaceLevel)(THIS_ UINT Level, IDirect3DSurface9** ppSurfaceLevel) PURE; + STDMETHOD(LockRect)(THIS_ UINT Level, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags) PURE; + STDMETHOD(UnlockRect)(THIS_ UINT Level) PURE; + STDMETHOD(AddDirtyRect)(THIS_ CONST RECT* pDirtyRect) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DTexture9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DTexture9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DTexture9_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DTexture9 methods: IDirect3DResource9 ***/ +#define IDirect3DTexture9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DTexture9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DTexture9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DTexture9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DTexture9_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) +#define IDirect3DTexture9_GetPriority(p) (p)->lpVtbl->GetPriority(p) +#define IDirect3DTexture9_PreLoad(p) (p)->lpVtbl->PreLoad(p) +#define IDirect3DTexture9_GetType(p) (p)->lpVtbl->GetType(p) +/*** IDirect3DTexture9 methods: IDirect3DBaseTexture9 ***/ +#define IDirect3DTexture9_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) +#define IDirect3DTexture9_GetLOD(p) (p)->lpVtbl->GetLOD(p) +#define IDirect3DTexture9_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) +#define IDirect3DTexture9_SetAutoGenFilterType(p,a) (p)->lpVtbl->SetAutoGenFilterType(p,a) +#define IDirect3DTexture9_GetAutoGenFilterType(p) (p)->lpVtbl->GetAutoGenFilterType(p) +#define IDirect3DTexture9_GenerateMipSubLevels(p) (p)->lpVtbl->GenerateMipSubLevels(p) +/*** IDirect3DTexture9 methods ***/ +#define IDirect3DTexture9_GetLevelDesc(p,a,b) (p)->lpVtbl->GetLevelDesc(p,a,b) +#define IDirect3DTexture9_GetSurfaceLevel(p,a,b) (p)->lpVtbl->GetSurfaceLevel(p,a,b) +#define IDirect3DTexture9_LockRect(p,a,b,c,d) (p)->lpVtbl->LockRect(p,a,b,c,d) +#define IDirect3DTexture9_UnlockRect(p,a) (p)->lpVtbl->UnlockRect(p,a) +#define IDirect3DTexture9_AddDirtyRect(p,a) (p)->lpVtbl->AddDirtyRect(p,a) +#else +/*** IUnknown methods ***/ +#define IDirect3DTexture9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DTexture9_AddRef(p) (p)->AddRef() +#define IDirect3DTexture9_Release(p) (p)->Release() +/*** IDirect3DTexture9 methods: IDirect3DResource9 ***/ +#define IDirect3DTexture9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DTexture9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirect3DTexture9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirect3DTexture9_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirect3DTexture9_SetPriority(p,a) (p)->SetPriority(a) +#define IDirect3DTexture9_GetPriority(p) (p)->GetPriority() +#define IDirect3DTexture9_PreLoad(p) (p)->PreLoad() +#define IDirect3DTexture9_GetType(p) (p)->GetType() +/*** IDirect3DTexture9 methods: IDirect3DBaseTexture9 ***/ +#define IDirect3DTexture9_SetLOD(p,a) (p)->SetLOD(a) +#define IDirect3DTexture9_GetLOD(p) (p)->GetLOD() +#define IDirect3DTexture9_GetLevelCount(p) (p)->GetLevelCount() +#define IDirect3DTexture9_SetAutoGenFilterType(p,a) (p)->SetAutoGenFilterType(a) +#define IDirect3DTexture9_GetAutoGenFilterType(p) (p)->GetAutoGenFilterType() +#define IDirect3DTexture9_GenerateMipSubLevels(p) (p)->GenerateMipSubLevels() +/*** IDirect3DTexture9 methods ***/ +#define IDirect3DTexture9_GetLevelDesc(p,a,b) (p)->GetLevelDesc(a,b) +#define IDirect3DTexture9_GetSurfaceLevel(p,a,b) (p)->GetSurfaceLevel(a,b) +#define IDirect3DTexture9_LockRect(p,a,b,c,d) (p)->LockRect(a,b,c,d) +#define IDirect3DTexture9_UnlockRect(p,a) (p)->UnlockRect(a) +#define IDirect3DTexture9_AddDirtyRect(p,a) (p)->AddDirtyRect(a) +#endif + +/***************************************************************************** + * IDirect3DVolumeTexture9 interface + */ +#define INTERFACE IDirect3DVolumeTexture9 +DECLARE_INTERFACE_(IDirect3DVolumeTexture9,IDirect3DBaseTexture9) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DResource9 methods ***/ + STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid, void* pData, DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; + STDMETHOD_(DWORD, GetPriority)(THIS) PURE; + STDMETHOD_(void, PreLoad)(THIS) PURE; + STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; + /*** IDirect3DBaseTexture9 methods ***/ + STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; + STDMETHOD_(DWORD, GetLOD)(THIS) PURE; + STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; + STDMETHOD(SetAutoGenFilterType)(THIS_ D3DTEXTUREFILTERTYPE FilterType) PURE; + STDMETHOD_(D3DTEXTUREFILTERTYPE, GetAutoGenFilterType)(THIS) PURE; + STDMETHOD_(void, GenerateMipSubLevels)(THIS) PURE; + /*** IDirect3DVolumeTexture9 methods ***/ + STDMETHOD(GetLevelDesc)(THIS_ UINT Level, D3DVOLUME_DESC *pDesc) PURE; + STDMETHOD(GetVolumeLevel)(THIS_ UINT Level, IDirect3DVolume9** ppVolumeLevel) PURE; + STDMETHOD(LockBox)(THIS_ UINT Level, D3DLOCKED_BOX* pLockedVolume, CONST D3DBOX* pBox, DWORD Flags) PURE; + STDMETHOD(UnlockBox)(THIS_ UINT Level) PURE; + STDMETHOD(AddDirtyBox)(THIS_ CONST D3DBOX* pDirtyBox) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IDirect3DVolumeTexture9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DVolumeTexture9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DVolumeTexture9_Release(p) (p)->lpVtbl->Release(p) +/*** IDirect3DVolumeTexture9 methods: IDirect3DResource9 ***/ +#define IDirect3DVolumeTexture9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DVolumeTexture9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DVolumeTexture9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DVolumeTexture9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DVolumeTexture9_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) +#define IDirect3DVolumeTexture9_GetPriority(p) (p)->lpVtbl->GetPriority(p) +#define IDirect3DVolumeTexture9_PreLoad(p) (p)->lpVtbl->PreLoad(p) +#define IDirect3DVolumeTexture9_GetType(p) (p)->lpVtbl->GetType(p) +/*** IDirect3DVolumeTexture9 methods: IDirect3DBaseTexture9 ***/ +#define IDirect3DVolumeTexture9_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) +#define IDirect3DVolumeTexture9_GetLOD(p) (p)->lpVtbl->GetLOD(p) +#define IDirect3DVolumeTexture9_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) + #define IDirect3DVolumeTexture9_SetAutoGenFilterType(p,a) (p)->lpVtbl->SetAutoGenFilterType(p,a) + #define IDirect3DVolumeTexture9_GetAutoGenFilterType(p) (p)->lpVtbl->GetAutoGenFilterType(p) + #define IDirect3DVolumeTexture9_GenerateMipSubLevels(p) (p)->lpVtbl->GenerateMipSubLevels(p) + /*** IDirect3DVolumeTexture9 methods ***/ + #define IDirect3DVolumeTexture9_GetLevelDesc(p,a,b) (p)->lpVtbl->GetLevelDesc(p,a,b) + #define IDirect3DVolumeTexture9_GetVolumeLevel(p,a,b) (p)->lpVtbl->GetVolumeLevel(p,a,b) + #define IDirect3DVolumeTexture9_LockBox(p,a,b,c,d) (p)->lpVtbl->LockBox(p,a,b,c,d) + #define IDirect3DVolumeTexture9_UnlockBox(p,a) (p)->lpVtbl->UnlockBox(p,a) + #define IDirect3DVolumeTexture9_AddDirtyBox(p,a) (p)->lpVtbl->AddDirtyBox(p,a) + #else + /*** IUnknown methods ***/ + #define IDirect3DVolumeTexture9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) + #define IDirect3DVolumeTexture9_AddRef(p) (p)->AddRef() + #define IDirect3DVolumeTexture9_Release(p) (p)->Release() + /*** IDirect3DVolumeTexture9 methods: IDirect3DResource9 ***/ + #define IDirect3DVolumeTexture9_GetDevice(p,a) (p)->GetDevice(a) + #define IDirect3DVolumeTexture9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) + #define IDirect3DVolumeTexture9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) + #define IDirect3DVolumeTexture9_FreePrivateData(p,a) (p)->FreePrivateData(a) + #define IDirect3DVolumeTexture9_SetPriority(p,a) (p)->SetPriority(a) + #define IDirect3DVolumeTexture9_GetPriority(p) (p)->GetPriority() + #define IDirect3DVolumeTexture9_PreLoad(p) (p)->PreLoad() + #define IDirect3DVolumeTexture9_GetType(p) (p)->GetType() + /*** IDirect3DVolumeTexture9 methods: IDirect3DBaseTexture9 ***/ + #define IDirect3DVolumeTexture9_SetLOD(p,a) (p)->SetLOD(a) + #define IDirect3DVolumeTexture9_GetLOD(p) (p)->GetLOD() + #define IDirect3DVolumeTexture9_GetLevelCount(p) (p)->GetLevelCount() + #define IDirect3DVolumeTexture9_SetAutoGenFilterType(p,a) (p)->SetAutoGenFilterType(a) + #define IDirect3DVolumeTexture9_GetAutoGenFilterType(p) (p)->GetAutoGenFilterType() + #define IDirect3DVolumeTexture9_GenerateMipSubLevels(p) (p)->GenerateMipSubLevels() + /*** IDirect3DVolumeTexture9 methods ***/ + #define IDirect3DVolumeTexture9_GetLevelDesc(p,a,b) (p)->GetLevelDesc(a,b) + #define IDirect3DVolumeTexture9_GetVolumeLevel(p,a,b) (p)->GetVolumeLevel(a,b) + #define IDirect3DVolumeTexture9_LockBox(p,a,b,c,d) (p)->LockBox(a,b,c,d) + #define IDirect3DVolumeTexture9_UnlockBox(p,a) (p)->UnlockBox(a) + #define IDirect3DVolumeTexture9_AddDirtyBox(p,a) (p)->AddDirtyBox(a) + #endif + + /***************************************************************************** + * IDirect3DVertexDeclaration9 interface + */ + #define INTERFACE IDirect3DVertexDeclaration9 + DECLARE_INTERFACE_(IDirect3DVertexDeclaration9,IUnknown) + { + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DVertexDeclaration9 methods ***/ + STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(GetDeclaration)(THIS_ D3DVERTEXELEMENT9*, UINT* pNumElements) PURE; + }; + #undef INTERFACE + + #if !defined(__cplusplus) || defined(CINTERFACE) + /*** IUnknown methods ***/ + #define IDirect3DVertexDeclaration9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) + #define IDirect3DVertexDeclaration9_AddRef(p) (p)->lpVtbl->AddRef(p) + #define IDirect3DVertexDeclaration9_Release(p) (p)->lpVtbl->Release(p) + /*** IDirect3DVertexShader9 methods ***/ + #define IDirect3DVertexDeclaration9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) + #define IDirect3DVertexDeclaration9_GetDeclaration(p,a,b) (p)->lpVtbl->GetDeclaration(p,a,b) + #else + /*** IUnknown methods ***/ + #define IDirect3DVertexDeclaration9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) + #define IDirect3DVertexDeclaration9_AddRef(p) (p)->AddRef() + #define IDirect3DVertexDeclaration9_Release(p) (p)->Release() + /*** IDirect3DVertexShader9 methods ***/ + #define IDirect3DVertexDeclaration9_GetDevice(p,a) (p)->GetDevice(a) + #define IDirect3DVertexDeclaration9_GetDeclaration(p,a,b) (p)->GetDeclaration(a,b) + #endif + + /***************************************************************************** + * IDirect3DVertexShader9 interface + */ + #define INTERFACE IDirect3DVertexShader9 + DECLARE_INTERFACE_(IDirect3DVertexShader9,IUnknown) + { + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DVertexShader9 methods ***/ + STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(GetFunction)(THIS_ void*, UINT* pSizeOfData) PURE; + }; + #undef INTERFACE + + #if !defined(__cplusplus) || defined(CINTERFACE) + /*** IUnknown methods ***/ + #define IDirect3DVertexShader9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) + #define IDirect3DVertexShader9_AddRef(p) (p)->lpVtbl->AddRef(p) + #define IDirect3DVertexShader9_Release(p) (p)->lpVtbl->Release(p) + /*** IDirect3DVertexShader9 methods ***/ + #define IDirect3DVertexShader9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) + #define IDirect3DVertexShader9_GetFunction(p,a,b) (p)->lpVtbl->GetFunction(p,a,b) + #else + /*** IUnknown methods ***/ + #define IDirect3DVertexShader9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) + #define IDirect3DVertexShader9_AddRef(p) (p)->AddRef() + #define IDirect3DVertexShader9_Release(p) (p)->Release() + /*** IDirect3DVertexShader9 methods ***/ + #define IDirect3DVertexShader9_GetDevice(p,a) (p)->GetDevice(a) + #define IDirect3DVertexShader9_GetFunction(p,a,b) (p)->GetFunction(a,b) + #endif + + /***************************************************************************** + * IDirect3DPixelShader9 interface + */ + #define INTERFACE IDirect3DPixelShader9 + DECLARE_INTERFACE_(IDirect3DPixelShader9,IUnknown) + { + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DPixelShader9 methods ***/ + STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(GetFunction)(THIS_ void*, UINT* pSizeOfData) PURE; + }; + #undef INTERFACE + + #if !defined(__cplusplus) || defined(CINTERFACE) + /*** IUnknown methods ***/ + #define IDirect3DPixelShader9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) + #define IDirect3DPixelShader9_AddRef(p) (p)->lpVtbl->AddRef(p) + #define IDirect3DPixelShader9_Release(p) (p)->lpVtbl->Release(p) + /*** IDirect3DPixelShader9 methods ***/ + #define IDirect3DPixelShader9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) + #define IDirect3DPixelShader9_GetFunction(p,a,b) (p)->lpVtbl->GetFunction(p,a,b) + #else + /*** IUnknown methods ***/ + #define IDirect3DPixelShader9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) + #define IDirect3DPixelShader9_AddRef(p) (p)->AddRef() + #define IDirect3DPixelShader9_Release(p) (p)->Release() + /*** IDirect3DPixelShader9 methods ***/ + #define IDirect3DPixelShader9_GetDevice(p,a) (p)->GetDevice(a) + #define IDirect3DPixelShader9_GetFunction(p,a,b) (p)->GetFunction(a,b) + #endif + + /***************************************************************************** + * IDirect3DStateBlock9 interface + */ + #define INTERFACE IDirect3DStateBlock9 + DECLARE_INTERFACE_(IDirect3DStateBlock9,IUnknown) + { + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DStateBlock9 methods ***/ + STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(Capture)(THIS) PURE; + STDMETHOD(Apply)(THIS) PURE; + }; + #undef INTERFACE + + #if !defined(__cplusplus) || defined(CINTERFACE) + /*** IUnknown methods ***/ + #define IDirect3DStateBlock9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) + #define IDirect3DStateBlock9_AddRef(p) (p)->lpVtbl->AddRef(p) + #define IDirect3DStateBlock9_Release(p) (p)->lpVtbl->Release(p) + /*** IDirect3DStateBlock9 methods ***/ + #define IDirect3DStateBlock9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) + #define IDirect3DStateBlock9_Capture(p) (p)->lpVtbl->Capture(p) + #define IDirect3DStateBlock9_Apply(p) (p)->lpVtbl->Apply(p) + #else + /*** IUnknown methods ***/ + #define IDirect3DStateBlock9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) + #define IDirect3DStateBlock9_AddRef(p) (p)->AddRef() + #define IDirect3DStateBlock9_Release(p) (p)->Release() + /*** IDirect3DStateBlock9 methods ***/ + #define IDirect3DStateBlock9_GetDevice(p,a) (p)->GetDevice(a) + #define IDirect3DStateBlock9_Capture(p) (p)->Capture() + #define IDirect3DStateBlock9_Apply(p) (p)->Apply() + #endif + + /***************************************************************************** + * IDirect3DQuery9 interface + */ + #define INTERFACE IDirect3DQuery9 + DECLARE_INTERFACE_(IDirect3DQuery9,IUnknown) + { + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DQuery9 methods ***/ + STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9** ppDevice) PURE; + STDMETHOD_(D3DQUERYTYPE, GetType)(THIS) PURE; + STDMETHOD_(DWORD, GetDataSize)(THIS) PURE; + STDMETHOD(Issue)(THIS_ DWORD dwIssueFlags) PURE; + STDMETHOD(GetData)(THIS_ void* pData, DWORD dwSize, DWORD dwGetDataFlags) PURE; + }; + #undef INTERFACE + + #if !defined(__cplusplus) || defined(CINTERFACE) + /*** IUnknown methods ***/ + #define IDirect3DQuery9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) + #define IDirect3DQuery9_AddRef(p) (p)->lpVtbl->AddRef(p) + #define IDirect3DQuery9_Release(p) (p)->lpVtbl->Release(p) + /*** IDirect3DQuery9 ***/ + #define IDirect3DQuery9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) + #define IDirect3DQuery9_GetType(p) (p)->lpVtbl->GetType(p) + #define IDirect3DQuery9_GetDataSize(p) (p)->lpVtbl->GetDataSize(p) + #define IDirect3DQuery9_Issue(p,a) (p)->lpVtbl->Issue(p,a) + #define IDirect3DQuery9_GetData(p,a,b,c) (p)->lpVtbl->GetData(p,a,b,c) + #else + /*** IUnknown methods ***/ + #define IDirect3DQuery9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) + #define IDirect3DQuery9_AddRef(p) (p)->AddRef() + #define IDirect3DQuery9_Release(p) (p)->Release() + /*** IDirect3DQuery9 ***/ + #define IDirect3DQuery9_GetDevice(p,a) (p)->GetDevice(a) + #define IDirect3DQuery9_GetType(p) (p)->GetType() + #define IDirect3DQuery9_GetDataSize(p) (p)->GetDataSize() + #define IDirect3DQuery9_Issue(p,a) (p)->Issue(a) + #define IDirect3DQuery9_GetData(p,a,b,c) (p)->GetData(a,b,c) + #endif + + /***************************************************************************** + * IDirect3DDevice9 interface + */ + #define INTERFACE IDirect3DDevice9 + DECLARE_INTERFACE_(IDirect3DDevice9,IUnknown) + { + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DDevice9 methods ***/ + STDMETHOD(TestCooperativeLevel)(THIS) PURE; + STDMETHOD_(UINT, GetAvailableTextureMem)(THIS) PURE; + STDMETHOD(EvictManagedResources)(THIS) PURE; + STDMETHOD(GetDirect3D)(THIS_ IDirect3D9** ppD3D9) PURE; + STDMETHOD(GetDeviceCaps)(THIS_ D3DCAPS9* pCaps) PURE; + STDMETHOD(GetDisplayMode)(THIS_ UINT iSwapChain, D3DDISPLAYMODE* pMode) PURE; + STDMETHOD(GetCreationParameters)(THIS_ D3DDEVICE_CREATION_PARAMETERS *pParameters) PURE; + STDMETHOD(SetCursorProperties)(THIS_ UINT XHotSpot, UINT YHotSpot, IDirect3DSurface9* pCursorBitmap) PURE; + STDMETHOD_(void, SetCursorPosition)(THIS_ int X,int Y, DWORD Flags) PURE; + STDMETHOD_(BOOL, ShowCursor)(THIS_ BOOL bShow) PURE; + STDMETHOD(CreateAdditionalSwapChain)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DSwapChain9** pSwapChain) PURE; + STDMETHOD(GetSwapChain)(THIS_ UINT iSwapChain, IDirect3DSwapChain9** pSwapChain) PURE; + STDMETHOD_(UINT, GetNumberOfSwapChains)(THIS) PURE; + STDMETHOD(Reset)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters) PURE; + STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion) PURE; + STDMETHOD(GetBackBuffer)(THIS_ UINT iSwapChain, UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9** ppBackBuffer) PURE; + STDMETHOD(GetRasterStatus)(THIS_ UINT iSwapChain, D3DRASTER_STATUS* pRasterStatus) PURE; + STDMETHOD(SetDialogBoxMode)(THIS_ BOOL bEnableDialogs) PURE; + STDMETHOD_(void, SetGammaRamp)(THIS_ UINT iSwapChain, DWORD Flags, CONST D3DGAMMARAMP* pRamp) PURE; + STDMETHOD_(void, GetGammaRamp)(THIS_ UINT iSwapChain, D3DGAMMARAMP* pRamp) PURE; + STDMETHOD(CreateTexture)(THIS_ UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture9** ppTexture, HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateVolumeTexture)(THIS_ UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DVolumeTexture9** ppVolumeTexture, HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateCubeTexture)(THIS_ UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture9** ppCubeTexture, HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateVertexBuffer)(THIS_ UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer9** ppVertexBuffer, HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateIndexBuffer)(THIS_ UINT Length, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DIndexBuffer9** ppIndexBuffer, HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateRenderTarget)(THIS_ UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Lockable, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateDepthStencilSurface)(THIS_ UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Discard, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) PURE; + STDMETHOD(UpdateSurface)(THIS_ IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestinationSurface, CONST POINT* pDestPoint) PURE; + STDMETHOD(UpdateTexture)(THIS_ IDirect3DBaseTexture9* pSourceTexture, IDirect3DBaseTexture9* pDestinationTexture) PURE; + STDMETHOD(GetRenderTargetData)(THIS_ IDirect3DSurface9* pRenderTarget, IDirect3DSurface9* pDestSurface) PURE; + STDMETHOD(GetFrontBufferData)(THIS_ UINT iSwapChain, IDirect3DSurface9* pDestSurface) PURE; + STDMETHOD(StretchRect)(THIS_ IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestSurface, CONST RECT* pDestRect, D3DTEXTUREFILTERTYPE Filter) PURE; + STDMETHOD(ColorFill)(THIS_ IDirect3DSurface9* pSurface, CONST RECT* pRect, D3DCOLOR color) PURE; + STDMETHOD(CreateOffscreenPlainSurface)(THIS_ UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) PURE; + STDMETHOD(SetRenderTarget)(THIS_ DWORD RenderTargetIndex, IDirect3DSurface9* pRenderTarget) PURE; + STDMETHOD(GetRenderTarget)(THIS_ DWORD RenderTargetIndex, IDirect3DSurface9** ppRenderTarget) PURE; + STDMETHOD(SetDepthStencilSurface)(THIS_ IDirect3DSurface9* pNewZStencil) PURE; + STDMETHOD(GetDepthStencilSurface)(THIS_ IDirect3DSurface9** ppZStencilSurface) PURE; + STDMETHOD(BeginScene)(THIS) PURE; + STDMETHOD(EndScene)(THIS) PURE; + STDMETHOD(Clear)(THIS_ DWORD Count, CONST D3DRECT* pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil) PURE; + STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix) PURE; + STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE State, D3DMATRIX* pMatrix) PURE; + STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE, CONST D3DMATRIX*) PURE; + STDMETHOD(SetViewport)(THIS_ CONST D3DVIEWPORT9* pViewport) PURE; + STDMETHOD(GetViewport)(THIS_ D3DVIEWPORT9* pViewport) PURE; + STDMETHOD(SetMaterial)(THIS_ CONST D3DMATERIAL9* pMaterial) PURE; + STDMETHOD(GetMaterial)(THIS_ D3DMATERIAL9* pMaterial) PURE; + STDMETHOD(SetLight)(THIS_ DWORD Index, CONST D3DLIGHT9*) PURE; + STDMETHOD(GetLight)(THIS_ DWORD Index, D3DLIGHT9*) PURE; + STDMETHOD(LightEnable)(THIS_ DWORD Index, BOOL Enable) PURE; + STDMETHOD(GetLightEnable)(THIS_ DWORD Index, BOOL* pEnable) PURE; + STDMETHOD(SetClipPlane)(THIS_ DWORD Index, CONST float* pPlane) PURE; + STDMETHOD(GetClipPlane)(THIS_ DWORD Index, float* pPlane) PURE; + STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE State, DWORD Value) PURE; + STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE State, DWORD* pValue) PURE; + STDMETHOD(CreateStateBlock)(THIS_ D3DSTATEBLOCKTYPE Type, IDirect3DStateBlock9** ppSB) PURE; + STDMETHOD(BeginStateBlock)(THIS) PURE; + STDMETHOD(EndStateBlock)(THIS_ IDirect3DStateBlock9** ppSB) PURE; + STDMETHOD(SetClipStatus)(THIS_ CONST D3DCLIPSTATUS9* pClipStatus) PURE; + STDMETHOD(GetClipStatus)(THIS_ D3DCLIPSTATUS9* pClipStatus) PURE; + STDMETHOD(GetTexture)(THIS_ DWORD Stage, IDirect3DBaseTexture9** ppTexture) PURE; + STDMETHOD(SetTexture)(THIS_ DWORD Stage, IDirect3DBaseTexture9* pTexture) PURE; + STDMETHOD(GetTextureStageState)(THIS_ DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue) PURE; + STDMETHOD(SetTextureStageState)(THIS_ DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value) PURE; + STDMETHOD(GetSamplerState)(THIS_ DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD* pValue) PURE; + STDMETHOD(SetSamplerState)(THIS_ DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value) PURE; + STDMETHOD(ValidateDevice)(THIS_ DWORD* pNumPasses) PURE; + STDMETHOD(SetPaletteEntries)(THIS_ UINT PaletteNumber, CONST PALETTEENTRY* pEntries) PURE; + STDMETHOD(GetPaletteEntries)(THIS_ UINT PaletteNumber,PALETTEENTRY* pEntries) PURE; + STDMETHOD(SetCurrentTexturePalette)(THIS_ UINT PaletteNumber) PURE; + STDMETHOD(GetCurrentTexturePalette)(THIS_ UINT *PaletteNumber) PURE; + STDMETHOD(SetScissorRect)(THIS_ CONST RECT* pRect) PURE; + STDMETHOD(GetScissorRect)(THIS_ RECT* pRect) PURE; + STDMETHOD(SetSoftwareVertexProcessing)(THIS_ BOOL bSoftware) PURE; + STDMETHOD_(BOOL, GetSoftwareVertexProcessing)(THIS) PURE; + STDMETHOD(SetNPatchMode)(THIS_ float nSegments) PURE; + STDMETHOD_(float, GetNPatchMode)(THIS) PURE; + STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount) PURE; + STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount) PURE; + STDMETHOD(DrawPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride) PURE; + STDMETHOD(DrawIndexedPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertices, UINT PrimitiveCount, CONST void* pIndexData, D3DFORMAT IndexDataFormat, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride) PURE; + STDMETHOD(ProcessVertices)(THIS_ UINT SrcStartIndex, UINT DestIndex, UINT VertexCount, IDirect3DVertexBuffer9* pDestBuffer, IDirect3DVertexDeclaration9* pVertexDecl, DWORD Flags) PURE; + STDMETHOD(CreateVertexDeclaration)(THIS_ CONST D3DVERTEXELEMENT9* pVertexElements, IDirect3DVertexDeclaration9** ppDecl) PURE; + STDMETHOD(SetVertexDeclaration)(THIS_ IDirect3DVertexDeclaration9* pDecl) PURE; + STDMETHOD(GetVertexDeclaration)(THIS_ IDirect3DVertexDeclaration9** ppDecl) PURE; + STDMETHOD(SetFVF)(THIS_ DWORD FVF) PURE; + STDMETHOD(GetFVF)(THIS_ DWORD* pFVF) PURE; + STDMETHOD(CreateVertexShader)(THIS_ CONST DWORD* pFunction, IDirect3DVertexShader9** ppShader) PURE; + STDMETHOD(SetVertexShader)(THIS_ IDirect3DVertexShader9* pShader) PURE; + STDMETHOD(GetVertexShader)(THIS_ IDirect3DVertexShader9** ppShader) PURE; + STDMETHOD(SetVertexShaderConstantF)(THIS_ UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount) PURE; + STDMETHOD(GetVertexShaderConstantF)(THIS_ UINT StartRegister, float* pConstantData, UINT Vector4fCount) PURE; + STDMETHOD(SetVertexShaderConstantI)(THIS_ UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount) PURE; + STDMETHOD(GetVertexShaderConstantI)(THIS_ UINT StartRegister, int* pConstantData, UINT Vector4iCount) PURE; + STDMETHOD(SetVertexShaderConstantB)(THIS_ UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount) PURE; + STDMETHOD(GetVertexShaderConstantB)(THIS_ UINT StartRegister, BOOL* pConstantData, UINT BoolCount) PURE; + STDMETHOD(SetStreamSource)(THIS_ UINT StreamNumber, IDirect3DVertexBuffer9* pStreamData, UINT OffsetInBytes, UINT Stride) PURE; + STDMETHOD(GetStreamSource)(THIS_ UINT StreamNumber, IDirect3DVertexBuffer9** ppStreamData, UINT* OffsetInBytes, UINT* pStride) PURE; + STDMETHOD(SetStreamSourceFreq)(THIS_ UINT StreamNumber, UINT Divider) PURE; + STDMETHOD(GetStreamSourceFreq)(THIS_ UINT StreamNumber, UINT* Divider) PURE; + STDMETHOD(SetIndices)(THIS_ IDirect3DIndexBuffer9* pIndexData) PURE; + STDMETHOD(GetIndices)(THIS_ IDirect3DIndexBuffer9** ppIndexData) PURE; + STDMETHOD(CreatePixelShader)(THIS_ CONST DWORD* pFunction, IDirect3DPixelShader9** ppShader) PURE; + STDMETHOD(SetPixelShader)(THIS_ IDirect3DPixelShader9* pShader) PURE; + STDMETHOD(GetPixelShader)(THIS_ IDirect3DPixelShader9** ppShader) PURE; + STDMETHOD(SetPixelShaderConstantF)(THIS_ UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount) PURE; + STDMETHOD(GetPixelShaderConstantF)(THIS_ UINT StartRegister, float* pConstantData, UINT Vector4fCount) PURE; + STDMETHOD(SetPixelShaderConstantI)(THIS_ UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount) PURE; + STDMETHOD(GetPixelShaderConstantI)(THIS_ UINT StartRegister, int* pConstantData, UINT Vector4iCount) PURE; + STDMETHOD(SetPixelShaderConstantB)(THIS_ UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount) PURE; + STDMETHOD(GetPixelShaderConstantB)(THIS_ UINT StartRegister, BOOL* pConstantData, UINT BoolCount) PURE; + STDMETHOD(DrawRectPatch)(THIS_ UINT Handle, CONST float* pNumSegs, CONST D3DRECTPATCH_INFO* pRectPatchInfo) PURE; + STDMETHOD(DrawTriPatch)(THIS_ UINT Handle, CONST float* pNumSegs, CONST D3DTRIPATCH_INFO* pTriPatchInfo) PURE; + STDMETHOD(DeletePatch)(THIS_ UINT Handle) PURE; + STDMETHOD(CreateQuery)(THIS_ D3DQUERYTYPE Type, IDirect3DQuery9** ppQuery) PURE; + }; + #undef INTERFACE + + #if !defined(__cplusplus) || defined(CINTERFACE) + /*** IUnknown methods ***/ + #define IDirect3DDevice9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) + #define IDirect3DDevice9_AddRef(p) (p)->lpVtbl->AddRef(p) + #define IDirect3DDevice9_Release(p) (p)->lpVtbl->Release(p) + /*** IDirect3DDevice9 methods ***/ + #define IDirect3DDevice9_TestCooperativeLevel(p) (p)->lpVtbl->TestCooperativeLevel(p) + #define IDirect3DDevice9_GetAvailableTextureMem(p) (p)->lpVtbl->GetAvailableTextureMem(p) + #define IDirect3DDevice9_EvictManagedResources(p) (p)->lpVtbl->EvictManagedResources(p) + #define IDirect3DDevice9_GetDirect3D(p,a) (p)->lpVtbl->GetDirect3D(p,a) + #define IDirect3DDevice9_GetDeviceCaps(p,a) (p)->lpVtbl->GetDeviceCaps(p,a) + #define IDirect3DDevice9_GetDisplayMode(p,a,b) (p)->lpVtbl->GetDisplayMode(p,a,b) + #define IDirect3DDevice9_GetCreationParameters(p,a) (p)->lpVtbl->GetCreationParameters(p,a) + #define IDirect3DDevice9_SetCursorProperties(p,a,b,c) (p)->lpVtbl->SetCursorProperties(p,a,b,c) + #define IDirect3DDevice9_SetCursorPosition(p,a,b,c) (p)->lpVtbl->SetCursorPosition(p,a,b,c) + #define IDirect3DDevice9_ShowCursor(p,a) (p)->lpVtbl->ShowCursor(p,a) + #define IDirect3DDevice9_CreateAdditionalSwapChain(p,a,b) (p)->lpVtbl->CreateAdditionalSwapChain(p,a,b) + #define IDirect3DDevice9_GetSwapChain(p,a,b) (p)->lpVtbl->GetSwapChain(p,a,b) + #define IDirect3DDevice9_GetNumberOfSwapChains(p) (p)->lpVtbl->GetNumberOfSwapChains(p) + #define IDirect3DDevice9_Reset(p,a) (p)->lpVtbl->Reset(p,a) + #define IDirect3DDevice9_Present(p,a,b,c,d) (p)->lpVtbl->Present(p,a,b,c,d) + #define IDirect3DDevice9_GetBackBuffer(p,a,b,c,d) (p)->lpVtbl->GetBackBuffer(p,a,b,c,d) + #define IDirect3DDevice9_GetRasterStatus(p,a,b) (p)->lpVtbl->GetRasterStatus(p,a,b) + #define IDirect3DDevice9_SetDialogBoxMode(p,a) (p)->lpVtbl->SetDialogBoxMode(p,a) + #define IDirect3DDevice9_SetGammaRamp(p,a,b,c) (p)->lpVtbl->SetGammaRamp(p,a,b,c) + #define IDirect3DDevice9_GetGammaRamp(p,a,b) (p)->lpVtbl->GetGammaRamp(p,a,b) + #define IDirect3DDevice9_CreateTexture(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CreateTexture(p,a,b,c,d,e,f,g,h) + #define IDirect3DDevice9_CreateVolumeTexture(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CreateVolumeTexture(p,a,b,c,d,e,f,g,h,i) + #define IDirect3DDevice9_CreateCubeTexture(p,a,b,c,d,e,f,g) (p)->lpVtbl->CreateCubeTexture(p,a,b,c,d,e,f,g) + #define IDirect3DDevice9_CreateVertexBuffer(p,a,b,c,d,e,f) (p)->lpVtbl->CreateVertexBuffer(p,a,b,c,d,e,f) + #define IDirect3DDevice9_CreateIndexBuffer(p,a,b,c,d,e,f) (p)->lpVtbl->CreateIndexBuffer(p,a,b,c,d,e,f) + #define IDirect3DDevice9_CreateRenderTarget(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CreateRenderTarget(p,a,b,c,d,e,f,g,h) + #define IDirect3DDevice9_CreateDepthStencilSurface(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CreateDepthStencilSurface(p,a,b,c,d,e,f,g,h) + #define IDirect3DDevice9_UpdateSurface(p,a,b,c,d) (p)->lpVtbl->UpdateSurface(p,a,b,c,d) + #define IDirect3DDevice9_UpdateTexture(p,a,b) (p)->lpVtbl->UpdateTexture(p,a,b) + #define IDirect3DDevice9_GetRenderTargetData(p,a,b) (p)->lpVtbl->GetRenderTargetData(p,a,b) + #define IDirect3DDevice9_GetFrontBufferData(p,a,b) (p)->lpVtbl->GetFrontBufferData(p,a,b) + #define IDirect3DDevice9_StretchRect(p,a,b,c,d,e) (p)->lpVtbl->StretchRect(p,a,b,c,d,e) + #define IDirect3DDevice9_ColorFill(p,a,b,c) (p)->lpVtbl->ColorFill(p,a,b,c) + #define IDirect3DDevice9_CreateOffscreenPlainSurface(p,a,b,c,d,e,f) (p)->lpVtbl->CreateOffscreenPlainSurface(p,a,b,c,d,e,f) + #define IDirect3DDevice9_SetRenderTarget(p,a,b) (p)->lpVtbl->SetRenderTarget(p,a,b) + #define IDirect3DDevice9_GetRenderTarget(p,a,b) (p)->lpVtbl->GetRenderTarget(p,a,b) + #define IDirect3DDevice9_SetDepthStencilSurface(p,a) (p)->lpVtbl->SetDepthStencilSurface(p,a) + #define IDirect3DDevice9_GetDepthStencilSurface(p,a) (p)->lpVtbl->GetDepthStencilSurface(p,a) + #define IDirect3DDevice9_BeginScene(p) (p)->lpVtbl->BeginScene(p) + #define IDirect3DDevice9_EndScene(p) (p)->lpVtbl->EndScene(p) + #define IDirect3DDevice9_Clear(p,a,b,c,d,e,f) (p)->lpVtbl->Clear(p,a,b,c,d,e,f) + #define IDirect3DDevice9_SetTransform(p,a,b) (p)->lpVtbl->SetTransform(p,a,b) + #define IDirect3DDevice9_GetTransform(p,a,b) (p)->lpVtbl->GetTransform(p,a,b) + #define IDirect3DDevice9_MultiplyTransform(p,a,b) (p)->lpVtbl->MultiplyTransform(p,a,b) + #define IDirect3DDevice9_SetViewport(p,a) (p)->lpVtbl->SetViewport(p,a) + #define IDirect3DDevice9_GetViewport(p,a) (p)->lpVtbl->GetViewport(p,a) + #define IDirect3DDevice9_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a) + #define IDirect3DDevice9_GetMaterial(p,a) (p)->lpVtbl->GetMaterial(p,a) + #define IDirect3DDevice9_SetLight(p,a,b) (p)->lpVtbl->SetLight(p,a,b) + #define IDirect3DDevice9_GetLight(p,a,b) (p)->lpVtbl->GetLight(p,a,b) + #define IDirect3DDevice9_LightEnable(p,a,b) (p)->lpVtbl->LightEnable(p,a,b) + #define IDirect3DDevice9_GetLightEnable(p,a,b) (p)->lpVtbl->GetLightEnable(p,a,b) + #define IDirect3DDevice9_SetClipPlane(p,a,b) (p)->lpVtbl->SetClipPlane(p,a,b) + #define IDirect3DDevice9_GetClipPlane(p,a,b) (p)->lpVtbl->GetClipPlane(p,a,b) + #define IDirect3DDevice9_SetRenderState(p,a,b) (p)->lpVtbl->SetRenderState(p,a,b) + #define IDirect3DDevice9_GetRenderState(p,a,b) (p)->lpVtbl->GetRenderState(p,a,b) + #define IDirect3DDevice9_CreateStateBlock(p,a,b) (p)->lpVtbl->CreateStateBlock(p,a,b) + #define IDirect3DDevice9_BeginStateBlock(p) (p)->lpVtbl->BeginStateBlock(p) + #define IDirect3DDevice9_EndStateBlock(p,a) (p)->lpVtbl->EndStateBlock(p,a) + #define IDirect3DDevice9_SetClipStatus(p,a) (p)->lpVtbl->SetClipStatus(p,a) + #define IDirect3DDevice9_GetClipStatus(p,a) (p)->lpVtbl->GetClipStatus(p,a) + #define IDirect3DDevice9_GetTexture(p,a,b) (p)->lpVtbl->GetTexture(p,a,b) + #define IDirect3DDevice9_SetTexture(p,a,b) (p)->lpVtbl->SetTexture(p,a,b) + #define IDirect3DDevice9_GetTextureStageState(p,a,b,c) (p)->lpVtbl->GetTextureStageState(p,a,b,c) + #define IDirect3DDevice9_SetTextureStageState(p,a,b,c) (p)->lpVtbl->SetTextureStageState(p,a,b,c) + #define IDirect3DDevice9_GetSamplerState(p,a,b,c) (p)->lpVtbl->GetSamplerState(p,a,b,c) + #define IDirect3DDevice9_SetSamplerState(p,a,b,c) (p)->lpVtbl->SetSamplerState(p,a,b,c) + #define IDirect3DDevice9_ValidateDevice(p,a) (p)->lpVtbl->ValidateDevice(p,a) + #define IDirect3DDevice9_SetPaletteEntries(p,a,b) (p)->lpVtbl->SetPaletteEntries(p,a,b) + #define IDirect3DDevice9_GetPaletteEntries(p,a,b) (p)->lpVtbl->GetPaletteEntries(p,a,b) + #define IDirect3DDevice9_SetCurrentTexturePalette(p,a) (p)->lpVtbl->SetCurrentTexturePalette(p,a) + #define IDirect3DDevice9_GetCurrentTexturePalette(p,a) (p)->lpVtbl->GetCurrentTexturePalette(p,a) + #define IDirect3DDevice9_SetScissorRect(p,a) (p)->lpVtbl->SetScissorRect(p,a) + #define IDirect3DDevice9_GetScissorRect(p,a) (p)->lpVtbl->GetScissorRect(p,a) + #define IDirect3DDevice9_SetSoftwareVertexProcessing(p,a) (p)->lpVtbl->SetSoftwareVertexProcessing(p,a) + #define IDirect3DDevice9_GetSoftwareVertexProcessing(p) (p)->lpVtbl->GetSoftwareVertexProcessing(p) + #define IDirect3DDevice9_SetNPatchMode(p,a) (p)->lpVtbl->SetNPatchMode(p,a) + #define IDirect3DDevice9_GetNPatchMode(p) (p)->lpVtbl->GetNPatchMode(p) + #define IDirect3DDevice9_DrawPrimitive(p,a,b,c) (p)->lpVtbl->DrawPrimitive(p,a,b,c) + #define IDirect3DDevice9_DrawIndexedPrimitive(p,a,b,c,d,e,f) (p)->lpVtbl->DrawIndexedPrimitive(p,a,b,c,d,e,f) + #define IDirect3DDevice9_DrawPrimitiveUP(p,a,b,c,d) (p)->lpVtbl->DrawPrimitiveUP(p,a,b,c,d) + #define IDirect3DDevice9_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) + #define IDirect3DDevice9_ProcessVertices(p,a,b,c,d,e,f) (p)->lpVtbl->ProcessVertices(p,a,b,c,d,e,f) + #define IDirect3DDevice9_CreateVertexDeclaration(p,a,b) (p)->lpVtbl->CreateVertexDeclaration(p,a,b) + #define IDirect3DDevice9_SetVertexDeclaration(p,a) (p)->lpVtbl->SetVertexDeclaration(p,a) + #define IDirect3DDevice9_GetVertexDeclaration(p,a) (p)->lpVtbl->GetVertexDeclaration(p,a) + #define IDirect3DDevice9_SetFVF(p,a) (p)->lpVtbl->SetFVF(p,a) + #define IDirect3DDevice9_GetFVF(p,a) (p)->lpVtbl->GetFVF(p,a) + #define IDirect3DDevice9_CreateVertexShader(p,a,b) (p)->lpVtbl->CreateVertexShader(p,a,b) + #define IDirect3DDevice9_SetVertexShader(p,a) (p)->lpVtbl->SetVertexShader(p,a) + #define IDirect3DDevice9_GetVertexShader(p,a) (p)->lpVtbl->GetVertexShader(p,a) + #define IDirect3DDevice9_SetVertexShaderConstantF(p,a,b,c) (p)->lpVtbl->SetVertexShaderConstantF(p,a,b,c) + #define IDirect3DDevice9_GetVertexShaderConstantF(p,a,b,c) (p)->lpVtbl->GetVertexShaderConstantF(p,a,b,c) + #define IDirect3DDevice9_SetVertexShaderConstantI(p,a,b,c) (p)->lpVtbl->SetVertexShaderConstantI(p,a,b,c) + #define IDirect3DDevice9_GetVertexShaderConstantI(p,a,b,c) (p)->lpVtbl->GetVertexShaderConstantI(p,a,b,c) + #define IDirect3DDevice9_SetVertexShaderConstantB(p,a,b,c) (p)->lpVtbl->SetVertexShaderConstantB(p,a,b,c) + #define IDirect3DDevice9_GetVertexShaderConstantB(p,a,b,c) (p)->lpVtbl->GetVertexShaderConstantB(p,a,b,c) + #define IDirect3DDevice9_SetStreamSource(p,a,b,c,d) (p)->lpVtbl->SetStreamSource(p,a,b,c,d) + #define IDirect3DDevice9_GetStreamSource(p,a,b,c,d) (p)->lpVtbl->GetStreamSource(p,a,b,c,d) + #define IDirect3DDevice9_SetStreamSourceFreq(p,a,b) (p)->lpVtbl->SetStreamSourceFreq(p,a,b) + #define IDirect3DDevice9_GetStreamSourceFreq(p,a,b) (p)->lpVtbl->GetStreamSourceFreq(p,a,b) + #define IDirect3DDevice9_SetIndices(p,a) (p)->lpVtbl->SetIndices(p,a) + #define IDirect3DDevice9_GetIndices(p,a) (p)->lpVtbl->GetIndices(p,a) + #define IDirect3DDevice9_CreatePixelShader(p,a,b) (p)->lpVtbl->CreatePixelShader(p,a,b) + #define IDirect3DDevice9_SetPixelShader(p,a) (p)->lpVtbl->SetPixelShader(p,a) + #define IDirect3DDevice9_GetPixelShader(p,a) (p)->lpVtbl->GetPixelShader(p,a) + #define IDirect3DDevice9_SetPixelShaderConstantF(p,a,b,c) (p)->lpVtbl->SetPixelShaderConstantF(p,a,b,c) + #define IDirect3DDevice9_GetPixelShaderConstantF(p,a,b,c) (p)->lpVtbl->GetPixelShaderConstantF(p,a,b,c) + #define IDirect3DDevice9_SetPixelShaderConstantI(p,a,b,c) (p)->lpVtbl->SetPixelShaderConstantI(p,a,b,c) + #define IDirect3DDevice9_GetPixelShaderConstantI(p,a,b,c) (p)->lpVtbl->GetPixelShaderConstantI(p,a,b,c) + #define IDirect3DDevice9_SetPixelShaderConstantB(p,a,b,c) (p)->lpVtbl->SetPixelShaderConstantB(p,a,b,c) + #define IDirect3DDevice9_GetPixelShaderConstantB(p,a,b,c) (p)->lpVtbl->GetPixelShaderConstantB(p,a,b,c) + #define IDirect3DDevice9_DrawRectPatch(p,a,b,c) (p)->lpVtbl->DrawRectPatch(p,a,b,c) + #define IDirect3DDevice9_DrawTriPatch(p,a,b,c) (p)->lpVtbl->DrawTriPatch(p,a,b,c) + #define IDirect3DDevice9_DeletePatch(p,a) (p)->lpVtbl->DeletePatch(p,a) + #define IDirect3DDevice9_CreateQuery(p,a,b) (p)->lpVtbl->CreateQuery(p,a,b) + #else + /*** IUnknown methods ***/ + #define IDirect3DDevice9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) + #define IDirect3DDevice9_AddRef(p) (p)->AddRef() + #define IDirect3DDevice9_Release(p) (p)->Release() + /*** IDirect3DDevice9 methods ***/ + #define IDirect3DDevice9_TestCooperativeLevel(p) (p)->TestCooperativeLevel() + #define IDirect3DDevice9_GetAvailableTextureMem(p) (p)->GetAvailableTextureMem() + #define IDirect3DDevice9_EvictManagedResources(p) (p)->EvictManagedResources() + #define IDirect3DDevice9_GetDirect3D(p,a) (p)->GetDirect3D(a) + #define IDirect3DDevice9_GetDeviceCaps(p,a) (p)->GetDeviceCaps(a) + #define IDirect3DDevice9_GetDisplayMode(p,a,b) (p)->GetDisplayMode(a,b) + #define IDirect3DDevice9_GetCreationParameters(p,a) (p)->GetCreationParameters(a) + #define IDirect3DDevice9_SetCursorProperties(p,a,b,c) (p)->SetCursorProperties(a,b,c) + #define IDirect3DDevice9_SetCursorPosition(p,a,b,c) (p)->SetCursorPosition(a,b,c) + #define IDirect3DDevice9_ShowCursor(p,a) (p)->ShowCursor(a) + #define IDirect3DDevice9_CreateAdditionalSwapChain(p,a,b) (p)->CreateAdditionalSwapChain(a,b) + #define IDirect3DDevice9_GetSwapChain(p,a,b) (p)->GetSwapChain(a,b) + #define IDirect3DDevice9_GetNumberOfSwapChains(p) (p)->GetNumberOfSwapChains() + #define IDirect3DDevice9_Reset(p,a) (p)->Reset(a) + #define IDirect3DDevice9_Present(p,a,b,c,d) (p)->Present(a,b,c,d) + #define IDirect3DDevice9_GetBackBuffer(p,a,b,c,d) (p)->GetBackBuffer(a,b,c,d) + #define IDirect3DDevice9_GetRasterStatus(p,a,b) (p)->GetRasterStatus(a,b) + #define IDirect3DDevice9_SetDialogBoxMode(p,a) (p)->SetDialogBoxMode(a) + #define IDirect3DDevice9_SetGammaRamp(p,a,b,c) (p)->SetGammaRamp(a,b,c) + #define IDirect3DDevice9_GetGammaRamp(p,a,b) (p)->GetGammaRamp(a,b) + #define IDirect3DDevice9_CreateTexture(p,a,b,c,d,e,f,g,h) (p)->CreateTexture(a,b,c,d,e,f,g,h) + #define IDirect3DDevice9_CreateVolumeTexture(p,a,b,c,d,e,f,g,h,i) (p)->CreateVolumeTexture(a,b,c,d,e,f,g,h,i) + #define IDirect3DDevice9_CreateCubeTexture(p,a,b,c,d,e,f,g) (p)->CreateCubeTexture(a,b,c,d,e,f,g) + #define IDirect3DDevice9_CreateVertexBuffer(p,a,b,c,d,e,f) (p)->CreateVertexBuffer(a,b,c,d,e,f) + #define IDirect3DDevice9_CreateIndexBuffer(p,a,b,c,d,e,f) (p)->CreateIndexBuffer(a,b,c,d,e,f) + #define IDirect3DDevice9_CreateRenderTarget(p,a,b,c,d,e,f,g,h) (p)->CreateRenderTarget(a,b,c,d,e,f,g,h) + #define IDirect3DDevice9_CreateDepthStencilSurface(p,a,b,c,d,e,f,g,h) (p)->CreateDepthStencilSurface(a,b,c,d,e,f,g,h) + #define IDirect3DDevice9_UpdateSurface(p,a,b,c,d) (p)->UpdateSurface(a,b,c,d) + #define IDirect3DDevice9_UpdateTexture(p,a,b) (p)->UpdateTexture(a,b) + #define IDirect3DDevice9_GetRenderTargetData(p,a,b) (p)->GetRenderTargetData(a,b) + #define IDirect3DDevice9_GetFrontBufferData(p,a,b) (p)->GetFrontBufferData(a,b) + #define IDirect3DDevice9_StretchRect(p,a,b,c,d,e) (p)->StretchRect(a,b,c,d,e) + #define IDirect3DDevice9_ColorFill(p,a,b,c) (p)->ColorFill(a,b,c) + #define IDirect3DDevice9_CreateOffscreenPlainSurface(p,a,b,c,d,e,f) (p)->CreateOffscreenPlainSurface(a,b,c,d,e,f) + #define IDirect3DDevice9_SetRenderTarget(p,a,b) (p)->SetRenderTarget(a,b) + #define IDirect3DDevice9_GetRenderTarget(p,a,b) (p)->GetRenderTarget(a,b) + #define IDirect3DDevice9_SetDepthStencilSurface(p,a) (p)->SetDepthStencilSurface(a) + #define IDirect3DDevice9_GetDepthStencilSurface(p,a) (p)->GetDepthStencilSurface(a) + #define IDirect3DDevice9_BeginScene(p) (p)->BeginScene() + #define IDirect3DDevice9_EndScene(p) (p)->EndScene() + #define IDirect3DDevice9_Clear(p,a,b,c,d,e,f) (p)->Clear(a,b,c,d,e,f) + #define IDirect3DDevice9_SetTransform(p,a,b) (p)->SetTransform(a,b) + #define IDirect3DDevice9_GetTransform(p,a,b) (p)->GetTransform(a,b) + #define IDirect3DDevice9_MultiplyTransform(p,a,b) (p)->MultiplyTransform(a,b) + #define IDirect3DDevice9_SetViewport(p,a) (p)->SetViewport(a) + #define IDirect3DDevice9_GetViewport(p,a) (p)->GetViewport(a) + #define IDirect3DDevice9_SetMaterial(p,a) (p)->SetMaterial(a) + #define IDirect3DDevice9_GetMaterial(p,a) (p)->GetMaterial(a) + #define IDirect3DDevice9_SetLight(p,a,b) (p)->SetLight(a,b) + #define IDirect3DDevice9_GetLight(p,a,b) (p)->GetLight(a,b) + #define IDirect3DDevice9_LightEnable(p,a,b) (p)->LightEnable(a,b) + #define IDirect3DDevice9_GetLightEnable(p,a,b) (p)->GetLightEnable(a,b) + #define IDirect3DDevice9_SetClipPlane(p,a,b) (p)->SetClipPlane(a,b) + #define IDirect3DDevice9_GetClipPlane(p,a,b) (p)->GetClipPlane(a,b) + #define IDirect3DDevice9_SetRenderState(p,a,b) (p)->SetRenderState(a,b) + #define IDirect3DDevice9_GetRenderState(p,a,b) (p)->GetRenderState(a,b) + #define IDirect3DDevice9_CreateStateBlock(p,a,b) (p)->CreateStateBlock(a,b) + #define IDirect3DDevice9_BeginStateBlock(p) (p)->BeginStateBlock() + #define IDirect3DDevice9_EndStateBlock(p,a) (p)->EndStateBlock(a) + #define IDirect3DDevice9_SetClipStatus(p,a) (p)->SetClipStatus(a) + #define IDirect3DDevice9_GetClipStatus(p,a) (p)->GetClipStatus(a) + #define IDirect3DDevice9_GetTexture(p,a,b) (p)->GetTexture(a,b) + #define IDirect3DDevice9_SetTexture(p,a,b) (p)->SetTexture(a,b) + #define IDirect3DDevice9_GetTextureStageState(p,a,b,c) (p)->GetTextureStageState(a,b,c) + #define IDirect3DDevice9_SetTextureStageState(p,a,b,c) (p)->SetTextureStageState(a,b,c) + #define IDirect3DDevice9_GetSamplerState(p,a,b,c) (p)->GetSamplerState(a,b,c) + #define IDirect3DDevice9_SetSamplerState(p,a,b,c) (p)->SetSamplerState(a,b,c) + #define IDirect3DDevice9_ValidateDevice(p,a) (p)->ValidateDevice(a) + #define IDirect3DDevice9_SetPaletteEntries(p,a,b) (p)->SetPaletteEntries(a,b) + #define IDirect3DDevice9_GetPaletteEntries(p,a,b) (p)->GetPaletteEntries(a,b) + #define IDirect3DDevice9_SetCurrentTexturePalette(p,a) (p)->SetCurrentTexturePalette(a) + #define IDirect3DDevice9_GetCurrentTexturePalette(p,a) (p)->GetCurrentTexturePalette(a) + #define IDirect3DDevice9_SetScissorRect(p,a) (p)->SetScissorRect(a) + #define IDirect3DDevice9_GetScissorRect(p,a) (p)->GetScissorRect(a) + #define IDirect3DDevice9_SetSoftwareVertexProcessing(p,a) (p)->SetSoftwareVertexProcessing(a) + #define IDirect3DDevice9_GetSoftwareVertexProcessing(p) (p)->GetSoftwareVertexProcessing() + #define IDirect3DDevice9_SetNPatchMode(p,a) (p)->SetNPatchMode(a) + #define IDirect3DDevice9_GetNPatchMode(p) (p)->GetNPatchMode() + #define IDirect3DDevice9_DrawPrimitive(p,a,b,c) (p)->DrawPrimitive(a,b,c) + #define IDirect3DDevice9_DrawIndexedPrimitive(p,a,b,c,d,e,f) (p)->DrawIndexedPrimitive(a,b,c,d,e,f) + #define IDirect3DDevice9_DrawPrimitiveUP(p,a,b,c,d) (p)->DrawPrimitiveUP(a,b,c,d) + #define IDirect3DDevice9_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) (p)->DrawIndexedPrimitiveUP(a,b,c,d,e,f,g,h) + #define IDirect3DDevice9_ProcessVertices(p,a,b,c,d,e,f) (p)->ProcessVertices(a,b,c,d,e,f) + #define IDirect3DDevice9_CreateVertexDeclaration(p,a,b) (p)->CreateVertexDeclaration(a,b) + #define IDirect3DDevice9_SetVertexDeclaration(p,a) (p)->SetVertexDeclaration(a) + #define IDirect3DDevice9_GetVertexDeclaration(p,a) (p)->GetVertexDeclaration(a) + #define IDirect3DDevice9_SetFVF(p,a) (p)->SetFVF(a) + #define IDirect3DDevice9_GetFVF(p,a) (p)->GetFVF(a) + #define IDirect3DDevice9_CreateVertexShader(p,a,b) (p)->CreateVertexShader(a,b) + #define IDirect3DDevice9_SetVertexShader(p,a) (p)->SetVertexShader(a) + #define IDirect3DDevice9_GetVertexShader(p,a) (p)->GetVertexShader(a) + #define IDirect3DDevice9_SetVertexShaderConstantF(p,a,b,c) (p)->SetVertexShaderConstantF(a,b,c) + #define IDirect3DDevice9_GetVertexShaderConstantF(p,a,b,c) (p)->GetVertexShaderConstantF(a,b,c) + #define IDirect3DDevice9_SetVertexShaderConstantI(p,a,b,c) (p)->SetVertexShaderConstantI(a,b,c) + #define IDirect3DDevice9_GetVertexShaderConstantI(p,a,b,c) (p)->GetVertexShaderConstantI(a,b,c) + #define IDirect3DDevice9_SetVertexShaderConstantB(p,a,b,c) (p)->SetVertexShaderConstantB(a,b,c) + #define IDirect3DDevice9_GetVertexShaderConstantB(p,a,b,c) (p)->GetVertexShaderConstantB(a,b,c) + #define IDirect3DDevice9_SetStreamSource(p,a,b,c,d) (p)->SetStreamSource(a,b,c,d) + #define IDirect3DDevice9_GetStreamSource(p,a,b,c,d) (p)->GetStreamSource(a,b,c,d) + #define IDirect3DDevice9_SetStreamSourceFreq(p,a,b) (p)->SetStreamSourceFreq(a,b) + #define IDirect3DDevice9_GetStreamSourceFreq(p,a,b) (p)->GetStreamSourceFreq(a,b) + #define IDirect3DDevice9_SetIndices(p,a) (p)->SetIndices(a) + #define IDirect3DDevice9_GetIndices(p,a) (p)->GetIndices(a) + #define IDirect3DDevice9_CreatePixelShader(p,a,b) (p)->CreatePixelShader(a,b) + #define IDirect3DDevice9_SetPixelShader(p,a) (p)->SetPixelShader(a) + #define IDirect3DDevice9_GetPixelShader(p,a) (p)->GetPixelShader(a) + #define IDirect3DDevice9_SetPixelShaderConstantF(p,a,b,c) (p)->SetPixelShaderConstantF(a,b,c) + #define IDirect3DDevice9_GetPixelShaderConstantF(p,a,b,c) (p)->GetPixelShaderConstantF(a,b,c) + #define IDirect3DDevice9_SetPixelShaderConstantI(p,a,b,c) (p)->SetPixelShaderConstantI(a,b,c) + #define IDirect3DDevice9_GetPixelShaderConstantI(p,a,b,c) (p)->GetPixelShaderConstantI(a,b,c) + #define IDirect3DDevice9_SetPixelShaderConstantB(p,a,b,c) (p)->SetPixelShaderConstantB(a,b,c) + #define IDirect3DDevice9_GetPixelShaderConstantB(p,a,b,c) (p)->GetPixelShaderConstantB(a,b,c) + #define IDirect3DDevice9_DrawRectPatch(p,a,b,c) (p)->DrawRectPatch(a,b,c) + #define IDirect3DDevice9_DrawTriPatch(p,a,b,c) (p)->DrawTriPatch(a,b,c) + #define IDirect3DDevice9_DeletePatch(p,a) (p)->DeletePatch(a) + #define IDirect3DDevice9_CreateQuery(p,a,b) (p)->CreateQuery(a,b) + #endif + + + /***************************************************************************** + * IDirect3DDevice9Ex interface + */ + #define INTERFACE IDirect3DDevice9Ex + DECLARE_INTERFACE_(IDirect3DDevice9Ex,IDirect3DDevice9) + { + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirect3DDevice9 methods ***/ + STDMETHOD(TestCooperativeLevel)(THIS) PURE; + STDMETHOD_(UINT, GetAvailableTextureMem)(THIS) PURE; + STDMETHOD(EvictManagedResources)(THIS) PURE; + STDMETHOD(GetDirect3D)(THIS_ IDirect3D9** ppD3D9) PURE; + STDMETHOD(GetDeviceCaps)(THIS_ D3DCAPS9* pCaps) PURE; + STDMETHOD(GetDisplayMode)(THIS_ UINT iSwapChain, D3DDISPLAYMODE* pMode) PURE; + STDMETHOD(GetCreationParameters)(THIS_ D3DDEVICE_CREATION_PARAMETERS *pParameters) PURE; + STDMETHOD(SetCursorProperties)(THIS_ UINT XHotSpot, UINT YHotSpot, IDirect3DSurface9* pCursorBitmap) PURE; + STDMETHOD_(void, SetCursorPosition)(THIS_ int X,int Y, DWORD Flags) PURE; + STDMETHOD_(BOOL, ShowCursor)(THIS_ BOOL bShow) PURE; + STDMETHOD(CreateAdditionalSwapChain)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DSwapChain9** pSwapChain) PURE; + STDMETHOD(GetSwapChain)(THIS_ UINT iSwapChain, IDirect3DSwapChain9** pSwapChain) PURE; + STDMETHOD_(UINT, GetNumberOfSwapChains)(THIS) PURE; + STDMETHOD(Reset)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters) PURE; + STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion) PURE; + STDMETHOD(GetBackBuffer)(THIS_ UINT iSwapChain, UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9** ppBackBuffer) PURE; + STDMETHOD(GetRasterStatus)(THIS_ UINT iSwapChain, D3DRASTER_STATUS* pRasterStatus) PURE; + STDMETHOD(SetDialogBoxMode)(THIS_ BOOL bEnableDialogs) PURE; + STDMETHOD_(void, SetGammaRamp)(THIS_ UINT iSwapChain, DWORD Flags, CONST D3DGAMMARAMP* pRamp) PURE; + STDMETHOD_(void, GetGammaRamp)(THIS_ UINT iSwapChain, D3DGAMMARAMP* pRamp) PURE; + STDMETHOD(CreateTexture)(THIS_ UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture9** ppTexture, HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateVolumeTexture)(THIS_ UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DVolumeTexture9** ppVolumeTexture, HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateCubeTexture)(THIS_ UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture9** ppCubeTexture, HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateVertexBuffer)(THIS_ UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer9** ppVertexBuffer, HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateIndexBuffer)(THIS_ UINT Length, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DIndexBuffer9** ppIndexBuffer, HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateRenderTarget)(THIS_ UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Lockable, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateDepthStencilSurface)(THIS_ UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Discard, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) PURE; + STDMETHOD(UpdateSurface)(THIS_ IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestinationSurface, CONST POINT* pDestPoint) PURE; + STDMETHOD(UpdateTexture)(THIS_ IDirect3DBaseTexture9* pSourceTexture, IDirect3DBaseTexture9* pDestinationTexture) PURE; + STDMETHOD(GetRenderTargetData)(THIS_ IDirect3DSurface9* pRenderTarget, IDirect3DSurface9* pDestSurface) PURE; + STDMETHOD(GetFrontBufferData)(THIS_ UINT iSwapChain, IDirect3DSurface9* pDestSurface) PURE; + STDMETHOD(StretchRect)(THIS_ IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestSurface, CONST RECT* pDestRect, D3DTEXTUREFILTERTYPE Filter) PURE; + STDMETHOD(ColorFill)(THIS_ IDirect3DSurface9* pSurface, CONST RECT* pRect, D3DCOLOR color) PURE; + STDMETHOD(CreateOffscreenPlainSurface)(THIS_ UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) PURE; + STDMETHOD(SetRenderTarget)(THIS_ DWORD RenderTargetIndex, IDirect3DSurface9* pRenderTarget) PURE; + STDMETHOD(GetRenderTarget)(THIS_ DWORD RenderTargetIndex, IDirect3DSurface9** ppRenderTarget) PURE; + STDMETHOD(SetDepthStencilSurface)(THIS_ IDirect3DSurface9* pNewZStencil) PURE; + STDMETHOD(GetDepthStencilSurface)(THIS_ IDirect3DSurface9** ppZStencilSurface) PURE; + STDMETHOD(BeginScene)(THIS) PURE; + STDMETHOD(EndScene)(THIS) PURE; + STDMETHOD(Clear)(THIS_ DWORD Count, CONST D3DRECT* pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil) PURE; + STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix) PURE; + STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE State, D3DMATRIX* pMatrix) PURE; + STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE, CONST D3DMATRIX*) PURE; + STDMETHOD(SetViewport)(THIS_ CONST D3DVIEWPORT9* pViewport) PURE; + STDMETHOD(GetViewport)(THIS_ D3DVIEWPORT9* pViewport) PURE; + STDMETHOD(SetMaterial)(THIS_ CONST D3DMATERIAL9* pMaterial) PURE; + STDMETHOD(GetMaterial)(THIS_ D3DMATERIAL9* pMaterial) PURE; + STDMETHOD(SetLight)(THIS_ DWORD Index, CONST D3DLIGHT9*) PURE; + STDMETHOD(GetLight)(THIS_ DWORD Index, D3DLIGHT9*) PURE; + STDMETHOD(LightEnable)(THIS_ DWORD Index, BOOL Enable) PURE; + STDMETHOD(GetLightEnable)(THIS_ DWORD Index, BOOL* pEnable) PURE; + STDMETHOD(SetClipPlane)(THIS_ DWORD Index, CONST float* pPlane) PURE; + STDMETHOD(GetClipPlane)(THIS_ DWORD Index, float* pPlane) PURE; + STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE State, DWORD Value) PURE; + STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE State, DWORD* pValue) PURE; + STDMETHOD(CreateStateBlock)(THIS_ D3DSTATEBLOCKTYPE Type, IDirect3DStateBlock9** ppSB) PURE; + STDMETHOD(BeginStateBlock)(THIS) PURE; + STDMETHOD(EndStateBlock)(THIS_ IDirect3DStateBlock9** ppSB) PURE; + STDMETHOD(SetClipStatus)(THIS_ CONST D3DCLIPSTATUS9* pClipStatus) PURE; + STDMETHOD(GetClipStatus)(THIS_ D3DCLIPSTATUS9* pClipStatus) PURE; + STDMETHOD(GetTexture)(THIS_ DWORD Stage, IDirect3DBaseTexture9** ppTexture) PURE; + STDMETHOD(SetTexture)(THIS_ DWORD Stage, IDirect3DBaseTexture9* pTexture) PURE; + STDMETHOD(GetTextureStageState)(THIS_ DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue) PURE; + STDMETHOD(SetTextureStageState)(THIS_ DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value) PURE; + STDMETHOD(GetSamplerState)(THIS_ DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD* pValue) PURE; + STDMETHOD(SetSamplerState)(THIS_ DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value) PURE; + STDMETHOD(ValidateDevice)(THIS_ DWORD* pNumPasses) PURE; + STDMETHOD(SetPaletteEntries)(THIS_ UINT PaletteNumber, CONST PALETTEENTRY* pEntries) PURE; + STDMETHOD(GetPaletteEntries)(THIS_ UINT PaletteNumber,PALETTEENTRY* pEntries) PURE; + STDMETHOD(SetCurrentTexturePalette)(THIS_ UINT PaletteNumber) PURE; + STDMETHOD(GetCurrentTexturePalette)(THIS_ UINT *PaletteNumber) PURE; + STDMETHOD(SetScissorRect)(THIS_ CONST RECT* pRect) PURE; + STDMETHOD(GetScissorRect)(THIS_ RECT* pRect) PURE; + STDMETHOD(SetSoftwareVertexProcessing)(THIS_ BOOL bSoftware) PURE; + STDMETHOD_(BOOL, GetSoftwareVertexProcessing)(THIS) PURE; + STDMETHOD(SetNPatchMode)(THIS_ float nSegments) PURE; + STDMETHOD_(float, GetNPatchMode)(THIS) PURE; + STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount) PURE; + STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount) PURE; + STDMETHOD(DrawPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride) PURE; + STDMETHOD(DrawIndexedPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertices, UINT PrimitiveCount, CONST void* pIndexData, D3DFORMAT IndexDataFormat, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride) PURE; + STDMETHOD(ProcessVertices)(THIS_ UINT SrcStartIndex, UINT DestIndex, UINT VertexCount, IDirect3DVertexBuffer9* pDestBuffer, IDirect3DVertexDeclaration9* pVertexDecl, DWORD Flags) PURE; + STDMETHOD(CreateVertexDeclaration)(THIS_ CONST D3DVERTEXELEMENT9* pVertexElements, IDirect3DVertexDeclaration9** ppDecl) PURE; + STDMETHOD(SetVertexDeclaration)(THIS_ IDirect3DVertexDeclaration9* pDecl) PURE; + STDMETHOD(GetVertexDeclaration)(THIS_ IDirect3DVertexDeclaration9** ppDecl) PURE; + STDMETHOD(SetFVF)(THIS_ DWORD FVF) PURE; + STDMETHOD(GetFVF)(THIS_ DWORD* pFVF) PURE; + STDMETHOD(CreateVertexShader)(THIS_ CONST DWORD* pFunction, IDirect3DVertexShader9** ppShader) PURE; + STDMETHOD(SetVertexShader)(THIS_ IDirect3DVertexShader9* pShader) PURE; + STDMETHOD(GetVertexShader)(THIS_ IDirect3DVertexShader9** ppShader) PURE; + STDMETHOD(SetVertexShaderConstantF)(THIS_ UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount) PURE; + STDMETHOD(GetVertexShaderConstantF)(THIS_ UINT StartRegister, float* pConstantData, UINT Vector4fCount) PURE; + STDMETHOD(SetVertexShaderConstantI)(THIS_ UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount) PURE; + STDMETHOD(GetVertexShaderConstantI)(THIS_ UINT StartRegister, int* pConstantData, UINT Vector4iCount) PURE; + STDMETHOD(SetVertexShaderConstantB)(THIS_ UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount) PURE; + STDMETHOD(GetVertexShaderConstantB)(THIS_ UINT StartRegister, BOOL* pConstantData, UINT BoolCount) PURE; + STDMETHOD(SetStreamSource)(THIS_ UINT StreamNumber, IDirect3DVertexBuffer9* pStreamData, UINT OffsetInBytes, UINT Stride) PURE; + STDMETHOD(GetStreamSource)(THIS_ UINT StreamNumber, IDirect3DVertexBuffer9** ppStreamData, UINT* OffsetInBytes, UINT* pStride) PURE; + STDMETHOD(SetStreamSourceFreq)(THIS_ UINT StreamNumber, UINT Divider) PURE; + STDMETHOD(GetStreamSourceFreq)(THIS_ UINT StreamNumber, UINT* Divider) PURE; + STDMETHOD(SetIndices)(THIS_ IDirect3DIndexBuffer9* pIndexData) PURE; + STDMETHOD(GetIndices)(THIS_ IDirect3DIndexBuffer9** ppIndexData) PURE; + STDMETHOD(CreatePixelShader)(THIS_ CONST DWORD* pFunction, IDirect3DPixelShader9** ppShader) PURE; + STDMETHOD(SetPixelShader)(THIS_ IDirect3DPixelShader9* pShader) PURE; + STDMETHOD(GetPixelShader)(THIS_ IDirect3DPixelShader9** ppShader) PURE; + STDMETHOD(SetPixelShaderConstantF)(THIS_ UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount) PURE; + STDMETHOD(GetPixelShaderConstantF)(THIS_ UINT StartRegister, float* pConstantData, UINT Vector4fCount) PURE; + STDMETHOD(SetPixelShaderConstantI)(THIS_ UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount) PURE; + STDMETHOD(GetPixelShaderConstantI)(THIS_ UINT StartRegister, int* pConstantData, UINT Vector4iCount) PURE; + STDMETHOD(SetPixelShaderConstantB)(THIS_ UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount) PURE; + STDMETHOD(GetPixelShaderConstantB)(THIS_ UINT StartRegister, BOOL* pConstantData, UINT BoolCount) PURE; + STDMETHOD(DrawRectPatch)(THIS_ UINT Handle, CONST float* pNumSegs, CONST D3DRECTPATCH_INFO* pRectPatchInfo) PURE; + STDMETHOD(DrawTriPatch)(THIS_ UINT Handle, CONST float* pNumSegs, CONST D3DTRIPATCH_INFO* pTriPatchInfo) PURE; + STDMETHOD(DeletePatch)(THIS_ UINT Handle) PURE; + STDMETHOD(CreateQuery)(THIS_ D3DQUERYTYPE Type, IDirect3DQuery9** ppQuery) PURE; + /* IDirect3DDevice9Ex methods */ + STDMETHOD(SetConvolutionMonoKernel)(THIS_ UINT width, UINT height, float *rows, float *columns) PURE; + STDMETHOD(ComposeRects)(THIS_ IDirect3DSurface9 *src_surface, IDirect3DSurface9 *dst_surface, + IDirect3DVertexBuffer9 *src_descs, UINT rect_count, IDirect3DVertexBuffer9 *dst_descs, + D3DCOMPOSERECTSOP operation, INT offset_x, INT offset_y) PURE; + STDMETHOD(PresentEx)(THIS_ CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion, DWORD dwFlags) PURE; + STDMETHOD(GetGPUThreadPriority)(THIS_ INT *pPriority) PURE; + STDMETHOD(SetGPUThreadPriority)(THIS_ INT Priority) PURE; + STDMETHOD(WaitForVBlank)(THIS_ UINT iSwapChain) PURE; + STDMETHOD(CheckResourceResidency)(THIS_ IDirect3DResource9 **resources, UINT32 resource_count) PURE; + STDMETHOD(SetMaximumFrameLatency)(THIS_ UINT MaxLatency) PURE; + STDMETHOD(GetMaximumFrameLatency)(THIS_ UINT *pMaxLatenxy) PURE; + STDMETHOD(CheckDeviceState)(THIS_ HWND dst_window) PURE; + STDMETHOD(CreateRenderTargetEx)(THIS_ UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultiSampleQuality, BOOL Lockable, IDirect3DSurface9 ** ppSurface, HANDLE *pSharedHandle, DWORD Usage) PURE; + STDMETHOD(CreateOffscreenPlainSurfaceEx)(THIS_ UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9 **ppSurface, HANDLE *pSharedHandle, DWORD Usage) PURE; + STDMETHOD(CreateDepthStencilSurfaceEx)(THIS_ UINT width, UINT height, D3DFORMAT format, + D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality, BOOL discard, + IDirect3DSurface9 **surface, HANDLE *shared_handle, DWORD usage) PURE; + STDMETHOD(ResetEx)(THIS_ D3DPRESENT_PARAMETERS *pPresentationParameters, D3DDISPLAYMODEEX *pFullscreenDisplayMode) PURE; + STDMETHOD(GetDisplayModeEx)(THIS_ UINT iSwapChain, D3DDISPLAYMODEEX *pMode, D3DDISPLAYROTATION *pRotation) PURE; + }; + #undef INTERFACE + + #if !defined(__cplusplus) || defined(CINTERFACE) + /*** IUnknown methods ***/ + #define IDirect3DDevice9Ex_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) + #define IDirect3DDevice9Ex_AddRef(p) (p)->lpVtbl->AddRef(p) + #define IDirect3DDevice9Ex_Release(p) (p)->lpVtbl->Release(p) + /*** IDirect3DDevice9 methods ***/ + #define IDirect3DDevice9Ex_TestCooperativeLevel(p) (p)->lpVtbl->TestCooperativeLevel(p) + #define IDirect3DDevice9Ex_GetAvailableTextureMem(p) (p)->lpVtbl->GetAvailableTextureMem(p) + #define IDirect3DDevice9Ex_EvictManagedResources(p) (p)->lpVtbl->EvictManagedResources(p) + #define IDirect3DDevice9Ex_GetDirect3D(p,a) (p)->lpVtbl->GetDirect3D(p,a) + #define IDirect3DDevice9Ex_GetDeviceCaps(p,a) (p)->lpVtbl->GetDeviceCaps(p,a) + #define IDirect3DDevice9Ex_GetDisplayMode(p,a,b) (p)->lpVtbl->GetDisplayMode(p,a,b) + #define IDirect3DDevice9Ex_GetCreationParameters(p,a) (p)->lpVtbl->GetCreationParameters(p,a) + #define IDirect3DDevice9Ex_SetCursorProperties(p,a,b,c) (p)->lpVtbl->SetCursorProperties(p,a,b,c) + #define IDirect3DDevice9Ex_SetCursorPosition(p,a,b,c) (p)->lpVtbl->SetCursorPosition(p,a,b,c) + #define IDirect3DDevice9Ex_ShowCursor(p,a) (p)->lpVtbl->ShowCursor(p,a) + #define IDirect3DDevice9Ex_CreateAdditionalSwapChain(p,a,b) (p)->lpVtbl->CreateAdditionalSwapChain(p,a,b) + #define IDirect3DDevice9Ex_GetSwapChain(p,a,b) (p)->lpVtbl->GetSwapChain(p,a,b) + #define IDirect3DDevice9Ex_GetNumberOfSwapChains(p) (p)->lpVtbl->GetNumberOfSwapChains(p) + #define IDirect3DDevice9Ex_Reset(p,a) (p)->lpVtbl->Reset(p,a) + #define IDirect3DDevice9Ex_Present(p,a,b,c,d) (p)->lpVtbl->Present(p,a,b,c,d) + #define IDirect3DDevice9Ex_GetBackBuffer(p,a,b,c,d) (p)->lpVtbl->GetBackBuffer(p,a,b,c,d) + #define IDirect3DDevice9Ex_GetRasterStatus(p,a,b) (p)->lpVtbl->GetRasterStatus(p,a,b) + #define IDirect3DDevice9Ex_SetDialogBoxMode(p,a) (p)->lpVtbl->SetDialogBoxMode(p,a) + #define IDirect3DDevice9Ex_SetGammaRamp(p,a,b,c) (p)->lpVtbl->SetGammaRamp(p,a,b,c) + #define IDirect3DDevice9Ex_GetGammaRamp(p,a,b) (p)->lpVtbl->GetGammaRamp(p,a,b) + #define IDirect3DDevice9Ex_CreateTexture(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CreateTexture(p,a,b,c,d,e,f,g,h) + #define IDirect3DDevice9Ex_CreateVolumeTexture(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CreateVolumeTexture(p,a,b,c,d,e,f,g,h,i) + #define IDirect3DDevice9Ex_CreateCubeTexture(p,a,b,c,d,e,f,g) (p)->lpVtbl->CreateCubeTexture(p,a,b,c,d,e,f,g) + #define IDirect3DDevice9Ex_CreateVertexBuffer(p,a,b,c,d,e,f) (p)->lpVtbl->CreateVertexBuffer(p,a,b,c,d,e,f) + #define IDirect3DDevice9Ex_CreateIndexBuffer(p,a,b,c,d,e,f) (p)->lpVtbl->CreateIndexBuffer(p,a,b,c,d,e,f) + #define IDirect3DDevice9Ex_CreateRenderTarget(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CreateRenderTarget(p,a,b,c,d,e,f,g,h) + #define IDirect3DDevice9Ex_CreateDepthStencilSurface(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CreateDepthStencilSurface(p,a,b,c,d,e,f,g,h) + #define IDirect3DDevice9Ex_UpdateSurface(p,a,b,c,d) (p)->lpVtbl->UpdateSurface(p,a,b,c,d) + #define IDirect3DDevice9Ex_UpdateTexture(p,a,b) (p)->lpVtbl->UpdateTexture(p,a,b) + #define IDirect3DDevice9Ex_GetRenderTargetData(p,a,b) (p)->lpVtbl->GetRenderTargetData(p,a,b) + #define IDirect3DDevice9Ex_GetFrontBufferData(p,a,b) (p)->lpVtbl->GetFrontBufferData(p,a,b) + #define IDirect3DDevice9Ex_StretchRect(p,a,b,c,d,e) (p)->lpVtbl->StretchRect(p,a,b,c,d,e) + #define IDirect3DDevice9Ex_ColorFill(p,a,b,c) (p)->lpVtbl->ColorFill(p,a,b,c) + #define IDirect3DDevice9Ex_CreateOffscreenPlainSurface(p,a,b,c,d,e,f) (p)->lpVtbl->CreateOffscreenPlainSurface(p,a,b,c,d,e,f) + #define IDirect3DDevice9Ex_SetRenderTarget(p,a,b) (p)->lpVtbl->SetRenderTarget(p,a,b) + #define IDirect3DDevice9Ex_GetRenderTarget(p,a,b) (p)->lpVtbl->GetRenderTarget(p,a,b) + #define IDirect3DDevice9Ex_SetDepthStencilSurface(p,a) (p)->lpVtbl->SetDepthStencilSurface(p,a) + #define IDirect3DDevice9Ex_GetDepthStencilSurface(p,a) (p)->lpVtbl->GetDepthStencilSurface(p,a) + #define IDirect3DDevice9Ex_BeginScene(p) (p)->lpVtbl->BeginScene(p) + #define IDirect3DDevice9Ex_EndScene(p) (p)->lpVtbl->EndScene(p) + #define IDirect3DDevice9Ex_Clear(p,a,b,c,d,e,f) (p)->lpVtbl->Clear(p,a,b,c,d,e,f) + #define IDirect3DDevice9Ex_SetTransform(p,a,b) (p)->lpVtbl->SetTransform(p,a,b) + #define IDirect3DDevice9Ex_GetTransform(p,a,b) (p)->lpVtbl->GetTransform(p,a,b) + #define IDirect3DDevice9Ex_MultiplyTransform(p,a,b) (p)->lpVtbl->MultiplyTransform(p,a,b) + #define IDirect3DDevice9Ex_SetViewport(p,a) (p)->lpVtbl->SetViewport(p,a) + #define IDirect3DDevice9Ex_GetViewport(p,a) (p)->lpVtbl->GetViewport(p,a) + #define IDirect3DDevice9Ex_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a) + #define IDirect3DDevice9Ex_GetMaterial(p,a) (p)->lpVtbl->GetMaterial(p,a) + #define IDirect3DDevice9Ex_SetLight(p,a,b) (p)->lpVtbl->SetLight(p,a,b) + #define IDirect3DDevice9Ex_GetLight(p,a,b) (p)->lpVtbl->GetLight(p,a,b) + #define IDirect3DDevice9Ex_LightEnable(p,a,b) (p)->lpVtbl->LightEnable(p,a,b) + #define IDirect3DDevice9Ex_GetLightEnable(p,a,b) (p)->lpVtbl->GetLightEnable(p,a,b) + #define IDirect3DDevice9Ex_SetClipPlane(p,a,b) (p)->lpVtbl->SetClipPlane(p,a,b) + #define IDirect3DDevice9Ex_GetClipPlane(p,a,b) (p)->lpVtbl->GetClipPlane(p,a,b) + #define IDirect3DDevice9Ex_SetRenderState(p,a,b) (p)->lpVtbl->SetRenderState(p,a,b) + #define IDirect3DDevice9Ex_GetRenderState(p,a,b) (p)->lpVtbl->GetRenderState(p,a,b) + #define IDirect3DDevice9Ex_CreateStateBlock(p,a,b) (p)->lpVtbl->CreateStateBlock(p,a,b) + #define IDirect3DDevice9Ex_BeginStateBlock(p) (p)->lpVtbl->BeginStateBlock(p) + #define IDirect3DDevice9Ex_EndStateBlock(p,a) (p)->lpVtbl->EndStateBlock(p,a) + #define IDirect3DDevice9Ex_SetClipStatus(p,a) (p)->lpVtbl->SetClipStatus(p,a) + #define IDirect3DDevice9Ex_GetClipStatus(p,a) (p)->lpVtbl->GetClipStatus(p,a) + #define IDirect3DDevice9Ex_GetTexture(p,a,b) (p)->lpVtbl->GetTexture(p,a,b) + #define IDirect3DDevice9Ex_SetTexture(p,a,b) (p)->lpVtbl->SetTexture(p,a,b) + #define IDirect3DDevice9Ex_GetTextureStageState(p,a,b,c) (p)->lpVtbl->GetTextureStageState(p,a,b,c) + #define IDirect3DDevice9Ex_SetTextureStageState(p,a,b,c) (p)->lpVtbl->SetTextureStageState(p,a,b,c) + #define IDirect3DDevice9Ex_GetSamplerState(p,a,b,c) (p)->lpVtbl->GetSamplerState(p,a,b,c) + #define IDirect3DDevice9Ex_SetSamplerState(p,a,b,c) (p)->lpVtbl->SetSamplerState(p,a,b,c) + #define IDirect3DDevice9Ex_ValidateDevice(p,a) (p)->lpVtbl->ValidateDevice(p,a) + #define IDirect3DDevice9Ex_SetPaletteEntries(p,a,b) (p)->lpVtbl->SetPaletteEntries(p,a,b) + #define IDirect3DDevice9Ex_GetPaletteEntries(p,a,b) (p)->lpVtbl->GetPaletteEntries(p,a,b) + #define IDirect3DDevice9Ex_SetCurrentTexturePalette(p,a) (p)->lpVtbl->SetCurrentTexturePalette(p,a) + #define IDirect3DDevice9Ex_GetCurrentTexturePalette(p,a) (p)->lpVtbl->GetCurrentTexturePalette(p,a) + #define IDirect3DDevice9Ex_SetScissorRect(p,a) (p)->lpVtbl->SetScissorRect(p,a) + #define IDirect3DDevice9Ex_GetScissorRect(p,a) (p)->lpVtbl->GetScissorRect(p,a) + #define IDirect3DDevice9Ex_SetSoftwareVertexProcessing(p,a) (p)->lpVtbl->SetSoftwareVertexProcessing(p,a) + #define IDirect3DDevice9Ex_GetSoftwareVertexProcessing(p) (p)->lpVtbl->GetSoftwareVertexProcessing(p) + #define IDirect3DDevice9Ex_SetNPatchMode(p,a) (p)->lpVtbl->SetNPatchMode(p,a) + #define IDirect3DDevice9Ex_GetNPatchMode(p) (p)->lpVtbl->GetNPatchMode(p) + #define IDirect3DDevice9Ex_DrawPrimitive(p,a,b,c) (p)->lpVtbl->DrawPrimitive(p,a,b,c) + #define IDirect3DDevice9Ex_DrawIndexedPrimitive(p,a,b,c,d,e,f) (p)->lpVtbl->DrawIndexedPrimitive(p,a,b,c,d,e,f) + #define IDirect3DDevice9Ex_DrawPrimitiveUP(p,a,b,c,d) (p)->lpVtbl->DrawPrimitiveUP(p,a,b,c,d) + #define IDirect3DDevice9Ex_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) + #define IDirect3DDevice9Ex_ProcessVertices(p,a,b,c,d,e,f) (p)->lpVtbl->ProcessVertices(p,a,b,c,d,e,f) + #define IDirect3DDevice9Ex_CreateVertexDeclaration(p,a,b) (p)->lpVtbl->CreateVertexDeclaration(p,a,b) + #define IDirect3DDevice9Ex_SetVertexDeclaration(p,a) (p)->lpVtbl->SetVertexDeclaration(p,a) + #define IDirect3DDevice9Ex_GetVertexDeclaration(p,a) (p)->lpVtbl->GetVertexDeclaration(p,a) + #define IDirect3DDevice9Ex_SetFVF(p,a) (p)->lpVtbl->SetFVF(p,a) + #define IDirect3DDevice9Ex_GetFVF(p,a) (p)->lpVtbl->GetFVF(p,a) + #define IDirect3DDevice9Ex_CreateVertexShader(p,a,b) (p)->lpVtbl->CreateVertexShader(p,a,b) + #define IDirect3DDevice9Ex_SetVertexShader(p,a) (p)->lpVtbl->SetVertexShader(p,a) + #define IDirect3DDevice9Ex_GetVertexShader(p,a) (p)->lpVtbl->GetVertexShader(p,a) + #define IDirect3DDevice9Ex_SetVertexShaderConstantF(p,a,b,c) (p)->lpVtbl->SetVertexShaderConstantF(p,a,b,c) + #define IDirect3DDevice9Ex_GetVertexShaderConstantF(p,a,b,c) (p)->lpVtbl->GetVertexShaderConstantF(p,a,b,c) + #define IDirect3DDevice9Ex_SetVertexShaderConstantI(p,a,b,c) (p)->lpVtbl->SetVertexShaderConstantI(p,a,b,c) + #define IDirect3DDevice9Ex_GetVertexShaderConstantI(p,a,b,c) (p)->lpVtbl->GetVertexShaderConstantI(p,a,b,c) + #define IDirect3DDevice9Ex_SetVertexShaderConstantB(p,a,b,c) (p)->lpVtbl->SetVertexShaderConstantB(p,a,b,c) + #define IDirect3DDevice9Ex_GetVertexShaderConstantB(p,a,b,c) (p)->lpVtbl->GetVertexShaderConstantB(p,a,b,c) + #define IDirect3DDevice9Ex_SetStreamSource(p,a,b,c,d) (p)->lpVtbl->SetStreamSource(p,a,b,c,d) + #define IDirect3DDevice9Ex_GetStreamSource(p,a,b,c,d) (p)->lpVtbl->GetStreamSource(p,a,b,c,d) + #define IDirect3DDevice9Ex_SetStreamSourceFreq(p,a,b) (p)->lpVtbl->SetStreamSourceFreq(p,a,b) + #define IDirect3DDevice9Ex_GetStreamSourceFreq(p,a,b) (p)->lpVtbl->GetStreamSourceFreq(p,a,b) + #define IDirect3DDevice9Ex_SetIndices(p,a) (p)->lpVtbl->SetIndices(p,a) + #define IDirect3DDevice9Ex_GetIndices(p,a) (p)->lpVtbl->GetIndices(p,a) + #define IDirect3DDevice9Ex_CreatePixelShader(p,a,b) (p)->lpVtbl->CreatePixelShader(p,a,b) + #define IDirect3DDevice9Ex_SetPixelShader(p,a) (p)->lpVtbl->SetPixelShader(p,a) + #define IDirect3DDevice9Ex_GetPixelShader(p,a) (p)->lpVtbl->GetPixelShader(p,a) + #define IDirect3DDevice9Ex_SetPixelShaderConstantF(p,a,b,c) (p)->lpVtbl->SetPixelShaderConstantF(p,a,b,c) + #define IDirect3DDevice9Ex_GetPixelShaderConstantF(p,a,b,c) (p)->lpVtbl->GetPixelShaderConstantF(p,a,b,c) + #define IDirect3DDevice9Ex_SetPixelShaderConstantI(p,a,b,c) (p)->lpVtbl->SetPixelShaderConstantI(p,a,b,c) + #define IDirect3DDevice9Ex_GetPixelShaderConstantI(p,a,b,c) (p)->lpVtbl->GetPixelShaderConstantI(p,a,b,c) + #define IDirect3DDevice9Ex_SetPixelShaderConstantB(p,a,b,c) (p)->lpVtbl->SetPixelShaderConstantB(p,a,b,c) + #define IDirect3DDevice9Ex_GetPixelShaderConstantB(p,a,b,c) (p)->lpVtbl->GetPixelShaderConstantB(p,a,b,c) + #define IDirect3DDevice9Ex_DrawRectPatch(p,a,b,c) (p)->lpVtbl->DrawRectPatch(p,a,b,c) + #define IDirect3DDevice9Ex_DrawTriPatch(p,a,b,c) (p)->lpVtbl->DrawTriPatch(p,a,b,c) + #define IDirect3DDevice9Ex_DeletePatch(p,a) (p)->lpVtbl->DeletePatch(p,a) + #define IDirect3DDevice9Ex_CreateQuery(p,a,b) (p)->lpVtbl->CreateQuery(p,a,b) + /* IDirect3DDevice9Ex */ + #define IDirect3DDevice9Ex_SetConvolutionMonoKernel(p,a,b,c,d) (p)->lpVtbl->SetConvolutionMonoKernel(p,a,b,c,d) + #define IDirect3DDevice9Ex_ComposeRects(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->ComposeRects(p,a,b,c,d,e,f,g,h) + #define IDirect3DDevice9Ex_PresentEx(p,a,b,c,d,e) (p)->lpVtbl->PresentEx(p,a,b,c,d,e) + #define IDirect3DDevice9Ex_GetGPUThreadPriority(p,a) (p)->lpVtbl->GetGPUThreadPriority(p,a) + #define IDirect3DDevice9Ex_SetGPUThreadPriority(p,a) (p)->lpVtbl->SetGPUThreadPriority(p,a) + #define IDirect3DDevice9Ex_WaitForVBlank(p,a) (p)->lpVtbl->WaitForVBlank(p,a) + #define IDirect3DDevice9Ex_CheckResourceResidency(p,a,b) (p)->lpVtbl->CheckResourceResidency(p,a,b) + #define IDirect3DDevice9Ex_SetMaximumFrameLatency(p,a) (p)->lpVtbl->SetMaximumFrameLatency(p,a) + #define IDirect3DDevice9Ex_GetMaximumFrameLatency(p,a) (p)->lpVtbl->GetMaximumFrameLatency(p,a) + #define IDirect3DDevice9Ex_CheckDeviceState(p,a) (p)->lpVtbl->CheckDeviceState(p,a) + #define IDirect3DDevice9Ex_CreateRenderTargetEx(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CreateRenderTargetEx(p,a,b,c,d,e,f,g,h,i) + #define IDirect3DDevice9Ex_CreateOffscreenPlainSurfaceEx(p,a,b,c,d,e,f,g)(p)->lpVtbl->CreateOffscreenPlainSurfaceEx(p,a,b,c,d,e,f,g) + #define IDirect3DDevice9Ex_CreateDepthStencilSurfaceEx(p,a,b,c,d,e,f,g,h,i)(p)->lpVtbl->CreateDepthStencilSurfaceEx(p,a,b,c,d,e,f,g,h,i) + #define IDirect3DDevice9Ex_ResetEx(p,a,b) (p)->lpVtbl->ResetEx(p,a,b) + #define IDirect3DDevice9Ex_GetDisplayModeEx(p,a,b,c) (p)->lpVtbl->GetDisplayModeEx(p,a,b,c) + #else + /*** IUnknown methods ***/ + #define IDirect3DDevice9Ex_QueryInterface(p,a,b) (p)->QueryInterface(a,b) + #define IDirect3DDevice9Ex_AddRef(p) (p)->AddRef() + #define IDirect3DDevice9Ex_Release(p) (p)->Release() + /*** IDirect3DDevice9 methods ***/ + #define IDirect3DDevice9Ex_TestCooperativeLevel(p) (p)->TestCooperativeLevel() + #define IDirect3DDevice9Ex_GetAvailableTextureMem(p) (p)->GetAvailableTextureMem() + #define IDirect3DDevice9Ex_EvictManagedResources(p) (p)->EvictManagedResources() + #define IDirect3DDevice9Ex_GetDirect3D(p,a) (p)->GetDirect3D(a) + #define IDirect3DDevice9Ex_GetDeviceCaps(p,a) (p)->GetDeviceCaps(a) + #define IDirect3DDevice9Ex_GetDisplayMode(p,a,b) (p)->GetDisplayMode(a,b) + #define IDirect3DDevice9Ex_GetCreationParameters(p,a) (p)->GetCreationParameters(a) + #define IDirect3DDevice9Ex_SetCursorProperties(p,a,b,c) (p)->SetCursorProperties(a,b,c) + #define IDirect3DDevice9Ex_SetCursorPosition(p,a,b,c) (p)->SetCursorPosition(a,b,c) + #define IDirect3DDevice9Ex_ShowCursor(p,a) (p)->ShowCursor(a) + #define IDirect3DDevice9Ex_CreateAdditionalSwapChain(p,a,b) (p)->CreateAdditionalSwapChain(a,b) + #define IDirect3DDevice9Ex_GetSwapChain(p,a,b) (p)->GetSwapChain(a,b) + #define IDirect3DDevice9Ex_GetNumberOfSwapChains(p) (p)->GetNumberOfSwapChains() + #define IDirect3DDevice9Ex_Reset(p,a) (p)->Reset(a) + #define IDirect3DDevice9Ex_Present(p,a,b,c,d) (p)->Present(a,b,c,d) + #define IDirect3DDevice9Ex_GetBackBuffer(p,a,b,c,d) (p)->GetBackBuffer(a,b,c,d) + #define IDirect3DDevice9Ex_GetRasterStatus(p,a,b) (p)->GetRasterStatus(a,b) + #define IDirect3DDevice9Ex_SetDialogBoxMode(p,a) (p)->SetDialogBoxMode(a) + #define IDirect3DDevice9Ex_SetGammaRamp(p,a,b,c) (p)->SetGammaRamp(a,b,c) + #define IDirect3DDevice9Ex_GetGammaRamp(p,a,b) (p)->GetGammaRamp(a,b) + #define IDirect3DDevice9Ex_CreateTexture(p,a,b,c,d,e,f,g,h) (p)->CreateTexture(a,b,c,d,e,f,g,h) + #define IDirect3DDevice9Ex_CreateVolumeTexture(p,a,b,c,d,e,f,g,h,i) (p)->CreateVolumeTexture(a,b,c,d,e,f,g,h,i) + #define IDirect3DDevice9Ex_CreateCubeTexture(p,a,b,c,d,e,f,g) (p)->CreateCubeTexture(a,b,c,d,e,f,g) + #define IDirect3DDevice9Ex_CreateVertexBuffer(p,a,b,c,d,e,f) (p)->CreateVertexBuffer(a,b,c,d,e,f) + #define IDirect3DDevice9Ex_CreateIndexBuffer(p,a,b,c,d,e,f) (p)->CreateIndexBuffer(a,b,c,d,e,f) + #define IDirect3DDevice9Ex_CreateRenderTarget(p,a,b,c,d,e,f,g,h) (p)->CreateRenderTarget(a,b,c,d,e,f,g,h) + #define IDirect3DDevice9Ex_CreateDepthStencilSurface(p,a,b,c,d,e,f,g,h) (p)->CreateDepthStencilSurface(a,b,c,d,e,f,g,h) + #define IDirect3DDevice9Ex_UpdateSurface(p,a,b,c,d) (p)->UpdateSurface(a,b,c,d) + #define IDirect3DDevice9Ex_UpdateTexture(p,a,b) (p)->UpdateTexture(a,b) + #define IDirect3DDevice9Ex_GetRenderTargetData(p,a,b) (p)->GetRenderTargetData(a,b) + #define IDirect3DDevice9Ex_GetFrontBufferData(p,a,b) (p)->GetFrontBufferData(a,b) + #define IDirect3DDevice9Ex_StretchRect(p,a,b,c,d,e) (p)->StretchRect(a,b,c,d,e) + #define IDirect3DDevice9Ex_ColorFill(p,a,b,c) (p)->ColorFill(a,b,c) + #define IDirect3DDevice9Ex_CreateOffscreenPlainSurface(p,a,b,c,d,e,f) (p)->CreateOffscreenPlainSurface(a,b,c,d,e,f) + #define IDirect3DDevice9Ex_SetRenderTarget(p,a,b) (p)->SetRenderTarget(a,b) + #define IDirect3DDevice9Ex_GetRenderTarget(p,a,b) (p)->GetRenderTarget(a,b) + #define IDirect3DDevice9Ex_SetDepthStencilSurface(p,a) (p)->SetDepthStencilSurface(a) + #define IDirect3DDevice9Ex_GetDepthStencilSurface(p,a) (p)->GetDepthStencilSurface(a) + #define IDirect3DDevice9Ex_BeginScene(p) (p)->BeginScene() + #define IDirect3DDevice9Ex_EndScene(p) (p)->EndScene() + #define IDirect3DDevice9Ex_Clear(p,a,b,c,d,e,f) (p)->Clear(a,b,c,d,e,f) + #define IDirect3DDevice9Ex_SetTransform(p,a,b) (p)->SetTransform(a,b) + #define IDirect3DDevice9Ex_GetTransform(p,a,b) (p)->GetTransform(a,b) + #define IDirect3DDevice9Ex_MultiplyTransform(p,a,b) (p)->MultiplyTransform(a,b) + #define IDirect3DDevice9Ex_SetViewport(p,a) (p)->SetViewport(a) + #define IDirect3DDevice9Ex_GetViewport(p,a) (p)->GetViewport(a) + #define IDirect3DDevice9Ex_SetMaterial(p,a) (p)->SetMaterial(a) + #define IDirect3DDevice9Ex_GetMaterial(p,a) (p)->GetMaterial(a) + #define IDirect3DDevice9Ex_SetLight(p,a,b) (p)->SetLight(a,b) + #define IDirect3DDevice9Ex_GetLight(p,a,b) (p)->GetLight(a,b) + #define IDirect3DDevice9Ex_LightEnable(p,a,b) (p)->LightEnable(a,b) + #define IDirect3DDevice9Ex_GetLightEnable(p,a,b) (p)->GetLightEnable(a,b) + #define IDirect3DDevice9Ex_SetClipPlane(p,a,b) (p)->SetClipPlane(a,b) + #define IDirect3DDevice9Ex_GetClipPlane(p,a,b) (p)->GetClipPlane(a,b) + #define IDirect3DDevice9Ex_SetRenderState(p,a,b) (p)->SetRenderState(a,b) + #define IDirect3DDevice9Ex_GetRenderState(p,a,b) (p)->GetRenderState(a,b) + #define IDirect3DDevice9Ex_CreateStateBlock(p,a,b) (p)->CreateStateBlock(a,b) + #define IDirect3DDevice9Ex_BeginStateBlock(p) (p)->BeginStateBlock() + #define IDirect3DDevice9Ex_EndStateBlock(p,a) (p)->EndStateBlock(a) + #define IDirect3DDevice9Ex_SetClipStatus(p,a) (p)->SetClipStatus(a) + #define IDirect3DDevice9Ex_GetClipStatus(p,a) (p)->GetClipStatus(a) + #define IDirect3DDevice9Ex_GetTexture(p,a,b) (p)->GetTexture(a,b) + #define IDirect3DDevice9Ex_SetTexture(p,a,b) (p)->SetTexture(a,b) + #define IDirect3DDevice9Ex_GetTextureStageState(p,a,b,c) (p)->GetTextureStageState(a,b,c) + #define IDirect3DDevice9Ex_SetTextureStageState(p,a,b,c) (p)->SetTextureStageState(a,b,c) + #define IDirect3DDevice9Ex_GetSamplerState(p,a,b,c) (p)->GetSamplerState(a,b,c) + #define IDirect3DDevice9Ex_SetSamplerState(p,a,b,c) (p)->SetSamplerState(a,b,c) + #define IDirect3DDevice9Ex_ValidateDevice(p,a) (p)->ValidateDevice(a) + #define IDirect3DDevice9Ex_SetPaletteEntries(p,a,b) (p)->SetPaletteEntries(a,b) + #define IDirect3DDevice9Ex_GetPaletteEntries(p,a,b) (p)->GetPaletteEntries(a,b) + #define IDirect3DDevice9Ex_SetCurrentTexturePalette(p,a) (p)->SetCurrentTexturePalette(a) + #define IDirect3DDevice9Ex_GetCurrentTexturePalette(p,a) (p)->GetCurrentTexturePalette(a) + #define IDirect3DDevice9Ex_SetScissorRect(p,a) (p)->SetScissorRect(a) + #define IDirect3DDevice9Ex_GetScissorRect(p,a) (p)->GetScissorRect(a) + #define IDirect3DDevice9Ex_SetSoftwareVertexProcessing(p,a) (p)->SetSoftwareVertexProcessing(a) + #define IDirect3DDevice9Ex_GetSoftwareVertexProcessing(p) (p)->GetSoftwareVertexProcessing() + #define IDirect3DDevice9Ex_SetNPatchMode(p,a) (p)->SetNPatchMode(a) + #define IDirect3DDevice9Ex_GetNPatchMode(p) (p)->GetNPatchMode() + #define IDirect3DDevice9Ex_DrawPrimitive(p,a,b,c) (p)->DrawPrimitive(a,b,c) + #define IDirect3DDevice9Ex_DrawIndexedPrimitive(p,a,b,c,d,e,f) (p)->DrawIndexedPrimitive(a,b,c,d,e,f) + #define IDirect3DDevice9Ex_DrawPrimitiveUP(p,a,b,c,d) (p)->DrawPrimitiveUP(a,b,c,d) + #define IDirect3DDevice9Ex_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) (p)->DrawIndexedPrimitiveUP(a,b,c,d,e,f,g,h) + #define IDirect3DDevice9Ex_ProcessVertices(p,a,b,c,d,e,f) (p)->ProcessVertices(a,b,c,d,e,f) + #define IDirect3DDevice9Ex_CreateVertexDeclaration(p,a,b) (p)->CreateVertexDeclaration(a,b) + #define IDirect3DDevice9Ex_SetVertexDeclaration(p,a) (p)->SetVertexDeclaration(a) + #define IDirect3DDevice9Ex_GetVertexDeclaration(p,a) (p)->GetVertexDeclaration(a) + #define IDirect3DDevice9Ex_SetFVF(p,a) (p)->SetFVF(a) + #define IDirect3DDevice9Ex_GetFVF(p,a) (p)->GetFVF(a) + #define IDirect3DDevice9Ex_CreateVertexShader(p,a,b) (p)->CreateVertexShader(a,b) + #define IDirect3DDevice9Ex_SetVertexShader(p,a) (p)->SetVertexShader(a) + #define IDirect3DDevice9Ex_GetVertexShader(p,a) (p)->GetVertexShader(a) + #define IDirect3DDevice9Ex_SetVertexShaderConstantF(p,a,b,c) (p)->SetVertexShaderConstantF(a,b,c) + #define IDirect3DDevice9Ex_GetVertexShaderConstantF(p,a,b,c) (p)->GetVertexShaderConstantF(a,b,c) + #define IDirect3DDevice9Ex_SetVertexShaderConstantI(p,a,b,c) (p)->SetVertexShaderConstantI(a,b,c) + #define IDirect3DDevice9Ex_GetVertexShaderConstantI(p,a,b,c) (p)->GetVertexShaderConstantI(a,b,c) + #define IDirect3DDevice9Ex_SetVertexShaderConstantB(p,a,b,c) (p)->SetVertexShaderConstantB(a,b,c) + #define IDirect3DDevice9Ex_GetVertexShaderConstantB(p,a,b,c) (p)->GetVertexShaderConstantB(a,b,c) + #define IDirect3DDevice9Ex_SetStreamSource(p,a,b,c,d) (p)->SetStreamSource(a,b,c,d) + #define IDirect3DDevice9Ex_GetStreamSource(p,a,b,c,d) (p)->GetStreamSource(a,b,c,d) + #define IDirect3DDevice9Ex_SetStreamSourceFreq(p,a,b) (p)->SetStreamSourceFreq(a,b) + #define IDirect3DDevice9Ex_GetStreamSourceFreq(p,a,b) (p)->GetStreamSourceFreq(a,b) + #define IDirect3DDevice9Ex_SetIndices(p,a) (p)->SetIndices(a) + #define IDirect3DDevice9Ex_GetIndices(p,a) (p)->GetIndices(a) + #define IDirect3DDevice9Ex_CreatePixelShader(p,a,b) (p)->CreatePixelShader(a,b) + #define IDirect3DDevice9Ex_SetPixelShader(p,a) (p)->SetPixelShader(a) + #define IDirect3DDevice9Ex_GetPixelShader(p,a) (p)->GetPixelShader(a) + #define IDirect3DDevice9Ex_SetPixelShaderConstantF(p,a,b,c) (p)->SetPixelShaderConstantF(a,b,c) + #define IDirect3DDevice9Ex_GetPixelShaderConstantF(p,a,b,c) (p)->GetPixelShaderConstantF(a,b,c) + #define IDirect3DDevice9Ex_SetPixelShaderConstantI(p,a,b,c) (p)->SetPixelShaderConstantI(a,b,c) + #define IDirect3DDevice9Ex_GetPixelShaderConstantI(p,a,b,c) (p)->GetPixelShaderConstantI(a,b,c) + #define IDirect3DDevice9Ex_SetPixelShaderConstantB(p,a,b,c) (p)->SetPixelShaderConstantB(a,b,c) + #define IDirect3DDevice9Ex_GetPixelShaderConstantB(p,a,b,c) (p)->GetPixelShaderConstantB(a,b,c) + #define IDirect3DDevice9Ex_DrawRectPatch(p,a,b,c) (p)->DrawRectPatch(a,b,c) + #define IDirect3DDevice9Ex_DrawTriPatch(p,a,b,c) (p)->DrawTriPatch(a,b,c) + #define IDirect3DDevice9Ex_DeletePatch(p,a) (p)->DeletePatch(a) + #define IDirect3DDevice9Ex_CreateQuery(p,a,b) (p)->CreateQuery(a,b) + /* IDirect3DDevice9Ex */ + #define IDirect3DDevice9Ex_SetConvolutionMonoKernel(p,a,b,c,d) (p)->SetConvolutionMonoKernel(a,b,c,d) + #define IDirect3DDevice9Ex_ComposeRects(p,a,b,c,d,e,f,g,h) (p)->ComposeRects(a,b,c,d,e,f,g,h) + #define IDirect3DDevice9Ex_PresentEx(p,a,b,c,d,e) (p)->PresentEx(a,b,c,d,e) + #define IDirect3DDevice9Ex_GetGPUThreadPriority(p,a) (p)->GetGPUThreadPriority(a) + #define IDirect3DDevice9Ex_SetGPUThreadPriority(p,a) (p)->SetGPUThreadPriority(a) + #define IDirect3DDevice9Ex_WaitForVBlank(p,a) (p)->WaitForVBlank(a) + #define IDirect3DDevice9Ex_CheckResourceResidency(p,a,b) (p)->CheckResourceResidency(a,b) + #define IDirect3DDevice9Ex_SetMaximumFrameLatency(p,a) (p)->SetMaximumFrameLatency(a) + #define IDirect3DDevice9Ex_GetMaximumFrameLatency(p,a) (p)->GetMaximumFrameLatency(a) + #define IDirect3DDevice9Ex_CheckDeviceState(p,a) (p)->CheckDeviceState(a) + #define IDirect3DDevice9Ex_CreateRenderTargetEx(p,a,b,c,d,e,f,g,h,i) (p)->CreateRenderTargetEx(a,b,c,d,e,f,g,h,i) + #define IDirect3DDevice9Ex_CreateOffscreenPlainSurfaceEx(p,a,b,c,d,e,f,g)(p)->CreateOffscreenPlainSurfaceEx(a,b,c,d,e,f,g) + #define IDirect3DDevice9Ex_CreateDepthStencilSurfaceEx(p,a,b,c,d,e,f,g,h,i)(p)->CreateDepthStencilSurfaceEx(a,b,c,d,e,f,g,h,i) + #define IDirect3DDevice9Ex_ResetEx(p,a,b) (p)->ResetEx(a,b) + #define IDirect3DDevice9Ex_GetDisplayModeEx(p,a,b,c) (p)->GetDisplayModeEx(a,b,c) + #endif + + #ifdef __cplusplus + extern "C" { + #endif /* defined(__cplusplus) */ + + int WINAPI D3DPERF_BeginEvent(D3DCOLOR,LPCWSTR); + int WINAPI D3DPERF_EndEvent(void); + DWORD WINAPI D3DPERF_GetStatus(void); + BOOL WINAPI D3DPERF_QueryRepeatFrame(void); + void WINAPI D3DPERF_SetMarker(D3DCOLOR,LPCWSTR); + void WINAPI D3DPERF_SetOptions(DWORD); + void WINAPI D3DPERF_SetRegion(D3DCOLOR,LPCWSTR); + + /* Define the main entrypoint as well */ + IDirect3D9* WINAPI Direct3DCreate9(UINT SDKVersion); + + #ifdef __cplusplus + } /* extern "C" */ + #endif /* defined(__cplusplus) */ + + + #endif /* __WINE_D3D9_H */ diff --git a/Include/dxwnd.h b/Include/dxwnd.h index 8dcde05..5cab89f 100644 --- a/Include/dxwnd.h +++ b/Include/dxwnd.h @@ -82,6 +82,8 @@ #define MARKBLIT 0x00000002 // higlights the blit to primary surface operation by surroundig the rect in color #define HOOKDLLS 0x00000004 // Hook all DLLs referenced in PE #define SUPPRESSD3DEXT 0x00000008 // Disables extended d3d APIs for Vista/Win7/Win8 platforms +#define HOOKENABLED 0x00000010 // Enables task hooking +#define FIXD3DFRAME 0x00000020 // Preserve windows frame in D3D9 programs // logging Tflags DWORD: #define OUTTRACE 0x00000001 // enables tracing to dxwnd.log in general @@ -104,6 +106,7 @@ typedef struct TARGETMAP char module[60+1]; char OpenGLLib[20+1]; int dxversion; + int coordinates; int flags; int flags2; int flags3; @@ -180,4 +183,8 @@ LRESULT CALLBACK extWindowProc(HWND, UINT, WPARAM, LPARAM); extern void WhndStackPush(HWND, WNDPROC); extern WNDPROC WhndGetWindowProc(HWND ); - +typedef enum { + DXW_SET_COORDINATES = 0, + DXW_DESKTOP_WORKAREA, + DXW_DESKTOP_CENTER +} Coordinates_Types; diff --git a/build/dxwnd.dll b/build/dxwnd.dll index cbaa407..31af4a0 100644 --- a/build/dxwnd.dll +++ b/build/dxwnd.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3ab8190eadcff243a68b15f1b95a1ae8a260ec90013a73ba149322adc1786dfd -size 340992 +oid sha256:8c93bb6e4097da150e945750f0b04e1b4b490868251332a3ea2451fb5338cf60 +size 341504 diff --git a/build/dxwnd.exe b/build/dxwnd.exe index f5ea8d0..d12c5fa 100644 --- a/build/dxwnd.exe +++ b/build/dxwnd.exe @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b5a29f58873b15c65c45cc3216847b5bd94c4c6a382ad62f717087cb69e8406e -size 503296 +oid sha256:0995a55f7547535590183f7287c7b511fcb4ee2203a39f6e8414afce2a0af15f +size 520192 diff --git a/build/dxwnd.ini b/build/dxwnd.ini index d45a764..23ed643 100644 --- a/build/dxwnd.ini +++ b/build/dxwnd.ini @@ -1,5 +1,5481 @@ +[target] +title0=007 NightFire +path0=D:\Games\007_NightFire\Bond.exe +module0= +ver0=8 +flag0=134217728 +flagg0=675282944 +tflag0=3 +initx0=0 +inity0=0 +minx0=0 +miny0=0 +maxx0=0 +maxy0=0 +posx0=50 +posy0=50 +sizx0=800 +sizy0=600 +title1=1602 A.D. +path1=C:\Games\1602 A.D\1602.exe +module1= +ver1=0 +flag1=679608354 +flagg1=0 +tflag1=0 +initx1=0 +inity1=0 +minx1=0 +miny1=0 +maxx1=0 +maxy1=0 +posx1=50 +posy1=50 +sizx1=800 +sizy1=600 +title2=688I Hunter Killer +path2=D:\Games\688\688I_HK.EXE +module2= +ver2=0 +flag2=134479906 +flagg2=134217728 +tflag2=3 +initx2=0 +inity2=0 +minx2=0 +miny2=0 +maxx2=0 +maxy2=0 +posx2=50 +posy2=50 +sizx2=640 +sizy2=480 +title3=7th Legion +path3=D:\Games\7th_Legion\LEGION.EXE +module3= +ver3=0 +flag3=402669607 +flagg3=539056144 +tflag3=12 +initx3=0 +inity3=0 +minx3=0 +miny3=0 +maxx3=0 +maxy3=0 +posx3=50 +posy3=50 +sizx3=800 +sizy3=600 +title4=A10 Cuba +path4=D:\Games\A10\A10Cuba.exe +module4= +ver4=0 +flag4=34 +flagg4=1073741824 +tflag4=258 +initx4=0 +inity4=0 +minx4=0 +miny4=0 +maxx4=0 +maxy4=0 +posx4=50 +posy4=50 +sizx4=800 +sizy4=600 +title5=Achtung Spitfire +path5=D:\Games\Achtung Spitfire\ASP95.EXE +module5= +ver5=0 +flag5=536870946 +flagg5=0 +tflag5=70 +initx5=0 +inity5=0 +minx5=0 +miny5=0 +maxx5=0 +maxy5=0 +posx5=50 +posy5=50 +sizx5=800 +sizy5=600 +title6=Actua Soccer 3 +path6=D:\Games\ActuaSoccer3\Soccer3.exe +module6= +ver6=0 +flag6=671088674 +flagg6=256 +tflag6=263 +initx6=0 +inity6=0 +minx6=0 +miny6=0 +maxx6=0 +maxy6=0 +posx6=50 +posy6=50 +sizx6=800 +sizy6=600 +title7=AfterLife +path7=d:\Games\ALIFE\ALIFE.EXE +module7= +ver7=1 +flag7=142606370 +flagg7=160 +tflag7=259 +initx7=0 +inity7=0 +minx7=0 +miny7=0 +maxx7=0 +maxy7=0 +posx7=50 +posy7=50 +sizx7=800 +sizy7=600 +title8=Age of Empires +path8=D:\Games\Age of Empires\EMPIRES.EXE +module8= +ver8=0 +flag8=402655267 +flagg8=536940544 +tflag8=3 +initx8=0 +inity8=0 +minx8=0 +miny8=0 +maxx8=0 +maxy8=0 +posx8=50 +posy8=50 +sizx8=800 +sizy8=600 +title9=Age of Empires 2 +path9=D:\Games\Age of Empires 2\empires2.exe +module9= +ver9=0 +flag9=134217762 +flagg9=1073762304 +tflag9=3 +initx9=0 +inity9=0 +minx9=0 +miny9=0 +maxx9=0 +maxy9=0 +posx9=50 +posy9=50 +sizx9=800 +sizy9=600 +title10=Age of Empires III +path10=D:\Games\Age of Empires III\age3.exe +module10= +ver10=0 +flag10=-1342169054 +flagg10=169869312 +tflag10=3 +initx10=0 +inity10=0 +minx10=0 +miny10=0 +maxx10=0 +maxy10=0 +posx10=50 +posy10=50 +sizx10=800 +sizy10=600 +title11=Age of Empires the Rise of Rome +path11=D:\Games\Age of Empires\EMPIRESX.EXE +module11= +ver11=0 +flag11=134217762 +flagg11=81920 +tflag11=0 +initx11=0 +inity11=0 +minx11=0 +miny11=0 +maxx11=0 +maxy11=0 +posx11=50 +posy11=50 +sizx11=800 +sizy11=600 +title12=Age of Wonders +path12=D:\Games\Age of Wonders\AoW.exe +module12=VideoP.dpl vcl30.dpl +ver12=0 +flag12=813826050 +flagg12=537919505 +tflag12=3 +initx12=0 +inity12=0 +minx12=0 +miny12=0 +maxx12=0 +maxy12=0 +posx12=50 +posy12=50 +sizx12=800 +sizy12=600 +title13=Airline Tycoon Evolution +path13=D:\Games\Airline.Tycoon.Evolution\AT.EXE +module13= +ver13=0 +flag13=402653217 +flagg13=5242880 +tflag13=259 +initx13=0 +inity13=0 +minx13=0 +miny13=0 +maxx13=0 +maxy13=0 +posx13=50 +posy13=50 +sizx13=800 +sizy13=600 +title14=Alien Cabal 95 +path14=D:\Games\Alien_cabal\ACabal95.exe +module14= +ver14=0 +flag14=71303200 +flagg14=0 +tflag14=3 +initx14=0 +inity14=0 +minx14=0 +miny14=0 +maxx14=0 +maxy14=0 +posx14=50 +posy14=50 +sizx14=800 +sizy14=600 +title15=Alien vs. Predator +path15=C:\Games\Alien vs Predator\AvP.exe +module15= +ver15=0 +flag15=8224 +flagg15=0 +tflag15=130 +initx15=0 +inity15=0 +minx15=0 +miny15=0 +maxx15=0 +maxy15=0 +posx15=50 +posy15=50 +sizx15=800 +sizy15=600 +title16=Aliens Nations Demo +path16=C:\Games\aademo\Bin\AA.exe +module16= +ver16=0 +flag16=134217762 +flagg16=0 +tflag16=0 +initx16=0 +inity16=0 +minx16=0 +miny16=0 +maxx16=0 +maxy16=0 +posx16=0 +posy16=0 +sizx16=800 +sizy16=600 +title17=America +path17=D:\Games\America\america.exe +module17= +ver17=0 +flag17=134234150 +flagg17=16 +tflag17=0 +initx17=0 +inity17=0 +minx17=0 +miny17=0 +maxx17=0 +maxy17=0 +posx17=50 +posy17=50 +sizx17=800 +sizy17=600 +title18=American McGee's Alice Demo +path18=D:\Games\American McGee's Alice Demo\alice.exe +module18= +ver18=10 +flag18=268435458 +flagg18=-2147352576 +tflag18=0 +initx18=0 +inity18=0 +minx18=0 +miny18=0 +maxx18=0 +maxy18=0 +posx18=50 +posy18=50 +sizx18=800 +sizy18=600 +title19=Ancient Conquest +path19=D:\Games\Ancient Conquest\ANCIENT.EXE +module19= +ver19=0 +flag19=142606370 +flagg19=1048576 +tflag19=258 +initx19=0 +inity19=0 +minx19=0 +miny19=0 +maxx19=0 +maxy19=0 +posx19=50 +posy19=50 +sizx19=800 +sizy19=600 +title20=Ancient Evil +path20=C:\Games\Ancient Evil\RPG.EXE +module20=DDW16.DLL +ver20=1 +flag20=-2013249497 +flagg20=0 +tflag20=2 +initx20=0 +inity20=0 +minx20=0 +miny20=0 +maxx20=0 +maxy20=0 +posx20=50 +posy20=50 +sizx20=800 +sizy20=600 +title21=Ancient Evil Demo +path21=C:\Games\Ancient Evil Curse of the Snake Cult\aecsc-demo.exe +module21= +ver21=1 +flag21=134242336 +flagg21=0 +tflag21=0 +initx21=0 +inity21=0 +minx21=0 +miny21=0 +maxx21=0 +maxy21=0 +posx21=50 +posy21=50 +sizx21=800 +sizy21=600 +title22=Armymen +path22=C:\Games\armymen\Armymen.exe +module22= +ver22=0 +flag22=134218274 +flagg22=1 +tflag22=0 +initx22=0 +inity22=0 +minx22=0 +miny22=0 +maxx22=0 +maxy22=0 +posx22=50 +posy22=50 +sizx22=800 +sizy22=600 +title23=ArmyMen 2 +path23=C:\Games\army2\ArmyMen2.exe +module23= +ver23=0 +flag23=402653730 +flagg23=0 +tflag23=0 +initx23=0 +inity23=0 +minx23=0 +miny23=0 +maxx23=0 +maxy23=0 +posx23=50 +posy23=50 +sizx23=800 +sizy23=600 +title24=Atomic Bomberman +path24=C:\Games\Atomic Bomberman\BM95.EXE +module24= +ver24=0 +flag24=2 +flagg24=0 +tflag24=0 +initx24=0 +inity24=0 +minx24=0 +miny24=0 +maxx24=0 +maxy24=0 +posx24=50 +posy24=50 +sizx24=800 +sizy24=600 +title25=Axis & Allies Iron Blitz Edition +path25=C:\Games\Axis & Allies Iron Blitz Edition\Axis & Allies\AxisAllies.exe +module25= +ver25=0 +flag25=-2147483614 +flagg25=0 +tflag25=0 +initx25=0 +inity25=0 +minx25=0 +miny25=0 +maxx25=0 +maxy25=0 +posx25=50 +posy25=50 +sizx25=800 +sizy25=600 +title26=Baldies +path26=C:\Games\Baldies for Win95\baldies.exe +module26= +ver26=0 +flag26=537010210 +flagg26=0 +tflag26=0 +initx26=0 +inity26=0 +minx26=0 +miny26=0 +maxx26=0 +maxy26=0 +posx26=50 +posy26=50 +sizx26=800 +sizy26=600 +title27=Battle Arena Toshinden 2 +path27=D:\Games\Battle Arena Toshinden 2\T2.EXE +module27= +ver27=0 +flag27=134217761 +flagg27=134217808 +tflag27=3 +initx27=0 +inity27=0 +minx27=0 +miny27=0 +maxx27=0 +maxy27=0 +posx27=50 +posy27=50 +sizx27=800 +sizy27=600 +title28=Battle Commander +path28=D:\Games\Battle Commander\bcommand.exe +module28= +ver28=0 +flag28=134217794 +flagg28=0 +tflag28=2 +initx28=0 +inity28=0 +minx28=0 +miny28=0 +maxx28=0 +maxy28=0 +posx28=50 +posy28=50 +sizx28=800 +sizy28=600 +title29=Beasts & Bumpkins +path29=C:\Games\Beasts and Bumpkins\BEASTS.EXE +module29= +ver29=0 +flag29=2105890 +flagg29=0 +tflag29=2 +initx29=0 +inity29=0 +minx29=0 +miny29=0 +maxx29=0 +maxy29=0 +posx29=50 +posy29=50 +sizx29=800 +sizy29=600 +title30=Beats of Rage +path30=C:\Games\BOR\BeatsOfRage.exe +module30= +ver30=0 +flag30=537002018 +flagg30=0 +tflag30=0 +initx30=0 +inity30=0 +minx30=0 +miny30=0 +maxx30=0 +maxy30=0 +posx30=50 +posy30=50 +sizx30=800 +sizy30=600 +title31=Beyond Good & Evil Demo +path31=C:\Games\Beyond Good & Evil\BGE.exe +module31= +ver31=0 +flag31=0 +flagg31=0 +tflag31=0 +initx31=0 +inity31=0 +minx31=0 +miny31=0 +maxx31=0 +maxy31=0 +posx31=50 +posy31=50 +sizx31=800 +sizy31=600 +title32=Black & White +path32=D:\Games\Black & White\runblack.exe +module32= +ver32=0 +flag32=0 +flagg32=134217728 +tflag32=0 +initx32=0 +inity32=0 +minx32=0 +miny32=0 +maxx32=0 +maxy32=0 +posx32=50 +posy32=50 +sizx32=800 +sizy32=600 +title33=Black Moon Lune Noire +path33=C:\Games\Black Moon\Lune noire\Engine.exe +module33= +ver33=0 +flag33=262179 +flagg33=0 +tflag33=0 +initx33=0 +inity33=0 +minx33=0 +miny33=0 +maxx33=0 +maxy33=0 +posx33=50 +posy33=50 +sizx33=800 +sizy33=600 +title34=Black Thorn +path34=D:\Games\BlackThorn\BlackThorn.exe +module34= +ver34=0 +flag34=0 +flagg34=134217984 +tflag34=66 +initx34=0 +inity34=0 +minx34=0 +miny34=0 +maxx34=0 +maxy34=0 +posx34=50 +posy34=50 +sizx34=800 +sizy34=600 +title35=Blood Omen Legacy of Kain +path35=C:\Games\Blood Omen\KAIN.EXE +module35= +ver35=0 +flag35=49190 +flagg35=0 +tflag35=0 +initx35=0 +inity35=0 +minx35=0 +miny35=0 +maxx35=0 +maxy35=0 +posx35=50 +posy35=50 +sizx35=800 +sizy35=600 +title36=Bonkheads +path36=C:\Games\Bonkheads\Bonkheads.exe +module36= +ver36=0 +flag36=262690 +flagg36=16 +tflag36=78 +initx36=0 +inity36=0 +minx36=0 +miny36=0 +maxx36=0 +maxy36=0 +posx36=50 +posy36=50 +sizx36=800 +sizy36=600 +title37=Bubble Bobble 2 +path37=C:\Games\bubble2\BOBO2.EXE +module37= +ver37=0 +flag37=34 +flagg37=0 +tflag37=0 +initx37=0 +inity37=0 +minx37=0 +miny37=0 +maxx37=0 +maxy37=0 +posx37=50 +posy37=50 +sizx37=800 +sizy37=600 +title38=Bug! +path38=C:\Games\Bug\BUG!.EXE +module38= +ver38=0 +flag38=134225954 +flagg38=32 +tflag38=2 +initx38=0 +inity38=0 +minx38=0 +miny38=0 +maxx38=0 +maxy38=0 +posx38=0 +posy38=0 +sizx38=800 +sizy38=600 +title39=BW2Demo.exe +path39=D:\Games\Black & White 2 Demo\BW2Demo.exe +module39= +ver39=0 +flag39=0 +flagg39=134217728 +tflag39=0 +initx39=0 +inity39=0 +minx39=0 +miny39=0 +maxx39=0 +maxy39=0 +posx39=50 +posy39=50 +sizx39=800 +sizy39=600 +title40=Caesar III +path40=C:\Games\Caesar III\c3.exe +module40= +ver40=0 +flag40=-2147475422 +flagg40=0 +tflag40=0 +initx40=0 +inity40=0 +minx40=0 +miny40=0 +maxx40=0 +maxy40=0 +posx40=50 +posy40=50 +sizx40=800 +sizy40=600 +title41=Championship Manager 99-00 +path41=C:\Games\CM9900\cm9900.exe +module41= +ver41=0 +flag41=10306 +flagg41=0 +tflag41=0 +initx41=0 +inity41=0 +minx41=0 +miny41=0 +maxx41=0 +maxy41=0 +posx41=50 +posy41=50 +sizx41=800 +sizy41=600 +title42=Civilization Call to Power +path42=C:\Games\civctp\Civilization_Call_To_Power\ctp_program\ctp\civctp.exe +module42= +ver42=0 +flag42=545267746 +flagg42=0 +tflag42=0 +initx42=0 +inity42=0 +minx42=0 +miny42=0 +maxx42=0 +maxy42=0 +posx42=50 +posy42=50 +sizx42=800 +sizy42=600 +title43=Claw +path43=C:\Games\claw\clawexe.exe +module43= +ver43=0 +flag43=24610 +flagg43=0 +tflag43=0 +initx43=0 +inity43=0 +minx43=0 +miny43=0 +maxx43=0 +maxy43=0 +posx43=50 +posy43=50 +sizx43=800 +sizy43=600 +title44=Commando's Behind Enemy Lines Demo +path44=C:\Games\Commando's Behind Enemy Lines Demo\COMANDOS\Comandos.exe +module44= +ver44=0 +flag44=1744838944 +flagg44=0 +tflag44=64 +initx44=0 +inity44=0 +minx44=0 +miny44=0 +maxx44=0 +maxy44=0 +posx44=50 +posy44=50 +sizx44=800 +sizy44=600 +title45=Commandos II: Men of Courage +path45=C:\Games\Commandos II\comm2.exe +module45= +ver45=0 +flag45=-1207951008 +flagg45=0 +tflag45=0 +initx45=0 +inity45=0 +minx45=0 +miny45=0 +maxx45=0 +maxy45=0 +posx45=50 +posy45=50 +sizx45=800 +sizy45=600 +title46=Crazy Taxy +path46=C:\Games\Crazy_Taxi\Crazy Taxi PC Version\crazy_taxi_pc.exe +module46= +ver46=8 +flag46=536870945 +flagg46=0 +tflag46=0 +initx46=0 +inity46=0 +minx46=0 +miny46=0 +maxx46=0 +maxy46=0 +posx46=50 +posy46=50 +sizx46=800 +sizy46=600 +title47=Crush! Deluxe +path47=C:\Games\Crush! Deluxe\CRUSHD.EXE +module47= +ver47=0 +flag47=134492706 +flagg47=0 +tflag47=0 +initx47=0 +inity47=0 +minx47=0 +miny47=0 +maxx47=0 +maxy47=0 +posx47=50 +posy47=50 +sizx47=800 +sizy47=600 +title48=Cybermercs +path48=C:\Games\cybermercs\cybermercs.exe +module48= +ver48=0 +flag48=134234146 +flagg48=16 +tflag48=0 +initx48=0 +inity48=0 +minx48=0 +miny48=0 +maxx48=0 +maxy48=0 +posx48=50 +posy48=50 +sizx48=800 +sizy48=600 +title49=Daikatana +path49=D:\Games\Daikatana\daikatana.exe +module49= +ver49=12 +flag49=806486528 +flagg49=131585 +tflag49=3 +initx49=0 +inity49=0 +minx49=0 +miny49=0 +maxx49=0 +maxy49=0 +posx49=50 +posy49=50 +sizx49=800 +sizy49=600 +title50=Darius Gaiden +path50=C:\Games\Darius_gaiden\DARIUS.EXE +module50= +ver50=0 +flag50=536870946 +flagg50=0 +tflag50=0 +initx50=0 +inity50=0 +minx50=0 +miny50=0 +maxx50=0 +maxy50=0 +posx50=50 +posy50=50 +sizx50=800 +sizy50=600 +title51=Dark Colony the Council Wars +path51=C:\Games\darkcolony_council\dc\DC16.EXE +module51= +ver51=0 +flag51=268435462 +flagg51=0 +tflag51=0 +initx51=0 +inity51=0 +minx51=0 +miny51=0 +maxx51=0 +maxy51=0 +posx51=50 +posy51=50 +sizx51=800 +sizy51=600 +title52=Darkstone +path52=C:\Games\darkstone\Darkstone.exe +module52= +ver52=0 +flag52=134234148 +flagg52=0 +tflag52=0 +initx52=0 +inity52=0 +minx52=0 +miny52=0 +maxx52=0 +maxy52=0 +posx52=50 +posy52=50 +sizx52=800 +sizy52=600 +title53=Dave Mirra Freestyle BMX Demo +path53=C:\Games\Dave Mirra Freestyle BMX\NgBMXDemo.exe +module53= +ver53=0 +flag53=8224 +flagg53=0 +tflag53=0 +initx53=0 +inity53=0 +minx53=0 +miny53=0 +maxx53=0 +maxy53=0 +posx53=50 +posy53=50 +sizx53=800 +sizy53=600 +title54=Daytona USA Deluxe +path54=C:\Games\Daytona USA Deluxe\DAYTONA USA Deluxe.exe +module54= +ver54=0 +flag54=402661410 +flagg54=0 +tflag54=0 +initx54=0 +inity54=0 +minx54=0 +miny54=0 +maxx54=0 +maxy54=0 +posx54=50 +posy54=50 +sizx54=800 +sizy54=600 +title55=Deadlock 2 +path55=C:\Games\deadlock2\DEADLOCK.EXE +module55= +ver55=0 +flag55=-2012995550 +flagg55=0 +tflag55=0 +initx55=0 +inity55=0 +minx55=0 +miny55=0 +maxx55=0 +maxy55=0 +posx55=50 +posy55=50 +sizx55=800 +sizy55=600 +title56=Deeper Dungeons 95 +path56=C:\Games\Keeper95\Deeper95.exe +module56= +ver56=0 +flag56=268460070 +flagg56=0 +tflag56=0 +initx56=0 +inity56=0 +minx56=0 +miny56=0 +maxx56=0 +maxy56=0 +posx56=50 +posy56=50 +sizx56=800 +sizy56=600 +title57=Delta Force +path57=C:\Games\Delta Force\Df.exe +module57= +ver57=0 +flag57=34 +flagg57=0 +tflag57=0 +initx57=0 +inity57=0 +minx57=0 +miny57=0 +maxx57=0 +maxy57=0 +posx57=50 +posy57=50 +sizx57=800 +sizy57=600 +title58=Dementia +path58=C:\Games\dementia\program\CRUX.EXE -h +module58= +ver58=0 +flag58=536887330 +flagg58=0 +tflag58=2 +initx58=0 +inity58=0 +minx58=0 +miny58=0 +maxx58=0 +maxy58=0 +posx58=50 +posy58=50 +sizx58=800 +sizy58=600 +title59=Dethkarz +path59=D:\Games\DethKarz\Dethkarz.exe +module59= +ver59=0 +flag59=0 +flagg59=0 +tflag59=0 +initx59=0 +inity59=0 +minx59=0 +miny59=0 +maxx59=0 +maxy59=0 +posx59=50 +posy59=50 +sizx59=800 +sizy59=600 +title60=Devil Inside +path60=C:\Games\Devil Inside\Devil.exe +module60= +ver60=0 +flag60=32 +flagg60=0 +tflag60=0 +initx60=0 +inity60=0 +minx60=0 +miny60=0 +maxx60=0 +maxy60=0 +posx60=50 +posy60=50 +sizx60=800 +sizy60=600 +title61=Diablo +path61=D:\Games\Diablo\Diablo.exe +module61= +ver61=1 +flag61=138428450 +flagg61=1108344832 +tflag61=259 +initx61=0 +inity61=0 +minx61=0 +miny61=0 +maxx61=0 +maxy61=0 +posx61=50 +posy61=50 +sizx61=640 +sizy61=480 +title62=Dink Smallwood (BAD) +path62=C:\Games\Dink SmallWood\Dink.exe +module62= +ver62=0 +flag62=546 +flagg62=0 +tflag62=258 +initx62=0 +inity62=0 +minx62=0 +miny62=0 +maxx62=0 +maxy62=0 +posx62=50 +posy62=50 +sizx62=800 +sizy62=600 +title63=Doom 64 Absolution +path63=D:\Games\Doom 64 - Absolution (Win32 Port)\Bin\Absolution.exe +module63= +ver63=8 +flag63=134217728 +flagg63=86016 +tflag63=3 +initx63=0 +inity63=0 +minx63=0 +miny63=0 +maxx63=0 +maxy63=0 +posx63=50 +posy63=50 +sizx63=800 +sizy63=600 +title64=Doom 95 +path64=D:\Games\Doom95\DOOM95.EXE +module64= +ver64=0 +flag64=134217762 +flagg64=2113536 +tflag64=258 +initx64=0 +inity64=0 +minx64=0 +miny64=0 +maxx64=0 +maxy64=0 +posx64=50 +posy64=50 +sizx64=800 +sizy64=600 +title65=Drakan +path65=C:\Games\Drakan\drakan.exe +module65= +ver65=0 +flag65=536887328 +flagg65=0 +tflag65=0 +initx65=0 +inity65=0 +minx65=0 +miny65=0 +maxx65=0 +maxy65=0 +posx65=50 +posy65=50 +sizx65=800 +sizy65=600 +title66=Dream Aquarium +path66=D:\Program Files\Dream Aquarium\Dream_Aquarium.scr +module66= +ver66=9 +flag66=679477249 +flagg66=303104 +tflag66=256 +initx66=0 +inity66=0 +minx66=0 +miny66=0 +maxx66=0 +maxy66=0 +posx66=50 +posy66=50 +sizx66=800 +sizy66=600 +title67=Dungeon Keeper 2 GOG release +path67=D:\Games\Dungeon Keeper 2 GOG release\DKII.EXE +module67= +ver67=0 +flag67=134217762 +flagg67=4276224 +tflag67=6 +initx67=0 +inity67=0 +minx67=0 +miny67=0 +maxx67=0 +maxy67=0 +posx67=50 +posy67=50 +sizx67=800 +sizy67=600 +title68=Dungeon Keeper 95 +path68=D:\Games\Keeper95\KEEPER95.EXE +module68= +ver68=0 +flag68=134234150 +flagg68=0 +tflag68=64 +initx68=0 +inity68=0 +minx68=0 +miny68=0 +maxx68=0 +maxy68=0 +posx68=50 +posy68=50 +sizx68=800 +sizy68=600 +title69=Dungeon Keeper D3D +path69=D:\Games\Keeper95\keepd3d.exe +module69= +ver69=0 +flag69=134217760 +flagg69=134217728 +tflag69=3 +initx69=0 +inity69=0 +minx69=0 +miny69=0 +maxx69=0 +maxy69=0 +posx69=50 +posy69=50 +sizx69=800 +sizy69=600 +title70=Dungeon Keeper II +path70=D:\Games\Dungeon Keeper 2\DKII.exe +module70= +ver70=0 +flag70=34 +flagg70=574619648 +tflag70=262 +initx70=0 +inity70=0 +minx70=0 +miny70=0 +maxx70=0 +maxy70=0 +posx70=150 +posy70=50 +sizx70=800 +sizy70=600 +title71=Emergency Fighters for life +path71=D:\Games\Emergency\EMERGY.EXE +module71= +ver71=0 +flag71=134545443 +flagg71=18 +tflag71=3 +initx71=0 +inity71=0 +minx71=0 +miny71=0 +maxx71=0 +maxy71=0 +posx71=50 +posy71=50 +sizx71=800 +sizy71=600 +title72=Enemy Infestation +path72=C:\Games\Enemy Infestation (1998)\Ei.exe +module72= +ver72=0 +flag72=38 +flagg72=0 +tflag72=0 +initx72=0 +inity72=0 +minx72=0 +miny72=0 +maxx72=0 +maxy72=0 +posx72=50 +posy72=50 +sizx72=800 +sizy72=600 +title73=Evil Genius +path73=D:\Games\Evil Genius\ReleaseExe\EvilGenius_Cracked.exe +module73= +ver73=9 +flag73=2053 +flagg73=80 +tflag73=0 +initx73=0 +inity73=0 +minx73=0 +miny73=0 +maxx73=0 +maxy73=0 +posx73=50 +posy73=50 +sizx73=800 +sizy73=600 +title74=Expendable +path74=C:\Games\eXpendable\go.exe -nocputest +module74= +ver74=0 +flag74=402653280 +flagg74=1 +tflag74=2 +initx74=0 +inity74=0 +minx74=0 +miny74=0 +maxx74=0 +maxy74=0 +posx74=50 +posy74=50 +sizx74=800 +sizy74=600 +title75=Fallen Heaven +path75=D:\Games\Fallen haven\Exe\FALLEN.EXE +module75=MFC42.dll MSVCRT.DLL mciavi32.dll +ver75=1 +flag75=135004674 +flagg75=1049120 +tflag75=259 +initx75=0 +inity75=0 +minx75=0 +miny75=0 +maxx75=0 +maxy75=0 +posx75=50 +posy75=50 +sizx75=800 +sizy75=600 +title76=Fallen Heaven (BAD) +path76=C:\Games\falhaven\Exe\FALLEN.EXE +module76= +ver76=0 +flag76=679485962 +flagg76=32 +tflag76=0 +initx76=0 +inity76=0 +minx76=0 +miny76=0 +maxx76=0 +maxy76=0 +posx76=0 +posy76=0 +sizx76=800 +sizy76=600 +title77=Fallout +path77=D:\Games\Fallout\FALLOUTW.EXE +module77= +ver77=1 +flag77=134217734 +flagg77=16 +tflag77=0 +initx77=0 +inity77=0 +minx77=0 +miny77=0 +maxx77=0 +maxy77=0 +posx77=50 +posy77=50 +sizx77=800 +sizy77=600 +title78=FreakOut +path78=C:\Games\Freak Out - Extreme Freeride\FreakOut.exe +module78= +ver78=9 +flag78=0 +flagg78=0 +tflag78=2 +initx78=0 +inity78=0 +minx78=0 +miny78=0 +maxx78=0 +maxy78=0 +posx78=50 +posy78=50 +sizx78=800 +sizy78=600 +title79=Funtracks +path79=C:\Games\Funtracks\Fun_win.exe +module79= +ver79=1 +flag79=2 +flagg79=0 +tflag79=258 +initx79=0 +inity79=0 +minx79=0 +miny79=0 +maxx79=0 +maxy79=0 +posx79=50 +posy79=50 +sizx79=800 +sizy79=600 +title80=Galapagos +path80=C:\Games\Galapagos\GALA.EXE +module80= +ver80=0 +flag80=134217760 +flagg80=0 +tflag80=0 +initx80=0 +inity80=0 +minx80=0 +miny80=0 +maxx80=0 +maxy80=0 +posx80=50 +posy80=50 +sizx80=800 +sizy80=600 +title81=Gangsters +path81=C:\Games\Gangsters\gangsters.exe +module81= +ver81=0 +flag81=134217762 +flagg81=0 +tflag81=2 +initx81=0 +inity81=0 +minx81=0 +miny81=0 +maxx81=0 +maxy81=0 +posx81=100 +posy81=100 +sizx81=800 +sizy81=600 +title82=Gangsters +path82=D:\Games\Gangsters\gangsters.exe +module82= +ver82=0 +flag82=134217730 +flagg82=135266304 +tflag82=0 +initx82=0 +inity82=0 +minx82=0 +miny82=0 +maxx82=0 +maxy82=0 +posx82=50 +posy82=50 +sizx82=800 +sizy82=600 +title83=GeneRally +path83=C:\Games\generally105\GeneRally.exe +module83= +ver83=0 +flag83=34 +flagg83=0 +tflag83=0 +initx83=0 +inity83=0 +minx83=0 +miny83=0 +maxx83=0 +maxy83=0 +posx83=50 +posy83=50 +sizx83=800 +sizy83=600 +title84=Get Medieval +path84=C:\Games\Get Medieval\MEDIEVAL.EXE +module84= +ver84=0 +flag84=34 +flagg84=2 +tflag84=0 +initx84=0 +inity84=0 +minx84=0 +miny84=0 +maxx84=0 +maxy84=0 +posx84=0 +posy84=0 +sizx84=800 +sizy84=600 +title85=Gift +path85=C:\Games\Gift\Gift.exe +module85= +ver85=0 +flag85=4196384 +flagg85=0 +tflag85=34 +initx85=0 +inity85=0 +minx85=0 +miny85=0 +maxx85=0 +maxy85=0 +posx85=0 +posy85=0 +sizx85=0 +sizy85=0 +title86=glsample.exe +path86=D:\DxWnd\code examples\glsample\Debug\glsample.exe +module86= +ver86=0 +flag86=0 +flagg86=134348800 +tflag86=3 +initx86=0 +inity86=0 +minx86=0 +miny86=0 +maxx86=0 +maxy86=0 +posx86=0 +posy86=0 +sizx86=800 +sizy86=600 +title87=Golden Age of Racing +path87=C:\Games\Golden Age of Racing\GAOR.exe +module87= +ver87=0 +flag87=34 +flagg87=0 +tflag87=0 +initx87=0 +inity87=0 +minx87=0 +miny87=0 +maxx87=0 +maxy87=0 +posx87=50 +posy87=50 +sizx87=800 +sizy87=600 +title88=Gp500 for Win2K +path88=C:\Games\gp500\gp500_win2k.exe +module88= +ver88=1 +flag88=545677860 +flagg88=0 +tflag88=2 +initx88=0 +inity88=0 +minx88=0 +miny88=0 +maxx88=0 +maxy88=0 +posx88=50 +posy88=50 +sizx88=800 +sizy88=600 +title89=G-Police +path89=C:\Games\gpolice\GPOLICE.EXE +module89= +ver89=0 +flag89=67125286 +flagg89=0 +tflag89=2 +initx89=0 +inity89=0 +minx89=0 +miny89=0 +maxx89=0 +maxy89=0 +posx89=50 +posy89=50 +sizx89=800 +sizy89=600 +title90=gpwxp.exe +path90=D:\Games\Grand Prix World\gpwxp.exe +module90= +ver90=0 +flag90=0 +flagg90=671088768 +tflag90=3 +initx90=0 +inity90=0 +minx90=0 +miny90=0 +maxx90=0 +maxy90=0 +posx90=50 +posy90=50 +sizx90=800 +sizy90=600 +title91=Grand Prix Legends +path91=D:\Games\Grand Prix Legends\gpl\gpl.exe +module91= +ver91=0 +flag91=-1979678687 +flagg91=4 +tflag91=271 +initx91=0 +inity91=0 +minx91=0 +miny91=0 +maxx91=0 +maxy91=0 +posx91=50 +posy91=50 +sizx91=640 +sizy91=480 +title92=Grand Prix Legends MAX +path92=D:\Games\Grand Prix Legends MAX\gpl.exe +module92= +ver92=7 +flag92=537001986 +flagg92=134217729 +tflag92=3 +initx92=0 +inity92=0 +minx92=0 +miny92=0 +maxx92=0 +maxy92=0 +posx92=50 +posy92=50 +sizx92=800 +sizy92=600 +title93=Grand Theft Auto 2 +path93=D:\Games\GTA2\gta2.exe +module93=binkw32 d3ddll +ver93=0 +flag93=671096866 +flagg93=1048576 +tflag93=3 +initx93=0 +inity93=0 +minx93=0 +miny93=0 +maxx93=0 +maxy93=0 +posx93=50 +posy93=50 +sizx93=400 +sizy93=300 +title94=Grand Touring +path94=D:\Games\Grand Touring\gt.exe +module94= +ver94=0 +flag94=16388 +flagg94=134283264 +tflag94=275 +initx94=0 +inity94=0 +minx94=0 +miny94=0 +maxx94=0 +maxy94=0 +posx94=50 +posy94=50 +sizx94=400 +sizy94=300 +title95=Grim Fandango Demo +path95=C:\Games\GrimWebDemo\grimdemo.exe +module95= +ver95=0 +flag95=34 +flagg95=0 +tflag95=258 +initx95=0 +inity95=0 +minx95=0 +miny95=0 +maxx95=0 +maxy95=0 +posx95=50 +posy95=50 +sizx95=800 +sizy95=600 +title96=Gruntz +path96=D:\Games\gruntz\GRUNTZ.EXE +module96= +ver96=0 +flag96=34 +flagg96=134217728 +tflag96=0 +initx96=0 +inity96=0 +minx96=0 +miny96=0 +maxx96=0 +maxy96=0 +posx96=50 +posy96=50 +sizx96=800 +sizy96=600 +title97=GTA 3 +path97=D:\Games\GTA3\gta3.exe +module97= +ver97=0 +flag97=16420 +flagg97=134234112 +tflag97=67 +initx97=0 +inity97=0 +minx97=0 +miny97=0 +maxx97=0 +maxy97=0 +posx97=50 +posy97=50 +sizx97=800 +sizy97=600 +title98=Gunman Chronicles +path98=D:\Games\Gunman\gunman.exe +module98= +ver98=0 +flag98=0 +flagg98=-2013134848 +tflag98=0 +initx98=0 +inity98=0 +minx98=0 +miny98=0 +maxx98=0 +maxy98=0 +posx98=0 +posy98=0 +sizx98=400 +sizy98=300 +title99=Half-Life Blue-Shift (d3d) +path99=D:\Games\Half-Life Blue-Shift\bshift.exe +module99= +ver99=7 +flag99=1207959554 +flagg99=513 +tflag99=258 +initx99=0 +inity99=0 +minx99=0 +miny99=0 +maxx99=0 +maxy99=0 +posx99=50 +posy99=50 +sizx99=800 +sizy99=600 +title100=Half-Life Uplink Demo +path100=D:\Games\Half-Life Uplink\hldemo.exe +module100= +ver100=1 +flag100=1073741826 +flagg100=16384 +tflag100=2 +initx100=0 +inity100=0 +minx100=0 +miny100=0 +maxx100=0 +maxy100=0 +posx100=50 +posy100=50 +sizx100=640 +sizy100=480 +title101=Halo Combat Evolved +path101=D:\Games\Halo Combat Evolved\halo.exe +module101= +ver101=9 +flag101=570425377 +flagg101=-2147483648 +tflag101=478 +initx101=0 +inity101=0 +minx101=0 +miny101=0 +maxx101=0 +maxy101=0 +posx101=50 +posy101=50 +sizx101=800 +sizy101=600 +title102=Heart of Darkness +path102=d:\Games\Heart of Darkness\HODWin32.exe +module102= +ver102=0 +flag102=8226 +flagg102=2179072 +tflag102=0 +initx102=0 +inity102=0 +minx102=0 +miny102=0 +maxx102=0 +maxy102=0 +posx102=50 +posy102=50 +sizx102=800 +sizy102=600 +title103=Heavy Metal FAKK 2 +path103=C:\Games\Heavy Metal - FAKK2\fakk2.exe +module103= +ver103=0 +flag103=33554464 +flagg103=64 +tflag103=2 +initx103=0 +inity103=0 +minx103=0 +miny103=0 +maxx103=0 +maxy103=0 +posx103=50 +posy103=50 +sizx103=800 +sizy103=600 +title104=HellCopter +path104=C:\Games\hellcop\HCopter.exe +module104= +ver104=0 +flag104=-2013249500 +flagg104=256 +tflag104=0 +initx104=0 +inity104=0 +minx104=0 +miny104=0 +maxx104=0 +maxy104=0 +posx104=50 +posy104=50 +sizx104=800 +sizy104=600 +title105=Heretic 2 +path105=D:\Games\Heretic 2\Heretic2.exe +module105= +ver105=0 +flag105=0 +flagg105=134348800 +tflag105=259 +initx105=0 +inity105=0 +minx105=0 +miny105=0 +maxx105=0 +maxy105=0 +posx105=50 +posy105=50 +sizx105=800 +sizy105=600 +title106=Heroes of Might & Magic III Demo +path106=C:\Games\Heroes III Demo\h3demo.exe +module106= +ver106=1 +flag106=134234146 +flagg106=0 +tflag106=2 +initx106=0 +inity106=0 +minx106=0 +miny106=0 +maxx106=0 +maxy106=0 +posx106=50 +posy106=50 +sizx106=800 +sizy106=600 +title107=Hexen II (opengl) +path107=D:\Games\Hexen II\glh2.exe +module107= +ver107=10 +flag107=3 +flagg107=212993 +tflag107=387 +initx107=0 +inity107=0 +minx107=0 +miny107=0 +maxx107=0 +maxy107=0 +posx107=50 +posy107=50 +sizx107=800 +sizy107=600 +title108=Hexen II (software) +path108=D:\Games\Hexen II\h2.exe +module108= +ver108=0 +flag108=671088642 +flagg108=1130496 +tflag108=0 +initx108=0 +inity108=0 +minx108=0 +miny108=0 +maxx108=0 +maxy108=0 +posx108=50 +posy108=50 +sizx108=800 +sizy108=600 +title109=hover +path109=C:\Games\hover\hoverX.exe +module109= +ver109=0 +flag109=8224 +flagg109=0 +tflag109=0 +initx109=0 +inity109=0 +minx109=0 +miny109=0 +maxx109=0 +maxy109=0 +posx109=50 +posy109=50 +sizx109=800 +sizy109=600 +title110=Hyperblade +path110=D:\Games\Hyperblade\HYPERX.EXE +module110= +ver110=0 +flag110=134217891 +flagg110=3231762 +tflag110=2 +initx110=0 +inity110=0 +minx110=0 +miny110=0 +maxx110=0 +maxy110=0 +posx110=50 +posy110=50 +sizx110=800 +sizy110=600 +title111=Idinaloq +path111=C:\Games\idina101\idinaloq.exe +module111= +ver111=0 +flag111=32 +flagg111=0 +tflag111=0 +initx111=0 +inity111=0 +minx111=0 +miny111=0 +maxx111=0 +maxy111=0 +posx111=50 +posy111=50 +sizx111=800 +sizy111=600 +title112=Immanis +path112=C:\Games\Immanis CD release\immanis.exe +module112= +ver112=0 +flag112=24611 +flagg112=0 +tflag112=0 +initx112=0 +inity112=0 +minx112=0 +miny112=0 +maxx112=0 +maxy112=0 +posx112=50 +posy112=50 +sizx112=800 +sizy112=600 +title113=Immanis (v2) +path113=C:\Games\Immanis CD release\immanis_v2.exe +module113= +ver113=0 +flag113=268460067 +flagg113=0 +tflag113=0 +initx113=0 +inity113=0 +minx113=0 +miny113=0 +maxx113=0 +maxy113=0 +posx113=50 +posy113=50 +sizx113=800 +sizy113=600 +title114=In the Hunt +path114=C:\Games\In The Hunt\e8.exe +module114= +ver114=0 +flag114=2 +flagg114=0 +tflag114=0 +initx114=0 +inity114=0 +minx114=0 +miny114=0 +maxx114=0 +maxy114=0 +posx114=50 +posy114=50 +sizx114=800 +sizy114=600 +title115=Incoming Forces +path115=D:\Games\Incoming Forces\forces.exe +module115= +ver115=8 +flag115=134217760 +flagg115=0 +tflag115=2 +initx115=0 +inity115=0 +minx115=0 +miny115=0 +maxx115=0 +maxy115=0 +posx115=50 +posy115=50 +sizx115=800 +sizy115=600 +title116=International Superstar Soccer 3 +path116=C:\Games\ISS_3\iss3.exe +module116= +ver116=8 +flag116=545267715 +flagg116=0 +tflag116=0 +initx116=0 +inity116=0 +minx116=0 +miny116=0 +maxx116=0 +maxy116=0 +posx116=50 +posy116=50 +sizx116=800 +sizy116=600 +title117=Jacked +path117=D:\Games\Jacked\Jacked.exe +module117=winmm +ver117=9 +flag117=537010208 +flagg117=196608 +tflag117=258 +initx117=0 +inity117=0 +minx117=0 +miny117=0 +maxx117=0 +maxy117=0 +posx117=50 +posy117=50 +sizx117=800 +sizy117=600 +title118=Jedi Knight II Jedi Outcast +path118=D:\Games\Jedi Knight II Jedi Outcast\GameData\jk2sp.exe +module118= +ver118=0 +flag118=2 +flagg118=1180161 +tflag118=3 +initx118=0 +inity118=0 +minx118=0 +miny118=0 +maxx118=0 +maxy118=0 +posx118=50 +posy118=50 +sizx118=800 +sizy118=600 +title119=Jet Moto +path119=M:\JETMOTO.EXE +module119= +ver119=0 +flag119=139298 +flagg119=0 +tflag119=0 +initx119=0 +inity119=0 +minx119=0 +miny119=0 +maxx119=0 +maxy119=0 +posx119=50 +posy119=50 +sizx119=800 +sizy119=600 +title120=Kiss Psyco Cyrcus +path120=C:\Games\Psycho\client.exe +module120=d3d.ren +ver120=7 +flag120=537018404 +flagg120=0 +tflag120=0 +initx120=0 +inity120=0 +minx120=0 +miny120=0 +maxx120=0 +maxy120=0 +posx120=50 +posy120=50 +sizx120=800 +sizy120=600 +title121=Koplio +path121=D:\Games\Koplio\KOPLIO.exe +module121= +ver121=0 +flag121=545259520 +flagg121=134217729 +tflag121=0 +initx121=0 +inity121=0 +minx121=0 +miny121=0 +maxx121=0 +maxy121=0 +posx121=50 +posy121=50 +sizx121=800 +sizy121=600 +title122=Krazy Ivan +path122=C:\Games\Krazy Ivan\KRAZY.EXE +module122= +ver122=0 +flag122=536870914 +flagg122=0 +tflag122=0 +initx122=0 +inity122=0 +minx122=0 +miny122=0 +maxx122=0 +maxy122=0 +posx122=50 +posy122=50 +sizx122=800 +sizy122=600 +title123=Last Bronx +path123=C:\Games\Last_Bronx\LB.EXE +module123= +ver123=0 +flag123=40994 +flagg123=0 +tflag123=64 +initx123=0 +inity123=0 +minx123=0 +miny123=0 +maxx123=0 +maxy123=0 +posx123=50 +posy123=50 +sizx123=800 +sizy123=600 +title124=Lionheart +path124=C:\Games\Lionheart Demo\Lionheart.exe +module124= +ver124=0 +flag124=-2147483612 +flagg124=0 +tflag124=0 +initx124=0 +inity124=0 +minx124=0 +miny124=0 +maxx124=0 +maxy124=0 +posx124=50 +posy124=50 +sizx124=800 +sizy124=600 +title125=lithtech.exe +path125=D:\Games\NOLF Technology Demo\lithtech.exe +module125= +ver125=7 +flag125=0 +flagg125=512 +tflag125=258 +initx125=0 +inity125=0 +minx125=0 +miny125=0 +maxx125=0 +maxy125=0 +posx125=50 +posy125=50 +sizx125=800 +sizy125=600 +title126=Lords of the Realm 2 +path126=D:\Games\L2SIEGE\LORDS2.EXE +module126= +ver126=0 +flag126=38 +flagg126=65536 +tflag126=9 +initx126=0 +inity126=0 +minx126=0 +miny126=0 +maxx126=0 +maxy126=0 +posx126=50 +posy126=50 +sizx126=800 +sizy126=600 +title127=M.A.X. 2 +path127=C:\Games\MAX 2\MAX_2\MAX2\MAX2.EXE +module127= +ver127=0 +flag127=34 +flagg127=0 +tflag127=0 +initx127=0 +inity127=0 +minx127=0 +miny127=0 +maxx127=0 +maxy127=0 +posx127=50 +posy127=50 +sizx127=800 +sizy127=600 +title128=M1 Tank Platoon 2 +path128=C:\Games\M1 Tank Platoon 2\M1TP2.exe +module128= +ver128=8 +flag128=34 +flagg128=0 +tflag128=0 +initx128=0 +inity128=0 +minx128=0 +miny128=0 +maxx128=0 +maxy128=0 +posx128=50 +posy128=50 +sizx128=800 +sizy128=600 +title129=Mario Worlds (stripped PE) +path129=C:\Games\Mario Worlds\Mario Worlds.exe +module129= +ver129=1 +flag129=2 +flagg129=1 +tflag129=386 +initx129=0 +inity129=0 +minx129=0 +miny129=0 +maxx129=0 +maxy129=0 +posx129=50 +posy129=50 +sizx129=800 +sizy129=600 +title130=Masters of Orion 2 +path130=C:\Games\Orion2\Orion95.exe +module130= +ver130=0 +flag130=34 +flagg130=0 +tflag130=0 +initx130=0 +inity130=0 +minx130=0 +miny130=0 +maxx130=0 +maxy130=0 +posx130=50 +posy130=50 +sizx130=800 +sizy130=600 +title131=Microsoft Flight Simulator 98 +path131=C:\Games\Flight Simulator 98\FLTSIM98.EXE +module131= +ver131=0 +flag131=288 +flagg131=0 +tflag131=0 +initx131=0 +inity131=0 +minx131=0 +miny131=0 +maxx131=0 +maxy131=0 +posx131=50 +posy131=50 +sizx131=800 +sizy131=600 +title132=Microsoft Midtown Madness +path132=C:\Games\Midtown Madness\midtown.exe +module132= +ver132=0 +flag132=8192 +flagg132=0 +tflag132=2 +initx132=0 +inity132=0 +minx132=0 +miny132=0 +maxx132=0 +maxy132=0 +posx132=50 +posy132=50 +sizx132=800 +sizy132=600 +title133=Microsoft Midtown Madness Trial (BAD) +path133=C:\Games\Midtown Madness Trial\midtrial.exe +module133= +ver133=0 +flag133=2 +flagg133=0 +tflag133=0 +initx133=0 +inity133=0 +minx133=0 +miny133=0 +maxx133=0 +maxy133=0 +posx133=0 +posy133=0 +sizx133=800 +sizy133=600 +title134=Microsoft Motocross Madness 2 (BAD!!) +path134=C:\Games\Motocross Madness 2\MCM2.cracked.EXE +module134= +ver134=7 +flag134=201326664 +flagg134=1 +tflag134=82 +initx134=0 +inity134=0 +minx134=0 +miny134=0 +maxx134=0 +maxy134=0 +posx134=50 +posy134=50 +sizx134=800 +sizy134=600 +title135=Microsoft Motocross Madness Trial (BAD) +path135=C:\Games\Motocross Madness Trial\mcm.exe +module135= +ver135=1 +flag135=134225952 +flagg135=0 +tflag135=130 +initx135=0 +inity135=0 +minx135=0 +miny135=0 +maxx135=0 +maxy135=0 +posx135=50 +posy135=50 +sizx135=0 +sizy135=0 +title136=Mission Force Cyberstorm (BAD ?) +path136=C:\Games\SIERRA\CSTORM\CSTORM.EXE +module136= +ver136=0 +flag136=33562658 +flagg136=0 +tflag136=0 +initx136=0 +inity136=0 +minx136=0 +miny136=0 +maxx136=0 +maxy136=0 +posx136=50 +posy136=50 +sizx136=0 +sizy136=0 +title137=Monopoly 3D +path137=C:\Games\Monopoly (Edition 3D)\Monopoly.exe +module137= +ver137=0 +flag137=134244388 +flagg137=0 +tflag137=2 +initx137=0 +inity137=0 +minx137=0 +miny137=0 +maxx137=0 +maxy137=0 +posx137=50 +posy137=50 +sizx137=800 +sizy137=600 +title138=Monster Truck Madness 2 +path138=C:\Games\Monster Truck Madness 2\Monster.EXE +module138= +ver138=1 +flag138=34 +flagg138=1 +tflag138=0 +initx138=0 +inity138=0 +minx138=0 +miny138=0 +maxx138=0 +maxy138=0 +posx138=50 +posy138=50 +sizx138=800 +sizy138=600 +title139=Moto Racer Demo +path139=D:\Games\Moto Racer Demo\PlayDemo.exe +module139= +ver139=0 +flag139=167903267 +flagg139=192 +tflag139=14 +initx139=0 +inity139=0 +minx139=0 +miny139=0 +maxx139=0 +maxy139=0 +posx139=50 +posy139=50 +sizx139=800 +sizy139=600 +title140=MTV Music Generator +path140=D:\Codemasters\MTV Music Generator\mtvmusic.exe +module140= +ver140=0 +flag140=2 +flagg140=134217728 +tflag140=0 +initx140=0 +inity140=0 +minx140=0 +miny140=0 +maxx140=0 +maxy140=0 +posx140=50 +posy140=50 +sizx140=800 +sizy140=600 +title141=Necrodrome +path141=C:\Games\Necrodome\NECRO95.EXE +module141= +ver141=0 +flag141=268435495 +flagg141=256 +tflag141=0 +initx141=0 +inity141=0 +minx141=0 +miny141=0 +maxx141=0 +maxy141=0 +posx141=50 +posy141=50 +sizx141=800 +sizy141=600 +title142=Need For Speed - Porsche 2000 +path142=C:\Games\Need For Speed - Porsche 2000\Porsche.exe +module142= +ver142=7 +flag142=0 +flagg142=0 +tflag142=258 +initx142=0 +inity142=0 +minx142=0 +miny142=0 +maxx142=0 +maxy142=0 +posx142=50 +posy142=50 +sizx142=800 +sizy142=600 +title143=Need For Speed Underground +path143=D:\Games\Need For Speed Underground\speed.exe +module143= +ver143=0 +flag143=671088674 +flagg143=1815101441 +tflag143=323 +initx143=0 +inity143=0 +minx143=0 +miny143=0 +maxx143=0 +maxy143=0 +posx143=50 +posy143=50 +sizx143=800 +sizy143=600 +title144=Need for Speed Underground 2 +path144=D:\Games\Need for Speed Underground 2\SPEED2.EXE +module144= +ver144=0 +flag144=671105024 +flagg144=673202176 +tflag144=7 +initx144=0 +inity144=0 +minx144=0 +miny144=0 +maxx144=0 +maxy144=0 +posx144=50 +posy144=50 +sizx144=800 +sizy144=600 +title145=Need For Speed Underground Demo +path145=D:\Games\Need For Speed Underground Demo\speeddemo.exe +module145= +ver145=9 +flag145=0 +flagg145=673464320 +tflag145=3 +initx145=0 +inity145=0 +minx145=0 +miny145=0 +maxx145=0 +maxy145=0 +posx145=50 +posy145=50 +sizx145=800 +sizy145=600 +title146=Netstorm Islands at War +path146=C:\Games\Netstorm\Netstorm.exe +module146= +ver146=0 +flag146=2 +flagg146=0 +tflag146=0 +initx146=0 +inity146=0 +minx146=0 +miny146=0 +maxx146=0 +maxy146=0 +posx146=50 +posy146=50 +sizx146=800 +sizy146=600 +title147=Nightmare Ned +path147=D:\Games\Ned\NITENED.EXE +module147= +ver147=0 +flag147=537395202 +flagg147=135266305 +tflag147=0 +initx147=0 +inity147=0 +minx147=0 +miny147=0 +maxx147=0 +maxy147=0 +posx147=0 +posy147=0 +sizx147=800 +sizy147=600 +title148=Nocturne +path148=D:\Games\Nocturne\nocturne.exe +module148= +ver148=0 +flag148=134217730 +flagg148=402653264 +tflag148=387 +initx148=0 +inity148=0 +minx148=0 +miny148=0 +maxx148=0 +maxy148=0 +posx148=50 +posy148=50 +sizx148=800 +sizy148=600 +title149=Nox +path149=d:\Games\Nox\Game.exe +module149= +ver149=0 +flag149=939540515 +flagg149=0 +tflag149=386 +initx149=0 +inity149=0 +minx149=0 +miny149=0 +maxx149=0 +maxy149=0 +posx149=50 +posy149=50 +sizx149=800 +sizy149=600 +title150=Pacific General +path150=C:\Games\Pacific General\PACGEN.EXE +module150= +ver150=0 +flag150=8226 +flagg150=0 +tflag150=2 +initx150=0 +inity150=0 +minx150=0 +miny150=0 +maxx150=0 +maxy150=0 +posx150=50 +posy150=50 +sizx150=800 +sizy150=600 +title151=Pandemonium 2 +path151=D:\Games\Pandemonium 2\pandy.exe +module151= +ver151=0 +flag151=671219714 +flagg151=1 +tflag151=0 +initx151=0 +inity151=0 +minx151=0 +miny151=0 +maxx151=0 +maxy151=0 +posx151=50 +posy151=50 +sizx151=800 +sizy151=600 +title152=Pharaoh +path152=D:\Games\Pharaoh\Pharaoh.exe +module152= +ver152=0 +flag152=1208483874 +flagg152=1048576 +tflag152=0 +initx152=0 +inity152=0 +minx152=0 +miny152=0 +maxx152=0 +maxy152=0 +posx152=50 +posy152=50 +sizx152=800 +sizy152=600 +title153=Postal +path153=D:\Games\Postal\POSTAL.EXE +module153= +ver153=1 +flag153=537133059 +flagg153=65536 +tflag153=266 +initx153=0 +inity153=0 +minx153=0 +miny153=0 +maxx153=0 +maxy153=0 +posx153=50 +posy153=50 +sizx153=800 +sizy153=600 +title154=Premier Manager 98 +path154=D:\Games\Premier Manager 98\MANAGER.EXE +module154= +ver154=0 +flag154=671088674 +flagg154=134217728 +tflag154=0 +initx154=0 +inity154=0 +minx154=0 +miny154=0 +maxx154=0 +maxy154=0 +posx154=50 +posy154=50 +sizx154=800 +sizy154=600 +title155=Project Nomads Demo (BAD) +path155=C:\Games\Project Nomads Demo\bin\win32\nomads.exe +module155= +ver155=8 +flag155=-1476394912 +flagg155=256 +tflag155=258 +initx155=0 +inity155=0 +minx155=0 +miny155=0 +maxx155=0 +maxy155=0 +posx155=50 +posy155=50 +sizx155=800 +sizy155=600 +title156=Puzzle Bubble +path156=C:\Games\Puzzle Bubble\PB.EXE +module156= +ver156=0 +flag156=34 +flagg156=0 +tflag156=0 +initx156=0 +inity156=0 +minx156=0 +miny156=0 +maxx156=0 +maxy156=0 +posx156=50 +posy156=50 +sizx156=800 +sizy156=600 +title157=Quake 2 +path157=D:\Games\QUAKE2\quake2.exe +module157= +ver157=10 +flag157=671089154 +flagg157=-1476263359 +tflag157=259 +initx157=0 +inity157=0 +minx157=0 +miny157=0 +maxx157=0 +maxy157=0 +posx157=50 +posy157=50 +sizx157=800 +sizy157=600 +title158=Quake 3 Arena +path158=D:\Games\Q3A\quake3.exe +module158= +ver158=10 +flag158=0 +flagg158=1180160 +tflag158=3 +initx158=0 +inity158=0 +minx158=0 +miny158=0 +maxx158=0 +maxy158=0 +posx158=50 +posy158=50 +sizx158=800 +sizy158=600 +title159=Raiden II +path159=C:\Games\Raiden II\Raiden II\RAIDENII.EXE +module159= +ver159=0 +flag159=34 +flagg159=0 +tflag159=0 +initx159=0 +inity159=0 +minx159=0 +miny159=0 +maxx159=0 +maxy159=0 +posx159=50 +posy159=50 +sizx159=800 +sizy159=600 +title160=Railroad Tycoon II +path160=C:\Games\Railroad.Tycoon.II\RT2.EXE +module160= +ver160=1 +flag160=134225954 +flagg160=0 +tflag160=0 +initx160=0 +inity160=0 +minx160=0 +miny160=0 +maxx160=0 +maxy160=0 +posx160=50 +posy160=50 +sizx160=800 +sizy160=600 +title161=Rally Championship 2000 +path161=C:\Games\Rally Championship 2000\RAL.EXE +module161= +ver161=0 +flag161=67108864 +flagg161=0 +tflag161=2 +initx161=0 +inity161=0 +minx161=0 +miny161=0 +maxx161=0 +maxy161=0 +posx161=50 +posy161=50 +sizx161=800 +sizy161=600 +title162=Rebel Moon Rising +path162=C:\Games\Rebel Moon Rising\Rmr.exe +module162= +ver162=0 +flag162=0 +flagg162=0 +tflag162=0 +initx162=0 +inity162=0 +minx162=0 +miny162=0 +maxx162=0 +maxy162=0 +posx162=50 +posy162=50 +sizx162=800 +sizy162=600 +title163=Redline - Gang Warfare 2066 +path163=C:\Games\Redline - Gang Warfare 2066\redline.exe +module163= +ver163=0 +flag163=32 +flagg163=0 +tflag163=386 +initx163=0 +inity163=0 +minx163=0 +miny163=0 +maxx163=0 +maxy163=0 +posx163=50 +posy163=50 +sizx163=800 +sizy163=600 +title164=Resident Evil +path164=D:\Games\Resident Evil\residentevil.patched.exe +module164= +ver164=1 +flag164=134217827 +flagg164=-2147483520 +tflag164=2 +initx164=0 +inity164=0 +minx164=0 +miny164=0 +maxx164=0 +maxy164=0 +posx164=50 +posy164=50 +sizx164=800 +sizy164=600 +title165=Return to Castle Wolfenstein +path165=D:\Games\Return to Castle Wolfenstein (2001)\Return to Castle Wolfenstein\WolfSP.exe +module165= +ver165=0 +flag165=134234114 +flagg165=-2147270656 +tflag165=256 +initx165=0 +inity165=0 +minx165=0 +miny165=0 +maxx165=0 +maxy165=0 +posx165=50 +posy165=50 +sizx165=800 +sizy165=600 +title166=Re-Volt +path166=C:\Games\Re-Volt\REVOLT.EXE +module166= +ver166=0 +flag166=134217792 +flagg166=0 +tflag166=0 +initx166=0 +inity166=0 +minx166=0 +miny166=0 +maxx166=0 +maxy166=0 +posx166=50 +posy166=50 +sizx166=800 +sizy166=600 +title167=Road Rash +path167=D:\Games\Road Rash\ROADRASH\ROADRASH.EXE +module167= +ver167=0 +flag167=134217730 +flagg167=0 +tflag167=386 +initx167=0 +inity167=0 +minx167=0 +miny167=0 +maxx167=0 +maxy167=0 +posx167=50 +posy167=50 +sizx167=800 +sizy167=600 +title168=Road Rash Demo +path168=D:\Games\RoadRash DEMO\DEMORASH.EXE +module168= +ver168=0 +flag168=134218242 +flagg168=0 +tflag168=258 +initx168=0 +inity168=0 +minx168=0 +miny168=0 +maxx168=0 +maxy168=0 +posx168=50 +posy168=50 +sizx168=800 +sizy168=600 +title169=Rogue Spear (BAD) +path169=D:\Games\Rogue Spear\RogueSpear.exe +module169= +ver169=1 +flag169=16388 +flagg169=134217984 +tflag169=2 +initx169=0 +inity169=0 +minx169=0 +miny169=0 +maxx169=0 +maxy169=0 +posx169=50 +posy169=50 +sizx169=400 +sizy169=300 +title170=Rollcage +path170=D:\Games\Rollcage\Direct3D\Rollcage.exe +module170= +ver170=0 +flag170=268698112 +flagg170=-2013200384 +tflag170=387 +initx170=0 +inity170=0 +minx170=0 +miny170=0 +maxx170=0 +maxy170=0 +posx170=50 +posy170=50 +sizx170=800 +sizy170=600 +title171=RollerCoaster Tycoon 2 Mini Game +path171=C:\Games\RollerCoaster Tycoon 2 Mini Game\rct2.exe +module171= +ver171=1 +flag171=536870946 +flagg171=0 +tflag171=0 +initx171=0 +inity171=0 +minx171=0 +miny171=0 +maxx171=0 +maxy171=0 +posx171=0 +posy171=0 +sizx171=800 +sizy171=600 +title172=Sega Rally 2 Championship +path172=C:\Games\Sega Rally 2 Championship\SEGA RALLY 2.exe +module172= +ver172=1 +flag172=268435488 +flagg172=2 +tflag172=0 +initx172=0 +inity172=0 +minx172=0 +miny172=0 +maxx172=0 +maxy172=0 +posx172=0 +posy172=0 +sizx172=800 +sizy172=600 +title173=Sentinel Returns +path173=D:\Games\Sentinel Returns\Sentinel.exe +module173= +ver173=1 +flag173=3 +flagg173=-2147483648 +tflag173=0 +initx173=0 +inity173=0 +minx173=0 +miny173=0 +maxx173=0 +maxy173=0 +posx173=50 +posy173=50 +sizx173=800 +sizy173=600 +title174=Shadow Master (TBD) +path174=C:\Games\Shadow Master\rmg.exe +module174= +ver174=1 +flag174=32 +flagg174=256 +tflag174=450 +initx174=0 +inity174=0 +minx174=0 +miny174=0 +maxx174=0 +maxy174=0 +posx174=50 +posy174=50 +sizx174=800 +sizy174=600 +title175=Sid Meier's SimGolf Demo +path175=C:\Games\Sid Meier's SimGolf Demo\golf.exe +module175=jgl.dll +ver175=0 +flag175=33554434 +flagg175=0 +tflag175=2 +initx175=0 +inity175=0 +minx175=0 +miny175=0 +maxx175=0 +maxy175=0 +posx175=50 +posy175=50 +sizx175=800 +sizy175=600 +title176=Silent Storm Demo +path176=D:\Games\Silent Storm Demo\SilentStormDemo.exe +module176= +ver176=0 +flag176=536870913 +flagg176=-2013265664 +tflag176=3 +initx176=0 +inity176=0 +minx176=0 +miny176=0 +maxx176=0 +maxy176=0 +posx176=50 +posy176=50 +sizx176=800 +sizy176=600 +title177=Sin, Wages of (sw renderer) +path177=D:\Games\sin\sin.exe +module177=ref_gl.dll ref_soft.dll +ver177=10 +flag177=402670082 +flagg177=513 +tflag177=386 +initx177=0 +inity177=0 +minx177=0 +miny177=0 +maxx177=0 +maxy177=0 +posx177=50 +posy177=50 +sizx177=800 +sizy177=600 +title178=SleepWalker +path178=C:\Games\SleepWalker\Sleepy.exe +module178= +ver178=0 +flag178=301989954 +flagg178=0 +tflag178=198 +initx178=0 +inity178=0 +minx178=0 +miny178=0 +maxx178=0 +maxy178=0 +posx178=50 +posy178=50 +sizx178=800 +sizy178=600 +title179=SnowBoard Racer +path179=C:\Games\Snowboard Racer\SnowBoard.exe +module179= +ver179=0 +flag179=268443681 +flagg179=0 +tflag179=0 +initx179=0 +inity179=0 +minx179=0 +miny179=0 +maxx179=0 +maxy179=0 +posx179=50 +posy179=50 +sizx179=800 +sizy179=600 +title180=Solaris (~BAD) +path180=c:\Games\Solaris\solaris.exe +module180= +ver180=7 +flag180=973078627 +flagg180=1 +tflag180=2 +initx180=0 +inity180=0 +minx180=0 +miny180=0 +maxx180=0 +maxy180=0 +posx180=50 +posy180=50 +sizx180=800 +sizy180=600 +title181=Soldiers at War +path181=D:\Games\Soldiers at War\SAW_Game.exe +module181= +ver181=0 +flag181=671359010 +flagg181=64 +tflag181=0 +initx181=0 +inity181=0 +minx181=0 +miny181=0 +maxx181=0 +maxy181=0 +posx181=50 +posy181=50 +sizx181=640 +sizy181=480 +title182=Sonic 3 +path182=C:\Games\Sonic 3 + Sonic et Knuckles\Sonic 3\SONIC3K.EXE +module182= +ver182=1 +flag182=546 +flagg182=0 +tflag182=0 +initx182=0 +inity182=0 +minx182=0 +miny182=0 +maxx182=0 +maxy182=0 +posx182=50 +posy182=50 +sizx182=800 +sizy182=600 +title183=Sonic 3D Blast +path183=C:\Games\Sonic3D\pcsonic.exe +module183= +ver183=0 +flag183=134217762 +flagg183=0 +tflag183=0 +initx183=0 +inity183=0 +minx183=0 +miny183=0 +maxx183=0 +maxy183=0 +posx183=50 +posy183=50 +sizx183=800 +sizy183=600 +title184=Sonic R +path184=C:\Games\SonicR\sonicr.exe +module184= +ver184=0 +flag184=8288 +flagg184=0 +tflag184=0 +initx184=0 +inity184=0 +minx184=0 +miny184=0 +maxx184=0 +maxy184=0 +posx184=50 +posy184=50 +sizx184=800 +sizy184=600 +title185=Soulbringer +path185=C:\Games\SoulBringer\SoulbringeVCnoeax.exe +module185= +ver185=0 +flag185=143024174 +flagg185=0 +tflag185=0 +initx185=0 +inity185=0 +minx185=0 +miny185=0 +maxx185=0 +maxy185=0 +posx185=50 +posy185=50 +sizx185=800 +sizy185=600 +title186=Speedboat Attack (BAD) +path186=C:\Games\Speedboat Attack\SBOAT.EXE +module186= +ver186=0 +flag186=541073954 +flagg186=0 +tflag186=2 +initx186=0 +inity186=0 +minx186=0 +miny186=0 +maxx186=0 +maxy186=0 +posx186=50 +posy186=50 +sizx186=800 +sizy186=600 +title187=Star trek Klingon Honor Guard +path187=D:\Games\Star trek Klingon Honor Guard\System\Khg.exe +module187=OGIDrv.dll +ver187=10 +flag187=0 +flagg187=131585 +tflag187=387 +initx187=0 +inity187=0 +minx187=0 +miny187=0 +maxx187=0 +maxy187=0 +posx187=50 +posy187=50 +sizx187=800 +sizy187=600 +maxfps0=0 +maxfps1=0 +maxfps2=0 +maxfps3=40 +maxfps4=0 +maxfps5=0 +maxfps6=0 +maxfps7=0 +maxfps8=10 +maxfps9=40 +maxfps10=0 +maxfps11=0 +maxfps12=0 +maxfps13=0 +maxfps14=0 +maxfps15=0 +maxfps16=0 +maxfps17=0 +maxfps18=0 +maxfps19=0 +maxfps20=0 +maxfps21=0 +maxfps22=0 +maxfps23=0 +maxfps24=0 +maxfps25=0 +maxfps26=0 +maxfps27=0 +maxfps28=0 +maxfps29=0 +maxfps30=0 +maxfps31=0 +maxfps32=0 +maxfps33=0 +maxfps34=0 +maxfps35=0 +maxfps36=0 +maxfps37=0 +maxfps38=0 +maxfps39=0 +maxfps40=0 +maxfps41=0 +maxfps42=0 +maxfps43=0 +maxfps44=0 +maxfps45=0 +maxfps46=0 +maxfps47=0 +maxfps48=0 +maxfps49=0 +maxfps50=0 +maxfps51=0 +maxfps52=0 +maxfps53=0 +maxfps54=0 +maxfps55=0 +maxfps56=0 +maxfps57=0 +maxfps58=0 +maxfps59=0 +maxfps60=0 +maxfps61=0 +maxfps62=0 +maxfps63=100 +maxfps64=20 +maxfps65=0 +maxfps66=500 +maxfps67=0 +maxfps68=0 +maxfps69=0 +maxfps70=0 +maxfps71=0 +maxfps72=0 +maxfps73=0 +maxfps74=0 +maxfps75=0 +maxfps76=0 +maxfps77=0 +maxfps78=0 +maxfps79=0 +maxfps80=0 +maxfps81=0 +maxfps82=0 +maxfps83=0 +maxfps84=0 +maxfps85=0 +maxfps86=0 +maxfps87=0 +maxfps88=0 +maxfps89=0 +maxfps90=0 +maxfps91=0 +maxfps92=0 +maxfps93=0 +maxfps94=0 +maxfps95=0 +maxfps96=0 +maxfps97=0 +maxfps98=0 +maxfps99=0 +maxfps100=0 +maxfps101=0 +maxfps102=0 +maxfps103=0 +maxfps104=0 +maxfps105=0 +maxfps106=0 +maxfps107=50 +maxfps108=0 +maxfps109=0 +maxfps110=25 +maxfps111=0 +maxfps112=0 +maxfps113=0 +maxfps114=0 +maxfps115=0 +maxfps116=0 +maxfps117=100 +maxfps118=0 +maxfps119=0 +maxfps120=0 +maxfps121=0 +maxfps122=0 +maxfps123=0 +maxfps124=0 +maxfps125=0 +maxfps126=0 +maxfps127=0 +maxfps128=0 +maxfps129=0 +maxfps130=0 +maxfps131=0 +maxfps132=0 +maxfps133=0 +maxfps134=0 +maxfps135=0 +maxfps136=0 +maxfps137=0 +maxfps138=0 +maxfps139=0 +maxfps140=0 +maxfps141=0 +maxfps142=0 +maxfps143=0 +maxfps144=0 +maxfps145=0 +maxfps146=0 +maxfps147=0 +maxfps148=0 +maxfps149=0 +maxfps150=0 +maxfps151=0 +maxfps152=0 +maxfps153=0 +maxfps154=0 +maxfps155=0 +maxfps156=0 +maxfps157=0 +maxfps158=0 +maxfps159=0 +maxfps160=0 +maxfps161=0 +maxfps162=0 +maxfps163=0 +maxfps164=0 +maxfps165=50 +maxfps166=0 +maxfps167=0 +maxfps168=0 +maxfps169=0 +maxfps170=0 +maxfps171=0 +maxfps172=0 +maxfps173=0 +maxfps174=0 +maxfps175=0 +maxfps176=0 +maxfps177=0 +maxfps178=0 +maxfps179=0 +maxfps180=0 +maxfps181=0 +maxfps182=0 +maxfps183=0 +maxfps184=0 +maxfps185=0 +maxfps186=0 +maxfps187=0 +title188=Star Wars Episode 1 Racer +path188=C:\Games\sw racer\SWEP1RCR.EXE +module188= +ver188=0 +flag188=142606368 +flagg188=0 +tflag188=0 +initx188=0 +inity188=0 +minx188=0 +miny188=0 +maxx188=0 +maxy188=0 +posx188=50 +posy188=50 +sizx188=800 +maxfps188=0 +opengllib0= +initts0=0 +opengllib1= +initts1=-8 +opengllib2= +initts2=0 +opengllib3= +initts3=-7 +opengllib4= +initts4=-7 +opengllib5= +initts5=0 +opengllib6= +initts6=0 +opengllib7= +initts7=0 +opengllib8= +initts8=0 +opengllib9= +initts9=0 +opengllib10= +initts10=0 +opengllib11= +initts11=0 +opengllib12= +initts12=0 +opengllib13= +initts13=0 +opengllib14= +initts14=0 +opengllib15= +initts15=0 +opengllib16= +initts16=0 +opengllib17= +initts17=0 +opengllib18= +initts18=0 +opengllib19= +initts19=0 +opengllib20= +initts20=0 +opengllib21= +initts21=0 +opengllib22= +initts22=0 +opengllib23= +initts23=0 +opengllib24= +initts24=0 +opengllib25= +initts25=0 +opengllib26= +initts26=0 +opengllib27= +initts27=0 +opengllib28= +initts28=0 +opengllib29= +initts29=0 +opengllib30= +initts30=0 +opengllib31= +initts31=0 +opengllib32= +initts32=0 +opengllib33= +initts33=0 +opengllib34= +initts34=0 +opengllib35= +initts35=0 +opengllib36= +initts36=0 +opengllib37= +initts37=0 +opengllib38= +initts38=0 +opengllib39= +initts39=0 +opengllib40= +initts40=0 +opengllib41= +initts41=0 +opengllib42= +initts42=0 +opengllib43= +initts43=0 +opengllib44= +initts44=0 +opengllib45= +initts45=0 +opengllib46= +initts46=0 +opengllib47= +initts47=0 +opengllib48= +initts48=0 +opengllib49= +initts49=0 +opengllib50= +initts50=0 +opengllib51= +initts51=0 +opengllib52= +initts52=0 +opengllib53= +initts53=0 +opengllib54= +initts54=0 +opengllib55= +initts55=0 +opengllib56= +initts56=0 +opengllib57= +initts57=0 +opengllib58= +initts58=0 +opengllib59= +initts59=0 +opengllib60= +initts60=0 +opengllib61= +initts61=0 +opengllib62= +initts62=0 +opengllib63= +initts63=-5 +opengllib64= +initts64=-9 +opengllib65= +initts65=0 +opengllib66= +initts66=0 +opengllib67= +initts67=0 +opengllib68= +initts68=0 +opengllib69= +initts69=0 +opengllib70= +initts70=0 +opengllib71= +initts71=0 +opengllib72= +initts72=0 +opengllib73= +initts73=0 +opengllib74= +initts74=0 +opengllib75= +initts75=0 +opengllib76= +initts76=0 +opengllib77= +initts77=0 +opengllib78= +initts78=0 +opengllib79= +initts79=0 +opengllib80= +initts80=0 +opengllib81= +initts81=0 +opengllib82= +initts82=0 +opengllib83= +initts83=0 +opengllib84= +initts84=0 +opengllib85= +initts85=0 +opengllib86= +initts86=0 +opengllib87= +initts87=0 +opengllib88= +initts88=0 +opengllib89= +initts89=0 +opengllib90= +initts90=0 +opengllib91= +initts91=0 +opengllib92= +initts92=0 +opengllib93= +initts93=0 +opengllib94= +initts94=8 +opengllib95= +initts95=0 +opengllib96= +initts96=0 +opengllib97= +initts97=0 +opengllib98= +initts98=0 +opengllib99= +initts99=0 +opengllib100= +initts100=0 +opengllib101= +initts101=0 +opengllib102= +initts102=4 +opengllib103= +initts103=0 +opengllib104= +initts104=0 +opengllib105= +initts105=0 +opengllib106= +initts106=0 +opengllib107= +initts107=8 +opengllib108= +initts108=8 +opengllib109= +initts109=0 +opengllib110= +initts110=1 +opengllib111= +initts111=0 +opengllib112= +initts112=0 +opengllib113= +initts113=0 +opengllib114= +initts114=0 +opengllib115= +initts115=0 +opengllib116= +initts116=0 +opengllib117= +initts117=3 +opengllib118= +initts118=0 +opengllib119= +initts119=0 +opengllib120= +initts120=0 +opengllib121= +initts121=0 +opengllib122= +initts122=0 +opengllib123= +initts123=0 +opengllib124= +initts124=0 +opengllib125= +initts125=0 +opengllib126= +initts126=0 +opengllib127= +initts127=0 +opengllib128= +initts128=0 +opengllib129= +initts129=0 +opengllib130= +initts130=0 +opengllib131= +initts131=0 +opengllib132= +initts132=0 +opengllib133= +initts133=0 +opengllib134= +initts134=0 +opengllib135= +initts135=0 +opengllib136= +initts136=0 +opengllib137= +initts137=0 +opengllib138= +initts138=0 +opengllib139= +initts139=0 +opengllib140= +initts140=0 +opengllib141= +initts141=0 +opengllib142= +initts142=0 +opengllib143= +initts143=6 +opengllib144= +initts144=0 +opengllib145= +initts145=0 +opengllib146= +initts146=0 +opengllib147= +initts147=0 +opengllib148= +initts148=0 +opengllib149= +initts149=0 +opengllib150= +initts150=0 +opengllib151= +initts151=0 +opengllib152= +initts152=0 +opengllib153= +initts153=-3 +opengllib154= +initts154=0 +opengllib155= +initts155=0 +opengllib156= +initts156=0 +opengllib157= +initts157=0 +opengllib158= +initts158=0 +opengllib159= +initts159=0 +opengllib160= +initts160=0 +opengllib161= +initts161=0 +opengllib162= +initts162=0 +opengllib163= +initts163=0 +opengllib164= +initts164=0 +opengllib165= +initts165=-4 +opengllib166= +initts166=0 +opengllib167= +initts167=0 +opengllib168= +initts168=0 +opengllib169= +initts169=0 +opengllib170= +initts170=3 +opengllib171= +initts171=0 +opengllib172= +initts172=0 +opengllib173= +initts173=0 +opengllib174= +initts174=0 +opengllib175= +initts175=0 +opengllib176= +initts176=0 +opengllib177= +initts177=0 +opengllib178= +initts178=0 +opengllib179= +initts179=0 +opengllib180= +initts180=0 +opengllib181= +initts181=0 +opengllib182= +initts182=0 +opengllib183= +initts183=0 +opengllib184= +initts184=0 +opengllib185= +initts185=0 +opengllib186= +initts186=0 +opengllib187= +initts187=0 +opengllib188= +sizy188=600 +initts188=0 +title189=Star Wars Jedi Knight Jedi Academy +path189=D:\Games\Star_Wars_Jedi_Knight_Jedi_Academy\GameData\jasp.exe +module189= +opengllib189= +ver189=0 +flag189=2 +flagg189=196608 +tflag189=3 +initx189=0 +inity189=0 +minx189=0 +miny189=0 +maxx189=0 +maxy189=0 +posx189=50 +posy189=50 +sizx189=800 +sizy189=600 +maxfps189=0 +initts189=0 +title190=Star Wars: Jedi Knight +module190= +opengllib190= +path190=C:\Games\Jedi Knight\Jedi Knight\JK.EXE +ver190=0 +flag190=8226 +flagg190=0 +tflag190=0 +initx190=0 +inity190=0 +minx190=0 +miny190=0 +maxx190=0 +maxy190=0 +posx190=50 +posy190=50 +sizx190=800 +sizy190=600 +maxfps190=0 +initts190=0 +title191=Star Wars: the Gungan Frontier +path191=C:\Games\sw the gungan frontier\Gungan Frontier.exe +module191= +opengllib191= +ver191=1 +flag191=402915362 +flagg191=512 +tflag191=0 +initx191=0 +inity191=0 +minx191=0 +miny191=0 +maxx191=0 +maxy191=0 +posx191=0 +posy191=0 +sizx191=800 +sizy191=600 +maxfps191=0 +initts191=0 +title192=Starcraft +path192=D:\Games\Starcraft\StarCraft.exe +module192= +opengllib192= +ver192=0 +flag192=134234115 +flagg192=2179088 +tflag192=258 +initx192=0 +inity192=0 +minx192=0 +miny192=0 +maxx192=0 +maxy192=0 +posx192=50 +posy192=50 +sizx192=800 +sizy192=600 +maxfps192=0 +initts192=0 +title193=Starship Troopers +path193=C:\Games\Starship Troopers - Terran Ascendancy\stta\StarshipTroopers.exe +module193= +opengllib193= +ver193=1 +flag193=32 +flagg193=0 +tflag193=0 +initx193=0 +inity193=0 +minx193=0 +miny193=0 +maxx193=0 +maxy193=0 +posx193=50 +posy193=50 +sizx193=800 +sizy193=600 +maxfps193=0 +initts193=0 +title194=Starshot Space Circus +path194=D:\SpaceCircus.exe +module194= +opengllib194= +ver194=0 +flag194=66 +flagg194=0 +tflag194=0 +initx194=0 +inity194=0 +minx194=0 +miny194=0 +maxx194=0 +maxy194=0 +posx194=50 +posy194=50 +sizx194=800 +sizy194=600 +maxfps194=0 +initts194=0 +title195=Stronghold Demo +path195=C:\Games\Firefly Studios' Stronghold - Demo\Stronghold Demo.exe +module195= +opengllib195= +ver195=0 +flag195=98 +flagg195=0 +tflag195=0 +initx195=0 +inity195=0 +minx195=0 +miny195=0 +maxx195=0 +maxy195=0 +posx195=50 +posy195=50 +sizx195=800 +sizy195=600 +maxfps195=0 +initts195=0 +title196=Sub Culture +path196=C:\Games\Sub Culture\sc.exe +module196= +opengllib196= +ver196=0 +flag196=66 +flagg196=256 +tflag196=10 +initx196=50 +inity196=50 +minx196=50 +miny196=50 +maxx196=800 +maxy196=600 +posx196=50 +posy196=50 +sizx196=800 +sizy196=600 +maxfps196=0 +initts196=0 + +title197=Superbike 2001 +path197=C:\Games\Superbike 2001\Sbk2001.exe +module197= +opengllib197= +ver197=1 +flag197=536887332 +flagg197=0 +tflag197=0 +initx197=0 +inity197=0 +minx197=0 +miny197=0 +maxx197=0 +maxy197=0 +posx197=50 +posy197=50 +sizx197=800 +sizy197=600 +maxfps197=0 +initts197=0 +title198=Syberia 2 Demo +path198=C:\Games\Syberia 2 Demo\Syberia2Demo.exe +module198= +opengllib198= +ver198=8 +flag198=536887332 +flagg198=0 +tflag198=0 +initx198=0 +inity198=0 +minx198=0 +miny198=0 +maxx198=0 +maxy198=0 +posx198=50 +posy198=50 +sizx198=800 +sizy198=600 +maxfps198=0 +initts198=0 +title199=Syberia Demo +path199=C:\Games\SyberiaDemo\SyberiaDemo.exe +module199= +opengllib199= +ver199=1 +flag199=536887332 +flagg199=0 +tflag199=0 +initx199=0 +inity199=0 +minx199=0 +miny199=0 +maxx199=0 +maxy199=0 +posx199=50 +posy199=50 +sizx199=800 +sizy199=600 +maxfps199=0 +initts199=0 +title200=System Shock 2 (BAD!!!) +path200=C:\Games\Sys Shock II\Shock2.exe +module200= +opengllib200= +ver200=1 +flag200=0 +flagg200=64 +tflag200=0 +initx200=0 +inity200=0 +minx200=0 +miny200=0 +maxx200=0 +maxy200=0 +posx200=50 +posy200=50 +sizx200=800 +sizy200=600 +maxfps200=0 +initts200=0 +title201=Take no Prisoners +path201=D:\Games\Take no Prisoners\TNP.EXE +module201= +opengllib201= +ver201=0 +flag201=2 +flagg201=16777248 +tflag201=0 +initx201=0 +inity201=0 +minx201=0 +miny201=0 +maxx201=0 +maxy201=0 +posx201=50 +posy201=50 +sizx201=800 +sizy201=600 +maxfps201=0 +initts201=0 +title202=Test Drive 4 +path202=D:\Games\Test Drive 4\td4.EXE +module202= +opengllib202= +ver202=0 +flag202=-2013265885 +flagg202=-2147418094 +tflag202=2 +initx202=0 +inity202=0 +minx202=0 +miny202=0 +maxx202=0 +maxy202=0 +posx202=50 +posy202=50 +sizx202=800 +sizy202=600 +maxfps202=0 +initts202=-2 +title203=Test Drive 5 (D3D) +path203=D:\Games\Test Drive 5\TD5_D3D.exe +module203= +opengllib203= +ver203=0 +flag203=536870944 +flagg203=-2147483648 +tflag203=263 +initx203=0 +inity203=0 +minx203=0 +miny203=0 +maxx203=0 +maxy203=0 +posx203=50 +posy203=50 +sizx203=800 +sizy203=600 +maxfps203=0 +initts203=0 +title204=The Nations Demo +path204=C:\Games\The Nations Demo\bin\Game.exe +module204= +opengllib204= +ver204=1 +flag204=402661920 +flagg204=256 +tflag204=0 +initx204=0 +inity204=0 +minx204=0 +miny204=0 +maxx204=0 +maxy204=0 +posx204=50 +posy204=50 +sizx204=800 +sizy204=600 +maxfps204=0 +initts204=0 +title205=The Sims +path205=D:\Games\sims\Sims.exe +module205= +opengllib205= +ver205=0 +flag205=134226976 +flagg205=65536 +tflag205=2 +initx205=0 +inity205=0 +minx205=0 +miny205=0 +maxx205=0 +maxy205=0 +posx205=50 +posy205=50 +sizx205=800 +sizy205=600 +maxfps205=0 +initts205=0 +title206=Thief the Dark Project (FRE) +path206=C:\Games\thief\game\thieffixed.exe +module206= +opengllib206= +ver206=1 +flag206=16390 +flagg206=0 +tflag206=0 +initx206=0 +inity206=0 +minx206=0 +miny206=0 +maxx206=0 +maxy206=0 +posx206=50 +posy206=50 +sizx206=800 +sizy206=600 +maxfps206=0 +initts206=0 +title207=TinTin: Prisoners of the Sun +path207=C:\Games\tintin\TINTINW.EXE +module207= +opengllib207= +ver207=0 +flag207=34 +flagg207=0 +tflag207=2 +initx207=0 +inity207=0 +minx207=0 +miny207=0 +maxx207=0 +maxy207=0 +posx207=50 +posy207=50 +sizx207=800 +sizy207=600 +maxfps207=0 +initts207=0 +title208=Tintoy (BAD gfx) +path208=C:\Games\Tintoy\Tintoy.exe +module208= +opengllib208= +ver208=0 +flag208=546 +flagg208=256 +tflag208=258 +initx208=0 +inity208=0 +minx208=0 +miny208=0 +maxx208=0 +maxy208=0 +posx208=50 +posy208=50 +sizx208=800 +sizy208=600 +maxfps208=0 +initts208=0 +title209=Tomb Raider - Anniversary +module209= +opengllib209= +path209=C:\Games\Tomb Raider - Anniversary\tra.exe +ver209=9 +flag209=0 +flagg209=256 +tflag209=2 +initx209=0 +inity209=0 +minx209=0 +miny209=0 +maxx209=0 +maxy209=0 +posx209=50 +posy209=50 +sizx209=800 +sizy209=600 +maxfps209=0 +initts209=8 +title210=Tomb Raider 2 the Golden Mask +path210=D:\Games\TR2 Golden Mask\T2GOLD.EXE +module210= +opengllib210= +ver210=0 +flag210=570425378 +flagg210=1064960 +tflag210=258 +initx210=0 +inity210=0 +minx210=0 +miny210=0 +maxx210=0 +maxy210=0 +posx210=50 +posy210=50 +sizx210=800 +sizy210=600 +maxfps210=0 +initts210=8 +title211=Tomb Raider 3 Demo +path211=C:\Games\Tomb Raider 3 - The Lost Artifact Demo\tr3gold.exe +module211= +opengllib211= +ver211=1 +flag211=369098848 +flagg211=0 +tflag211=258 +initx211=0 +inity211=0 +minx211=0 +miny211=0 +maxx211=0 +maxy211=0 +posx211=50 +posy211=50 +sizx211=800 +sizy211=600 +maxfps211=0 +initts211=0 +title212=Tomb Raider 4 Demo +path212=C:\Games\Tomb Raider 4 - The Last Revelation (Demo)\tomb4.patched.exe +module212= +opengllib212= +ver212=0 +flag212=234881056 +flagg212=16 +tflag212=258 +initx212=0 +inity212=0 +minx212=0 +miny212=0 +maxx212=0 +maxy212=0 +posx212=50 +posy212=50 +sizx212=800 +sizy212=600 +maxfps212=0 +initts212=0 +title213=Total Annihilation Kingdoms +path213=D:\Games\Total Annihilation Kingdoms\Kingdoms.exe +module213= +opengllib213= +ver213=0 +flag213=134234146 +flagg213=1073741824 +tflag213=0 +initx213=0 +inity213=0 +minx213=0 +miny213=0 +maxx213=0 +maxy213=0 +posx213=50 +posy213=50 +sizx213=800 +sizy213=600 +maxfps213=0 +initts213=0 +title214=Total Soccer 2000 +path214=D:\Games\Total Soccer 2000\Total Soccer 2000\SOCCERDX.EXE +module214= +opengllib214= +ver214=1 +flag214=33554434 +flagg214=1069056 +tflag214=0 +initx214=0 +inity214=0 +minx214=0 +miny214=0 +maxx214=0 +maxy214=0 +posx214=50 +posy214=50 +sizx214=800 +sizy214=600 +maxfps214=200 +initts214=0 +title215=Ultim@te Race Pro +path215=C:\Games\Ultim@te race pro\Ultim@te Race Pro.exe +module215= +opengllib215= +ver215=0 +flag215=570425440 +flagg215=256 +tflag215=0 +initx215=0 +inity215=0 +minx215=0 +miny215=0 +maxx215=0 +maxy215=0 +posx215=50 +posy215=50 +sizx215=800 +sizy215=600 +maxfps215=0 +initts215=0 +title216=Uprising - Join or Die +path216=D:\Games\Uprising\uprising.exe +module216= +opengllib216= +ver216=0 +flag216=-2013265882 +flagg216=18 +tflag216=0 +initx216=0 +inity216=0 +minx216=0 +miny216=0 +maxx216=0 +maxy216=0 +posx216=50 +posy216=50 +sizx216=800 +sizy216=600 +maxfps216=0 +initts216=0 +title217=Urban Assault +path217=D:\Games\Urban Assault\UA.EXE +module217= +opengllib217= +ver217=0 +flag217=671236130 +flagg217=256 +tflag217=258 +initx217=0 +inity217=0 +minx217=0 +miny217=0 +maxx217=0 +maxy217=0 +posx217=50 +posy217=50 +sizx217=800 +sizy217=600 +maxfps217=0 +initts217=0 +title218=Urban Assault CD +module218= +opengllib218= +path218=D:\Games\Urban Assault CD\UA.EXE +ver218=0 +flag218=671236130 +flagg218=33024 +tflag218=258 +initx218=0 +inity218=0 +minx218=0 +miny218=0 +maxx218=0 +maxy218=0 +posx218=50 +posy218=50 +sizx218=800 +sizy218=600 +maxfps218=0 +initts218=0 +title219=wa[cracked].exe +path219=D:\Games\Worms 2 Armageddon\wa[cracked].exe +module219= +opengllib219= +ver219=0 +flag219=679477250 +flagg219=171966464 +tflag219=0 +initx219=0 +inity219=0 +minx219=0 +miny219=0 +maxx219=0 +maxy219=0 +posx219=50 +posy219=50 +sizx219=800 +sizy219=600 +maxfps219=0 +initts219=0 +title220=Warcraft 2 Battlenet Edition +path220=D:\Games\Warcraft 2\Warcraft II BNE.exe +module220= +opengllib220= +ver220=0 +flag220=268452003 +flagg220=16 +tflag220=258 +initx220=0 +inity220=0 +minx220=0 +miny220=0 +maxx220=0 +maxy220=0 +posx220=50 +posy220=50 +sizx220=800 +sizy220=600 +maxfps220=40 +initts220=0 +title221=Wargames (demo) +path221=D:\Games\Wargames\wargames.exe +module221= +opengllib221= +ver221=0 +flag221=268436642 +flagg221=134217728 +tflag221=3 +initx221=0 +inity221=0 +minx221=0 +miny221=0 +maxx221=0 +maxy221=0 +posx221=50 +posy221=50 +sizx221=800 +sizy221=600 +maxfps221=0 +initts221=0 +title222=WarHammer Rites of War +path222=C:\Games\Rites of War\RoW.exe +module222= +opengllib222= +ver222=0 +flag222=134217760 +flagg222=128 +tflag222=0 +initx222=0 +inity222=0 +minx222=0 +miny222=0 +maxx222=0 +maxy222=0 +posx222=50 +posy222=50 +sizx222=800 +sizy222=600 +maxfps222=0 +initts222=0 +flagh0=20 +flagi0=0 +flagh1=0 +flagi1=0 +flagh2=0 +flagi2=0 +flagh3=0 +flagi3=0 +flagh4=16 +flagi4=0 +flagh5=0 +flagi5=0 +flagh6=0 +flagi6=0 +flagh7=0 +flagi7=0 +flagh8=16 +flagi8=0 +flagh9=16 +flagi9=0 +flagh10=28 +flagi10=0 +flagh11=0 +flagi11=0 +flagh12=20 +flagi12=0 +flagh13=2 +flagi13=0 +flagh14=0 +flagi14=0 +flagh15=0 +flagi15=0 +flagh16=0 +flagi16=0 +flagh17=20 +flagi17=0 +flagh18=0 +flagi18=0 +flagh19=0 +flagi19=0 +flagh20=0 +flagi20=0 +flagh21=0 +flagi21=0 +flagh22=0 +flagi22=0 +flagh23=0 +flagi23=0 +flagh24=0 +flagi24=0 +flagh25=0 +flagi25=0 +flagh26=0 +flagi26=0 +flagh27=0 +flagi27=0 +flagh28=0 +flagi28=0 +flagh29=0 +flagi29=0 +flagh30=0 +flagi30=0 +flagh31=0 +flagi31=0 +flagh32=29 +flagi32=0 +flagh33=0 +flagi33=0 +flagh34=48 +flagi34=0 +flagh35=0 +flagi35=0 +flagh36=0 +flagi36=0 +flagh37=0 +flagi37=0 +flagh38=0 +flagi38=0 +flagh39=-842150435 +flagi39=-842150451 +flagh40=0 +flagi40=0 +flagh41=0 +flagi41=0 +flagh42=0 +flagi42=0 +flagh43=0 +flagi43=0 +flagh44=0 +flagi44=0 +flagh45=0 +flagi45=0 +flagh46=0 +flagi46=0 +flagh47=0 +flagi47=0 +flagh48=0 +flagi48=0 +flagh49=20 +flagi49=0 +flagh50=0 +flagi50=0 +flagh51=0 +flagi51=0 +flagh52=0 +flagi52=0 +flagh53=0 +flagi53=0 +flagh54=0 +flagi54=0 +flagh55=0 +flagi55=0 +flagh56=0 +flagi56=0 +flagh57=0 +flagi57=0 +flagh58=0 +flagi58=0 +flagh59=0 +flagi59=0 +flagh60=0 +flagi60=0 +flagh61=20 +flagi61=0 +flagh62=0 +flagi62=0 +flagh63=20 +flagi63=0 +flagh64=0 +flagi64=0 +flagh65=0 +flagi65=0 +flagh66=0 +flagi66=0 +flagh67=0 +flagi67=0 +flagh68=18 +flagi68=0 +flagh69=1 +flagi69=0 +flagh70=20 +flagi70=0 +flagh71=0 +flagi71=0 +flagh72=0 +flagi72=0 +flagh73=0 +flagi73=0 +flagh74=0 +flagi74=0 +flagh75=0 +flagi75=0 +flagh76=0 +flagi76=0 +flagh77=16 +flagi77=0 +flagh78=0 +flagi78=0 +flagh79=0 +flagi79=0 +flagh80=0 +flagi80=0 +flagh81=0 +flagi81=0 +flagh82=0 +flagi82=0 +flagh83=0 +flagi83=0 +flagh84=0 +flagi84=0 +flagh85=0 +flagi85=0 +flagh86=0 +flagi86=0 +flagh87=0 +flagi87=0 +flagh88=0 +flagi88=0 +flagh89=0 +flagi89=0 +flagh90=29 +flagi90=0 +flagh91=0 +flagi91=0 +flagh92=0 +flagi92=0 +flagh93=0 +flagi93=0 +flagh94=0 +flagi94=0 +flagh95=0 +flagi95=0 +flagh96=0 +flagi96=0 +flagh97=16 +flagi97=0 +flagh98=0 +flagi98=0 +flagh99=0 +flagi99=0 +flagh100=0 +flagi100=0 +flagh101=0 +flagi101=0 +flagh102=16 +flagi102=0 +flagh103=0 +flagi103=0 +flagh104=0 +flagi104=0 +flagh105=29 +flagi105=0 +flagh106=0 +flagi106=0 +flagh107=16 +flagi107=0 +flagh108=16 +flagi108=0 +flagh109=0 +flagi109=0 +flagh110=0 +flagi110=0 +flagh111=0 +flagi111=0 +flagh112=0 +flagi112=0 +flagh113=0 +flagi113=0 +flagh114=0 +flagi114=0 +flagh115=0 +flagi115=0 +flagh116=0 +flagi116=0 +flagh117=0 +flagi117=0 +flagh118=16 +flagi118=0 +flagh119=0 +flagi119=0 +flagh120=0 +flagi120=0 +flagh121=0 +flagi121=0 +flagh122=0 +flagi122=0 +flagh123=0 +flagi123=0 +flagh124=0 +flagi124=0 +flagh125=0 +flagi125=0 +flagh126=0 +flagi126=0 +flagh127=0 +flagi127=0 +flagh128=0 +flagi128=0 +flagh129=0 +flagi129=0 +flagh130=0 +flagi130=0 +flagh131=0 +flagi131=0 +flagh132=0 +flagi132=0 +flagh133=0 +flagi133=0 +flagh134=0 +flagi134=0 +flagh135=0 +flagi135=0 +flagh136=0 +flagi136=0 +flagh137=0 +flagi137=0 +flagh138=0 +flagi138=0 +flagh139=0 +flagi139=0 +flagh140=29 +flagi140=0 +flagh141=0 +flagi141=0 +flagh142=0 +flagi142=0 +flagh143=60 +flagi143=0 +flagh144=61 +flagi144=0 +flagh145=61 +flagi145=0 +flagh146=0 +flagi146=0 +flagh147=0 +flagi147=0 +flagh148=16 +flagi148=0 +flagh149=0 +flagi149=0 +flagh150=0 +flagi150=0 +flagh151=0 +flagi151=0 +flagh152=0 +flagi152=0 +flagh153=20 +flagi153=0 +flagh154=0 +flagi154=0 +flagh155=0 +flagi155=0 +flagh156=0 +flagi156=0 +flagh157=0 +flagi157=0 +flagh158=0 +flagi158=0 +flagh159=0 +flagi159=0 +flagh160=0 +flagi160=0 +flagh161=0 +flagi161=0 +flagh162=0 +flagi162=0 +flagh163=0 +flagi163=0 +flagh164=0 +flagi164=0 +flagh165=0 +flagi165=0 +flagh166=0 +flagi166=0 +flagh167=0 +flagi167=0 +flagh168=0 +flagi168=0 +flagh169=0 +flagi169=0 +flagh170=0 +flagi170=0 +flagh171=0 +flagi171=0 +flagh172=0 +flagi172=0 +flagh173=0 +flagi173=0 +flagh174=0 +flagi174=0 +flagh175=0 +flagi175=0 +flagh176=0 +flagi176=0 +flagh177=0 +flagi177=0 +flagh178=0 +flagi178=0 +flagh179=0 +flagi179=0 +flagh180=0 +flagi180=0 +flagh181=0 +flagi181=0 +flagh182=0 +flagi182=0 +flagh183=0 +flagi183=0 +flagh184=0 +flagi184=0 +flagh185=0 +flagi185=0 +flagh186=0 +flagi186=0 +flagh187=0 +flagi187=0 +flagh188=0 +flagi188=0 +flagh189=20 +flagi189=0 +flagh190=0 +flagi190=0 +flagh191=0 +flagi191=0 +flagh192=0 +flagi192=0 +flagh193=0 +flagi193=0 +flagh194=0 +flagi194=0 +flagh195=0 +flagi195=0 +flagh196=0 +flagi196=0 +flagh197=0 +flagi197=0 +flagh198=0 +flagi198=0 +flagh199=0 +flagi199=0 +flagh200=0 +flagi200=0 +flagh201=0 +flagi201=0 +flagh202=0 +flagi202=0 +flagh203=2 +flagi203=0 +flagh204=0 +flagi204=0 +flagh205=16 +flagi205=0 +flagh206=0 +flagi206=0 +flagh207=0 +flagi207=0 +flagh208=0 +flagi208=0 +flagh209=0 +flagi209=0 +flagh210=0 +flagi210=0 +flagh211=0 +flagi211=0 +flagh212=0 +flagi212=0 +flagh213=16 +flagi213=0 +flagh214=0 +flagi214=0 +flagh215=0 +flagi215=0 +flagh216=0 +flagi216=0 +flagh217=16 +flagi217=0 +flagh218=0 +flagi218=0 +flagh219=0 +flagi219=0 +flagh220=16 +flagi220=0 +flagh221=0 +flagi221=0 +flagh222=0 +flagi222=0 +title223=Warlords 3 +path223=D:\Games\WARLORDS3\Darklord.exe +module223= +opengllib223= +ver223=0 +flag223=-2013264350 +flagg223=286261280 +flagh223=0 +flagi223=0 +tflag223=259 +initx223=0 +inity223=0 +minx223=0 +miny223=0 +maxx223=0 +maxy223=0 +posx223=50 +posy223=50 +sizx223=0 +sizy223=0 +maxfps223=0 +initts223=0 +title224=WarTorn +path224=C:\Games\WarTorn\W.exe +module224= +opengllib224= +ver224=0 +flag224=32 +flagg224=0 +flagh224=0 +flagi224=0 +tflag224=0 +initx224=0 +inity224=0 +minx224=0 +miny224=0 +maxx224=0 +maxy224=0 +posx224=50 +posy224=50 +sizx224=800 +sizy224=600 +maxfps224=0 +initts224=0 +title225=WarWind +path225=C:\Games\WarWind\WW.EXE +module225= +opengllib225= +ver225=0 +flag225=16418 +flagg225=81936 +flagh225=0 +flagi225=0 +tflag225=0 +initx225=0 +inity225=0 +minx225=0 +miny225=0 +maxx225=0 +maxy225=0 +posx225=50 +posy225=50 +sizx225=800 +sizy225=600 +maxfps225=0 +initts225=0 +title226=Worms Armageddon Demo (BAD!!!) +path226=C:\Games\Worms Armageddon Demo\WaDemo.exe +module226= +opengllib226= +ver226=1 +flag226=939524099 +flagg226=8 +flagh226=0 +flagi226=0 +tflag226=2 +initx226=0 +inity226=0 +minx226=0 +miny226=0 +maxx226=0 +maxy226=0 +posx226=0 +posy226=0 +sizx226=0 +sizy226=0 +maxfps226=0 +initts226=0 +title227=Worms World Party +path227=D:\Games\Worms World Party\wwp.exe +module227= +opengllib227= +ver227=1 +flag227=8388610 +flagg227=0 +flagh227=0 +flagi227=0 +tflag227=0 +initx227=0 +inity227=0 +minx227=0 +miny227=0 +maxx227=0 +maxy227=0 +posx227=50 +posy227=50 +sizx227=800 +sizy227=600 +maxfps227=0 +initts227=0 +title228=Worms World Party Demo (BAD) +path228=C:\Games\WWP Demo\wwp.exe +module228=MFC42.DLL ltkrn10N.dll +opengllib228= +ver228=1 +flag228=406847491 +flagg228=8 +flagh228=0 +flagi228=0 +tflag228=2 +initx228=0 +inity228=0 +minx228=0 +miny228=0 +maxx228=0 +maxy228=0 +posx228=0 +posy228=0 +sizx228=0 +sizy228=0 +maxfps228=0 +initts228=0 +title229=X-Com Enforcer +path229=C:\Games\X-Com Enforcer\System\xcom.exe +module229= +opengllib229= +ver229=1 +flag229=32 +flagg229=0 +flagh229=0 +flagi229=0 +tflag229=0 +initx229=0 +inity229=0 +minx229=0 +miny229=0 +maxx229=0 +maxy229=0 +posx229=0 +posy229=0 +sizx229=800 +sizy229=600 +maxfps229=0 +initts229=0 +title230=X-Com Interceptor +module230= +opengllib230= +title231=Z Steel Soldiers +module231= +opengllib231= +path230=C:\Games\X-Com_Interceptor\X-COM Interceptor\Interceptor.exe +ver230=0 +flag230=16418 +flagg230=0 +flagh230=0 +flagi230=0 +tflag230=0 +initx230=0 +inity230=0 +minx230=0 +miny230=0 +maxx230=0 +maxy230=0 +posx230=50 +posy230=50 +sizx230=800 +sizy230=600 +maxfps230=0 +initts230=0 +path231=C:\Games\ZSteelSoldiers\Bin\z2.exe +ver231=8 +flag231=805462020 +flagg231=0 +flagh231=0 +flagi231=0 +tflag231=0 +initx231=0 +inity231=0 +minx231=0 +miny231=0 +maxx231=0 +maxy231=0 +posx231=50 +posy231=50 +sizx231=800 +sizy231=600 +maxfps231=0 +initts231=0 +title232=Zax Alien Hunter +path232=C:\Games\ZaxDemo\Zax.exe +module232= +opengllib232= +ver232=0 +flag232=-1476386784 +flagg232=0 +flagh232=0 +flagi232=0 +tflag232=0 +initx232=0 +inity232=0 +minx232=0 +miny232=0 +maxx232=0 +maxy232=0 +posx232=50 +posy232=50 +sizx232=800 +sizy232=600 +maxfps232=0 +initts232=0 +title233=Zero Critical (BAD) +path233=C:\Games\zero_critical_-_satin_rift\ZEROCR.EXE +module233= +opengllib233= +ver233=0 +flag233=679477858 +flagg233=8 +flagh233=0 +flagi233=0 +tflag233=0 +initx233=0 +inity233=0 +minx233=0 +miny233=0 +maxx233=0 +maxy233=0 +posx233=0 +posy233=0 +sizx233=800 +sizy233=600 +maxfps233=0 +initts233=0 +title234=Zero Population Count +path234=C:\Games\ZPC\ZPC.EXE +module234= +opengllib234= +ver234=0 +flag234=1073741859 +flagg234=0 +flagh234=0 +flagi234=0 +tflag234=0 +initx234=0 +inity234=0 +minx234=0 +miny234=0 +maxx234=0 +maxy234=0 +posx234=0 +posy234=0 +sizx234=800 +sizy234=600 +maxfps234=0 +initts234=0 +coord0=0 +coord1=0 +coord2=0 +coord3=0 +coord4=0 +coord5=0 +coord6=0 +coord7=0 +coord8=0 +coord9=0 +coord10=1 +coord11=0 +coord12=0 +coord13=0 +coord14=0 +coord15=0 +coord16=0 +coord17=0 +coord18=0 +coord19=0 +coord20=0 +coord21=0 +coord22=0 +coord23=0 +coord24=0 +coord25=0 +coord26=0 +coord27=0 +coord28=0 +coord29=0 +coord30=0 +coord31=0 +coord32=0 +coord33=0 +coord34=0 +coord35=0 +coord36=0 +coord37=0 +coord38=0 +coord39=0 +coord40=0 +coord41=0 +coord42=0 +coord43=0 +coord44=0 +coord45=0 +coord46=0 +coord47=0 +coord48=0 +coord49=0 +coord50=0 +coord51=0 +coord52=0 +coord53=0 +coord54=0 +coord55=0 +coord56=0 +coord57=0 +coord58=0 +coord59=0 +coord60=0 +coord61=0 +coord62=0 +coord63=0 +coord64=0 +coord65=0 +coord66=0 +coord67=0 +coord68=0 +coord69=0 +coord70=0 +coord71=0 +coord72=0 +coord73=0 +coord74=0 +coord75=0 +coord76=0 +coord77=0 +coord78=0 +coord79=0 +coord80=0 +coord81=0 +coord82=0 +coord83=0 +coord84=0 +coord85=0 +coord86=0 +coord87=0 +coord88=0 +coord89=0 +coord90=0 +coord91=0 +coord92=0 +coord93=0 +coord94=0 +coord95=0 +coord96=0 +coord97=0 +coord98=0 +coord99=0 +coord100=0 +coord101=0 +coord102=0 +coord103=0 +coord104=0 +coord105=0 +coord106=0 +coord107=0 +coord108=0 +coord109=0 +coord110=0 +coord111=0 +coord112=0 +coord113=0 +coord114=0 +coord115=0 +coord116=0 +coord117=0 +coord118=0 +coord119=0 +coord120=0 +coord121=0 +coord122=0 +coord123=0 +coord124=0 +coord125=0 +coord126=0 +coord127=0 +coord128=0 +coord129=0 +coord130=0 +coord131=0 +coord132=0 +coord133=0 +coord134=0 +coord135=0 +coord136=0 +coord137=0 +coord138=0 +coord139=0 +coord140=0 +coord141=0 +coord142=0 +coord143=0 +coord144=0 +coord145=0 +coord146=0 +coord147=0 +coord148=0 +coord149=0 +coord150=0 +coord151=0 +coord152=0 +coord153=0 +coord154=0 +coord155=0 +coord156=0 +coord157=0 +coord158=0 +coord159=0 +coord160=0 +coord161=0 +coord162=0 +coord163=0 +coord164=0 +coord165=0 +coord166=0 +coord167=0 +coord168=0 +coord169=0 +coord170=0 +coord171=0 +coord172=0 +coord173=0 +coord174=0 +coord175=0 +coord176=0 +coord177=0 +coord178=0 +coord179=0 +coord180=0 +coord181=0 +coord182=0 +coord183=0 +coord184=0 +coord185=0 +coord186=0 +coord187=0 +coord188=0 +coord189=0 +coord190=0 +coord191=0 +coord192=1 +coord193=0 +coord194=0 +coord195=0 +coord196=0 +coord197=0 +coord198=0 +coord199=0 +coord200=0 +coord201=0 +coord202=0 +coord203=0 +coord204=0 +coord205=0 +coord206=0 +coord207=0 +coord208=0 +coord209=0 +coord210=0 +coord211=0 +coord212=0 +coord213=1 +coord214=0 +coord215=0 +coord216=0 +coord217=0 +coord218=0 +coord219=0 +coord220=0 +coord221=0 +coord222=0 +coord223=0 +coord224=0 +coord225=0 +coord226=0 +coord227=0 +coord228=0 +coord229=0 +coord230=0 +coord231=0 +coord232=0 +coord233=0 +coord234=0 +title235=Zero Zone +path235=D:\ZZone\ZeroZone.exe +module235= +opengllib235= +ver235=0 +coord235=0 +flag235=34 +flagg235=0 +flagh235=0 +flagi235=0 +tflag235=0 +initx235=0 +inity235=0 +minx235=0 +miny235=0 +maxx235=0 +maxy235=0 +posx235=50 +posy235=50 +sizx235=800 +sizy235=600 +maxfps235=0 +initts235=0 +title236=Zeus Poseidon +path236=C:\Games\Zeus-Poseidon\Zeus.exe +module236= +opengllib236= +ver236=0 +coord236=0 +flag236=34 +flagg236=0 +flagh236=0 +flagi236=0 +tflag236=0 +initx236=0 +inity236=0 +minx236=0 +miny236=0 +maxx236=0 +maxy236=0 +posx236=50 +posy236=50 +sizx236=800 +sizy236=600 +maxfps236=0 +initts236=0 +title237=Zoo Tycoon +path237=C:\Games\Zoo Tycoon\zoo.exe +module237= +opengllib237= +ver237=0 +coord237=0 +flag237=-2013265886 +flagg237=0 +flagh237=0 +flagi237=0 +tflag237=0 +initx237=0 +inity237=0 +minx237=0 +miny237=0 +maxx237=0 +maxy237=0 +posx237=50 +posy237=50 +sizx237=800 +sizy237=600 +maxfps237=0 +initts237=0 [window] -posx=2 -posy=2 -sizx=300 -sizy=138 +posx=851 +posy=329 +sizx=435 +sizy=299 diff --git a/build/dxwnd_manual.pdf b/build/dxwnd_manual.pdf new file mode 100644 index 0000000..e9a606b Binary files /dev/null and b/build/dxwnd_manual.pdf differ diff --git a/build/readme-relnotes.txt b/build/readme-relnotes.txt index 20df778..4c9af22 100644 --- a/build/readme-relnotes.txt +++ b/build/readme-relnotes.txt @@ -120,3 +120,12 @@ Some code rearrangement v2.02.21 it's a w.i.p. release, wait 'till finished.... +v2.02.22 +Major code rearrangement in API hooking. Expect some troubles... +Added desktop workarea and centered coordinate settings +Fixed imelib hooking +Added HOOKENABLED flag +Fixed ChangeDisplaySettings +GUI: added ListView icons +GUI: added pause command +GUI: updated commands layout diff --git a/build/v2_02_22_build.rar b/build/v2_02_22_build.rar new file mode 100644 index 0000000..fd35067 Binary files /dev/null and b/build/v2_02_22_build.rar differ diff --git a/dll/dxdiaghook.cpp b/dll/dxdiaghook.cpp index e6e95ae..b37f2ef 100644 --- a/dll/dxdiaghook.cpp +++ b/dll/dxdiaghook.cpp @@ -43,9 +43,7 @@ HRESULT HookDxDiag(REFIID riid, LPVOID FAR* ppv) OutTraceD("CoCreateInstance: CLSID_DxDiagProvider object\n"); dxdlib=(*pLoadLibraryA)("dxdiagn.dll"); OutTraceD("CoCreateInstance: dxdiagn lib handle=%x\n", dxdlib); - extern void HookSysLibs(HMODULE); extern void HookModule(HMODULE, int); - //HookSysLibs(dxdlib); HookModule(dxdlib, 0); switch (*(DWORD *)&riid){ diff --git a/dll/dxhelper.cpp b/dll/dxhelper.cpp index f7087b7..c97099b 100644 --- a/dll/dxhelper.cpp +++ b/dll/dxhelper.cpp @@ -999,3 +999,44 @@ char *ExplainLoadLibFlags(DWORD c) else strcpy(eb,"NULL"); return(eb); } + +char *ExplainDevModeFields(DWORD c) +{ + static char eb[512]; + unsigned int l; + strcpy(eb,"DM_"); + if (c & DM_ORIENTATION) strcat(eb, "ORIENTATION+"); + if (c & DM_PAPERSIZE) strcat(eb, "PAPERSIZE+"); + if (c & DM_PAPERLENGTH) strcat(eb, "PAPERLENGTH+"); + if (c & DM_PAPERWIDTH) strcat(eb, "PAPERWIDTH+"); + if (c & DM_SCALE) strcat(eb, "SCALE+"); + if (c & DM_COPIES) strcat(eb, "COPIES+"); + if (c & DM_DEFAULTSOURCE) strcat(eb, "DEFAULTSOURCE+"); + if (c & DM_PRINTQUALITY) strcat(eb, "PRINTQUALITY+"); + if (c & DM_POSITION) strcat(eb, "POSITION+"); + if (c & DM_DISPLAYORIENTATION) strcat(eb, "DISPLAYORIENTATION+"); + if (c & DM_DISPLAYFIXEDOUTPUT) strcat(eb, "DISPLAYFIXEDOUTPUT+"); + if (c & DM_COLOR) strcat(eb, "COLOR+"); + if (c & DM_DUPLEX) strcat(eb, "DUPLEX+"); + if (c & DM_YRESOLUTION) strcat(eb, "YRESOLUTION+"); + if (c & DM_TTOPTION) strcat(eb, "TTOPTION+"); + if (c & DM_COLLATE) strcat(eb, "COLLATE+"); + if (c & DM_FORMNAME) strcat(eb, "FORMNAME+"); + if (c & DM_LOGPIXELS) strcat(eb, "LOGPIXELS+"); + if (c & DM_BITSPERPEL) strcat(eb, "BITSPERPEL+"); + if (c & DM_PELSWIDTH) strcat(eb, "PELSWIDTH+"); + if (c & DM_PELSHEIGHT) strcat(eb, "PELSHEIGHT+"); + if (c & DM_DISPLAYFLAGS) strcat(eb, "DISPLAYFLAGS+"); + if (c & DM_NUP) strcat(eb, "NUP+"); + if (c & DM_DISPLAYFREQUENCY) strcat(eb, "DISPLAYFREQUENCY+"); + if (c & DM_ICMMETHOD) strcat(eb, "ICMMETHOD+"); + if (c & DM_ICMINTENT) strcat(eb, "ICMINTENT+"); + if (c & DM_MEDIATYPE) strcat(eb, "MEDIATYPE+"); + if (c & DM_DITHERTYPE) strcat(eb, "DITHERTYPE+"); + if (c & DM_PANNINGWIDTH) strcat(eb, "PANNINGWIDTH+"); + if (c & DM_PANNINGHEIGHT) strcat(eb, "PANNINGHEIGHT+"); + l=strlen(eb); + if (l>strlen("DM_")) eb[l-1]=0; // delete last '+' if any + else strcpy(eb,"NULL"); + return(eb); +} diff --git a/dll/dxhelper.h b/dll/dxhelper.h index e1c2113..5f00983 100644 --- a/dll/dxhelper.h +++ b/dll/dxhelper.h @@ -29,4 +29,5 @@ extern char *ExplainNChitTest(DWORD); extern char *ExplainDDEnumerateFlags(DWORD); extern char *ExplainsSystemMetrics(DWORD); extern char *ExplainWPFlags(DWORD); -extern char *ExplainLoadLibFlags(DWORD); \ No newline at end of file +extern char *ExplainLoadLibFlags(DWORD); +extern char *ExplainDevModeFields(DWORD); diff --git a/dll/dxhook.cpp b/dll/dxhook.cpp index 98dba3d..273f1bf 100644 --- a/dll/dxhook.cpp +++ b/dll/dxhook.cpp @@ -280,6 +280,7 @@ void SetHook(void *target, void *hookproc, void **hookedproc, char *hookname) static DWORD MinHook=0xFFFFFFFF; static DWORD MaxHook=0; + OutTraceB("SetHook: DEBUG target=%x, proc=%x name=%s\n", target, hookproc, hookname); // keep track of hooked call range to avoid re-hooking of hooked addresses !!! if ((DWORD)hookproc < MinHook) MinHook=(DWORD)hookproc; if ((DWORD)hookproc > MaxHook) MaxHook=(DWORD)hookproc; @@ -316,6 +317,9 @@ void *HookAPI(HMODULE module, char *dll, void *apiproc, const char *apiname, voi DWORD oldprotect; void *org; + OutTraceB("HookAPI: module=%x dll=%s apiproc=%x apiname=%s hookproc=%x\n", + module, dll, apiproc, apiname, hookproc); + if(!*apiname) { // check char *sMsg="HookAPI: NULL api name\n"; OutTraceE(sMsg); @@ -401,19 +405,55 @@ void *HookAPI(HMODULE module, char *dll, void *apiproc, const char *apiname, voi void CalculateWindowPos(HWND hwnd, DWORD width, DWORD height, LPWINDOWPOS wp) { - RECT rect; + RECT rect, desktop, workarea; DWORD dwStyle; int MaxX, MaxY; HMENU hMenu; - rect.left = dxw.iPosX; - rect.top = dxw.iPosY; //v2.02.09 - MaxX = dxw.iSizX; - MaxY = dxw.iSizY; - if (!MaxX) MaxX = width; - if (!MaxY) MaxY = height; - rect.right = dxw.iPosX+MaxX; - rect.bottom = dxw.iPosY+MaxY; //v2.02.09 + switch(dxw.Coordinates){ + case DXW_DESKTOP_CENTER: + MaxX = dxw.iSizX; + MaxY = dxw.iSizY; + if (!MaxX) MaxX = width; + if (!MaxY) MaxY = height; + //GetClientRect(0, &desktop); + (*pGetClientRect)(GetDesktopWindow(), &desktop); + rect.left = (desktop.right - MaxX) / 2; + rect.top = (desktop.bottom - MaxY) / 2; + rect.right = rect.left + MaxX; + rect.bottom = rect.top + MaxY; //v2.02.09 + break; + case DXW_DESKTOP_WORKAREA: + SystemParametersInfo(SPI_GETWORKAREA, NULL, &workarea, 0); + rect = workarea; + if (dxw.dwFlags2 & KEEPASPECTRATIO) { + int w, h, b; // width, height and border + w = workarea.right - workarea.left; + h = workarea.bottom - workarea.top; + if ((w * 600) > (h * 800)){ + b = (w - (h * 800 / 600))/2; + rect.left = workarea.left + b; + rect.right = workarea.right - b; + } + else { + b = (h - (w * 600 / 800))/2; + rect.top = workarea.top + b; + rect.bottom = workarea.bottom - b; + } + } + break; + case DXW_SET_COORDINATES: + default: + rect.left = dxw.iPosX; + rect.top = dxw.iPosY; //v2.02.09 + MaxX = dxw.iSizX; + MaxY = dxw.iSizY; + if (!MaxX) MaxX = width; + if (!MaxY) MaxY = height; + rect.right = dxw.iPosX + MaxX; + rect.bottom = dxw.iPosY + MaxY; //v2.02.09 + break; + } dwStyle=(*pGetWindowLong)(hwnd, GWL_STYLE); hMenu = GetMenu(hwnd); @@ -455,16 +495,18 @@ void AdjustWindowFrame(HWND hwnd, DWORD width, DWORD height) HRESULT res=0; WNDPROC pWindowProc; + LONG style; - OutTraceD("AdjustWindowFrame hwnd=%x, size=(%d,%d)\n", hwnd, width, height); + OutTraceD("AdjustWindowFrame hwnd=%x, size=(%d,%d) coord=%d\n", hwnd, width, height, dxw.Coordinates); dxw.SetScreenSize(width, height); if (hwnd==NULL) return; - (*pSetWindowLong)(hwnd, GWL_STYLE, (dxw.dwFlags2 & MODALSTYLE) ? 0 : WS_OVERLAPPEDWINDOW); + style = ((dxw.dwFlags2 & MODALSTYLE) || (dxw.Coordinates == DXW_DESKTOP_WORKAREA)) ? 0 : WS_OVERLAPPEDWINDOW; + (*pSetWindowLong)(hwnd, GWL_STYLE, style); (*pSetWindowLong)(hwnd, GWL_EXSTYLE, 0); (*pShowWindow)(hwnd, SW_SHOWNORMAL); - OutTraceD("AdjustWindowFrame hwnd=%x, set style=%s extstyle=0\n", hwnd, (dxw.dwFlags2 & MODALSTYLE) ? "0" : "WS_OVERLAPPEDWINDOW"); + OutTraceD("AdjustWindowFrame hwnd=%x, set style=%s extstyle=0\n", hwnd, (style == 0) ? "0" : "WS_OVERLAPPEDWINDOW"); AdjustWindowPos(hwnd, width, height); // fixing windows message handling procedure @@ -1053,138 +1095,6 @@ void HookGDILib(HMODULE module) } } -void HookSysLibs(HMODULE module) -{ - void *tmp; - - OutTraceD("HookSysLibs module=%x\n", module); - - tmp = HookAPI(module, "kernel32.dll", GetProcAddress, "GetProcAddress", extGetProcAddress); - if(tmp) pGetProcAddress = (GetProcAddress_Type)tmp; - tmp = HookAPI(module, "kernel32.dll", LoadLibraryA, "LoadLibraryA", extLoadLibraryA); - if(tmp) pLoadLibraryA = (LoadLibraryA_Type)tmp; - tmp = HookAPI(module, "kernel32.dll", LoadLibraryExA, "LoadLibraryExA", extLoadLibraryExA); - if(tmp) pLoadLibraryExA = (LoadLibraryExA_Type)tmp; - tmp = HookAPI(module, "kernel32.dll", LoadLibraryW, "LoadLibraryW", extLoadLibraryW); - if(tmp) pLoadLibraryW = (LoadLibraryW_Type)tmp; - tmp = HookAPI(module, "kernel32.dll", LoadLibraryExW, "LoadLibraryExW", extLoadLibraryExW); - if(tmp) pLoadLibraryExW = (LoadLibraryExW_Type)tmp; - - tmp = HookAPI(module, "user32.dll", BeginPaint, "BeginPaint", extBeginPaint); - if(tmp) pBeginPaint = (BeginPaint_Type)tmp; - tmp = HookAPI(module, "user32.dll", EndPaint, "EndPaint", extEndPaint); - if(tmp) pEndPaint = (EndPaint_Type)tmp; - tmp = HookAPI(module, "user32.dll", ShowCursor, "ShowCursor", extShowCursor); - if(tmp) pShowCursor = (ShowCursor_Type)tmp; - if(dxw.dwFlags1 & MAPGDITOPRIMARY){ - tmp = HookAPI(module, "user32.dll", GetDC, "GetDC", extDDGetDC); - if(tmp) pGDIGetDC = (GDIGetDC_Type)tmp; - tmp = HookAPI(module, "user32.dll", GetWindowDC, "GetWindowDC", extDDGetWindowDC); - if(tmp) pGDIGetWindowDC = (GDIGetDC_Type)tmp; - tmp = HookAPI(module, "user32.dll", ReleaseDC, "ReleaseDC", extDDReleaseDC); - if(tmp) pGDIReleaseDC = (GDIReleaseDC_Type)tmp; - tmp = HookAPI(module, "user32.dll", InvalidateRect, "InvalidateRect", extDDInvalidateRect); - if(tmp) pInvalidateRect = (InvalidateRect_Type)tmp; - } - else{ - tmp = HookAPI(module, "user32.dll", GetDC, "GetDC", extGDIGetDC); - if(tmp) pGDIGetDC = (GDIGetDC_Type)tmp; - tmp = HookAPI(module, "user32.dll", GetWindowDC, "GetWindowDC", extGDIGetWindowDC); - if(tmp) pGDIGetWindowDC = (GDIGetDC_Type)tmp; - tmp = HookAPI(module, "user32.dll", ReleaseDC, "ReleaseDC", extGDIReleaseDC); - if(tmp) pGDIReleaseDC = (GDIReleaseDC_Type)tmp; - tmp = HookAPI(module, "user32.dll", InvalidateRect, "InvalidateRect", extInvalidateRect); - if(tmp) pInvalidateRect = (InvalidateRect_Type)tmp; - } - - if (dxw.dwFlags1 & CLIENTREMAPPING){ - tmp = HookAPI(module, "user32.dll", ScreenToClient, "ScreenToClient", extScreenToClient); - if(tmp) pScreenToClient = (ScreenToClient_Type)tmp; - tmp = HookAPI(module, "user32.dll", ClientToScreen, "ClientToScreen", extClientToScreen); - if(tmp) pClientToScreen = (ClientToScreen_Type)tmp; - tmp = HookAPI(module, "user32.dll", GetClientRect, "GetClientRect", extGetClientRect); - if(tmp) pGetClientRect = (GetClientRect_Type)tmp; - tmp = HookAPI(module, "user32.dll", GetWindowRect, "GetWindowRect", extGetWindowRect); - if(tmp) pGetWindowRect = (GetWindowRect_Type)tmp; - tmp = HookAPI(module, "user32.dll", MapWindowPoints, "MapWindowPoints", extMapWindowPoints); - if(tmp) pMapWindowPoints = (MapWindowPoints_Type)tmp; - } - - // get / change display settings - tmp = HookAPI(module, "user32.dll", ChangeDisplaySettingsA, "ChangeDisplaySettingsA", extChangeDisplaySettings); - if(tmp) pChangeDisplaySettings = (ChangeDisplaySettings_Type)tmp; - tmp = HookAPI(module, "user32.dll", ChangeDisplaySettingsExA, "ChangeDisplaySettingsExA", extChangeDisplaySettingsEx); - if(tmp) pChangeDisplaySettingsEx = (ChangeDisplaySettingsEx_Type)tmp; - tmp = HookAPI(module, "user32.dll", EnumDisplaySettingsA, "EnumDisplaySettingsA", extEnumDisplaySettings); - if(tmp) pEnumDisplaySettings = (EnumDisplaySettings_Type)tmp; - - // handle cursor clipping - tmp = HookAPI(module, "user32.dll", GetClipCursor, "GetClipCursor", extGetClipCursor); - if(tmp) pGetClipCursor = (GetClipCursor_Type)tmp; - - tmp = HookAPI(module, "user32.dll", ClipCursor, "ClipCursor", extClipCursor); - if(tmp) pClipCursor = (ClipCursor_Type)tmp; - tmp = HookAPI(module, "user32.dll", FillRect, "FillRect", extFillRect); - if(tmp) pFillRect = (FillRect_Type)tmp; - if (dxw.dwFlags1 & MESSAGEPROC) { - tmp = HookAPI(module, "user32.dll", PeekMessageA, "PeekMessageA", extPeekMessage); // added for GPL - if(tmp) pPeekMessage = (PeekMessage_Type)tmp; - tmp = HookAPI(module, "user32.dll", GetMessageA, "GetMessageA", extGetMessage); // added for GPL - if(tmp) pGetMessage = (GetMessage_Type)tmp; - } - tmp = HookAPI(module, "user32.dll", DefWindowProcA, "DefWindowProcA", extDefWindowProc); // added for WarWind background erase - if(tmp) pDefWindowProc = (DefWindowProc_Type)tmp; - tmp = HookAPI(module, "user32.dll", CreateWindowExA, "CreateWindowExA", extCreateWindowExA); - if(tmp) pCreateWindowExA = (CreateWindowExA_Type)tmp; - tmp = HookAPI(module, "user32.dll", RegisterClassExA, "RegisterClassExA", extRegisterClassExA); - if(tmp) pRegisterClassExA = (RegisterClassExA_Type)tmp; - if (dxw.dwFlags1 & (PREVENTMAXIMIZE|FIXWINFRAME|LOCKWINPOS|LOCKWINSTYLE)){ - tmp = HookAPI(module, "user32.dll", ShowWindow, "ShowWindow", extShowWindow); - if(tmp) pShowWindow = (ShowWindow_Type)tmp; - tmp = HookAPI(module, "user32.dll", SetWindowLongA, "SetWindowLongA", extSetWindowLong); - if(tmp) pSetWindowLong = (SetWindowLong_Type)tmp; - tmp = HookAPI(module, "user32.dll", GetWindowLongA, "GetWindowLongA", extGetWindowLong); - if(tmp) pGetWindowLong = (GetWindowLong_Type)tmp; - tmp = HookAPI(module, "user32.dll", SetWindowPos, "SetWindowPos", extSetWindowPos); - if(tmp) pSetWindowPos = (SetWindowPos_Type)tmp; - tmp = HookAPI(module, "user32.dll", DeferWindowPos, "DeferWindowPos", extDeferWindowPos); - if(tmp) pGDIDeferWindowPos = (DeferWindowPos_Type)tmp; - tmp = HookAPI(module, "user32.dll", CallWindowProcA, "CallWindowProcA", extCallWindowProc); - if(tmp) pCallWindowProc = (CallWindowProc_Type)tmp; - } - tmp = HookAPI(module, "user32.dll", GetSystemMetrics, "GetSystemMetrics", extGetSystemMetrics); - if(tmp) pGetSystemMetrics = (GetSystemMetrics_Type)tmp; - - tmp = HookAPI(module, "user32.dll", GetDesktopWindow, "GetDesktopWindow", extGetDesktopWindow); - if(tmp) pGetDesktopWindow = (GetDesktopWindow_Type)tmp; - - if(dxw.dwFlags1 & MODIFYMOUSE){ - tmp = HookAPI(module, "user32.dll", GetCursorPos, "GetCursorPos", extGetCursorPos); - if(tmp) pGetCursorPos = (GetCursorPos_Type)tmp; - //tmp = HookAPI(module, "user32.dll", GetPhysicalCursorPos, "", extGetCursorPos); - tmp = HookAPI(module, "user32.dll", SetCursor, "SetCursor", extSetCursor); - if(tmp) pSetCursor = (SetCursor_Type)tmp; - //tmp = HookAPI(module, "user32.dll", SetPhysicalCursorPos, "", extSetCursorPos); - tmp = HookAPI(module, "user32.dll", SendMessageA, "SendMessageA", extSendMessage); - if(tmp) pSendMessage = (SendMessage_Type)tmp; - } - - if((dxw.dwFlags1 & (MODIFYMOUSE|SLOWDOWN|KEEPCURSORWITHIN)) || (dxw.dwFlags2 & KEEPCURSORFIXED)){ - tmp = HookAPI(module, "user32.dll", SetCursorPos, "SetCursorPos", extSetCursorPos); - if(tmp) pSetCursorPos = (SetCursorPos_Type)tmp; - } - - tmp = HookAPI(module, "user32.dll", CreateDialogIndirectParamA, "CreateDialogIndirectParamA", extCreateDialogIndirectParam); - if(tmp) pCreateDialogIndirectParam = (CreateDialogIndirectParam_Type)tmp; - tmp = HookAPI(module, "user32.dll", CreateDialogParamA, "CreateDialogParamA", extCreateDialogParam); - if(tmp) pCreateDialogParam = (CreateDialogParam_Type)tmp; - tmp = HookAPI(module, "user32.dll", MoveWindow, "MoveWindow", extMoveWindow); - if(tmp) pMoveWindow = (MoveWindow_Type)tmp; - - HookKernel32(module); - return; -} - static void RecoverScreenMode() { DEVMODE InitDevMode; @@ -1281,13 +1191,15 @@ void HookExceptionHandler(void) void HookModule(HMODULE base, int dxversion) { - HookSysLibs(base); + HookKernel32(base); + HookUser32(base); + HookWinMM(base); //if(dxw.dwFlags2 & SUPPRESSIME) HookImeLib(module); if(dxw.dwFlags2 & HOOKGDI) HookGDILib(base); if(dxw.dwFlags1 & HOOKDI) HookDirectInput(base, dxversion); HookDirectDraw(base, dxversion); HookDirect3D(base, dxversion); - HookOle32(base, dxversion); // unfinished business + HookOle32(base); if(dxw.dwFlags2 & HOOKOPENGL) HookOpenGLLibs(base, dxw.CustomOpenGLLib); HookMSV4WLibs(base); } @@ -1440,3 +1352,30 @@ LPCSTR ProcToString(LPCSTR proc) else return proc; } + +FARPROC RemapLibrary(LPCSTR proc, HMODULE hModule, HookEntry_Type *Hooks) +{ + int i; + HookEntry_Type *Hook; + for(i=0; Hooks[i].APIName; i++){ + Hook=&Hooks[i]; + if (!strcmp(proc,Hook->APIName)){ + if (Hook->StoreAddress) *(Hook->StoreAddress)=(*pGetProcAddress)(hModule, proc); + OutTraceD("GetProcAddress: hooking proc=%s at addr=%x\n", ProcToString(proc), (Hook->StoreAddress) ? *(Hook->StoreAddress) : 0); + return Hook->HookerAddress; + } + } + return NULL; +} + +void HookLibrary(HMODULE hModule, HookEntry_Type *Hooks, char *DLLName) +{ + int i; + void *tmp; + HookEntry_Type *Hook; + for(i=0; Hooks[i].APIName; i++){ + Hook=&Hooks[i]; + tmp = HookAPI(hModule, DLLName, Hook->OriginalAddress, Hook->APIName, Hook->HookerAddress); + if(tmp) *(Hook->StoreAddress) = (FARPROC)tmp; + } +} diff --git a/dll/dxhook.h b/dll/dxhook.h index e0f2ba9..a40dbc1 100644 --- a/dll/dxhook.h +++ b/dll/dxhook.h @@ -1,10 +1,12 @@ extern int HookDirectDraw(HMODULE, int); extern int HookDDProxy(HMODULE, int); extern int HookDirect3D(HMODULE, int); -extern int HookOle32(HMODULE, int); +extern void HookOle32(HMODULE); extern int HookDirectInput(HMODULE, int); extern void HookImeLib(HMODULE); extern void HookKernel32(HMODULE); +extern void HookUser32(HMODULE); +extern void HookWinMM(HMODULE); extern void InitPosition(int, int, int, int, int, int); //void InitWindowPos(int, int, int, int); @@ -22,4 +24,16 @@ extern FARPROC Remap_smack_ProcAddress(LPCSTR, HMODULE); extern FARPROC Remap_user32_ProcAddress(LPCSTR, HMODULE); extern FARPROC Remap_kernel32_ProcAddress(LPCSTR, HMODULE); extern FARPROC Remap_ole32_ProcAddress(LPCSTR, HMODULE); +extern FARPROC Remap_trust_ProcAddress(LPCSTR, HMODULE); +extern FARPROC Remap_WinMM_ProcAddress(LPCSTR, HMODULE); +extern FARPROC Remap_ImeLib_ProcAddress(LPCSTR, HMODULE); +typedef struct { + char *APIName; + FARPROC OriginalAddress; + FARPROC *StoreAddress; + FARPROC HookerAddress; +} HookEntry_Type; + +extern FARPROC RemapLibrary(LPCSTR, HMODULE, HookEntry_Type *); +extern void HookLibrary(HMODULE, HookEntry_Type *, char *); diff --git a/dll/dxkernel32.cpp b/dll/dxkernel32.cpp index 1b516aa..01904f3 100644 --- a/dll/dxkernel32.cpp +++ b/dll/dxkernel32.cpp @@ -3,111 +3,66 @@ #include "syslibs.h" #include "dxhook.h" +static HookEntry_Type Hooks[]={ + {"IsDebuggerPresent", (FARPROC)NULL, (FARPROC *)NULL, (FARPROC)extIsDebuggerPresent}, + {"GlobalMemoryStatus", (FARPROC)GlobalMemoryStatus, (FARPROC *)&pGlobalMemoryStatus, (FARPROC)extGlobalMemoryStatus}, + {"GetProcAddress", (FARPROC)GetProcAddress, (FARPROC *)&pGetProcAddress, (FARPROC)extGetProcAddress}, + {"LoadLibraryA", (FARPROC)LoadLibraryA, (FARPROC *)&pLoadLibraryA, (FARPROC)extLoadLibraryA}, + {"LoadLibraryExA", (FARPROC)LoadLibraryExA, (FARPROC *)&pLoadLibraryExA, (FARPROC)extLoadLibraryExA}, + {"LoadLibraryW", (FARPROC)LoadLibraryW, (FARPROC *)&pLoadLibraryW, (FARPROC)extLoadLibraryW}, + {"LoadLibraryExW", (FARPROC)LoadLibraryExW, (FARPROC *)&pLoadLibraryExW, (FARPROC)extLoadLibraryExW}, + {0, NULL, 0, 0} // terminator +}; + +static HookEntry_Type LimitHooks[]={ + {"GetDiskFreeSpaceA", (FARPROC)GetDiskFreeSpaceA, (FARPROC *)&pGetDiskFreeSpaceA, (FARPROC)extGetDiskFreeSpaceA}, + {"GlobalMemoryStatus", (FARPROC)GlobalMemoryStatus, (FARPROC *)&pGlobalMemoryStatus, (FARPROC)extGlobalMemoryStatus}, + {0, NULL, 0, 0} // terminator +}; + +static HookEntry_Type TimeHooks[]={ + {"GetTickCount", (FARPROC)GetTickCount, (FARPROC *)&pGetTickCount, (FARPROC)extGetTickCount}, + {"GetLocalTime", (FARPROC)GetLocalTime, (FARPROC *)&pGetLocalTime, (FARPROC)extGetLocalTime}, + {"GetSystemTime", (FARPROC)GetSystemTime, (FARPROC *)&pGetSystemTime, (FARPROC)extGetSystemTime}, + {"GetSystemTimeAsFileTime", (FARPROC)GetSystemTimeAsFileTime, (FARPROC *)&pGetSystemTimeAsFileTime, (FARPROC)extGetSystemTimeAsFileTime}, + {"Sleep", (FARPROC)Sleep, (FARPROC *)&pSleep, (FARPROC)extSleep}, + {"SleepEx", (FARPROC)SleepEx, (FARPROC *)&pSleepEx, (FARPROC)extSleepEx}, + {"SetTimer", (FARPROC)SetTimer, (FARPROC *)&pSetTimer, (FARPROC)extSetTimer}, + {0, NULL, 0, 0} // terminator +}; + +static HookEntry_Type VersionHooks[]={ + {"GetVersion", (FARPROC)GetVersion, (FARPROC *)&pGetVersion, (FARPROC)extGetVersion}, + {"GetVersionEx", (FARPROC)GetVersionEx, (FARPROC *)&pGetVersionEx, (FARPROC)extGetVersionEx}, + {0, NULL, 0, 0} // terminator +}; + void HookKernel32(HMODULE module) { - void *tmp; + HookLibrary(module, Hooks, "kernel32.dll"); - if(dxw.dwFlags2 & LIMITRESOURCES){ - tmp = HookAPI(module, "kernel32.dll", GetDiskFreeSpaceA, "GetDiskFreeSpaceA", extGetDiskFreeSpaceA); - if(tmp) pGetDiskFreeSpaceA = (GetDiskFreeSpaceA_Type)tmp; - tmp = HookAPI(module, "kernel32.dll", GlobalMemoryStatus, "GlobalMemoryStatus", extGlobalMemoryStatus); - if(tmp) pGlobalMemoryStatus = (GlobalMemoryStatus_Type)tmp; - } + if(dxw.dwFlags2 & LIMITRESOURCES) HookLibrary(module, LimitHooks, "kernel32.dll"); + + if(dxw.dwFlags2 & LIMITRESOURCES) HookLibrary(module, TimeHooks, "kernel32.dll"); - if(dxw.dwFlags2 & TIMESTRETCH){ - tmp = HookAPI(module, "kernel32.dll", GetTickCount, "GetTickCount", extGetTickCount); - if(tmp) pGetTickCount = (GetTickCount_Type)tmp; - tmp = HookAPI(module, "kernel32.dll", GetLocalTime, "GetLocalTime", extGetLocalTime); - if(tmp) pGetLocalTime = (GetLocalTime_Type)tmp; - tmp = HookAPI(module, "kernel32.dll", GetSystemTime, "GetSystemTime", extGetSystemTime); - if(tmp) pGetSystemTime = (GetSystemTime_Type)tmp; - tmp = HookAPI(module, "kernel32.dll", GetSystemTimeAsFileTime, "GetSystemTimeAsFileTime", extGetSystemTimeAsFileTime); - if(tmp) pGetSystemTimeAsFileTime = (GetSystemTimeAsFileTime_Type)tmp; - tmp = HookAPI(module, "kernel32.dll", Sleep, "Sleep", extSleep); - if(tmp) pSleep = (Sleep_Type)tmp; - tmp = HookAPI(module, "kernel32.dll", SleepEx, "SleepEx", extSleepEx); - if(tmp) pSleepEx = (SleepEx_Type)tmp; - tmp = HookAPI(module, "user32.dll", SetTimer, "SetTimer", extSetTimer); - if(tmp) pSetTimer = (SetTimer_Type)tmp; - tmp = HookAPI(module, "winmm.dll", NULL, "timeGetTime", exttimeGetTime); - if(tmp) ptimeGetTime = (timeGetTime_Type)tmp; - } - - if(dxw.dwFlags2 & FAKEVERSION){ - tmp = HookAPI(module, "kernel32.dll", GetVersion, "GetVersion", extGetVersion); - if(tmp) pGetVersion = (GetVersion_Type)tmp; - tmp = HookAPI(module, "kernel32.dll", GetVersionEx, "GetVersionEx", extGetVersionEx); - if(tmp) pGetVersionEx = (GetVersionEx_Type)tmp; - } + if(dxw.dwFlags2 & FAKEVERSION) HookLibrary(module, VersionHooks, "kernel32.dll"); } FARPROC Remap_kernel32_ProcAddress(LPCSTR proc, HMODULE hModule) { - if (!strcmp(proc,"IsDebuggerPresent")){ - OutTraceD("GetProcAddress: hooking proc=%s at addr=%x\n", ProcToString(proc), extIsDebuggerPresent); - return (FARPROC)extIsDebuggerPresent; - } - if(dxw.dwFlags2 & LIMITRESOURCES){ - if (!strcmp(proc,"GetDiskFreeSpaceA")){ - pGetDiskFreeSpaceA=(GetDiskFreeSpaceA_Type)(*pGetProcAddress)(hModule, proc); - OutTraceD("GetProcAddress: hooking proc=%s at addr=%x\n", ProcToString(proc), extGetDiskFreeSpaceA); - return (FARPROC)extGetDiskFreeSpaceA; - } - if (!strcmp(proc,"GlobalMemoryStatus")){ - pGlobalMemoryStatus=(GlobalMemoryStatus_Type)(*pGetProcAddress)(hModule, proc); - OutTraceD("GetProcAddress: hooking proc=%s at addr=%x\n", ProcToString(proc), extGlobalMemoryStatus); - return (FARPROC)extGlobalMemoryStatus; - } - } - if(dxw.dwFlags2 & TIMESTRETCH){ - if (!strcmp(proc,"GetTickCount")){ - pGetTickCount=(GetTickCount_Type)(*pGetProcAddress)(hModule, proc); - OutTraceD("GetProcAddress: hooking proc=%s at addr=%x\n", ProcToString(proc), extGetTickCount); - return (FARPROC)extGetTickCount; - } - if (!strcmp(proc,"GetLocalTime")){ - pGetLocalTime=(GetLocalTime_Type)(*pGetProcAddress)(hModule, proc); - OutTraceD("GetProcAddress: hooking proc=%s at addr=%x\n", ProcToString(proc), extGetLocalTime); - return (FARPROC)extGetLocalTime; - } - if (!strcmp(proc,"GetSystemTime")){ - pGetSystemTime=(GetSystemTime_Type)(*pGetProcAddress)(hModule, proc); - OutTraceD("GetProcAddress: hooking proc=%s at addr=%x\n", ProcToString(proc), extGetSystemTime); - return (FARPROC)extGetSystemTime; - } - if (!strcmp(proc,"GetSystemTimeAsFileTime")){ - pGetSystemTimeAsFileTime=(GetSystemTimeAsFileTime_Type)(*pGetProcAddress)(hModule, proc); - OutTraceD("GetProcAddress: hooking proc=%s at addr=%x\n", ProcToString(proc), extGetSystemTimeAsFileTime); - return (FARPROC)extGetSystemTimeAsFileTime; - } - if (!strcmp(proc,"Sleep")){ - pSleep=(Sleep_Type)(*pGetProcAddress)(hModule, proc); - OutTraceD("GetProcAddress: hooking proc=%s at addr=%x\n", ProcToString(proc), extSleep); - return (FARPROC)extSleep; - } - if (!strcmp(proc,"SleepEx")){ - pSleepEx=(SleepEx_Type)(*pGetProcAddress)(hModule, proc); - OutTraceD("GetProcAddress: hooking proc=%s at addr=%x\n", ProcToString(proc), extSleepEx); - return (FARPROC)extSleepEx; - } - if (!strcmp(proc,"SetTimer")){ - pSetTimer=(SetTimer_Type)(*pGetProcAddress)(hModule, proc); - OutTraceD("GetProcAddress: hooking proc=%s at addr=%x\n", ProcToString(proc), extSetTimer); - return (FARPROC)extSetTimer; - } - } - if(dxw.dwFlags2 & FAKEVERSION){ - if (!strcmp(proc,"GetVersion")){ - pGetVersion=(GetVersion_Type)(*pGetProcAddress)(hModule, proc); - OutTraceD("GetProcAddress: hooking proc=%s at addr=%x\n", ProcToString(proc), extGetVersion); - return (FARPROC)extGetVersion; - } - if (!strcmp(proc,"GetVersionEx")){ - pGetVersionEx=(GetVersionEx_Type)(*pGetProcAddress)(hModule, proc); - OutTraceD("GetProcAddress: hooking proc=%s at addr=%x\n", ProcToString(proc), extGetVersionEx); - return (FARPROC)extGetVersionEx; - } - } + FARPROC addr; + + if (addr=RemapLibrary(proc, hModule, Hooks)) return addr; + + if(dxw.dwFlags2 & LIMITRESOURCES) + if (addr=RemapLibrary(proc, hModule, LimitHooks)) return addr; + + if(dxw.dwFlags2 & TIMESTRETCH) + if (addr=RemapLibrary(proc, hModule, TimeHooks)) return addr; + + if(dxw.dwFlags2 & FAKEVERSION) + if (addr=RemapLibrary(proc, hModule, VersionHooks)) return addr; + return NULL; } diff --git a/dll/dxole32.cpp b/dll/dxole32.cpp index 6778c96..edc6796 100644 --- a/dll/dxole32.cpp +++ b/dll/dxole32.cpp @@ -5,16 +5,24 @@ #include "dxhook.h" #include "dxhelper.h" +static HookEntry_Type Hooks[]={ + {"CoCreateInstance", NULL, (FARPROC *)&pCoCreateInstance, (FARPROC)extCoCreateInstance}, + // {"CoCreateInstanceEx", NULL, (FARPROC *)&pCoCreateInstanceEx, (FARPROC)extCoCreateInstanceEx}, remote object creation.... + {0, NULL, 0, 0} // terminator +}; + extern HRESULT WINAPI extDirectDrawCreate(GUID FAR *, LPDIRECTDRAW FAR *, IUnknown FAR *); extern HRESULT WINAPI extDirectDrawCreateEx(GUID FAR *, LPDIRECTDRAW FAR *, REFIID, IUnknown FAR *); +void HookOle32(HMODULE module) +{ + HookLibrary(module, Hooks, "ole32.dll"); +} + FARPROC Remap_ole32_ProcAddress(LPCSTR proc, HMODULE hModule) { - if (!strcmp(proc,"CoCreateInstance")){ - pCoCreateInstance=(CoCreateInstance_Type)(*pGetProcAddress)(hModule, proc); - OutTraceD("GetProcAddress: hooking proc=%s at addr=%x\n", ProcToString(proc), pCoCreateInstance); - return (FARPROC)extCoCreateInstance; - } + FARPROC addr; + if (addr=RemapLibrary(proc, hModule, Hooks)) return addr; return NULL; } @@ -24,7 +32,6 @@ FARPROC Remap_ole32_ProcAddress(LPCSTR proc, HMODULE hModule) // ------------------------------------------------------------------------------------- static void HookDDSession(LPDIRECTDRAW *, int); -//CoCreateInstance_Type pCoCreateInstance=NULL; HRESULT STDAPICALLTYPE extCoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID riid, LPVOID FAR* ppv) { @@ -39,8 +46,9 @@ HRESULT STDAPICALLTYPE extCoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, OutTraceD("CoCreateInstance: CLSID_FilterGraph RIID=%x\n", *(DWORD *)&riid); qlib=(*pLoadLibraryA)("quartz.dll"); OutTraceD("CoCreateInstance: quartz lib handle=%x\n", qlib); - extern void HookSysLibs(HMODULE); - HookSysLibs(qlib); + HookKernel32(qlib); + HookUser32(qlib); + HookWinMM(qlib); } res=(*pCoCreateInstance)(rclsid, pUnkOuter, dwClsContext, riid, ppv); @@ -87,14 +95,3 @@ HRESULT STDAPICALLTYPE extCoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, return res; } - -int HookOle32(HMODULE module, int version) -{ - // used by Axis & Allies .... - void *tmp; - //return 0; - OutTraceD("HookOle32 version=%d\n", version); //GHO - tmp = HookAPI(module, "ole32.dll", NULL, "CoCreateInstance", extCoCreateInstance); - if(tmp) pCoCreateInstance = (CoCreateInstance_Type)tmp; - return 0; -} diff --git a/dll/dxuser32.cpp b/dll/dxuser32.cpp index fa1e24a..f877f1b 100644 --- a/dll/dxuser32.cpp +++ b/dll/dxuser32.cpp @@ -3,138 +3,117 @@ #include "syslibs.h" #include "dxhook.h" +static HookEntry_Type Hooks[]={ + {"ChangeDisplaySettingsA", NULL, (FARPROC *)&pChangeDisplaySettings, (FARPROC)extChangeDisplaySettings}, + {"ChangeDisplaySettingsExA", NULL, (FARPROC *)&pChangeDisplaySettingsEx, (FARPROC)extChangeDisplaySettingsEx}, + {"BeginPaint", NULL, (FARPROC *)&pBeginPaint, (FARPROC)&extBeginPaint}, + {"EndPaint", NULL, (FARPROC *)&pEndPaint, (FARPROC)extEndPaint}, + {"ShowCursor", NULL, (FARPROC *)&pShowCursor, (FARPROC)extShowCursor}, + {"CreateDialogIndirectParamA", NULL, (FARPROC *)&pCreateDialogIndirectParam, (FARPROC)extCreateDialogIndirectParam}, + {"CreateDialogParamA", NULL, (FARPROC *)&pCreateDialogParam, (FARPROC)extCreateDialogParam}, + {"MoveWindow", NULL, (FARPROC *)&pMoveWindow, (FARPROC)extMoveWindow}, + {"ChangeDisplaySettingsA", NULL, (FARPROC *)&pChangeDisplaySettings, (FARPROC)extChangeDisplaySettings}, + {"ChangeDisplaySettingsExA", NULL, (FARPROC *)&pChangeDisplaySettingsEx, (FARPROC)extChangeDisplaySettingsEx}, + {"EnumDisplaySettingsA", NULL, (FARPROC *)&pEnumDisplaySettings, (FARPROC)extEnumDisplaySettings}, + {"GetClipCursor", NULL, (FARPROC *)&pGetClipCursor, (FARPROC)extGetClipCursor}, + {"ClipCursor", NULL, (FARPROC *)&pClipCursor, (FARPROC)extClipCursor}, + {"FillRect", NULL, (FARPROC *)&pClipCursor, (FARPROC)extFillRect}, + {"DefWindowProcA", NULL, (FARPROC *)&pDefWindowProc, (FARPROC)extDefWindowProc}, + {"CreateWindowExA", NULL, (FARPROC *)&pCreateWindowExA, (FARPROC)extCreateWindowExA}, + {"RegisterClassExA", NULL, (FARPROC *)&pRegisterClassExA, (FARPROC)extRegisterClassExA}, + {"GetSystemMetrics", NULL, (FARPROC *)&pGetSystemMetrics, (FARPROC)extGetSystemMetrics}, + {"GetDesktopWindow", NULL, (FARPROC *)&pGetDesktopWindow, (FARPROC)extGetDesktopWindow}, + {0, NULL, 0, 0} // terminator +}; + +static HookEntry_Type DDHooks[]={ + {"GetDC", NULL, (FARPROC *)&pGDIGetDC, (FARPROC)extDDGetDC}, + {"GetWindowDC", NULL, (FARPROC *)&pGDIGetWindowDC, (FARPROC)extDDGetDC}, + {"ReleaseDC", NULL, (FARPROC *)&pGDIReleaseDC, (FARPROC)extDDReleaseDC}, + {"InvalidateRect", NULL, (FARPROC *)&pInvalidateRect, (FARPROC)extDDInvalidateRect}, + {0, NULL, 0, 0} // terminator +}; + +static HookEntry_Type GDIHooks[]={ + {"GetDC", NULL, (FARPROC *)&pGDIGetDC, (FARPROC)extGDIGetDC}, + {"GetWindowDC", NULL, (FARPROC *)&pGDIGetWindowDC, (FARPROC)extGDIGetDC}, + {"ReleaseDC", NULL, (FARPROC *)&pGDIReleaseDC, (FARPROC)extGDIReleaseDC}, + {"InvalidateRect", NULL, (FARPROC *)&pInvalidateRect, (FARPROC)extInvalidateRect}, + {0, NULL, 0, 0} // terminator +}; + +static HookEntry_Type RemapHooks[]={ + {"ScreenToClient", NULL, (FARPROC *)&pScreenToClient, (FARPROC)extScreenToClient}, + {"ClientToScreen", NULL, (FARPROC *)&pClientToScreen, (FARPROC)extClientToScreen}, + {"GetClientRect", NULL, (FARPROC *)&pGetClientRect, (FARPROC)extGetClientRect}, + {"GetWindowRect", NULL, (FARPROC *)&pGetWindowRect, (FARPROC)extGetWindowRect}, + {"MapWindowPoints", NULL, (FARPROC *)&pMapWindowPoints, (FARPROC)extMapWindowPoints}, + {0, NULL, 0, 0} // terminator +}; + +static HookEntry_Type MessageHooks[]={ + {"PeekMessageA", NULL, (FARPROC *)&pPeekMessage, (FARPROC)extPeekMessage}, + {"GetMessageA", NULL, (FARPROC *)&pGetMessage, (FARPROC)extGetMessage}, + {0, NULL, 0, 0} // terminator +}; + +static HookEntry_Type MouseHooks[]={ + {"GetCursorPos", NULL, (FARPROC *)&pGetCursorPos, (FARPROC)extGetCursorPos}, + {"SetCursor", NULL, (FARPROC *)&pSetCursor, (FARPROC)extSetCursor}, + {"SendMessageA", NULL, (FARPROC *)&pSendMessage, (FARPROC)extSendMessage}, // ??? + //{"SetPhysicalCursorPos", NULL, (FARPROC *)&pSetCursor, (FARPROC)extSetCursor}, // ??? + {0, NULL, 0, 0} // terminator +}; + +static HookEntry_Type WinHooks[]={ + {"ShowWindow", NULL, (FARPROC *)&pShowWindow, (FARPROC)extShowWindow}, + {"SetWindowLongA", (FARPROC)SetWindowLongA, (FARPROC *)&pSetWindowLong, (FARPROC)extSetWindowLong}, + {"GetWindowLongA", (FARPROC)GetWindowLongA, (FARPROC *)&pGetWindowLong, (FARPROC)extGetWindowLong}, + {"SetWindowPos", (FARPROC)SetWindowPos, (FARPROC *)&pSetWindowPos, (FARPROC)extSetWindowPos}, + {"DeferWindowPos", (FARPROC)DeferWindowPos, (FARPROC *)&pGDIDeferWindowPos, (FARPROC)extDeferWindowPos}, + {"CallWindowProcA", (FARPROC)CallWindowProcA, (FARPROC *)&pCallWindowProc, (FARPROC)extCallWindowProc}, + {0, NULL, 0, 0} // terminator +}; + +static HookEntry_Type MouseHooks2[]={ + {"SetCursorPos", (FARPROC)SetCursorPos, (FARPROC *)&pSetCursorPos, (FARPROC)extSetCursorPos}, + {0, NULL, 0, 0} // terminator +}; + FARPROC Remap_user32_ProcAddress(LPCSTR proc, HMODULE hModule) { - if (!strcmp(proc,"ChangeDisplaySettingsA")){ - pChangeDisplaySettings=(ChangeDisplaySettings_Type)(*pGetProcAddress)(hModule, proc); - OutTraceD("GetProcAddress: hooking proc=%s at addr=%x\n", ProcToString(proc), pChangeDisplaySettings); - return (FARPROC)extChangeDisplaySettings; - } - if (!strcmp(proc,"ChangeDisplaySettingsExA")){ - pChangeDisplaySettingsEx=(ChangeDisplaySettingsEx_Type)(*pGetProcAddress)(hModule, proc); - OutTraceD("GetProcAddress: hooking proc=%s at addr=%x\n", ProcToString(proc), pChangeDisplaySettingsEx); - return (FARPROC)extChangeDisplaySettingsEx; - } - if (!strcmp(proc,"BeginPaint")){ - pBeginPaint=(BeginPaint_Type)(*pGetProcAddress)(hModule, proc); - OutTraceD("GetProcAddress: hooking proc=%s at addr=%x\n", ProcToString(proc), pBeginPaint); - return (FARPROC)extBeginPaint; - } - if (!strcmp(proc,"EndPaint")){ - pEndPaint=(EndPaint_Type)(*pGetProcAddress)(hModule, proc); - OutTraceD("GetProcAddress: hooking proc=%s at addr=%x\n", ProcToString(proc), pEndPaint); - return (FARPROC)extEndPaint; - } - if (!strcmp(proc,"ShowCursor")){ - pShowCursor=(ShowCursor_Type)(*pGetProcAddress)(hModule, proc); - OutTraceD("GetProcAddress: hooking proc=%s at addr=%x\n", ProcToString(proc), pShowCursor); - return (FARPROC)extShowCursor; - } - /* - if(dxw.dwFlags1 & MAPGDITOPRIMARY){ - tmp = HookAPI(module, "user32.dll", GetDC, "GetDC", extDDGetDC); - if(tmp) pGDIGetDC = (GDIGetDC_Type)tmp; - tmp = HookAPI(module, "user32.dll", GetWindowDC, "GetWindowDC", extDDGetWindowDC); - if(tmp) pGDIGetWindowDC = (GDIGetDC_Type)tmp; - tmp = HookAPI(module, "user32.dll", ReleaseDC, "ReleaseDC", extDDReleaseDC); - if(tmp) pGDIReleaseDC = (GDIReleaseDC_Type)tmp; - tmp = HookAPI(module, "user32.dll", InvalidateRect, "InvalidateRect", extDDInvalidateRect); - if(tmp) pInvalidateRect = (InvalidateRect_Type)tmp; - } - else{ - tmp = HookAPI(module, "user32.dll", GetDC, "GetDC", extGDIGetDC); - if(tmp) pGDIGetDC = (GDIGetDC_Type)tmp; - tmp = HookAPI(module, "user32.dll", GetWindowDC, "GetWindowDC", extGDIGetWindowDC); - if(tmp) pGDIGetWindowDC = (GDIGetDC_Type)tmp; - tmp = HookAPI(module, "user32.dll", ReleaseDC, "ReleaseDC", extGDIReleaseDC); - if(tmp) pGDIReleaseDC = (GDIReleaseDC_Type)tmp; - tmp = HookAPI(module, "user32.dll", InvalidateRect, "InvalidateRect", extInvalidateRect); - if(tmp) pInvalidateRect = (InvalidateRect_Type)tmp; - } + FARPROC addr; + if (addr=RemapLibrary(proc, hModule, Hooks)) return addr; + + if (addr=RemapLibrary(proc, hModule, (dxw.dwFlags1 & MAPGDITOPRIMARY) ? DDHooks : GDIHooks)) return addr; - if (dxw.dwFlags1 & CLIENTREMAPPING){ - tmp = HookAPI(module, "user32.dll", ScreenToClient, "ScreenToClient", extScreenToClient); - if(tmp) pScreenToClient = (ScreenToClient_Type)tmp; - tmp = HookAPI(module, "user32.dll", ClientToScreen, "ClientToScreen", extClientToScreen); - if(tmp) pClientToScreen = (ClientToScreen_Type)tmp; - tmp = HookAPI(module, "user32.dll", GetClientRect, "GetClientRect", extGetClientRect); - if(tmp) pGetClientRect = (GetClientRect_Type)tmp; - tmp = HookAPI(module, "user32.dll", GetWindowRect, "GetWindowRect", extGetWindowRect); - if(tmp) pGetWindowRect = (GetWindowRect_Type)tmp; - tmp = HookAPI(module, "user32.dll", MapWindowPoints, "MapWindowPoints", extMapWindowPoints); - if(tmp) pMapWindowPoints = (MapWindowPoints_Type)tmp; - } + if (dxw.dwFlags1 & CLIENTREMAPPING) + if (addr=RemapLibrary(proc, hModule, RemapHooks)) return addr; - // get / change display settings - tmp = HookAPI(module, "user32.dll", ChangeDisplaySettingsA, "ChangeDisplaySettingsA", extChangeDisplaySettings); - if(tmp) pChangeDisplaySettings = (ChangeDisplaySettings_Type)tmp; - tmp = HookAPI(module, "user32.dll", ChangeDisplaySettingsExA, "ChangeDisplaySettingsExA", extChangeDisplaySettingsEx); - if(tmp) pChangeDisplaySettingsEx = (ChangeDisplaySettingsEx_Type)tmp; - tmp = HookAPI(module, "user32.dll", EnumDisplaySettingsA, "EnumDisplaySettingsA", extEnumDisplaySettings); - if(tmp) pEnumDisplaySettings = (EnumDisplaySettings_Type)tmp; + if (dxw.dwFlags1 & MESSAGEPROC) + if (addr=RemapLibrary(proc, hModule, MessageHooks)) return addr; - // handle cursor clipping - tmp = HookAPI(module, "user32.dll", GetClipCursor, "GetClipCursor", extGetClipCursor); - if(tmp) pGetClipCursor = (GetClipCursor_Type)tmp; + if(dxw.dwFlags1 & MODIFYMOUSE) + if (addr=RemapLibrary(proc, hModule, MouseHooks)) return addr; - tmp = HookAPI(module, "user32.dll", ClipCursor, "ClipCursor", extClipCursor); - if(tmp) pClipCursor = (ClipCursor_Type)tmp; - tmp = HookAPI(module, "user32.dll", FillRect, "FillRect", extFillRect); - if(tmp) pFillRect = (FillRect_Type)tmp; - if (dxw.dwFlags1 & MESSAGEPROC) { - tmp = HookAPI(module, "user32.dll", PeekMessageA, "PeekMessageA", extPeekMessage); // added for GPL - if(tmp) pPeekMessage = (PeekMessage_Type)tmp; - tmp = HookAPI(module, "user32.dll", GetMessageA, "GetMessageA", extGetMessage); // added for GPL - if(tmp) pGetMessage = (GetMessage_Type)tmp; - } - tmp = HookAPI(module, "user32.dll", DefWindowProcA, "DefWindowProcA", extDefWindowProc); // added for WarWind background erase - if(tmp) pDefWindowProc = (DefWindowProc_Type)tmp; - tmp = HookAPI(module, "user32.dll", CreateWindowExA, "CreateWindowExA", extCreateWindowExA); - if(tmp) pCreateWindowExA = (CreateWindowExA_Type)tmp; - tmp = HookAPI(module, "user32.dll", RegisterClassExA, "RegisterClassExA", extRegisterClassExA); - if(tmp) pRegisterClassExA = (RegisterClassExA_Type)tmp; - if (dxw.dwFlags1 & (PREVENTMAXIMIZE|FIXWINFRAME|LOCKWINPOS|LOCKWINSTYLE)){ - tmp = HookAPI(module, "user32.dll", ShowWindow, "ShowWindow", extShowWindow); - if(tmp) pShowWindow = (ShowWindow_Type)tmp; - tmp = HookAPI(module, "user32.dll", SetWindowLongA, "SetWindowLongA", extSetWindowLong); - if(tmp) pSetWindowLong = (SetWindowLong_Type)tmp; - tmp = HookAPI(module, "user32.dll", GetWindowLongA, "GetWindowLongA", extGetWindowLong); - if(tmp) pGetWindowLong = (GetWindowLong_Type)tmp; - tmp = HookAPI(module, "user32.dll", SetWindowPos, "SetWindowPos", extSetWindowPos); - if(tmp) pSetWindowPos = (SetWindowPos_Type)tmp; - tmp = HookAPI(module, "user32.dll", DeferWindowPos, "DeferWindowPos", extDeferWindowPos); - if(tmp) pGDIDeferWindowPos = (DeferWindowPos_Type)tmp; - tmp = HookAPI(module, "user32.dll", CallWindowProcA, "CallWindowProcA", extCallWindowProc); - if(tmp) pCallWindowProc = (CallWindowProc_Type)tmp; - } - tmp = HookAPI(module, "user32.dll", GetSystemMetrics, "GetSystemMetrics", extGetSystemMetrics); - if(tmp) pGetSystemMetrics = (GetSystemMetrics_Type)tmp; + if (dxw.dwFlags1 & (PREVENTMAXIMIZE|FIXWINFRAME|LOCKWINPOS|LOCKWINSTYLE)) + if (addr=RemapLibrary(proc, hModule, WinHooks)) return addr; - tmp = HookAPI(module, "user32.dll", GetDesktopWindow, "GetDesktopWindow", extGetDesktopWindow); - if(tmp) pGetDesktopWindow = (GetDesktopWindow_Type)tmp; + if((dxw.dwFlags1 & (MODIFYMOUSE|SLOWDOWN|KEEPCURSORWITHIN)) || (dxw.dwFlags2 & KEEPCURSORFIXED)) + if (addr=RemapLibrary(proc, hModule, MouseHooks2)) return addr; - if(dxw.dwFlags1 & MODIFYMOUSE){ - tmp = HookAPI(module, "user32.dll", GetCursorPos, "GetCursorPos", extGetCursorPos); - if(tmp) pGetCursorPos = (GetCursorPos_Type)tmp; - //tmp = HookAPI(module, "user32.dll", GetPhysicalCursorPos, "", extGetCursorPos); - tmp = HookAPI(module, "user32.dll", SetCursor, "SetCursor", extSetCursor); - if(tmp) pSetCursor = (SetCursor_Type)tmp; - //tmp = HookAPI(module, "user32.dll", SetPhysicalCursorPos, "", extSetCursorPos); - tmp = HookAPI(module, "user32.dll", SendMessageA, "SendMessageA", extSendMessage); - if(tmp) pSendMessage = (SendMessage_Type)tmp; - } - - if((dxw.dwFlags1 & (MODIFYMOUSE|SLOWDOWN|KEEPCURSORWITHIN)) || (dxw.dwFlags2 & KEEPCURSORFIXED)){ - tmp = HookAPI(module, "user32.dll", SetCursorPos, "SetCursorPos", extSetCursorPos); - if(tmp) pSetCursorPos = (SetCursorPos_Type)tmp; - } - - tmp = HookAPI(module, "user32.dll", CreateDialogIndirectParamA, "CreateDialogIndirectParamA", extCreateDialogIndirectParam); - if(tmp) pCreateDialogIndirectParam = (CreateDialogIndirectParam_Type)tmp; - tmp = HookAPI(module, "user32.dll", CreateDialogParamA, "CreateDialogParamA", extCreateDialogParam); - if(tmp) pCreateDialogParam = (CreateDialogParam_Type)tmp; - tmp = HookAPI(module, "user32.dll", MoveWindow, "MoveWindow", extMoveWindow); - if(tmp) pMoveWindow = (MoveWindow_Type)tmp; - */ return NULL; } + +void HookUser32(HMODULE hModule) +{ + HookLibrary(hModule, Hooks, "user32.dll"); + + HookLibrary(hModule, (dxw.dwFlags1 & MAPGDITOPRIMARY) ? DDHooks : GDIHooks, "user32.dll"); + if (dxw.dwFlags1 & CLIENTREMAPPING) HookLibrary(hModule, RemapHooks, "user32.dll"); + if (dxw.dwFlags1 & MESSAGEPROC) HookLibrary(hModule, MessageHooks, "user32.dll"); + if(dxw.dwFlags1 & MODIFYMOUSE)HookLibrary(hModule, MouseHooks, "user32.dll"); + if (dxw.dwFlags1 & (PREVENTMAXIMIZE|FIXWINFRAME|LOCKWINPOS|LOCKWINSTYLE))HookLibrary(hModule, WinHooks, "user32.dll"); + if((dxw.dwFlags1 & (MODIFYMOUSE|SLOWDOWN|KEEPCURSORWITHIN)) || (dxw.dwFlags2 & KEEPCURSORFIXED)) HookLibrary(hModule, MouseHooks2, "user32.dll"); + return; +} diff --git a/dll/dxwcore.cpp b/dll/dxwcore.cpp index 47bf6e7..9962b94 100644 --- a/dll/dxwcore.cpp +++ b/dll/dxwcore.cpp @@ -49,6 +49,7 @@ void dxwCore::InitTarget(TARGETMAP *target) if(TimeShift < -8) TimeShift = -8; if(TimeShift > 8) TimeShift = 8; FakeVersionId = target->FakeVersionId; + Coordinates = target->coordinates; } /* ------------------------------------------------------------------ */ @@ -540,7 +541,7 @@ static BOOL SkipFrameCount(DWORD delay) BOOL dxwCore::HandleFPS() { - if(dwFlags2 & (SHOWFPS|SHOWFPSOVERLAY)) CountFPS(hWnd); + if(dwFlags2 & (SHOWFPS|SHOWFPSOVERLAY)) CountFPS(hWndFPS); if(dwFlags2 & LIMITFPS) LimitFrameCount(dxw.MaxFPS); if(dwFlags2 & SKIPFPS) if(SkipFrameCount(dxw.MaxFPS)) return TRUE; return FALSE; @@ -786,6 +787,7 @@ int dxwCore::GetDLLIndex(char *lpFileName) "kernel32", "USER32", "GDI32", + "imelib", "ADVAPI32", "ole32", "ddraw", @@ -810,6 +812,7 @@ int dxwCore::GetDLLIndex(char *lpFileName) "ws2_32", "tapi32", "netapi32", + "wintrust", NULL }; diff --git a/dll/dxwcore.hpp b/dll/dxwcore.hpp index 0c59672..e396f69 100644 --- a/dll/dxwcore.hpp +++ b/dll/dxwcore.hpp @@ -13,7 +13,8 @@ public: // Operations public: // methods void InitTarget(TARGETMAP *); - void SethWnd(HWND hwnd) {hWnd=hwnd;} + void SethWnd(HWND hwnd) {hWnd=hwnd; hWndFPS=hwnd;} + void SethWnd(HWND hwnd, HWND hwndfps) {hWnd=hwnd; hWndFPS=hwndfps;} void InitWindowPos(int, int, int, int); HWND GethWnd(void) {return hWnd;} void SetScreenSize(void) {dwScreenWidth=800; dwScreenHeight=600;} @@ -96,13 +97,14 @@ public: // simple data variables WORD palNumEntries; PALETTEENTRY palPalEntry[256]; short FakeVersionId; + int Coordinates; // Implementation protected: DWORD dwScreenWidth; DWORD dwScreenHeight; BOOL FullScreen; - HWND hWnd; + HWND hWnd, hWndFPS; DWORD PrimSurfaces[DDSQLEN+1]; }; @@ -112,6 +114,7 @@ typedef enum { SYSLIBIDX_KERNEL32 = 0, SYSLIBIDX_USER32, SYSLIBIDX_GDI32, + SYSLIBIDX_IMELIB, SYSLIBIDX_ADVAPI32, SYSLIBIDX_OLE32, SYSLIBIDX_DIRECTDRAW, @@ -127,6 +130,7 @@ typedef enum { SYSLIBIDX_DPLAYX, SYSLIBIDX_DSOUND, SYSLIBIDX_WINMM, + SYSLIBIDX_IMM32, SYSLIBIDX_WSOCK, SYSLIBIDX_DINPUT, SYSLIBIDX_DINPUT8, @@ -135,4 +139,6 @@ typedef enum { SYSLIBIDX_WS2_32, SYSLIBIDX_TAPI32, SYSLIBIDX_NETAPI32, - SYSLIBIDX_MAX } enum_syslibraries; \ No newline at end of file + SYSLIBIDX_WINTRUST, + SYSLIBIDX_MAX } +enum_syslibraries; diff --git a/dll/dxwnd.cpp b/dll/dxwnd.cpp index e56299c..ca84efc 100644 --- a/dll/dxwnd.cpp +++ b/dll/dxwnd.cpp @@ -24,7 +24,7 @@ along with this program. If not, see . #include "dxwnd.h" #include "dxwcore.hpp" -#define VERSION "2.02.21" +#define VERSION "2.02.22" LRESULT CALLBACK HookProc(int ncode, WPARAM wparam, LPARAM lparam); @@ -150,6 +150,7 @@ LRESULT CALLBACK HookProc(int ncode, WPARAM wparam, LPARAM lparam) for(i = 0; name[i]; i ++) name[i] = tolower(name[i]); WaitForSingleObject(hMutex, INFINITE); for(i = 0; pMapping[i].path[0]; i ++){ + if (!(pMapping[i].flags3 & HOOKENABLED)) continue; if(!strncmp(name, pMapping[i].path, strlen(name))) { // V.68 late fix: diff --git a/dll/dxwnd.vs2008.suo b/dll/dxwnd.vs2008.suo index 069e44e..a8ce95b 100644 Binary files a/dll/dxwnd.vs2008.suo and b/dll/dxwnd.vs2008.suo differ diff --git a/dll/dxwnd.vs2008.vcproj b/dll/dxwnd.vs2008.vcproj index 0598103..96c1393 100644 --- a/dll/dxwnd.vs2008.vcproj +++ b/dll/dxwnd.vs2008.vcproj @@ -377,7 +377,11 @@ > + + keep the original call address return NULL; } +static FARPROC wglRemapLibrary(LPCSTR proc, HookEntry_Type *Hooks) +{ + int i; + HookEntry_Type *Hook; + for(i=0; Hooks[i].APIName; i++){ + Hook=&Hooks[i]; + if (!strcmp(proc,Hook->APIName)){ + if (Hook->StoreAddress) *(Hook->StoreAddress)=(*pwglGetProcAddress)(proc); + OutTraceD("GetProcAddress: hooking proc=%s at addr=%x\n", ProcToString(proc), (Hook->StoreAddress) ? *(Hook->StoreAddress) : 0); + return Hook->HookerAddress; + } + } + return NULL; +} + PROC Remap_wgl_ProcAddress(LPCSTR proc) { - if (!strcmp(proc,"glViewport")){ - pglViewport=(glViewport_Type)(*pwglGetProcAddress)(proc); - OutTraceD("GetProcAddress: hooking proc=%s at addr=%x\n", ProcToString(proc), pglViewport); - return (FARPROC)extglViewport; - } - if (!strcmp(proc,"glScissor")){ - pglScissor=(glScissor_Type)(*pwglGetProcAddress)(proc); - OutTraceD("GetProcAddress: hooking proc=%s at addr=%x\n", ProcToString(proc), pglScissor); - return (FARPROC)extglScissor; - } - if (!strcmp(proc,"glGetIntegerv")){ - pglGetIntegerv=(glGetIntegerv_Type)(*pwglGetProcAddress)(proc); - OutTraceD("GetProcAddress: hooking proc=%s at addr=%x\n", ProcToString(proc), pglGetIntegerv); - return (FARPROC)extglGetIntegerv; - } - if (!strcmp(proc,"glDrawBuffer")){ - pglDrawBuffer=(glDrawBuffer_Type)(*pwglGetProcAddress)(proc); - OutTraceD("GetProcAddress: hooking proc=%s at addr=%x\n", ProcToString(proc), pglDrawBuffer); - return (FARPROC)extglDrawBuffer; - } - if (!strcmp(proc,"glPolygonMode")){ - pglPolygonMode=(glPolygonMode_Type)(*pwglGetProcAddress)(proc); - OutTraceD("GetProcAddress: hooking proc=%s at addr=%x\n", ProcToString(proc), pglPolygonMode); - return (FARPROC)extglPolygonMode; - } - if (!strcmp(proc,"glGetFloatv")){ - pglGetFloatv=(glGetFloatv_Type)(*pwglGetProcAddress)(proc); - OutTraceD("GetProcAddress: hooking proc=%s at addr=%x\n", ProcToString(proc), pglGetFloatv); - return (FARPROC)extglGetFloatv; - } - if (!strcmp(proc,"glClear")){ - pglClear=(glClear_Type)(*pwglGetProcAddress)(proc); - OutTraceD("GetProcAddress: hooking proc=%s at addr=%x\n", ProcToString(proc), pglClear); - return (FARPROC)extglClear; - } + FARPROC addr; + if(addr=wglRemapLibrary(proc, wglHooks)) return addr; // NULL -> keep the original call address return NULL; } diff --git a/dll/hd3d.cpp b/dll/hd3d.cpp index 0edb66a..a867de9 100644 --- a/dll/hd3d.cpp +++ b/dll/hd3d.cpp @@ -7,6 +7,7 @@ #include "dxwnd.h" #include "dxwcore.hpp" #include "dxhook.h" +#include "syslibs.h" #define HOOKD3D10ANDLATER 1 @@ -15,6 +16,7 @@ typedef HRESULT (WINAPI *QueryInterface_Type)(void *, REFIID riid, void** ppvObj typedef void* (WINAPI *Direct3DCreate8_Type)(UINT); typedef void* (WINAPI *Direct3DCreate9_Type)(UINT); typedef HRESULT (WINAPI *Direct3DCreate9Ex_Type)(UINT, IDirect3D9Ex **); +typedef HRESULT (WINAPI *CheckFullScreen_Type)(void); typedef UINT (WINAPI *GetAdapterCount_Type)(void *); typedef HRESULT (WINAPI *GetAdapterIdentifier_Type)(void *, UINT, DWORD, D3DADAPTER_IDENTIFIER9 *); @@ -49,6 +51,8 @@ HRESULT WINAPI extGetDirect3D(void *, IDirect3D9 **); void* WINAPI extDirect3DCreate8(UINT); void* WINAPI extDirect3DCreate9(UINT); HRESULT WINAPI extDirect3DCreate9Ex(UINT, IDirect3D9Ex **); +HRESULT WINAPI extCheckFullScreen(void); + UINT WINAPI extGetAdapterCount(void *); HRESULT WINAPI extGetAdapterIdentifier(void *, UINT, DWORD, D3DADAPTER_IDENTIFIER9 *); HRESULT WINAPI extCreateDevice(void *, UINT, D3DDEVTYPE, HWND, DWORD, D3DPRESENT_PARAMETERS *, void **); @@ -74,37 +78,39 @@ void WINAPI extRSSetViewports(ID3D11DeviceContext *, UINT, D3D11_VIEWPORT *); extern char *ExplainDDError(DWORD); -QueryInterface_Type pQueryInterfaceD3D8; -QueryInterface_Type pQueryInterfaceDev8; -QueryInterface_Type pQueryInterfaceD3D9; -QueryInterface_Type pQueryInterfaceDev9; +QueryInterface_Type pQueryInterfaceD3D8 = 0; +QueryInterface_Type pQueryInterfaceDev8 = 0; +QueryInterface_Type pQueryInterfaceD3D9 = 0; +QueryInterface_Type pQueryInterfaceDev9 = 0; -GetDirect3D_Type pGetDirect3D; +GetDirect3D_Type pGetDirect3D = 0; Direct3DCreate8_Type pDirect3DCreate8 = 0; Direct3DCreate9_Type pDirect3DCreate9 = 0; Direct3DCreate9Ex_Type pDirect3DCreate9Ex = 0; -GetAdapterCount_Type pGetAdapterCount; -GetAdapterIdentifier_Type pGetAdapterIdentifier; -CreateDevice_Type pCreateDevice; -CreateDeviceEx_Type pCreateDeviceEx; -EnumAdapterModes8_Type pEnumAdapterModes8; -EnumAdapterModes9_Type pEnumAdapterModes9; -GetAdapterDisplayMode_Type pGetAdapterDisplayMode; -GetDisplayMode_Type pGetDisplayMode; -Present_Type pPresent = 0; -SetRenderState_Type pSetRenderState; -GetRenderState_Type pGetRenderState; -CreateAdditionalSwapChain_Type pCreateAdditionalSwapChain; -GetViewport_Type pGetViewport; -SetViewport_Type pSetViewport; +CheckFullScreen_Type pCheckFullScreen = 0; -D3D10CreateDevice_Type pD3D10CreateDevice; -D3D10CreateDeviceAndSwapChain_Type pD3D10CreateDeviceAndSwapChain; -D3D10CreateDevice1_Type pD3D10CreateDevice1; -D3D10CreateDeviceAndSwapChain1_Type pD3D10CreateDeviceAndSwapChain1; -D3D11CreateDevice_Type pD3D11CreateDevice; -D3D11CreateDeviceAndSwapChain_Type pD3D11CreateDeviceAndSwapChain; -RSSetViewports_Type pRSSetViewports; +GetAdapterCount_Type pGetAdapterCount = 0; +GetAdapterIdentifier_Type pGetAdapterIdentifier = 0; +CreateDevice_Type pCreateDevice = 0; +CreateDeviceEx_Type pCreateDeviceEx = 0; +EnumAdapterModes8_Type pEnumAdapterModes8 = 0; +EnumAdapterModes9_Type pEnumAdapterModes9 = 0; +GetAdapterDisplayMode_Type pGetAdapterDisplayMode = 0; +GetDisplayMode_Type pGetDisplayMode = 0; +Present_Type pPresent = 0; +SetRenderState_Type pSetRenderState = 0; +GetRenderState_Type pGetRenderState = 0; +CreateAdditionalSwapChain_Type pCreateAdditionalSwapChain = 0; +GetViewport_Type pGetViewport = 0; +SetViewport_Type pSetViewport = 0; + +D3D10CreateDevice_Type pD3D10CreateDevice = 0; +D3D10CreateDeviceAndSwapChain_Type pD3D10CreateDeviceAndSwapChain = 0; +D3D10CreateDevice1_Type pD3D10CreateDevice1 = 0; +D3D10CreateDeviceAndSwapChain1_Type pD3D10CreateDeviceAndSwapChain1 = 0; +D3D11CreateDevice_Type pD3D11CreateDevice = 0; +D3D11CreateDeviceAndSwapChain_Type pD3D11CreateDeviceAndSwapChain = 0; +RSSetViewports_Type pRSSetViewports = 0; DWORD dwD3DVersion; @@ -150,6 +156,11 @@ FARPROC Remap_d3d9_ProcAddress(LPCSTR proc, HMODULE hModule) OutTraceD("GetProcAddress: hooking proc=%s at addr=%x\n", ProcToString(proc), pDirect3DCreate9Ex); return (FARPROC)extDirect3DCreate9Ex; } + if (!strcmp(proc,"CheckFullScreen") && !pCheckFullScreen){ + pCheckFullScreen=(CheckFullScreen_Type)(*pGetProcAddress)(hModule, proc); + OutTraceD("GetProcAddress: hooking proc=%s at addr=%x\n", ProcToString(proc), pCheckFullScreen); + return (FARPROC)extCheckFullScreen; + } if (!(dxw.dwFlags3 & SUPPRESSD3DEXT)) return NULL; @@ -237,6 +248,8 @@ int HookDirect3D(HMODULE module, int version){ if(tmp) pDirect3DCreate9 = (Direct3DCreate9_Type)tmp; tmp = HookAPI(module, "d3d9.dll", NULL, "Direct3DCreate9Ex", extDirect3DCreate9Ex); if(tmp) pDirect3DCreate9Ex = (Direct3DCreate9Ex_Type)tmp; + tmp = HookAPI(module, "d3d9.dll", NULL, "CheckFullScreen", extCheckFullScreen); + if(tmp) pCheckFullScreen = (CheckFullScreen_Type)tmp; #ifdef HOOKD3D10ANDLATER // D3D10 tmp = HookAPI(module, "d3d10.dll", NULL, "D3D10CreateDevice", extD3D10CreateDevice); @@ -268,6 +281,10 @@ int HookDirect3D(HMODULE module, int version){ hinst = LoadLibrary("d3d9.dll"); pDirect3DCreate9 = (Direct3DCreate9_Type)GetProcAddress(hinst, "Direct3DCreate9"); + pDirect3DCreate9Ex = + (Direct3DCreate9Ex_Type)GetProcAddress(hinst, "Direct3DCreate9Ex"); + pCheckFullScreen = + (CheckFullScreen_Type)GetProcAddress(hinst, "CheckFullScreen"); if(pDirect3DCreate9){ lpd3d = (LPDIRECT3D9)extDirect3DCreate9(31); if(lpd3d) lpd3d->Release(); @@ -535,6 +552,11 @@ HRESULT WINAPI extGetAdapterDisplayMode(void *lpd3d, UINT Adapter, D3DDISPLAYMOD // OutTrace("GetDeviceCaps hooked\n"); // return (*pGetDeviceCapsD3D)(lpd3dd, pCaps); //} +HRESULT WINAPI extProbe(void *lpd3dd) +{ + OutTrace("Probe: %x\n", lpd3dd); + return 0; +} HRESULT WINAPI extCreateDevice(void *lpd3d, UINT adapter, D3DDEVTYPE devicetype, HWND hfocuswindow, DWORD behaviorflags, D3DPRESENT_PARAMETERS *ppresentparam, void **ppd3dd) @@ -549,6 +571,23 @@ HRESULT WINAPI extCreateDevice(void *lpd3d, UINT adapter, D3DDEVTYPE devicetype, dxw.SetScreenSize(param[0], param[1]); AdjustWindowFrame(dxw.GethWnd(), dxw.GetScreenWidth(), dxw.GetScreenHeight()); + if(dxw.dwFlags3 & FIXD3DFRAME){ + char ClassName[81]; + GetClassName(dxw.GethWnd(), ClassName, 80); + hfocuswindow=(*pCreateWindowExA)( + 0, ClassName, "child", + WS_CHILD|WS_VISIBLE, + //GetSystemMetrics(SM_CXSIZEFRAME), GetSystemMetrics(SM_CYSIZEFRAME)+GetSystemMetrics(SM_CYCAPTION), + 0, 0, + dxw.GetScreenWidth(), dxw.GetScreenHeight(), dxw.GethWnd(), + NULL, NULL, NULL); + if (hfocuswindow) + OutTraceD("CreateDevice: updated hfocuswindow=%x\n", hfocuswindow, GetLastError()); + else + OutTraceD("CreateDevice: CreateWindowEx ERROR err=%d\n", GetLastError()); + dxw.SethWnd(hfocuswindow, dxw.GethWnd()); + } + tmp = param; OutTraceD("D3D%d::CreateDevice\n", dwD3DVersion); OutTraceD(" Adapter = %i\n", adapter); @@ -575,10 +614,13 @@ HRESULT WINAPI extCreateDevice(void *lpd3d, UINT adapter, D3DDEVTYPE devicetype, param[2] = mode.Format; OutTraceD(" Current Format = 0x%x\n", mode.Format); + //param[0]=param[1]=0; + if(dwD3DVersion == 9){ param[7] = 0; //hDeviceWindow dxw.SetFullScreen(~param[8]?TRUE:FALSE); param[8] = 1; //Windowed + //param[11] = D3DPRESENTFLAG_DEVICECLIP; //Flags; param[12] = 0; //FullScreen_RefreshRateInHz; param[13] = D3DPRESENT_INTERVAL_DEFAULT; //PresentationInterval } @@ -586,6 +628,7 @@ HRESULT WINAPI extCreateDevice(void *lpd3d, UINT adapter, D3DDEVTYPE devicetype, param[6] = 0; //hDeviceWindow dxw.SetFullScreen(~param[7]?TRUE:FALSE); param[7] = 1; //Windowed + //param[10] = D3DPRESENTFLAG_DEVICECLIP; //Flags; param[11] = 0; //FullScreen_RefreshRateInHz; param[12] = D3DPRESENT_INTERVAL_DEFAULT; //PresentationInterval } @@ -595,7 +638,7 @@ HRESULT WINAPI extCreateDevice(void *lpd3d, UINT adapter, D3DDEVTYPE devicetype, OutTraceD("FAILED! %x\n", res); return res; } - OutTraceD("SUCCESS!\n"); + OutTraceD("SUCCESS! device=%x\n", *ppd3dd); if(dwD3DVersion == 8){ void *pReset; @@ -628,8 +671,12 @@ HRESULT WINAPI extCreateDevice(void *lpd3d, UINT adapter, D3DDEVTYPE devicetype, SetHook((void *)(**(DWORD **)ppd3dd + 232), extGetRenderState, (void **)&pGetRenderState, "GetRenderState(D9)"); (*pSetRenderState)((void *)*ppd3dd, D3DRS_FILLMODE, D3DFILL_WIREFRAME); } + // experiments .... //SetHook((void *)(**(DWORD **)ppd3dd +280), extValidateDevice, (void **)&pValidateDevice, "ValidateDevice(D9)"); //SetHook((void *)(**(DWORD **)ppd3dd + 28), extGetDeviceCapsD3D, (void **)&pGetDeviceCapsD3D, "GetDeviceCaps(D9)"); + //void *pNull=0; + //SetHook((void *)(**(DWORD **)ppd3dd + 344), extProbe, &pNull, "Probe-CreateVertexDeclaration(D9)"); + //SetHook((void *)(**(DWORD **)ppd3dd + 28), extProbe, &pNull, "Probe-GetDeviceCaps(D9)"); } GetHookInfo()->IsFullScreen = dxw.IsFullScreen(); @@ -741,7 +788,7 @@ HRESULT WINAPI extSetViewport(void *pd3dd, D3DVIEWPORT9 *pViewport) (*pGetClientRect)(dxw.GethWnd(), &client); OutTraceD("SetViewport: declared pos=(%d,%d) size=(%d,%d) depth=(%f;%f)\n", pViewport->X, pViewport->Y, pViewport->Width, pViewport->Height, pViewport->MinZ, pViewport->MaxZ); - if(IsDebug) OutTrace("glViewport: DEBUG win=(%d,%d) screen=(%d,%d)\n", + if(IsDebug) OutTrace("SetViewport: DEBUG win=(%d,%d) screen=(%d,%d)\n", client.right, client.bottom, dxw.GetScreenWidth(), dxw.GetScreenHeight()); pViewport->X = (pViewport->X * (int)client.right) / (int)dxw.GetScreenWidth(); pViewport->Y = (pViewport->Y * (int)client.bottom) / (int)dxw.GetScreenHeight(); @@ -982,6 +1029,8 @@ HRESULT WINAPI extQueryInterfaceD3D9(void *obj, REFIID riid, void** ppvObj) HRESULT WINAPI extQueryInterfaceDev9(void *obj, REFIID riid, void** ppvObj) { HRESULT res; + void *pReset; + OutTraceD("Device::QueryInterface(9): lpd3dd=%x refiid=%x\n", obj, riid); res=pQueryInterfaceDev9(obj, riid, ppvObj); if(res){ @@ -990,19 +1039,23 @@ HRESULT WINAPI extQueryInterfaceDev9(void *obj, REFIID riid, void** ppvObj) } OutTraceD("Device::QueryInterface(9): ppvObj=%x\n", *ppvObj); - void *pReset; - pReset=NULL; // to avoid assert condition - SetHook((void *)(**(DWORD **)ppvObj + 0), extQueryInterfaceDev9, (void **)&pQueryInterfaceDev9, "QueryInterface(D9)"); - SetHook((void *)(**(DWORD **)ppvObj + 32), extGetDisplayMode, (void **)&pGetDisplayMode, "GetDisplayMode(D9)"); - SetHook((void *)(**(DWORD **)ppvObj + 52), extCreateAdditionalSwapChain, (void **)&pCreateAdditionalSwapChain, "CreateAdditionalSwapChain(D9)"); - SetHook((void *)(**(DWORD **)ppvObj + 64), extReset, (void **)&pReset, "Reset(D9)"); - SetHook((void *)(**(DWORD **)ppvObj + 68), extPresent, (void **)&pPresent, "Present(D9)"); - SetHook((void *)(**(DWORD **)ppvObj +188), extSetViewport, (void **)&pSetViewport, "SetViewport(D9)"); - SetHook((void *)(**(DWORD **)ppvObj +192), extGetViewport, (void **)&pGetViewport, "GetViewport(D9)"); - if(dxw.dwFlags2 & WIREFRAME){ - SetHook((void *)(**(DWORD **)ppvObj + 228), extSetRenderState, (void **)&pSetRenderState, "SetRenderState(D9)"); - SetHook((void *)(**(DWORD **)ppvObj + 232), extGetRenderState, (void **)&pGetRenderState, "GetRenderState(D9)"); - (*pSetRenderState)((void *)*ppvObj, D3DRS_FILLMODE, D3DFILL_WIREFRAME); + switch(*(DWORD *)&riid){ + case 0xD0223B96: // IID_IDirect3DDevice9 + OutTraceD("Device hook for IID_IDirect3DDevice9 interface\n"); + pReset=NULL; // to avoid assert condition + SetHook((void *)(**(DWORD **)ppvObj + 0), extQueryInterfaceDev9, (void **)&pQueryInterfaceDev9, "QueryInterface(D9)"); + SetHook((void *)(**(DWORD **)ppvObj + 32), extGetDisplayMode, (void **)&pGetDisplayMode, "GetDisplayMode(D9)"); + SetHook((void *)(**(DWORD **)ppvObj + 52), extCreateAdditionalSwapChain, (void **)&pCreateAdditionalSwapChain, "CreateAdditionalSwapChain(D9)"); + SetHook((void *)(**(DWORD **)ppvObj + 64), extReset, (void **)&pReset, "Reset(D9)"); + SetHook((void *)(**(DWORD **)ppvObj + 68), extPresent, (void **)&pPresent, "Present(D9)"); + //SetHook((void *)(**(DWORD **)ppvObj +188), extSetViewport, (void **)&pSetViewport, "SetViewport(D9)"); + //SetHook((void *)(**(DWORD **)ppvObj +192), extGetViewport, (void **)&pGetViewport, "GetViewport(D9)"); + if(dxw.dwFlags2 & WIREFRAME){ + SetHook((void *)(**(DWORD **)ppvObj + 228), extSetRenderState, (void **)&pSetRenderState, "SetRenderState(D9)"); + SetHook((void *)(**(DWORD **)ppvObj + 232), extGetRenderState, (void **)&pGetRenderState, "GetRenderState(D9)"); + (*pSetRenderState)((void *)*ppvObj, D3DRS_FILLMODE, D3DFILL_WIREFRAME); + } + break; } return res; @@ -1013,3 +1066,9 @@ HRESULT WINAPI extGetDirect3D(void *lpdd3dd, IDirect3D9 **ppD3D9) OutTraceD("Device::GetDirect3D\n"); return (*pGetDirect3D)(lpdd3dd, ppD3D9); } + +HRESULT WINAPI extCheckFullScreen(void) +{ + OutTraceD("CheckFullScreen\n"); + return 0; +} diff --git a/dll/hddraw.cpp b/dll/hddraw.cpp index 1bac199..8ae86b0 100644 --- a/dll/hddraw.cpp +++ b/dll/hddraw.cpp @@ -509,8 +509,10 @@ int HookDirectDraw(HMODULE module, int version) hinst=LoadLibrary("ddraw.dll"); pSetAppCompatData=(SetAppCompatData_Type)(*pGetProcAddress)(hinst, "SetAppCompatData"); - if(pSetAppCompatData) res=(*pSetAppCompatData)(2, 0); - OutTraceD("HookDirectDraw: SetAppCompatData(2,0) ret=%x(%s)\n", res, ExplainDDError(res)); + if(pSetAppCompatData) { + res=(*pSetAppCompatData)(2, 0); + OutTraceD("HookDirectDraw: SetAppCompatData(2,0) ret=%x(%s)\n", res, ExplainDDError(res)); + } FreeLibrary(hinst); } diff --git a/dll/imelib.cpp b/dll/imelib.cpp index dcbace1..4c5327b 100644 --- a/dll/imelib.cpp +++ b/dll/imelib.cpp @@ -9,6 +9,30 @@ #include "syslibs.h" #include "dxhelper.h" +static HookEntry_Type Hooks[]={ + {"ImmNotifyIME", NULL, (FARPROC *)&pImmNotifyIME, (FARPROC)extImmNotifyIME}, + {"ImmCreateContext", NULL, (FARPROC *)&pImmCreateContext, (FARPROC)extImmCreateContext}, + {"ImmDestroyContext", NULL, (FARPROC *)&pImmDestroyContext, (FARPROC)extImmDestroyContext}, + {"ImmSetOpenStatus", NULL, (FARPROC *)&pImmSetOpenStatus, (FARPROC)extImmSetOpenStatus}, + {"ImmAssociateContext", NULL, (FARPROC *)&pImmAssociateContext, (FARPROC)extImmAssociateContext}, + {"ImmSetCompositionWindow", NULL, (FARPROC *)&pImmSetCompositionWindow, (FARPROC)extImmSetCompositionWindow}, + {"ImmSetCompositionStringA", NULL, (FARPROC *)&pImmSetCompositionString, (FARPROC)extImmSetCompositionString}, + {"ImmGetOpenStatus", NULL, (FARPROC *)&pImmGetOpenStatus, (FARPROC)extImmGetOpenStatus}, + {0, NULL, 0, 0} // terminator +}; + +void HookImeLib(HMODULE module) +{ + HookLibrary(module, Hooks, "IMM32.dll"); +} + +FARPROC Remap_ImeLib_ProcAddress(LPCSTR proc, HMODULE hModule) +{ + FARPROC addr; + if (addr=RemapLibrary(proc, hModule, Hooks)) return addr; + return NULL; +} + BOOL WINAPI extImmNotifyIME(HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD dwValue) { OutTraceD("ImmNotifyIME: hIMC=%x dwAction=%x dwIndex=%x dwValue=%x\n", hIMC, dwAction, dwIndex, dwValue); @@ -57,25 +81,3 @@ BOOL WINAPI extImmGetOpenStatus(HIMC hIMC) OutTraceD("ImmGetOpenStatus: hIMC=%x\n", hIMC); return(*pImmGetOpenStatus)(hIMC); } - -void HookImeLib(HMODULE module) -{ - void *tmp; - - tmp = HookAPI(module, "IMM32.dll", NULL, "ImmNotifyIME", extImmNotifyIME); - if(tmp) pImmNotifyIME = (ImmNotifyIME_Type)tmp; - tmp = HookAPI(module, "IMM32.dll", NULL, "ImmCreateContext", extImmCreateContext); - if(tmp) pImmCreateContext = (ImmCreateContext_Type)tmp; - tmp = HookAPI(module, "IMM32.dll", NULL, "ImmDestroyContext", extImmDestroyContext); - if(tmp) pImmDestroyContext = (ImmDestroyContext_Type)tmp; - tmp = HookAPI(module, "IMM32.dll", NULL, "ImmSetOpenStatus", extImmSetOpenStatus); - if(tmp) pImmSetOpenStatus = (ImmSetOpenStatus_Type)tmp; - tmp = HookAPI(module, "IMM32.dll", NULL, "ImmAssociateContext", extImmAssociateContext); - if(tmp) pImmAssociateContext = (ImmAssociateContext_Type)tmp; - tmp = HookAPI(module, "IMM32.dll", NULL, "ImmSetCompositionWindow", extImmSetCompositionWindow); - if(tmp) pImmSetCompositionWindow = (ImmSetCompositionWindow_Type)tmp; - tmp = HookAPI(module, "IMM32.dll", NULL, "ImmSetCompositionStringA", extImmSetCompositionString); - if(tmp) pImmSetCompositionString = (ImmSetCompositionString_Type)tmp; - tmp = HookAPI(module, "IMM32.dll", NULL, "ImmGetOpenStatus", extImmGetOpenStatus); - if(tmp) pImmGetOpenStatus = (ImmGetOpenStatus_Type)tmp; -} diff --git a/dll/msvfwhook.cpp b/dll/msvfwhook.cpp index 084b4cc..c553c10 100644 --- a/dll/msvfwhook.cpp +++ b/dll/msvfwhook.cpp @@ -8,32 +8,23 @@ #include "msvfwhook.h" #undef DXWDECLARATIONS +static HookEntry_Type Hooks[]={ + {"ICSendMessage", (FARPROC)NULL, (FARPROC *)&pICSendMessage, (FARPROC)extICSendMessage}, + {"ICOpen", (FARPROC)NULL, (FARPROC *)&pICOpen, (FARPROC)extICOpen}, + {0, NULL, 0, 0} // terminator +}; + FARPROC Remap_vfw_ProcAddress(LPCSTR proc, HMODULE hModule) { - if (!strcmp(proc,"ICSendMessage")){ - pICSendMessage=(ICSendMessage_Type)(*pGetProcAddress)(hModule, proc); - OutTraceD("GetProcAddress: hooking proc=%s at addr=%x\n", ProcToString(proc), pICSendMessage); - return (FARPROC)extICSendMessage; - } - if (!strcmp(proc,"ICOpen")){ - pICOpen=(ICOpen_Type)(*pGetProcAddress)(hModule, proc); - OutTraceD("GetProcAddress: hooking proc=%s at addr=%x\n", ProcToString(proc), pICOpen); - return (FARPROC)extICOpen; - } - + FARPROC addr; + if (addr=RemapLibrary(proc, hModule, Hooks)) return addr; // NULL -> keep the original call address return NULL; } void HookMSV4WLibs(HMODULE module) { - void *tmp; - tmp = HookAPI(module, "MSVFW32.dll", NULL, "ICSendMessage", extICSendMessage); - if(tmp) pICSendMessage = (ICSendMessage_Type)tmp; - tmp = HookAPI(module, "MSVFW32.dll", NULL, "ICOpen", extICOpen); - if(tmp) pICOpen = (ICOpen_Type)tmp; - - return; + HookLibrary(module, Hooks, "MSVFW32.dll"); } LRESULT WINAPI extICSendMessage(HIC hic, UINT wMsg, DWORD_PTR dw1, DWORD_PTR dw2) diff --git a/dll/syslibs.cpp b/dll/syslibs.cpp index 6c6a6d3..1b85d37 100644 --- a/dll/syslibs.cpp +++ b/dll/syslibs.cpp @@ -1190,11 +1190,16 @@ LONG WINAPI MyChangeDisplaySettings(char *fname, DEVMODE *lpDevMode, DWORD dwfla else{ DEVMODE NewMode, TryMode; int i; + HDC DesktopDC; // set the proper mode NewMode = *lpDevMode; NewMode.dmPelsHeight = (*GetSystemMetrics)(SM_CYSCREEN); NewMode.dmPelsWidth = (*GetSystemMetrics)(SM_CXSCREEN); + if (!(NewMode.dmFields & DM_BITSPERPEL)) { + DesktopDC = GetDC(GetDesktopWindow()); + NewMode.dmBitsPerPel = GetDeviceCaps(DesktopDC, BITSPIXEL) * GetDeviceCaps(DesktopDC, PLANES); + } TryMode.dmSize = sizeof(TryMode); OutTraceD("ChangeDisplaySettings: DEBUG looking for size=(%d x %d) bpp=%d\n", NewMode.dmPelsWidth, NewMode.dmPelsHeight, NewMode.dmBitsPerPel); @@ -1212,6 +1217,11 @@ LONG WINAPI MyChangeDisplaySettings(char *fname, DEVMODE *lpDevMode, DWORD dwfla if((NewMode.dmBitsPerPel==TryMode.dmBitsPerPel) && (NewMode.dmPelsHeight==TryMode.dmPelsHeight) && (NewMode.dmPelsWidth==TryMode.dmPelsWidth)) break; + + //if ((NewMode.dmFields & DM_BITSPERPEL) && (NewMode.dmBitsPerPel!=TryMode.dmBitsPerPel)) continue; + //if (NewMode.dmPelsHeight!=TryMode.dmPelsHeight) continue; + //if (NewMode.dmPelsWidth!=TryMode.dmPelsWidth) continue; + break; } if(dwflags==CDS_FULLSCREEN) dwflags=0; // no FULLSCREEN res=(*ChangeDisplaySettings)(&TryMode, dwflags); @@ -1229,7 +1239,8 @@ LONG WINAPI extChangeDisplaySettings(DEVMODE *lpDevMode, DWORD dwflags) { if(IsTraceD){ OutTrace("ChangeDisplaySettings: lpDevMode=%x flags=%x", lpDevMode, dwflags); - if (lpDevMode) OutTrace(" size=(%d x %d) bpp=%x", + if (lpDevMode) OutTrace(" fields=%x(%s) size=(%d x %d) bpp=%x", + lpDevMode->dmFields, ExplainDevModeFields(lpDevMode->dmFields), lpDevMode->dmPelsWidth, lpDevMode->dmPelsHeight, lpDevMode->dmBitsPerPel); OutTrace("\n"); } @@ -1465,7 +1476,6 @@ BOOL WINAPI extGetMessage(LPMSG lpMsg, HWND hwnd, UINT wMsgFilterMin, UINT wMsgF extern void HookModule(HMODULE, int); -extern void HookSysLibs(HMODULE); HMODULE SysLibs[SYSLIBIDX_MAX]; @@ -1494,7 +1504,6 @@ HMODULE WINAPI LoadLibraryExWrapper(LPCTSTR lpFileName, HANDLE hFile, DWORD dwFl idx=SYSLIBIDX_OPENGL; SysLibs[idx]=libhandle; } - //if (idx == SYSLIBIDX_MAX) HookModule(libhandle, 0); if (idx == -1) HookModule(libhandle, 0); return libhandle; } @@ -1561,6 +1570,12 @@ FARPROC WINAPI extGetProcAddress(HMODULE hModule, LPCSTR proc) case SYSLIBIDX_KERNEL32: if (remap=Remap_kernel32_ProcAddress(proc, hModule)) return remap; break; + case SYSLIBIDX_IMELIB: + if (remap=Remap_ImeLib_ProcAddress(proc, hModule)) return remap; + break; + case SYSLIBIDX_WINMM: + if (remap=Remap_WinMM_ProcAddress(proc, hModule)) return remap; + break; case SYSLIBIDX_OLE32: if (remap=Remap_ole32_ProcAddress(proc, hModule)) return remap; break; @@ -1588,6 +1603,9 @@ FARPROC WINAPI extGetProcAddress(HMODULE hModule, LPCSTR proc) case SYSLIBIDX_SMACK: if (remap=Remap_smack_ProcAddress(proc, hModule)) return remap; break; + case SYSLIBIDX_WINTRUST: + if (remap=Remap_trust_ProcAddress(proc, hModule)) return remap; + break; default: break; } @@ -2451,14 +2469,6 @@ LRESULT WINAPI extSendMessage(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) return ret; } -DWORD WINAPI exttimeGetTime(void) -{ - DWORD ret; - ret = dxw.GetTickCount(); - if (IsDebug) OutTrace("timeGetTime: time=%x\n", ret); - return ret; -} - int WINAPI extShowCursor(BOOL bShow) { static int iFakeCounter; diff --git a/dll/syslibs.cpp.bak b/dll/syslibs.cpp.bak new file mode 100644 index 0000000..e2eb11a --- /dev/null +++ b/dll/syslibs.cpp.bak @@ -0,0 +1,2493 @@ +#define _WIN32_WINNT 0x0600 +#define WIN32_LEAN_AND_MEAN +#include +#include +#include +#include +#include "dxwnd.h" +#include "dxwcore.hpp" +#include "dxhook.h" +#include "glhook.h" +#include "msvfwhook.h" +#include "syslibs.h" +#include "dxhelper.h" +#include "hddraw.h" +#include "hddproxy.h" + +#define WINDOWDC 0xFFFFFFFF + +extern DWORD PaletteEntries[256]; +extern LPDIRECTDRAW lpDD; +extern Unlock4_Type pUnlockMethod(LPDIRECTDRAWSURFACE); + +extern GetDC_Type pGetDC; +extern ReleaseDC_Type pReleaseDC; + +DEVMODE SetDevMode; +DEVMODE *pSetDevMode=NULL; + +extern HRESULT WINAPI extBlt(LPDIRECTDRAWSURFACE, LPRECT, LPDIRECTDRAWSURFACE, LPRECT, DWORD, LPDDBLTFX); +extern HRESULT WINAPI sBlt(char *, LPDIRECTDRAWSURFACE, LPRECT, LPDIRECTDRAWSURFACE, LPRECT, DWORD, LPDDBLTFX, BOOL); + +extern DirectDrawEnumerate_Type pDirectDrawEnumerate; +extern DirectDrawEnumerateEx_Type pDirectDrawEnumerateEx; + +extern LRESULT CALLBACK extChildWindowProc(HWND, UINT, WPARAM, LPARAM); +extern INT_PTR CALLBACK extDialogWindowProc(HWND, UINT, WPARAM, LPARAM); + +/* ------------------------------------------------------------------ */ + +static POINT FixMessagePt(HWND hwnd, POINT point) +{ + RECT rect; + static POINT curr; + curr=point; + + if(!(*pScreenToClient)(hwnd, &curr)){ + OutTraceE("ScreenToClient ERROR=%d hwnd=%x at %d\n", GetLastError(), hwnd, __LINE__); + curr.x = curr.y = 0; + } + + if (!(*pGetClientRect)(hwnd, &rect)) { + OutTraceE("GetClientRect ERROR=%d hwnd=%x at %d\n", GetLastError(), hwnd, __LINE__); + curr.x = curr.y = 0; + } + +#ifdef ISDEBUG + if(IsDebug) OutTrace("FixMessagePt point=(%d,%d) hwnd=%x win pos=(%d,%d) size=(%d,%d)\n", + point.x, point.y, hwnd, point.x-curr.x, point.y-curr.y, rect.right, rect.bottom); +#endif + + if (curr.x < 0) curr.x=0; + if (curr.y < 0) curr.y=0; + if (curr.x > rect.right) curr.x=rect.right; + if (curr.y > rect.bottom) curr.y=rect.bottom; + if (rect.right) curr.x = (curr.x * dxw.GetScreenWidth()) / rect.right; + if (rect.bottom) curr.y = (curr.y * dxw.GetScreenHeight()) / rect.bottom; + + return curr; +} + +/* ------------------------------------------------------------------ */ + +static COLORREF GetMatchingColor(COLORREF crColor) +{ + int iDistance, iMinDistance; + int iColorIndex, iMinColorIndex; + COLORREF PalColor; + + iMinDistance=0xFFFFFF; + iMinColorIndex=0; + + for(iColorIndex=0; iColorIndex<256; iColorIndex++){ + int iDist; + iDistance=0; + + PalColor=PaletteEntries[iColorIndex]; + switch(dxw.ActualPixelFormat.dwRGBBitCount){ + case 32: + PalColor = ((PalColor & 0x00FF0000) >> 16) | (PalColor & 0x0000FF00) | ((PalColor & 0x000000FF) << 16); + break; + case 16: + if(dxw.ActualPixelFormat.dwGBitMask==0x03E0){ + // RGB555 screen settings + PalColor = ((PalColor & 0x7C00) >> 7) | ((PalColor & 0x03E0) << 6) | ((PalColor & 0x001F) << 19); + } + else { + // RGB565 screen settings + PalColor = ((PalColor & 0xF800) >> 8) | ((PalColor & 0x07E0) << 5) | ((PalColor & 0x001F) << 19); + } + break; + } + + iDist = (crColor & 0x00FF0000) - (PalColor & 0x00FF0000); + iDist >>= 16; + if (iDist<0) iDist=-iDist; + iDist *= iDist; + iDistance += iDist; + + iDist = (crColor & 0x0000FF00) - (PalColor & 0x0000FF00); + iDist >>= 8; + if (iDist<0) iDist=-iDist; + iDist *= iDist; + iDistance += iDist; + + iDist = (crColor & 0x000000FF) - (PalColor & 0x000000FF); + // iDist >>= 0; + if (iDist<0) iDist=-iDist; + iDist *= iDist; + iDistance += iDist; + + if (iDistance < iMinDistance) { + iMinDistance = iDistance; + iMinColorIndex = iColorIndex; + } + + if (iMinDistance==0) break; // got the perfect match! + } + OutTraceD("GetMatchingColor: color=%x matched with palette[%d]=%x dist=%d\n", + crColor, iMinColorIndex, PaletteEntries[iMinColorIndex], iDistance); + PalColor=PaletteEntries[iMinColorIndex]; + switch(dxw.ActualPixelFormat.dwRGBBitCount){ + case 32: + crColor = ((PalColor & 0x00FF0000) >> 16) | (PalColor & 0x0000FF00) | ((PalColor & 0x000000FF) << 16); + break; + case 16: + if(dxw.ActualPixelFormat.dwGBitMask==0x03E0){ + // RGB555 screen settings + crColor = ((PalColor & 0x7C00) >> 7) | ((PalColor & 0x03E0) << 6) | ((PalColor & 0x001F) << 19); + } + else { + // RGB565 screen settings + crColor = ((PalColor & 0xF800) >> 8) | ((PalColor & 0x07E0) << 5) | ((PalColor & 0x001F) << 19); + } + break; + } + return crColor; +} + +extern void FixWindowFrame(HWND); + +// GHO: pro Diablo +HWND WINAPI extCreateWindowExA( + DWORD dwExStyle, + LPCTSTR lpClassName, + LPCTSTR lpWindowName, + DWORD dwStyle, + int x, + int y, + int nWidth, + int nHeight, + HWND hWndParent, + HMENU hMenu, + HINSTANCE hInstance, + LPVOID lpParam) +{ + HWND wndh; + WNDPROC pWindowProc; + BOOL isValidHandle=TRUE; + + OutTraceD("CreateWindowEx: class=\"%s\" wname=\"%s\" pos=(%d,%d) size=(%d,%d) Style=%x(%s) ExStyle=%x(%s)\n", + lpClassName, lpWindowName, x, y, nWidth, nHeight, + dwStyle, ExplainStyle(dwStyle), dwExStyle, ExplainExStyle(dwExStyle)); + if(IsDebug) OutTrace("CreateWindowEx: DEBUG screen=(%d,%d)\n", dxw.GetScreenWidth(), dxw.GetScreenHeight()); + + // no maximized windows in any case + if (dxw.dwFlags1 & PREVENTMAXIMIZE){ + OutTraceD("CreateWindowEx: handling PREVENTMAXIMIZE mode\n"); + dwStyle &= ~(WS_MAXIMIZE | WS_POPUP); + dwExStyle &= ~WS_EX_TOPMOST; + } + + // v2.1.92: fixes size & position for auxiliary big window, often used + // for intro movies etc. : needed for ...... + // evidently, this was supposed to be a fullscreen window.... + // v2.1.100: fixes for "The Grinch": this game creates a new main window for OpenGL + // rendering using CW_USEDEFAULT placement and 800x600 size while the previous + // main win was 640x480 only! + // v2.02.13: if it's a WS_CHILD window, don't reposition the x,y, placement for BIG win. + if ( + ( + ((x==0)&&(y==0)) || ((x==CW_USEDEFAULT)&&(y==CW_USEDEFAULT)) + ) + && + (((DWORD)nWidth>=dxw.GetScreenWidth())&&((DWORD)nHeight>=dxw.GetScreenHeight())) + && + !(dwExStyle & WS_EX_CONTROLPARENT) // Diablo fix + && + !(dwStyle & WS_CHILD) // Diablo fix + ){ + RECT screen; + POINT upleft = {0,0}; + // update virtual screen size if it has grown + dxw.SetScreenSize(nWidth, nHeight); + // inserted some checks here, since the main window could be destroyed + // or minimized (see "Jedi Outcast") so that you may get a dangerous + // zero size. In this case, better renew the hWnd assignement and its coordinates. + do { // fake loop + isValidHandle = FALSE; + if (!(*pGetClientRect)(dxw.GethWnd(),&screen)) break; + if (!(*pClientToScreen)(dxw.GethWnd(),&upleft)) break; + if (screen.right==0 || screen.bottom==0) break; + isValidHandle = TRUE; + } while(FALSE); + if (isValidHandle){ + if (!(dwStyle & WS_CHILD)){ + x=upleft.x; + y=upleft.y; + } + nWidth=screen.right; + nHeight=screen.bottom; + OutTraceD("CreateWindowEx: fixed BIG win pos=(%d,%d) size=(%d,%d)\n", x, y, nWidth, nHeight); + } + else { + // invalid parent coordinates: use initial placement, but leave the size. + // should also fix the window style and compensate for borders here? + if (!(dwStyle & WS_CHILD)){ + x=dxw.iPosX; + y=dxw.iPosY; + } + nWidth=dxw.iSizX; + nHeight=dxw.iSizY; + OutTraceD("CreateWindowEx: renewed BIG win pos=(%d,%d) size=(%d,%d)\n", x, y, nWidth, nHeight); + } + dxw.SetFullScreen(TRUE); + } + + if(!dxw.IsFullScreen()){ // v2.1.63: needed for "Monster Truck Madness" + wndh= (*pCreateWindowExA)(dwExStyle, lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, + hWndParent, hMenu, hInstance, lpParam); + OutTraceD("CreateWindowEx: windowed mode ret=%x\n", wndh); + return wndh; + } + + // tested on Gangsters: coordinates must be window-relative!!! + // Age of Empires.... + if (dwStyle & WS_CHILD){ + dxw.MapClient(&x, &y, &nWidth, &nHeight); + OutTraceD("CreateWindowEx: fixed WS_CHILD pos=(%d,%d) size=(%d,%d)\n", + x, y, nWidth, nHeight); + } + // needed for Diablo, that creates a new control parent window that must be + // overlapped to the directdraw surface. + else if (dwExStyle & WS_EX_CONTROLPARENT){ + dxw.MapWindow(&x, &y, &nWidth, &nHeight); + OutTraceD("CreateWindowEx: fixed WS_EX_CONTROLPARENT pos=(%d,%d) size=(%d,%d)\n", + x, y, nWidth, nHeight); + } + + OutTraceB("CreateWindowEx: fixed pos=(%d,%d) size=(%d,%d) Style=%x(%s) ExStyle=%x(%s)\n", + x, y, nWidth, nHeight, dwStyle, ExplainStyle(dwStyle), dwExStyle, ExplainExStyle(dwExStyle)); + + wndh= (*pCreateWindowExA)(dwExStyle, lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, + hWndParent, hMenu, hInstance, lpParam); + if (wndh==(HWND)NULL){ + OutTraceE("CreateWindowEx: ERROR err=%d Style=%x(%s) ExStyle=%x\n", + GetLastError(), dwStyle, ExplainStyle(dwStyle), dwExStyle); + return wndh; + } + + if ((!isValidHandle) && dxw.IsFullScreen()) { + dxw.SethWnd(wndh); + extern void AdjustWindowPos(HWND, DWORD, DWORD); + (*pSetWindowLong)(wndh, GWL_STYLE, (dxw.dwFlags2 & MODALSTYLE) ? 0 : WS_OVERLAPPEDWINDOW); + (*pSetWindowLong)(wndh, GWL_EXSTYLE, 0); + OutTraceD("CreateWindow: hwnd=%x, set style=WS_OVERLAPPEDWINDOW extstyle=0\n", wndh); + AdjustWindowPos(wndh, nWidth, nHeight); + (*pShowWindow)(wndh, SW_SHOWNORMAL); + } + + if ((dxw.dwFlags1 & FIXWINFRAME) && !(dwStyle & WS_CHILD)) + FixWindowFrame(wndh); + + // to do: handle inner child, and leave dialogue & modal child alone!!! + if (dwStyle & WS_CHILD){ + long res; + pWindowProc = (WNDPROC)(*pGetWindowLong)(wndh, GWL_WNDPROC); + OutTraceD("Hooking CHILD wndh=%x WindowProc %x->%x\n", wndh, pWindowProc, extChildWindowProc); + res=(*pSetWindowLong)(wndh, GWL_WNDPROC, (LONG)extChildWindowProc); + WhndStackPush(wndh, pWindowProc); + if(!res) OutTraceE("CreateWindowExA: SetWindowLong ERROR %x\n", GetLastError()); + } + + OutTraceD("CreateWindowEx: ret=%x\n", wndh); + return wndh; +} + +COLORREF WINAPI extSetTextColor(HDC hdc, COLORREF crColor) +{ + COLORREF res; + + if ((dxw.dwFlags1 & EMULATESURFACE) && (dxw.dwFlags1 & HANDLEDC) && (dxw.VirtualPixelFormat.dwRGBBitCount==8)) + crColor=GetMatchingColor(crColor); + + res=(*pGDISetTextColor)(hdc, crColor); + OutTraceD("SetTextColor: color=%x res=%x%s\n", crColor, res, (res==CLR_INVALID)?"(CLR_INVALID)":""); + return res; +} + +COLORREF WINAPI extSetBkColor(HDC hdc, COLORREF crColor) +{ + COLORREF res; + + if ((dxw.dwFlags1 & EMULATESURFACE) && (dxw.dwFlags1 & HANDLEDC) && (dxw.VirtualPixelFormat.dwRGBBitCount==8)) + crColor=GetMatchingColor(crColor); + + res=(*pGDISetBkColor)(hdc, crColor); + OutTraceD("SetBkColor: color=%x res=%x%s\n", crColor, res, (res==CLR_INVALID)?"(CLR_INVALID)":""); + return res; +} + +LPRECT lpClipRegion=NULL; +RECT ClipRegion; + +BOOL WINAPI extClipCursor(RECT *lpRectArg) +{ + // reference: hooking and setting ClipCursor is mandatori in "Emergency: Fighters for Life" + // where the application expects the cursor to be moved just in a inner rect within the + // main window surface. + + BOOL res; + RECT *lpRect; + RECT Rect; + + if(IsTraceC){ + if (lpRectArg) + OutTrace("ClipCursor: rect=(%d,%d)-(%d,%d)\n", + lpRectArg->left,lpRectArg->top,lpRectArg->right,lpRectArg->bottom); + else + OutTrace("ClipCursor: rect=(NULL)\n"); + } + + if (!(dxw.dwFlags1 & ENABLECLIPPING)) return 1; + + if(lpRectArg){ + Rect=*lpRectArg; + lpRect=&Rect; + } + else + lpRect=NULL; + + if(dxw.dwFlags1 & MODIFYMOUSE){ + // save desired clip region + if (lpRect) { + ClipRegion=*lpRectArg; + lpClipRegion=&ClipRegion; + } + else + lpClipRegion=NULL; + + *lpRect=dxw.MapWindowRect(lpRect); + } + + if (pClipCursor) res=(*pClipCursor)(lpRect); + OutTraceD("ClipCursor: rect=(%d,%d)-(%d,%d) res=%x\n", + lpRect->left,lpRect->top,lpRect->right,lpRect->bottom, res); + + return TRUE; +} + +BOOL WINAPI extGetClipCursor(LPRECT lpRect) +{ + // v2.1.93: if ENABLECLIPPING, return the saved clip rect coordinates + + BOOL ret; + + // proxy.... + if (!(dxw.dwFlags1 & ENABLECLIPPING)) { + ret=(*pGetClipCursor)(lpRect); + if(IsTraceD){ + if (lpRect) + OutTrace("ClipCursor: PROXED rect=(%d,%d)-(%d,%d) ret=%d\n", + lpRect->left,lpRect->top,lpRect->right,lpRect->bottom, ret); + else + OutTrace("ClipCursor: PROXED rect=(NULL) ret=%d\n", ret); + } + return ret; + } + + if(lpRect){ + if(lpClipRegion) + *lpRect=ClipRegion; + else{ + lpRect->top = lpRect->left = 0; + lpRect->right = dxw.GetScreenWidth(); + lpRect->bottom = dxw.GetScreenHeight(); + } + OutTraceD("ClipCursor: rect=(%d,%d)-(%d,%d) ret=%d\n", + lpRect->left,lpRect->top,lpRect->right,lpRect->bottom, TRUE); + } + + return TRUE; +} + +int LastCurPosX, LastCurPosY; + +BOOL WINAPI extGetCursorPos(LPPOINT lppoint) +{ + HRESULT res; + static int PrevX, PrevY; + POINT prev; + + if(dxw.dwFlags1 & SLOWDOWN) dxw.DoSlow(2); + + if (pGetCursorPos) { + res=(*pGetCursorPos)(lppoint); + } + else { + lppoint->x =0; lppoint->y=0; + res=1; + } + + prev=*lppoint; + *lppoint=dxw.ScreenToClient(*lppoint); + *lppoint=dxw.FixCursorPos(*lppoint); + GetHookInfo()->CursorX=(short)lppoint->x; + GetHookInfo()->CursorY=(short)lppoint->y; + OutTraceC("GetCursorPos: FIXED pos=(%d,%d)->(%d,%d)\n", prev.x, prev.y, lppoint->x, lppoint->y); + + return res; +} + +BOOL WINAPI extSetCursorPos(int x, int y) +{ + BOOL res; + int PrevX, PrevY; + + PrevX=x; + PrevY=y; + + if(dxw.dwFlags2 & KEEPCURSORFIXED) { + OutTraceC("SetCursorPos: FIXED pos=(%d,%d)\n", x, y); + LastCurPosX=x; + LastCurPosY=y; + return 1; + } + + if(dxw.dwFlags1 & SLOWDOWN) dxw.DoSlow(2); + + if(dxw.dwFlags1 & KEEPCURSORWITHIN){ + // Intercept SetCursorPos outside screen boundaries (used as Cursor OFF in some games) + if ((y<0)||(y>=(int)dxw.GetScreenHeight())||(x<0)||(x>=(int)dxw.GetScreenWidth())) return 1; + } + + if(dxw.dwFlags1 & MODIFYMOUSE){ + POINT cur; + RECT rect; + + // find window metrics + if (!(*pGetClientRect)(dxw.GethWnd(), &rect)) { + // report error and ignore ... + OutTraceE("GetClientRect(%x) ERROR %d at %d\n", dxw.GethWnd(), GetLastError(), __LINE__); + return 0; + } + + x= x * rect.right / dxw.GetScreenWidth(); + y= y * rect.bottom / dxw.GetScreenHeight(); + + // check for boundaries (???) + if (x >= rect.right) x=rect.right-1; + if (x<0) x=0; + if (y >= rect.bottom) y=rect.bottom-1; + if (y<0) y=0; + + // make it screen absolute + cur.x = x; + cur.y = y; + if (!(*pClientToScreen)(dxw.GethWnd(), &cur)) { + OutTraceE("ClientToScreen(%x) ERROR %d at %d\n", dxw.GethWnd(), GetLastError(), __LINE__); + return 0; + } + x = cur.x; + y = cur.y; + } + + res=0; + if (pSetCursorPos) res=(*pSetCursorPos)(x,y); + + OutTraceC("SetCursorPos: res=%x XY=(%d,%d)->(%d,%d)\n",res, PrevX, PrevY, x, y); + return res; +} + +BOOL WINAPI extTextOutA(HDC hdc, int nXStart, int nYStart, LPCTSTR lpString, int cchString) +{ + BOOL res; + OutTraceD("TextOut: hdc=%x xy=(%d,%d) str=(%d)\"%s\"\n", hdc, nXStart, nYStart, cchString, lpString); + if (dxw.dwFlags1 & FIXTEXTOUT) { + POINT anchor; + anchor.x=nXStart; + anchor.y=nYStart; + (*pClientToScreen)(dxw.GethWnd(), &anchor); + nXStart=anchor.x; + nYStart=anchor.y; + } + res=(*pGDITextOutA)(hdc, nXStart, nYStart, lpString, cchString); + return res; +} + +BOOL WINAPI extRectangle(HDC hdc, int nLeftRect, int nTopRect, int nRightRect, int nBottomRect) +{ + OutTraceD("Rectangle: hdc=%x xy=(%d,%d)-(%d,%d)\n", hdc, nLeftRect, nTopRect, nRightRect, nBottomRect); + if (dxw.dwFlags1 & FIXTEXTOUT) { + POINT anchor; + anchor.x=nLeftRect; + anchor.y=nTopRect; + (*pClientToScreen)(dxw.GethWnd(), &anchor); + nLeftRect=anchor.x; + nTopRect=anchor.y; + anchor.x=nRightRect; + anchor.y=nBottomRect; + (*pClientToScreen)(dxw.GethWnd(), &anchor); + nRightRect=anchor.x; + nBottomRect=anchor.y; + } + return (*pGDIRectangle)(hdc, nLeftRect, nTopRect, nRightRect, nBottomRect); +} + +int WINAPI extFillRect(HDC hdc, const RECT *lprc, HBRUSH hbr) +{ + RECT rc, trim; + HWND hWnd; + OutTraceD("FillRect: hdc=%x xy=(%d,%d)-(%d,%d)\n", hdc, lprc->left, lprc->top, lprc->right, lprc->bottom); + memcpy(&rc, lprc, sizeof(rc)); + hWnd = WindowFromDC(hdc); + if((hWnd == dxw.GethWnd()) || + (hWnd == 0) || + (hWnd == GetDesktopWindow())){ + // trim: some games (Player Manager 98) clear the screen by filling an exagerated rect + (*pGetClientRect)(dxw.GethWnd(), &trim); + hdc=GetDC(dxw.GethWnd()); + dxw.MapWindowRect(&rc); + if(rc.left < trim.left) rc.left = trim.left; + if(rc.top < trim.top) rc.top = trim.top; + if(rc.right > trim.right) rc.right = trim.right; + if(rc.bottom > trim.bottom) rc.bottom = trim.bottom; + OutTraceD("FillRect: hwnd=%x hdc=%x fixed xy=(%d,%d)-(%d,%d)\n", hWnd, hdc, rc.left, rc.top, rc.right, rc.bottom); + } + if (dxw.dwFlags1 & FIXTEXTOUT) { + // to be verified: why shifting and not scaling? + POINT anchor; + anchor.x=rc.left; + anchor.y=rc.top; + (*pClientToScreen)(dxw.GethWnd(), &anchor); + rc.left=anchor.x; + rc.top=anchor.y; + anchor.x=rc.right; + anchor.y=rc.bottom; + (*pClientToScreen)(dxw.GethWnd(), &anchor); + rc.right=anchor.x; + rc.bottom=anchor.y; + } + return (*pFillRect)(hdc, &rc, hbr); +} + +HFONT WINAPI extCreateFont(int nHeight, int nWidth, int nEscapement, int nOrientation, int fnWeight, + DWORD fdwItalic, DWORD fdwUnderline, DWORD fdwStrikeOut, DWORD fdwCharSet, + DWORD fdwOutputPrecision, DWORD fdwClipPrecision, DWORD fdwQuality, + DWORD fdwPitchAndFamily, LPCTSTR lpszFace) +{ + OutTraceD("CreateFont: h=%d w=%d face=\"%s\"\n", nHeight, nWidth, lpszFace); + return (*pGDICreateFont)(nHeight, nWidth, nEscapement, nOrientation, fnWeight, + fdwItalic, fdwUnderline, fdwStrikeOut, fdwCharSet, + fdwOutputPrecision, fdwClipPrecision, NONANTIALIASED_QUALITY, + fdwPitchAndFamily, lpszFace); +} + +// CreateFontIndirect hook routine to avoid font aliasing that prevents reverse blitting working on palettized surfaces + +HFONT WINAPI extCreateFontIndirect(const LOGFONT* lplf) +{ + LOGFONT lf; + HFONT retHFont; + OutTraceD("CreateFontIndirect: h=%d w=%d face=\"%s\"\n", lplf->lfHeight, lplf->lfWidth, lplf->lfFaceName); + memcpy((char *)&lf, (char *)lplf, sizeof(LOGFONT)); + lf.lfQuality=NONANTIALIASED_QUALITY; + retHFont=((*pGDICreateFontIndirect)(&lf)); + if(retHFont) + OutTraceD("CreateFontIndirect: hfont=%x\n", retHFont); + else + OutTraceD("CreateFontIndirect: error=%d at %d\n", GetLastError(), __LINE__); + return retHFont; +} + +BOOL WINAPI extShowWindow(HWND hwnd, int nCmdShow) +{ + BOOL res; + + OutTraceD("ShowWindow: hwnd=%x, CmdShow=%x(%s)\n", hwnd, nCmdShow, ExplainShowCmd(nCmdShow)); + if (dxw.dwFlags1 & PREVENTMAXIMIZE){ + if(nCmdShow==SW_MAXIMIZE){ + OutTraceD("ShowWindow: suppress maximize\n"); + nCmdShow=SW_SHOWNORMAL; + } + } + + res=pShowWindow(hwnd, nCmdShow); + + return res; +} + +LONG WINAPI extGetWindowLong(HWND hwnd, int nIndex) +{ + LONG res; + + res=(*pGetWindowLong)(hwnd, nIndex); + + OutTraceD("GetWindowLong: hwnd=%x, Index=%x(%s) res=%x\n", hwnd, nIndex, ExplainSetWindowIndex(nIndex), res); + + if(nIndex==GWL_WNDPROC){ + WNDPROC wp; + wp=WhndGetWindowProc(hwnd); + OutTraceD("GetWindowLong: remapping WindowProc res=%x -> %x\n", res, (LONG)wp); + if(wp) res=(LONG)wp; // if not found, don't alter the value. + } + + return res; +} + +LONG WINAPI extSetWindowLong(HWND hwnd, int nIndex, LONG dwNewLong) +{ + LONG res; + + OutTraceD("SetWindowLong: hwnd=%x, Index=%x(%s) Val=%x\n", + hwnd, nIndex, ExplainSetWindowIndex(nIndex), dwNewLong); + + //if(!hwnd) hwnd=dxw.GethWnd(); + + if (dxw.dwFlags1 & LOCKWINSTYLE){ + if(nIndex==GWL_STYLE){ + OutTraceD("SetWindowLong: Lock GWL_STYLE=%x\n", dwNewLong); + //return 1; + return (*pGetWindowLong)(hwnd, nIndex); + } + if(nIndex==GWL_EXSTYLE){ + OutTraceD("SetWindowLong: Lock GWL_EXSTYLE=%x\n", dwNewLong); + //return 1; + return (*pGetWindowLong)(hwnd, nIndex); + } + } + + if (dxw.dwFlags1 & PREVENTMAXIMIZE){ + if(nIndex==GWL_STYLE){ + OutTraceD("SetWindowLong: GWL_STYLE %x suppress MAXIMIZE\n", dwNewLong); + dwNewLong |= WS_OVERLAPPEDWINDOW; + dwNewLong &= ~(WS_DLGFRAME|WS_MAXIMIZE|WS_POPUP|WS_VSCROLL|WS_HSCROLL|WS_CLIPSIBLINGS); + } + if(nIndex==GWL_EXSTYLE){ + OutTraceD("SetWindowLong: GWL_EXSTYLE %x suppress TOPMOST\n", dwNewLong); + dwNewLong = dwNewLong & ~(WS_EX_TOPMOST); + } + } + + if (dxw.dwFlags1 & FIXWINFRAME){ + if((nIndex==GWL_STYLE) && !(dwNewLong & WS_CHILD)){ + OutTraceD("SetWindowLong: GWL_STYLE %x force OVERLAPPEDWINDOW\n", dwNewLong); + dwNewLong |= WS_OVERLAPPEDWINDOW; + dwNewLong &= ~WS_CLIPSIBLINGS; + } + } + + if (nIndex==GWL_WNDPROC){ + long lres; + // GPL fix + if(hwnd==0) { + hwnd=dxw.GethWnd(); + OutTrace("SetWindowLong: NULL hwnd, FIXING hwnd=%x\n",hwnd); + } + // end of GPL fix + res=(LONG)WhndGetWindowProc(hwnd); + WhndStackPush(hwnd, (WNDPROC)dwNewLong); + SetLastError(0); + lres=(*pSetWindowLong)(hwnd, GWL_WNDPROC, (LONG)extWindowProc); + if(!lres && GetLastError())OutTraceE("SetWindowLong: ERROR err=%d at %d\n", GetLastError(), __LINE__); + } + else { + res=(*pSetWindowLong)(hwnd, nIndex, dwNewLong); + } + + OutTraceD("SetWindowLong: hwnd=%x, nIndex=%x, Val=%x, res=%x\n", hwnd, nIndex, dwNewLong, res); + return res; +} + +BOOL WINAPI extSetWindowPos(HWND hwnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, UINT uFlags) +{ + BOOL res; + + OutTraceD("SetWindowPos: hwnd=%x%s pos=(%d,%d) dim=(%d,%d) Flags=%x\n", + hwnd, dxw.IsFullScreen()?"(FULLSCREEN)":"", X, Y, cx, cy, uFlags); + + if ((hwnd != dxw.GethWnd()) || !dxw.IsFullScreen()){ + // just proxy + res=(*pSetWindowPos)(hwnd, hWndInsertAfter, X, Y, cx, cy, uFlags); + if(!res)OutTraceE("SetWindowPos: ERROR err=%d at %d\n", GetLastError(), __LINE__); + return res; + } + + if ((dxw.dwFlags1 & LOCKWINPOS) && dxw.IsFullScreen()){ + // Note: any attempt to change the window position, no matter where and how, through the + // SetWindowPos API is causing resizing to the default 1:1 pixed size in Commandos. + // in such cases, there is incompatibility between LOCKWINPOS and LOCKWINSTYLE. + return 1; + } + + if (dxw.dwFlags1 & PREVENTMAXIMIZE){ + int UpdFlag =0; + int MaxX, MaxY; + MaxX = dxw.iSizX; + MaxY = dxw.iSizY; + if (!MaxX) MaxX = dxw.GetScreenWidth(); + if (!MaxY) MaxY = dxw.GetScreenHeight(); + if(cx>MaxX) { cx=MaxX; UpdFlag=1; } + if(cy>MaxY) { cy=MaxY; UpdFlag=1; } + if (UpdFlag) + OutTraceD("SetWindowPos: using max dim=(%d,%d)\n", cx, cy); + } + + // useful??? to be demonstrated.... + // when altering main window in fullscreen mode, fix the coordinates for borders + DWORD dwCurStyle; + RECT rect; + rect.top=rect.left=0; + rect.right=cx; rect.bottom=cy; + dwCurStyle=(*pGetWindowLong)(hwnd, GWL_STYLE); + AdjustWindowRect(&rect, dwCurStyle, FALSE); + cx=rect.right; cy=rect.bottom; + OutTraceD("SetWindowPos: main form hwnd=%x fixed size=(%d,%d)\n", hwnd, cx, cy); + + res=(*pSetWindowPos)(hwnd, hWndInsertAfter, X, Y, cx, cy, uFlags); + if(!res)OutTraceE("SetWindowPos: ERROR err=%d at %d\n", GetLastError(), __LINE__); + return res; +} + +HDWP WINAPI extDeferWindowPos(HDWP hWinPosInfo, HWND hwnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, UINT uFlags) +{ + HDWP res; + + OutTraceD("DeferWindowPos: hwnd=%x%s pos=(%d,%d) dim=(%d,%d) Flags=%x\n", + hwnd, dxw.IsFullScreen()?"(FULLSCREEN)":"", X, Y, cx, cy, uFlags); + + if ((hwnd != dxw.GethWnd()) || !dxw.IsFullScreen()){ + // just proxy + res=(*pGDIDeferWindowPos)(hWinPosInfo, hwnd, hWndInsertAfter, X, Y, cx, cy, uFlags); + if(!res)OutTraceE("SetWindowPos: ERROR err=%d at %d\n", GetLastError(), __LINE__); + return res; + } + + if (dxw.dwFlags1 & LOCKWINPOS){ + return hWinPosInfo; + } + + if (dxw.dwFlags1 & PREVENTMAXIMIZE){ + int UpdFlag =0; + int MaxX, MaxY; + MaxX = dxw.iSizX; + MaxY = dxw.iSizY; + if (!MaxX) MaxX = dxw.GetScreenWidth(); + if (!MaxY) MaxY = dxw.GetScreenHeight(); + if(cx>MaxX) { cx=MaxX; UpdFlag=1; } + if(cy>MaxY) { cy=MaxY; UpdFlag=1; } + if (UpdFlag) + OutTraceD("SetWindowPos: using max dim=(%d,%d)\n", cx, cy); + } + + // useful??? to be demonstrated.... + // when altering main window in fullscreen mode, fix the coordinates for borders + DWORD dwCurStyle; + RECT rect; + rect.top=rect.left=0; + rect.right=cx; rect.bottom=cy; + dwCurStyle=(*pGetWindowLong)(hwnd, GWL_STYLE); + AdjustWindowRect(&rect, dwCurStyle, FALSE); + cx=rect.right; cy=rect.bottom; + OutTraceD("SetWindowPos: main form hwnd=%x fixed size=(%d,%d)\n", hwnd, cx, cy); + + res=(*pGDIDeferWindowPos)(hWinPosInfo, hwnd, hWndInsertAfter, X, Y, cx, cy, uFlags); + if(!res)OutTraceE("DeferWindowPos: ERROR err=%d at %d\n", GetLastError(), __LINE__); + return res; +} + +void dxwFixWindowPos(char *ApiName, HWND hwnd, LPARAM lParam) +{ + LPWINDOWPOS wp; + int MaxX, MaxY; + wp = (LPWINDOWPOS)lParam; + MaxX = dxw.iSizX; + MaxY = dxw.iSizY; + if (!MaxX) MaxX = dxw.GetScreenWidth(); + if (!MaxY) MaxY = dxw.GetScreenHeight(); + static int iLastCX, iLastCY; + static int BorderX=-1; + static int BorderY=-1; + int cx, cy; + + OutTraceD("%s: GOT hwnd=%x pos=(%d,%d) dim=(%d,%d) Flags=%x(%s)\n", + ApiName, hwnd, wp->x, wp->y, wp->cx, wp->cy, wp->flags, ExplainWPFlags(wp->flags)); + + if ((wp->flags & (SWP_NOMOVE|SWP_NOSIZE))==(SWP_NOMOVE|SWP_NOSIZE)) return; //v2.02.13 + //if (wp->flags & (SWP_NOMOVE|SWP_NOSIZE)) return; //v2.02.10 + + if ((dxw.dwFlags1 & LOCKWINPOS) && dxw.IsFullScreen() && (hwnd==dxw.GethWnd())){ + extern void CalculateWindowPos(HWND, DWORD, DWORD, LPWINDOWPOS); + CalculateWindowPos(hwnd, MaxX, MaxY, wp); + OutTraceD("%s: LOCK pos=(%d,%d) dim=(%d,%d)\n", ApiName, wp->x, wp->y, wp->cx, wp->cy); + } + + if ((dxw.dwFlags2 & KEEPASPECTRATIO) && dxw.IsFullScreen() && (hwnd==dxw.GethWnd())){ + // note: while keeping aspect ration, resizing from one corner doesn't tell + // which coordinate is prevalent to the other. We made an arbitrary choice. + // note: v2.1.93: compensation must refer to the client area, not the wp + // window dimensions that include the window borders. + if(BorderX==-1){ + RECT client, full; + (*pGetClientRect)(hwnd, &client); + (*pGetWindowRect)(hwnd, &full); + BorderX= full.right - full.left - client.right; + BorderY= full.bottom - full.top - client.bottom; + OutTraceD("%s: KEEPASPECTRATIO window borders=(%d,%d)\n", ApiName, BorderX, BorderY); + } + extern LRESULT LastCursorPos; + switch (LastCursorPos){ + case HTBOTTOM: + case HTTOP: + case HTBOTTOMLEFT: + case HTBOTTOMRIGHT: + case HTTOPLEFT: + case HTTOPRIGHT: + cx = BorderX + ((wp->cy - BorderY) * dxw.GetScreenWidth()) / dxw.GetScreenHeight(); + if(cx!=wp->cx){ + OutTraceD("%s: KEEPASPECTRATIO adjusted cx=%d->%d\n", ApiName, wp->cx, cx); + wp->cx = cx; + } + break; + case HTLEFT: + case HTRIGHT: + cy = BorderY + ((wp->cx - BorderX) * dxw.GetScreenHeight()) / dxw.GetScreenWidth(); + if(cy!=wp->cy){ + OutTraceD("%s: KEEPASPECTRATIO adjusted cy=%d->%d\n", ApiName, wp->cy, cy); + wp->cy = cy; + } + break; + } + } + + if (dxw.dwFlags1 & PREVENTMAXIMIZE){ + int UpdFlag = 0; + + if(wp->cx>MaxX) { wp->cx=MaxX; UpdFlag=1; } + if(wp->cy>MaxY) { wp->cy=MaxY; UpdFlag=1; } + if (UpdFlag) + OutTraceD("%s: SET max dim=(%d,%d)\n", ApiName, wp->cx, wp->cy); + } + + iLastCX= wp->cx; + iLastCY= wp->cy; +} + +void dxwFixMinMaxInfo(char *ApiName, HWND hwnd, LPARAM lParam) +{ + if (dxw.dwFlags1 & PREVENTMAXIMIZE){ + LPMINMAXINFO lpmmi; + lpmmi=(LPMINMAXINFO)lParam; + OutTraceD("%s: GOT MaxPosition=(%d,%d) MaxSize=(%d,%d)\n", ApiName, + lpmmi->ptMaxPosition.x, lpmmi->ptMaxPosition.y, lpmmi->ptMaxSize.x, lpmmi->ptMaxSize.y); + lpmmi->ptMaxPosition.x=0; + lpmmi->ptMaxPosition.y=0; + if(pSetDevMode){ + lpmmi->ptMaxSize.x = pSetDevMode->dmPelsWidth; + lpmmi->ptMaxSize.y = pSetDevMode->dmPelsHeight; + } + else{ + lpmmi->ptMaxSize.x = dxw.GetScreenWidth(); + lpmmi->ptMaxSize.y = dxw.GetScreenHeight(); + } + OutTraceD("%s: SET PREVENTMAXIMIZE MaxPosition=(%d,%d) MaxSize=(%d,%d)\n", ApiName, + lpmmi->ptMaxPosition.x, lpmmi->ptMaxPosition.y, lpmmi->ptMaxSize.x, lpmmi->ptMaxSize.y); + } + // v2.1.75: added logic to fix win coordinates to selected ones. + // fixes the problem with "Achtung Spitfire", that can't be managed through PREVENTMAXIMIZE flag. + if (dxw.dwFlags1 & LOCKWINPOS){ + LPMINMAXINFO lpmmi; + lpmmi=(LPMINMAXINFO)lParam; + OutTraceD("%s: GOT MaxPosition=(%d,%d) MaxSize=(%d,%d)\n", ApiName, + lpmmi->ptMaxPosition.x, lpmmi->ptMaxPosition.y, lpmmi->ptMaxSize.x, lpmmi->ptMaxSize.y); + lpmmi->ptMaxPosition.x=dxw.iPosX; + lpmmi->ptMaxPosition.y=dxw.iPosY; + lpmmi->ptMaxSize.x = dxw.iSizX ? dxw.iSizX : dxw.GetScreenWidth(); + lpmmi->ptMaxSize.y = dxw.iSizY ? dxw.iSizY : dxw.GetScreenHeight(); + OutTraceD("%s: SET LOCKWINPOS MaxPosition=(%d,%d) MaxSize=(%d,%d)\n", ApiName, + lpmmi->ptMaxPosition.x, lpmmi->ptMaxPosition.y, lpmmi->ptMaxSize.x, lpmmi->ptMaxSize.y); + } +} + +void dxwFixStyle(char *ApiName, HWND hwnd, LPARAM lParam) +{ + LPSTYLESTRUCT lpSS; + lpSS = (LPSTYLESTRUCT) lParam; + + OutTraceD("%s: new Style=%x(%s)\n", + ApiName, lpSS->styleNew, ExplainStyle(lpSS->styleNew)); + + if (dxw.dwFlags1 & FIXWINFRAME){ // set canonical style + lpSS->styleNew= WS_OVERLAPPEDWINDOW; + } + if (dxw.dwFlags1 & LOCKWINSTYLE){ // set to current value + lpSS->styleNew= (*pGetWindowLong)(hwnd, GWL_STYLE); + } + if (dxw.dwFlags1 & PREVENTMAXIMIZE){ // disable maximize settings + if (lpSS->styleNew & WS_MAXIMIZE){ + OutTraceD("%s: prevent maximize style\n", ApiName); + lpSS->styleNew &= ~WS_MAXIMIZE; + } + } +} + +void dxwFixExStyle(char *ApiName, HWND hwnd, LPARAM lParam) +{ + LPSTYLESTRUCT lpSS; + lpSS = (LPSTYLESTRUCT) lParam; + + OutTraceD("%s: new ExStyle=%x(%s)\n", + ApiName, lpSS->styleNew, ExplainExStyle(lpSS->styleNew)); + + if (dxw.dwFlags1 & FIXWINFRAME){ // set canonical style + lpSS->styleNew= 0; + } + if (dxw.dwFlags1 & LOCKWINSTYLE){ // set to current value + lpSS->styleNew= (*pGetWindowLong)(hwnd, GWL_EXSTYLE); + } + if (dxw.dwFlags1 & PREVENTMAXIMIZE){ // disable maximize settings + if (lpSS->styleNew & WS_EX_TOPMOST){ + OutTraceD("%s: prevent EXSTYLE topmost style\n", ApiName); + lpSS->styleNew &= ~WS_EX_TOPMOST; + } + } +} + +static LRESULT WINAPI FixWindowProc(char *ApiName, HWND hwnd, UINT Msg, WPARAM wParam, LPARAM *lpParam) +{ + LPARAM lParam; + + lParam=*lpParam; + OutTraceW("%s: hwnd=%x msg=[0x%x]%s(%x,%x)\n", + ApiName, hwnd, Msg, ExplainWinMessage(Msg), wParam, lParam); + + switch(Msg){ + // attempt to fix Sleepwalker + //case WM_NCCALCSIZE: + // if (dxw.dwFlags1 & PREVENTMAXIMIZE) + // return 0; + // break; + case WM_ERASEBKGND: + OutTraceD("%s: prevent erase background\n", ApiName); + return 1; // 1=erased + break; // useless + case WM_GETMINMAXINFO: + dxwFixMinMaxInfo(ApiName, hwnd, lParam); + break; + case WM_WINDOWPOSCHANGING: + case WM_WINDOWPOSCHANGED: + dxwFixWindowPos(ApiName, hwnd, lParam); + break; + case WM_STYLECHANGING: + case WM_STYLECHANGED: + if (wParam==GWL_STYLE) + dxwFixStyle(ApiName, hwnd, lParam); + else + dxwFixExStyle(ApiName, hwnd, lParam); + break; + case WM_DISPLAYCHANGE: + // too late? to be deleted.... + if ((dxw.dwFlags1 & LOCKWINPOS) && dxw.IsFullScreen()) return 0; + if (dxw.dwFlags1 & PREVENTMAXIMIZE){ + OutTraceD("%s: WM_DISPLAYCHANGE depth=%d size=(%d,%d)\n", + ApiName, wParam, HIWORD(lParam), LOWORD(lParam)); + return 0; + } + break; + case WM_SIZE: + if ((dxw.dwFlags1 & LOCKWINPOS) && dxw.IsFullScreen()) return 0; + if (dxw.dwFlags1 & PREVENTMAXIMIZE){ + if ((wParam == SIZE_MAXIMIZED)||(wParam == SIZE_MAXSHOW)){ + OutTraceD("%s: prevent screen SIZE to fullscreen wparam=%d(%s) size=(%d,%d)\n", ApiName, + wParam, ExplainResizing(wParam), HIWORD(lParam), LOWORD(lParam)); + return 0; // checked + //lParam = MAKELPARAM(dxw.GetScreenWidth(), dxw.GetScreenHeight()); + //OutTraceD("%s: updated SIZE wparam=%d(%s) size=(%d,%d)\n", ApiName, + // wParam, ExplainResizing(wParam), HIWORD(lParam), LOWORD(lParam)); + } + } + break; + default: + break; + } + + // marker to run hooked function + return(-1); +} + +LRESULT WINAPI extCallWindowProc(WNDPROC lpPrevWndFunc, HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) +{ + HRESULT res; + + res=FixWindowProc("CallWindowProc", hwnd, Msg, wParam, &lParam); + + if (res==(HRESULT)-1) + return (*pCallWindowProc)(lpPrevWndFunc, hwnd, Msg, wParam, lParam); + else + return res; +} + +LRESULT WINAPI extDefWindowProc(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) +{ + HRESULT res; + + res=FixWindowProc("DefWindowProc", hwnd, Msg, wParam, &lParam); + + if (res==(HRESULT)-1) + return (*pDefWindowProc)(hwnd, Msg, wParam, lParam); + else + return res; +} + +int WINAPI extGetDeviceCaps(HDC hdc, int nindex) +{ + DWORD res; + + res = (*pGDIGetDeviceCaps)(hdc, nindex); + OutTraceD("GetDeviceCaps: hdc=%x index=%x(%s) res=%x\n", + hdc, nindex, ExplainDeviceCaps(nindex), res); + + // if you have a bypassed setting, use it first! + if(pSetDevMode){ + switch(nindex){ + case BITSPIXEL: + case COLORRES: + res = pSetDevMode->dmBitsPerPel; + OutTraceD("GetDeviceCaps: fix BITSPIXEL/COLORRES cap=%x\n",res); + return res; + case HORZRES: + res = pSetDevMode->dmPelsWidth; + OutTraceD("GetDeviceCaps: fix HORZRES cap=%d\n", res); + return res; + case VERTRES: + res = pSetDevMode->dmPelsHeight; + OutTraceD("GetDeviceCaps: fix VERTRES cap=%d\n", res); + return res; + } + } + + switch(nindex){ + case VERTRES: + res= dxw.GetScreenHeight(); + OutTraceD("GetDeviceCaps: fix VERTRES cap=%d\n", res); + break; + case HORZRES: + res= dxw.GetScreenWidth(); + OutTraceD("GetDeviceCaps: fix HORZRES cap=%d\n", res); + break; + // WARNING: in no-emu mode, the INIT8BPP and INIT16BPP flags expose capabilities that + // are NOT implemented and may cause later troubles! + case RASTERCAPS: + if(dxw.dwFlags2 & INIT8BPP) { + res |= RC_PALETTE; // v2.02.12 + OutTraceD("GetDeviceCaps: fix RASTERCAPS setting RC_PALETTE cap=%x\n",res); + } + break; + case BITSPIXEL: + case COLORRES: + if(dxw.dwFlags2 & INIT8BPP|INIT16BPP){ + if(dxw.dwFlags2 & INIT8BPP) res = 8; + if(dxw.dwFlags2 & INIT16BPP) res = 16; + OutTraceD("GetDeviceCaps: fix BITSPIXEL/COLORRES cap=%d\n",res); + } + break; + } + + if(dxw.dwFlags1 & EMULATESURFACE){ + switch(nindex){ + case RASTERCAPS: + if((dxw.VirtualPixelFormat.dwRGBBitCount==8) || (dxw.dwFlags2 & INIT8BPP)){ + res = RC_PALETTE; + OutTraceD("GetDeviceCaps: fix RASTERCAPS setting RC_PALETTE cap=%x\n",res); + } + break; + case BITSPIXEL: + case COLORRES: + int PrevRes; + PrevRes=res; + if(dxw.VirtualPixelFormat.dwRGBBitCount!=0) res = dxw.VirtualPixelFormat.dwRGBBitCount; + if(dxw.dwFlags2 & INIT8BPP) res = 8; + if(dxw.dwFlags2 & INIT16BPP) res = 16; + if(PrevRes != res) OutTraceD("GetDeviceCaps: fix BITSPIXEL/COLORRES cap=%d\n",res); + break; + case SIZEPALETTE: + res = 256; + OutTraceD("GetDeviceCaps: fix SIZEPALETTE cap=%x\n",res); + break; + case NUMRESERVED: + res = 0; + OutTraceD("GetDeviceCaps: fix NUMRESERVED cap=%x\n",res); + break; + } + } + return res; +} + +int WINAPI extGetSystemMetrics(int nindex) +{ + HRESULT res; + + res=(*pGetSystemMetrics)(nindex); + OutTraceD("GetSystemMetrics: index=%x(%s), res=%d\n", nindex, ExplainsSystemMetrics(nindex), res); + + // if you have a bypassed setting, use it first! + if(pSetDevMode){ + switch(nindex){ + case SM_CXFULLSCREEN: + case SM_CXSCREEN: + res = pSetDevMode->dmPelsWidth; + OutTraceD("GetDeviceCaps: fix HORZRES cap=%d\n", res); + return res; + case SM_CYFULLSCREEN: + case SM_CYSCREEN: + res = pSetDevMode->dmPelsHeight; + OutTraceD("GetDeviceCaps: fix VERTRES cap=%d\n", res); + return res; + } + } + + switch(nindex){ + case SM_CXFULLSCREEN: + case SM_CXSCREEN: + res= dxw.GetScreenWidth(); + OutTraceD("GetSystemMetrics: fix SM_CXSCREEN=%d\n", res); + break; + case SM_CYFULLSCREEN: + case SM_CYSCREEN: + res= dxw.GetScreenHeight(); + OutTraceD("GetSystemMetrics: fix SM_CYSCREEN=%d\n", res); + break; + case SM_CMONITORS: + if((dxw.dwFlags2 & HIDEMULTIMONITOR) && res>1) { + res=1; + OutTraceD("GetSystemMetrics: fix SM_CMONITORS=%d\n", res); + } + break; + } + + return res; +} + +BOOL WINAPI extScaleWindowExtEx(HDC hdc, int Xnum, int Xdenom, int Ynum, int Ydenom, LPSIZE lpSize) +{ + OutTraceD("ScaleWindowExtEx: hdc=%x num=(%d,%d) denom=(%d,%d) lpSize=%d\n", + hdc, Xnum, Ynum, Xdenom, Ydenom, lpSize); + + if ((dxw.dwFlags1 & LOCKWINPOS) && dxw.IsFullScreen()) return 1; + + return (*pGDIScaleWindowExtEx)(hdc, Xnum, Xdenom, Ynum, Ydenom, lpSize); +} + +LONG WINAPI MyChangeDisplaySettings(char *fname, DEVMODE *lpDevMode, DWORD dwflags) +{ + HRESULT res; + + // save desired settings first v.2.1.89 + // v2.1.95 protect when lpDevMode is null (closing game... Jedi Outcast + if(lpDevMode) + dxw.SetScreenSize(lpDevMode->dmPelsWidth, lpDevMode->dmPelsHeight); + + if ((dwflags==0 || dwflags==CDS_FULLSCREEN) && lpDevMode){ + + // v2.2.21: save desired mode to possible use in EnumDisplaySettings wrapper v2.2.21 + SetDevMode=*lpDevMode; + pSetDevMode=&SetDevMode; + + if (dxw.dwFlags1 & EMULATESURFACE){ + OutTraceD("%s: BYPASS res=DISP_CHANGE_SUCCESSFUL\n", fname); + return DISP_CHANGE_SUCCESSFUL; + } + else{ + DEVMODE NewMode, TryMode; + int i; + + // set the proper mode + NewMode = *lpDevMode; + NewMode.dmPelsHeight = (*GetSystemMetrics)(SM_CYSCREEN); + NewMode.dmPelsWidth = (*GetSystemMetrics)(SM_CXSCREEN); + TryMode.dmSize = sizeof(TryMode); + OutTraceD("ChangeDisplaySettings: DEBUG looking for size=(%d x %d) bpp=%d\n", + NewMode.dmPelsWidth, NewMode.dmPelsHeight, NewMode.dmBitsPerPel); + for(i=0; ;i++){ + if (pEnumDisplaySettings) + res=(*pEnumDisplaySettings)(NULL, i, &TryMode); + else + res=EnumDisplaySettings(NULL, i, &TryMode); + if(res==0) { + OutTraceE("%s: ERROR unable to find a matching video mode among %d ones\n", fname, i); + return DISP_CHANGE_FAILED; + } + //OutTraceD("ChangeDisplaySettings: DEBUG index=%d size=(%d x %d) bpp=%x\n", + // i, TryMode.dmPelsWidth, TryMode.dmPelsHeight, TryMode.dmBitsPerPel); + if((NewMode.dmBitsPerPel==TryMode.dmBitsPerPel) && + (NewMode.dmPelsHeight==TryMode.dmPelsHeight) && + (NewMode.dmPelsWidth==TryMode.dmPelsWidth)) break; + } + if(dwflags==CDS_FULLSCREEN) dwflags=0; // no FULLSCREEN + res=(*ChangeDisplaySettings)(&TryMode, dwflags); + OutTraceD("%s: fixed size=(%d x %d) bpp=%d res=%x(%s)\n", + fname, NewMode.dmPelsWidth, NewMode.dmPelsHeight, NewMode.dmBitsPerPel, + res, ExplainDisplaySettingsRetcode(res)); + return res; + } + } + else + return (*ChangeDisplaySettings)(lpDevMode, dwflags); +} + +LONG WINAPI extChangeDisplaySettings(DEVMODE *lpDevMode, DWORD dwflags) +{ + if(IsTraceD){ + OutTrace("ChangeDisplaySettings: lpDevMode=%x flags=%x", lpDevMode, dwflags); + if (lpDevMode) OutTrace(" size=(%d x %d) bpp=%x", + lpDevMode->dmPelsWidth, lpDevMode->dmPelsHeight, lpDevMode->dmBitsPerPel); + OutTrace("\n"); + } + + return MyChangeDisplaySettings("ChangeDisplaySettings", lpDevMode, dwflags); +} + +LONG WINAPI extChangeDisplaySettingsEx(LPCTSTR lpszDeviceName, DEVMODE *lpDevMode, HWND hwnd, DWORD dwflags, LPVOID lParam) +{ + if(IsTraceD){ + OutTrace("ChangeDisplaySettingsEx: DeviceName=%s lpDevMode=%x flags=%x", lpszDeviceName, lpDevMode, dwflags); + if (lpDevMode) OutTrace(" size=(%d x %d) bpp=%x", + lpDevMode->dmPelsWidth, lpDevMode->dmPelsHeight, lpDevMode->dmBitsPerPel); + OutTrace("\n"); + } + + return MyChangeDisplaySettings("ChangeDisplaySettingsEx", lpDevMode, dwflags); +} + +LONG WINAPI extEnumDisplaySettings(LPCTSTR lpszDeviceName, DWORD iModeNum, DEVMODE *lpDevMode) +{ + OutTraceD("EnumDisplaySettings: Devicename=%s ModeNum=%x\n", lpszDeviceName, iModeNum); + if(pSetDevMode && iModeNum==ENUM_CURRENT_SETTINGS){ + lpDevMode=pSetDevMode; + return 1; + } + else + return (*pEnumDisplaySettings)(lpszDeviceName, iModeNum, lpDevMode); +} + +BOOL WINAPI extSetWindowPlacement(const WINDOWPLACEMENT*lpwndpl) +{ + OutTraceD("SetWindowPlacement: BYPASS\n"); + return 1; +} + +ATOM WINAPI extRegisterClassExA(WNDCLASSEX *lpwcx) +{ + OutTraceD("RegisterClassEx: PROXED ClassName=%s style=%x(%s)\n", + lpwcx->lpszClassName, lpwcx->style, ExplainStyle(lpwcx->style)); + return (*pRegisterClassExA)(lpwcx); +} + +BOOL WINAPI extClientToScreen(HWND hwnd, LPPOINT lppoint) +{ + // v2.02.10: fully revised to handle scaled windows + BOOL res; + + OutTraceB("ClientToScreen: hwnd=%x hWnd=%x FullScreen=%x point=(%d,%d)\n", + hwnd, dxw.GethWnd(), dxw.IsFullScreen(), lppoint->x, lppoint->y); + if (lppoint && dxw.IsFullScreen()){ + *lppoint = dxw.AddCoordinates(*lppoint, dxw.ClientOffset(hwnd)); + OutTraceB("ClientToScreen: FIXED point=(%d,%d)\n", lppoint->x, lppoint->y); + res=TRUE; + } + else { + res=(*pClientToScreen)(hwnd, lppoint); + } + return res; +} + +BOOL WINAPI extScreenToClient(HWND hwnd, LPPOINT lppoint) +{ + // v2.02.10: fully revised to handle scaled windows + BOOL res; + OutTraceB("ScreenToClient: hwnd=%x hWnd=%x FullScreen=%x point=(%d,%d)\n", + hwnd, dxw.GethWnd(), dxw.IsFullScreen(), lppoint->x, lppoint->y); + + if (lppoint && (lppoint->x == -32000) && (lppoint->y == -32000)) return 1; + + if (lppoint && dxw.IsFullScreen()){ + *lppoint = dxw.SubCoordinates(*lppoint, dxw.ClientOffset(hwnd)); + OutTraceB("ScreenToClient: FIXED point=(%d,%d)\n", lppoint->x, lppoint->y); + res=TRUE; + } + else { + res=(*pScreenToClient)(hwnd, lppoint); + } + return res; +} + +BOOL WINAPI extGetClientRect(HWND hwnd, LPRECT lpRect) +{ + BOOL ret; + OutTraceB("GetClientRect: whnd=%x FullScreen=%x\n", hwnd, dxw.IsFullScreen()); + + if(!lpRect) return 0; + + // proxed call + ret=(*pGetClientRect)(hwnd, lpRect); + if(!ret) { + OutTraceE("GetClientRect: ERROR hwnd=%x err=%d at %d\n", hwnd, GetLastError(), __LINE__); + return ret; + } + OutTraceB("GetClientRect: actual rect=(%d,%d)-(%d,%d)\n", lpRect->left, lpRect->top, lpRect->right, lpRect->bottom); + + if (dxw.IsDesktop(hwnd)){ + *lpRect = dxw.GetScreenRect(); + OutTraceB("GetClientRect: desktop rect=(%d,%d)-(%d,%d)\n", lpRect->left, lpRect->top, lpRect->right, lpRect->bottom); + } + else + if (dxw.IsFullScreen()){ + *lpRect=dxw.GetClientRect(*lpRect); + OutTraceB("GetClientRect: fixed rect=(%d,%d)-(%d,%d)\n", lpRect->left, lpRect->top, lpRect->right, lpRect->bottom); + } + return ret; +} + +BOOL WINAPI extGetWindowRect(HWND hwnd, LPRECT lpRect) +{ + BOOL ret; + OutTraceB("GetWindowRect: hwnd=%x hWnd=%x FullScreen=%x\n", hwnd, dxw.GethWnd(), dxw.IsFullScreen()); + ret=(*pGetWindowRect)(hwnd, lpRect); + if(!ret) { + OutTraceE("GetWindowRect: GetWindowRect hwnd=%x error %d at %d\n", hwnd, GetLastError(), __LINE__); + return ret; + } + OutTraceB("GetWindowRect: rect=(%d,%d)-(%d,%d)\n", lpRect->left, lpRect->top, lpRect->right, lpRect->bottom); + + // minimized windows behaviour + if((lpRect->left == -32000)||(lpRect->top == -32000)) return ret; + + if (dxw.IsDesktop(hwnd)){ + // to avoid keeping track of window frame + *lpRect = dxw.GetScreenRect(); + OutTraceB("GetWindowRect: desktop rect=(%d,%d)-(%d,%d)\n", lpRect->left, lpRect->top, lpRect->right, lpRect->bottom); + } + else + if (dxw.IsFullScreen()){ + *lpRect=dxw.GetWindowRect(*lpRect); + + // Diablo fix: it retrieves coordinates for the explorer window, that are as big as the real desktop!!! + if(lpRect->left < 0) lpRect->left=0; + if(lpRect->right > (LONG)dxw.GetScreenWidth()) lpRect->right=dxw.GetScreenWidth(); + if(lpRect->top < 0) lpRect->top=0; + if(lpRect->bottom > (LONG)dxw.GetScreenHeight()) lpRect->bottom=dxw.GetScreenHeight(); + + OutTraceB("GetWindowRect: fixed rect=(%d,%d)-(%d,%d)\n", lpRect->left, lpRect->top, lpRect->right, lpRect->bottom); + } + + return ret; +} + +int WINAPI extMapWindowPoints(HWND hWndFrom, HWND hWndTo, LPPOINT lpPoints, UINT cPoints) +{ + // a rarely used API, but responsible for a painful headache: needs hooking for "Commandos 2". + + OutTraceD("MapWindowPoints: hWndFrom=%x hWndTo=%x cPoints=%d FullScreen=%x\n", + hWndFrom, hWndTo, cPoints, dxw.IsFullScreen()); + if(IsDebug){ + UINT pi; + OutTrace("Points: "); + for(pi=0; pihwnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg, + lpMsg->message, ExplainWinMessage(lpMsg->message & 0xFFFF), + lpMsg->wParam, lpMsg->lParam, lpMsg->pt.x, lpMsg->pt.y, res); + + // v2.1.74: skip message fix for WM_CHAR to avoid double typing bug + switch(lpMsg->message){ + //case WM_CHAR: + case WM_KEYUP: + case WM_KEYDOWN: + return res; + } + + // fix to avoid crash in Warhammer Final Liberation, that evidently intercepts mouse position by + // peeking & removing messages from window queue and considering the lParam parameter. + // v2.1.100 - never alter the mlMsg, otherwise the message is duplicated in the queue! Work on a copy of it. + if(wRemoveMsg){ + static MSG MsgCopy; + MsgCopy=*lpMsg; + MsgCopy.pt=FixMessagePt(dxw.GethWnd(), MsgCopy.pt); + if((MsgCopy.message <= WM_MOUSELAST) && (MsgCopy.message >= WM_MOUSEFIRST)) MsgCopy.lParam = MAKELPARAM(MsgCopy.pt.x, MsgCopy.pt.y); + OutTraceC("PeekMessage: fixed lparam/pt=(%d,%d)\n", MsgCopy.pt.x, MsgCopy.pt.y); + lpMsg=&MsgCopy; + GetHookInfo()->CursorX=(short)MsgCopy.pt.x; + GetHookInfo()->CursorY=(short)MsgCopy.pt.y; + } + + return res; +} + +BOOL WINAPI extGetMessage(LPMSG lpMsg, HWND hwnd, UINT wMsgFilterMin, UINT wMsgFilterMax) +{ + BOOL res; + HWND FixedHwnd; + + res=(*pGetMessage)(lpMsg, hwnd, wMsgFilterMin, wMsgFilterMax); + + OutTraceW("GetMessage: lpmsg=%x hwnd=%x filter=(%x-%x) msg=%x(%s) wparam=%x, lparam=%x pt=(%d,%d) res=%x\n", + lpMsg, lpMsg->hwnd, wMsgFilterMin, wMsgFilterMax, + lpMsg->message, ExplainWinMessage(lpMsg->message & 0xFFFF), + lpMsg->wParam, lpMsg->lParam, lpMsg->pt.x, lpMsg->pt.y, res); + + // V2.1.68: processing ALL mouse events, to sync mouse over and mouse click events + // in "Uprising 2", now perfectly working. + DWORD Message; + Message=lpMsg->message & 0xFFFF; + if((Message <= WM_MOUSELAST) && (Message >= WM_MOUSEFIRST)){ + FixedHwnd=(hwnd)?hwnd:dxw.GethWnd(); + lpMsg->pt=FixMessagePt(FixedHwnd, lpMsg->pt); + lpMsg->lParam = MAKELPARAM(lpMsg->pt.x, lpMsg->pt.y); + OutTraceC("PeekMessage: fixed lparam/pt=(%d,%d)\n", lpMsg->pt.x, lpMsg->pt.y); + GetHookInfo()->CursorX=(short)lpMsg->pt.x; + GetHookInfo()->CursorY=(short)lpMsg->pt.y; + } + return res; +} + +// intercept GetProcAddress to initialize DirectDraw hook pointers. +// This is necessary in "The Sims" game, that loads DirectDraw dinamically + + +extern void HookModule(HMODULE, int); +extern void HookSysLibs(HMODULE); + +HMODULE SysLibs[SYSLIBIDX_MAX]; + +HMODULE WINAPI LoadLibraryExWrapper(LPCTSTR lpFileName, HANDLE hFile, DWORD dwFlags, char *api) +{ + HMODULE libhandle; + int idx; + + //if(!strcmp(lpFileName, "d3d9.dll") && GetModuleHandle(lpFileName)) return GetModuleHandle(lpFileName); // attempt to avoid loading same dll twice.... + + libhandle=(*pLoadLibraryExA)(lpFileName, hFile, dwFlags); + OutTraceD("%s: FileName=%s hFile=%x Flags=%x(%s) hmodule=%x\n", api, lpFileName, hFile, dwFlags, ExplainLoadLibFlags(dwFlags), libhandle); + if(!libhandle){ + OutTraceE("%s: ERROR FileName=%s err=%d\n", api, lpFileName, GetLastError()); + return libhandle; + } + + // when loaded with LOAD_LIBRARY_AS_DATAFILE or LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE flags, + // there's no symbol map, then itìs no possible to hook function calls. + if(dwFlags & (LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE|LOAD_LIBRARY_AS_DATAFILE)) return libhandle; + + idx=dxw.GetDLLIndex((char *)lpFileName); + if(idx != -1) SysLibs[idx]=libhandle; + // handle custom OpenGL library + if(!lstrcmpi(lpFileName,dxw.CustomOpenGLLib)){ + idx=SYSLIBIDX_OPENGL; + SysLibs[idx]=libhandle; + } + //if (idx == SYSLIBIDX_MAX) HookModule(libhandle, 0); + if (idx == SYSLIBIDX_DIRECT3D9) { + HookSysLibs(libhandle); // trap D3D9 GetProcAddress calls + HookDirect3D(libhandle, 9); + } + if (idx == -1) HookModule(libhandle, 0); + return libhandle; +} + +HMODULE WINAPI extLoadLibraryA(LPCTSTR lpFileName) +{ + return LoadLibraryExWrapper(lpFileName, NULL, 0, "LoadLibraryA"); +} + +HMODULE WINAPI extLoadLibraryW(LPCWSTR lpFileName) +{ + char sFileName[256+1]; + wcstombs_s(NULL, sFileName, lpFileName, 80); + return LoadLibraryExWrapper(sFileName, NULL, 0, "LoadLibraryW");; +} + +HMODULE WINAPI extLoadLibraryExA(LPCTSTR lpFileName, HANDLE hFile, DWORD dwFlags) +{ + return LoadLibraryExWrapper(lpFileName, hFile, dwFlags, "LoadLibraryExA"); +} + +HMODULE WINAPI extLoadLibraryExW(LPCWSTR lpFileName, HANDLE hFile, DWORD dwFlags) +{ + char sFileName[256+1]; + wcstombs_s(NULL, sFileName, lpFileName, 80); + return LoadLibraryExWrapper(sFileName, hFile, dwFlags, "LoadLibraryExW");; +} + +extern DirectDrawCreate_Type pDirectDrawCreate; +extern DirectDrawCreateEx_Type pDirectDrawCreateEx; +extern HRESULT WINAPI extDirectDrawCreate(GUID FAR *, LPDIRECTDRAW FAR *, IUnknown FAR *); +extern HRESULT WINAPI extDirectDrawCreateEx(GUID FAR *, LPDIRECTDRAW FAR *, REFIID, IUnknown FAR *); +extern GetProcAddress_Type pGetProcAddress; +//extern HRESULT STDAPICALLTYPE extCoCreateInstance(REFCLSID, LPUNKNOWN, DWORD, REFIID, LPVOID FAR*); + +FARPROC WINAPI extGetProcAddress(HMODULE hModule, LPCSTR proc) +{ + FARPROC ret; + int idx; + + // WARNING: seems to be called with bad LPCSTR value.... + // from MSDN: + // The function or variable name, or the function's ordinal value. + // If this parameter is an ordinal value, it must be in the low-order word; + // the high-order word must be zero. + + OutTraceD("GetProcAddress: hModule=%x proc=%s\n", hModule, ProcToString(proc)); + + for(idx=0; idx%x\n", hwnd, dxw.GethWnd()); + lochwnd=dxw.GethWnd(); + } + ret=(*pGDIGetDC)(lochwnd); + if(ret){ + OutTraceD("GDI.GetDC: hwnd=%x ret=%x\n", lochwnd, ret); + } + else{ + int err; + err=GetLastError(); + OutTraceE("GDI.GetDC ERROR: hwnd=%x err=%d at %d\n", lochwnd, err, __LINE__); + if((err==ERROR_INVALID_WINDOW_HANDLE) && (lochwnd!=hwnd)){ + ret=(*pGDIGetDC)(hwnd); + if(ret) + OutTraceD("GDI.GetDC: hwnd=%x ret=%x\n", hwnd, ret); + else + OutTraceE("GDI.GetDC ERROR: hwnd=%x err=%d at %d\n", hwnd, GetLastError(), __LINE__); + } + } + + return ret; +} + +HDC WINAPI extGDIGetWindowDC(HWND hwnd) +{ + HDC ret; + HWND lochwnd; + OutTraceD("GDI.GetWindowDC: hwnd=%x\n", hwnd); + lochwnd=hwnd; + if ((hwnd==0) || (hwnd==(*pGetDesktopWindow)())) { + OutTraceD("GDI.GetWindowDC: desktop remapping hwnd=%x->%x\n", hwnd, dxw.GethWnd()); + lochwnd=dxw.GethWnd(); + } + ret=(*pGDIGetWindowDC)(lochwnd); + if(ret){ + OutTraceD("GDI.GetWindowDC: hwnd=%x ret=%x\n", lochwnd, ret); + } + else{ + int err; + err=GetLastError(); + OutTraceE("GDI.GetWindowDC ERROR: hwnd=%x err=%d at %d\n", lochwnd, err, __LINE__); + if((err==ERROR_INVALID_WINDOW_HANDLE) && (lochwnd!=hwnd)){ + ret=(*pGDIGetWindowDC)(hwnd); + if(ret) + OutTraceD("GDI.GetWindowDC: hwnd=%x ret=%x\n", hwnd, ret); + else + OutTraceE("GDI.GetWindowDC ERROR: hwnd=%x err=%d at %d\n", hwnd, GetLastError(), __LINE__); + } + } + return ret; +} + +int WINAPI extGDIReleaseDC(HWND hwnd, HDC hDC) +{ + int res; + + OutTraceD("GDI.ReleaseDC: hwnd=%x hdc=%x\n", hwnd, hDC); + if (hwnd==0) hwnd=dxw.GethWnd(); + res=(*pGDIReleaseDC)(hwnd, hDC); + if (!res) OutTraceE("GDI.ReleaseDC ERROR: err=%d at %d\n", GetLastError(), __LINE__); + return(res); +} + +HDC WINAPI extGDICreateDC(LPSTR Driver, LPSTR Device, LPSTR Output, CONST DEVMODE *InitData) +{ + HDC WinHDC, RetHDC; + OutTraceD("GDI.CreateDC: Driver=%s Device=%s Output=%s InitData=%x\n", + Driver?Driver:"(NULL)", Device?Device:"(NULL)", Output?Output:"(NULL)", InitData); + + if (!Driver || !strncmp(Driver,"DISPLAY",7)) { + OutTraceD("GDI.CreateDC: returning window surface DC\n"); + WinHDC=(*pGDIGetDC)(dxw.GethWnd()); + RetHDC=(*pGDICreateCompatibleDC)(WinHDC); + (*pGDIReleaseDC)(dxw.GethWnd(), WinHDC); + } + else{ + RetHDC=(*pGDICreateDC)(Driver, Device, Output, InitData); + } + if(RetHDC) + OutTraceD("GDI.CreateDC: returning HDC=%x\n", RetHDC); + else + OutTraceE("GDI.CreateDC ERROR: err=%d at %d\n", GetLastError(), __LINE__); + return RetHDC; +} + +HDC WINAPI extGDICreateCompatibleDC(HDC hdc) +{ + HDC RetHdc, SrcHdc; + extern LPDIRECTDRAWSURFACE lpDDSHDC; + extern GetDC_Type pGetDC; + DWORD LastError; + + OutTraceD("GDI.CreateCompatibleDC: hdc=%x\n", hdc); + if(hdc==0){ + SrcHdc=(*pGDIGetDC)(dxw.GethWnd()); + OutTraceD("GDI.CreateCompatibleDC: duplicating win HDC hWnd=%x\n", dxw.GethWnd()); + } + + // eliminated error message for errorcode 0. + SetLastError(0); + RetHdc=(*pGDICreateCompatibleDC)(hdc); + LastError=GetLastError(); + if(!LastError) + OutTraceD("GDI.CreateCompatibleDC: returning HDC=%x\n", RetHdc); + else + OutTraceE("GDI.CreateCompatibleDC ERROR: err=%d at %d\n", LastError, __LINE__); + return RetHdc; +} + +BOOL WINAPI extGDIBitBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HDC hdcSrc, int nXSrc, int nYSrc, DWORD dwRop) +{ + BOOL res; + extern BOOL isWithinDialog; + + OutTraceD("GDI.BitBlt: HDC=%x nXDest=%d nYDest=%d nWidth=%d nHeight=%d hdcSrc=%x nXSrc=%d nYSrc=%d dwRop=%x(%s)\n", + hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop, ExplainROP(dwRop)); + + if (dxw.HandleFPS()) return TRUE; + + // beware: HDC could refer to screen DC that are written directly on screen, or memory DC that will be scaled to + // the screen surface later on, on ReleaseDC or ddraw Blit / Flip operation. Scaling of rect coordinates is + // needed only in the first case, and must be avoided on the second, otherwise the image would be scaled twice! + + if (dxw.IsFullScreen() && (OBJ_DC == GetObjectType(hdcDest))){ + int nWDest, nHDest; + nWDest= nWidth; + nHDest= nHeight; + dxw.MapClient(&nXDest, &nYDest, &nWDest, &nHDest); + if (dxw.dwFlags2 & SHOWFPSOVERLAY) dxw.ShowFPS(hdcDest); + res=(*pGDIStretchBlt)(hdcDest, nXDest, nYDest, nWDest, nHDest, hdcSrc, nXSrc, nYSrc, nWidth, nHeight, dwRop); + } + else { + res=(*pGDIBitBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop); + } + if(!res) OutTraceE("GDI.BitBlt: ERROR err=%d at %d\n", GetLastError(), __LINE__); + + return res; +} + +BOOL WINAPI extGDIPatBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, DWORD dwRop) +{ + BOOL res; + + OutTraceD("GDI.PatBlt: HDC=%x nXDest=%d nYDest=%d nWidth=%d nHeight=%d dwRop=%x(%s)\n", + hdcDest, nXDest, nYDest, nWidth, nHeight, dwRop, ExplainROP(dwRop)); + + if (dxw.HandleFPS()) return TRUE; + + if (dxw.IsFullScreen() && (OBJ_DC == GetObjectType(hdcDest))){ + int nWDest, nHDest; + dxw.MapClient(&nXDest, &nYDest, &nWDest, &nHDest); + if (dxw.dwFlags2 & SHOWFPSOVERLAY) dxw.ShowFPS(hdcDest); + res=(*pGDIPatBlt)(hdcDest, nXDest, nYDest, nWDest, nHDest, dwRop); + } + else { + res=(*pGDIPatBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, dwRop); + } + if(!res) OutTraceE("GDI.PatBlt: ERROR err=%d at %d\n", GetLastError(), __LINE__); + + return res; +} + +BOOL WINAPI extGDIStretchBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, + HDC hdcSrc, int nXSrc, int nYSrc, int nWSrc, int nHSrc, DWORD dwRop) +{ + BOOL res; + + OutTraceD("GDI.StretchBlt: HDC=%x nXDest=%d nYDest=%d nWidth=%d nHeight=%d hdcSrc=%x nXSrc=%d nYSrc=%d nWSrc=%d nHSrc=%d dwRop=%x(%s)\n", + hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, nWSrc, nHSrc, dwRop, ExplainROP(dwRop)); + + if (dxw.HandleFPS()) return TRUE; + + // to do: what happend if StretchBlt is applied on screen DC ? + + if (dxw.dwFlags2 & SHOWFPSOVERLAY) dxw.ShowFPS(hdcDest); + res=(*pGDIStretchBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, nWSrc, nHSrc, dwRop); + if(!res) OutTraceE("GDI.StretchBlt: ERROR err=%d at %d\n", GetLastError(), __LINE__); + return res; +} + +BOOL WINAPI extGDIDeleteDC(HDC hdc) +{ + BOOL res; + OutTraceD("GDI.DeleteDC: hdc=%x\n", hdc); + res=(*pGDIDeleteDC)(hdc); + if(!res) OutTraceE("GDI.DeleteDC: ERROR err=%d at %d\n", GetLastError(), __LINE__); + return res; +} + +static HANDLE AutoRefreshThread; +static DWORD dwThrdId; +void AutoRefresh(HDC hdc) +{ + while(1){ + (*pSleep)(10); + (*pInvalidateRect)(dxw.GethWnd(), 0, FALSE); + } +} + +int WINAPI extGDISaveDC(HDC hdc) +{ + int ret; + + ret=(*pGDISaveDC)(hdc); + //ret=1; + OutTraceD("GDI.SaveDC: hdc=%x ret=%x\n", hdc, ret); + //AutoRefreshThread=CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)AutoRefresh, (LPVOID)hdc, 0, &dwThrdId); + return ret; +} + +BOOL WINAPI extGDIRestoreDC(HDC hdc, int nSavedDC) +{ + BOOL ret; + + ret=(*pGDIRestoreDC)(hdc, nSavedDC); + //ret=1; + OutTraceD("GDI.RestoreDC: hdc=%x nSavedDC=%x ret=%x\n", hdc, nSavedDC, ret); + //TerminateThread(AutoRefreshThread, 0); + return ret; +} + +/* -------------------------------------------------------------------- */ +// directdraw supported GDI calls +/* -------------------------------------------------------------------- */ + +// PrimHDC: DC handle of the selected DirectDraw primary surface. NULL when invalid. +static HDC PrimHDC=NULL; + +HDC WINAPI extDDCreateCompatibleDC(HDC hdc) +{ + HDC RetHdc, SrcHdc; + extern GetDC_Type pGetDC; + + OutTraceD("GDI.CreateCompatibleDC: hdc=%x\n", hdc); + + if(hdc==0 && pGetDC && dxw.IsFullScreen()){ + dxw.SetPrimarySurface(); + (*pGetDC)(dxw.lpDDSPrimHDC,&SrcHdc); + OutTraceD("GDI.CreateCompatibleDC: duplicating screen HDC lpDDSPrimHDC=%x\n", dxw.lpDDSPrimHDC); + RetHdc=(*pGDICreateCompatibleDC)(SrcHdc); + (*pReleaseDC)(dxw.lpDDSPrimHDC,SrcHdc); + } + else + RetHdc=(*pGDICreateCompatibleDC)(hdc); + + if(RetHdc) + OutTraceD("GDI.CreateCompatibleDC: returning HDC=%x\n", RetHdc); + else + OutTraceE("GDI.CreateCompatibleDC ERROR: err=%d at %d\n", GetLastError(), __LINE__); + + return RetHdc; +} + +BOOL WINAPI extDDDeleteDC(HDC hdc) +{ + BOOL res; + + OutTraceD("GDI.DeleteDC: hdc=%x\n", hdc); + + res=(*pGDIDeleteDC)(hdc); + if(!res) OutTraceE("GDI.DeleteDC: ERROR err=%d at %d\n", GetLastError(), __LINE__); + return res; +} + +static HDC WINAPI winDDGetDC(HWND hwnd, char *api) +{ + HDC hdc; + HRESULT res; + extern HRESULT WINAPI extGetDC(LPDIRECTDRAWSURFACE, HDC FAR *); + + OutTraceD("%s: hwnd=%x\n", api, hwnd); + + dxw.ResetPrimarySurface(); + dxw.SetPrimarySurface(); + + if(dxw.lpDDSPrimHDC){ + if (PrimHDC){ + OutTraceD("%s: reusing primary hdc\n", api); + (*pUnlockMethod(dxw.lpDDSPrimHDC))(dxw.lpDDSPrimHDC, NULL); + hdc=PrimHDC; + } + else{ + OutTraceD("%s: get hdc from PRIMARY surface lpdds=%x\n", api, dxw.lpDDSPrimHDC); + res=extGetDC(dxw.lpDDSPrimHDC,&hdc); + if(res) { + OutTraceE("%s: GetDC(%x) ERROR %x(%s) at %d\n", api, dxw.lpDDSPrimHDC, res, ExplainDDError(res), __LINE__); + if(res==DDERR_DCALREADYCREATED){ + // try recovery.... + (*pReleaseDC)(dxw.lpDDSPrimHDC,NULL); + res=extGetDC(dxw.lpDDSPrimHDC,&hdc); + } + if(res)return 0; + } + PrimHDC=hdc; + } + } + else { + hdc=(*pGDIGetDC)(hwnd ? hwnd : dxw.GethWnd()); + OutTraceD("%s: returning window DC handle hwnd=%x hdc=%x\n", api, hwnd, hdc); + PrimHDC=NULL; + } + + if(hdc) + OutTraceD("%s: hwnd=%x hdc=%x\n", api, hwnd, hdc); + else + OutTraceE("%s: ERROR err=%d at %d\n", api, GetLastError, __LINE__); + return(hdc); +} + +HDC WINAPI extDDCreateDC(LPSTR Driver, LPSTR Device, LPSTR Output, CONST DEVMODE *InitData) +{ + HDC RetHDC; + OutTraceD("GDI.CreateDC: Driver=%s Device=%s Output=%s InitData=%x\n", + Driver?Driver:"(NULL)", Device?Device:"(NULL)", Output?Output:"(NULL)", InitData); + + if (!Driver || !strncmp(Driver,"DISPLAY",7)) { + //HDC PrimHDC; + LPDIRECTDRAWSURFACE lpdds; + OutTraceD("GDI.CreateDC: returning primary surface DC\n"); + lpdds=dxw.GetPrimarySurface(); + (*pGetDC)(lpdds, &PrimHDC); + RetHDC=(*pGDICreateCompatibleDC)(PrimHDC); + (*pReleaseDC)(lpdds, PrimHDC); + } + else{ + RetHDC=(*pGDICreateDC)(Driver, Device, Output, InitData); + } + if(RetHDC) + OutTraceD("GDI.CreateDC: returning HDC=%x\n", RetHDC); + else + OutTraceE("GDI.CreateDC ERROR: err=%d at %d\n", GetLastError(), __LINE__); + return RetHDC; +} + +HDC WINAPI extDDGetDC(HWND hwnd) +{ + HDC ret; + ret=winDDGetDC(hwnd, "GDI.GetDC"); + return ret; +} + +HDC WINAPI extDDGetWindowDC(HWND hwnd) +{ + HDC ret; + ret=winDDGetDC(hwnd, "GDI.GetWindowDC"); + return ret; +} + +int WINAPI extDDReleaseDC(HWND hwnd, HDC hDC) +{ + int res; + extern HRESULT WINAPI extReleaseDC(LPDIRECTDRAWSURFACE, HDC); + + OutTraceD("GDI.ReleaseDC: hwnd=%x hdc=%x\n", hwnd, hDC); + res=0; + if ((hDC == PrimHDC) || (hwnd==0)){ + dxw.SetPrimarySurface(); + OutTraceD("GDI.ReleaseDC: refreshing primary surface lpdds=%x\n",dxw.lpDDSPrimHDC); + if(!dxw.lpDDSPrimHDC) return 0; + extReleaseDC(dxw.lpDDSPrimHDC, hDC); + PrimHDC=NULL; + res=1; // 1 = OK + } + else { + res=(*pGDIReleaseDC)(hwnd, hDC); + if (!res) OutTraceE("GDI.ReleaseDC: ERROR err=%d at %d\n", GetLastError(), __LINE__); + } + return(res); +} + +BOOL WINAPI extDDBitBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HDC hdcSrc, int nXSrc, int nYSrc, DWORD dwRop) +{ + BOOL ret; + HRESULT res; + extern HRESULT WINAPI extGetDC(LPDIRECTDRAWSURFACE, HDC FAR *); + + OutTraceD("GDI.BitBlt: HDC=%x nXDest=%d nYDest=%d nWidth=%d nHeight=%d hdcSrc=%x nXSrc=%d nYSrc=%d dwRop=%x(%s)\n", + hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop, ExplainROP(dwRop)); + + ret=1; // OK + + if(hdcDest==0) hdcDest=PrimHDC; + if(hdcDest==0) { + dxw.ResetPrimarySurface(); + dxw.SetPrimarySurface(); + res=extGetDC(dxw.lpDDSPrimHDC, &PrimHDC); + hdcDest=PrimHDC; + } + + res=(*pGDIBitBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop); + if(!res) OutTraceE("GDI.BitBlt: ERROR err=%d at %d\n", GetLastError(), __LINE__); + + res=(*pGDIBitBlt)(NULL, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop); + + if(!res) ret=0; + return ret; +} + +BOOL WINAPI extDDStretchBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, + HDC hdcSrc, int nXSrc, int nYSrc, int nWSrc, int nHSrc, DWORD dwRop) +{ + BOOL ret; + HRESULT res; + RECT ClientRect; + + OutTraceD("GDI.StretchBlt: HDC=%x nXDest=%d nYDest=%d nWidth=%d nHeight=%d hdcSrc=%x nXSrc=%d nYSrc=%d nWSrc=%x nHSrc=%x dwRop=%x\n", + hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, nWSrc, nHSrc, dwRop); + + if(hdcDest != hdcSrc){ + (*pGetClientRect)(dxw.GethWnd(),&ClientRect); + ret=(*pGDIStretchBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, nWidth, nHeight, dwRop); + if(!ret) { + OutTraceE("GDI.StretchBlt: ERROR err=%d at %d\n", GetLastError(), __LINE__); + return ret; + } + } + dxw.SetPrimarySurface(); + OutTraceD("GDI.StretchBlt: refreshing primary surface lpdds=%x\n",dxw.lpDDSPrimHDC); + sBlt("GDI.StretchBlt", dxw.lpDDSPrimHDC, NULL, dxw.lpDDSPrimHDC, NULL, 0, NULL, 0); + res=(*pUnlockMethod(dxw.lpDDSPrimHDC))(dxw.lpDDSPrimHDC, NULL); + return ret; +} + +HDC WINAPI extBeginPaint(HWND hwnd, LPPAINTSTRUCT lpPaint) +{ + HDC hdc; + extern HRESULT WINAPI extGetDC(LPDIRECTDRAWSURFACE, HDC FAR *); + + // proxy part ... + OutTraceD("GDI.BeginPaint: hwnd=%x lpPaint=%x FullScreen=%x\n", hwnd, lpPaint, dxw.IsFullScreen()); + hdc=(*pBeginPaint)(hwnd, lpPaint); + + // if not in fullscreen mode, that's all! + if(!dxw.IsFullScreen()) return hdc; + + // on MAPGDITOPRIMARY, return the PrimHDC handle instead of the window DC + if(dxw.dwFlags1 & MAPGDITOPRIMARY) { + if(pGetDC && dxw.lpDDSPrimHDC){ + extGetDC(dxw.lpDDSPrimHDC,&PrimHDC); + OutTraceD("GDI.BeginPaint: redirect hdc=%x -> PrimHDC=%x\n", hdc, PrimHDC); + hdc=PrimHDC; + } + else { + OutTraceD("GDI.BeginPaint: hdc=%x\n", hdc); + } + } + + // on CLIENTREMAPPING, resize the paint area to virtual screen size + if(dxw.dwFlags1 & CLIENTREMAPPING){ + lpPaint->rcPaint.top=0; + lpPaint->rcPaint.left=0; + lpPaint->rcPaint.right=dxw.GetScreenWidth(); + lpPaint->rcPaint.bottom=dxw.GetScreenHeight(); + } + + return hdc; +} + +BOOL WINAPI extEndPaint(HWND hwnd, const PAINTSTRUCT *lpPaint) +{ + BOOL ret; + HRESULT WINAPI extReleaseDC(LPDIRECTDRAWSURFACE lpdds, HDC FAR hdc); + + // proxy part ... + OutTraceD("GDI.EndPaint: hwnd=%x lpPaint=%x\n", hwnd, lpPaint); + ret=(*pEndPaint)(hwnd, lpPaint); + OutTraceD("GDI.EndPaint: hwnd=%x ret=%x\n", hwnd, ret); + if(!ret) OutTraceE("GDI.EndPaint ERROR: err=%d at %d\n", GetLastError(), __LINE__); + + // if not in fullscreen mode, that's all! + if(!dxw.IsFullScreen()) return ret; + + // v2.02.09: on MAPGDITOPRIMARY, release the PrimHDC handle + if(dxw.dwFlags1 & MAPGDITOPRIMARY) { + if(pReleaseDC && dxw.lpDDSPrimHDC){ + extReleaseDC(dxw.lpDDSPrimHDC, PrimHDC); + OutTraceD("GDI.EndPaint: released hdc=%x\n", PrimHDC); + } + } + + return ret; +} + +/* --------------------------------------------------------------------------- */ +// C&C Tiberian Sun: mixes DirectDraw with GDI Dialogues. +// To make them visible, the lpDialog call had to be hooked to insert a periodic +// InvalidateRect call to make GDI appear on screen +/* --------------------------------------------------------------------------- */ + +BOOL __cdecl TraceChildWin(HWND hwnd, LPARAM lParam) +{ + POINT pos={0,0}; + RECT child; + (*pGetClientRect)(hwnd, &child); + (*pClientToScreen)(hwnd,&pos); + OutTraceD("Father hwnd=%x has child=%x pos=(%d,%d) size=(%d,%d)\n", + HWND(lParam), hwnd, pos.x, pos.y, child.right, child.bottom); + return TRUE; +} + +BOOL isWithinDialog=FALSE; + +HWND WINAPI extCreateDialogIndirectParam(HINSTANCE hInstance, LPCDLGTEMPLATE lpTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM lParamInit) +{ + HWND RetHWND; + isWithinDialog=TRUE; + OutTraceD("CreateDialogIndirectParam: hInstance=%x lpTemplate=%s hWndParent=%x lpDialogFunc=%x lParamInit=%x\n", + hInstance, "tbd", hWndParent, lpDialogFunc, lParamInit); + if(hWndParent==NULL) hWndParent=dxw.GethWnd(); + RetHWND=(*pCreateDialogIndirectParam)(hInstance, lpTemplate, hWndParent, lpDialogFunc, lParamInit); + + WhndStackPush(RetHWND, (WNDPROC)lpDialogFunc); + if(!(*pSetWindowLong)(RetHWND, DWL_DLGPROC, (LONG)extDialogWindowProc)) + OutTraceE("SetWindowLong: ERROR err=%d at %d\n", GetLastError(), __LINE__); + + OutTraceD("CreateDialogIndirectParam: hwnd=%x\n", RetHWND); + isWithinDialog=FALSE; + //if (IsDebug) EnumChildWindows(RetHWND, (WNDENUMPROC)TraceChildWin, (LPARAM)RetHWND); + return RetHWND; +} + +HWND WINAPI extCreateDialogParam(HINSTANCE hInstance, LPCTSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM lParamInit) +{ + HWND RetHWND; + isWithinDialog=TRUE; + OutTraceD("CreateDialogParam: hInstance=%x lpTemplateName=%s hWndParent=%x lpDialogFunc=%x lParamInit=%x\n", + hInstance, "tbd", hWndParent, lpDialogFunc, lParamInit); + if(hWndParent==NULL) hWndParent=dxw.GethWnd(); + RetHWND=(*pCreateDialogParam)(hInstance, lpTemplateName, hWndParent, lpDialogFunc, lParamInit); + + WhndStackPush(RetHWND, (WNDPROC)lpDialogFunc); + if(!(*pSetWindowLong)(RetHWND, DWL_DLGPROC, (LONG)extDialogWindowProc)) + OutTraceE("SetWindowLong: ERROR err=%d at %d\n", GetLastError(), __LINE__); + + OutTraceD("CreateDialogParam: hwnd=%x\n", RetHWND); + isWithinDialog=FALSE; + //if (IsDebug) EnumChildWindows(RetHWND, (WNDENUMPROC)TraceChildWin, (LPARAM)RetHWND); + return RetHWND; +} + +BOOL WINAPI extDDInvalidateRect(HWND hwnd, RECT *lpRect, BOOL bErase) +{ + if(lpRect) + OutTraceD("InvalidateRect: hwnd=%x rect=(%d,%d)-(%d,%d) erase=%x\n", + hwnd, lpRect->left, lpRect->top, lpRect->right, lpRect->bottom, bErase); + else + OutTraceD("InvalidateRect: hwnd=%x rect=NULL erase=%x\n", + hwnd, bErase); + + return (*pInvalidateRect)(hwnd, NULL, bErase); +} + +BOOL WINAPI extInvalidateRect(HWND hwnd, RECT *lpRect, BOOL bErase) +{ + if(lpRect) + OutTraceD("InvalidateRect: hwnd=%x rect=(%d,%d)-(%d,%d) erase=%x\n", + hwnd, lpRect->left, lpRect->top, lpRect->right, lpRect->bottom, bErase); + else + OutTraceD("InvalidateRect: hwnd=%x rect=NULL erase=%x\n", + hwnd, bErase); + + return (*pInvalidateRect)(hwnd, NULL, bErase); +} + +/* --------------------------------------------------------------------------- */ + +// v2.1.75: Hooking for GDI32 CreatePalette, SelectPalette, RealizePalette: +// maps the GDI palette to the buffered DirectDraw one. This fixes the screen +// output for "Dementia" (a.k.a. "Armed & Delirious"). + +HPALETTE WINAPI extGDICreatePalette(CONST LOGPALETTE *plpal) +{ + HPALETTE ret; + int idx; + + dxw.IsGDIPalette=TRUE; + OutTraceD("GDI.CreatePalette: plpal=%x version=%x NumEntries=%x\n", plpal, plpal->palVersion, plpal->palNumEntries); + ret=(*pGDICreatePalette)(plpal); + if(IsDebug){ + OutTraceD("PalEntry[%x]= ", plpal->palNumEntries); + for(idx=0; idxpalNumEntries; idx++) OutTraceD("(%x)", plpal->palPalEntry[idx]); + OutTraceD("\n"); + } + dxw.palVersion=plpal->palVersion; + dxw.palNumEntries=plpal->palNumEntries; + if(dxw.palNumEntries>256) dxw.palNumEntries=256; + for(idx=0; idxpalPalEntry[idx]; + OutTraceD("GDI.CreatePalette: hPalette=%x\n", ret); + return ret; +} + +HPALETTE WINAPI extSelectPalette(HDC hdc, HPALETTE hpal, BOOL bForceBackground) +{ + HPALETTE ret; + + ret=(*pGDISelectPalette)(hdc, hpal, bForceBackground); + OutTraceD("GDI.SelectPalette: hdc=%x hpal=%x ForceBackground=%x ret=%x\n", hdc, hpal, bForceBackground, ret); + return ret; +} + +UINT WINAPI extRealizePalette(HDC hdc) +{ + UINT ret; + extern void mySetPalette(int, int, LPPALETTEENTRY); + + ret=(*pGDIRealizePalette)(hdc); + OutTraceD("GDI.RealizePalette: hdc=%x ret=%x\n", hdc, ret); + + if(!dxw.IsGDIPalette) return ret; + + // quick & dirty implementation through a nasty global: + // if the SelectPalette didn't force to the background (arg bForceBackground==FALSE) + // then don't override the current palette set by the DirectDrawPalette class. + // should be cleaned up a little.... + // maybe not: now both Diablo & Dementia colors are working... + if(dxw.dwFlags1 & EMULATESURFACE) + mySetPalette(0, dxw.palNumEntries, dxw.palPalEntry); + // DEBUGGING + if(IsDebug){ + int idx; + OutTraceD("PaletteEntries[%x]= ", dxw.palNumEntries); + for(idx=0; idx(%d,%d)\n", hwnd, prev.x, prev.y, curr.x, curr.y); + break; + default: + break; + } + } + ret=(*pSendMessage)(hwnd, Msg, wParam, lParam); + OutTraceW("SendMessage: lresult=%x\n", ret); + return ret; +} + +DWORD WINAPI exttimeGetTime(void) +{ + DWORD ret; + ret = dxw.GetTickCount(); + if (IsDebug) OutTrace("timeGetTime: time=%x\n", ret); + return ret; +} + +int WINAPI extShowCursor(BOOL bShow) +{ + static int iFakeCounter; + int ret; + + OutTraceC("ShowCursor: bShow=%x\n", bShow); + if (bShow){ + if (dxw.dwFlags1 & HIDEHWCURSOR){ + iFakeCounter++; + OutTraceC("ShowCursor: HIDEHWCURSOR ret=%x\n", iFakeCounter); + return iFakeCounter; + } + } + else { + if (dxw.dwFlags2 & SHOWHWCURSOR){ + iFakeCounter--; + OutTraceC("ShowCursor: SHOWHWCURSOR ret=%x\n", iFakeCounter); + return iFakeCounter; + } + } + ret=(*pShowCursor)(bShow); + OutTraceC("ShowCursor: ret=%x\n", ret); + return ret; +} + diff --git a/dll/winmm.cpp b/dll/winmm.cpp new file mode 100644 index 0000000..b34797c --- /dev/null +++ b/dll/winmm.cpp @@ -0,0 +1,32 @@ +#include "dxwnd.h" +#include "dxwcore.hpp" +#include "syslibs.h" +#include "dxhook.h" + +static HookEntry_Type TimeHooks[]={ + {"timeGetTime", NULL, (FARPROC *)&ptimeGetTime, (FARPROC)exttimeGetTime}, + {0, NULL, 0, 0} // terminator +}; + +void HookWinMM(HMODULE module) +{ + if(dxw.dwFlags2 & TIMESTRETCH) HookLibrary(module, TimeHooks, "winmm.dll"); +} + +FARPROC Remap_WinMM_ProcAddress(LPCSTR proc, HMODULE hModule) +{ + FARPROC addr; + + if(dxw.dwFlags2 & TIMESTRETCH) + if (addr=RemapLibrary(proc, hModule, TimeHooks)) return addr; + + return NULL; +} + +DWORD WINAPI exttimeGetTime(void) +{ + DWORD ret; + ret = dxw.GetTickCount(); + if (IsDebug) OutTrace("timeGetTime: time=%x\n", ret); + return ret; +} diff --git a/dll/wintrust.cpp b/dll/wintrust.cpp new file mode 100644 index 0000000..e641d0c --- /dev/null +++ b/dll/wintrust.cpp @@ -0,0 +1,35 @@ +#include +#include "dxwnd.h" +#include "dxwcore.hpp" +#include "syslibs.h" +#include "dxhook.h" +#include "dxhelper.h" + +typedef LONG (WINAPI *WinVerifyTrust_Type)(HWND, GUID *, LPVOID); +WinVerifyTrust_Type pWinVerifyTrust; +extern LONG WINAPI extWinVerifyTrust(HWND, GUID *, LPVOID); + +static HookEntry_Type Hooks[]={ + {"WinVerifyTrust", NULL, (FARPROC *)&pWinVerifyTrust, (FARPROC)extWinVerifyTrust}, + {0, NULL, 0, 0} // terminator +}; + +void HookTrust(HMODULE module) +{ + HookLibrary(module, Hooks, "wintrust.dll"); +} + +FARPROC Remap_trust_ProcAddress(LPCSTR proc, HMODULE hModule) +{ + FARPROC addr; + if (addr=RemapLibrary(proc, hModule, Hooks)) return addr; + return NULL;} + +LONG WINAPI extWinVerifyTrust(HWND hWnd, GUID *pgActionID, LPVOID pWVTData) +{ + LONG ret; + OutTraceD("WinVerifyTrust: hwnd=%x pgActionID=%x pWVTData=%x\n", hWnd, pgActionID, pWVTData); + ret = (*pWinVerifyTrust)(hWnd, pgActionID, pWVTData); + OutTraceD("WinVerifyTrust: ret=%x\n", ret); + return ret; +} diff --git a/host/Resource.h b/host/Resource.h index 9d0fc88..0e21bb4 100644 --- a/host/Resource.h +++ b/host/Resource.h @@ -6,13 +6,11 @@ #define IDR_MAINFRAME 128 #define IDR_MFXTEXTYPE 129 #define IDD_TARGET 130 -#define IDR_DXWNDIDLE 131 #define IDR_ACTIVE 131 #define IDR_MENU_POPUP 132 #define IDR_MENU_SYSTRAY 133 #define IDI_DXWAIT 137 #define IDI_DXIDLE 138 -#define IDI_ICON1 140 #define IDI_DXRUN 140 #define IDI_ICON2 141 #define IDI_RUN0 142 @@ -21,21 +19,21 @@ #define IDI_RUN3 145 #define IDI_RUN4 146 #define IDI_RUN5 147 -#define IDI_ICON3 148 #define IDI_RUN6 148 #define IDD_STATUS 149 #define IDD_TIMESLIDER 150 #define IDD_TAB_PROGRAM 152 #define IDD_TAB_LOG 153 +#define IDB_BIGICONS 153 #define IDD_TAB_DIRECTX 154 #define IDD_TAB_MOUSE 155 +#define IDB_BITMAP1 155 +#define IDB_SMALLICONS 155 #define IDD_TAB_TIMING 156 #define IDD_TAB_WINDOW 157 #define IDD_TAB_EMPTY 158 -#define IDD_TAB_EMPTY1 159 #define IDD_TAB_OPENGL 159 #define IDD_TAB_COMPAT 160 -#define IDD_TAB_EMPTY2 161 #define IDD_TAB_GDI 161 #define IDC_AUTO 300 #define IDC_DIRECTX1 301 @@ -47,6 +45,8 @@ #define IDC_DIRECTX11 307 #define IDC_FILE 1000 #define IDC_OPEN 1001 +#define IDC_STATUSINFO 1005 +#define IDC_VERSION 1006 #define IDC_UNNOTIFY 1007 #define IDC_EMULATESURFACE 1008 #define IDC_EMULATEBUFFER 1009 @@ -54,7 +54,6 @@ #define IDC_HOOKDI 1011 #define IDC_MODIFYMOUSE 1012 #define IDC_OUTTRACE 1013 -#define IDC_VERSION 1014 #define IDC_HANDLEDC 1014 #define IDC_SAVELOAD 1015 #define IDC_INITX 1016 @@ -65,28 +64,20 @@ #define IDC_MAXY 1021 #define IDC_MAXFPS 1022 #define IDC_MODULE 1023 -#define IDC_SNOOZE 1023 -#define IDC_KILL 1024 #define IDC_OPENGLLIB 1024 #define IDC_AUTOREFRESH 1025 #define IDC_FIXWINFRAME 1026 #define IDC_HIDEHWCURSOR 1027 #define IDC_ENABLECLIPPING 1028 -#define IDC_COUNTDOWN 1028 -#define IDC_EDIT1 1029 #define IDC_SHOWHWCURSOR 1029 #define IDC_VIDEOTOSYSTEMMEM 1030 #define IDC_FIXTEXTOUT 1031 -#define IDC_STATUSINFO 1031 #define IDC_KEEPCURSORWITHIN 1032 #define IDC_USERGB565 1033 #define IDC_SUPPRESSDXERRORS 1034 #define IDC_PREVENTMAXIMIZE 1035 -#define IDC_SUPPRESSDXERRORS2 1035 -#define IDC_MARKBLIT 1035 #define IDC_OUTWINMESSAGES 1036 #define IDC_OUTDXTRACE 1037 -#define IDC_MODEXEMULATION 1038 #define IDC_DXPROXED 1038 #define IDC_TITLE 1039 #define IDC_SLOW 1040 @@ -112,7 +103,6 @@ #define IDC_LOCKWINSTYLE 1060 #define IDC_FIXPARENTWIN 1061 #define IDC_LOGENABLED 1062 -#define IDC_MOUSETRACE 1063 #define IDC_CURSORTRACE 1063 #define IDC_IMPORTTABLE 1064 #define IDC_HANDLEEXCEPTIONS 1065 @@ -124,22 +114,20 @@ #define IDC_LIMITRESOURCES 1071 #define IDC_SUPPRESSIME 1072 #define IDC_SETCOMPATIBILITY 1073 -#define IDC_SUPPRESSD3DEXT 1073 #define IDC_FIXNCHITTEST 1074 #define IDC_LIMITFPS 1075 #define IDC_SKIPFPS 1076 #define IDC_SHOWFPS 1077 #define IDC_HIDEMULTIMONITOR 1078 #define IDC_TIMESTRETCH 1079 -#define IDC_TIMESPEED 1079 #define IDC_HOOKOPENGL 1080 #define IDC_WALLPAPERMODE 1081 #define IDC_HOOKGDI 1082 #define IDC_SHOWFPSOVERLAY 1083 #define IDC_FAKEVERSION 1084 #define IDC_COMBOTS 1085 -#define IDC_FULLRECTBLT 1085 #define IDC_NOPALETTEUPDATE 1086 +#define IDC_MARKBLIT 1087 #define IDC_LISTTS 1088 #define IDC_LISTFAKE 1089 #define IDC_TABPANEL 1090 @@ -148,11 +136,18 @@ #define IDC_STARTDEBUG 1093 #define IDC_WIREFRAME 1094 #define IDC_DISABLEGAMMARAMP 1095 -#define IDC_WINDOWIZE2 1095 -#define IDC_HOOKDLLS 1095 #define IDC_FORCEWINRESIZE 1096 #define IDC_TIMESLIDER 1097 #define IDC_FORCEHOOKOPENGL 1098 +#define IDC_DESKTOPCENTER 1099 +#define IDC_COORDINATES 1100 +#define IDC_SUPPRESSD3DEXT 1101 +#define IDC_FULLRECTBLT 1102 +#define IDC_TIMESPEED 1103 +#define IDC_HOOKDLLS 1104 +#define IDC_HOOKENABLED 1105 +#define IDC_DESKTOPWORKAREA 1106 +#define IDC_FIXD3DFRAME 1107 #define ID_MODIFY 32771 #define ID_DELETE 32772 #define ID_ADD 32773 @@ -186,14 +181,21 @@ #define ID_VIEW_STATUS32813 32813 #define ID_VIEW_TIMESLIDER32814 32814 #define ID_VIEW_STATUS3 32815 +#define ID_KILL_PAUSE 32816 +#define ID_KILL_RESUME 32817 +#define ID_KILL_KILL 32818 +#define ID_TASK_RESUME 32819 +#define ID_FILE_IMPORT 32820 +#define ID_INDEX0_EXPORT 32821 +#define ID_PEXPORT 32822 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_3D_CONTROLS 1 -#define _APS_NEXT_RESOURCE_VALUE 153 -#define _APS_NEXT_COMMAND_VALUE 32816 +#define _APS_NEXT_RESOURCE_VALUE 156 +#define _APS_NEXT_COMMAND_VALUE 32823 #define _APS_NEXT_CONTROL_VALUE 1091 #define _APS_NEXT_SYMED_VALUE 101 #endif diff --git a/host/TabDirectX.cpp b/host/TabDirectX.cpp index fc26bc0..af89a38 100644 --- a/host/TabDirectX.cpp +++ b/host/TabDirectX.cpp @@ -62,3 +62,4 @@ END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CTabDirectX message handlers + diff --git a/host/TabDirectX.h b/host/TabDirectX.h index cda485b..d21f7b8 100644 --- a/host/TabDirectX.h +++ b/host/TabDirectX.h @@ -39,6 +39,7 @@ protected: // NOTE: the ClassWizard will add member functions here //}}AFX_MSG DECLARE_MESSAGE_MAP() +public: }; //{{AFX_INSERT_LOCATION}} diff --git a/host/TabProgram.cpp b/host/TabProgram.cpp index ea5ecc8..f6b7c52 100644 --- a/host/TabProgram.cpp +++ b/host/TabProgram.cpp @@ -26,6 +26,7 @@ void CTabProgram::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); CTargetDlg *cTarget = ((CTargetDlg *)(this->GetParent()->GetParent())); + DDX_Radio(pDX, IDC_COORDINATES, cTarget->m_Coordinates); DDX_Control(pDX, IDC_FILE, cTarget->m_File); DDX_Text(pDX, IDC_FILE, cTarget->m_FilePath); DDX_Text(pDX, IDC_MODULE, cTarget->m_Module); @@ -33,6 +34,7 @@ void CTabProgram::DoDataExchange(CDataExchange* pDX) DDX_Check(pDX, IDC_UNNOTIFY, cTarget->m_UnNotify); DDX_Check(pDX, IDC_WINDOWIZE, cTarget->m_Windowize); DDX_Check(pDX, IDC_HOOKDLLS, cTarget->m_HookDLLs); + DDX_Check(pDX, IDC_HOOKENABLED, cTarget->m_HookEnabled); DDX_Check(pDX, IDC_NOBANNER, cTarget->m_NoBanner); DDX_Check(pDX, IDC_STARTDEBUG, cTarget->m_StartDebug); DDX_Check(pDX, IDC_CLIENTREMAPPING, cTarget->m_ClientRemapping); @@ -50,6 +52,9 @@ BEGIN_MESSAGE_MAP(CTabProgram, CDialog) // NOTE: the ClassWizard will add message map macros here ON_BN_CLICKED(IDC_OPEN, OnOpen) //}}AFX_MSG_MAP + //ON_BN_CLICKED(IDC_COORDINATES, &CTabProgram::OnBnClickedCoordinates) + //ON_BN_CLICKED(IDC_DESKTOPWORKAREA, &CTabProgram::OnBnClickedDesktopworkarea) + //ON_BN_CLICKED(IDC_DESKTOPCENTER, &CTabProgram::OnBnClickedDesktopcenter) END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// @@ -64,4 +69,20 @@ void CTabProgram::OnOpen() CFileDialog dlg( TRUE, "*.*", path, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, "Program (*.exe)|*.exe|All Files (*.*)|*.*||", this); if( dlg.DoModal() == IDOK) cTarget->m_File.SetWindowText(dlg.GetPathName()); -} \ No newline at end of file +} +void CTabProgram::OnBnClickedCoordinates() +{ + // TODO: Add your control notification handler code here + //CWnd *cTarget = ((CTargetDlg *)(this->GetParent()); + //(CEdBoxEditor *)(cTarget->GetDlgItem(IDC_POSX)) +} + +void CTabProgram::OnBnClickedDesktopworkarea() +{ + // TODO: Add your control notification handler code here +} + +void CTabProgram::OnBnClickedDesktopcenter() +{ + // TODO: Add your control notification handler code here +} diff --git a/host/TabProgram.h b/host/TabProgram.h index 7e32976..3736072 100644 --- a/host/TabProgram.h +++ b/host/TabProgram.h @@ -37,6 +37,10 @@ protected: // NOTE: the ClassWizard will add member functions here //}}AFX_MSG DECLARE_MESSAGE_MAP() +public: + afx_msg void OnBnClickedCoordinates(); + afx_msg void OnBnClickedDesktopworkarea(); + afx_msg void OnBnClickedDesktopcenter(); }; //{{AFX_INSERT_LOCATION}} diff --git a/host/TabWindow.cpp b/host/TabWindow.cpp index 9d926f6..8f6dc62 100644 --- a/host/TabWindow.cpp +++ b/host/TabWindow.cpp @@ -43,6 +43,7 @@ void CTabWindow::DoDataExchange(CDataExchange* pDX) DDX_Check(pDX, IDC_REFRESHONRESIZE, cTarget->m_RefreshOnResize); DDX_Check(pDX, IDC_INIT8BPP, cTarget->m_Init8BPP); DDX_Check(pDX, IDC_INIT16BPP, cTarget->m_Init16BPP); + DDX_Check(pDX, IDC_FIXD3DFRAME, cTarget->m_FixD3DFrame); } BOOL CTabWindow::OnInitDialog() diff --git a/host/TargetDlg.cpp b/host/TargetDlg.cpp index 37ae83f..845f053 100644 --- a/host/TargetDlg.cpp +++ b/host/TargetDlg.cpp @@ -21,6 +21,7 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/) { //{{AFX_DATA_INIT(CTargetDlg) m_DXVersion = -1; + m_Coordinates = 0; m_EmulateSurface = FALSE; m_NoEmulateSurface = TRUE; // current default m_EmulateBuffer = FALSE; @@ -39,8 +40,9 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/) m_SetCompatibility = FALSE; m_LimitResources = FALSE; m_UnNotify = FALSE; - m_Windowize = TRUE; + m_Windowize = TRUE; // default true !! m_HookDLLs = FALSE; + m_HookEnabled = TRUE; // default true !! m_NoBanner = FALSE; m_StartDebug = FALSE; m_FilePath = _T(""); @@ -75,6 +77,7 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/) m_HookGDI = FALSE; m_HideMultiMonitor = FALSE; m_WallpaperMode = FALSE; + m_FixD3DFrame = FALSE; m_HookChildWin = FALSE; m_MessageProc = FALSE; m_FixNCHITTEST = FALSE; @@ -101,8 +104,8 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/) m_MaxY = 0; m_MinX = 0; m_MinY = 0; - m_PosX = 0; - m_PosY = 0; + m_PosX = 50; + m_PosY = 50; m_SizX = 800; m_SizY = 600; m_MaxFPS = 0; diff --git a/host/TargetDlg.h b/host/TargetDlg.h index 307de3f..c94ab45 100644 --- a/host/TargetDlg.h +++ b/host/TargetDlg.h @@ -24,6 +24,7 @@ public: CDXTabCtrl m_tabdxTabCtrl; CEdit m_File; int m_DXVersion; + int m_Coordinates; BOOL m_EmulateSurface; BOOL m_NoEmulateSurface; BOOL m_EmulateBuffer; @@ -44,6 +45,7 @@ public: BOOL m_HookDLLs; BOOL m_NoBanner; BOOL m_StartDebug; + BOOL m_HookEnabled; CString m_FilePath; CString m_Module; CString m_Title; @@ -78,6 +80,7 @@ public: BOOL m_HookGDI; BOOL m_HideMultiMonitor; BOOL m_WallpaperMode; + BOOL m_FixD3DFrame; BOOL m_HookChildWin; BOOL m_MessageProc; BOOL m_FixNCHITTEST; diff --git a/host/TlHelp32.h b/host/TlHelp32.h new file mode 100644 index 0000000..5167904 --- /dev/null +++ b/host/TlHelp32.h @@ -0,0 +1,317 @@ +/*****************************************************************************\ +* * +* tlhelp32.h - WIN32 tool help functions, types, and definitions * +* * +* Version 1.0 * +* * +* NOTE: windows.h/winbase.h must be #included first * +* * +* Copyright (c) Microsoft Corp. All rights reserved. * +* * +\*****************************************************************************/ + +#ifndef _INC_TOOLHELP32 +#define _INC_TOOLHELP32 + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifdef __cplusplus +extern "C" { /* Assume C declarations for C++ */ +#endif /* __cplusplus */ + +#define MAX_MODULE_NAME32 255 + +/****** Shapshot function **********************************************/ + +HANDLE +WINAPI +CreateToolhelp32Snapshot( + DWORD dwFlags, + DWORD th32ProcessID + ); + +// +// The th32ProcessID argument is only used if TH32CS_SNAPHEAPLIST or +// TH32CS_SNAPMODULE is specified. th32ProcessID == 0 means the current +// process. +// +// NOTE that all of the snapshots are global except for the heap and module +// lists which are process specific. To enumerate the heap or module +// state for all WIN32 processes call with TH32CS_SNAPALL and the +// current process. Then for each process in the TH32CS_SNAPPROCESS +// list that isn't the current process, do a call with just +// TH32CS_SNAPHEAPLIST and/or TH32CS_SNAPMODULE. +// +// dwFlags +// +#define TH32CS_SNAPHEAPLIST 0x00000001 +#define TH32CS_SNAPPROCESS 0x00000002 +#define TH32CS_SNAPTHREAD 0x00000004 +#define TH32CS_SNAPMODULE 0x00000008 +#define TH32CS_SNAPMODULE32 0x00000010 +#define TH32CS_SNAPALL (TH32CS_SNAPHEAPLIST | TH32CS_SNAPPROCESS | TH32CS_SNAPTHREAD | TH32CS_SNAPMODULE) +#define TH32CS_INHERIT 0x80000000 +// +// Use CloseHandle to destroy the snapshot +// + +/****** heap walking ***************************************************/ + +typedef struct tagHEAPLIST32 +{ + SIZE_T dwSize; + DWORD th32ProcessID; // owning process + ULONG_PTR th32HeapID; // heap (in owning process's context!) + DWORD dwFlags; +} HEAPLIST32; +typedef HEAPLIST32 * PHEAPLIST32; +typedef HEAPLIST32 * LPHEAPLIST32; +// +// dwFlags +// +#define HF32_DEFAULT 1 // process's default heap +#define HF32_SHARED 2 // is shared heap + +BOOL +WINAPI +Heap32ListFirst( + HANDLE hSnapshot, + LPHEAPLIST32 lphl + ); + +BOOL +WINAPI +Heap32ListNext( + HANDLE hSnapshot, + LPHEAPLIST32 lphl + ); + +typedef struct tagHEAPENTRY32 +{ + SIZE_T dwSize; + HANDLE hHandle; // Handle of this heap block + ULONG_PTR dwAddress; // Linear address of start of block + SIZE_T dwBlockSize; // Size of block in bytes + DWORD dwFlags; + DWORD dwLockCount; + DWORD dwResvd; + DWORD th32ProcessID; // owning process + ULONG_PTR th32HeapID; // heap block is in +} HEAPENTRY32; +typedef HEAPENTRY32 * PHEAPENTRY32; +typedef HEAPENTRY32 * LPHEAPENTRY32; +// +// dwFlags +// +#define LF32_FIXED 0x00000001 +#define LF32_FREE 0x00000002 +#define LF32_MOVEABLE 0x00000004 + +BOOL +WINAPI +Heap32First( + LPHEAPENTRY32 lphe, + DWORD th32ProcessID, + ULONG_PTR th32HeapID + ); + +BOOL +WINAPI +Heap32Next( + LPHEAPENTRY32 lphe + ); + +BOOL +WINAPI +Toolhelp32ReadProcessMemory( + DWORD th32ProcessID, + LPCVOID lpBaseAddress, + LPVOID lpBuffer, + SIZE_T cbRead, + SIZE_T *lpNumberOfBytesRead + ); + +/***** Process walking *************************************************/ + +typedef struct tagPROCESSENTRY32W +{ + DWORD dwSize; + DWORD cntUsage; + DWORD th32ProcessID; // this process + ULONG_PTR th32DefaultHeapID; + DWORD th32ModuleID; // associated exe + DWORD cntThreads; + DWORD th32ParentProcessID; // this process's parent process + LONG pcPriClassBase; // Base priority of process's threads + DWORD dwFlags; + WCHAR szExeFile[MAX_PATH]; // Path +} PROCESSENTRY32W; +typedef PROCESSENTRY32W * PPROCESSENTRY32W; +typedef PROCESSENTRY32W * LPPROCESSENTRY32W; + +BOOL +WINAPI +Process32FirstW( + HANDLE hSnapshot, + LPPROCESSENTRY32W lppe + ); + +BOOL +WINAPI +Process32NextW( + HANDLE hSnapshot, + LPPROCESSENTRY32W lppe + ); + +typedef struct tagPROCESSENTRY32 +{ + DWORD dwSize; + DWORD cntUsage; + DWORD th32ProcessID; // this process + ULONG_PTR th32DefaultHeapID; + DWORD th32ModuleID; // associated exe + DWORD cntThreads; + DWORD th32ParentProcessID; // this process's parent process + LONG pcPriClassBase; // Base priority of process's threads + DWORD dwFlags; + CHAR szExeFile[MAX_PATH]; // Path +} PROCESSENTRY32; +typedef PROCESSENTRY32 * PPROCESSENTRY32; +typedef PROCESSENTRY32 * LPPROCESSENTRY32; + +BOOL +WINAPI +Process32First( + HANDLE hSnapshot, + LPPROCESSENTRY32 lppe + ); + +BOOL +WINAPI +Process32Next( + HANDLE hSnapshot, + LPPROCESSENTRY32 lppe + ); + +#ifdef UNICODE +#define Process32First Process32FirstW +#define Process32Next Process32NextW +#define PROCESSENTRY32 PROCESSENTRY32W +#define PPROCESSENTRY32 PPROCESSENTRY32W +#define LPPROCESSENTRY32 LPPROCESSENTRY32W +#endif // !UNICODE + +/***** Thread walking **************************************************/ + +typedef struct tagTHREADENTRY32 +{ + DWORD dwSize; + DWORD cntUsage; + DWORD th32ThreadID; // this thread + DWORD th32OwnerProcessID; // Process this thread is associated with + LONG tpBasePri; + LONG tpDeltaPri; + DWORD dwFlags; +} THREADENTRY32; +typedef THREADENTRY32 * PTHREADENTRY32; +typedef THREADENTRY32 * LPTHREADENTRY32; + +BOOL +WINAPI +Thread32First( + HANDLE hSnapshot, + LPTHREADENTRY32 lpte + ); + +BOOL +WINAPI +Thread32Next( + HANDLE hSnapshot, + LPTHREADENTRY32 lpte + ); + +/***** Module walking *************************************************/ + +typedef struct tagMODULEENTRY32W +{ + DWORD dwSize; + DWORD th32ModuleID; // This module + DWORD th32ProcessID; // owning process + DWORD GlblcntUsage; // Global usage count on the module + DWORD ProccntUsage; // Module usage count in th32ProcessID's context + BYTE * modBaseAddr; // Base address of module in th32ProcessID's context + DWORD modBaseSize; // Size in bytes of module starting at modBaseAddr + HMODULE hModule; // The hModule of this module in th32ProcessID's context + WCHAR szModule[MAX_MODULE_NAME32 + 1]; + WCHAR szExePath[MAX_PATH]; +} MODULEENTRY32W; +typedef MODULEENTRY32W * PMODULEENTRY32W; +typedef MODULEENTRY32W * LPMODULEENTRY32W; + +BOOL +WINAPI +Module32FirstW( + HANDLE hSnapshot, + LPMODULEENTRY32W lpme + ); + +BOOL +WINAPI +Module32NextW( + HANDLE hSnapshot, + LPMODULEENTRY32W lpme + ); + + +typedef struct tagMODULEENTRY32 +{ + DWORD dwSize; + DWORD th32ModuleID; // This module + DWORD th32ProcessID; // owning process + DWORD GlblcntUsage; // Global usage count on the module + DWORD ProccntUsage; // Module usage count in th32ProcessID's context + BYTE * modBaseAddr; // Base address of module in th32ProcessID's context + DWORD modBaseSize; // Size in bytes of module starting at modBaseAddr + HMODULE hModule; // The hModule of this module in th32ProcessID's context + char szModule[MAX_MODULE_NAME32 + 1]; + char szExePath[MAX_PATH]; +} MODULEENTRY32; +typedef MODULEENTRY32 * PMODULEENTRY32; +typedef MODULEENTRY32 * LPMODULEENTRY32; + +// +// NOTE CAREFULLY that the modBaseAddr and hModule fields are valid ONLY +// in th32ProcessID's process context. +// + +BOOL +WINAPI +Module32First( + HANDLE hSnapshot, + LPMODULEENTRY32 lpme + ); + +BOOL +WINAPI +Module32Next( + HANDLE hSnapshot, + LPMODULEENTRY32 lpme + ); + +#ifdef UNICODE +#define Module32First Module32FirstW +#define Module32Next Module32NextW +#define MODULEENTRY32 MODULEENTRY32W +#define PMODULEENTRY32 PMODULEENTRY32W +#define LPMODULEENTRY32 LPMODULEENTRY32W +#endif // !UNICODE + + +#ifdef __cplusplus +} +#endif + +#endif // _INC_TOOLHELP32 + diff --git a/host/dxwnd.ini b/host/dxwnd.ini index e198da0..74f0945 100644 --- a/host/dxwnd.ini +++ b/host/dxwnd.ini @@ -3,3 +3,26 @@ posx=1104 posy=310 sizx=303 sizy=138 +[target] +title0=speeddemo.exe +path0=D:\Games\Need For Speed Underground Demo\speeddemo.exe +module0= +opengllib0= +ver0=0 +flag0=0 +flagg0=134217728 +flagh0=-842150435 +flagi0=-842150451 +tflag0=0 +initx0=0 +inity0=0 +minx0=0 +miny0=0 +maxx0=0 +maxy0=0 +posx0=0 +posy0=0 +sizx0=800 +sizy0=600 +maxfps0=0 +initts0=0 diff --git a/host/dxwndhost.aps b/host/dxwndhost.aps index c5e2e0e..98d4a36 100644 Binary files a/host/dxwndhost.aps and b/host/dxwndhost.aps differ diff --git a/host/dxwndhost.rc b/host/dxwndhost.rc index d1b3efa..74e9c1d 100644 --- a/host/dxwndhost.rc +++ b/host/dxwndhost.rc @@ -82,13 +82,19 @@ BEGIN BEGIN MENUITEM "Save", ID_FILE_SAVE MENUITEM "&Sort programs list", ID_FILE_SORTPROGRAMSLIST + MENUITEM "&Import ...", ID_FILE_IMPORT MENUITEM "&Clear all logs", ID_FILE_CLEARALLLOGS POPUP "Hook" BEGIN MENUITEM "Start", ID_HOOK_START MENUITEM "Stop", ID_HOOK_STOP END - MENUITEM "&Kill", ID_TASK_KILL + POPUP "&Process" + BEGIN + MENUITEM "&Pause", ID_TASK_PAUSE + MENUITEM "&Resume", ID_TASK_RESUME + MENUITEM "&Kill", ID_TASK_KILL + END MENUITEM "Move to Tray", ID_FILE_GOTOTRAYICON MENUITEM "e&Xit", ID_DXAPP_EXIT END @@ -130,7 +136,7 @@ BEGIN MENUITEM "&View", ID_PLOG_VIEW MENUITEM "&Delete", ID_PLOG_DELETE END - MENUITEM "&Kill ", ID_TASK_KILL + MENUITEM "e&Xport ...", ID_PEXPORT END END @@ -252,16 +258,20 @@ BEGIN EDITTEXT IDC_POSY,55,210,19,14,ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT EDITTEXT IDC_SIZX,85,210,19,14,ES_AUTOHSCROLL,WS_EX_RIGHT EDITTEXT IDC_SIZY,113,210,19,14,ES_AUTOHSCROLL,WS_EX_RIGHT - CONTROL "Do not notify on task switch",IDC_UNNOTIFY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,112,124,12 - CONTROL "Optimize CPU (DirectX1 - 7)",IDC_SAVELOAD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,122,123,12 - CONTROL "Intercept Alt-F4 key",IDC_HANDLEALTF4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,132,109,12 - CONTROL "Run in Window",IDC_WINDOWIZE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,142,124,12 + CONTROL "Do not notify on task switch",IDC_UNNOTIFY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,122,124,10 + CONTROL "Optimize CPU (DirectX1 - 7)",IDC_SAVELOAD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,152,109,10 + CONTROL "Intercept Alt-F4 key",IDC_HANDLEALTF4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,132,109,10 + CONTROL "Run in Window",IDC_WINDOWIZE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,142,124,10 GROUPBOX "Generic",IDC_STATIC,7,103,286,88 - CONTROL "No banner",IDC_NOBANNER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,122,108,12 - CONTROL "use DLL Injection",IDC_STARTDEBUG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,132,100,12 - CONTROL "3D Wireframe",IDC_WIREFRAME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,142,115,12 + CONTROL "No banner",IDC_NOBANNER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,122,108,10 + CONTROL "use DLL Injection",IDC_STARTDEBUG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,132,100,10 + CONTROL "3D Wireframe",IDC_WIREFRAME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,142,96,10 CONTROL "Remap Client Rect",IDC_CLIENTREMAPPING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,112,115,10 - CONTROL "Hook all DLLs",IDC_HOOKDLLS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,152,124,12 + CONTROL "Hook all DLLs",IDC_HOOKDLLS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,152,124,10 + CONTROL "Hook enabled",IDC_HOOKENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,112,124,10 + CONTROL "X,Y coordinates",IDC_COORDINATES,"Button",BS_AUTORADIOBUTTON | WS_GROUP,170,198,95,10 + CONTROL "Desktop work area",IDC_DESKTOPWORKAREA,"Button",BS_AUTORADIOBUTTON,170,208,95,10 + CONTROL "Desktop center",IDC_DESKTOPCENTER,"Button",BS_AUTORADIOBUTTON,170,218,95,10 END IDD_TAB_LOG DIALOGEX 0, 0, 300, 240 @@ -370,7 +380,7 @@ FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN CONTROL "Fix Window Frame Style",IDC_FIXWINFRAME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,16,120,10 CONTROL "Prevent Win Maximize",IDC_PREVENTMAXIMIZE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,28,115,10 - GROUPBOX "Windows handling",IDC_STATIC,6,4,140,193 + GROUPBOX "Windows handling",IDC_STATIC,6,4,140,229 CONTROL "Lock win coordinates",IDC_LOCKWINPOS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,39,115,10 CONTROL "Hook CHILD windows",IDC_HOOKCHILDWIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,62,115,10 CONTROL "Recover screen mode",IDC_RECOVERSCREENMODE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,74,115,10 @@ -384,6 +394,7 @@ BEGIN CONTROL "Force win resize",IDC_FORCEWINRESIZE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,154,115,10 CONTROL "Hide multi-monitor config.",IDC_HIDEMULTIMONITOR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,166,115,10 CONTROL "Wallpaper mode",IDC_WALLPAPERMODE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,178,115,10 + CONTROL "Fix Windows Frame in D3D",IDC_FIXD3DFRAME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,188,115,10 END IDD_TAB_EMPTY DIALOGEX 0, 0, 300, 240 @@ -589,6 +600,14 @@ END #endif // APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDB_BIGICONS BITMAP "res\\bigicons.bmp" +IDB_SMALLICONS BITMAP "res\\smallicons.bmp" + ///////////////////////////////////////////////////////////////////////////// // // String Table diff --git a/host/dxwndhost.vs2008.suo b/host/dxwndhost.vs2008.suo index f1eff0d..7dba9e5 100644 Binary files a/host/dxwndhost.vs2008.suo and b/host/dxwndhost.vs2008.suo differ diff --git a/host/dxwndhost.vs2008.vcproj b/host/dxwndhost.vs2008.vcproj index 1f25bdd..e58df9b 100644 --- a/host/dxwndhost.vs2008.vcproj +++ b/host/dxwndhost.vs2008.vcproj @@ -1,7 +1,7 @@ + + @@ -567,6 +571,10 @@ RelativePath=".\res\run-90.ico" > + + diff --git a/host/dxwndhostView.cpp b/host/dxwndhostView.cpp index f7c4cee..ddd1f5e 100644 --- a/host/dxwndhostView.cpp +++ b/host/dxwndhostView.cpp @@ -5,6 +5,7 @@ #include "stdafx.h" #include "shlwapi.h" +#include "TlHelp32.h" #include "dxwndhost.h" @@ -43,8 +44,12 @@ BEGIN_MESSAGE_MAP(CDxwndhostView, CListView) ON_COMMAND(ID_LOG_VIEW, OnViewLog) ON_COMMAND(ID_LOG_DELETE, OnDeleteLog) ON_COMMAND(ID_TASK_KILL, OnKill) + ON_COMMAND(ID_TASK_PAUSE, OnPause) + ON_COMMAND(ID_TASK_RESUME, OnResume) ON_COMMAND(ID_ADD, OnAdd) ON_COMMAND(ID_MODIFY, OnModify) + ON_COMMAND(ID_PEXPORT, OnExport) + ON_COMMAND(ID_FILE_IMPORT, OnImport) ON_COMMAND(ID_DELETE, OnDelete) ON_COMMAND(ID_FILE_SORTPROGRAMSLIST, OnSort) ON_COMMAND(ID_FILE_CLEARALLLOGS, OnClearAllLogs) @@ -54,10 +59,6 @@ BEGIN_MESSAGE_MAP(CDxwndhostView, CListView) ON_COMMAND(ID_HOOK_STOP, OnHookStop) ON_COMMAND(ID_DXAPP_EXIT, OnExit) ON_WM_RBUTTONDOWN() - ON_WM_DESTROY() - ON_WM_MOVE() - ON_WM_SIZE() - ON_WM_DESTROY() ON_COMMAND(ID_RUN, OnRun) ON_COMMAND(ID_TRAY_RESTORE, OnTrayRestore) ON_COMMAND(ID_VIEW_STATUS, OnViewStatus) @@ -92,170 +93,201 @@ static void RevertScreenChanges(DEVMODE *InitDevMode) } } +static void SaveConfigItem(TARGETMAP *TargetMap, char *Title, int i, char *InitPath) +{ + char key[32], val[32]; + sprintf_s(key, sizeof(key), "title%i", i); + WritePrivateProfileString("target", key, Title, InitPath); + sprintf_s(key, sizeof(key), "path%i", i); + WritePrivateProfileString("target", key, TargetMap->path, InitPath); + sprintf_s(key, sizeof(key), "module%i", i); + WritePrivateProfileString("target", key, TargetMap->module, InitPath); + sprintf_s(key, sizeof(key), "opengllib%i", i); + WritePrivateProfileString("target", key, TargetMap->OpenGLLib, InitPath); + sprintf_s(key, sizeof(key), "ver%i", i); + sprintf_s(val, sizeof(val), "%i", TargetMap->dxversion); + WritePrivateProfileString("target", key, val, InitPath); + sprintf_s(key, sizeof(key), "coord%i", i); + sprintf_s(val, sizeof(val), "%i", TargetMap->coordinates); + WritePrivateProfileString("target", key, val, InitPath); + sprintf_s(key, sizeof(key), "flag%i", i); + sprintf_s(val, sizeof(val), "%i", TargetMap->flags); + WritePrivateProfileString("target", key, val, InitPath); + sprintf_s(key, sizeof(key), "flagg%i", i); + sprintf_s(val, sizeof(val), "%i", TargetMap->flags2); + WritePrivateProfileString("target", key, val, InitPath); + sprintf_s(key, sizeof(key), "flagh%i", i); + sprintf_s(val, sizeof(val), "%i", TargetMap->flags3); + WritePrivateProfileString("target", key, val, InitPath); + sprintf_s(key, sizeof(key), "flagi%i", i); + sprintf_s(val, sizeof(val), "%i", TargetMap->flags4); + WritePrivateProfileString("target", key, val, InitPath); + sprintf_s(key, sizeof(key), "tflag%i", i); + sprintf_s(val, sizeof(val), "%i", TargetMap->tflags); + WritePrivateProfileString("target", key, val, InitPath); + sprintf_s(key, sizeof(key), "initx%i", i); + sprintf_s(val, sizeof(val), "%i", TargetMap->initx); + WritePrivateProfileString("target", key, val, InitPath); + sprintf_s(key, sizeof(key), "inity%i", i); + sprintf_s(val, sizeof(val), "%i", TargetMap->inity); + WritePrivateProfileString("target", key, val, InitPath); + sprintf_s(key, sizeof(key), "minx%i", i); + sprintf_s(val, sizeof(val), "%i", TargetMap->minx); + WritePrivateProfileString("target", key, val, InitPath); + sprintf_s(key, sizeof(key), "miny%i", i); + sprintf_s(val, sizeof(val), "%i", TargetMap->miny); + WritePrivateProfileString("target", key, val, InitPath); + sprintf_s(key, sizeof(key), "maxx%i", i); + sprintf_s(val, sizeof(val), "%i", TargetMap->maxx); + WritePrivateProfileString("target", key, val, InitPath); + sprintf_s(key, sizeof(key), "maxy%i", i); + sprintf_s(val, sizeof(val), "%i", TargetMap->maxy); + WritePrivateProfileString("target", key, val, InitPath); + sprintf_s(key, sizeof(key), "posx%i", i); + sprintf_s(val, sizeof(val), "%i", TargetMap->posx); + WritePrivateProfileString("target", key, val, InitPath); + sprintf_s(key, sizeof(key), "posy%i", i); + sprintf_s(val, sizeof(val), "%i", TargetMap->posy); + WritePrivateProfileString("target", key, val, InitPath); + sprintf_s(key, sizeof(key), "sizx%i", i); + sprintf_s(val, sizeof(val), "%i", TargetMap->sizx); + WritePrivateProfileString("target", key, val, InitPath); + sprintf_s(key, sizeof(key), "sizy%i", i); + sprintf_s(val, sizeof(val), "%i", TargetMap->sizy); + WritePrivateProfileString("target", key, val, InitPath); + sprintf_s(key, sizeof(key), "maxfps%i", i); + sprintf_s(val, sizeof(val), "%i", TargetMap->MaxFPS); + WritePrivateProfileString("target", key, val, InitPath); + sprintf_s(key, sizeof(key), "initts%i", i); + sprintf_s(val, sizeof(val), "%i", TargetMap->InitTS); + WritePrivateProfileString("target", key, val, InitPath); +} + +static void ClearTarget(int i, char *InitPath) +{ + char key[32]; + sprintf_s(key, sizeof(key), "path%i", i); + WritePrivateProfileString("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "ver%i", i); + WritePrivateProfileString("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "coord%i", i); + WritePrivateProfileString("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "flag%i", i); + WritePrivateProfileString("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "flagg%i", i); + WritePrivateProfileString("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "flagh%i", i); + WritePrivateProfileString("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "flagi%i", i); + WritePrivateProfileString("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "tflag%i", i); + WritePrivateProfileString("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "initx%i", i); + WritePrivateProfileString("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "inity%i", i); + WritePrivateProfileString("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "minx%i", i); + WritePrivateProfileString("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "miny%i", i); + WritePrivateProfileString("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "maxx%i", i); + WritePrivateProfileString("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "maxy%i", i); + WritePrivateProfileString("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "posx%i", i); + WritePrivateProfileString("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "posy%i", i); + WritePrivateProfileString("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "sizx%i", i); + WritePrivateProfileString("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "sizy%i", i); + WritePrivateProfileString("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "maxfps%i", i); + WritePrivateProfileString("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "initts%i", i); + WritePrivateProfileString("target", key, 0, InitPath); +} + +static int LoadConfigItem(TARGETMAP *TargetMap, char *Title, int i, char *InitPath) +{ + char key[32]; + sprintf_s(key, sizeof(key), "path%i", i); + GetPrivateProfileString("target", key, "", TargetMap->path, MAX_PATH, InitPath); + if(!TargetMap->path[0]) return FALSE; + sprintf_s(key, sizeof(key), "title%i", i); + GetPrivateProfileString("target", key, "", Title, sizeof(PRIVATEMAP)-1, InitPath); + sprintf_s(key, sizeof(key), "module%i", i); + GetPrivateProfileString("target", key, "", TargetMap->module, sizeof(TargetMap->module)-1, InitPath); + sprintf_s(key, sizeof(key), "opengllib%i", i); + GetPrivateProfileString("target", key, "", TargetMap->OpenGLLib, sizeof(TargetMap->OpenGLLib)-1, InitPath); + sprintf_s(key, sizeof(key), "ver%i", i); + TargetMap->dxversion = GetPrivateProfileInt("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "coord%i", i); + TargetMap->coordinates = GetPrivateProfileInt("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "flag%i", i); + TargetMap->flags = GetPrivateProfileInt("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "flagg%i", i); + TargetMap->flags2 = GetPrivateProfileInt("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "flagh%i", i); + TargetMap->flags3 = GetPrivateProfileInt("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "flagi%i", i); + TargetMap->flags4 = GetPrivateProfileInt("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "tflag%i", i); + TargetMap->tflags = GetPrivateProfileInt("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "initx%i", i); + TargetMap->initx = GetPrivateProfileInt("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "inity%i", i); + TargetMap->inity = GetPrivateProfileInt("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "minx%i", i); + TargetMap->minx = GetPrivateProfileInt("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "miny%i", i); + TargetMap->miny = GetPrivateProfileInt("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "maxx%i", i); + TargetMap->maxx = GetPrivateProfileInt("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "maxy%i", i); + TargetMap->maxy = GetPrivateProfileInt("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "posx%i", i); + TargetMap->posx = GetPrivateProfileInt("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "posy%i", i); + TargetMap->posy = GetPrivateProfileInt("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "sizx%i", i); + TargetMap->sizx = GetPrivateProfileInt("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "sizy%i", i); + TargetMap->sizy = GetPrivateProfileInt("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "maxfps%i", i); + TargetMap->MaxFPS = GetPrivateProfileInt("target", key, 0, InitPath); + sprintf_s(key, sizeof(key), "initts%i", i); + TargetMap->InitTS = GetPrivateProfileInt("target", key, 0, InitPath); + return TRUE; +} + +static int SetTargetIcon(TARGETMAP tm) +{ + FILE *target; + target = fopen(tm.path, "r"); + if (target==NULL) return 3; + fclose(target); + if (tm.flags3 & HOOKENABLED) return (tm.flags2 & STARTDEBUG) ? 2 : 1; + return 0; +} + ///////////////////////////////////////////////////////////////////////////// // CDxwndhostView class constructor / destructor CDxwndhostView::CDxwndhostView() { -// EnumDisplaySettings(NULL, ENUM_REGISTRY_SETTINGS, &this->InitDevMode); EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &this->InitDevMode); } -void CDxwndhostView::OnMove(int x, int y) -{ - CWnd::OnMove(x, y); - this->LastX=x; - this->LastY=y; -} - -void CDxwndhostView::OnSize(UINT nSize, int cx, int cy) -{ - this->LastCX=cx; - this->LastCY=cy; - // save x,y pos since OnMove is not working .... why? - RECT rect; - this->GetActiveWindow()->GetWindowRect(&rect); - this->LastX=rect.left; - this->LastY=rect.top; -} - -void CDxwndhostView::SaveWinPos() -{ - char val[32]; - //RECT rect; - - // save window rect - //this->GetActiveWindow()->GetWindowRect(&rect); - //if((rect.top < 0) || (rect.bottom < 0) || (rect.left < 0) || (rect.right < 0)) return; - //sprintf_s(val, sizeof(val), "%i", rect.left); - //WritePrivateProfileString("window", "posx", val, InitPath); - //sprintf_s(val, sizeof(val), "%i", rect.top); - //WritePrivateProfileString("window", "posy", val, InitPath); - //sprintf_s(val, sizeof(val), "%i", rect.right-rect.left); - //WritePrivateProfileString("window", "sizx", val, InitPath); - //sprintf_s(val, sizeof(val), "%i", rect.bottom-rect.top); - //WritePrivateProfileString("window", "sizy", val, InitPath); - sprintf_s(val, sizeof(val), "%i", this->LastX); - WritePrivateProfileString("window", "posx", val, InitPath); - sprintf_s(val, sizeof(val), "%i", this->LastY); - WritePrivateProfileString("window", "posy", val, InitPath); - sprintf_s(val, sizeof(val), "%i", this->LastCX); - WritePrivateProfileString("window", "sizx", val, InitPath); - sprintf_s(val, sizeof(val), "%i", this->LastCY); - WritePrivateProfileString("window", "sizy", val, InitPath); -} - void CDxwndhostView::SaveConfigFile() { int i; - char key[32], val[32]; for(i = 0; i < MAXTARGETS; i ++){ if(!TargetMaps[i].path[0]) break; - sprintf_s(key, sizeof(key), "title%i", i); - WritePrivateProfileString("target", key, TitleMaps[i].title, InitPath); - sprintf_s(key, sizeof(key), "path%i", i); - WritePrivateProfileString("target", key, TargetMaps[i].path, InitPath); - sprintf_s(key, sizeof(key), "module%i", i); - WritePrivateProfileString("target", key, TargetMaps[i].module, InitPath); - sprintf_s(key, sizeof(key), "opengllib%i", i); - WritePrivateProfileString("target", key, TargetMaps[i].OpenGLLib, InitPath); - sprintf_s(key, sizeof(key), "ver%i", i); - sprintf_s(val, sizeof(val), "%i", TargetMaps[i].dxversion); - WritePrivateProfileString("target", key, val, InitPath); - sprintf_s(key, sizeof(key), "flag%i", i); - sprintf_s(val, sizeof(val), "%i", TargetMaps[i].flags); - WritePrivateProfileString("target", key, val, InitPath); - sprintf_s(key, sizeof(key), "flagg%i", i); - sprintf_s(val, sizeof(val), "%i", TargetMaps[i].flags2); - WritePrivateProfileString("target", key, val, InitPath); - sprintf_s(key, sizeof(key), "flagh%i", i); - sprintf_s(val, sizeof(val), "%i", TargetMaps[i].flags3); - WritePrivateProfileString("target", key, val, InitPath); - sprintf_s(key, sizeof(key), "flagi%i", i); - sprintf_s(val, sizeof(val), "%i", TargetMaps[i].flags4); - WritePrivateProfileString("target", key, val, InitPath); - sprintf_s(key, sizeof(key), "tflag%i", i); - sprintf_s(val, sizeof(val), "%i", TargetMaps[i].tflags); - WritePrivateProfileString("target", key, val, InitPath); - sprintf_s(key, sizeof(key), "initx%i", i); - sprintf_s(val, sizeof(val), "%i", TargetMaps[i].initx); - WritePrivateProfileString("target", key, val, InitPath); - sprintf_s(key, sizeof(key), "inity%i", i); - sprintf_s(val, sizeof(val), "%i", TargetMaps[i].inity); - WritePrivateProfileString("target", key, val, InitPath); - sprintf_s(key, sizeof(key), "minx%i", i); - sprintf_s(val, sizeof(val), "%i", TargetMaps[i].minx); - WritePrivateProfileString("target", key, val, InitPath); - sprintf_s(key, sizeof(key), "miny%i", i); - sprintf_s(val, sizeof(val), "%i", TargetMaps[i].miny); - WritePrivateProfileString("target", key, val, InitPath); - sprintf_s(key, sizeof(key), "maxx%i", i); - sprintf_s(val, sizeof(val), "%i", TargetMaps[i].maxx); - WritePrivateProfileString("target", key, val, InitPath); - sprintf_s(key, sizeof(key), "maxy%i", i); - sprintf_s(val, sizeof(val), "%i", TargetMaps[i].maxy); - WritePrivateProfileString("target", key, val, InitPath); - sprintf_s(key, sizeof(key), "posx%i", i); - sprintf_s(val, sizeof(val), "%i", TargetMaps[i].posx); - WritePrivateProfileString("target", key, val, InitPath); - sprintf_s(key, sizeof(key), "posy%i", i); - sprintf_s(val, sizeof(val), "%i", TargetMaps[i].posy); - WritePrivateProfileString("target", key, val, InitPath); - sprintf_s(key, sizeof(key), "sizx%i", i); - sprintf_s(val, sizeof(val), "%i", TargetMaps[i].sizx); - WritePrivateProfileString("target", key, val, InitPath); - sprintf_s(key, sizeof(key), "sizy%i", i); - sprintf_s(val, sizeof(val), "%i", TargetMaps[i].sizy); - WritePrivateProfileString("target", key, val, InitPath); - sprintf_s(key, sizeof(key), "maxfps%i", i); - sprintf_s(val, sizeof(val), "%i", TargetMaps[i].MaxFPS); - WritePrivateProfileString("target", key, val, InitPath); - sprintf_s(key, sizeof(key), "initts%i", i); - sprintf_s(val, sizeof(val), "%i", TargetMaps[i].InitTS); - WritePrivateProfileString("target", key, val, InitPath); + SaveConfigItem(&TargetMaps[i], TitleMaps[i].title, i, InitPath); } - for(; i < MAXTARGETS; i ++){ - sprintf_s(key, sizeof(key), "path%i", i); - WritePrivateProfileString("target", key, 0, InitPath); - sprintf_s(key, sizeof(key), "ver%i", i); - WritePrivateProfileString("target", key, 0, InitPath); - sprintf_s(key, sizeof(key), "flag%i", i); - WritePrivateProfileString("target", key, 0, InitPath); - sprintf_s(key, sizeof(key), "flagg%i", i); - WritePrivateProfileString("target", key, 0, InitPath); - sprintf_s(key, sizeof(key), "flagh%i", i); - WritePrivateProfileString("target", key, 0, InitPath); - sprintf_s(key, sizeof(key), "flagi%i", i); - WritePrivateProfileString("target", key, 0, InitPath); - sprintf_s(key, sizeof(key), "tflag%i", i); - WritePrivateProfileString("target", key, 0, InitPath); - sprintf_s(key, sizeof(key), "initx%i", i); - WritePrivateProfileString("target", key, 0, InitPath); - sprintf_s(key, sizeof(key), "inity%i", i); - WritePrivateProfileString("target", key, 0, InitPath); - sprintf_s(key, sizeof(key), "minx%i", i); - WritePrivateProfileString("target", key, 0, InitPath); - sprintf_s(key, sizeof(key), "miny%i", i); - WritePrivateProfileString("target", key, 0, InitPath); - sprintf_s(key, sizeof(key), "maxx%i", i); - WritePrivateProfileString("target", key, 0, InitPath); - sprintf_s(key, sizeof(key), "maxy%i", i); - WritePrivateProfileString("target", key, 0, InitPath); - sprintf_s(key, sizeof(key), "posx%i", i); - WritePrivateProfileString("target", key, 0, InitPath); - sprintf_s(key, sizeof(key), "posy%i", i); - WritePrivateProfileString("target", key, 0, InitPath); - sprintf_s(key, sizeof(key), "sizx%i", i); - WritePrivateProfileString("target", key, 0, InitPath); - sprintf_s(key, sizeof(key), "sizy%i", i); - WritePrivateProfileString("target", key, 0, InitPath); - sprintf_s(key, sizeof(key), "maxfps%i", i); - WritePrivateProfileString("target", key, 0, InitPath); - sprintf_s(key, sizeof(key), "initts%i", i); - WritePrivateProfileString("target", key, 0, InitPath); - } - + for(; i < MAXTARGETS; i ++) ClearTarget(i, InitPath); this->isUpdated=FALSE; } @@ -278,16 +310,9 @@ CDxwndhostView::~CDxwndhostView() } } -void CDxwndhostView::OnDestroy() -{ - this->OnExit(); - exit(0); -} - void CDxwndhostView::OnExit() { // check for running apps .... - this->SaveWinPos(); if (GetHookStatus(NULL)==DXW_RUNNING){ if (MessageBoxEx(0, "A hooked task is still running.\n" @@ -320,7 +345,27 @@ void CDxwndhostView::OnInitialUpdate() LV_COLUMN listcol; LV_ITEM listitem; int i; - char key[32]; + + // Create 256 color image lists + HIMAGELIST hList = ImageList_Create(32,32, ILC_COLOR8 |ILC_MASK , 4, 1); + m_cImageListNormal.Attach(hList); + + hList = ImageList_Create(16, 16, ILC_COLOR8 | ILC_MASK, 4, 1); + m_cImageListSmall.Attach(hList); + + // Load the large icons + CBitmap cBmp; + cBmp.LoadBitmap(IDB_BIGICONS); + m_cImageListNormal.Add(&cBmp, RGB(255,0, 255)); + cBmp.DeleteObject(); + + // Load the small icons + cBmp.LoadBitmap(IDB_SMALLICONS); + m_cImageListSmall.Add(&cBmp, RGB(255,0, 255)); + + // Attach them + listctrl.SetImageList(&m_cImageListNormal, LVSIL_NORMAL); + listctrl.SetImageList(&m_cImageListSmall, LVSIL_SMALL); listcol.mask = LVCF_WIDTH; listcol.cx = 100; @@ -329,57 +374,16 @@ void CDxwndhostView::OnInitialUpdate() GetCurrentDirectory(MAX_PATH, InitPath); strcat_s(InitPath, sizeof(InitPath), "\\"); strcat_s(InitPath, sizeof(InitPath), m_ConfigFileName); + listctrl.InsertColumn(0, &listcol); for(i = 0; i < MAXTARGETS; i ++){ - sprintf_s(key, sizeof(key), "path%i", i); - GetPrivateProfileString("target", key, "", TargetMaps[i].path, MAX_PATH, InitPath); - if(!TargetMaps[i].path[0]) break; - sprintf_s(key, sizeof(key), "title%i", i); - GetPrivateProfileString("target", key, "", TitleMaps[i].title, sizeof(TitleMaps[i].title)-1, InitPath); - sprintf_s(key, sizeof(key), "module%i", i); - GetPrivateProfileString("target", key, "", TargetMaps[i].module, sizeof(TargetMaps[i].module)-1, InitPath); - sprintf_s(key, sizeof(key), "opengllib%i", i); - GetPrivateProfileString("target", key, "", TargetMaps[i].OpenGLLib, sizeof(TargetMaps[i].OpenGLLib)-1, InitPath); - sprintf_s(key, sizeof(key), "ver%i", i); - TargetMaps[i].dxversion = GetPrivateProfileInt("target", key, 0, InitPath); - sprintf_s(key, sizeof(key), "flag%i", i); - TargetMaps[i].flags = GetPrivateProfileInt("target", key, 0, InitPath); - sprintf_s(key, sizeof(key), "flagg%i", i); - TargetMaps[i].flags2 = GetPrivateProfileInt("target", key, 0, InitPath); - sprintf_s(key, sizeof(key), "flagh%i", i); - TargetMaps[i].flags3 = GetPrivateProfileInt("target", key, 0, InitPath); - sprintf_s(key, sizeof(key), "flagi%i", i); - TargetMaps[i].flags4 = GetPrivateProfileInt("target", key, 0, InitPath); - sprintf_s(key, sizeof(key), "tflag%i", i); - TargetMaps[i].tflags = GetPrivateProfileInt("target", key, 0, InitPath); - sprintf_s(key, sizeof(key), "initx%i", i); - TargetMaps[i].initx = GetPrivateProfileInt("target", key, 0, InitPath); - sprintf_s(key, sizeof(key), "inity%i", i); - TargetMaps[i].inity = GetPrivateProfileInt("target", key, 0, InitPath); - sprintf_s(key, sizeof(key), "minx%i", i); - TargetMaps[i].minx = GetPrivateProfileInt("target", key, 0, InitPath); - sprintf_s(key, sizeof(key), "miny%i", i); - TargetMaps[i].miny = GetPrivateProfileInt("target", key, 0, InitPath); - sprintf_s(key, sizeof(key), "maxx%i", i); - TargetMaps[i].maxx = GetPrivateProfileInt("target", key, 0, InitPath); - sprintf_s(key, sizeof(key), "maxy%i", i); - TargetMaps[i].maxy = GetPrivateProfileInt("target", key, 0, InitPath); - sprintf_s(key, sizeof(key), "posx%i", i); - TargetMaps[i].posx = GetPrivateProfileInt("target", key, 0, InitPath); - sprintf_s(key, sizeof(key), "posy%i", i); - TargetMaps[i].posy = GetPrivateProfileInt("target", key, 0, InitPath); - sprintf_s(key, sizeof(key), "sizx%i", i); - TargetMaps[i].sizx = GetPrivateProfileInt("target", key, 0, InitPath); - sprintf_s(key, sizeof(key), "sizy%i", i); - TargetMaps[i].sizy = GetPrivateProfileInt("target", key, 0, InitPath); - sprintf_s(key, sizeof(key), "maxfps%i", i); - TargetMaps[i].MaxFPS = GetPrivateProfileInt("target", key, 0, InitPath); - sprintf_s(key, sizeof(key), "initts%i", i); - TargetMaps[i].InitTS = GetPrivateProfileInt("target", key, 0, InitPath); - listitem.mask = LVIF_TEXT; + FILE *target; + if (!LoadConfigItem(&TargetMaps[i], TitleMaps[i].title, i, InitPath)) break; + listitem.mask = LVIF_TEXT | LVIF_IMAGE; listitem.iItem = i; listitem.iSubItem = 0; listitem.pszText = TitleMaps[i].title; + listitem.iImage = SetTargetIcon(TargetMaps[i]); listctrl.InsertItem(&listitem); } for(; i < MAXTARGETS; i ++) TargetMaps[i].path[0] = 0; @@ -424,9 +428,62 @@ void CDxwndhostView::OnDblclk(NMHDR* pNMHDR, LRESULT* pResult) *pResult = 0; } +void CDxwndhostView::OnExport() +{ + int i; + char path[MAX_PATH]; + CListCtrl& listctrl = GetListCtrl(); + POSITION pos; + if(!listctrl.GetSelectedCount()) return; + pos = listctrl.GetFirstSelectedItemPosition(); + i = listctrl.GetNextSelectedItem(pos); + //path[0]=0; + strcpy_s(path, MAX_PATH, TitleMaps[i].title); + CFileDialog dlg( FALSE, "*.dxw", path, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, + "dxwnd task config (*.dxw)|*.dxw|All Files (*.*)|*.*||", this); + if( dlg.DoModal() == IDOK) + SaveConfigItem(&TargetMaps[i], TitleMaps[i].title, 0, dlg.GetPathName().GetBuffer()); +} + +void CDxwndhostView::OnImport() +{ + int i; + char path[MAX_PATH]; + for (i=0; strlen(TargetMaps[i].path) && iisUpdated=TRUE; + } +} + void CDxwndhostView::OnModify() { - // TODO: Please add a command handler code here. int i; CTargetDlg dlg; POSITION pos; @@ -438,6 +495,7 @@ void CDxwndhostView::OnModify() i = listctrl.GetNextSelectedItem(pos); dlg.m_DXVersion = TargetMaps[i].dxversion; if(dlg.m_DXVersion > 6) dlg.m_DXVersion -= 5; + dlg.m_Coordinates = TargetMaps[i].coordinates; dlg.m_FilePath = TargetMaps[i].path; dlg.m_Module = TargetMaps[i].module; dlg.m_OpenGLLib = TargetMaps[i].OpenGLLib; @@ -445,6 +503,7 @@ void CDxwndhostView::OnModify() dlg.m_UnNotify = TargetMaps[i].flags & UNNOTIFY ? 1 : 0; dlg.m_Windowize = TargetMaps[i].flags2 & WINDOWIZE ? 1 : 0; dlg.m_HookDLLs = TargetMaps[i].flags3 & HOOKDLLS ? 1 : 0; + dlg.m_HookEnabled = TargetMaps[i].flags3 & HOOKENABLED ? 1 : 0; dlg.m_NoBanner = TargetMaps[i].flags2 & NOBANNER ? 1 : 0; dlg.m_StartDebug = TargetMaps[i].flags2 & STARTDEBUG ? 1 : 0; dlg.m_EmulateSurface = TargetMaps[i].flags & EMULATESURFACE ? 1 : 0; @@ -497,6 +556,7 @@ void CDxwndhostView::OnModify() dlg.m_HookGDI = TargetMaps[i].flags2 & HOOKGDI ? 1 : 0; dlg.m_HideMultiMonitor = TargetMaps[i].flags2 & HIDEMULTIMONITOR ? 1 : 0; dlg.m_WallpaperMode = TargetMaps[i].flags2 & WALLPAPERMODE ? 1 : 0; + dlg.m_FixD3DFrame = TargetMaps[i].flags3 & FIXD3DFRAME ? 1 : 0; dlg.m_HookChildWin = TargetMaps[i].flags & HOOKCHILDWIN ? 1 : 0; dlg.m_MessageProc = TargetMaps[i].flags & MESSAGEPROC ? 1 : 0; dlg.m_FixNCHITTEST = TargetMaps[i].flags2 & FIXNCHITTEST ? 1 : 0; @@ -537,6 +597,7 @@ void CDxwndhostView::OnModify() strcpy_s(TitleMaps[i].title, sizeof(TitleMaps[i].title), dlg.m_Title); if(dlg.m_DXVersion > 1) dlg.m_DXVersion += 5; TargetMaps[i].dxversion = dlg.m_DXVersion; + TargetMaps[i].coordinates = dlg.m_Coordinates; TargetMaps[i].flags = 0; TargetMaps[i].flags2 = 0; TargetMaps[i].flags3 = 0; @@ -545,6 +606,7 @@ void CDxwndhostView::OnModify() if(dlg.m_UnNotify) TargetMaps[i].flags |= UNNOTIFY; if(dlg.m_Windowize) TargetMaps[i].flags2 |= WINDOWIZE; if(dlg.m_HookDLLs) TargetMaps[i].flags3 |= HOOKDLLS; + if(dlg.m_HookEnabled) TargetMaps[i].flags3 |= HOOKENABLED; if(dlg.m_NoBanner) TargetMaps[i].flags2 |= NOBANNER; if(dlg.m_StartDebug) TargetMaps[i].flags2 |= STARTDEBUG; if(dlg.m_NoEmulateSurface) { @@ -611,6 +673,7 @@ void CDxwndhostView::OnModify() if(dlg.m_HookGDI) TargetMaps[i].flags2 |= HOOKGDI; if(dlg.m_HideMultiMonitor) TargetMaps[i].flags2 |= HIDEMULTIMONITOR; if(dlg.m_WallpaperMode) TargetMaps[i].flags2 |= WALLPAPERMODE; + if(dlg.m_FixD3DFrame) TargetMaps[i].flags3 |= FIXD3DFRAME; if(dlg.m_HookChildWin) TargetMaps[i].flags |= HOOKCHILDWIN; if(dlg.m_MessageProc) TargetMaps[i].flags |= MESSAGEPROC; if(dlg.m_FixNCHITTEST) TargetMaps[i].flags2 |= FIXNCHITTEST; @@ -648,9 +711,10 @@ void CDxwndhostView::OnModify() strcpy_s(TargetMaps[i].OpenGLLib, sizeof(TargetMaps[i].OpenGLLib), dlg.m_OpenGLLib); strcpy_s(TitleMaps[i].title, sizeof(TitleMaps[i].title), dlg.m_Title); CListCtrl& listctrl = GetListCtrl(); - listitem.mask = LVIF_TEXT; + listitem.mask = LVIF_TEXT | LVIF_IMAGE; listitem.iItem = i; listitem.iSubItem = 0; + listitem.iImage = SetTargetIcon(TargetMaps[i]); listitem.pszText = TitleMaps[i].title; listctrl.SetItem(&listitem); Resize(); @@ -776,9 +840,10 @@ void CDxwndhostView::OnSort() listctrl.DeleteAllItems(); for(i=0; iisUpdated=TRUE; } +BOOL PauseResumeThreadList(DWORD dwOwnerPID, bool bResumeThread) +{ + HANDLE hThreadSnap = NULL; + BOOL bRet = FALSE; + THREADENTRY32 te32 = {0}; + + // Take a snapshot of all threads currently in the system. + + hThreadSnap = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0); + if (hThreadSnap == INVALID_HANDLE_VALUE) + return (FALSE); + + // Fill in the size of the structure before using it. + + te32.dwSize = sizeof(THREADENTRY32); + + // Walk the thread snapshot to find all threads of the process. + // If the thread belongs to the process, add its information + // to the display list. + + if (Thread32First(hThreadSnap, &te32)){ + do{ + if (te32.th32OwnerProcessID == dwOwnerPID){ + HANDLE hThread = OpenThread(THREAD_SUSPEND_RESUME, FALSE, te32.th32ThreadID); + if (bResumeThread) + ResumeThread(hThread); + else + SuspendThread(hThread); + CloseHandle(hThread); + } + } + while (Thread32Next(hThreadSnap, &te32)); + bRet = TRUE; + } + else + bRet = FALSE; // could not walk the list of threads + + // Do not forget to clean up the snapshot object. + CloseHandle (hThreadSnap); + + return (bRet); +} + +void CDxwndhostView::OnPause() +{ + CTargetDlg dlg; + HRESULT res; + char sMsg[128+1]; + DXWNDSTATUS DxWndStatus; + if ((GetHookStatus(&DxWndStatus) != DXW_RUNNING) || (DxWndStatus.hWnd==NULL)) { + MessageBoxEx(0, "No active task to pause.", "Info", MB_ICONEXCLAMATION, NULL); + } + else { + sprintf_s(sMsg, 128, "Do you want to pause \nthe \"%s\" task?", TitleMaps[DxWndStatus.TaskIdx].title); + res=MessageBoxEx(0, sMsg, "Warning", MB_YESNO | MB_ICONQUESTION, NULL); + if(res!=IDYES) return; + PauseResumeThreadList(DxWndStatus.dwPid, FALSE); + } +} + +void CDxwndhostView::OnResume() +{ + CTargetDlg dlg; + HRESULT res; + HANDLE TargetHandle; + char sMsg[128+1]; + DXWNDSTATUS DxWndStatus; + if ((GetHookStatus(&DxWndStatus) != DXW_RUNNING) || (DxWndStatus.hWnd==NULL)) { + MessageBoxEx(0, "No active task to resume.", "Info", MB_ICONEXCLAMATION, NULL); + } + else { + sprintf_s(sMsg, 128, "Do you want to resume \nthe \"%s\" task?", TitleMaps[DxWndStatus.TaskIdx].title); + res=MessageBoxEx(0, sMsg, "Warning", MB_YESNO | MB_ICONQUESTION, NULL); + if(res!=IDYES) return; + PauseResumeThreadList(DxWndStatus.dwPid, TRUE); + } +} + void CDxwndhostView::OnKill() { CTargetDlg dlg; @@ -830,6 +973,7 @@ void CDxwndhostView::OnAdd() LV_ITEM listitem; dlg.m_DXVersion = 0; + dlg.m_Coordinates = 0; dlg.m_MaxX = 0; //639; dlg.m_MaxY = 0; //479; for(i = 0; i < MAXTARGETS; i ++) if(!TargetMaps[i].path[0]) break; @@ -844,12 +988,14 @@ void CDxwndhostView::OnAdd() strcpy_s(TitleMaps[i].title, sizeof(TitleMaps[i].title), dlg.m_Title); if(dlg.m_DXVersion > 1) dlg.m_DXVersion += 5; TargetMaps[i].dxversion = dlg.m_DXVersion; + TargetMaps[i].coordinates = dlg.m_Coordinates; TargetMaps[i].flags = 0; TargetMaps[i].flags2 = 0; TargetMaps[i].tflags = 0; if(dlg.m_UnNotify) TargetMaps[i].flags |= UNNOTIFY; if(dlg.m_Windowize) TargetMaps[i].flags2 |= WINDOWIZE; if(dlg.m_HookDLLs) TargetMaps[i].flags3 |= HOOKDLLS; + if(dlg.m_HookEnabled) TargetMaps[i].flags3 |= HOOKENABLED; if(dlg.m_NoBanner) TargetMaps[i].flags2 |= NOBANNER; if(dlg.m_StartDebug) TargetMaps[i].flags2 |= STARTDEBUG; if(dlg.m_NoEmulateSurface) { @@ -916,6 +1062,7 @@ void CDxwndhostView::OnAdd() if(dlg.m_HookGDI) TargetMaps[i].flags2 |= HOOKGDI; if(dlg.m_HideMultiMonitor) TargetMaps[i].flags2 |= HIDEMULTIMONITOR; if(dlg.m_WallpaperMode) TargetMaps[i].flags2 |= WALLPAPERMODE; + if(dlg.m_FixD3DFrame) TargetMaps[i].flags3 |= FIXD3DFRAME; if(dlg.m_HookChildWin) TargetMaps[i].flags |= HOOKCHILDWIN; if(dlg.m_MessageProc) TargetMaps[i].flags |= MESSAGEPROC; if(dlg.m_FixNCHITTEST) TargetMaps[i].flags2 |= FIXNCHITTEST; @@ -953,9 +1100,10 @@ void CDxwndhostView::OnAdd() else MessageBoxEx(0, "Bad InitTS", "Warning", MB_OK, NULL); CListCtrl& listctrl = GetListCtrl(); - listitem.mask = LVIF_TEXT; + listitem.mask = LVIF_TEXT | LVIF_IMAGE; listitem.iItem = i; listitem.iSubItem = 0; + listitem.iImage = SetTargetIcon(TargetMaps[i]); if (strlen(TitleMaps[i].title)==0){ int len; CString FilePath; @@ -1234,6 +1382,18 @@ void CDxwndhostView::OnRButtonDown(UINT nFlags, CPoint point) case ID_TASK_KILL: OnKill(); break; + case ID_TASK_PAUSE: + OnPause(); + break; + case ID_TASK_RESUME: + OnResume(); + break; + case ID_PEXPORT: + OnExport(); + break; + case ID_FILE_IMPORT: + OnImport(); + break; } CListView::OnRButtonDown(nFlags, point); } @@ -1307,6 +1467,10 @@ DWORD WINAPI StartDebug(void *p) li->hFile, GetFileNameFromHandle(li->hFile)); res=MessageBoxEx(0, DebugMessage, "Continue stepping?", MB_YESNO | MB_ICONQUESTION, NULL); if(res!=IDYES) step=FALSE; + if(!Inject(pinfo.dwProcessId, path)){ + sprintf(DebugMessage,"Injection error: pid=%x dll=%s", pinfo.dwProcessId, path); + MessageBoxEx(0, DebugMessage, "Injection", MB_ICONEXCLAMATION, NULL); + } } break; case UNLOAD_DLL_DEBUG_EVENT: diff --git a/host/dxwndhostView.h b/host/dxwndhostView.h index a82236c..346b784 100644 --- a/host/dxwndhostView.h +++ b/host/dxwndhostView.h @@ -20,7 +20,6 @@ protected: // Create from serialization only features. private: void Resize(void); void SaveConfigFile(); - void SaveWinPos(); TARGETMAP TargetMaps[MAXTARGETS]; PRIVATEMAP TitleMaps[MAXTARGETS]; char InitPath[MAX_PATH]; @@ -28,6 +27,7 @@ private: DEVMODE InitDevMode; CSystemTray SystemTray; int LastX, LastY, LastCX, LastCY; + CImageList m_cImageListNormal, m_cImageListSmall; // Attributes public: @@ -44,9 +44,6 @@ public: virtual BOOL PreCreateWindow(CREATESTRUCT& cs); protected: virtual void OnInitialUpdate(); // Called once after the initial construction. - virtual void OnMove(int, int); - virtual void OnSize(UINT, int, int); - virtual void OnDestroy(); //}}AFX_VIRTUAL // Implementation @@ -65,9 +62,13 @@ protected: afx_msg void OnDblclk(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnAdd(); afx_msg void OnModify(); + afx_msg void OnExport(); + afx_msg void OnImport(); afx_msg void OnDelete(); afx_msg void OnExplore(); afx_msg void OnKill(); + afx_msg void OnPause(); + afx_msg void OnResume(); afx_msg void OnSort(); afx_msg void OnViewLog(); afx_msg void OnDeleteLog(); diff --git a/host/res/bigicons.bmp b/host/res/bigicons.bmp new file mode 100644 index 0000000..66dd6f4 Binary files /dev/null and b/host/res/bigicons.bmp differ diff --git a/host/res/smallicons.bmp b/host/res/smallicons.bmp new file mode 100644 index 0000000..9d55631 Binary files /dev/null and b/host/res/smallicons.bmp differ