summaryrefslogtreecommitdiff
path: root/librpc/ndr/ndr_wmi.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-10-20 16:38:25 -0700
committerJeremy Allison <jra@samba.org>2008-10-20 16:38:25 -0700
commit29c9b88e2bb5d3f585e7aa591870e8b39a0d23c9 (patch)
tree761e1b6c8172470d651c7760806ce5081f5ee55f /librpc/ndr/ndr_wmi.c
parent6aba3516769b944e7960d27f10799bb8a8898d2d (diff)
parentcefe4c66970b8ca243595cdb940a7c1a26765a08 (diff)
downloadsamba-29c9b88e2bb5d3f585e7aa591870e8b39a0d23c9.tar.gz
samba-29c9b88e2bb5d3f585e7aa591870e8b39a0d23c9.tar.bz2
samba-29c9b88e2bb5d3f585e7aa591870e8b39a0d23c9.zip
Merge branch 'master' of ssh://jra@git.samba.org/data/git/samba
Diffstat (limited to 'librpc/ndr/ndr_wmi.c')
-rw-r--r--librpc/ndr/ndr_wmi.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/librpc/ndr/ndr_wmi.c b/librpc/ndr/ndr_wmi.c
new file mode 100644
index 0000000000..2c122decf4
--- /dev/null
+++ b/librpc/ndr/ndr_wmi.c
@@ -0,0 +1,60 @@
+/*
+ Unix SMB/CIFS implementation.
+
+ routines for marshalling/unmarshalling DCOM string arrays
+
+ Copyright (C) Jelmer Vernooij 2004
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+//#define NDR_CHECK_DEBUG
+#include "includes.h"
+#include "librpc/gen_ndr/ndr_dcom.h"
+#include "librpc/gen_ndr/ndr_wmi.h"
+#include "librpc/ndr/ndr_wmi.h"
+
+// Just for debugging
+int NDR_CHECK_depth = 0;
+int NDR_CHECK_shift = 0x18;
+
+enum ndr_err_code ndr_push_BSTR(struct ndr_push *ndr, int ndr_flags, const struct BSTR *r)
+{
+ uint32_t len;
+ uint32_t flags;
+ enum ndr_err_code status;
+ len = strlen(r->data);
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0x72657355));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, len));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 2*len));
+ flags = ndr->flags;
+ ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NOTERM | LIBNDR_FLAG_STR_SIZE4);
+ status = ndr_push_string(ndr, NDR_SCALARS, r->data);
+ ndr->flags = flags;
+ return status;
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+enum ndr_err_code ndr_pull_BSTR(struct ndr_pull *ndr, int ndr_flags, struct BSTR *r)
+{
+ return NDR_ERR_BAD_SWITCH;
+}
+
+void ndr_print_BSTR(struct ndr_print *ndr, const char *name, const struct BSTR *r)
+{
+ ndr->print(ndr, "%-25s: BSTR(\"%s\")", name, r->data);
+}