summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/Python.pm16
1 files changed, 8 insertions, 8 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm b/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm
index 31b06d16b8..2475925377 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm
@@ -642,12 +642,12 @@ sub ConvertObjectFromPythonData($$$$$$)
if ($actual_ctype->{TYPE} eq "SCALAR" and $actual_ctype->{NAME} eq "NTSTATUS") {
- $self->pidl("$target = PyInt_AsLong($cvar);");
+ $self->pidl("$target = NT_STATUS(PyInt_AsLong($cvar));");
return;
}
if ($actual_ctype->{TYPE} eq "SCALAR" and $actual_ctype->{NAME} eq "WERROR") {
- $self->pidl("$target = PyInt_AsLong($cvar);");
+ $self->pidl("$target = W_ERROR(PyInt_AsLong($cvar));");
return;
}
@@ -690,16 +690,16 @@ sub ConvertObjectFromPythonLevel($$$$$$$$)
$self->pidl("}");
}
} elsif ($l->{TYPE} eq "ARRAY") {
+ my $pl = GetPrevLevel($e, $l);
+ if ($pl && $pl->{TYPE} eq "POINTER") {
+ $var_name = get_pointer_to($var_name);
+ }
+
if (is_charset_array($e, $l)) {
$self->pidl("PY_CHECK_TYPE(PyUnicode, $py_var, $fail);");
# FIXME: Use Unix charset setting rather than utf-8
- $self->pidl(get_pointer_to($var_name) . " = PyString_AsString(PyUnicode_AsEncodedString($py_var, \"utf-8\", \"ignore\"));");
+ $self->pidl($var_name . " = PyString_AsString(PyUnicode_AsEncodedString($py_var, \"utf-8\", \"ignore\"));");
} else {
- my $pl = GetPrevLevel($e, $l);
- if ($pl && $pl->{TYPE} eq "POINTER") {
- $var_name = get_pointer_to($var_name);
- }
-
my $counter = "$e->{NAME}_cntr_$l->{LEVEL_INDEX}";
$self->pidl("PY_CHECK_TYPE(PyList, $py_var, $fail);");
$self->pidl("{");