func (obj *Device) Release() uint32 {
	ret, _, _ := syscall.Syscall(
		obj.vtbl.Release,
		1,
		uintptr(unsafe.Pointer(obj)),
		0,
		0,
	)
	return uint32(ret)
}
Release has to be called when finished using the object to free its
associated resources.
package d3d9
import (
	"syscall"
	"unsafe"
)
type Device struct {
	vtbl *deviceVtbl
}
type deviceVtbl struct {
	QueryInterface uintptr
	AddRef         uintptr
	Release        uintptr
	TestCooperativeLevel        uintptr
	GetAvailableTextureMem      uintptr
	EvictManagedResources       uintptr
	GetDirect3D                 uintptr
	GetDeviceCaps               uintptr
	GetDisplayMode              uintptr
	GetCreationParameters       uintptr
	SetCursorProperties         uintptr
	SetCursorPosition           uintptr
	ShowCursor                  uintptr
	CreateAdditionalSwapChain   uintptr
	GetSwapChain                uintptr
	GetNumberOfSwapChains       uintptr
	Reset                       uintptr
	Present                     uintptr
	GetBackBuffer               uintptr
	GetRasterStatus             uintptr
	SetDialogBoxMode            uintptr
	SetGammaRamp                uintptr
	GetGammaRamp                uintptr
	CreateTexture               uintptr
	CreateVolumeTexture         uintptr
	CreateCubeTexture           uintptr
	CreateVertexBuffer          uintptr
	CreateIndexBuffer           uintptr
	CreateRenderTarget          uintptr
	CreateDepthStencilSurface   uintptr
	UpdateSurface               uintptr
	UpdateTexture               uintptr
	GetRenderTargetData         uintptr
	GetFrontBufferData          uintptr
	StretchRect                 uintptr
	ColorFill                   uintptr
	CreateOffscreenPlainSurface uintptr
	SetRenderTarget             uintptr
	GetRenderTarget             uintptr
	SetDepthStencilSurface      uintptr
	GetDepthStencilSurface      uintptr
	BeginScene                  uintptr
	EndScene                    uintptr
	Clear                       uintptr
	SetTransform                uintptr
	GetTransform                uintptr
	MultiplyTransform           uintptr
	SetViewport                 uintptr
	GetViewport                 uintptr
	SetMaterial                 uintptr
	GetMaterial                 uintptr
	SetLight                    uintptr
	GetLight                    uintptr
	LightEnable                 uintptr
	GetLightEnable              uintptr
	SetClipPlane                uintptr
	GetClipPlane                uintptr
	SetRenderState              uintptr
	GetRenderState              uintptr
	CreateStateBlock            uintptr
	BeginStateBlock             uintptr
	EndStateBlock               uintptr
	SetClipStatus               uintptr
	GetClipStatus               uintptr
	GetTexture                  uintptr
	SetTexture                  uintptr
	GetTextureStageState        uintptr
	SetTextureStageState        uintptr
	GetSamplerState             uintptr
	SetSamplerState             uintptr
	ValidateDevice              uintptr
	SetPaletteEntries           uintptr
	GetPaletteEntries           uintptr
	SetCurrentTexturePalette    uintptr
	GetCurrentTexturePalette    uintptr
	SetScissorRect              uintptr
	GetScissorRect              uintptr
	SetSoftwareVertexProcessing uintptr
	GetSoftwareVertexProcessing uintptr
	SetNPatchMode               uintptr
	GetNPatchMode               uintptr
	DrawPrimitive               uintptr
	DrawIndexedPrimitive        uintptr
	DrawPrimitiveUP             uintptr
	DrawIndexedPrimitiveUP      uintptr
	ProcessVertices             uintptr
	CreateVertexDeclaration     uintptr
	SetVertexDeclaration        uintptr
	GetVertexDeclaration        uintptr
	SetFVF                      uintptr
	GetFVF                      uintptr
	CreateVertexShader          uintptr
	SetVertexShader             uintptr
	GetVertexShader             uintptr
	SetVertexShaderConstantF    uintptr
	GetVertexShaderConstantF    uintptr
	SetVertexShaderConstantI    uintptr
	GetVertexShaderConstantI    uintptr
	SetVertexShaderConstantB    uintptr
	GetVertexShaderConstantB    uintptr
	SetStreamSource             uintptr
	GetStreamSource             uintptr
	SetStreamSourceFreq         uintptr
	GetStreamSourceFreq         uintptr
	SetIndices                  uintptr
	GetIndices                  uintptr
	CreatePixelShader           uintptr
	SetPixelShader              uintptr
	GetPixelShader              uintptr
	SetPixelShaderConstantF     uintptr
	GetPixelShaderConstantF     uintptr
	SetPixelShaderConstantI     uintptr
	GetPixelShaderConstantI     uintptr
	SetPixelShaderConstantB     uintptr
	GetPixelShaderConstantB     uintptr
	DrawRectPatch               uintptr
	DrawTriPatch                uintptr
	DeletePatch                 uintptr
	CreateQuery                 uintptr
}
func (obj *Device) AddRef() uint32 {
	ret, _, _ := syscall.Syscall(
		obj.vtbl.AddRef,
		1,
		uintptr(unsafe.Pointer(obj)),
		0,
		0,
	)
	return uint32(ret)
}