//int rpc_port_stub_add_received_event_cb(rpc_port_stub_h h, rpc_port_stub_received_event_cb cb, void* data);
[DllImport(Libraries.RpcPort, EntryPoint = "rpc_port_stub_add_received_event_cb")]
internal static extern int AddReceivedEventCb(IntPtr handle, ReceivedEventCallback cb, IntPtr data);
+
+ //int rpc_port_stub_add_privilege(rpc_port_stub_h h, const char *privilege);
+ [DllImport(Libraries.RpcPort, EntryPoint = "rpc_port_stub_add_privilege")]
+ internal static extern int AddPrivilege(IntPtr handle, string privilege);
}
\ No newline at end of file
" Interop.LibRPCPort.Stub.Create(out _stub, \"$$\");\n" \
" Interop.LibRPCPort.Stub.AddReceivedEventCb(_stub, OnReceivedEvent, IntPtr.Zero);\n" \
" Interop.LibRPCPort.Stub.AddConnectedEventCb(_stub, OnConnectedEvent, IntPtr.Zero);\n" \
- " Interop.LibRPCPort.Stub.AddDisconnectedEventCb(_stub, OnDisconnectedEvent, IntPtr.Zero);\n" \
- "}\n";
+ " Interop.LibRPCPort.Stub.AddDisconnectedEventCb(_stub, OnDisconnectedEvent, IntPtr.Zero);\n";
GenTemplate(AddIndent(TAB_SIZE * 3, ctor), stream,
[&]()->std::string {
return iface.GetID();
}
);
- stream << NLine(1);
+
+ for (auto& i : iface.GetAttributes().GetAttrs()) {
+ if (i->GetKey() == "privilege") {
+ stream << Tab(4) << "Interop.LibRPCPort.Stub.AddPrivilege(_stub, \""
+ << i->GetValue() << "\");" << NLine(1);
+ }
+ }
+ stream << Tab(3) << "}" << NLine(2);
}
void CsStubGen::GenCommonMethods(std::ofstream& stream) {