dpnet_private.h 4.55 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/*
 * DirectPlay8 (dpnet) private include file
 *
 * Copyright 2004 Raphael Junqueira
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 20 21 22 23 24 25 26 27
 */

#ifndef __WINE_DPNET_PRIVATE_H
#define __WINE_DPNET_PRIVATE_H

#ifndef __WINE_CONFIG_H
# error You must include config.h to use this header
#endif

28 29
#include <wine/list.h>

30
#include "dplay8.h"
31
#include "dplobby8.h"
32 33 34 35 36 37 38
/*
 *#include "dplay8sp.h"
 */

/* DirectPlay8 Interfaces: */
typedef struct IDirectPlay8ClientImpl IDirectPlay8ClientImpl;
typedef struct IDirectPlay8AddressImpl IDirectPlay8AddressImpl;
39
typedef struct IDirectPlay8LobbiedApplicationImpl IDirectPlay8LobbiedApplicationImpl;
40
typedef struct IDirectPlay8ThreadPoolImpl IDirectPlay8ThreadPoolImpl;
41 42 43 44 45 46 47 48 49 50

/* ------------------ */
/* IDirectPlay8Client */
/* ------------------ */

/*****************************************************************************
 * IDirectPlay8Client implementation structure
 */
struct IDirectPlay8ClientImpl
{
51 52 53 54 55 56 57
    IDirectPlay8Client IDirectPlay8Client_iface;
    LONG ref;

    /* IDirectPlay8Client fields */
    PFNDPNMESSAGEHANDLER msghandler;
    DWORD flags;
    void *usercontext;
58 59

    DPN_SP_CAPS spcaps;
60 61 62 63 64
};

/* ------------------- */
/* IDirectPlay8Address */
/* ------------------- */
65 66 67 68 69 70
struct component
{
    struct list entry;

    WCHAR *name;
    DWORD type;
71
    DWORD size;
72 73 74 75 76 77 78 79 80 81

    union
    {
        DWORD value;            /* DPNA_DATATYPE_DWORD       */
        GUID guid;              /* DPNA_DATATYPE_GUID        */
        WCHAR *string;          /* DPNA_DATATYPE_STRING      */
        char *ansi;             /* DPNA_DATATYPE_STRING_ANSI */
        void *binary;           /* DPNA_DATATYPE_BINARY      */
    } data;
};
82 83 84 85 86 87

/*****************************************************************************
 * IDirectPlay8Address implementation structure
 */
struct IDirectPlay8AddressImpl
{
88 89 90 91 92 93
    IDirectPlay8Address IDirectPlay8Address_iface;
    LONG ref;
    /* IDirectPlay8Address fields */
    GUID SP_guid;
    BOOL init;

94 95 96
    struct component **components;
    DWORD comp_count;
    DWORD comp_array_size;
97 98
};

99 100 101 102 103
/*****************************************************************************
 * IDirectPlay8LobbiedApplication implementation structure
 */
struct IDirectPlay8LobbiedApplicationImpl
{
104 105 106 107 108 109 110
    IDirectPlay8LobbiedApplication IDirectPlay8LobbiedApplication_iface;
    LONG ref;

    PFNDPNMESSAGEHANDLER msghandler;
    DWORD flags;
    void *usercontext;
    DPNHANDLE *connection;
111 112
};

113 114 115 116 117
/*****************************************************************************
 * IDirectPlay8ThreadPool implementation structure
 */
struct IDirectPlay8ThreadPoolImpl
{
118 119
  IDirectPlay8ThreadPool IDirectPlay8ThreadPool_iface;
  LONG ref;
120 121
};

122 123 124
/**
 * factories
 */
125 126 127 128 129 130
extern HRESULT DPNET_CreateDirectPlay8Client(LPCLASSFACTORY iface, LPUNKNOWN punkOuter, REFIID riid, LPVOID *ppobj) DECLSPEC_HIDDEN;
extern HRESULT DPNET_CreateDirectPlay8Server(LPCLASSFACTORY iface, LPUNKNOWN punkOuter, REFIID riid, LPVOID *ppobj) DECLSPEC_HIDDEN;
extern HRESULT DPNET_CreateDirectPlay8Peer(LPCLASSFACTORY iface, LPUNKNOWN punkOuter, REFIID riid, LPVOID *ppobj) DECLSPEC_HIDDEN;
extern HRESULT DPNET_CreateDirectPlay8Address(LPCLASSFACTORY iface, LPUNKNOWN punkOuter, REFIID riid, LPVOID *ppobj) DECLSPEC_HIDDEN;
extern HRESULT DPNET_CreateDirectPlay8LobbiedApp(LPCLASSFACTORY iface, LPUNKNOWN punkOuter, REFIID riid, LPVOID *ppobj) DECLSPEC_HIDDEN;
extern HRESULT DPNET_CreateDirectPlay8ThreadPool(LPCLASSFACTORY iface, LPUNKNOWN punkOuter, REFIID riid, LPVOID *ppobj) DECLSPEC_HIDDEN;
131
extern HRESULT DPNET_CreateDirectPlay8LobbyClient(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppobj) DECLSPEC_HIDDEN;
132

133 134
extern void init_dpn_sp_caps(DPN_SP_CAPS *dpnspcaps) DECLSPEC_HIDDEN;

135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
/* used for generic dumping (copied from ddraw) */
typedef struct {
    DWORD val;
    const char* name;
} flag_info;

typedef struct {
    const GUID *guid;
    const char* name;
} guid_info;

#define FE(x) { x, #x }	
#define GE(x) { &x, #x }



151
#endif