diff options
author | Tim Potter <tpot@samba.org> | 2004-10-16 00:19:33 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:59:56 -0500 |
commit | addb2a9fd45ad4df21f22d1b712e37ff0a5affd4 (patch) | |
tree | 50f2596749cf91304abe0408fd40d5f38eee3d60 /source4/scripting/swig | |
parent | 04767ce90619b5936c3a1e346a74a3293bbc9472 (diff) | |
download | samba-addb2a9fd45ad4df21f22d1b712e37ff0a5affd4.tar.gz samba-addb2a9fd45ad4df21f22d1b712e37ff0a5affd4.tar.bz2 samba-addb2a9fd45ad4df21f22d1b712e37ff0a5affd4.zip |
r3001: Expose unmarshalling functions for structures marked "public" in the
idl. This allows us to pass a buffer of bytes returned from a spoolss
call and convert it to a Python dictionary. Works for enumprinters level
1!
(This used to be commit 4bc497a2994b12845a46b2d19f60bb81c9869fc9)
Diffstat (limited to 'source4/scripting/swig')
-rw-r--r-- | source4/scripting/swig/dcerpc.i | 6 | ||||
-rw-r--r-- | source4/scripting/swig/torture/spoolss.py | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/source4/scripting/swig/dcerpc.i b/source4/scripting/swig/dcerpc.i index ab53a1dc51..1222d54766 100644 --- a/source4/scripting/swig/dcerpc.i +++ b/source4/scripting/swig/dcerpc.i @@ -346,6 +346,12 @@ NTSTATUS dcerpc_pipe_connect(struct dcerpc_pipe **OUT, const char *username, const char *password); +%typemap(in) DATA_BLOB * (DATA_BLOB temp_data_blob) { + temp_data_blob.data = PyString_AsString($input); + temp_data_blob.length = PyString_Size($input); + $1 = &temp_data_blob; +} + %include "librpc/gen_ndr/misc.i" %include "librpc/gen_ndr/lsa.i" %include "librpc/gen_ndr/samr.i" diff --git a/source4/scripting/swig/torture/spoolss.py b/source4/scripting/swig/torture/spoolss.py index 78d573a7cd..e29178a0b6 100644 --- a/source4/scripting/swig/torture/spoolss.py +++ b/source4/scripting/swig/torture/spoolss.py @@ -11,7 +11,7 @@ def test_EnumPrinters(pipe): result = dcerpc.spoolss_EnumPrinters(pipe, r) - print result + print dcerpc.unmarshall_spoolss_PrinterInfo1(result['buffer']) def runtests(binding, domain, username, password): |