summaryrefslogtreecommitdiffstats
path: root/private/dcomidl/lclor.idl
blob: c5d17f81cb9b1ac25b38dec96cb6ed4d76b8ff3b (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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
//+-------------------------------------------------------------------------
//
//  Microsoft Windows
//  Copyright (C) Microsoft Corporation, 1992 - 1995.
//
//  File:       lclor.idl
//
//  Synopsis:   This is the local interface to the object exporter.
//
//    Clients can
//      Register object ids to be pinged.
//      Deregister object ids that no longer need to be pinged.
//      Lookup an OXID and register an object id for that OXID.
//
//    Servers can
//      Register their OXID.
//      Register an object id so they receive a death notification.
//
//--------------------------------------------------------------------------
[
    uuid(e60c73e6-88f9-11cf-9af1-0020af6e72f4),
    version(2.0)
]

interface ILocalObjectExporter
{
    import "obase.idl";

    typedef [context_handle] void *PHPROCESS;

    //////////////////////////////////////////////////
    ////////// Shared client and server APIs

    // Client and Server both call this to establish a context handle
    // in the local oxid resolver/ping process.

    typedef          USHORT  *STATIC_ARRAY;
    typedef          unsigned char *STATIC_BYTE_ARRAY;
    typedef [string] wchar_t *STATIC_STRING;

    // Flags for use in Connect.
    const unsigned long CONNECT_DISABLEDCOM = 0x1;
    const unsigned long CONNECT_MUTUALAUTH  = 0x2;
    const unsigned long CONNECT_SECUREREF   = 0x4;

    error_status_t Connect
        (
        [in]  handle_t          hServer,
        [out] PHPROCESS        *pProcess,
        [out] ULONG            *pdwTimeoutInSeconds,
        [out] DUALSTRINGARRAY **ppdsaOrBindings,
        [out] MID              *pLocalMid,
        [in]  long              cIdsToReserve,
        [out, ref] ID          *pidReservedBase,
        [out] DWORD            *pfConnectFlags,
        [out] STATIC_STRING    *pLegacySecurity,
        [out] DWORD            *pAuthnLevel,
        [out] DWORD            *pImpLevel,
        [out] DWORD            *pcServerSvc,
        [out, size_is(,*pcServerSvc)] STATIC_ARRAY *aServerSvc,
        [out] DWORD            *pcClientSvc,
        [out, size_is(,*pcClientSvc)] STATIC_ARRAY *aClientSvc,
        [out] DWORD *           pProcessID,
        [out] DWORD *           pScmProcessID,
        [out] DWORD *           pSignature
        );

    // Called by local clients to reserve a range of IDs which will
    // not conflict with any other local IDs.
    error_status_t AllocateReservedIds
        (
        [in]       handle_t hServer,
        [in]       long     cIdsToReserve,  // Max of ten will be returned
        [out, ref] ID      *pidReservedBase
        );

    // Clients and server of call this to update the state of OID
    // they are using.
    // Clients may add OIDs to the set of OID in use by their process
    // Clients may remove OIDs from those in use by their process
    // Servers may free OIDs they allocated but are no longer using.
    // Clients may free OXIDs they are no longer using.
    typedef struct
        {
        MID mid;
        OXID oxid;
        unsigned long refs;
        } OXID_REF;

    typedef struct
        {
        MID mid;
        OID oid;
        } OID_MID_PAIR;

    typedef struct
        {
        MID  mid;
        OXID oxid;
        OID  oid;
        } OXID_OID_PAIR;

    // Returned if at least one OID was not successful added/removed.
    const long OR_PARTIAL_UPDATE = 1003L;

    error_status_t
    BulkUpdateOIDs
        (
        [in]                            handle_t      hServer,
        [in]                            PHPROCESS     phProcess,

        [in]                            unsigned long cOidsToBeAdded,    // can be zero
        [in, size_is(cOidsToBeAdded)]   OXID_OID_PAIR aOidsToBeAdded[],
        [out, size_is(cOidsToBeAdded)]  long          aStatusOfAdds[],

        [in]                            unsigned long cOidsToBeRemoved,  // can be zero
        [in, size_is(cOidsToBeRemoved)] OID_MID_PAIR  aOidsToBeRemoved[],

        [in]                            unsigned long cServerOidsToFree, // can be zero
        [in, size_is(cServerOidsToFree)] OID          aServerOids[],

        [in]                            unsigned long cOxidsToFree,      // can be zero
        [in, size_is(cOxidsToFree)]     OXID_REF      aOxidsToFree[]
        );

    //////////////////////////////////////////////////
    ////////// Client specific APIs

    // Clients to remote OXIDs call this to lookup the OXID_INFO for an oxid.

    // psaRemoteOrBindings - compressed string bindings from the long
    // form of the marshalled interface (if any).

    // pwstrBindingToServer - expanded string binding to the client which
    // passed the IN interface pointer to the server.

    error_status_t
    ClientResolveOXID
        (
        [in]         handle_t     hServer,
        [in]         PHPROCESS    phProcess,
        [in, ref]    OXID        *poxidServer,
        // [in, ref]    MID         *pMidHint,
        [in, unique] DUALSTRINGARRAY *pssaServerObjectResolverBindings,
        [in]         long         fApartment,
        [out, ref]   OXID_INFO   *poxidInfo,  // Contains a single expanded stringbinding + security bindings
        [out]        MID         *pLocalMidOfRemote
        );

    //////////////////////////////////////////////////
    //////////////// Server specific APIs

    // Called to register an OXID and associated information. The server may
    // simultaneously register a number of OIDs.

    error_status_t
    ServerAllocateOXIDAndOIDs
        (
        [in]                  handle_t          hServer,
        [in]                  PHPROCESS         phProcess,
        [out, ref]            OXID                 *poxidServer,
        [in]                  long              fApartment,
        [in]                  unsigned long     cOids,
        [out, size_is(cOids)] OID               aOid[],
        [out]                 unsigned long    *pcOidsAllocated,
        [in, ref]             OXID_INFO        *poxidInfo, // no strings
        [in, unique]          DUALSTRINGARRAY  *pdsaStringBindings, // Expanded, NULL if not changed
        [in, unique]          DUALSTRINGARRAY  *pdsaSecurityBindings // Compressed, NULL if not first OXID for process.
        );


    // Server calls this to register additional OIDs with the ping server.
    error_status_t
    ServerAllocateOIDs
        (
        [in]                  handle_t        hServer,
        [in]                  PHPROCESS       phProcess,
        [in, ref]             OXID               *poxidServer,
        [in]                  unsigned long   cOids,
        [out, size_is(cOids)] OID             aOid[],
        [out]                 unsigned long  *pcOidsAllocated
        );

    // Called when a particular OXID is being removed. This is only
    // necessary if the server may continue running but is destroying
    // a thead (apartment model) or is unloading com.
    // The unused oids are used as a hint for cleaning up object resolver
    // faster.
    error_status_t ServerFreeOXIDAndOIDs
        (
        [in] handle_t   hServer,
        [in] PHPROCESS phProcess,
        [in] OXID oxidServer,
        [in] unsigned long cOids,
        [in, size_is(cOids)] OID aOids[]
        );
}