struc IDirect3D9 {
	.QueryInterface 		rd 01h	; +00h
	.AddRef 			rd 01h	; +04h
	.Release			rd 01h	; +08h

	.RegisterSoftwareDevice 	rd 01h	; +0Ch
	.GetAdapterCount		rd 01h	; +10h
	.GetAdapterIdentifier		rd 01h	; +14h
	.GetAdapterModeCount		rd 01h	; +18h
	.EnumAdapterModes		rd 01h	; +1Ch
	.GetAdapterDisplayMode		rd 01h	; +20h
	.CheckDeviceType		rd 01h	; +24h
	.CheckDeviceFormat		rd 01h	; +28h
	.CheckDeviceMultiSampleType	rd 01h	; +2Ch
	.CheckDepthStencilMatch 	rd 01h	; +30h
	.CheckDeviceFormatConversion	rd 01h	; +34h
	.GetDeviceCaps			rd 01h	; +38h
	.GetAdapterMonitor		rd 01h	; +3Ch
	.CreateDevice			rd 01h	; +40h
}
struct IDirect3D9

struc IDirect3DDevice9 {
	.QueryInterface 		rd 01h	; +0000h
	.AddRef 			rd 01h	; +0004h
	.Release			rd 01h	; +0008h

	.TestCooperativeLevel		rd 01h	; +000Ch
	.GetAvailableTextureMem 	rd 01h	; +0010h
	.EvictManagedResources		rd 01h	; +0014h
	.GetDirect3D			rd 01h	; +0018h
	.GetDeviceCaps			rd 01h	; +001Ch
	.GetDisplayMode 		rd 01h	; +0020h
	.GetCreationParameters		rd 01h	; +0024h
	.SetCursorProperties		rd 01h	; +0028h
	.SetCursorPosition		rd 01h	; +002Ch
	.ShowCursor			rd 01h	; +0030h
	.CreateAdditionalSwapChain	rd 01h	; +0034h
	.GetSwapChain			rd 01h	; +0038h
	.GetNumberOfSwapChains		rd 01h	; +003Ch
	.Reset				rd 01h	; +0040h
	.Present			rd 01h	; +0044h
	.GetBackBuffer			rd 01h	; +0048h
	.GetRasterStatus		rd 01h	; +004Ch
	.SetDialogBoxMode		rd 01h	; +0050h
	.SetGammaRamp			rd 01h	; +0054h
	.GetGammaRamp			rd 01h	; +0058h
	.CreateTexture			rd 01h	; +005Ch
	.CreateVolumeTexture		rd 01h	; +0060h
	.CreateCubeTexture		rd 01h	; +0064h
	.CreateVertexBuffer		rd 01h	; +0068h
	.CreateIndexBuffer		rd 01h	; +006Ch
	.CreateRenderTarget		rd 01h	; +0070h
	.CreateDepthStencilSurface	rd 01h	; +0074h
	.UpdateSurface			rd 01h	; +0078h
	.UpdateTexture			rd 01h	; +007Ch
	.GetRenderTargetData		rd 01h	; +0080h
	.GetFrontBufferData		rd 01h	; +0084h
	.StretchRect			rd 01h	; +0088h
	.ColorFill			rd 01h	; +008Ch
	.CreateOffscreenPlainSurface	rd 01h	; +0090h
	.SetRenderTarget		rd 01h	; +0094h
	.GetRenderTarget		rd 01h	; +0098h
	.SetDepthStencilSurface 	rd 01h	; +009Ch
	.GetDepthStencilSurface 	rd 01h	; +00A0h
	.BeginScene			rd 01h	; +00A4h
	.EndScene			rd 01h	; +00A8h
	.Clear				rd 01h	; +00ACh
	.SetTransform			rd 01h	; +00B0h
	.GetTransform			rd 01h	; +00B4h
	.MultiplyTransform		rd 01h	; +00B8h
	.SetViewport			rd 01h	; +00BCh
	.GetViewport			rd 01h	; +00C0h
	.SetMaterial			rd 01h	; +00C4h
	.GetMaterial			rd 01h	; +00C8h
	.SetLight			rd 01h	; +00CCh
	.GetLight			rd 01h	; +00D0h
	.LightEnable			rd 01h	; +00D4h
	.GetLightEnable 		rd 01h	; +00D8h
	.SetClipPlane			rd 01h	; +00DCh
	.GetClipPlane			rd 01h	; +00E0h
	.SetRenderState 		rd 01h	; +00E4h
	.GetRenderState 		rd 01h	; +00E8h
	.CreateStateBlock		rd 01h	; +00ECh
	.BeginStateBlock		rd 01h	; +00E0h
	.EndStateBlock			rd 01h	; +00F4h
	.SetClipStatus			rd 01h	; +00F8h
	.GetClipStatus			rd 01h	; +00FCh
	.GetTexture			rd 01h	; +00F0h
	.SetTexture			rd 01h	; +0100h
	.GetTextureStageState		rd 01h	; +0104h
	.SetTextureStageState		rd 01h	; +0108h
	.GetSamplerState		rd 01h	; +010Ch
	.SetSamplerState		rd 01h	; +0110h
	.ValidateDevice 		rd 01h	; +0114h
	.SetPaletteEntries		rd 01h	; +0118h
	.GetPaletteEntries		rd 01h	; +011Ch
	.SetCurrentTexturePalette	rd 01h	; +0120h
	.GetCurrentTexturePalette	rd 01h	; +0124h
	.SetScissorRect 		rd 01h	; +0128h
	.GetScissorRect 		rd 01h	; +012Ch
	.SetSoftwareVertexProcessing	rd 01h	; +0130h
	.GetSoftwareVertexProcessing	rd 01h	; +0134h
	.SetNPatchMode			rd 01h	; +0138h
	.GetNPatchMode			rd 01h	; +013Ch
	.DrawPrimitive			rd 01h	; +0140h
	.DrawIndexedPrimitive		rd 01h	; +0144h
	.DrawPrimitiveUP		rd 01h	; +0148h
	.DrawIndexedPrimitiveUP 	rd 01h	; +014Ch
	.ProcessVertices		rd 01h	; +0150h
	.CreateVertexDeclaration	rd 01h	; +0154h
	.SetVertexDeclaration		rd 01h	; +0158h
	.GetVertexDeclaration		rd 01h	; +015Ch
	.SetFVF 			rd 01h	; +0160h
	.GetFVF 			rd 01h	; +0164h
	.CreateVertexShader		rd 01h	; +0168h
	.SetVertexShader		rd 01h	; +016Ch
	.GetVertexShader		rd 01h	; +0170h
	.SetVertexShaderConstantF	rd 01h	; +0174h
	.GetVertexShaderConstantF	rd 01h	; +0178h
	.SetVertexShaderConstantI	rd 01h	; +017Ch
	.GetVertexShaderConstantI	rd 01h	; +0180h
	.SetVertexShaderConstantB	rd 01h	; +0184h
	.GetVertexShaderConstantB	rd 01h	; +0188h
	.SetStreamSource		rd 01h	; +018Ch
	.GetStreamSource		rd 01h	; +0190h
	.SetStreamSourceFreq		rd 01h	; +0194h
	.GetStreamSourceFreq		rd 01h	; +0198h
	.SetIndices			rd 01h	; +019Ch
	.GetIndices			rd 01h	; +01A0h
	.CreatePixelShader		rd 01h	; +01A4h
	.SetPixelShader 		rd 01h	; +01A8h
	.GetPixelShader 		rd 01h	; +01ACh
	.SetPixelShaderConstantF	rd 01h	; +01B0h
	.GetPixelShaderConstantF	rd 01h	; +01B4h
	.SetPixelShaderConstantI	rd 01h	; +01B8h
	.GetPixelShaderConstantI	rd 01h	; +01BCh
	.SetPixelShaderConstantB	rd 01h	; +01C0h
	.GetPixelShaderConstantB	rd 01h	; +01C4h
	.DrawRectPatch			rd 01h	; +01C8h
	.DrawTriPatch			rd 01h	; +01CCh
	.DeletePatch			rd 01h	; +01D0h
	.CreateQuery			rd 01h	; +01D4h
}
struct IDirect3DDevice9

