/* This is the header file for the service providers
 * PLEASE NOTE: The dp8 service provider API is NOT available from Microsoft
 * and they are not willing to give it to anyone. So this interface has been
 * created by David Hammerton (TransGaming Technologies). So feel
 * free to change it if you want.
 * It is very much a work in progress!
 */

#ifndef _WINE_DPLAY8SP_H__
#define _WINE_DPLAY8SP_H__

#include "ole2.h"

#ifdef __cplusplus
extern "C" {
#endif

#include "dplay8.h"
#include "dp8threadpool.h"

/* IID for DirectPlay8 Service Providers */
/* {985E2C76-66BC-4d66-AD8E-ED3801F1B459} */
DEFINE_GUID(IID_IDirectPlay8ServiceProvider,
0x985e2c76, 0x66bc, 0x4d66, 0xad, 0x8e, 0xed, 0x38, 0x1, 0xf1, 0xb4, 0x59);

/* interface pointers */

typedef struct IDirectPlay8ServiceProvider IDirectPlay8ServiceProvider, *PDIRECTPLAY8SERVICEPROVIDER;

/* external types */
typedef struct DirectPlay8GlobalData DirectPlay8GlobalData;

/* callback functions */
typedef void (*spMessageReceived)(DirectPlay8GlobalData *, void *, int, PVOID);

/* non structure/message datatypes */

/* message identifiers */

/* constants */

/* Flags */

/* non message structures */

/* message callback structures */

/* functions */

/******** Interfaces *******/

/* IDirectPlay8ServiceProvider */
#define ICOM_INTERFACE IDirectPlay8ServiceProvider
#define IDirectPlay8ServiceProvider_METHODS \
    ICOM_METHOD3(HRESULT,Initialize,             DirectPlay8GlobalData *, dp8gdData, spMessageReceived, msgCallback, DWORD, dwFlags) \
    ICOM_METHOD4(HRESULT,SendToAddress,          IDirectPlay8Address *, pAddrDest, LPVOID, pPacket, DWORD, dwSize, DWORD, dwFlags) \
    ICOM_METHOD2(HRESULT,SetSPCaps,              DPN_SP_CAPS *, pdpspCaps, DWORD, dwFlags) \
    ICOM_METHOD2(HRESULT,GetSPCaps,              DPN_SP_CAPS *, pdpspCaps, DWORD, dwFlags) \
    ICOM_METHOD1(HRESULT,GetThreadPool,          IDirectPlay8ThreadPool_Internal **, ppThreadPool) \
    ICOM_METHOD1(HRESULT,SetSPAddressData,       IDirectPlay8Address *, pAddr) \
    ICOM_METHOD2(HRESULT,BuildAddressFromSPData, IDirectPlay8Address *, pAddr, PVOID, pvSPData)
#define IDirectPlay8ServiceProvider_IMETHODS \
    IUnknown_IMETHODS \
    IDirectPlay8ServiceProvider_METHODS
ICOM_DEFINE(IDirectPlay8ServiceProvider, IUnknown)
#undef ICOM_INTERFACE

  /* IUnknown methods */
#define IDirectPlay8ServiceProvider_QueryInterface(p,a,b)             ICOM_CALL2(QueryInterface,p,a,b)
#define IDirectPlay8ServiceProvider_AddRef(p)                         ICOM_CALL (AddRef,p)
#define IDirectPlay8ServiceProvider_Release(p)                        ICOM_CALL (Release,p)
  /* IDirectPlay8ServiceProvider methods */
#define IDirectPlay8ServiceProvider_Initialize(p,a,b,c)               ICOM_CALL3(Initialize,p,a,b,c)
#define IDirectPlay8ServiceProvider_SendToAddress(p,a,b,c,d)          ICOM_CALL4(SendToAddress,p,a,b,c,d)
#define IDirectPlay8ServiceProvider_GetThreadPool(p,a)                ICOM_CALL1(GetThreadPool,p,a)
#define IDirectPlay8ServiceProvider_SetSPAddressData(p,a)             ICOM_CALL1(SetSPAddressData,p,a)
#define IDirectPlay8ServiceProvider_BuildAddressFromSPData(p,a,b)     ICOM_CALL2(BuildAddressFromSPData,p,a,b)

#ifdef __cplusplus
}
#endif

#endif /* _WINE_DPLAY8SP_H__ */
