diff options
author | Günther Deschner <gd@samba.org> | 2016-09-23 17:11:27 +0200 |
---|---|---|
committer | Uri Simchoni <uri@samba.org> | 2016-09-26 20:24:18 +0200 |
commit | 2f4f9a086cfa7220663f69d15d27fe67e0a666e3 (patch) | |
tree | 43a2ccd13c8189157bcaea774f03bba2f690ffad /source3/rpc_client | |
parent | 56949a1c32fad6f1de387d37aaeb83b131cd0e14 (diff) | |
download | samba-2f4f9a086cfa7220663f69d15d27fe67e0a666e3.tar.gz |
s3-rpc_client: add spoolss_driver_version_to_qword()
Guenther
Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Diffstat (limited to 'source3/rpc_client')
-rw-r--r-- | source3/rpc_client/init_spoolss.c | 20 | ||||
-rw-r--r-- | source3/rpc_client/init_spoolss.h | 2 |
2 files changed, 22 insertions, 0 deletions
diff --git a/source3/rpc_client/init_spoolss.c b/source3/rpc_client/init_spoolss.c index b4e3daac8fc..14370d8c69c 100644 --- a/source3/rpc_client/init_spoolss.c +++ b/source3/rpc_client/init_spoolss.c @@ -94,6 +94,26 @@ bool spoolss_timestr_to_NTTIME(const char *str, /******************************************************************* ********************************************************************/ +bool spoolss_driver_version_to_qword(const char *str, + uint64_t *data) +{ + unsigned int v1, v2, v3, v4; + + if (sscanf(str, "%u.%u.%u.%u", &v1, &v2, &v3, &v4) != 4) { + return false; + } + + *data = ((uint64_t)(v1 & 0xFFFF) << 48) + + ((uint64_t)(v2 & 0xFFFF) << 32) + + ((uint64_t)(v3 & 0xFFFF) << 16) + + (uint64_t)(v4 & 0xFFFF); + + return true; +} + +/******************************************************************* + ********************************************************************/ + WERROR pull_spoolss_PrinterData(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob, union spoolss_PrinterData *data, diff --git a/source3/rpc_client/init_spoolss.h b/source3/rpc_client/init_spoolss.h index 10c899df29e..28dbb1b7b8b 100644 --- a/source3/rpc_client/init_spoolss.h +++ b/source3/rpc_client/init_spoolss.h @@ -27,6 +27,8 @@ bool init_systemtime(struct spoolss_Time *r, time_t spoolss_Time_to_time_t(const struct spoolss_Time *r); bool spoolss_timestr_to_NTTIME(const char *str, NTTIME *data); +bool spoolss_driver_version_to_qword(const char *str, + uint64_t *data); WERROR pull_spoolss_PrinterData(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob, union spoolss_PrinterData *data, |