Ada计算机图形DirectX之d3d9

----------------------------------------
-- File : d3d9.ads                    --
-- Translator:Dongfeng.Gu,2018/10/12  --
-- Mail: [email protected]                --
-- Progress:100%                      --
----------------------------------------

with win32;                            use win32;
with win32.Winerror;
with win32.winnt;                      use win32.winnt;
with win32.windef;                     use win32.windef;
with win32.Wingdi;                     use win32.Wingdi;
with win32.Objbase;                    use win32.Objbase;
with win32.rpcdce;                     use win32.rpcdce;
with Interfaces.C;

with d3d9types;                        use d3d9types;
with d3d9caps;                         use d3d9caps;

package d3d9 is

   DIRECT3D_VERSION : constant := 16#0900#;

   use type interfaces.C.unsigned_long;

   -- FOR Debug ifno
   -- D3D_SDK_VERSION : constant dword:= (32 or 16#80000000#);
   -- D3D9b_SDK_VERSION : constant dword:= (31 or 16#80000000#);

   -- for Release value
   D3D_SDK_VERSION   : constant := 32;
   D3D9b_SDK_VERSION : constant := 31;

   type lplpvoid is access all PVOID;
   type lpFloat is access all Float;
   type lpcFloat is access constant Float;
   type lpcInt is access constant Int;
   type lpcBool is access constant Bool;
   type lpUint is access all Uint;

   type Bool_Array is array(Natural range<>) of Bool;
   type D3DMATRIX_ARRAY is array(Natural range<>) of D3DMATRIX;
   type D3DLIGHT9_aRRAY is array(Natural range<>) of D3DLIGHT9;
   subtype HMONITOR is win32.winnt.HANDLE;



   --
   -- Interface IIDs
   --
   IID_IDirect3D9:constant win32.rpcdce.GUID:=(16#81bdcbca#,16#64d4#,16#426d#,(16#ae#,16#8d#,16#ad#,16#1#,16#47#,16#f4#,16#27#,16#5c#));
   IID_IDirect3DDevice9:constant win32.rpcdce.GUID:=(16#d0223b96#,16#bf7a#,16#43fd#,(16#92#,16#bd#,16#a4#,16#3b#,16#d#,16#82#,16#b9#,16#eb#));
   IID_IDirect3DResource9:constant win32.rpcdce.GUID:=(16#5eec05d#,16#8f7d#,16#4362#,(16#b9#,16#99#,16#d1#,16#ba#,16#f3#,16#57#,16#c7#,16#4#));
   IID_IDirect3DBaseTexture9:constant win32.rpcdce.GUID:=(16#580ca87e#,16#1d3c#,16#4d54#,(16#99#,16#1d#,16#b7#,16#d3#,16#e3#,16#c2#,16#98#,16#ce#));
   IID_IDirect3DTexture9:constant win32.rpcdce.GUID:=(16#85c31227#,16#3de5#,16#4f00#,(16#9b#,16#3a#,16#f1#,16#1a#,16#c3#,16#8c#,16#18#,16#b5#));
   IID_IDirect3DCubeTexture9:constant win32.rpcdce.GUID:=(16#fff32f81#,16#d953#,16#473a#,(16#92#,16#23#,16#93#,16#d6#,16#52#,16#ab#,16#a9#,16#3f#));
   IID_IDirect3DVolumeTexture9:constant win32.rpcdce.GUID:=(16#2518526c#,16#e789#,16#4111#,(16#a7#,16#b9#,16#47#,16#ef#,16#32#,16#8d#,16#13#,16#e6#));
   IID_IDirect3DVertexBuffer9:constant win32.rpcdce.GUID:=(16#b64bb1b5#,16#fd70#,16#4df6#,(16#bf#,16#91#,16#19#,16#d0#,16#a1#,16#24#,16#55#,16#e3#));
   IID_IDirect3DIndexBuffer9:constant win32.rpcdce.GUID:=(16#7c9dd65e#,16#d3f7#,16#4529#,(16#ac#,16#ee#,16#78#,16#58#,16#30#,16#ac#,16#de#,16#35#));
   IID_IDirect3DSurface9:constant win32.rpcdce.GUID:=(16#cfbaf3a#,16#9ff6#,16#429a#,(16#99#,16#b3#,16#a2#,16#79#,16#6a#,16#f8#,16#b8#,16#9b#));
   IID_IDirect3DVolume9:constant win32.rpcdce.GUID:=(16#24f416e6#,16#1f67#,16#4aa7#,(16#b8#,16#8e#,16#d3#,16#3f#,16#6f#,16#31#,16#28#,16#a1#));
   IID_IDirect3DSwapChain9:constant win32.rpcdce.GUID:=(16#794950f2#,16#adfc#,16#458a#,(16#90#,16#5e#,16#10#,16#a1#,16#b#,16#b#,16#50#,16#3b#));
   IID_IDirect3DVertexDeclaration9:constant win32.rpcdce.GUID:=(16#dd13c59c#,16#36fa#,16#4098#,(16#a8#,16#fb#,16#c7#,16#ed#,16#39#,16#dc#,16#85#,16#46#));
   IID_IDirect3DVertexShader9:constant win32.rpcdce.GUID:=(16#efc5557e#,16#6265#,16#4613#,(16#8a#,16#94#,16#43#,16#85#,16#78#,16#89#,16#eb#,16#36#));
   IID_IDirect3DPixelShader9:constant win32.rpcdce.GUID:=(16#6d3bdbdc#,16#5b02#,16#4415#,(16#b8#,16#52#,16#ce#,16#5e#,16#8b#,16#cc#,16#b2#,16#89#));
   IID_IDirect3DStateBlock9:constant win32.rpcdce.GUID:=(16#b07c4fe5#,16#310d#,16#4ba8#,(16#a2#,16#3c#,16#4f#,16#f#,16#20#,16#6f#,16#21#,16#8b#));
   IID_IDirect3DQuery9:constant win32.rpcdce.GUID:=(16#d9771460#,16#a695#,16#4f26#,(16#bb#,16#d3#,16#27#,16#b8#,16#40#,16#b5#,16#41#,16#cc#));
   IID_HelperName:constant win32.rpcdce.GUID:=(16#e4a36723#,16#fdfe#,16#4b22#,(16#b1#,16#46#,16#3c#,16#4#,16#c0#,16#7f#,16#4c#,16#c8#));
   IID_IDirect3D9Ex:constant win32.rpcdce.GUID:=(16#02177241#,16#69FC#,16#400C#,(16#8F#,16#F1#,16#93#,16#A4#,16#4D#,16#F6#,16#86#,16#1D#));
   IID_IDirect3DDevice9Ex:constant win32.rpcdce.GUID:=(16#b18b10ce#,16#2649#,16#405a#,(16#87#,16#f#,16#95#,16#f7#,16#77#,16#d4#,16#31#,16#3a#));
   IID_IDirect3DSwapChain9Ex:constant win32.rpcdce.GUID:=(16#91886caf#,16#1c3d#,16#4d2e#,(16#a0#,16#ab#,16#3e#,16#4c#,16#7d#,16#8d#,16#33#,16#3#));
   IID_IDirect3D9ExOverlayExtension:constant win32.rpcdce.GUID:=(16#187aeb13#,16#aaf5#,16#4c59#,(16#87#,16#6d#,16#e0#,16#59#,16#8#,16#8c#,16#d#,16#f8#));
   IID_IDirect3DDevice9Video:constant win32.rpcdce.GUID:=(16#26dc4561#,16#a1ee#,16#4ae7#,(16#96#,16#da#,16#11#,16#8a#,16#36#,16#c0#,16#ec#,16#95#));
   IID_IDirect3DAuthenticatedChannel9:constant win32.rpcdce.GUID:=(16#ff24beee#,16#da21#,16#4beb#,(16#98#,16#b5#,16#d2#,16#f8#,16#99#,16#f9#,16#8a#,16#f9#));
   IID_IDirect3DCryptoSession9:constant win32.rpcdce.GUID:=(16#fa0ab799#,16#7a9c#,16#48ca#,(16#8c#,16#5b#,16#23#,16#7e#,16#71#,16#a5#,16#44#,16#34#));


   type IDirect3D9;
   type LPIDIRECT3D9 is access all IDirect3D9;
   type LPLPIDIRECT3D9 is access all LPIDIRECT3D9;

   type IDirect3DDevice9;
   type LPIDirect3DDevice9 is access all IDirect3DDevice9;
   type LPLPIDirect3DDevice9 is access all LPIDirect3DDevice9;
   
   type IDirect3DStateBlock9;
   type LPIDirect3DStateBlock9 is access all IDirect3DStateBlock9;
   type LPLPIDirect3DStateBlock9 is access all LPIDirect3DStateBlock9;
   
   type IDirect3DVertexDeclaration9;
   type LPIDirect3DVertexDeclaration9 is access all IDirect3DVertexDeclaration9;
   type LPLPIDirect3DVertexDeclaration9 is access all LPIDirect3DVertexDeclaration9;
   
   type IDirect3DVertexShader9;
   type LPIDirect3DVertexShader9 is access all IDirect3DVertexShader9;
   type LPLPIDirect3DVertexShader9 is access all LPIDirect3DVertexShader9;
   
   type IDirect3DPixelShader9;
   type LPIDirect3DPixelShader9 IS access all IDirect3DPixelShader9;
   type LPLPIDirect3DPixelShader9 is access all LPIDirect3DPixelShader9;
   
   type IDirect3DResource9;
   type LPIDirect3DResource9 is access all IDirect3DResource9;
   type LPLPIDirect3DResource9 is access all LPIDirect3DResource9;

   type IDirect3DBaseTexture9;
   type LPIDirect3DBaseTexture9 is access all IDirect3DBaseTexture9;
   type LPLPIDirect3DBaseTexture9 is access all LPIDirect3DBaseTexture9;

   type IDirect3DTexture9;
   type LPIDirect3DTexture9 IS ACCESS ALL IDirect3DTexture9;
   TYPE LPLPIDirect3DTexture9 IS ACCESS ALL LPIDirect3DTexture9;

   type IDirect3DVolumeTexture9;
   type LPIDirect3DVolumeTexture9 is access all IDirect3DVolumeTexture9;
   type LPLPIDirect3DVolumeTexture9 is access all LPIDirect3DVolumeTexture9;

   type IDirect3DCubeTexture9;
   type LPIDirect3DCubeTexture9 is access all IDirect3DCubeTexture9;
   type LPLPIDirect3DCubeTexture9 is access all LPIDirect3DCubeTexture9;

   type IDirect3DVertexBuffer9;
   type LPIDirect3DVertexBuffer9 is access all IDirect3DVertexBuffer9;
   type LPLPIDirect3DVertexBuffer9 is access all LPIDirect3DVertexBuffer9;

   type IDirect3DIndexBuffer9;
   type LPIDirect3DIndexBuffer9 is access all IDirect3DIndexBuffer9;
   type LPLPIDirect3DIndexBuffer9 is access all LPIDirect3DIndexBuffer9;

   type IDirect3DSurface9;
   type LPIDirect3DSurface9 is access all IDirect3DSurface9;
   subtype PIDirect3DSurface9 is LPIDirect3DSurface9;
   type LPLPIDirect3DSurface9 is access all LPIDirect3DSurface9;

   type IDirect3DVolume9;
   type LPIDirect3DVolume9 is access all IDirect3DVolume9;
   type LPLPIDirect3DVolume9 is access all LPIDirect3DVolume9;


   type IDirect3DSwapChain9;
   type LPIDirect3DSwapChain9 is access all IDirect3DSwapChain9;
   type LPLPIDirect3DSwapChain9 is access all LPIDirect3DSwapChain9;

   type IDirect3DQuery9;
   type LPIDirect3DQuery9  is access all IDirect3DQuery9;
   type LPLPIDirect3DQuery9 is access all LPIDirect3DQuery9;

   type IDirect3D9Ex;
   type LPIDirect3D9Ex is access all IDirect3D9Ex;
   type LPLPIDirect3D9Ex is access all LPIDirect3D9Ex;

   type IDirect3DDevice9Ex;
   type LPIDirect3DDevice9Ex is access all IDirect3DDevice9Ex;
   type LPLPIDirect3DDevice9Ex is access all LPIDirect3DDevice9Ex;

   type IDirect3DSwapChain9Ex;
   type LPIDirect3DSwapChain9Ex is access all IDirect3DSwapChain9Ex;
   type LPLPIDirect3DSwapChain9Ex is access all LPIDirect3DSwapChain9Ex;


   type IDirect3D9ExOverlayExtension;
   type LPIDirect3D9ExOverlayExtension is access all IDirect3D9ExOverlayExtension;
   type LPLPIDirect3D9ExOverlayExtension is access all LPIDirect3D9ExOverlayExtension;

   type IDirect3DDevice9Video;
   type LPIDirect3DDevice9Video is access all IDirect3DDevice9Video;
   type LPLPIDirect3DDevice9Video is access all LPIDirect3DDevice9Video;

   type IDirect3DAuthenticatedChannel9;
   type LPIDirect3DAuthenticatedChannel9 is access all IDirect3DAuthenticatedChannel9;
   type LPLPIDirect3DAuthenticatedChannel9 is access all LPIDirect3DAuthenticatedChannel9;

   TYPE IDirect3DCryptoSession9;
   type LPIDirect3DCryptoSession9 is access all IDirect3DCryptoSession9;
   type LPLPIDirect3DCryptoSession9 is access all LPIDirect3DCryptoSession9;




   --
   -- APIs
   --
   function Direct3DCreate9(SDKVersion:UINT) return access IDirect3D9 with Import,Convention=>stdcall,external_name=>"Direct3DCreate9";

   function D3DPERF_BeginEvent(col:D3DCOLOR;wszName:LPCWSTR) return int with Import,Convention=>stdcall,external_name=>"D3DPERF_BeginEvent";

   function D3DPERF_EndEvent return int with Import,Convention=>stdcall,external_name=>"D3DPERF_EndEvent";

   procedure D3DPERF_SetMarker(col:D3DCOLOR;wszName:LPCWSTR) with Import,Convention=>stdcall,external_name=>"D3DPERF_SetMarker";

   procedure D3DPERF_SetRegion(col:D3DCOLOR;wszName:LPCWSTR) with Import,Convention=>stdcall,external_name=>"D3DPERF_SetRegion";

   function D3DPERF_QueryRepeatFrame return BOOL with Import,Convention=>stdcall,external_name=>"D3DPERF_QueryRepeatFrame";

   procedure D3DPERF_SetOptions(dwOptions:DWORD) with Import,Convention=>stdcall,external_name=>"D3DPERF_SetOptions";

   function D3DPERF_GetStatus return DWORD with Import,Convention=>stdcall,external_name=>"D3DPERF_GetStatus";

   --
   -- Interfaces begin
   --
   type IDirect3D9 is record
      QueryInterface:access procedure(THIS:LPIDirect3D9;riid:REFIID;ppvObj:LPLPvoid) with Convention=>Stdcall;
      AddRef:access function(THIS:LPIDirect3D9) return ULONG with Convention=>Stdcall;
      Release:access function(THIS:LPIDirect3D9) return ULONG with Convention=>Stdcall;
      RegisterSoftwareDevice:access procedure(THIS:LPIDirect3D9;pInitializeFunction:LPvoid) with Convention=>Stdcall;
      GetAdapterCount:access function(THIS:LPIDirect3D9) return UINT with Convention=>Stdcall;
      GetAdapterIdentifier:access procedure(THIS:LPIDirect3D9;Adapter:UINT;Flags:DWORD;pIdentifier:access D3DADAPTER_IDENTIFIER9) with Convention=>Stdcall;
      GetAdapterModeCount:access function(THIS:LPIDirect3D9;Adapter:UINT;Format:D3DFORMAT) return UINT with Convention=>Stdcall;
      EnumAdapterModes:access procedure(THIS:LPIDirect3D9;Adapter:UINT;Format:D3DFORMAT;Mode:UINT;pMode:access D3DDISPLAYMODE) with Convention=>Stdcall;
      GetAdapterDisplayMode:access procedure(THIS:LPIDirect3D9;Adapter:UINT;pMode:access D3DDISPLAYMODE) with Convention=>Stdcall;
      CheckDeviceTyp:access procedure(THIS:LPIDirect3D9;Adapter:UINT;DevTyp:D3DDEVTYPE;AdapterFormat:D3DFORMAT;BackBufferFormat:D3DFORMAT;bWindowed:BOOL) with Convention=>Stdcall;
      CheckDeviceFormat:access procedure(THIS:LPIDirect3D9;Adapter:UINT;DeviceTyp:D3DDEVTYPE;AdapterFormat:D3DFORMAT;Usage:DWORD;RTyp:D3DRESOURCETYPE;CheckFormat:D3DFORMAT) with Convention=>Stdcall;
      CheckDeviceMultiSampleTyp:access procedure(THIS:LPIDirect3D9;Adapter:UINT;DeviceTyp:D3DDEVTYPE;SurfaceFormat:D3DFORMAT;Windowed:BOOL;MultiSampleTyp:D3DMULTISAMPLE_TYPE;pQualityLevels:LPDWORD) with Convention=>Stdcall;
      CheckDepthStencilMatch:access procedure(THIS:LPIDirect3D9;Adapter:UINT;DeviceTyp:D3DDEVTYPE;AdapterFormat:D3DFORMAT;RenderTargetFormat:D3DFORMAT;DepthStencilFormat:D3DFORMAT) with Convention=>Stdcall;
      CheckDeviceFormatConversion:access procedure(THIS:LPIDirect3D9;Adapter:UINT;DeviceTyp:D3DDEVTYPE;SourceFormat:D3DFORMAT;TargetFormat:D3DFORMAT) with Convention=>Stdcall;
      GetDeviceCaps:access procedure(THIS:LPIDirect3D9;Adapter:UINT;DeviceTyp:D3DDEVTYPE;pCaps:access D3DCAPS9) with Convention=>Stdcall;
      GetAdapterMonitor:access function(THIS:LPIDirect3D9;Adapter:UINT) return HMONITOR with Convention=>Stdcall;
      CreateDevice:access procedure(THIS:LPIDirect3D9;Adapter:UINT;DeviceTyp:D3DDEVTYPE;hFocusWindow:win32.windef.HWND;BehaviorFlags:DWORD;pPresentationParameters:access D3DPRESENT_PARAMETERS;ppReturnedDeviceInterface:LPLPIDirect3DDevice9) with Convention=>Stdcall;
      Version:LPCWSTR;
   end record;




   type IDirect3DDevice9 is record
      QueryInterface:access procedure(THIS:LPIDirect3DDevice9;riid:REFIID;ppvObj:LPLPvoid) with Convention=>Stdcall;
      AddRef:access function(THIS:LPIDirect3DDevice9) return ULONG with Convention=>Stdcall;
      Release:access function(THIS:LPIDirect3DDevice9) return ULONG with Convention=>Stdcall;
      TestCooperativeLevel:access procedure(THIS:LPIDirect3DDevice9) with Convention=>Stdcall;
      GetAvailableTextureMem:access function(THIS:LPIDirect3DDevice9) return UINT with Convention=>Stdcall;
      EvictManagedResources:access procedure(THIS:LPIDirect3DDevice9) with Convention=>Stdcall;
      GetDirect3D:access procedure(THIS:LPIDirect3DDevice9;ppD3D9:LPLPIDirect3D9) with Convention=>Stdcall;
      GetDeviceCaps:access procedure(THIS:LPIDirect3DDevice9;pCaps:access D3DCAPS9) with Convention=>Stdcall;
      GetDisplayMode:access procedure(THIS:LPIDirect3DDevice9;iSwapChain:UINT;pMode:access D3DDISPLAYMODE) with Convention=>Stdcall;
      GetCreationParameters:access procedure(THIS:LPIDirect3DDevice9;pParameters:access D3DDEVICE_CREATION_PARAMETERS) with Convention=>Stdcall;
      SetCursorProperties:access procedure(THIS:LPIDirect3DDevice9;XHotSpot:UINT;YHotSpot:UINT;pCursorBitmap:LPIDirect3DSurface9) with Convention=>Stdcall;
      SetCursorPosition:access function(THIS:LPIDirect3DDevice9;X:int;Y:int;Flags:DWORD) return void with Convention=>Stdcall;
      ShowCursor:access function(THIS:LPIDirect3DDevice9;bShow:BOOL) return BOOL with Convention=>Stdcall;
      CreateAdditionalSwapChain:access procedure(THIS:LPIDirect3DDevice9;pPresentationParameters:access D3DPRESENT_PARAMETERS;pSwapChain:LPLPIDirect3DSwapChain9) with Convention=>Stdcall;
      GetSwapChain:access procedure(THIS:LPIDirect3DDevice9;iSwapChain:UINT;pSwapChain:LPLPIDirect3DSwapChain9) with Convention=>Stdcall;
      GetNumberOfSwapChains:access function(THIS:LPIDirect3DDevice9) return UINT with Convention=>Stdcall;
      Reset:access procedure(THIS:LPIDirect3DDevice9;pPresentationParameters:access D3DPRESENT_PARAMETERS) with Convention=>Stdcall;
      Present:access procedure(THIS:LPIDirect3DDevice9;pSourceRect:LPCRECT;pDestRect:LPCRECT;hDestWindowOverride:win32.windef.HWND;pDirtyRegion:access constant RGNDATA) with Convention=>Stdcall;
      GetBackBuffer:access procedure(THIS:LPIDirect3DDevice9;iSwapChain:UINT;iBackBuffer:UINT;Typ:D3DBACKBUFFER_TYPE;ppBackBuffer:LPLPIDirect3DSurface9) with Convention=>Stdcall;
      GetRasterStatus:access procedure(THIS:LPIDirect3DDevice9;iSwapChain:UINT;pRasterStatus:access D3DRASTER_STATUS) with Convention=>Stdcall;
      SetDialogBoxMode:access procedure(THIS:LPIDirect3DDevice9;bEnableDialogs:BOOL) with Convention=>Stdcall;
      SetGammaRamp:access function(THIS:LPIDirect3DDevice9;iSwapChain:UINT;Flags:DWORD;pRamp:access constant D3DGAMMARAMP) return void with Convention=>Stdcall;
      GetGammaRamp:access function(THIS:LPIDirect3DDevice9;iSwapChain:UINT;pRamp:access D3DGAMMARAMP) return void with Convention=>Stdcall;
      CreateTexture:access procedure(THIS:LPIDirect3DDevice9;Width:UINT;Height:UINT;Levels:UINT;Usage:DWORD;Format:D3DFORMAT;Pool:D3DPOOL;ppTexture:LPLPIDirect3DTexture9;pSharedHandle:access win32.winnt.HANDLE) with Convention=>Stdcall;
      CreateVolumeTexture:access procedure(THIS:LPIDirect3DDevice9;Width:UINT;Height:UINT;Depth:UINT;Levels:UINT;Usage:DWORD;Format:D3DFORMAT;Pool:D3DPOOL;ppVolumeTexture:LPLPIDirect3DVolumeTexture9;pSharedHandle:win32.windef.LPHANDLE) with Convention=>Stdcall;
      CreateCubeTexture:access procedure(THIS:LPIDirect3DDevice9;EdgeLength:UINT;Levels:UINT;Usage:DWORD;Format:D3DFORMAT;Pool:D3DPOOL;ppCubeTexture:LPLPIDirect3DCubeTexture9;pSharedHandle:win32.windef.LPHANDLE) with Convention=>Stdcall;
      CreateVertexBuffer:access procedure(THIS:LPIDirect3DDevice9;Length:UINT;Usage:DWORD;FVF:DWORD;Pool:D3DPOOL;ppVertexBuffer:LPLPIDirect3DVertexBuffer9;pSharedHandle:win32.windef.LPHANDLE) with Convention=>Stdcall;
      CreateIndexBuffer:access procedure(THIS:LPIDirect3DDevice9;Length:UINT;Usage:DWORD;Format:D3DFORMAT;Pool:D3DPOOL;ppIndexBuffer:LPLPIDirect3DIndexBuffer9;pSharedHandle:win32.windef.LPHANDLE) with Convention=>Stdcall;
      CreateRenderTarget:access procedure(THIS:LPIDirect3DDevice9;Width:UINT;Height:UINT;Format:D3DFORMAT;MultiSample:D3DMULTISAMPLE_TYPE;MultisampleQuality:DWORD;Lockable:BOOL;ppSurface:LPLPIDirect3DSurface9;pSharedHandle:win32.windef.LPHANDLE) with Convention=>Stdcall;
      CreateDepthStencilSurface:access procedure(THIS:LPIDirect3DDevice9;Width:UINT;Height:UINT;Format:D3DFORMAT;MultiSample:D3DMULTISAMPLE_TYPE;MultisampleQuality:DWORD;Discard:BOOL;ppSurface:LPLPIDirect3DSurface9;pSharedHandle:win32.windef.LPHANDLE) with Convention=>Stdcall;
      UpdateSurface:access procedure(THIS:LPIDirect3DDevice9;pSourceSurface:LPIDirect3DSurface9;pSourceRect:LPCRECT;pDestinationSurface:LPIDirect3DSurface9;pDestPoint:access constant win32.windef.POINT) with Convention=>Stdcall;
      UpdateTexture:access procedure(THIS:LPIDirect3DDevice9;pSourceTexture:LPIDirect3DBaseTexture9;pDestinationTexture:LPIDirect3DBaseTexture9) with Convention=>Stdcall;
      GetRenderTargetData:access procedure(THIS:LPIDirect3DDevice9;pRenderTarget:LPIDirect3DSurface9;pDestSurface:LPIDirect3DSurface9) with Convention=>Stdcall;
      GetFrontBufferData:access procedure(THIS:LPIDirect3DDevice9;iSwapChain:UINT;pDestSurface:LPIDirect3DSurface9) with Convention=>Stdcall;
      StretchRect:access procedure(THIS:LPIDirect3DDevice9;pSourceSurface:LPIDirect3DSurface9;pSourceRect:LPCRECT;pDestSurface:LPIDirect3DSurface9;pDestRect:LPCRECT;Filter:D3DTEXTUREFILTERTYPE) with Convention=>Stdcall;
      ColorFill:access procedure(THIS:LPIDirect3DDevice9;pSurface:LPIDirect3DSurface9;pRect:LPCRECT;color:D3DCOLOR) with Convention=>Stdcall;
      CreateOffscreenPlainSurface:access procedure(THIS:LPIDirect3DDevice9;Width:UINT;Height:UINT;Format:D3DFORMAT;Pool:D3DPOOL;ppSurface:LPLPIDirect3DSurface9;pSharedHandle:win32.windef.LPHANDLE) with Convention=>Stdcall;
      SetRenderTarget:access procedure(THIS:LPIDirect3DDevice9;RenderTargetIndex:DWORD;pRenderTarget:LPIDirect3DSurface9) with Convention=>Stdcall;
      GetRenderTarget:access procedure(THIS:LPIDirect3DDevice9;RenderTargetIndex:DWORD;ppRenderTarget:LPLPIDirect3DSurface9) with Convention=>Stdcall;
      SetDepthStencilSurface:access procedure(THIS:LPIDirect3DDevice9;pNewZStencil:LPIDirect3DSurface9) with Convention=>Stdcall;
      GetDepthStencilSurface:access procedure(THIS:LPIDirect3DDevice9;ppZStencilSurface:LPLPIDirect3DSurface9) with Convention=>Stdcall;
      BeginScene:access procedure(THIS:LPIDirect3DDevice9) with Convention=>Stdcall;
      EndScene:access procedure(THIS:LPIDirect3DDevice9) with Convention=>Stdcall;
      Clear:access procedure(THIS:LPIDirect3DDevice9;Count:DWORD;pRects:access constant D3DRECT;Flags:DWORD;Color:D3DCOLOR;Z:float;Stencil:DWORD) with Convention=>Stdcall;
      SetTransform:access procedure(THIS:LPIDirect3DDevice9;State:D3DTRANSFORMSTATETYPE;pMatrix:access constant D3DMATRIX) with Convention=>Stdcall;
      GetTransform:access procedure(THIS:LPIDirect3DDevice9;State:D3DTRANSFORMSTATETYPE;pMatrix:access D3DMATRIX) with Convention=>Stdcall;
      MultiplyTransform:access procedure(THIS:LPIDirect3DDevice9;State:D3DTRANSFORMSTATETYPE;M:access constant D3DMATRIX) with Convention=>Stdcall;
      SetViewport:access procedure(THIS:LPIDirect3DDevice9;pViewport:access constant D3DVIEWPORT9) with Convention=>Stdcall;
      GetViewport:access procedure(THIS:LPIDirect3DDevice9;pViewport:access D3DVIEWPORT9) with Convention=>Stdcall;
      SetMaterial:access procedure(THIS:LPIDirect3DDevice9;pMaterial:access constant D3DMATERIAL9) with Convention=>Stdcall;
      GetMaterial:access procedure(THIS:LPIDirect3DDevice9;pMaterial:access D3DMATERIAL9) with Convention=>Stdcall;
      SetLight:access procedure(THIS:LPIDirect3DDevice9;Index:DWORD;l9:access constant D3DLIGHT9) with Convention=>Stdcall;
      GetLight:access procedure(THIS:LPIDirect3DDevice9;Index:DWORD;l9:access D3DLIGHT9) with Convention=>Stdcall;
      LightEnable:access procedure(THIS:LPIDirect3DDevice9;Index:DWORD;Enable:BOOL) with Convention=>Stdcall;
      GetLightEnable:access procedure(THIS:LPIDirect3DDevice9;Index:DWORD;pEnable:LPBOOL) with Convention=>Stdcall;
      SetClipPlane:access procedure(THIS:LPIDirect3DDevice9;Index:DWORD;pPlane:access constant float) with Convention=>Stdcall;
      GetClipPlane:access procedure(THIS:LPIDirect3DDevice9;Index:DWORD;pPlane:access float) with Convention=>Stdcall;
      SetRenderState:access procedure(THIS:LPIDirect3DDevice9;State:D3DRENDERSTATETYPE;Value:DWORD) with Convention=>Stdcall;
      GetRenderState:access procedure(THIS:LPIDirect3DDevice9;State:D3DRENDERSTATETYPE;pValue:LPDWORD) with Convention=>Stdcall;
      CreateStateBlock:access procedure(THIS:LPIDirect3DDevice9;Typ:D3DSTATEBLOCKTYPE;ppSB:LPLPIDirect3DStateBlock9) with Convention=>Stdcall;
      BeginStateBlock:access procedure(THIS:LPIDirect3DDevice9) with Convention=>Stdcall;
      EndStateBlock:access procedure(THIS:LPIDirect3DDevice9;ppSB:LPLPIDirect3DStateBlock9) with Convention=>Stdcall;
      SetClipStatus:access procedure(THIS:LPIDirect3DDevice9;pClipStatus:access constant D3DCLIPSTATUS9) with Convention=>Stdcall;
      GetClipStatus:access procedure(THIS:LPIDirect3DDevice9;pClipStatus:access D3DCLIPSTATUS9) with Convention=>Stdcall;
      GetTexture:access procedure(THIS:LPIDirect3DDevice9;Stage:DWORD;ppTexture:LPLPIDirect3DBaseTexture9) with Convention=>Stdcall;
      SetTexture:access procedure(THIS:LPIDirect3DDevice9;Stage:DWORD;pTexture:LPIDirect3DBaseTexture9) with Convention=>Stdcall;
      GetTextureStageState:access procedure(THIS:LPIDirect3DDevice9;Stage:DWORD;Typ:D3DTEXTURESTAGESTATETYPE;pValue:LPDWORD) with Convention=>Stdcall;
      SetTextureStageState:access procedure(THIS:LPIDirect3DDevice9;Stage:DWORD;Typ:D3DTEXTURESTAGESTATETYPE;Value:DWORD) with Convention=>Stdcall;
      GetSamplerState:access procedure(THIS:LPIDirect3DDevice9;Sampler:DWORD;Typ:D3DSAMPLERSTATETYPE;pValue:LPDWORD) with Convention=>Stdcall;
      SetSamplerState:access procedure(THIS:LPIDirect3DDevice9;Sampler:DWORD;Typ:D3DSAMPLERSTATETYPE;Value:DWORD) with Convention=>Stdcall;
      ValidateDevice:access procedure(THIS:LPIDirect3DDevice9;pNumPasses:LPDWORD) with Convention=>Stdcall;
      SetPaletteEntries:access procedure(THIS:LPIDirect3DDevice9;PaletteNumber:UINT;pEntries:access constant PALETTEENTRY) with Convention=>Stdcall;
      GetPaletteEntries:access procedure(THIS:LPIDirect3DDevice9;PaletteNumber:UINT;pEntries:access PALETTEENTRY) with Convention=>Stdcall;
      SetCurrentTexturePalette:access procedure(THIS:LPIDirect3DDevice9;PaletteNumber:UINT) with Convention=>Stdcall;
      GetCurrentTexturePalette:access procedure(THIS:LPIDirect3DDevice9;PaletteNumber:access UINT) with Convention=>Stdcall;
      SetScissorRect:access procedure(THIS:LPIDirect3DDevice9;pRect:LPCRECT) with Convention=>Stdcall;
      GetScissorRect:access procedure(THIS:LPIDirect3DDevice9;pRect:access win32.windef.RECT) with Convention=>Stdcall;
      SetSoftwareVertexProcessing:access procedure(THIS:LPIDirect3DDevice9;bSoftware:BOOL) with Convention=>Stdcall;
      GetSoftwareVertexProcessing:access function(THIS:LPIDirect3DDevice9) return BOOL with Convention=>Stdcall;
      SetNPatchMode:access procedure(THIS:LPIDirect3DDevice9;nSegments:float) with Convention=>Stdcall;
      GetNPatchMode:access function(THIS:LPIDirect3DDevice9) return float with Convention=>Stdcall;
      DrawPrimitive:access procedure(THIS:LPIDirect3DDevice9;PrimitiveTyp:D3DPRIMITIVETYPE;StartVertex:UINT;PrimitiveCount:UINT) with Convention=>Stdcall;
      DrawIndexedPrimitive:access procedure(THIS:LPIDirect3DDevice9;BaseVertexIndex:INT;MinVertexIndex:UINT;NumVertices:UINT;startIndex:UINT;primCount:UINT) with Convention=>Stdcall;
      DrawPrimitiveUP:access procedure(THIS:LPIDirect3DDevice9;PrimitiveTyp:D3DPRIMITIVETYPE;PrimitiveCount:UINT;pVertexStreamZeroData:LPCvoid;VertexStreamZeroStride:UINT) with Convention=>Stdcall;
      DrawIndexedPrimitiveUP:access procedure(THIS:LPIDirect3DDevice9;PrimitiveTyp:D3DPRIMITIVETYPE;MinVertexIndex:UINT;NumVertices:UINT;PrimitiveCount:UINT;pIndexData:LPCvoid;IndexDataFormat:D3DFORMAT;pVertexStreamZeroData:LPCvoid;VertexStreamZeroStride:UINT) with Convention=>Stdcall;
      ProcessVertices:access procedure(THIS:LPIDirect3DDevice9;SrcStartIndex:UINT;DestIndex:UINT;VertexCount:UINT;pDestBuffer:LPIDirect3DVertexBuffer9;pVertexDecl:LPIDirect3DVertexDeclaration9;Flags:DWORD) with Convention=>Stdcall;
      CreateVertexDeclaration:access procedure(THIS:LPIDirect3DDevice9;pVertexElements:access constant D3DVERTEXELEMENT9;ppDecl:LPLPIDirect3DVertexDeclaration9) with Convention=>Stdcall;
      SetVertexDeclaration:access procedure(THIS:LPIDirect3DDevice9;pDecl:LPIDirect3DVertexDeclaration9) with Convention=>Stdcall;
      GetVertexDeclaration:access procedure(THIS:LPIDirect3DDevice9;ppDecl:LPLPIDirect3DVertexDeclaration9) with Convention=>Stdcall;
      SetFVF:access procedure(THIS:LPIDirect3DDevice9;FVF:DWORD) with Convention=>Stdcall;
      GetFVF:access procedure(THIS:LPIDirect3DDevice9;pFVF:LPDWORD) with Convention=>Stdcall;
      CreateVertexShader:access procedure(THIS:LPIDirect3DDevice9;pFunction:access constant DWORD;ppShader:LPLPIDirect3DVertexShader9) with Convention=>Stdcall;
      SetVertexShader:access procedure(THIS:LPIDirect3DDevice9;pShader:LPIDirect3DVertexShader9) with Convention=>Stdcall;
      GetVertexShader:access procedure(THIS:LPIDirect3DDevice9;ppShader:LPLPIDirect3DVertexShader9) with Convention=>Stdcall;
      SetVertexShaderConstantF:access procedure(THIS:LPIDirect3DDevice9;StartRegister:UINT;pConstantData:access constant float;Vector4fCount:UINT) with Convention=>Stdcall;
      GetVertexShaderConstantF:access procedure(THIS:LPIDirect3DDevice9;StartRegister:UINT;pConstantData:access float;Vector4fCount:UINT) with Convention=>Stdcall;
      SetVertexShaderConstantI:access procedure(THIS:LPIDirect3DDevice9;StartRegister:UINT;pConstantData:access constant int;Vector4iCount:UINT) with Convention=>Stdcall;
      GetVertexShaderConstantI:access procedure(THIS:LPIDirect3DDevice9;StartRegister:UINT;pConstantData:LPint;Vector4iCount:UINT) with Convention=>Stdcall;
      SetVertexShaderConstantB:access procedure(THIS:LPIDirect3DDevice9;StartRegister:UINT;pConstantData:access constant BOOL;BoolCount:UINT) with Convention=>Stdcall;
      GetVertexShaderConstantB:access procedure(THIS:LPIDirect3DDevice9;StartRegister:UINT;pConstantData:LPBOOL;BoolCount:UINT) with Convention=>Stdcall;
      SetStreamSource:access procedure(THIS:LPIDirect3DDevice9;StreamNumber:UINT;pStreamData:LPIDirect3DVertexBuffer9;OffsetInBytes:UINT;Stride:UINT) with Convention=>Stdcall;
      GetStreamSource:access procedure(THIS:LPIDirect3DDevice9;StreamNumber:UINT;ppStreamData:LPLPIDirect3DVertexBuffer9;pOffsetInBytes:access UINT;pStride:access UINT) with Convention=>Stdcall;
      SetStreamSourceFreq:access procedure(THIS:LPIDirect3DDevice9;StreamNumber:UINT;Setting:UINT) with Convention=>Stdcall;
      GetStreamSourceFreq:access procedure(THIS:LPIDirect3DDevice9;StreamNumber:UINT;pSetting:access UINT) with Convention=>Stdcall;
      SetIndices:access procedure(THIS:LPIDirect3DDevice9;pIndexData:LPIDirect3DIndexBuffer9) with Convention=>Stdcall;
      GetIndices:access procedure(THIS:LPIDirect3DDevice9;ppIndexData:LPLPIDirect3DIndexBuffer9) with Convention=>Stdcall;
      CreatePixelShader:access procedure(THIS:LPIDirect3DDevice9;pFunction:access constant DWORD;ppShader:LPLPIDirect3DPixelShader9) with Convention=>Stdcall;
      SetPixelShader:access procedure(THIS:LPIDirect3DDevice9;pShader:LPIDirect3DPixelShader9) with Convention=>Stdcall;
      GetPixelShader:access procedure(THIS:LPIDirect3DDevice9;ppShader:LPLPIDirect3DPixelShader9) with Convention=>Stdcall;
      SetPixelShaderConstantF:access procedure(THIS:LPIDirect3DDevice9;StartRegister:UINT;pConstantData:LPCfloat;Vector4fCount:UINT) with Convention=>Stdcall;
      GetPixelShaderConstantF:access procedure(THIS:LPIDirect3DDevice9;StartRegister:UINT;pConstantData:LPfloat;Vector4fCount:UINT) with Convention=>Stdcall;
      SetPixelShaderConstantI:access procedure(THIS:LPIDirect3DDevice9;StartRegister:UINT;pConstantData:LPCint;Vector4iCount:UINT) with Convention=>Stdcall;
      GetPixelShaderConstantI:access procedure(THIS:LPIDirect3DDevice9;StartRegister:UINT;pConstantData:LPint;Vector4iCount:UINT) with Convention=>Stdcall;
      SetPixelShaderConstantB:access procedure(THIS:LPIDirect3DDevice9;StartRegister:UINT;pConstantData:LPCBOOL;BoolCount:UINT) with Convention=>Stdcall;
      GetPixelShaderConstantB:access procedure(THIS:LPIDirect3DDevice9;StartRegister:UINT;pConstantData:LPBOOL;BoolCount:UINT) with Convention=>Stdcall;
      DrawRectPatch:access procedure(THIS:LPIDirect3DDevice9;Handle:UINT;pNumSegs:LPCfloat;pRectPatchInfo:access constant D3DRECTPATCH_INFO) with Convention=>Stdcall;
      DrawTriPatch:access procedure(THIS:LPIDirect3DDevice9;Handle:UINT;pNumSegs:LPCfloat;pTriPatchInfo:access constant D3DTRIPATCH_INFO) with Convention=>Stdcall;
      DeletePatch:access procedure(THIS:LPIDirect3DDevice9;Handle:UINT) with Convention=>Stdcall;
      CreateQuery:access procedure(THIS:LPIDirect3DDevice9;Typ:D3DQUERYTYPE;ppQuery:LPLPIDirect3DQuery9) with Convention=>Stdcall;

      -- Below for Debug version
      CreationParameters:D3DDEVICE_CREATION_PARAMETERS;
      PresentParameters:D3DPRESENT_PARAMETERS;
      DisplayMode:D3DDISPLAYMODE;
      Caps:D3DCAPS9;
      AvailableTextureMem:UINT;
      SwapChains:UINT;
      Textures:UINT;
      VertexBuffers:UINT;
      IndexBuffers:UINT;
      VertexShaders:UINT;
      PixelShaders:UINT;
      Viewport:D3DVIEWPORT9;
      ProjectionMatrix:D3DMATRIX;
      ViewMatrix:D3DMATRIX;
      WorldMatrix:D3DMATRIX;
      TextureMatrices:D3DMATRIX_Array(0..7);
      FVF:DWORD;
      VertexSize:UINT;
      VertexShaderVersion:DWORD;
      PixelShaderVersion:DWORD;
      SoftwareVertexProcessing:BOOL;
      Material:D3DMATERIAL9;
      Lights:D3DLIGHT9_Array(0..15);
      LightsEnabled:BOOL_Array(0..15);
      GammaRamp:D3DGAMMARAMP;
      ScissorRect:win32.windef.RECT;
      DialogBoxMode:BOOL;
   end record;

   type LPDIRECT3DDEVICE9 is access all IDirect3DDevice9;

   type PDIRECT3DDEVICE9 is access all IDirect3DDevice9;



   type IDirect3DStateBlock9 is record
      QueryInterface:access procedure(THIS:LPIDirect3DStateBlock9;riid:REFIID;ppvObj:LPLPvoid) with Convention=>Stdcall;
      AddRef:access function(THIS:LPIDirect3DStateBlock9) return ULONG with Convention=>Stdcall;
      Release:access function(THIS:LPIDirect3DStateBlock9) return ULONG with Convention=>Stdcall;
      GetDevice:access procedure(THIS:LPIDirect3DStateBlock9;ppDevice:LPLPIDirect3DDevice9) with Convention=>Stdcall;
      Capture:access procedure(THIS:LPIDirect3DStateBlock9) with Convention=>Stdcall;
      Apply:access procedure(THIS:LPIDirect3DStateBlock9) with Convention=>Stdcall;
      CreationCallStack:LPCWSTR;
   end record;

   type LPDIRECT3DSTATEBLOCK9 is access all IDirect3DStateBlock9;

   type PDIRECT3DSTATEBLOCK9 is access all IDirect3DStateBlock9;


   type IDirect3DSwapChain9 is record
      QueryInterface:access procedure(THIS:LPIDirect3DSwapChain9;riid:REFIID;ppvObj:LPLPvoid) with Convention=>Stdcall;
      AddRef:access function(THIS:LPIDirect3DSwapChain9) return ULONG with Convention=>Stdcall;
      Release:access function(THIS:LPIDirect3DSwapChain9) return ULONG with Convention=>Stdcall;
      Present:access procedure(THIS:LPIDirect3DSwapChain9;pSourceRect:access constant win32.windef.RECT;pDestRect:access constant win32.windef.RECT;hDestWindowOverride:win32.windef.HWND;pDirtyRegion:access constant RGNDATA;dwFlags:DWORD) with Convention=>Stdcall;
      GetFrontBufferData:access procedure(THIS:LPIDirect3DSwapChain9;pDestSurface:LPIDirect3DSurface9) with Convention=>Stdcall;
      GetBackBuffer:access procedure(THIS:LPIDirect3DSwapChain9;iBackBuffer:UINT;Typ:D3DBACKBUFFER_TYPE;ppBackBuffer:LPLPIDirect3DSurface9) with Convention=>Stdcall;
      GetRasterStatus:access procedure(THIS:LPIDirect3DSwapChain9;pRasterStatus:access D3DRASTER_STATUS) with Convention=>Stdcall;
      GetDisplayMode:access procedure(THIS:LPIDirect3DSwapChain9;pMode:access D3DDISPLAYMODE) with Convention=>Stdcall;
      GetDevice:access procedure(THIS:LPIDirect3DSwapChain9;ppDevice:LPLPIDirect3DDevice9) with Convention=>Stdcall;
      GetPresentParameters:access procedure(THIS:LPIDirect3DSwapChain9;pPresentationParameters:access D3DPRESENT_PARAMETERS) with Convention=>Stdcall;
      PresentParameters:D3DPRESENT_PARAMETERS;
      DisplayMode:D3DDISPLAYMODE;
      CreationCallStack:LPCWSTR;
   end record;

   type LPDIRECT3DSWAPCHAIN9 is access all IDirect3DSwapChain9;
   type PDIRECT3DSWAPCHAIN9  is access all IDirect3DSwapChain9;




   type IDirect3DResource9 is record
      QueryInterface:access procedure(THIS:LPIDirect3DResource9;riid:REFIID;ppvObj:LPLPvoid) with Convention=>Stdcall;
      AddRef:access function(THIS:LPIDirect3DResource9) return ULONG with Convention=>Stdcall;
      Release:access function(THIS:LPIDirect3DResource9) return ULONG with Convention=>Stdcall;
      GetDevice:access procedure(THIS:LPIDirect3DResource9;ppDevice:LPLPIDirect3DDevice9) with Convention=>Stdcall;
      SetPrivateData:access procedure(THIS:LPIDirect3DResource9;refguid:win32.Objbase.REFGUID;pData:LPCvoid;SizeOfData:DWORD;Flags:DWORD) with Convention=>Stdcall;
      GetPrivateData:access procedure(THIS:LPIDirect3DResource9;refguid:win32.Objbase.REFGUID;pData:LPvoid;pSizeOfData:LPDWORD) with Convention=>Stdcall;
      FreePrivateData:access procedure(THIS:LPIDirect3DResource9;refguid:win32.Objbase.REFGUID) with Convention=>Stdcall;
      SetPriority:access function(THIS:LPIDirect3DResource9;PriorityNew:DWORD) return DWORD with Convention=>Stdcall;
      GetPriority:access function(THIS:LPIDirect3DResource9) return DWORD with Convention=>Stdcall;
      PreLoad:access function(THIS:LPIDirect3DResource9) return void with Convention=>Stdcall;
      GetTyp:access function(THIS:LPIDirect3DResource9) return D3DRESOURCETYPE with Convention=>Stdcall;
   end record;

   type LPDIRECT3DRESOURCE9 is access all IDirect3DResource9;
   type PDIRECT3DRESOURCE9  is access all IDirect3DResource9;



   type IDirect3DVertexDeclaration9 is record
      QueryInterface:access procedure(THIS:LPIDirect3DVertexDeclaration9;riid:REFIID;ppvObj:LPLPvoid) with Convention=>Stdcall;
      AddRef:access function(THIS:LPIDirect3DVertexDeclaration9) return ULONG with Convention=>Stdcall;
      Release:access function(THIS:LPIDirect3DVertexDeclaration9) return ULONG with Convention=>Stdcall;
      GetDevice:access procedure(THIS:LPIDirect3DVertexDeclaration9;ppDevice:LPLPIDirect3DDevice9) with Convention=>Stdcall;
      GetDeclaration:access procedure(THIS:LPIDirect3DVertexDeclaration9;pElement:LPD3DVERTEXELEMENT9;pNumElements:LPUINT) with Convention=>Stdcall;
      CreationCallStack:LPCWSTR;
   end record;

   type LPDIRECT3DVERTEXDECLARATION9 is access all IDirect3DVertexDeclaration9;
   type PDIRECT3DVERTEXDECLARATION9  is access all IDirect3DVertexDeclaration9;



   type IDirect3DVertexShader9 is record
      QueryInterface:access procedure(THIS:LPIDirect3DVertexShader9;riid:REFIID;ppvObj:LPLPvoid) with Convention=>Stdcall;
      AddRef:access function(THIS:LPIDirect3DVertexShader9) return ULONG with Convention=>Stdcall;
      Release:access function(THIS:LPIDirect3DVertexShader9) return ULONG with Convention=>Stdcall;
      GetDevice:access procedure(THIS:LPIDirect3DVertexShader9;ppDevice:LPLPIDirect3DDevice9) with Convention=>Stdcall;
      GetFunction:access procedure(THIS:LPIDirect3DVertexShader9;pv:pvoid;pSizeOfData:LPUINT) with Convention=>Stdcall;
      Version:DWORD;
      CreationCallStack:LPCWSTR;
   end record;

   type LPDIRECT3DVERTEXSHADER9 is access all IDirect3DVertexShader9;
   type PDIRECT3DVERTEXSHADER9  is access all IDirect3DVertexShader9;



   type IDirect3DPixelShader9 is record
      QueryInterface:access procedure(THIS:LPIDirect3DPixelShader9;riid:REFIID;ppvObj:LPLPvoid) with Convention=>Stdcall;
      AddRef:access function(THIS:LPIDirect3DPixelShader9) return ULONG with Convention=>Stdcall;
      Release:access function(THIS:LPIDirect3DPixelShader9) return ULONG with Convention=>Stdcall;
      GetDevice:access procedure(THIS:LPIDirect3DPixelShader9;ppDevice:LPLPIDirect3DDevice9) with Convention=>Stdcall;
      GetFunction:access procedure(THIS:LPIDirect3DPixelShader9;pv:pvoid;pSizeOfData:LPUINT) with Convention=>Stdcall;
      Version:DWORD;
      CreationCallStack:LPCWSTR;
   end record;

   type LPDIRECT3DPIXELSHADER9 is access all IDirect3DPixelShader9;
   type PDIRECT3DPIXELSHADER9  is access all IDirect3DPixelShader9;



   type IDirect3DBaseTexture9 is record
      QueryInterface:access procedure(THIS:LPIDirect3DBaseTexture9;riid:REFIID;ppvObj:LPLPvoid) with Convention=>Stdcall;
      AddRef:access function(THIS:LPIDirect3DBaseTexture9) return ULONG with Convention=>Stdcall;
      Release:access function(THIS:LPIDirect3DBaseTexture9) return ULONG with Convention=>Stdcall;
      GetDevice:access procedure(THIS:LPIDirect3DBaseTexture9;ppDevice:LPLPIDirect3DDevice9) with Convention=>Stdcall;
      SetPrivateData:access procedure(THIS:LPIDirect3DBaseTexture9;refguid:win32.Objbase.REFGUID;pData:LPCvoid;SizeOfData:DWORD;Flags:DWORD) with Convention=>Stdcall;
      GetPrivateData:access procedure(THIS:LPIDirect3DBaseTexture9;refguid:win32.Objbase.REFGUID;pData:LPvoid;pSizeOfData:LPDWORD) with Convention=>Stdcall;
      FreePrivateData:access procedure(THIS:LPIDirect3DBaseTexture9;refguid:win32.Objbase.REFGUID) with Convention=>Stdcall;
      SetPriority:access function(THIS:LPIDirect3DBaseTexture9;PriorityNew:DWORD) return DWORD with Convention=>Stdcall;
      GetPriority:access function(THIS:LPIDirect3DBaseTexture9) return DWORD with Convention=>Stdcall;
      PreLoad:access function(THIS:LPIDirect3DBaseTexture9) return void with Convention=>Stdcall;
      GetTyp:access function(THIS:LPIDirect3DBaseTexture9) return D3DRESOURCETYPE with Convention=>Stdcall;
      SetLOD:access function(THIS:LPIDirect3DBaseTexture9;LODNew:DWORD) return DWORD with Convention=>Stdcall;
      GetLOD:access function(THIS:LPIDirect3DBaseTexture9) return DWORD with Convention=>Stdcall;
      GetLevelCount:access function(THIS:LPIDirect3DBaseTexture9) return DWORD with Convention=>Stdcall;
      SetAutoGenFilterTyp:access procedure(THIS:LPIDirect3DBaseTexture9;FilterTyp:D3DTEXTUREFILTERTYPE) with Convention=>Stdcall;
      GetAutoGenFilterTyp:access function(THIS:LPIDirect3DBaseTexture9) return D3DTEXTUREFILTERTYPE with Convention=>Stdcall;
      GenerateMipSubLevels:access function(THIS:LPIDirect3DBaseTexture9) return void with Convention=>Stdcall;
   end record;

   type LPDIRECT3DBASETEXTURE9 is access all IDirect3DBaseTexture9;
   type PDIRECT3DBASETEXTURE9 is access all IDirect3DBaseTexture9;




   type IDirect3DTexture9 is record
      QueryInterface:access procedure(THIS:LPIDirect3DTexture9;riid:REFIID;ppvObj:LPLPvoid) with Convention=>Stdcall;
      AddRef:access function(THIS:LPIDirect3DTexture9) return ULONG with Convention=>Stdcall;
      Release:access function(THIS:LPIDirect3DTexture9) return ULONG with Convention=>Stdcall;
      GetDevice:access procedure(THIS:LPIDirect3DTexture9;ppDevice:LPLPIDirect3DDevice9) with Convention=>Stdcall;
      SetPrivateData:access procedure(THIS:LPIDirect3DTexture9;refguid:win32.Objbase.REFGUID;pData:LPCvoid;SizeOfData:DWORD;Flags:DWORD) with Convention=>Stdcall;
      GetPrivateData:access procedure(THIS:LPIDirect3DTexture9;refguid:win32.Objbase.REFGUID;pData:LPvoid;pSizeOfData:LPDWORD) with Convention=>Stdcall;
      FreePrivateData:access procedure(THIS:LPIDirect3DTexture9;refguid:win32.Objbase.REFGUID) with Convention=>Stdcall;
      SetPriority:access function(THIS:LPIDirect3DTexture9;PriorityNew:DWORD) return DWORD with Convention=>Stdcall;
      GetPriority:access function(THIS:LPIDirect3DTexture9) return DWORD with Convention=>Stdcall;
      PreLoad:access function(THIS:LPIDirect3DTexture9) return void with Convention=>Stdcall;
      GetTyp:access function(THIS:LPIDirect3DTexture9) return D3DRESOURCETYPE with Convention=>Stdcall;
      SetLOD:access function(THIS:LPIDirect3DTexture9;LODNew:DWORD) return DWORD with Convention=>Stdcall;
      GetLOD:access function(THIS:LPIDirect3DTexture9) return DWORD with Convention=>Stdcall;
      GetLevelCount:access function(THIS:LPIDirect3DTexture9) return DWORD with Convention=>Stdcall;
      SetAutoGenFilterTyp:access procedure(THIS:LPIDirect3DTexture9;FilterTyp:D3DTEXTUREFILTERTYPE) with Convention=>Stdcall;
      GetAutoGenFilterTyp:access function(THIS:LPIDirect3DTexture9) return D3DTEXTUREFILTERTYPE with Convention=>Stdcall;
      GenerateMipSubLevels:access function(THIS:LPIDirect3DTexture9) return void with Convention=>Stdcall;
      GetLevelDesc:access procedure(THIS:LPIDirect3DTexture9;Level:UINT;pDesc:access D3DSURFACE_DESC) with Convention=>Stdcall;
      GetSurfaceLevel:access procedure(THIS:LPIDirect3DTexture9;Level:UINT;ppSurfaceLevel:LPLPIDirect3DSurface9) with Convention=>Stdcall;
      LockRect:access procedure(THIS:LPIDirect3DTexture9;Level:UINT;pLockedRect:access D3DLOCKED_RECT;pRect:access constant RECT;Flags:DWORD) with Convention=>Stdcall;
      UnlockRect:access procedure(THIS:LPIDirect3DTexture9;Level:UINT) with Convention=>Stdcall;
      AddDirtyRect:access procedure(THIS:LPIDirect3DTexture9;pDirtyRect:LPCRECT) with Convention=>Stdcall;
      Name:LPCWSTR;
      Width:UINT;
      Height:UINT;
      Levels:UINT;
      Usage:DWORD;
      Format:D3DFORMAT;
      Pool:D3DPOOL;
      Priority:DWORD;
      LOD:DWORD;
      FilterTyp:D3DTEXTUREFILTERTYPE;
      LockCount:UINT;
      CreationCallStack:LPCWSTR;
   end record;

   type LPDIRECT3DTEXTURE9 is access all IDirect3DTexture9;
   type PDIRECT3DTEXTURE9 is access all IDirect3DTexture9;



   type IDirect3DVolumeTexture9 is record
      QueryInterface:access procedure(THIS:LPIDirect3DVolumeTexture9;riid:REFIID;ppvObj:LPLPvoid) with Convention=>Stdcall;
      AddRef:access function(THIS:LPIDirect3DVolumeTexture9) return ULONG with Convention=>Stdcall;
      Release:access function(THIS:LPIDirect3DVolumeTexture9) return ULONG with Convention=>Stdcall;
      GetDevice:access procedure(THIS:LPIDirect3DVolumeTexture9;ppDevice:LPLPIDirect3DDevice9) with Convention=>Stdcall;
      SetPrivateData:access procedure(THIS:LPIDirect3DVolumeTexture9;refguid:win32.Objbase.REFGUID;pData:LPCvoid;SizeOfData:DWORD;Flags:DWORD) with Convention=>Stdcall;
      GetPrivateData:access procedure(THIS:LPIDirect3DVolumeTexture9;refguid:win32.Objbase.REFGUID;pData:LPvoid;pSizeOfData:LPDWORD) with Convention=>Stdcall;
      FreePrivateData:access procedure(THIS:LPIDirect3DVolumeTexture9;refguid:win32.Objbase.REFGUID) with Convention=>Stdcall;
      SetPriority:access function(THIS:LPIDirect3DVolumeTexture9;PriorityNew:DWORD) return DWORD with Convention=>Stdcall;
      GetPriority:access function(THIS:LPIDirect3DVolumeTexture9) return DWORD with Convention=>Stdcall;
      PreLoad:access function(THIS:LPIDirect3DVolumeTexture9) return void with Convention=>Stdcall;
      GetTyp:access function(THIS:LPIDirect3DVolumeTexture9) return D3DRESOURCETYPE with Convention=>Stdcall;
      SetLOD:access function(THIS:LPIDirect3DVolumeTexture9;LODNew:DWORD) return DWORD with Convention=>Stdcall;
      GetLOD:access function(THIS:LPIDirect3DVolumeTexture9) return DWORD with Convention=>Stdcall;
      GetLevelCount:access function(THIS:LPIDirect3DVolumeTexture9) return DWORD with Convention=>Stdcall;
      SetAutoGenFilterTyp:access procedure(THIS:LPIDirect3DVolumeTexture9;FilterTyp:D3DTEXTUREFILTERTYPE) with Convention=>Stdcall;
      GetAutoGenFilterTyp:access function(THIS:LPIDirect3DVolumeTexture9) return D3DTEXTUREFILTERTYPE with Convention=>Stdcall;
      GenerateMipSubLevels:access function(THIS:LPIDirect3DVolumeTexture9) return void with Convention=>Stdcall;
      GetLevelDesc:access procedure(THIS:LPIDirect3DVolumeTexture9;Level:UINT;pDesc:access D3DVOLUME_DESC) with Convention=>Stdcall;
      GetVolumeLevel:access procedure(THIS:LPIDirect3DVolumeTexture9;Level:UINT;ppVolumeLevel:LPLPIDirect3DVolume9) with Convention=>Stdcall;
      LockBox:access procedure(THIS:LPIDirect3DVolumeTexture9;Level:UINT;pLockedVolume:access D3DLOCKED_BOX;pBox:access constant D3DBOX;Flags:DWORD) with Convention=>Stdcall;
      UnlockBox:access procedure(THIS:LPIDirect3DVolumeTexture9;Level:UINT) with Convention=>Stdcall;
      AddDirtyBox:access procedure(THIS:LPIDirect3DVolumeTexture9;pDirtyBox:access constant D3DBOX) with Convention=>Stdcall;
      Name:LPCWSTR;
      Width:UINT;
      Height:UINT;
      Depth:UINT;
      Levels:UINT;
      Usage:DWORD;
      Format:D3DFORMAT;
      Pool:D3DPOOL;
      Priority:DWORD;
      LOD:DWORD;
      FilterTyp:D3DTEXTUREFILTERTYPE;
      LockCount:UINT;
      CreationCallStack:LPCWSTR;
   end record;

   type LPDIRECT3DVOLUMETEXTURE9 is access all IDirect3DVolumeTexture9;
   type PDIRECT3DVOLUMETEXTURE9 is access all IDirect3DVolumeTexture9;



   type IDirect3DCubeTexture9 is record
      QueryInterface:access procedure(THIS:LPIDirect3DCubeTexture9;riid:REFIID;ppvObj:LPLPvoid) with Convention=>Stdcall;
      AddRef:access function(THIS:LPIDirect3DCubeTexture9) return ULONG with Convention=>Stdcall;
      Release:access function(THIS:LPIDirect3DCubeTexture9) return ULONG with Convention=>Stdcall;
      GetDevice:access procedure(THIS:LPIDirect3DCubeTexture9;ppDevice:LPLPIDirect3DDevice9) with Convention=>Stdcall;
      SetPrivateData:access procedure(THIS:LPIDirect3DCubeTexture9;refguid:win32.Objbase.REFGUID;pData:LPCvoid;SizeOfData:DWORD;Flags:DWORD) with Convention=>Stdcall;
      GetPrivateData:access procedure(THIS:LPIDirect3DCubeTexture9;refguid:win32.Objbase.REFGUID;pData:LPvoid;pSizeOfData:LPDWORD) with Convention=>Stdcall;
      FreePrivateData:access procedure(THIS:LPIDirect3DCubeTexture9;refguid:win32.Objbase.REFGUID) with Convention=>Stdcall;
      SetPriority:access function(THIS:LPIDirect3DCubeTexture9;PriorityNew:DWORD) return DWORD with Convention=>Stdcall;
      GetPriority:access function(THIS:LPIDirect3DCubeTexture9) return DWORD with Convention=>Stdcall;
      PreLoad:access function(THIS:LPIDirect3DCubeTexture9) return void with Convention=>Stdcall;
      GetTyp:access function(THIS:LPIDirect3DCubeTexture9) return D3DRESOURCETYPE with Convention=>Stdcall;
      SetLOD:access function(THIS:LPIDirect3DCubeTexture9;LODNew:DWORD) return DWORD with Convention=>Stdcall;
      GetLOD:access function(THIS:LPIDirect3DCubeTexture9) return DWORD with Convention=>Stdcall;
      GetLevelCount:access function(THIS:LPIDirect3DCubeTexture9) return DWORD with Convention=>Stdcall;
      SetAutoGenFilterTyp:access procedure(THIS:LPIDirect3DCubeTexture9;FilterTyp:D3DTEXTUREFILTERTYPE) with Convention=>Stdcall;
      GetAutoGenFilterTyp:access function(THIS:LPIDirect3DCubeTexture9) return D3DTEXTUREFILTERTYPE with Convention=>Stdcall;
      GenerateMipSubLevels:access function(THIS:LPIDirect3DCubeTexture9) return void with Convention=>Stdcall;
      GetLevelDesc:access procedure(THIS:LPIDirect3DCubeTexture9;Level:UINT;pDesc:access D3DSURFACE_DESC) with Convention=>Stdcall;
      GetCubeMapSurface:access procedure(THIS:LPIDirect3DCubeTexture9;FaceTyp:D3DCUBEMAP_FACES;Level:UINT;ppCubeMapSurface:LPLPIDirect3DSurface9) with Convention=>Stdcall;
      LockRect:access procedure(THIS:LPIDirect3DCubeTexture9;FaceTyp:D3DCUBEMAP_FACES;Level:UINT;pLockedRect:access D3DLOCKED_RECT;pRect:access constant RECT;Flags:DWORD) with Convention=>Stdcall;
      UnlockRect:access procedure(THIS:LPIDirect3DCubeTexture9;FaceTyp:D3DCUBEMAP_FACES;Level:UINT) with Convention=>Stdcall;
      AddDirtyRect:access procedure(THIS:LPIDirect3DCubeTexture9;FaceTyp:D3DCUBEMAP_FACES;pDirtyRect:LPCRECT) with Convention=>Stdcall;
      Name:LPCWSTR;
      Width:UINT;
      Height:UINT;
      Levels:UINT;
      Usage:DWORD;
      Format:D3DFORMAT;
      Pool:D3DPOOL;
      Priority:DWORD;
      LOD:DWORD;
      FilterTyp:D3DTEXTUREFILTERTYPE;
      LockCount:UINT;
      CreationCallStack:LPCWSTR;
   end record;

   type LPDIRECT3DCUBETEXTURE9 is access all IDirect3DCubeTexture9;
   type PDIRECT3DCUBETEXTURE9 is access all IDirect3DCubeTexture9;


   type IDirect3DVertexBuffer9 is record
      QueryInterface:access procedure(THIS:LPIDirect3DVertexBuffer9;riid:REFIID;ppvObj:LPLPvoid) with Convention=>Stdcall;
      AddRef:access function(THIS:LPIDirect3DVertexBuffer9) return ULONG with Convention=>Stdcall;
      Release:access function(THIS:LPIDirect3DVertexBuffer9) return ULONG with Convention=>Stdcall;
      GetDevice:access procedure(THIS:LPIDirect3DVertexBuffer9;ppDevice:LPLPIDirect3DDevice9) with Convention=>Stdcall;
      SetPrivateData:access procedure(THIS:LPIDirect3DVertexBuffer9;refguid:win32.Objbase.REFGUID;pData:LPCvoid;SizeOfData:DWORD;Flags:DWORD) with Convention=>Stdcall;
      GetPrivateData:access procedure(THIS:LPIDirect3DVertexBuffer9;refguid:win32.Objbase.REFGUID;pData:LPvoid;pSizeOfData:LPDWORD) with Convention=>Stdcall;
      FreePrivateData:access procedure(THIS:LPIDirect3DVertexBuffer9;refguid:win32.Objbase.REFGUID) with Convention=>Stdcall;
      SetPriority:access function(THIS:LPIDirect3DVertexBuffer9;PriorityNew:DWORD) return DWORD with Convention=>Stdcall;
      GetPriority:access function(THIS:LPIDirect3DVertexBuffer9) return DWORD with Convention=>Stdcall;
      PreLoad:access function(THIS:LPIDirect3DVertexBuffer9) return void with Convention=>Stdcall;
      GetTyp:access function(THIS:LPIDirect3DVertexBuffer9) return D3DRESOURCETYPE with Convention=>Stdcall;
      Lock:access procedure(THIS:LPIDirect3DVertexBuffer9;OffsetToLock:UINT;SizeToLock:UINT;ppbData:LPLPvoid;Flags:DWORD) with Convention=>Stdcall;
      Unlock:access procedure(THIS:LPIDirect3DVertexBuffer9) with Convention=>Stdcall;
      GetDesc:access procedure(THIS:LPIDirect3DVertexBuffer9;pDesc:access D3DVERTEXBUFFER_DESC) with Convention=>Stdcall;
      Name:LPCWSTR;
      Length:UINT;
      Usage:DWORD;
      FVF:DWORD;
      Pool:D3DPOOL;
      Priority:DWORD;
      LockCount:UINT;
      CreationCallStack:LPCWSTR;
   end record;

   type LPDIRECT3DVERTEXBUFFER9 is access all IDirect3DVertexBuffer9;
   type PDIRECT3DVERTEXBUFFER9 is access all IDirect3DVertexBuffer9;



   type IDirect3DIndexBuffer9 is record
      QueryInterface:access procedure(THIS:LPIDirect3DIndexBuffer9;riid:REFIID;ppvObj:LPLPvoid) with Convention=>Stdcall;
      AddRef:access function(THIS:LPIDirect3DIndexBuffer9) return ULONG with Convention=>Stdcall;
      Release:access function(THIS:LPIDirect3DIndexBuffer9) return ULONG with Convention=>Stdcall;
      GetDevice:access procedure(THIS:LPIDirect3DIndexBuffer9;ppDevice:LPLPIDirect3DDevice9) with Convention=>Stdcall;
      SetPrivateData:access procedure(THIS:LPIDirect3DIndexBuffer9;refguid:win32.Objbase.REFGUID;pData:LPCvoid;SizeOfData:DWORD;Flags:DWORD) with Convention=>Stdcall;
      GetPrivateData:access procedure(THIS:LPIDirect3DIndexBuffer9;refguid:win32.Objbase.REFGUID;pData:LPvoid;pSizeOfData:LPDWORD) with Convention=>Stdcall;
      FreePrivateData:access procedure(THIS:LPIDirect3DIndexBuffer9;refguid:win32.Objbase.REFGUID) with Convention=>Stdcall;
      SetPriority:access function(THIS:LPIDirect3DIndexBuffer9;PriorityNew:DWORD) return DWORD with Convention=>Stdcall;
      GetPriority:access function(THIS:LPIDirect3DIndexBuffer9) return DWORD with Convention=>Stdcall;
      PreLoad:access function(THIS:LPIDirect3DIndexBuffer9) return void with Convention=>Stdcall;
      GetTyp:access function(THIS:LPIDirect3DIndexBuffer9) return D3DRESOURCETYPE with Convention=>Stdcall;
      Lock:access procedure(THIS:LPIDirect3DIndexBuffer9;OffsetToLock:UINT;SizeToLock:UINT;ppbData:LPLPvoid;Flags:DWORD) with Convention=>Stdcall;
      Unlock:access procedure(THIS:LPIDirect3DIndexBuffer9) with Convention=>Stdcall;
      GetDesc:access procedure(THIS:LPIDirect3DIndexBuffer9;pDesc:access D3DINDEXBUFFER_DESC) with Convention=>Stdcall;
      Name:LPCWSTR;
      Length:UINT;
      Usage:DWORD;
      Format:D3DFORMAT;
      Pool:D3DPOOL;
      Priority:DWORD;
      LockCount:UINT;
      CreationCallStack:LPCWSTR;
   end record;

   type LPDIRECT3DINDEXBUFFER9 is access all IDirect3DIndexBuffer9;
   type PDIRECT3DINDEXBUFFER9 is access all IDirect3DIndexBuffer9;



   type IDirect3DSurface9 is record
      QueryInterface:access procedure(THIS:LPIDirect3DSurface9;riid:REFIID;ppvObj:LPLPvoid) with Convention=>Stdcall;
      AddRef:access function(THIS:LPIDirect3DSurface9) return ULONG with Convention=>Stdcall;
      Release:access function(THIS:LPIDirect3DSurface9) return ULONG with Convention=>Stdcall;
      GetDevice:access procedure(THIS:LPIDirect3DSurface9;ppDevice:LPLPIDirect3DDevice9) with Convention=>Stdcall;
      SetPrivateData:access procedure(THIS:LPIDirect3DSurface9;refguid:win32.Objbase.REFGUID;pData:LPCvoid;SizeOfData:DWORD;Flags:DWORD) with Convention=>Stdcall;
      GetPrivateData:access procedure(THIS:LPIDirect3DSurface9;refguid:win32.Objbase.REFGUID;pData:LPvoid;pSizeOfData:LPDWORD) with Convention=>Stdcall;
      FreePrivateData:access procedure(THIS:LPIDirect3DSurface9;refguid:win32.Objbase.REFGUID) with Convention=>Stdcall;
      SetPriority:access function(THIS:LPIDirect3DSurface9;PriorityNew:DWORD) return DWORD with Convention=>Stdcall;
      GetPriority:access function(THIS:LPIDirect3DSurface9) return DWORD with Convention=>Stdcall;
      PreLoad:access function(THIS:LPIDirect3DSurface9) return void with Convention=>Stdcall;
      GetTyp:access function(THIS:LPIDirect3DSurface9) return D3DRESOURCETYPE with Convention=>Stdcall;
      GetContainer:access procedure(THIS:LPIDirect3DSurface9;riid:REFIID;ppContainer:LPLPvoid) with Convention=>Stdcall;
      GetDesc:access procedure(THIS:LPIDirect3DSurface9;pDesc:access D3DSURFACE_DESC) with Convention=>Stdcall;
      LockRect:access procedure(THIS:LPIDirect3DSurface9;pLockedRect:access D3DLOCKED_RECT;pRect:LPCRECT;Flags:DWORD) with Convention=>Stdcall;
      UnlockRect:access procedure(THIS:LPIDirect3DSurface9) with Convention=>Stdcall;
      GetDC:access procedure(THIS:LPIDirect3DSurface9;phdc:access HDC) with Convention=>Stdcall;
      ReleaseDC:access procedure(THIS:LPIDirect3DSurface9;hdc:win32.windef.HDC) with Convention=>Stdcall;
      Name:LPCWSTR;
      Width:UINT;
      Height:UINT;
      Usage:DWORD;
      Format:D3DFORMAT;
      Pool:D3DPOOL;
      MultiSampleTyp:D3DMULTISAMPLE_TYPE;
      MultiSampleQuality:DWORD;
      Priority:DWORD;
      LockCount:UINT;
      DCCount:UINT;
      CreationCallStack:LPCWSTR;
   end record;

   type LPDIRECT3DSURFACE9 is access all IDirect3DSurface9;
   type PDIRECT3DSURFACE9 is access all IDirect3DSurface9;


   type IDirect3DVolume9 is record
      QueryInterface:access procedure(THIS:LPIDirect3DVolume9;riid:REFIID;ppvObj:LPLPvoid) with Convention=>Stdcall;
      AddRef:access function(THIS:LPIDirect3DVolume9) return ULONG with Convention=>Stdcall;
      Release:access function(THIS:LPIDirect3DVolume9) return ULONG with Convention=>Stdcall;
      GetDevice:access procedure(THIS:LPIDirect3DVolume9;ppDevice:LPLPIDirect3DDevice9) with Convention=>Stdcall;
      SetPrivateData:access procedure(THIS:LPIDirect3DVolume9;refguid:win32.Objbase.REFGUID;pData:LPCvoid;SizeOfData:DWORD;Flags:DWORD) with Convention=>Stdcall;
      GetPrivateData:access procedure(THIS:LPIDirect3DVolume9;refguid:win32.Objbase.REFGUID;pData:LPvoid;pSizeOfData:LPDWORD) with Convention=>Stdcall;
      FreePrivateData:access procedure(THIS:LPIDirect3DVolume9;refguid:win32.Objbase.REFGUID) with Convention=>Stdcall;
      GetContainer:access procedure(THIS:LPIDirect3DVolume9;riid:REFIID;ppContainer:LPLPvoid) with Convention=>Stdcall;
      GetDesc:access procedure(THIS:LPIDirect3DVolume9;pDesc:access D3DVOLUME_DESC) with Convention=>Stdcall;
      LockBox:access procedure(THIS:LPIDirect3DVolume9;pLockedVolume:access D3DLOCKED_BOX;pBox:access constant D3DBOX;Flags:DWORD) with Convention=>Stdcall;
      UnlockBox:access procedure(THIS:LPIDirect3DVolume9) with Convention=>Stdcall;
      Name:LPCWSTR;
      Width:UINT;
      Height:UINT;
      Depth:UINT;
      Usage:DWORD;
      Format:D3DFORMAT;
      Pool:D3DPOOL;
      LockCount:UINT;
      CreationCallStack:LPCWSTR;
   end record;

   type LPDIRECT3DVOLUME9 is access all IDirect3DVolume9;
   type PDIRECT3DVOLUME9 is access all IDirect3DVolume9;



   type IDirect3DQuery9 is record
      QueryInterface:access procedure(THIS:LPIDirect3DQuery9;riid:REFIID;ppvObj:LPLPvoid) with Convention=>Stdcall;
      AddRef:access function(THIS:LPIDirect3DQuery9) return ULONG with Convention=>Stdcall;
      Release:access function(THIS:LPIDirect3DQuery9) return ULONG with Convention=>Stdcall;
      GetDevice:access procedure(THIS:LPIDirect3DQuery9;ppDevice:LPLPIDirect3DDevice9) with Convention=>Stdcall;
      GetTyp:access function(THIS:LPIDirect3DQuery9) return D3DQUERYTYPE with Convention=>Stdcall;
      GetDataSize:access function(THIS:LPIDirect3DQuery9) return DWORD with Convention=>Stdcall;
      Issue:access procedure(THIS:LPIDirect3DQuery9;dwIssueFlags:DWORD) with Convention=>Stdcall;
      GetData:access procedure(THIS:LPIDirect3DQuery9;pData:LPvoid;dwSize:DWORD;dwGetDataFlags:DWORD) with Convention=>Stdcall;
      Typ:D3DQUERYTYPE;
      DataSize:DWORD;
      CreationCallStack:LPCWSTR;
   end record;

   type LPDIRECT3DQUERY9 is access all IDirect3DQuery9;
   type PDIRECT3DQUERY9 is access all IDirect3DQuery9;


   D3DSPD_IUNKNOWN : constant := 16#00000001#;

   D3DCREATE_FPU_PRESERVE : constant := 16#00000002#;

   D3DCREATE_MULTITHREADED : constant := 16#00000004#;

   D3DCREATE_PUREDEVICE : constant := 16#00000010#;

   D3DCREATE_SOFTWARE_VERTEXPROCESSING : constant := 16#00000020#;

   D3DCREATE_HARDWARE_VERTEXPROCESSING : constant := 16#00000040#;

   D3DCREATE_MIXED_VERTEXPROCESSING : constant := 16#00000080#;

   D3DCREATE_DISABLE_DRIVER_MANAGEMENT : constant := 16#00000100#;

   D3DCREATE_ADAPTERGROUP_DEVICE : constant := 16#00000200#;

   D3DCREATE_DISABLE_DRIVER_MANAGEMENT_EX : constant := 16#00000400#;

   D3DCREATE_NOWINDOWCHANGES : constant := 16#00000800#;

   D3DCREATE_DISABLE_PSGP_THREADING : constant := 16#00002000#;

   D3DCREATE_ENABLE_PRESENTSTATS : constant := 16#00004000#;

   D3DCREATE_DISABLE_PRINTSCREEN : constant := 16#00008000#;

   D3DCREATE_SCREENSAVER : constant := 16#10000000#;

   D3DADAPTER_DEFAULT : constant := 0;

   D3DENUM_WHQL_LEVEL : constant := 16#00000002#;

   D3DENUM_NO_DRIVERVERSION : constant := 16#00000004#;

   D3DPRESENT_BACK_BUFFERS_MAX : constant := 30;

   D3DPRESENT_BACK_BUFFERS_MAX_EX : constant := 300;

   D3DSGR_NO_CALIBRATION : constant := 16#00000000#;

   D3DSGR_CALIBRATE : constant := 16#00000001#;

   D3DCURSOR_IMMEDIATE_UPDATE : constant := 16#00000001#;

   D3DPRESENT_DONOTWAIT : constant := 16#00000001#;

   D3DPRESENT_LINEAR_CONTENT : constant := 16#00000002#;

   D3DPRESENT_DONOTFLIP : constant := 16#00000004#;

   D3DPRESENT_FLIPRESTART : constant := 16#00000008#;

   D3DPRESENT_VIDEO_RESTRICT_TO_MONITOR : constant := 16#00000010#;

   D3DPRESENT_UPDATEOVERLAYONLY : constant := 16#00000020#;

   D3DPRESENT_HIDEOVERLAY : constant := 16#00000040#;

   D3DPRESENT_UPDATECOLORKEY : constant := 16#00000080#;

   D3DPRESENT_FORCEIMMEDIATE : constant := 16#00000100#;

   FACD3D : constant := 16#876#;

   -- #define MAKE_D3DHRESULT( code )  MAKE_HRESULT( 1, _FACD3D, code )
   function MAKE_D3DHRESULT(code:WORD) return HRESULT is(win32.Winerror.MAKE_HRESULT(1,FACD3D,code));


   -- #define MAKE_D3DSTATUS( code )  MAKE_HRESULT( 0, _FACD3D, code )
   function MAKE_D3DSTATUS(code:WORD) return HRESULT is(win32.Winerror.MAKE_HRESULT(0,FACD3D,code));


   D3D_OK : constant := win32.Winerror.S_OK;

   D3DERR_WRONGTEXTUREFORMAT : constant HRESULT:= MAKE_D3DHRESULT(2072);

   D3DERR_UNSUPPORTEDCOLOROPERATION : constant HRESULT:= MAKE_D3DHRESULT(2073);

   D3DERR_UNSUPPORTEDCOLORARG : constant HRESULT:= MAKE_D3DHRESULT(2074);

   D3DERR_UNSUPPORTEDALPHAOPERATION : constant HRESULT:= MAKE_D3DHRESULT(2075);

   D3DERR_UNSUPPORTEDALPHAARG : constant HRESULT:= MAKE_D3DHRESULT(2076);

   D3DERR_TOOMANYOPERATIONS : constant HRESULT := MAKE_D3DHRESULT(2077);

   D3DERR_CONFLICTINGTEXTUREFILTER : constant HRESULT:= MAKE_D3DHRESULT(2078);

   D3DERR_UNSUPPORTEDFACTORVALUE : constant HRESULT := MAKE_D3DHRESULT(2079);

   D3DERR_CONFLICTINGRENDERSTATE : constant HRESULT:= MAKE_D3DHRESULT(2081);

   D3DERR_UNSUPPORTEDTEXTUREFILTER : constant HRESULT:= MAKE_D3DHRESULT(2082);

   D3DERR_CONFLICTINGTEXTUREPALETTE : constant HRESULT:= MAKE_D3DHRESULT(2086);

   D3DERR_DRIVERINTERNALERROR : constant HRESULT:= MAKE_D3DHRESULT(2087);

   D3DERR_NOTFOUND : constant HRESULT:= MAKE_D3DHRESULT(2150);

   D3DERR_MOREDATA : constant HRESULT:= MAKE_D3DHRESULT(2151);

   D3DERR_DEVICELOST : constant HRESULT:= MAKE_D3DHRESULT(2152);

   D3DERR_DEVICENOTRESET : constant HRESULT:= MAKE_D3DHRESULT(2153);

   D3DERR_NOTAVAILABLE : constant HRESULT:= MAKE_D3DHRESULT(2154);

   D3DERR_OUTOFVIDEOMEMORY : constant HRESULT:= MAKE_D3DHRESULT(380);

   D3DERR_INVALIDDEVICE : constant HRESULT:= MAKE_D3DHRESULT(2155);

   D3DERR_INVALIDCALL : constant HRESULT:= MAKE_D3DHRESULT(2156);

   D3DERR_DRIVERINVALIDCALL : constant HRESULT:= MAKE_D3DHRESULT(2157);

   D3DERR_WASSTILLDRAWING : constant HRESULT:= MAKE_D3DHRESULT(540);

   D3DOK_NOAUTOGEN : constant HRESULT:= MAKE_D3DSTATUS(2159);

   D3DERR_DEVICEREMOVED : constant HRESULT:= MAKE_D3DHRESULT(2160);

   S_NOT_RESIDENT : constant HRESULT:= MAKE_D3DSTATUS(2165);

   S_RESIDENT_IN_SHARED_MEMORY : constant HRESULT:= MAKE_D3DSTATUS(2166);

   S_PRESENT_MODE_CHANGED : constant HRESULT:= MAKE_D3DSTATUS(2167);

   S_PRESENT_OCCLUDED : constant HRESULT:= MAKE_D3DSTATUS(2168);

   D3DERR_DEVICEHUNG : constant HRESULT:= MAKE_D3DHRESULT(2164);

   D3DERR_UNSUPPORTEDOVERLAY : constant HRESULT:= MAKE_D3DHRESULT(2171);

   D3DERR_UNSUPPORTEDOVERLAYFORMAT : constant HRESULT:= MAKE_D3DHRESULT(2172);

   D3DERR_CANNOTPROTECTCONTENT : constant HRESULT := MAKE_D3DHRESULT(2173);

   D3DERR_UNSUPPORTEDCRYPTO : constant HRESULT:= MAKE_D3DHRESULT(2174);

   D3DERR_PRESENT_STATISTICS_DISJOINT : constant HRESULT:= MAKE_D3DHRESULT(2180);

   function Direct3DCreate9Ex(SDKVersion:UINT;d3d9exRef:lplpIDirect3D9Ex) return HRESULT with Import,Convention=>stdcall,external_name=>"Direct3DCreate9Ex";


   type IDirect3D9Ex is record
      QueryInterface:access procedure(THIS:LPIDirect3D9Ex;riid:REFIID;ppvObj:LPLPvoid) with Convention=>Stdcall;
      AddRef:access function(THIS:LPIDirect3D9Ex) return ULONG with Convention=>Stdcall;
      Release:access function(THIS:LPIDirect3D9Ex) return ULONG with Convention=>Stdcall;
      GetAdapterCount:access function(THIS:LPIDirect3D9Ex) return UINT with Convention=>Stdcall;
      GetAdapterIdentifier:access procedure(THIS:LPIDirect3D9Ex;Adapter:UINT;Flags:DWORD;pIdentifier:access D3DADAPTER_IDENTIFIER9) with Convention=>Stdcall;
      GetAdapterModeCount:access function(THIS:LPIDirect3D9Ex;Adapter:UINT;Format:D3DFORMAT) return UINT with Convention=>Stdcall;
      EnumAdapterModes:access procedure(THIS:LPIDirect3D9Ex;Adapter:UINT;Format:D3DFORMAT;Mode:UINT;pMode:access D3DDISPLAYMODE) with Convention=>Stdcall;
      GetAdapterDisplayMode:access procedure(THIS:LPIDirect3D9Ex;Adapter:UINT;pMode:access D3DDISPLAYMODE) with Convention=>Stdcall;
      CheckDeviceTyp:access procedure(THIS:LPIDirect3D9Ex;Adapter:UINT;DevTyp:D3DDEVTYPE;AdapterFormat:D3DFORMAT;BackBufferFormat:D3DFORMAT;bWindowed:BOOL) with Convention=>Stdcall;
      CheckDeviceFormat:access procedure(THIS:LPIDirect3D9Ex;Adapter:UINT;DeviceTyp:D3DDEVTYPE;AdapterFormat:D3DFORMAT;Usage:DWORD;RTyp:D3DRESOURCETYPE;CheckFormat:D3DFORMAT) with Convention=>Stdcall;
      CheckDeviceMultiSampleTyp:access procedure(THIS:LPIDirect3D9Ex;Adapter:UINT;DeviceTyp:D3DDEVTYPE;SurfaceFormat:D3DFORMAT;Windowed:BOOL;MultiSampleTyp:D3DMULTISAMPLE_TYPE;pQualityLevels:LPDWORD) with Convention=>Stdcall;
      CheckDepthStencilMatch:access procedure(THIS:LPIDirect3D9Ex;Adapter:UINT;DeviceTyp:D3DDEVTYPE;AdapterFormat:D3DFORMAT;RenderTargetFormat:D3DFORMAT;DepthStencilFormat:D3DFORMAT) with Convention=>Stdcall;
      CheckDeviceFormatConversion:access procedure(THIS:LPIDirect3D9Ex;Adapter:UINT;DeviceTyp:D3DDEVTYPE;SourceFormat:D3DFORMAT;TargetFormat:D3DFORMAT) with Convention=>Stdcall;
      GetDeviceCaps:access procedure(THIS:LPIDirect3D9Ex;Adapter:UINT;DeviceTyp:D3DDEVTYPE;pCaps:access D3DCAPS9) with Convention=>Stdcall;
      GetAdapterMonitor:access function(THIS:LPIDirect3D9Ex;Adapter:UINT) return HMONITOR with Convention=>Stdcall;
      CreateDevice:access procedure(THIS:LPIDirect3D9Ex;Adapter:UINT;DeviceTyp:D3DDEVTYPE;hFocusWindow:win32.windef.HWND;BehaviorFlags:DWORD;pPresentationParameters:access D3DPRESENT_PARAMETERS;ppReturnedDeviceInterface:LPLPIDirect3DDevice9) with Convention=>Stdcall;
      GetAdapterModeCountEx:access function(THIS:LPIDirect3D9Ex;Adapter:UINT;pFilter:access constant D3DDISPLAYMODEFILTER) return UINT with Convention=>Stdcall;
      EnumAdapterModesEx:access procedure(THIS:LPIDirect3D9Ex;Adapter:UINT;pFilter:access constant D3DDISPLAYMODEFILTER;Mode:UINT;pMode:access constant D3DDISPLAYMODEEX) with Convention=>Stdcall;
      GetAdapterDisplayModeEx:access procedure(THIS:LPIDirect3D9Ex;Adapter:UINT;pMode:access D3DDISPLAYMODEEX;pRotation:access D3DDISPLAYROTATION) with Convention=>Stdcall;
      CreateDeviceEx:access procedure(THIS:LPIDirect3D9Ex;Adapter:UINT;DeviceTyp:D3DDEVTYPE;hFocusWindow:HWND;BehaviorFlags:DWORD;pPresentationParameters:access D3DPRESENT_PARAMETERS;pFullscreenDisplayMode:access D3DDISPLAYMODEEX;ppReturnedDeviceInterface:LPLPIDirect3DDevice9Ex) with Convention=>Stdcall;
      GetAdapterLUID:access procedure(THIS:LPIDirect3D9Ex;Adapter:UINT;pLUID:access LUID) with Convention=>Stdcall;
   end record;

   type LPDIRECT3D9EX is access all IDirect3D9Ex;
   type PDIRECT3D9EX is access all IDirect3D9Ex;



   type IDirect3DDevice9Ex is record
      QueryInterface:access procedure(THIS:LPIDirect3DDevice9Ex;riid:REFIID;ppvObj:LPLPvoid) with Convention=>Stdcall;
      AddRef:access function(THIS:LPIDirect3DDevice9Ex) return ULONG with Convention=>Stdcall;
      Release:access function(THIS:LPIDirect3DDevice9Ex) return ULONG with Convention=>Stdcall;
      TestCooperativeLevel:access procedure(THIS:LPIDirect3DDevice9Ex) with Convention=>Stdcall;
      GetAvailableTextureMem:access function(THIS:LPIDirect3DDevice9Ex) return UINT with Convention=>Stdcall;
      EvictManagedResources:access procedure(THIS:LPIDirect3DDevice9Ex) with Convention=>Stdcall;
      GetDirect3D:access procedure(THIS:LPIDirect3DDevice9Ex;ppD3D9:LPLPIDirect3D9) with Convention=>Stdcall;
      GetDeviceCaps:access procedure(THIS:LPIDirect3DDevice9Ex;pCaps:access D3DCAPS9) with Convention=>Stdcall;
      GetDisplayMode:access procedure(THIS:LPIDirect3DDevice9Ex;iSwapChain:UINT;pMode:access D3DDISPLAYMODE) with Convention=>Stdcall;
      GetCreationParameters:access procedure(THIS:LPIDirect3DDevice9Ex;pParameters:access D3DDEVICE_CREATION_PARAMETERS) with Convention=>Stdcall;
      SetCursorProperties:access procedure(THIS:LPIDirect3DDevice9Ex;XHotSpot:UINT;YHotSpot:UINT;pCursorBitmap:LPIDirect3DSurface9) with Convention=>Stdcall;
      SetCursorPosition:access function(THIS:LPIDirect3DDevice9Ex;X:int;Y:int;Flags:DWORD) return void with Convention=>Stdcall;
      ShowCursor:access function(THIS:LPIDirect3DDevice9Ex;bShow:BOOL) return BOOL with Convention=>Stdcall;
      CreateAdditionalSwapChain:access procedure(THIS:LPIDirect3DDevice9Ex;pPresentationParameters:access D3DPRESENT_PARAMETERS;pSwapChain:LPLPIDirect3DSwapChain9) with Convention=>Stdcall;
      GetSwapChain:access procedure(THIS:LPIDirect3DDevice9Ex;iSwapChain:UINT;pSwapChain:LPLPIDirect3DSwapChain9) with Convention=>Stdcall;
      GetNumberOfSwapChains:access function(THIS:LPIDirect3DDevice9Ex) return UINT with Convention=>Stdcall;
      Reset:access procedure(THIS:LPIDirect3DDevice9Ex;pPresentationParameters:access D3DPRESENT_PARAMETERS) with Convention=>Stdcall;
      Present:access procedure(THIS:LPIDirect3DDevice9Ex;pSourceRect:LPCRECT;pDestRect:LPCRECT;hDestWindowOverride:HWND;pDirtyRegion:access constant RGNDATA) with Convention=>Stdcall;
      GetBackBuffer:access procedure(THIS:LPIDirect3DDevice9Ex;iSwapChain:UINT;iBackBuffer:UINT;Typ:D3DBACKBUFFER_TYPE;ppBackBuffer:LPLPIDirect3DSurface9) with Convention=>Stdcall;
      GetRasterStatus:access procedure(THIS:LPIDirect3DDevice9Ex;iSwapChain:UINT;pRasterStatus:access D3DRASTER_STATUS) with Convention=>Stdcall;
      SetDialogBoxMode:access procedure(THIS:LPIDirect3DDevice9Ex;bEnableDialogs:BOOL) with Convention=>Stdcall;
      SetGammaRamp:access function(THIS:LPIDirect3DDevice9Ex;iSwapChain:UINT;Flags:DWORD;pRamp:access constant D3DGAMMARAMP) return void with Convention=>Stdcall;
      GetGammaRamp:access function(THIS:LPIDirect3DDevice9Ex;iSwapChain:UINT;pRamp:access D3DGAMMARAMP) return void with Convention=>Stdcall;
      CreateTexture:access procedure(THIS:LPIDirect3DDevice9Ex;Width:UINT;Height:UINT;Levels:UINT;Usage:DWORD;Format:D3DFORMAT;Pool:D3DPOOL;ppTexture:LPLPIDirect3DTexture9;pSharedHandle:LPHANDLE) with Convention=>Stdcall;
      CreateVolumeTexture:access procedure(THIS:LPIDirect3DDevice9Ex;Width:UINT;Height:UINT;Depth:UINT;Levels:UINT;Usage:DWORD;Format:D3DFORMAT;Pool:D3DPOOL;ppVolumeTexture:LPLPIDirect3DVolumeTexture9;pSharedHandle:LPHANDLE) with Convention=>Stdcall;
      CreateCubeTexture:access procedure(THIS:LPIDirect3DDevice9Ex;EdgeLength:UINT;Levels:UINT;Usage:DWORD;Format:D3DFORMAT;Pool:D3DPOOL;ppCubeTexture:LPLPIDirect3DCubeTexture9;pSharedHandle:LPHANDLE) with Convention=>Stdcall;
      CreateVertexBuffer:access procedure(THIS:LPIDirect3DDevice9Ex;Length:UINT;Usage:DWORD;FVF:DWORD;Pool:D3DPOOL;ppVertexBuffer:LPLPIDirect3DVertexBuffer9;pSharedHandle:LPHANDLE) with Convention=>Stdcall;
      CreateIndexBuffer:access procedure(THIS:LPIDirect3DDevice9Ex;Length:UINT;Usage:DWORD;Format:D3DFORMAT;Pool:D3DPOOL;ppIndexBuffer:LPLPIDirect3DIndexBuffer9;pSharedHandle:LPHANDLE) with Convention=>Stdcall;
      CreateRenderTarget:access procedure(THIS:LPIDirect3DDevice9Ex;Width:UINT;Height:UINT;Format:D3DFORMAT;MultiSample:D3DMULTISAMPLE_TYPE;MultisampleQuality:DWORD;Lockable:BOOL;ppSurface:LPLPIDirect3DSurface9;pSharedHandle:LPHANDLE) with Convention=>Stdcall;
      CreateDepthStencilSurface:access procedure(THIS:LPIDirect3DDevice9Ex;Width:UINT;Height:UINT;Format:D3DFORMAT;MultiSample:D3DMULTISAMPLE_TYPE;MultisampleQuality:DWORD;Discard:BOOL;ppSurface:LPLPIDirect3DSurface9;pSharedHandle:LPHANDLE) with Convention=>Stdcall;
      UpdateSurface:access procedure(THIS:LPIDirect3DDevice9Ex;pSourceSurface:LPIDirect3DSurface9;pSourceRect:LPCRECT;pDestinationSurface:LPIDirect3DSurface9;pDestPoint:access constant POINT) with Convention=>Stdcall;
      UpdateTexture:access procedure(THIS:LPIDirect3DDevice9Ex;pSourceTexture:LPIDirect3DBaseTexture9;pDestinationTexture:LPIDirect3DBaseTexture9) with Convention=>Stdcall;
      GetRenderTargetData:access procedure(THIS:LPIDirect3DDevice9Ex;pRenderTarget:LPIDirect3DSurface9;pDestSurface:LPIDirect3DSurface9) with Convention=>Stdcall;
      GetFrontBufferData:access procedure(THIS:LPIDirect3DDevice9Ex;iSwapChain:UINT;pDestSurface:LPIDirect3DSurface9) with Convention=>Stdcall;
      StretchRect:access procedure(THIS:LPIDirect3DDevice9Ex;pSourceSurface:LPIDirect3DSurface9;pSourceRect:LPCRECT;pDestSurface:LPIDirect3DSurface9;pDestRect:LPCRECT;Filter:D3DTEXTUREFILTERTYPE) with Convention=>Stdcall;
      ColorFill:access procedure(THIS:LPIDirect3DDevice9Ex;pSurface:LPIDirect3DSurface9;pRect:LPCRECT;color:D3DCOLOR) with Convention=>Stdcall;
      CreateOffscreenPlainSurface:access procedure(THIS:LPIDirect3DDevice9Ex;Width:UINT;Height:UINT;Format:D3DFORMAT;Pool:D3DPOOL;ppSurface:LPLPIDirect3DSurface9;pSharedHandle:LPHANDLE) with Convention=>Stdcall;
      SetRenderTarget:access procedure(THIS:LPIDirect3DDevice9Ex;RenderTargetIndex:DWORD;pRenderTarget:LPIDirect3DSurface9) with Convention=>Stdcall;
      GetRenderTarget:access procedure(THIS:LPIDirect3DDevice9Ex;RenderTargetIndex:DWORD;ppRenderTarget:LPLPIDirect3DSurface9) with Convention=>Stdcall;
      SetDepthStencilSurface:access procedure(THIS:LPIDirect3DDevice9Ex;pNewZStencil:LPIDirect3DSurface9) with Convention=>Stdcall;
      GetDepthStencilSurface:access procedure(THIS:LPIDirect3DDevice9Ex;ppZStencilSurface:LPLPIDirect3DSurface9) with Convention=>Stdcall;
      BeginScene:access procedure(THIS:LPIDirect3DDevice9Ex) with Convention=>Stdcall;
      EndScene:access procedure(THIS:LPIDirect3DDevice9Ex) with Convention=>Stdcall;
      Clear:access procedure(THIS:LPIDirect3DDevice9Ex;Count:DWORD;pRects:access constant D3DRECT;Flags:DWORD;Color:D3DCOLOR;Z:float;Stencil:DWORD) with Convention=>Stdcall;
      SetTransform:access procedure(THIS:LPIDirect3DDevice9Ex;State:D3DTRANSFORMSTATETYPE;pMatrix:access constant D3DMATRIX) with Convention=>Stdcall;
      GetTransform:access procedure(THIS:LPIDirect3DDevice9Ex;State:D3DTRANSFORMSTATETYPE;pMatrix:access D3DMATRIX) with Convention=>Stdcall;
      MultiplyTransform:access procedure(THIS:LPIDirect3DDevice9Ex;State:D3DTRANSFORMSTATETYPE;M:access constant D3DMATRIX) with Convention=>Stdcall;
      SetViewport:access procedure(THIS:LPIDirect3DDevice9Ex;pViewport:access constant D3DVIEWPORT9) with Convention=>Stdcall;
      GetViewport:access procedure(THIS:LPIDirect3DDevice9Ex;pViewport:access D3DVIEWPORT9) with Convention=>Stdcall;
      SetMaterial:access procedure(THIS:LPIDirect3DDevice9Ex;pMaterial:access constant D3DMATERIAL9) with Convention=>Stdcall;
      GetMaterial:access procedure(THIS:LPIDirect3DDevice9Ex;pMaterial:access D3DMATERIAL9) with Convention=>Stdcall;
      SetLight:access procedure(THIS:LPIDirect3DDevice9Ex;Index:DWORD;L9:access constant D3DLIGHT9) with Convention=>Stdcall;
      GetLight:access procedure(THIS:LPIDirect3DDevice9Ex;Index:DWORD;L9:access D3DLIGHT9) with Convention=>Stdcall;
      LightEnable:access procedure(THIS:LPIDirect3DDevice9Ex;Index:DWORD;Enable:BOOL) with Convention=>Stdcall;
      GetLightEnable:access procedure(THIS:LPIDirect3DDevice9Ex;Index:DWORD;pEnable:LPBOOL) with Convention=>Stdcall;
      SetClipPlane:access procedure(THIS:LPIDirect3DDevice9Ex;Index:DWORD;pPlane:LPCfloat) with Convention=>Stdcall;
      GetClipPlane:access procedure(THIS:LPIDirect3DDevice9Ex;Index:DWORD;pPlane:LPfloat) with Convention=>Stdcall;
      SetRenderState:access procedure(THIS:LPIDirect3DDevice9Ex;State:D3DRENDERSTATETYPE;Value:DWORD) with Convention=>Stdcall;
      GetRenderState:access procedure(THIS:LPIDirect3DDevice9Ex;State:D3DRENDERSTATETYPE;pValue:LPDWORD) with Convention=>Stdcall;
      CreateStateBlock:access procedure(THIS:LPIDirect3DDevice9Ex;Typ:D3DSTATEBLOCKTYPE;ppSB:LPLPIDirect3DStateBlock9) with Convention=>Stdcall;
      BeginStateBlock:access procedure(THIS:LPIDirect3DDevice9Ex) with Convention=>Stdcall;
      EndStateBlock:access procedure(THIS:LPIDirect3DDevice9Ex;ppSB:LPLPIDirect3DStateBlock9) with Convention=>Stdcall;
      SetClipStatus:access procedure(THIS:LPIDirect3DDevice9Ex;pClipStatus:access constant D3DCLIPSTATUS9) with Convention=>Stdcall;
      GetClipStatus:access procedure(THIS:LPIDirect3DDevice9Ex;pClipStatus:access D3DCLIPSTATUS9) with Convention=>Stdcall;
      GetTexture:access procedure(THIS:LPIDirect3DDevice9Ex;Stage:DWORD;ppTexture:LPLPIDirect3DBaseTexture9) with Convention=>Stdcall;
      SetTexture:access procedure(THIS:LPIDirect3DDevice9Ex;Stage:DWORD;pTexture:LPIDirect3DBaseTexture9) with Convention=>Stdcall;
      GetTextureStageState:access procedure(THIS:LPIDirect3DDevice9Ex;Stage:DWORD;Typ:D3DTEXTURESTAGESTATETYPE;pValue:LPDWORD) with Convention=>Stdcall;
      SetTextureStageState:access procedure(THIS:LPIDirect3DDevice9Ex;Stage:DWORD;Typ:D3DTEXTURESTAGESTATETYPE;Value:DWORD) with Convention=>Stdcall;
      GetSamplerState:access procedure(THIS:LPIDirect3DDevice9Ex;Sampler:DWORD;Typ:D3DSAMPLERSTATETYPE;pValue:LPDWORD) with Convention=>Stdcall;
      SetSamplerState:access procedure(THIS:LPIDirect3DDevice9Ex;Sampler:DWORD;Typ:D3DSAMPLERSTATETYPE;Value:DWORD) with Convention=>Stdcall;
      ValidateDevice:access procedure(THIS:LPIDirect3DDevice9Ex;pNumPasses:LPDWORD) with Convention=>Stdcall;
      SetPaletteEntries:access procedure(THIS:LPIDirect3DDevice9Ex;PaletteNumber:UINT;pEntries:access constant PALETTEENTRY) with Convention=>Stdcall;
      GetPaletteEntries:access procedure(THIS:LPIDirect3DDevice9Ex;PaletteNumber:UINT;pEntries:LPPALETTEENTRY) with Convention=>Stdcall;
      SetCurrentTexturePalette:access procedure(THIS:LPIDirect3DDevice9Ex;PaletteNumber:UINT) with Convention=>Stdcall;
      GetCurrentTexturePalette:access procedure(THIS:LPIDirect3DDevice9Ex;PaletteNumber:LPUINT) with Convention=>Stdcall;
      SetScissorRect:access procedure(THIS:LPIDirect3DDevice9Ex;pRect:LPCRECT) with Convention=>Stdcall;
      GetScissorRect:access procedure(THIS:LPIDirect3DDevice9Ex;pRect:LPRECT) with Convention=>Stdcall;
      SetSoftwareVertexProcessing:access procedure(THIS:LPIDirect3DDevice9Ex;bSoftware:BOOL) with Convention=>Stdcall;
      GetSoftwareVertexProcessing:access function(THIS:LPIDirect3DDevice9Ex) return BOOL with Convention=>Stdcall;
      SetNPatchMode:access procedure(THIS:LPIDirect3DDevice9Ex;nSegments:float) with Convention=>Stdcall;
      GetNPatchMode:access function(THIS:LPIDirect3DDevice9Ex) return float with Convention=>Stdcall;
      DrawPrimitive:access procedure(THIS:LPIDirect3DDevice9Ex;PrimitiveTyp:D3DPRIMITIVETYPE;StartVertex:UINT;PrimitiveCount:UINT) with Convention=>Stdcall;
      DrawIndexedPrimitive:access procedure(THIS:LPIDirect3DDevice9Ex;BaseVertexIndex:INT;MinVertexIndex:UINT;NumVertices:UINT;startIndex:UINT;primCount:UINT) with Convention=>Stdcall;
      DrawPrimitiveUP:access procedure(THIS:LPIDirect3DDevice9Ex;PrimitiveTyp:D3DPRIMITIVETYPE;PrimitiveCount:UINT;pVertexStreamZeroData:LPCvoid;VertexStreamZeroStride:UINT) with Convention=>Stdcall;
      DrawIndexedPrimitiveUP:access procedure(THIS:LPIDirect3DDevice9Ex;PrimitiveTyp:D3DPRIMITIVETYPE;MinVertexIndex:UINT;NumVertices:UINT;PrimitiveCount:UINT;pIndexData:LPCvoid;IndexDataFormat:D3DFORMAT;pVertexStreamZeroData:LPCvoid;VertexStreamZeroStride:UINT) with Convention=>Stdcall;
      ProcessVertices:access procedure(THIS:LPIDirect3DDevice9Ex;SrcStartIndex:UINT;DestIndex:UINT;VertexCount:UINT;pDestBuffer:LPIDirect3DVertexBuffer9;pVertexDecl:LPIDirect3DVertexDeclaration9;Flags:DWORD) with Convention=>Stdcall;
      CreateVertexDeclaration:access procedure(THIS:LPIDirect3DDevice9Ex;pVertexElements:access constant D3DVERTEXELEMENT9;ppDecl:LPLPIDirect3DVertexDeclaration9) with Convention=>Stdcall;
      SetVertexDeclaration:access procedure(THIS:LPIDirect3DDevice9Ex;pDecl:LPIDirect3DVertexDeclaration9) with Convention=>Stdcall;
      GetVertexDeclaration:access procedure(THIS:LPIDirect3DDevice9Ex;ppDecl:LPLPIDirect3DVertexDeclaration9) with Convention=>Stdcall;
      SetFVF:access procedure(THIS:LPIDirect3DDevice9Ex;FVF:DWORD) with Convention=>Stdcall;
      GetFVF:access procedure(THIS:LPIDirect3DDevice9Ex;pFVF:LPDWORD) with Convention=>Stdcall;
      CreateVertexShader:access procedure(THIS:LPIDirect3DDevice9Ex;pFunction:access constant DWORD;ppShader:LPLPIDirect3DVertexShader9) with Convention=>Stdcall;
      SetVertexShader:access procedure(THIS:LPIDirect3DDevice9Ex;pShader:LPIDirect3DVertexShader9) with Convention=>Stdcall;
      GetVertexShader:access procedure(THIS:LPIDirect3DDevice9Ex;ppShader:LPLPIDirect3DVertexShader9) with Convention=>Stdcall;
      SetVertexShaderConstantF:access procedure(THIS:LPIDirect3DDevice9Ex;StartRegister:UINT;pConstantData:LPCfloat;Vector4fCount:UINT) with Convention=>Stdcall;
      GetVertexShaderConstantF:access procedure(THIS:LPIDirect3DDevice9Ex;StartRegister:UINT;pConstantData:LPfloat;Vector4fCount:UINT) with Convention=>Stdcall;
      SetVertexShaderConstantI:access procedure(THIS:LPIDirect3DDevice9Ex;StartRegister:UINT;pConstantData:LPCint;Vector4iCount:UINT) with Convention=>Stdcall;
      GetVertexShaderConstantI:access procedure(THIS:LPIDirect3DDevice9Ex;StartRegister:UINT;pConstantData:LPint;Vector4iCount:UINT) with Convention=>Stdcall;
      SetVertexShaderConstantB:access procedure(THIS:LPIDirect3DDevice9Ex;StartRegister:UINT;pConstantData:LPCBOOL;BoolCount:UINT) with Convention=>Stdcall;
      GetVertexShaderConstantB:access procedure(THIS:LPIDirect3DDevice9Ex;StartRegister:UINT;pConstantData:LPBOOL;BoolCount:UINT) with Convention=>Stdcall;
      SetStreamSource:access procedure(THIS:LPIDirect3DDevice9Ex;StreamNumber:UINT;pStreamData:LPIDirect3DVertexBuffer9;OffsetInBytes:UINT;Stride:UINT) with Convention=>Stdcall;
      GetStreamSource:access procedure(THIS:LPIDirect3DDevice9Ex;StreamNumber:UINT;ppStreamData:LPLPIDirect3DVertexBuffer9;pOffsetInBytes:LPUINT;pStride:LPUINT) with Convention=>Stdcall;
      SetStreamSourceFreq:access procedure(THIS:LPIDirect3DDevice9Ex;StreamNumber:UINT;Setting:UINT) with Convention=>Stdcall;
      GetStreamSourceFreq:access procedure(THIS:LPIDirect3DDevice9Ex;StreamNumber:UINT;pSetting:LPUINT) with Convention=>Stdcall;
      SetIndices:access procedure(THIS:LPIDirect3DDevice9Ex;pIndexData:LPIDirect3DIndexBuffer9) with Convention=>Stdcall;
      GetIndices:access procedure(THIS:LPIDirect3DDevice9Ex;ppIndexData:LPLPIDirect3DIndexBuffer9) with Convention=>Stdcall;
      CreatePixelShader:access procedure(THIS:LPIDirect3DDevice9Ex;pFunction:access constant DWORD;ppShader:LPLPIDirect3DPixelShader9) with Convention=>Stdcall;
      SetPixelShader:access procedure(THIS:LPIDirect3DDevice9Ex;pShader:LPIDirect3DPixelShader9) with Convention=>Stdcall;
      GetPixelShader:access procedure(THIS:LPIDirect3DDevice9Ex;ppShader:LPLPIDirect3DPixelShader9) with Convention=>Stdcall;
      SetPixelShaderConstantF:access procedure(THIS:LPIDirect3DDevice9Ex;StartRegister:UINT;pConstantData:LPCfloat;Vector4fCount:UINT) with Convention=>Stdcall;
      GetPixelShaderConstantF:access procedure(THIS:LPIDirect3DDevice9Ex;StartRegister:UINT;pConstantData:LPfloat;Vector4fCount:UINT) with Convention=>Stdcall;
      SetPixelShaderConstantI:access procedure(THIS:LPIDirect3DDevice9Ex;StartRegister:UINT;pConstantData:LPCint;Vector4iCount:UINT) with Convention=>Stdcall;
      GetPixelShaderConstantI:access procedure(THIS:LPIDirect3DDevice9Ex;StartRegister:UINT;pConstantData:LPint;Vector4iCount:UINT) with Convention=>Stdcall;
      SetPixelShaderConstantB:access procedure(THIS:LPIDirect3DDevice9Ex;StartRegister:UINT;pConstantData:LPCBOOL;BoolCount:UINT) with Convention=>Stdcall;
      GetPixelShaderConstantB:access procedure(THIS:LPIDirect3DDevice9Ex;StartRegister:UINT;pConstantData:LPBOOL;BoolCount:UINT) with Convention=>Stdcall;
      DrawRectPatch:access procedure(THIS:LPIDirect3DDevice9Ex;Handle:UINT;pNumSegs:LPCfloat;pRectPatchInfo:access constant D3DRECTPATCH_INFO) with Convention=>Stdcall;
      DrawTriPatch:access procedure(THIS:LPIDirect3DDevice9Ex;Handle:UINT;pNumSegs:LPCfloat;pTriPatchInfo:access constant D3DTRIPATCH_INFO) with Convention=>Stdcall;
      DeletePatch:access procedure(THIS:LPIDirect3DDevice9Ex;Handle:UINT) with Convention=>Stdcall;
      CreateQuery:access procedure(THIS:LPIDirect3DDevice9Ex;Typ:D3DQUERYTYPE;ppQuery:LPLPIDirect3DQuery9) with Convention=>Stdcall;
      SetConvolutionMonoKernel:access procedure(THIS:LPIDirect3DDevice9Ex;width:UINT;height:UINT;rows:LPfloat;columns:LPfloat) with Convention=>Stdcall;
      ComposeRects:access procedure(THIS:LPIDirect3DDevice9Ex;pSrc:LPIDirect3DSurface9;pDst:LPIDirect3DSurface9;pSrcRectDescs:LPIDirect3DVertexBuffer9;NumRects:UINT;pDstRectDescs:LPIDirect3DVertexBuffer9;Operation:D3DCOMPOSERECTSOP;Xoffset:int;Yoffset:int) with Convention=>Stdcall;
      PresentEx:access procedure(THIS:LPIDirect3DDevice9Ex;pSourceRect:LPCRECT;pDestRect:LPCRECT;hDestWindowOverride:HWND;pDirtyRegion:access constant RGNDATA;dwFlags:DWORD) with Convention=>Stdcall;
      GetGPUThreadPriority:access procedure(THIS:LPIDirect3DDevice9Ex;pPriority:LPINT) with Convention=>Stdcall;
      SetGPUThreadPriority:access procedure(THIS:LPIDirect3DDevice9Ex;Priority:INT) with Convention=>Stdcall;
      WaitForVBlank:access procedure(THIS:LPIDirect3DDevice9Ex;iSwapChain:UINT) with Convention=>Stdcall;
      CheckResourceResidency:access procedure(THIS:LPIDirect3DDevice9Ex;pResourceArray:LPLPIDirect3DResource9;NumResources:UINT) with Convention=>Stdcall;
      SetMaximumFrameLatency:access procedure(THIS:LPIDirect3DDevice9Ex;MaxLatency:UINT) with Convention=>Stdcall;
      GetMaximumFrameLatency:access procedure(THIS:LPIDirect3DDevice9Ex;pMaxLatency:LPUINT) with Convention=>Stdcall;
      CheckDeviceState:access procedure(THIS:LPIDirect3DDevice9Ex;hDestinationWindow:HWND) with Convention=>Stdcall;
      CreateRenderTargetEx:access procedure(THIS:LPIDirect3DDevice9Ex;Width:UINT;Height:UINT;Format:D3DFORMAT;MultiSample:D3DMULTISAMPLE_TYPE;MultisampleQuality:DWORD;Lockable:BOOL;ppSurface:LPLPIDirect3DSurface9;pSharedHandle:LPHANDLE;Usage:DWORD) with Convention=>Stdcall;
      CreateOffscreenPlainSurfaceEx:access procedure(THIS:LPIDirect3DDevice9Ex;Width:UINT;Height:UINT;Format:D3DFORMAT;Pool:D3DPOOL;ppSurface:LPLPIDirect3DSurface9;pSharedHandle:LPHANDLE;Usage:DWORD) with Convention=>Stdcall;
      CreateDepthStencilSurfaceEx:access procedure(THIS:LPIDirect3DDevice9Ex;Width:UINT;Height:UINT;Format:D3DFORMAT;MultiSample:D3DMULTISAMPLE_TYPE;MultisampleQuality:DWORD;Discard:BOOL;ppSurface:LPLPIDirect3DSurface9;pSharedHandle:LPHANDLE;Usage:DWORD) with Convention=>Stdcall;
      ResetEx:access procedure(THIS:LPIDirect3DDevice9Ex;pPresentationParameters:access D3DPRESENT_PARAMETERS;pFullscreenDisplayMode:access D3DDISPLAYMODEEX) with Convention=>Stdcall;
      GetDisplayModeEx:access procedure(THIS:LPIDirect3DDevice9Ex;iSwapChain:UINT;pMode:access D3DDISPLAYMODEEX;pRotation:access D3DDISPLAYROTATION) with Convention=>Stdcall;
   end record;

   type LPDIRECT3DDEVICE9EX is access all IDirect3DDevice9Ex;
   type PDIRECT3DDEVICE9EX is access all IDirect3DDevice9Ex;


   type IDirect3DSwapChain9Ex is record
      QueryInterface:access procedure(THIS:LPIDirect3DSwapChain9Ex;riid:REFIID;ppvObj:LPLPvoid) with Convention=>Stdcall;
      AddRef:access function(THIS:LPIDirect3DSwapChain9Ex) return ULONG with Convention=>Stdcall;
      Release:access function(THIS:LPIDirect3DSwapChain9Ex) return ULONG with Convention=>Stdcall;
      Present:access procedure(THIS:LPIDirect3DSwapChain9Ex;pSourceRect:LPCRECT;pDestRect:LPCRECT;hDestWindowOverride:HWND;pDirtyRegion:access constant RGNDATA;dwFlags:DWORD) with Convention=>Stdcall;
      GetFrontBufferData:access procedure(THIS:LPIDirect3DSwapChain9Ex;pDestSurface:LPIDirect3DSurface9) with Convention=>Stdcall;
      GetBackBuffer:access procedure(THIS:LPIDirect3DSwapChain9Ex;iBackBuffer:UINT;Typ:D3DBACKBUFFER_TYPE;ppBackBuffer:LPLPIDirect3DSurface9) with Convention=>Stdcall;
      GetRasterStatus:access procedure(THIS:LPIDirect3DSwapChain9Ex;pRasterStatus:access D3DRASTER_STATUS) with Convention=>Stdcall;
      GetDisplayMode:access procedure(THIS:LPIDirect3DSwapChain9Ex;pMode:access D3DDISPLAYMODE) with Convention=>Stdcall;
      GetDevice:access procedure(THIS:LPIDirect3DSwapChain9Ex;ppDevice:LPLPIDirect3DDevice9) with Convention=>Stdcall;
      GetPresentParameters:access procedure(THIS:LPIDirect3DSwapChain9Ex;pPresentationParameters:access D3DPRESENT_PARAMETERS) with Convention=>Stdcall;
      GetLastPresentCount:access procedure(THIS:LPIDirect3DSwapChain9Ex;pLastPresentCount:LPUINT) with Convention=>Stdcall;
      GetPresentStats:access procedure(THIS:LPIDirect3DSwapChain9Ex;pPresentationStatistics:access D3DPRESENTSTATS) with Convention=>Stdcall;
      GetDisplayModeEx:access procedure(THIS:LPIDirect3DSwapChain9Ex;pMode:access D3DDISPLAYMODEEX;pRotation:access D3DDISPLAYROTATION) with Convention=>Stdcall;
   end record;

   type LPDIRECT3DSWAPCHAIN9EX is access all IDirect3DSwapChain9Ex;
   type PDIRECT3DSWAPCHAIN9EX is access all IDirect3DSwapChain9Ex;

   type IDirect3D9ExOverlayExtension is record
      QueryInterface:access procedure(THIS:LPIDirect3D9ExOverlayExtension;riid:REFIID;ppvObj:LPLPvoid) with Convention=>Stdcall;
      AddRef:access function(THIS:LPIDirect3D9ExOverlayExtension) return ULONG with Convention=>Stdcall;
      Release:access function(THIS:LPIDirect3D9ExOverlayExtension) return ULONG with Convention=>Stdcall;
      CheckDeviceOverlayTyp:access procedure(THIS:LPIDirect3D9ExOverlayExtension;Adapter:UINT;DevTyp:D3DDEVTYPE;OverlayWidth:UINT;OverlayHeight:UINT;OverlayFormat:D3DFORMAT;pDisplayMode:access D3DDISPLAYMODEEX;DisplayRotation:D3DDISPLAYROTATION;pOverlayCaps:access D3DOVERLAYCAPS) with Convention=>Stdcall;
   end record;

   type LPDIRECT3D9EXOVERLAYEXTENSION is access all IDirect3D9ExOverlayExtension;
   type PDIRECT3D9EXOVERLAYEXTENSION is access all IDirect3D9ExOverlayExtension;


   type IDirect3DDevice9Video is record
      QueryInterface:access procedure(THIS:LPIDirect3DDevice9Video;riid:REFIID;ppvObj:LPLPvoid) with Convention=>Stdcall;
      AddRef:access function(THIS:LPIDirect3DDevice9Video) return ULONG with Convention=>Stdcall;
      Release:access function(THIS:LPIDirect3DDevice9Video) return ULONG with Convention=>Stdcall;
      GetContentProtectionCaps:access procedure(THIS:LPIDirect3DDevice9Video;pCryptoTyp:access constant GUID;pDecodeProfile:access constant GUID;pCaps:access D3DCONTENTPROTECTIONCAPS) with Convention=>Stdcall;
      CreateAuthenticatedChannel:access procedure(THIS:LPIDirect3DDevice9Video;ChannelTyp:D3DAUTHENTICATEDCHANNELTYPE;ppAuthenticatedChannel:LPLPIDirect3DAuthenticatedChannel9;pChannelHandle:LPHANDLE) with Convention=>Stdcall;
      CreateCryptoSession:access procedure(THIS:LPIDirect3DDevice9Video;pCryptoTyp:access constant GUID;pDecodeProfile:access constant GUID;ppCryptoSession:LPLPIDirect3DCryptoSession9;pCryptoHandle:LPHANDLE) with Convention=>Stdcall;
   end record;

   type LPDIRECT3DDEVICE9VIDEO is access all IDirect3DDevice9Video;
   type PDIRECT3DDEVICE9VIDEO is access all IDirect3DDevice9Video;


   type IDirect3DAuthenticatedChannel9 is record
      QueryInterface:access procedure(THIS:LPIDirect3DAuthenticatedChannel9;riid:REFIID;ppvObj:LPLPvoid) with Convention=>Stdcall;
      AddRef:access function(THIS:LPIDirect3DAuthenticatedChannel9) return ULONG with Convention=>Stdcall;
      Release:access function(THIS:LPIDirect3DAuthenticatedChannel9) return ULONG with Convention=>Stdcall;
      GetCertificateSize:access procedure(THIS:LPIDirect3DAuthenticatedChannel9;pCertificateSize:LPUINT) with Convention=>Stdcall;
      GetCertificate:access procedure(THIS:LPIDirect3DAuthenticatedChannel9;CertifacteSize:UINT;ppCertificate:LPBYTE) with Convention=>Stdcall;
      NegotiateKeyExchange:access procedure(THIS:LPIDirect3DAuthenticatedChannel9;DataSize:UINT;pData:LPVOID) with Convention=>Stdcall;
      Query:access procedure(THIS:LPIDirect3DAuthenticatedChannel9;InputSize:UINT;pInput:LPCVOID;OutputSize:UINT;pOutput:LPVOID) with Convention=>Stdcall;
      Configure:access procedure(THIS:LPIDirect3DAuthenticatedChannel9;InputSize:UINT;pInput:LPCVOID;pOutput:access D3DAUTHENTICATEDCHANNEL_CONFIGURE_OUTPUT) with Convention=>Stdcall;
   end record;

   type LPDIRECT3DAUTHENTICATEDCHANNEL9 is access all IDirect3DAuthenticatedChannel9;
   type PDIRECT3DAUTHENTICATEDCHANNEL9 is access all IDirect3DAuthenticatedChannel9;


   type IDirect3DCryptoSession9 is record
      QueryInterface:access procedure(THIS:LPIDirect3DCryptoSession9;riid:REFIID;ppvObj:LPLPvoid) with Convention=>Stdcall;
      AddRef:access function(THIS:LPIDirect3DCryptoSession9) return ULONG with Convention=>Stdcall;
      Release:access function(THIS:LPIDirect3DCryptoSession9) return ULONG with Convention=>Stdcall;
      GetCertificateSize:access procedure(THIS:LPIDirect3DCryptoSession9;pCertificateSize:LPUINT) with Convention=>Stdcall;
      GetCertificate:access procedure(THIS:LPIDirect3DCryptoSession9;CertifacteSize:UINT;ppCertificate:LPBYTE) with Convention=>Stdcall;
      NegotiateKeyExchange:access procedure(THIS:LPIDirect3DCryptoSession9;DataSize:UINT;pData:LPVOID) with Convention=>Stdcall;
      EncryptionBlt:access procedure(THIS:LPIDirect3DCryptoSession9;pSrcSurface:LPIDirect3DSurface9;pDstSurface:LPIDirect3DSurface9;DstSurfaceSize:UINT;pIV:LPVOID) with Convention=>Stdcall;
      DecryptionBlt:access procedure(THIS:LPIDirect3DCryptoSession9;pSrcSurface:LPIDirect3DSurface9;pDstSurface:LPIDirect3DSurface9;SrcSurfaceSize:UINT;pEncryptedBlockInfo:access D3DENCRYPTED_BLOCK_INFO;pContentKey:LPVOID;pIV:LPVOID) with Convention=>Stdcall;
      GetSurfacePitch:access procedure(THIS:LPIDirect3DCryptoSession9;pSrcSurface:LPIDirect3DSurface9;pSurfacePitch:LPUINT) with Convention=>Stdcall;
      StartSessionKeyRefresh:access procedure(THIS:LPIDirect3DCryptoSession9;pRandomNumber:LPVOID;RandomNumberSize:UINT) with Convention=>Stdcall;
      FinishSessionKeyRefresh:access procedure(THIS:LPIDirect3DCryptoSession9) with Convention=>Stdcall;
      GetEncryptionBltKey:access procedure(THIS:LPIDirect3DCryptoSession9;pReadbackKey:LPVOID;KeySize:UINT) with Convention=>Stdcall;
   end record;

   type LPDIRECT3DCRYPTOSESSION9 is access all IDirect3DCryptoSession9;
   type PDIRECT3DCRYPTOSESSION9 is access all IDirect3DCryptoSession9;



end d3d9;

猜你喜欢

转载自blog.csdn.net/adacore/article/details/83031796