struc IDirect3DStateBlock9 {
	.QueryInterface 		rd 01h
	.AddRef 			rd 01h
	.Release			rd 01h
	.GetDevice			rd 01h
	.Capture			rd 01h
	.Apply				rd 01h
}
struct IDirect3DStateBlock9

struc IDirect3DSwapChain9 {
	.QueryInterface 		rd 01h
	.AddRef 			rd 01h
	.Release			rd 01h
	.Present			rd 01h
	.GetFrontBufferData		rd 01h
	.GetBackBuffer			rd 01h
	.GetRasterStatus		rd 01h
	.GetDisplayMode 		rd 01h
	.GetDevice			rd 01h
	.GetPresentParameters		rd 01h
}
struct IDirect3DSwapChain9

struc IDirect3DResource9 {
	.QueryInterface 		rd 01h
	.AddRef 			rd 01h
	.Release			rd 01h
	.GetDevice			rd 01h
	.SetPrivateData 		rd 01h
	.GetPrivateData 		rd 01h
	.FreePrivateData		rd 01h
	.SetPriority			rd 01h
	.GetPriority			rd 01h
	.PreLoad			rd 01h
	.GetType			rd 01h
}
struct IDirect3DResource9

struc IDirect3DVertexDeclaration9 {
	.QueryInterface 		rd 01h
	.AddRef 			rd 01h
	.Release			rd 01h
	.GetDevice			rd 01h
	.GetDeclaration 		rd 01h
}
struct IDirect3DVertexDeclaration9

