//////////////////////////////////////////////////////////////////////////////
//
// Asura_PC_DirectPlay_Client.h
//
// Copyright (c) 2003 Rebellion. All rights reserved.
//
//////////////////////////////////////////////////////////////////////////////

// B E G I N   F I L E   W R A P P E R ///////////////////////////////////////

#ifdef ASURA_USE_PRAGMA_ONCE
    #pragma once
#endif

#ifndef ___ASURA_PC_DIRECTPLAY_CLIENT_H___
#define ___ASURA_PC_DIRECTPLAY_CLIENT_H___ 1

// I N C L U D E S ///////////////////////////////////////////////////////////

// Engine platform-specific.
#include "Core/Asura_DirectX.h"

// C L A S S E S /////////////////////////////////////////////////////////////

class Asura_PC_DirectPlay_Client
{

    public:

        // C L A S S   M E T H O D S /////////////////////////////////////////

        static void CreateInstance( Asura_PC_DirectPlay_Client** ppxInstance );
        static void DestroyInstance( Asura_PC_DirectPlay_Client** ppxInstance );

        // M E T H O D S /////////////////////////////////////////////////////

        // Methods from IDirectPlay8Client that we want to override in some
        // manner.
        HRESULT Send( const DPN_BUFFER_DESC *const prgBufferDesc, const DWORD cBufferDesc, const DWORD dwTimeOut, void *const pvAsyncContext, DPNHANDLE *const phAsyncHandle, const DWORD dwFlags );
        
