summaryrefslogtreecommitdiff
path: root/source4/scripting/ejs
diff options
context:
space:
mode:
Diffstat (limited to 'source4/scripting/ejs')
-rw-r--r--source4/scripting/ejs/ejsrpc.c17
-rw-r--r--source4/scripting/ejs/ejsrpc.h8
2 files changed, 25 insertions, 0 deletions
diff --git a/source4/scripting/ejs/ejsrpc.c b/source4/scripting/ejs/ejsrpc.c
index a0fee2efe7..c84f9eb6fb 100644
--- a/source4/scripting/ejs/ejsrpc.c
+++ b/source4/scripting/ejs/ejsrpc.c
@@ -133,6 +133,23 @@ NTSTATUS ejs_push_int32(struct ejs_rpc *ejs,
return mprSetVar(v, name, mprCreateIntegerVar(*r));
}
+/*
+ pull a uint32 from a mpr variable to a C element
+*/
+NTSTATUS ejs_pull_time_t(struct ejs_rpc *ejs,
+ struct MprVar *v, const char *name, time_t *r)
+{
+ NDR_CHECK(mprGetVar(&v, name));
+ *r = mprVarToInteger(v);
+ return NT_STATUS_OK;
+}
+
+NTSTATUS ejs_push_time_t(struct ejs_rpc *ejs,
+ struct MprVar *v, const char *name, const time_t *r)
+{
+ return mprSetVar(v, name, mprCreateIntegerVar(*r));
+}
+
NTSTATUS ejs_pull_hyper(struct ejs_rpc *ejs,
struct MprVar *v, const char *name, uint64_t *r)
{
diff --git a/source4/scripting/ejs/ejsrpc.h b/source4/scripting/ejs/ejsrpc.h
index d710ff375c..80674fc43b 100644
--- a/source4/scripting/ejs/ejsrpc.h
+++ b/source4/scripting/ejs/ejsrpc.h
@@ -78,6 +78,10 @@ NTSTATUS ejs_pull_NTTIME(struct ejs_rpc *ejs,
struct MprVar *v, const char *name, uint64_t *r);
NTSTATUS ejs_push_NTTIME(struct ejs_rpc *ejs,
struct MprVar *v, const char *name, const uint64_t *r);
+NTSTATUS ejs_pull_time_t(struct ejs_rpc *ejs,
+ struct MprVar *v, const char *name, time_t *r);
+NTSTATUS ejs_push_time_t(struct ejs_rpc *ejs,
+ struct MprVar *v, const char *name, const time_t *r);
NTSTATUS ejs_pull_enum(struct ejs_rpc *ejs,
struct MprVar *v, const char *name, unsigned *r);
NTSTATUS ejs_push_enum(struct ejs_rpc *ejs,
@@ -149,6 +153,10 @@ NTSTATUS ejs_push_winreg_String(struct ejs_rpc *ejs,
/* some types are equivalent for ejs */
#define ejs_pull_dom_sid2 ejs_pull_dom_sid
#define ejs_push_dom_sid2 ejs_push_dom_sid
+#define ejs_pull_dom_sid28 ejs_pull_dom_sid
+#define ejs_push_dom_sid28 ejs_push_dom_sid
#define ejs_pull_NTTIME_hyper ejs_pull_NTTIME
#define ejs_push_NTTIME_hyper ejs_push_NTTIME
+#define ejs_pull_NTTIME_1sec ejs_pull_NTTIME
+#define ejs_push_NTTIME_1sec ejs_push_NTTIME