struc IDirect3DVertexShader9 {
	.QueryInterface 		rd 01h
	.AddRef 			rd 01h
	.Release			rd 01h
	.GetDevice			rd 01h
	.GetFunction			rd 01h
}
struct IDirect3DVertexShader9

struc IDirect3DPixelShader9 {
	.QueryInterface 		rd 01h
	.AddRef 			rd 01h
	.Release			rd 01h
	.GetDevice			rd 01h
	.GetFunction			rd 01h
}
struct IDirect3DPixelShader9

struc IDirect3DBaseTexture9 {
	.QueryInterface 		rd 01h
	.AddRef 			rd 01h
	.Release			rd 01h
	.GetDevice			rd 01h
	.SetPrivateData 		rd 01h
	.GetPrivateData 		rd 01h
	.FreePrivateData		rd 01h
	.SetPriority			rd 01h
	.GetPriority			rd 01h
	.PreLoad			rd 01h
	.GetType			rd 01h
	.SetLOD 			rd 01h
	.GetLOD 			rd 01h
	.GetLevelCount			rd 01h
	.SetAutoGenFilterType		rd 01h
	.GetAutoGenFilterType		rd 01h
	.GenerateMipSubLevels		rd 01h
}
struct IDirect3DBaseTexture9

struc IDirect3DTexture9 {
	.QueryInterface 		rd 01h
	.AddRef 			rd 01h
	.Release			rd 01h
	.GetDevice			rd 01h
	.SetPrivateData 		rd 01h
	.GetPrivateData 		rd 01h
	.FreePrivateData		rd 01h
	.SetPriority			rd 01h
	.GetPriority			rd 01h
	.PreLoad			rd 01h
	.GetType			rd 01h
	.SetLOD 			rd 01h
	.GetLOD 			rd 01h
	.GetLevelCount			rd 01h
	.SetAutoGenFilterType		rd 01h
	.GetAutoGenFilterType		rd 01h
	.GenerateMipSubLevels		rd 01h
	.GetLevelDesc			rd 01h
	.GetSurfaceLevel		rd 01h
	.LockRect			rd 01h
	.UnlockRect			rd 01h
	.AddDirtyRect			rd 01h
}
struct IDirect3DTexture9

struc IDirect3DVolumeTexture9 {
	.QueryInterface 		rd 01h
	.AddRef 			rd 01h
	.Release			rd 01h
	.GetDevice			rd 01h
	.SetPrivateData 		rd 01h
	.GetPrivateData 		rd 01h
	.FreePrivateData		rd 01h
	.SetPriority			rd 01h
	.GetPriority			rd 01h
	.PreLoad			rd 01h
	.GetType			rd 01h
	.SetLOD 			rd 01h
	.GetLOD 			rd 01h
	.GetLevelCount			rd 01h
	.SetAutoGenFilterType		rd 01h
	.GetAutoGenFilterType		rd 01h
	.GenerateMipSubLevels		rd 01h
	.GetLevelDesc			rd 01h
	.GetVolumeLevel 		rd 01h
	.LockBox			rd 01h
	.UnlockBox			rd 01h
	.AddDirtyBox			rd 01h
}
struct IDirect3DVolumeTexture9

