summaryrefslogtreecommitdiff
path: root/src/dlls/mscoree/comcallunmarshal.h
blob: 2e8af4511a571af7a9d716b7bad8466eed46482d (plain)
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
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
//
// File: ComCallUnmarshal.h
//

//
// Classes used to unmarshal all COM call wrapper IPs.
//


#pragma once

#ifndef FEATURE_COMINTEROP
#error FEATURE_COMINTEROP is required for this file
#endif // FEATURE_COMINTEROP

// Class used to unmarshal all COM call wrapper IPs. In order for this to work in side-by-side
// scenarios, the CLSID of this class has to be changed with every side-by-side release.
//
// The class is identified by the following CLSID:
// CLR v1.0, v1.1, v2.0: 3F281000-E95A-11d2-886B-00C04F869F04
// CLR v4.0:             45FB4600-E6E8-4928-B25E-50476FF79425
//
class ComCallUnmarshal : public IMarshal
{
public:

    // *** IUnknown methods ***
    STDMETHODIMP QueryInterface(REFIID iid, void **ppv); 
    STDMETHODIMP_(ULONG) AddRef(void); 
    STDMETHODIMP_(ULONG) Release(void); 

    // *** IMarshal methods ***
    STDMETHODIMP GetUnmarshalClass (REFIID riid, void * pv, ULONG dwDestContext, 
                                    void * pvDestContext, ULONG mshlflags, 
                                    LPCLSID pclsid);

    STDMETHODIMP GetMarshalSizeMax (REFIID riid, void * pv, ULONG dwDestContext, 
                                    void * pvDestContext, ULONG mshlflags, 
                                    ULONG * pSize);

    STDMETHODIMP MarshalInterface (LPSTREAM pStm, REFIID riid, void * pv,
                                   ULONG dwDestContext, LPVOID pvDestContext,
                                   ULONG mshlflags);

    STDMETHODIMP UnmarshalInterface (LPSTREAM pStm, REFIID riid, void ** ppvObj);
    STDMETHODIMP ReleaseMarshalData (LPSTREAM pStm);
    STDMETHODIMP DisconnectObject (ULONG dwReserved);
};

// Class factory for the COM call wrapper unmarshaller.
class CComCallUnmarshalFactory : public IClassFactory
{
    ComCallUnmarshal    m_Unmarshaller;

  public:

    CComCallUnmarshalFactory();

    // *** IUnknown methods ***
	STDMETHODIMP QueryInterface(REFIID iid, void **ppv);
	STDMETHODIMP_(ULONG) AddRef(void);
	STDMETHODIMP_(ULONG) Release(void); 

    // *** IClassFactory methods ***
    STDMETHODIMP CreateInstance(LPUNKNOWN punkOuter, REFIID iid, LPVOID FAR *ppv);
    STDMETHODIMP LockServer(BOOL fLock);
};