1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

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>
This commit is contained in:
Günther Deschner 2016-09-23 17:11:27 +02:00 committed by Uri Simchoni
parent 56949a1c32
commit 2f4f9a086c
2 changed files with 22 additions and 0 deletions

View File

@ -91,6 +91,26 @@ bool spoolss_timestr_to_NTTIME(const char *str,
return true;
}
/*******************************************************************
********************************************************************/
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;
}
/*******************************************************************
********************************************************************/

View File

@ -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,