diff options
author | Günther Deschner <gd@samba.org> | 2009-09-24 11:30:45 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2009-09-30 00:29:56 +0200 |
commit | a50cc61ee6bc973f913a8c26a082ae99f63091db (patch) | |
tree | 90a462efe78c5d0b424def11f363cdff356b27ec | |
parent | 2c11b73391551723e4ada8664b1ba77873420217 (diff) | |
download | samba-a50cc61ee6bc973f913a8c26a082ae99f63091db.tar.gz samba-a50cc61ee6bc973f913a8c26a082ae99f63091db.tar.bz2 samba-a50cc61ee6bc973f913a8c26a082ae99f63091db.zip |
s3-registry: add regval_ctr_addvalue_sz.
Guenther
-rw-r--r-- | source3/include/proto.h | 1 | ||||
-rw-r--r-- | source3/registry/reg_objects.c | 17 |
2 files changed, 18 insertions, 0 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index 328145b8f7..0335876b7f 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -5117,6 +5117,7 @@ struct regval_blob *regval_compose(TALLOC_CTX *ctx, const char *name, const char *data_p, size_t size); int regval_ctr_addvalue(struct regval_ctr *ctr, const char *name, uint16 type, const char *data_p, size_t size); +int regval_ctr_addvalue_sz(struct regval_ctr *ctr, const char *name, const char *data); int regval_ctr_copyvalue(struct regval_ctr *ctr, struct regval_blob *val); int regval_ctr_delvalue(struct regval_ctr *ctr, const char *name); struct regval_blob* regval_ctr_getvalue(struct regval_ctr *ctr, diff --git a/source3/registry/reg_objects.c b/source3/registry/reg_objects.c index 0c0455aada..908cda5d2e 100644 --- a/source3/registry/reg_objects.c +++ b/source3/registry/reg_objects.c @@ -490,6 +490,23 @@ int regval_ctr_addvalue(struct regval_ctr *ctr, const char *name, uint16 type, } /*********************************************************************** + Add a new registry SZ value to the array + **********************************************************************/ + +int regval_ctr_addvalue_sz(struct regval_ctr *ctr, const char *name, const char *data) +{ + DATA_BLOB blob; + + if (!push_reg_sz(ctr, &blob, data)) { + return -1; + } + + return regval_ctr_addvalue(ctr, name, REG_SZ, + (const char *)blob.data, + blob.length); +} + +/*********************************************************************** Add a new registry value to the array **********************************************************************/ |