struc IDirect3DCubeTexture9 {
	.QueryInterface 		rd 01h
	.AddRef 			rd 01h
	.Release			rd 01h
	.GetDevice			rd 01h
	.SetPrivateData 		rd 01h
	.GetPrivateData 		rd 01h
	.FreePrivateData		rd 01h
	.SetPriority			rd 01h
	.GetPriority			rd 01h
	.PreLoad			rd 01h
	.GetType			rd 01h
	.SetLOD 			rd 01h
	.GetLOD 			rd 01h
	.GetLevelCount			rd 01h
	.SetAutoGenFilterType		rd 01h
	.GetAutoGenFilterType		rd 01h
	.GenerateMipSubLevels		rd 01h
	.GetLevelDesc			rd 01h
	.GetCubeMapSurface		rd 01h
	.LockRect			rd 01h
	.UnlockRect			rd 01h
	.AddDirtyRect			rd 01h
}
struct IDirect3DCubeTexture9

struc IDirect3DVertexBuffer9 {
	.QueryInterface 		rd 01h
	.AddRef 			rd 01h
	.Release			rd 01h
	.GetDevice			rd 01h
	.SetPrivateData 		rd 01h
	.GetPrivateData 		rd 01h
	.FreePrivateData		rd 01h
	.SetPriority			rd 01h
	.GetPriority			rd 01h
	.PreLoad			rd 01h
	.GetType			rd 01h
	.Lock				rd 01h
	.Unlock 			rd 01h
	.GetDesc			rd 01h
}
struct IDirect3DVertexBuffer9

struc IDirect3DIndexBuffer9 {
	.QueryInterface 		rd 01h
	.AddRef 			rd 01h
	.Release			rd 01h
	.GetDevice			rd 01h
	.SetPrivateData 		rd 01h
	.GetPrivateData 		rd 01h
	.FreePrivateData		rd 01h
	.SetPriority			rd 01h
	.GetPriority			rd 01h
	.PreLoad			rd 01h
	.GetType			rd 01h
	.Lock				rd 01h
	.Unlock 			rd 01h
	.GetDesc			rd 01h
}
struct IDirect3DIndexBuffer9

struc IDirect3DSurface9 {
	.QueryInterface 		rd 01h
	.AddRef 			rd 01h
	.Release			rd 01h
	.GetDevice			rd 01h
	.SetPrivateData 		rd 01h
	.GetPrivateData 		rd 01h
	.FreePrivateData		rd 01h
	.SetPriority			rd 01h
	.GetPriority			rd 01h
	.PreLoad			rd 01h
	.GetType			rd 01h
	.GetContainer			rd 01h
	.GetDesc			rd 01h
	.LockRect			rd 01h
	.UnlockRect			rd 01h
	.GetDC				rd 01h
	.ReleaseDC			rd 01h
}
struct IDirect3DSurface9

struc IDirect3DVolume9 {
	.QueryInterface 		rd 01h
	.AddRef 			rd 01h
	.Release			rd 01h
	.GetDevice			rd 01h
	.SetPrivateData 		rd 01h
	.GetPrivateData 		rd 01h
	.FreePrivateData		rd 01h
	.GetContainer			rd 01h
	.GetDesc			rd 01h
	.LockBox			rd 01h
	.UnlockBox			rd 01h
}
struct IDirect3DVolume9

struc IDirect3DQuery9 {
	.QueryInterface 		rd 01h
	.AddRef 			rd 01h
	.Release			rd 01h
	.GetDevice			rd 01h
	.GetType			rd 01h
	.GetDataSize			rd 01h
	.Issue				rd 01h
	.GetData			rd 01h
}
struct IDirect3DQuery9

struc D3DPRESENT_PARAMETERS {
    .BackBufferWidth		rd 01h
    .BackBufferHeight		rd 01h
    .BackBufferFormat		rd 01h
    .BackBufferCount		rd 01h
    .MultiSampleType		rd 01h
    .MultiSampleQuality 	rd 01h
    .SwapEffect 		rd 01h
    .hDeviceWindow		rd 01h
    .Windowed			rd 01h
    .EnableAutoDepthStencil	rd 01h
    .AutoDepthStencilFormat	rd 01h
    .Flags			rd 01h
    .FullScreen_RefreshRateInHz rd 01h
    .PresentationInterval	rd 01h
}
struct D3DPRESENT_PARAMETERS

struc D3D9SURFACE_DESC {
  .Format	dd ?
  .Type 	dd ?
  .Usage	dd ?
  .Pool 	dd ?
  .MultiSampleType dd ?
  .MultiSampleQuality dd ?
  .Width	dd ?
  .Height	dd ?
}
struct D3D9SURFACE_DESC

D3DPOOL_DEFAULT = 0
D3DPOOL_MANAGED = 1
D3DPOOL_SYSTEMMEM = 2
D3DPOOL_SCRATCH = 3
D3DPOOL_FORCE_DWORD = 0x7fffffff