+
+ void exception_to_array(::System::VStruct *ex, Array<uint8_t> *ar)
+ {
+ // FIXME: marshall struct
+ }
+
+ void handle_message(ParamInfoBlock *pib)
+ {
+ Message *msg = reinterpret_cast<Message *>(pib->segments[0].ptr);
+
+ switch (msg->seg0.opcode) {
+ case Segment0::InvokeMethod: {
+ if (pib->segments[0].len < sizeof(InvokeMethod))
+ throw_idl(ShortMessage, 0, pib->segments[0].len,
+ sizeof(InvokeMethod));
+
+// ID obj = pib->objlist[0];
+ break;
+ }
+
+ default:
+ throw_idl(InvalidOpcode, msg->seg0.opcode);
+ }
+ }
+ }
+}}
+
+extern "C" void abort();
+
+extern "C" void handle_message(::System::RunTime::ParamInfoBlock *pib,
+ ::System::RunTime::Array<uint8_t> *ex_arr)
+{
+ try {
+ ::System::RunTime::Priv::handle_message(pib);
+ }
+
+ catch (::System::Exceptions::Exception &ex) {
+ ::System::RunTime::Priv::exception_to_array(&ex, ex_arr);
+ }
+
+ catch (...) {
+ abort();