2 Unix SMB/CIFS implementation.
4 endpoint server for the IRemoteActivation pipe
6 Copyright (C) Jelmer Vernooij 2004
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #include "rpc_server/dcerpc_server.h"
25 #include "rpc_server/common/common.h"
26 #include "librpc/gen_ndr/ndr_remact.h"
27 #include "librpc/gen_ndr/ndr_oxidresolver.h"
29 struct dcom_interface_pointer *dcom_interface_pointer_by_ipid(struct GUID *ipid)
38 static WERROR RemoteActivation(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct RemoteActivation *r)
40 struct CreateInstance *cr = NULL;
41 /*struct Release *ur;*/
42 struct dcom_interface_p *o = NULL;
45 /* FIXME: CoGetClassObject() */
46 /* FIXME: IClassFactory::CreateInstance() */
47 /* FIXME: IUnknown::Release() */
50 r->out.ServerVersion.MajorVersion = COM_MAJOR_VERSION;
51 r->out.ServerVersion.MinorVersion = COM_MINOR_VERSION;
53 r->out.AuthnHint = DCERPC_AUTH_LEVEL_DEFAULT;
54 r->out.pdsaOxidBindings = dcom_server_generate_dual_string(mem_ctx, dce_call);
56 /* FIXME: Loop thru given interfaces and set r->out.results and
57 * r->out.interfaces */
58 r->out.ifaces = talloc_array_p(mem_ctx, struct pMInterfacePointer, r->in.Interfaces);
59 r->out.results = talloc_array_p(mem_ctx, WERROR, r->in.Interfaces);
60 r->out.hr = cr->out.result;
62 for (i = 0; i < r->in.Interfaces; i++) {
63 struct QueryInterface rr;
64 rr.in.iid = &r->in.pIIDs[i];
65 dcom_IUnknown_QueryInterface(o, mem_ctx, &rr);
66 ZERO_STRUCT(r->out.ifaces[i]);
67 r->out.results[i] = rr.out.result;
72 ZERO_STRUCT(r->out.ipidRemUnknown);
78 NTSTATUS dcerpc_server_dcom_init(void)
81 status = dcerpc_server_IOXIDResolver_init();
82 if (NT_STATUS_IS_ERR(status)) {
86 status = dcerpc_server_IRemoteActivation_init();
87 if (NT_STATUS_IS_ERR(status)) {
94 /* include the generated boilerplate */
95 #include "librpc/gen_ndr/ndr_remact_s.c"