From 67b6fe3dc39aaf88787471b1ce10f47db74c5b1e Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Thu, 15 Jul 2010 16:19:04 -0400 Subject: s3-misc: Move smb_io_time() to regfio.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is the last file using this function and we do not want anyone else to keep using hand marshalled stuff anyway. So make it also private to that file. Signed-off-by: Günther Deschner --- source3/registry/regfio.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'source3/registry/regfio.c') diff --git a/source3/registry/regfio.c b/source3/registry/regfio.c index d64eab84f9..5ba936273d 100644 --- a/source3/registry/regfio.c +++ b/source3/registry/regfio.c @@ -31,6 +31,38 @@ * ******************************************************************/ +/******************************************************************* + Reads or writes an NTTIME structure. +********************************************************************/ + +static bool smb_io_time(const char *desc, NTTIME *nttime, prs_struct *ps, int depth) +{ + uint32 low, high; + if (nttime == NULL) + return False; + + prs_debug(ps, depth, desc, "smb_io_time"); + depth++; + + if(!prs_align(ps)) + return False; + + if (MARSHALLING(ps)) { + low = *nttime & 0xFFFFFFFF; + high = *nttime >> 32; + } + + if(!prs_uint32("low ", ps, depth, &low)) /* low part */ + return False; + if(!prs_uint32("high", ps, depth, &high)) /* high part */ + return False; + + if (UNMARSHALLING(ps)) { + *nttime = (((uint64_t)high << 32) + low); + } + + return True; +} /******************************************************************* *******************************************************************/ -- cgit