ndr: Add ndr_ntprinting_string_flags() function.
authorAndreas Schneider <asn@samba.org>
Mon, 11 Mar 2013 14:45:15 +0000 (15:45 +0100)
committerKarolin Seeger <kseeger@samba.org>
Fri, 26 Apr 2013 07:25:01 +0000 (09:25 +0200)
It defaults to utf8string.

Reviewed-by: Günther Deschner <gd@samba.org>
(cherry picked from commit 6abfeb7d806e40c932f09f0323f20535b54a5613)

librpc/ndr/ndr_ntprinting.c
librpc/ndr/ndr_ntprinting.h

index 76b296d169b68395bb972c0c0ae1ea8aab3e8ddd..8d392b0c1dd686c34f72526738c3de19c8190778 100644 (file)
 #include "includes.h"
 #include "../librpc/gen_ndr/ndr_ntprinting.h"
 
+_PUBLIC_ uint32_t ndr_ntprinting_string_flags(uint32_t string_flags)
+{
+       uint32_t flags = LIBNDR_FLAG_STR_NULLTERM;
+
+       if (string_flags & LIBNDR_FLAG_STR_ASCII) {
+               flags |= LIBNDR_FLAG_STR_ASCII;
+       } else {
+               flags |= LIBNDR_FLAG_STR_UTF8;
+       }
+
+       return flags;
+}
+
 _PUBLIC_ enum ndr_err_code ndr_pull_ntprinting_printer(struct ndr_pull *ndr, int ndr_flags, struct ntprinting_printer *r)
 {
        uint32_t _ptr_devmode;
index 8bda430438ff3497f65f3ccb4e8aa80c0953af33..3b6ee0146065a85c421234fadbd0bd5fbab21681 100644 (file)
@@ -22,4 +22,6 @@
 #include "includes.h"
 #include "../librpc/gen_ndr/ndr_ntprinting.h"
 
+_PUBLIC_ uint32_t ndr_ntprinting_string_flags(uint32_t string_flags);
+
 _PUBLIC_ enum ndr_err_code ndr_pull_ntprinting_printer(struct ndr_pull *ndr, int ndr_flags, struct ntprinting_printer *r);