text: #pragma once
  
  class m_IDirectDrawSurface4 : public IDirectDrawSurface4, public AddressLookupTableDdrawObject
  {
  private:
  	m_IDirectDrawSurfaceX *ProxyInterface;
  	IDirectDrawSurface4 *RealInterface;
  	REFIID WrapperID = IID_IDirectDrawSurface4;
  	const DWORD DirectXVersion = 4;
  
  public:
  	m_IDirectDrawSurface4(IDirectDrawSurface4 *aOriginal, m_IDirectDrawSurfaceX *Interface) : RealInterface(aOriginal), ProxyInterface(Interface)
  	{
  		ProxyAddressLookupTable.SaveAddress(this, (RealInterface) ? RealInterface : (void*)ProxyInterface);
  	}
  	~m_IDirectDrawSurface4()
  	{
  		ProxyAddressLookupTable.DeleteAddress(this);
  	}
  
  	/*** IUnknown methods ***/
  	STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj);
  	STDMETHOD_(ULONG, AddRef) (THIS);
  	STDMETHOD_(ULONG, Release) (THIS);
  
  	/*** IDirectDrawSurface methods ***/
  	STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE4);
  	STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT);
  	STDMETHOD(Blt)(THIS_ LPRECT, LPDIRECTDRAWSURFACE4, LPRECT, DWORD, LPDDBLTFX);
  	STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD);
  	STDMETHOD(BltFast)(THIS_ DWORD, DWORD, LPDIRECTDRAWSURFACE4, LPRECT, DWORD);
  	STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD, LPDIRECTDRAWSURFACE4);
  	STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID, LPDDENUMSURFACESCALLBACK2);
  	STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD, LPVOID, LPDDENUMSURFACESCALLBACK2);
  	STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE4, DWORD);
  	STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS2, LPDIRECTDRAWSURFACE4 FAR *);
  	STDMETHOD(GetBltStatus)(THIS_ DWORD);
  	STDMETHOD(GetCaps)(THIS_ LPDDSCAPS2);
  	STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*);
  	STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY);
  	STDMETHOD(GetDC)(THIS_ HDC FAR *);
  	STDMETHOD(GetFlipStatus)(THIS_ DWORD);
  	STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG);
  	STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*);
  	STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT);
  	STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC2);
  	STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC2);
  	STDMETHOD(IsLost)(THIS);
  	STDMETHOD(Lock)(THIS_ LPRECT, LPDDSURFACEDESC2, DWORD, HANDLE);
  	STDMETHOD(ReleaseDC)(THIS_ HDC);
  	STDMETHOD(Restore)(THIS);
  	STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER);
  	STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY);
  	STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG);
  	STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE);
  	STDMETHOD(Unlock)(THIS_ LPRECT);
  	STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE4, LPRECT, DWORD, LPDDOVERLAYFX);
  	STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD);
  	STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE4);
  	/*** Added in the v2 interface ***/
  	STDMETHOD(GetDDInterface)(THIS_ LPVOID FAR *);
  	STDMETHOD(PageLock)(THIS_ DWORD);
  	STDMETHOD(PageUnlock)(THIS_ DWORD);
  	/*** Added in the v3 interface ***/
  	STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC2, DWORD);
  	/*** Added in the v4 interface ***/
  	STDMETHOD(SetPrivateData)(THIS_ REFGUID, LPVOID, DWORD, DWORD);
  	STDMETHOD(GetPrivateData)(THIS_ REFGUID, LPVOID, LPDWORD);
  	STDMETHOD(FreePrivateData)(THIS_ REFGUID);
  	STDMETHOD(GetUniquenessValue)(THIS_ LPDWORD);
  	STDMETHOD(ChangeUniquenessValue)(THIS);
  };
  