s3:srv_ntsvcs: use regval_ctr/blob accessor functions
authorMichael Adam <obnox@samba.org>
Mon, 24 May 2010 12:06:20 +0000 (14:06 +0200)
committerMichael Adam <obnox@samba.org>
Tue, 25 May 2010 08:35:29 +0000 (10:35 +0200)
source3/rpc_server/srv_ntsvcs_nt.c

index c7fd3ccc89f777ae82dbfa5bf6cea5a2c0d4bbb5..ebe117db42f475d93835a9530ae88eca7bc189d9 100644 (file)
@@ -149,22 +149,22 @@ WERROR _PNP_GetDeviceRegProp(pipes_struct *p,
                        return WERR_GENERAL_FAILURE;
                }
 
-               if (*r->in.buffer_size < val->size) {
-                       *r->out.needed = val->size;
+               if (*r->in.buffer_size < regval_size(val)) {
+                       *r->out.needed = regval_size(val);
                        *r->out.buffer_size = 0;
                        TALLOC_FREE( values );
                        return WERR_CM_BUFFER_SMALL;
                }
 
-               r->out.buffer = (uint8_t *)talloc_memdup(p->mem_ctx, val->data_p, val->size);
+               r->out.buffer = (uint8_t *)talloc_memdup(p->mem_ctx, regval_data_p(val), regval_size(val));
                TALLOC_FREE(values);
                if (!r->out.buffer) {
                        return WERR_NOMEM;
                }
 
                *r->out.reg_data_type = REG_SZ; /* always 1...tested using a remove device manager connection */
-               *r->out.buffer_size = val->size;
-               *r->out.needed = val->size;
+               *r->out.buffer_size = regval_size(val);
+               *r->out.needed = regval_size(val);
 
                break;