s3-spoolss: Added more winreg hepler functions.
authorAndreas Schneider <asn@samba.org>
Wed, 21 Apr 2010 16:12:50 +0000 (18:12 +0200)
committerGünther Deschner <gd@samba.org>
Fri, 23 Apr 2010 14:23:48 +0000 (16:23 +0200)
Signed-off-by: Günther Deschner <gd@samba.org>
source3/rpc_server/srv_spoolss_util.c

index 79af761b0dfdeb3eab36c5c12517e4e508b9234d..a20a772f57b8c763cbe974e188a03b9a54057b07 100644 (file)
@@ -1058,6 +1058,26 @@ static WERROR winreg_enumval_to_multi_sz(TALLOC_CTX *mem_ctx,
        return WERR_OK;
 }
 
+static WERROR winreg_enumval_to_blob(TALLOC_CTX *mem_ctx,
+                                    struct spoolss_PrinterEnumValues *v,
+                                    const char *valuename,
+                                    DATA_BLOB *blob)
+{
+       /* just return if it is not the one we are looking for */
+       if (strcmp(valuename, v->value_name) != 0) {
+               return WERR_NOT_FOUND;
+       }
+
+       if (v->type != REG_BINARY) {
+               return WERR_INVALID_DATATYPE;
+       }
+
+       blob->data = v->data->data;
+       blob->length = v->data_length;
+
+       return WERR_OK;
+}
+
 /********************************************************************
  Public winreg function for spoolss
 ********************************************************************/