        // Methods from IDirectPlay8Client that we just want to call straight
        // through to.
        HRESULT QueryInterface( DP8REFIID riid, LPVOID *ppvObj ) { return m_pxDPClient->QueryInterface( riid, ppvObj ); }
        ULONG   AddRef( void ) { return m_pxDPClient->AddRef(); }
        ULONG   Release( void ) { return m_pxDPClient->Release(); }
        HRESULT Initialize( PVOID const pvUserContext, const PFNDPNMESSAGEHANDLER pfn, const DWORD dwFlags ) { return m_pxDPClient->Initialize( pvUserContext, pfn, dwFlags ); }
        HRESULT EnumServiceProviders( const GUID *const pguidServiceProvider, const GUID *const pguidApplication, DPN_SERVICE_PROVIDER_INFO *const pSPInfoBuffer, PDWORD const pcbEnumData, PDWORD const pcReturned, const DWORD dwFlags ) { return m_pxDPClient->EnumServiceProviders( pguidServiceProvider, pguidApplication, pSPInfoBuffer, pcbEnumData, pcReturned, dwFlags ); }
        HRESULT EnumHosts( PDPN_APPLICATION_DESC const pApplicationDesc,IDirectPlay8Address *const pAddrHost,IDirectPlay8Address *const pDeviceInfo,PVOID const pUserEnumData,const DWORD dwUserEnumDataSize,const DWORD dwEnumCount,const DWORD dwRetryInterval,const DWORD dwTimeOut,PVOID const pvUserContext,DPNHANDLE *const pAsyncHandle,const DWORD dwFlags ) { return m_pxDPClient->EnumHosts( pApplicationDesc, pAddrHost, pDeviceInfo, pUserEnumData, dwUserEnumDataSize, dwEnumCount, dwRetryInterval, dwTimeOut, pvUserContext, pAsyncHandle, dwFlags ); }
        HRESULT CancelAsyncOperation( const DPNHANDLE hAsyncHandle, const DWORD dwFlags ) { return m_pxDPClient->CancelAsyncOperation( hAsyncHandle, dwFlags ); }
        HRESULT Connect( const DPN_APPLICATION_DESC *const pdnAppDesc,IDirectPlay8Address *const pHostAddr,IDirectPlay8Address *const pDeviceInfo,const DPN_SECURITY_DESC *const pdnSecurity,const DPN_SECURITY_CREDENTIALS *const pdnCredentials,const void *const pvUserConnectData,const DWORD dwUserConnectDataSize,void *const pvAsyncContext,DPNHANDLE *const phAsyncHandle,const DWORD dwFlags ) { return m_pxDPClient->Connect( pdnAppDesc, pHostAddr, pDeviceInfo, pdnSecurity, pdnCredentials, pvUserConnectData, dwUserConnectDataSize, pvAsyncContext, phAsyncHandle, dwFlags ); }
        HRESULT GetSendQueueInfo( DWORD *const pdwNumMsgs, DWORD *const pdwNumBytes, const DWORD dwFlags ) { return m_pxDPClient->GetSendQueueInfo( pdwNumMsgs, pdwNumBytes, dwFlags ); }
        HRESULT GetApplicationDesc( DPN_APPLICATION_DESC *const pAppDescBuffer, DWORD *const pcbDataSize, const DWORD dwFlags ) { return m_pxDPClient->GetApplicationDesc( pAppDescBuffer, pcbDataSize, dwFlags ); }
        HRESULT SetClientInfo( const DPN_PLAYER_INFO *const pdpnPlayerInfo,PVOID const pvAsyncContext,DPNHANDLE *const phAsyncHandle, const DWORD dwFlags ) { return m_pxDPClient->SetClientInfo( pdpnPlayerInfo, pvAsyncContext, phAsyncHandle, dwFlags ); }
        HRESULT GetServerInfo( DPN_PLAYER_INFO *const pdpnPlayerInfo,DWORD *const pdwSize,const DWORD dwFlags ) { return m_pxDPClient->GetServerInfo( pdpnPlayerInfo, pdwSize, dwFlags ); }
        HRESULT GetServerAddress( IDirectPlay8Address **const pAddress,const DWORD dwFlags ) { return m_pxDPClient->GetServerAddress( pAddress, dwFlags ); }
        HRESULT Close( const DWORD dwFlags ) { return m_pxDPClient->Close( dwFlags ); }
        HRESULT ReturnBuffer( const DPNHANDLE hBufferHandle,const DWORD dwFlags ) { return m_pxDPClient->ReturnBuffer( hBufferHandle, dwFlags ); }
        HRESULT GetCaps( DPN_CAPS *const pdpCaps,const DWORD dwFlags ) { return m_pxDPClient->GetCaps( pdpCaps, dwFlags ); }
        HRESULT SetCaps( const DPN_CAPS *const pdpCaps, const DWORD dwFlags ) { return m_pxDPClient->SetCaps( pdpCaps, dwFlags ); }
        HRESULT SetSPCaps( const GUID * const pguidSP, const DPN_SP_CAPS *const pdpspCaps, const DWORD dwFlags ) { return m_pxDPClient->SetSPCaps( pguidSP, pdpspCaps, dwFlags  ); }
        HRESULT GetSPCaps( const GUID * const pguidSP,DPN_SP_CAPS *const pdpspCaps,const DWORD dwFlags ) { return m_pxDPClient->GetSPCaps( pguidSP, pdpspCaps, dwFlags ); }
        HRESULT GetConnectionInfo( DPN_CONNECTION_INFO *const pdpConnectionInfo,const DWORD dwFlags ) { return m_pxDPClient->GetConnectionInfo( pdpConnectionInfo, dwFlags ); }
        HRESULT RegisterLobby( const DPNHANDLE dpnHandle, struct IDirectPlay8LobbiedApplication *const pIDP8LobbiedApplication,const DWORD dwFlags ) { return m_pxDPClient->RegisterLobby( dpnHandle, pIDP8LobbiedApplication, dwFlags ); }

    private:
        
        // S T A T E /////////////////////////////////////////////////////////

        IDirectPlay8Client* m_pxDPClient;

};

// E N D   F I L E   W R A P P E R ///////////////////////////////////////////

#endif // #ifndef ___ASURA_PC_DIRECTPLAY_CLIENT_H___
