Finish removal of iconv_convenience in public API's.
[samba.git] / source4 / smb_server / blob.c
index bd250361a402d0cebe00dcd15ac21baa101851e6..c17cde070d6b53845105edabc8088e5f8c435230 100644 (file)
 */
 
 #include "includes.h"
-#include "../lib/util/dlinklist.h"
 #include "smb_server/smb_server.h"
 #include "librpc/gen_ndr/ndr_misc.h"
-#include "ntvfs/ntvfs.h"
 #include "libcli/raw/libcliraw.h"
 #include "libcli/raw/raw_proto.h"
-#include "param/param.h"
 
 #define BLOB_CHECK(cmd) do { \
        NTSTATUS _status; \
@@ -140,10 +137,10 @@ size_t smbsrv_blob_push_string(TALLOC_CTX *mem_ctx,
                alignment = 1;
                if (dest_len > 0) {
                        SCVAL(blob->data + offset, 0, 0);
-                       ret = push_string(lp_iconv_convenience(global_loadparm), blob->data + offset + 1, str, dest_len-1, flags);
+                       ret = push_string(blob->data + offset + 1, str, dest_len-1, flags);
                }
        } else {
-               ret = push_string(lp_iconv_convenience(global_loadparm), blob->data + offset, str, dest_len, flags);
+               ret = push_string(blob->data + offset, str, dest_len, flags);
        }
 
        /* sometimes the string needs to be terminated, but the length
@@ -176,7 +173,7 @@ size_t smbsrv_blob_push_string(TALLOC_CTX *mem_ctx,
 NTSTATUS smbsrv_blob_append_string(TALLOC_CTX *mem_ctx,
                                   DATA_BLOB *blob,
                                   const char *str,
-                                  uint_t len_offset,
+                                  unsigned int len_offset,
                                   int default_flags,
                                   int flags)
 {
@@ -200,7 +197,7 @@ NTSTATUS smbsrv_push_passthru_fsinfo(TALLOC_CTX *mem_ctx,
                                     union smb_fsinfo *fsinfo,
                                     int default_str_flags)
 {
-       uint_t i;
+       unsigned int i;
        DATA_BLOB guid_blob;
 
        switch (level) {
@@ -275,15 +272,13 @@ NTSTATUS smbsrv_push_passthru_fsinfo(TALLOC_CTX *mem_ctx,
                return NT_STATUS_OK;
 
        case RAW_QFS_OBJECTID_INFORMATION: {
-               enum ndr_err_code ndr_err;
+               NTSTATUS status;
 
                BLOB_CHECK(smbsrv_blob_grow_data(mem_ctx, blob, 64));
 
-               ndr_err = ndr_push_struct_blob(&guid_blob, mem_ctx, NULL, 
-                                              &fsinfo->objectid_information.out.guid,
-                                              (ndr_push_flags_fn_t)ndr_push_GUID);
-               if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
-                       BLOB_CHECK(ndr_map_error2ntstatus(ndr_err));
+               status = GUID_to_ndr_blob(&fsinfo->objectid_information.out.guid, mem_ctx, &guid_blob);
+               if (!NT_STATUS_IS_OK(status)) {
+                       BLOB_CHECK(status);
                }
 
                memcpy(blob->data, guid_blob.data, guid_blob.length);
@@ -307,7 +302,7 @@ NTSTATUS smbsrv_push_passthru_fileinfo(TALLOC_CTX *mem_ctx,
                                       union smb_fileinfo *st,
                                       int default_str_flags)
 {
-       uint_t i;
+       unsigned int i;
        size_t list_size;
 
        switch (level) {
@@ -655,7 +650,7 @@ NTSTATUS smbsrv_push_passthru_search(TALLOC_CTX *mem_ctx,
                                     int default_str_flags)
 {
        uint8_t *data;
-       uint_t ofs = blob->length;
+       unsigned int ofs = blob->length;
 
        switch (level) {
        case RAW_SEARCH_DATA_DIRECTORY_INFO: