From fb16ac229beb9ce9d37b49ab6cb630d60c95ee9e Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 2 Sep 2009 21:25:32 +0200 Subject: s3-registry: support REG_QWORD. Guenther --- source3/lib/util_reg_api.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'source3/lib') diff --git a/source3/lib/util_reg_api.c b/source3/lib/util_reg_api.c index 1616d24107..4347e5d6ed 100644 --- a/source3/lib/util_reg_api.c +++ b/source3/lib/util_reg_api.c @@ -45,6 +45,13 @@ WERROR registry_pull_value(TALLOC_CTX *mem_ctx, } value->v.dword = IVAL(data, 0); break; + case REG_QWORD: + if ((size != 8) || (length != 8)) { + err = WERR_INVALID_PARAM; + goto error; + } + value->v.qword = BVAL(data, 0); + break; case REG_SZ: case REG_EXPAND_SZ: { @@ -84,7 +91,6 @@ WERROR registry_pull_value(TALLOC_CTX *mem_ctx, memcpy((void *)tmp, (const void *)data, length); tmp[num_ucs2] = 0; } - if (length + 2 < length) { /* Integer wrap. */ SAFE_FREE(tmp); @@ -154,6 +160,15 @@ WERROR registry_push_value(TALLOC_CTX *mem_ctx, } break; } + case REG_QWORD: { + char buf[8]; + SBVAL(buf, 0, value->v.qword); + *presult = data_blob_talloc(mem_ctx, (void *)buf, 8); + if (presult->data == NULL) { + return WERR_NOMEM; + } + break; + } case REG_SZ: case REG_EXPAND_SZ: { if (!push_reg_sz(mem_ctx, presult, value->v.sz.str)) -- cgit