diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-08-05 23:01:57 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:31:23 -0500 |
commit | 31fa87f23b68785665411ab49dee5f920b239a5c (patch) | |
tree | 335ea5f8176a3f8293f17183790581dd2e319aa2 | |
parent | d87e1306c5cbfcbcd80d3f527aa4412aedfb9dcf (diff) | |
download | samba-31fa87f23b68785665411ab49dee5f920b239a5c.tar.gz samba-31fa87f23b68785665411ab49dee5f920b239a5c.tar.bz2 samba-31fa87f23b68785665411ab49dee5f920b239a5c.zip |
r9146: - enable winreg pipe from ejs
- map the result code from rpc calls into the ejs objects
- treat winreg_String like lsa_String, hiding the length elements
(This used to be commit 2f6311c9a34db46f9a4b1f31e865a373b15702bf)
-rw-r--r-- | source4/build/pidl/Parse/Pidl/Samba/EJS.pm | 5 | ||||
-rw-r--r-- | source4/librpc/config.mk | 9 | ||||
-rw-r--r-- | source4/librpc/idl/winreg.idl | 2 | ||||
-rw-r--r-- | source4/scripting/ejs/ejsrpc.c | 31 | ||||
-rw-r--r-- | source4/scripting/ejs/ejsrpc.h | 4 |
5 files changed, 49 insertions, 2 deletions
diff --git a/source4/build/pidl/Parse/Pidl/Samba/EJS.pm b/source4/build/pidl/Parse/Pidl/Samba/EJS.pm index c528e13a52..415ca584b5 100644 --- a/source4/build/pidl/Parse/Pidl/Samba/EJS.pm +++ b/source4/build/pidl/Parse/Pidl/Samba/EJS.pm @@ -628,6 +628,11 @@ sub EjsPushFunction($) EjsPushElementTop($e, $env); } + if ($d->{RETURN_TYPE}) { + my $t = $d->{RETURN_TYPE}; + pidl "NDR_CHECK(ejs_push_$t(ejs, v, \"result\", &r->out.result));"; + } + pidl "return NT_STATUS_OK;"; deindent; pidl "}\n"; diff --git a/source4/librpc/config.mk b/source4/librpc/config.mk index 665c0920d7..356fb38bf2 100644 --- a/source4/librpc/config.mk +++ b/source4/librpc/config.mk @@ -623,6 +623,12 @@ OBJ_FILES = librpc/gen_ndr/ndr_winreg_ejs.o REQUIRED_SUBSYSTEMS = RPC NDR_WINREG NOPROTO = YES +[SUBSYSTEM::RPC_EJS_INITSHUTDOWN] +INIT_FUNCTION = ejs_init_initshutdown +OBJ_FILES = librpc/gen_ndr/ndr_initshutdown_ejs.o +REQUIRED_SUBSYSTEMS = RPC NDR_INITSHUTDOWN +NOPROTO = YES + [SUBSYSTEM::RPC_EJS_NETLOGON] INIT_FUNCTION = ejs_init_netlogon OBJ_FILES = librpc/gen_ndr/ndr_netlogon_ejs.o @@ -645,6 +651,7 @@ NOPROTO = YES # Start SUBSYSTEM RPC_EJS [SUBSYSTEM::RPC_EJS] REQUIRED_SUBSYSTEMS = RPC_EJS_ECHO RPC_EJS_MISC RPC_EJS_SAMR RPC_EJS_SECURITY \ - RPC_EJS_LSA RPC_EJS_SRVSVC RPC_EJS_SVCCTL RPC_EJS_IRPC + RPC_EJS_LSA RPC_EJS_SRVSVC RPC_EJS_SVCCTL RPC_EJS_IRPC RPC_EJS_WINREG \ + RPC_EJS_INITSHUTDOWN # End SUBSYSTEM RPC_EJS ################################################ diff --git a/source4/librpc/idl/winreg.idl b/source4/librpc/idl/winreg.idl index 1f31d17f8c..a6caf22b9b 100644 --- a/source4/librpc/idl/winreg.idl +++ b/source4/librpc/idl/winreg.idl @@ -14,7 +14,7 @@ depends(lsa,initshutdown) ] interface winreg { - typedef struct { + typedef [public,noejs] struct { [value(strlen_m_term(name)*2)] uint16 name_len; [value(strlen_m_term(name)*2)] uint16 name_size; unistr *name; diff --git a/source4/scripting/ejs/ejsrpc.c b/source4/scripting/ejs/ejsrpc.c index f3abc3c34a..f107c84b73 100644 --- a/source4/scripting/ejs/ejsrpc.c +++ b/source4/scripting/ejs/ejsrpc.c @@ -25,6 +25,7 @@ #include "scripting/ejs/smbcalls.h" #include "librpc/gen_ndr/ndr_security.h" #include "librpc/gen_ndr/ndr_lsa.h" +#include "librpc/gen_ndr/ndr_winreg.h" #include "scripting/ejs/ejsrpc.h" /* @@ -182,6 +183,18 @@ NTSTATUS ejs_push_NTTIME(struct ejs_rpc *ejs, return ejs_push_hyper(ejs, v, name, r); } +NTSTATUS ejs_push_WERROR(struct ejs_rpc *ejs, + struct MprVar *v, const char *name, const WERROR *r) +{ + return ejs_push_string(ejs, v, name, win_errstr(*r)); +} + +NTSTATUS ejs_push_NTSTATUS(struct ejs_rpc *ejs, + struct MprVar *v, const char *name, const NTSTATUS *r) +{ + return ejs_push_string(ejs, v, name, nt_errstr(*r)); +} + /* pull a enum from a mpr variable to a C element @@ -292,6 +305,24 @@ NTSTATUS ejs_push_lsa_String(struct ejs_rpc *ejs, return ejs_push_string(ejs, v, name, r->string); } +/* + pull a winreg_String +*/ +NTSTATUS ejs_pull_winreg_String(struct ejs_rpc *ejs, + struct MprVar *v, const char *name, struct winreg_String *r) +{ + return ejs_pull_string(ejs, v, name, &r->name); +} + +/* + push a winreg_String +*/ +NTSTATUS ejs_push_winreg_String(struct ejs_rpc *ejs, + struct MprVar *v, const char *name, const struct winreg_String *r) +{ + return ejs_push_string(ejs, v, name, r->name); +} + NTSTATUS ejs_pull_DATA_BLOB(struct ejs_rpc *ejs, struct MprVar *v, const char *name, DATA_BLOB *r) { diff --git a/source4/scripting/ejs/ejsrpc.h b/source4/scripting/ejs/ejsrpc.h index 8bd735c739..99da0d35ea 100644 --- a/source4/scripting/ejs/ejsrpc.h +++ b/source4/scripting/ejs/ejsrpc.h @@ -95,6 +95,10 @@ NTSTATUS ejs_push_dom_sid(struct ejs_rpc *ejs, struct MprVar *v, const char *name, const struct dom_sid *r); NTSTATUS ejs_push_null(struct ejs_rpc *ejs, struct MprVar *v, const char *name); BOOL ejs_pull_null(struct ejs_rpc *ejs, struct MprVar *v, const char *name); +NTSTATUS ejs_push_WERROR(struct ejs_rpc *ejs, + struct MprVar *v, const char *name, const WERROR *r); +NTSTATUS ejs_push_NTSTATUS(struct ejs_rpc *ejs, + struct MprVar *v, const char *name, const NTSTATUS *r); NTSTATUS ejs_pull_DATA_BLOB(struct ejs_rpc *ejs, struct MprVar *v, const char *name, DATA_BLOB *r); NTSTATUS ejs_push_DATA_BLOB(struct ejs_rpc *ejs, |