eax: pointer to exception, or NULL if none
edx: length of exception segment, if any
-GUID hash retrieval:
+GUID SHA-1 hash retrieval:
eax: object id
- edx: 16-byte buffer
+ edx: 20-byte buffer
Call the 32-bit address stored at 0x7fff000c.
Object references are encoded as pointer-sized offsets into the
objlist array.
+Virtual structs are prefaced with a header, which consists of
+the following, in order:
+1. 128-bit GUID of the most derived vstruct type
+2. 160-bit SHA-1 of the vstruct type info
+3. 32-bit objlist-offset of an introspection object
+4. 32-bit length of vstruct, including header, and all referenced
+data chunks, which must be contiguously appended to the vstruct body
+5. 32-bit reserved field
+
+The requirement for all referenced data chunks to be contiguous with
+the vstruct means that scatter-gather and zero-copy cannot be done;
+however, it prevents the loss of derived-type data when only a base
+type is known at unmarshalling time (the derived-type data could
+later be accessed through introspection, or be passed to another
+process that does know the derived type). For this reason, vstructs
+should generally not be used to pass large chunks of data.
+
+The introspection object reference may be NULL; in this case, the
+SHA-1 field is ignored.
+
Op1: Get Interface List
-----------------------
struct NewObject {
- u32 guid_hash[4]; // Interface GUID checksum
+ u32 guid_hash[5]; // SHA-1 hash of Interface GUIDs
u32 id; // Filled in by ORB
u32 reserved[3]; // must be zero
};
#ifndef _UTIL_ASSERT_H
#define _UTIL_ASSERT_H
+#ifndef _UTIL_ASSERT_LEVEL
+#define _UTIL_ASSERT_LEVEL 1
+#endif
+
namespace Assert {
enum {
Always = 0,
#include <stddef.h>
#include <stdint.h>
-
#include <lowlevel/bitops.h>
namespace Util {
// This function could be made to do a binary search if we can
// manage to somehow sort the IFaceTables...
-
uintptr_t downcast(::System::_i_Object *obj,
const unsigned long *new_guid)
{
return ptr;
};
-
namespace Priv {
typedef void (*MethodEntry)(ParamInfoBlock *pib);
void *ptr; // pointer to the class interface
};
- typedef Util::RadixTree<Object, ID, 6> ObjTable;
+ typedef ::Util::RadixTree<Object, ID, 6> ObjTable;
ObjTable objtable;
unsigned long get_pc()
void exception_to_array(::System::VStruct *ex, Array<uint8_t> *ar)
{
- // FIXME
-// ar->ptr = reinterpret_cast<uint8_t *>(ex);
-// ar->count = ex->_infoptr->structlen;
+ // FIXME: marshall struct
}
void handle_message(ParamInfoBlock *pib)
throw_idl(ShortMessage, 0, pib->segments[0].len,
sizeof(InvokeMethod));
- // ID obj = pib->objlist[0];
-
-
+// ID obj = pib->objlist[0];
break;
}
::System::RunTime::Priv::handle_message(pib);
}
- catch (::System::Exceptions::Exception *ex) {
- ::System::RunTime::Priv::exception_to_array(ex, ex_arr);
+ catch (::System::Exceptions::Exception &ex) {
+ ::System::RunTime::Priv::exception_to_array(&ex, ex_arr);
}
catch (...) {