summaryrefslogtreecommitdiffstats
path: root/private/oleauto/src/dispatch/evps.h
blob: 3fb2780ae2b7ce1bf4e45df3da6842b15edd64b5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
/*** 
*evps.h - IEnumVARIANT Proxy and Stub class definitions
*
*  Copyright (C) 1992, Microsoft Corporation.  All Rights Reserved.
*  Information Contained Herein Is Proprietary and Confidential.
*
*Purpose:
*  This file describes the IEnumVARIANT Proxy and Stub classes.
*
*  CProxEnumVARIANT      -- the IEnumVARIANT proxy class
*    CPEVUnkImpl         -    CProxEnumVARIANT implementation of IUnknown
*    CPEVProxImpl        -    CProxEnumVARIANT implementation of IRpcProxy
*    CPEVEnumVARIANTImpl -    CProxEnumVARIANT implementation of IEnumVARIANT
*
*  CStubEnumVARIANT      -- the IEnumVARIANT stub class
*
*Revision History:
*
* [00]	05-Nov-92 bradlo: Created.
*
*Implementation Notes:
*
*****************************************************************************/

#ifndef __evps_h__
#define __evps_h__

#pragma warning(4:4355)


// forward declarations
class FAR CProxEnumVARIANT;
class FAR CStubEnumVARIANT;


// IEnumVARIANT proxy class' IUnknown implementation
class FAR CPEVUnkImpl : public IUnknown
{
public:
    CPEVUnkImpl(CProxEnumVARIANT FAR* pproxenum);

    STDMETHOD(QueryInterface)(REFIID riid, void FAR* FAR* ppv);
    STDMETHOD_(unsigned long, AddRef)(void);
    STDMETHOD_(unsigned long, Release)(void);

private:
    CProxEnumVARIANT FAR* m_pproxenum;
};


// IEnumVARIANT proxy class' IRpcProxy implementation
class CPEVProxImpl : public IPROXY
{
public:
    CPEVProxImpl(CProxEnumVARIANT FAR* pproxenum);
    ~CPEVProxImpl();

    STDMETHOD(QueryInterface)(REFIID riid, void FAR* FAR* ppv);
    STDMETHOD_(unsigned long, AddRef)(void);
    STDMETHOD_(unsigned long, Release)(void);

    STDMETHOD(Connect)(ICHANNEL FAR* plrpc);
    STDMETHOD_(void, Disconnect)(void);

private:
    CProxEnumVARIANT FAR* m_pproxenum;
};


// IEnumVARIANT
//
class CPEVEnumVARIANTImpl : public IEnumVARIANT
{
public:
    CPEVEnumVARIANTImpl(CProxEnumVARIANT FAR* pproxy);
	
    // IUnknown methods
    STDMETHOD(QueryInterface)(REFIID riid, void FAR* FAR* ppv);
    STDMETHOD_(unsigned long, AddRef)(void);
    STDMETHOD_(unsigned long, Release)(void);

    // IEnumVARIANT methods
    STDMETHOD(Next)(unsigned long celt, VARIANT FAR* rgvar, unsigned long FAR* pceltFetched);
    STDMETHOD(Skip)(unsigned long celt);
    STDMETHOD(Reset)(void);
    STDMETHOD(Clone)(IEnumVARIANT FAR* FAR* ppenum);

private:
    CProxEnumVARIANT FAR* m_pproxenum;
};


// IEnumVARIANT Proxy Class
class FAR CProxEnumVARIANT
{
public:
    static IUnknown FAR* Create(IUnknown FAR* punkOuter); 

private:
    CProxEnumVARIANT(IUnknown FAR* punkOuter);

    friend CPEVUnkImpl;
    friend CPEVProxImpl;
    friend CPEVEnumVARIANTImpl;

    CPEVUnkImpl m_unk;
    CPEVProxImpl m_proxy;
    CPEVEnumVARIANTImpl m_enum;

private:
    unsigned long m_refs;
    ICHANNEL FAR* m_plrpc;
    IUnknown FAR* m_punkOuter;
};


// IEnumVARIANT Stub Class
//
class FAR CStubEnumVARIANT : public ISTUB
{
public:
    static HRESULT Create(IUnknown FAR* punkServer, ISTUB FAR* FAR* ppstub);
	
    // IUnknown methods
    //
    STDMETHOD(QueryInterface)(REFIID riid, void FAR* FAR* ppv);
    STDMETHOD_(unsigned long, AddRef)(void);
    STDMETHOD_(unsigned long, Release)(void);
	
    // IRpcStub methods
    //
#if (OE_WIN32 || defined(WOW))
    STDMETHOD(Connect)(IUnknown FAR* pUnk);
    STDMETHOD_(void, Disconnect)(void);
    STDMETHOD(Invoke)(RPCOLEMESSAGE FAR* pRpcMsg, 
	      IRpcChannelBuffer FAR* pRpcChannel);
    STDMETHOD_(IRpcStubBuffer *, IsIIDSupported)(REFIID iid);
    STDMETHOD_(ULONG, CountRefs)(void);
    STDMETHOD(DebugServerQueryInterface)(void FAR* FAR* ppv);
    STDMETHOD_(void, DebugServerRelease)(void FAR* pv);
#else
    STDMETHOD(Connect)(IUnknown FAR* punkObject);
    STDMETHOD_(void, Disconnect)(void);              
    STDMETHOD(Invoke)(
      REFIID riid,
      int imeth,
      IStream FAR* pstm,
      unsigned long dwDestCtx,
      void FAR* pvDestCtx);
#if OE_MAC
    STDMETHOD_(unsigned long, IsIIDSupported)(REFIID riid);
#else
    STDMETHOD_(BOOL, IsIIDSupported)(REFIID riid);
#endif
    STDMETHOD_(unsigned long, CountRefs)(void);
#endif

private:	
    CStubEnumVARIANT();
    ~CStubEnumVARIANT();

    unsigned long m_refs;
    IUnknown FAR* m_punk;
    IEnumVARIANT FAR* m_penum;
};


// IEnumVARIANT method indices
//
#define IMETH_ENUMVARIANT_QUERYINTERFACE 0	/* Placeholder */
#define IMETH_ENUMVARIANT_ADDREF	1	/* Placeholder */
#define	IMETH_ENUMVARIANT_RELEASE	2	/* Placeholder */

#define IMETH_ENUMVARIANT_NEXT		3
#define IMETH_ENUMVARIANT_SKIP		4
#define IMETH_ENUMVARIANT_RESET		5
#define IMETH_ENUMVARIANT_CLONE		6

#endif __evps_h__