1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-28 11:42:03 +03:00

Merge of cleanups and srvsvc implementation from HEAD.

This commit is contained in:
Tim Potter
-
parent efc9269780
commit dbea592877
20 changed files with 222 additions and 255 deletions

View File

@ -18,8 +18,6 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "includes.h"
#include "Python.h"
#include "py_conv.h"
/* Helper for rpcstr_pull() function */
@ -29,6 +27,11 @@ static void fstr_pull(fstring str, UNISTR *uni)
rpcstr_pull(str, uni->buffer, sizeof(fstring), -1, STR_TERMINATE);
}
static void fstr_pull2(fstring str, UNISTR2 *uni)
{
rpcstr_pull(str, uni->buffer, sizeof(fstring), -1, STR_TERMINATE);
}
/* Convert a structure to a Python dict */
PyObject *from_struct(void *s, struct pyconv *conv)
@ -52,6 +55,18 @@ PyObject *from_struct(void *s, struct pyconv *conv)
break;
}
case PY_UNISTR2: {
UNISTR2 *u = (UNISTR2 *)((char *)s + conv[i].offset);
fstring str = "";
if (u->buffer)
fstr_pull2(str, u);
item = PyString_FromString(str);
PyDict_SetItemString(obj, conv[i].name, item);
break;
}
case PY_UINT32: {
uint32 *u = (uint32 *)((char *)s + conv[i].offset);