1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-03 04:22:09 +03:00

r9339: treat arrays of uint8 values as a special DATA_BLOB type in the ejs

interfaces to RPC. This makes large blobs of data much saner. Tim, you
will probably want to do the same for the smb_interfaces.h generated
code.

Next we will need ways of extracting different data types from these
blobs, for example asking for the blob to be interpreted as a utf16
string, or as a little-endian integer. That will allow for registry
scripting to be quite sane.
(This used to be commit a8bca2e8e2)
This commit is contained in:
Andrew Tridgell
2005-08-17 01:29:35 +00:00
committed by Gerald (Jerry) Carter
parent 9fffd12799
commit ba6d3075bc
4 changed files with 88 additions and 3 deletions

View File

@ -317,6 +317,31 @@ struct MprVar mprNTSTATUS(NTSTATUS status)
return res;
}
/*
create a data-blob in a mpr variable
*/
struct MprVar mprDataBlob(DATA_BLOB blob)
{
struct MprVar res;
struct data_blob *pblob = talloc(mprMemCtx(), struct data_blob);
*pblob = data_blob_talloc(pblob, blob.data, blob.length);
res = mprObject("DATA_BLOB");
mprSetVar(&res, "size", mprCreateIntegerVar(blob.length));
mprSetPtrChild(&res, "blob", pblob);
return res;
}
/*
return a data blob from a mpr var created using mprDataBlob
*/
struct data_blob *mprToDataBlob(struct MprVar *v)
{
return talloc_get_type(mprGetPtr(v, "blob"), struct data_blob);
}
/*
turn a WERROR into a MprVar object with lots of funky properties
*/