// constructs a DB_LOCKREQ instance based on this instance and an // externally (in unmanaged memory) allocated DBT and byte buffer; // bufp *must* point to memory large enough to hold obj.Size bytes internal unsafe DB_LOCKREQ PrepareLockReq(DBT *dbt, ref byte *bufp) { DB_LOCKREQ dblr = new DB_LOCKREQ((DB_LOCKOP)op, (DB_LOCKMODE)mode, unchecked ((uint)timeout), (IntPtr)dbt, lck.dblck); dbt->data = bufp; dbt->size = obj.dbt.size; dbt->flags = DBT.DB_DBT_USERMEM; if (bufp != null) { Marshal.Copy(obj.Buffer, obj.Start, (IntPtr)bufp, obj.Size); } bufp += obj.dbt.size; return(dblr); }
// constructs a DB_LOCKREQ instance based on this instance and an // externally (in unmanaged memory) allocated DBT and byte buffer; // bufp *must* point to memory large enough to hold obj.Size bytes internal unsafe DB_LOCKREQ PrepareLockReq(DBT* dbt, ref byte* bufp) { DB_LOCKREQ dblr = new DB_LOCKREQ((DB_LOCKOP)op, (DB_LOCKMODE)mode, unchecked((uint)timeout), (IntPtr)dbt, lck.dblck); dbt->data = bufp; dbt->size = obj.dbt.size; dbt->flags = DBT.DB_DBT_USERMEM; if (bufp != null) Marshal.Copy(obj.Buffer, obj.Start, (IntPtr)bufp, obj.Size); bufp += obj.dbt.size; return dblr; }