From 717c8bc7950c2f0eabcdbc7437f47289f6b227b5 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 19 Nov 2004 02:35:48 +0000 Subject: r3869: in the NDR encoded replPropertyMetaData attribute in ADS I see a new 64 bit time field which are seconds since 1601, this will be mapped to NTTIME by th eparsing code +#define NTTIME_1sec NTTIME metze (This used to be commit db35f3b0f99943311ff8b797e8336616dab28220) --- source4/librpc/ndr/ndr_basic.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'source4/librpc/ndr/ndr_basic.c') diff --git a/source4/librpc/ndr/ndr_basic.c b/source4/librpc/ndr/ndr_basic.c index 057b162ca9..f26c40e7b7 100644 --- a/source4/librpc/ndr/ndr_basic.c +++ b/source4/librpc/ndr/ndr_basic.c @@ -950,6 +950,26 @@ NTSTATUS ndr_pull_NTTIME(struct ndr_pull *ndr, NTTIME *t) return NT_STATUS_OK; } +/* + push a NTTIME +*/ +NTSTATUS ndr_push_NTTIME_1sec(struct ndr_push *ndr, NTTIME t) +{ + t /= 10000000; + NDR_CHECK(ndr_push_uint64(ndr, t)); + return NT_STATUS_OK; +} + +/* + pull a NTTIME +*/ +NTSTATUS ndr_pull_NTTIME_1sec(struct ndr_pull *ndr, NTTIME *t) +{ + NDR_CHECK(ndr_pull_uint64(ndr, t)); + (*t) *= 10000000; + return NT_STATUS_OK; +} + /* push a time_t */ @@ -997,7 +1017,10 @@ void ndr_print_int32(struct ndr_print *ndr, const char *name, int32_t v) void ndr_print_uint64(struct ndr_print *ndr, const char *name, uint64_t v) { - ndr->print(ndr, "%-25s: 0x%08x%08x", name, (uint32_t)(v >> 32), (uint32_t)(v & 0xFFFFFFFF)); + ndr->print(ndr, "%-25s: 0x%08x%08x (%llu)", name, + (uint32_t)(v >> 32), + (uint32_t)(v & 0xFFFFFFFF), + v); } void ndr_print_int64(struct ndr_print *ndr, const char *name, int64_t v) @@ -1036,6 +1059,11 @@ void ndr_print_NTTIME(struct ndr_print *ndr, const char *name, NTTIME t) ndr->print(ndr, "%-25s: %s", name, nt_time_string(ndr, t)); } +void ndr_print_NTTIME_1sec(struct ndr_print *ndr, const char *name, NTTIME t) +{ + ndr_print_NTTIME(ndr, name, t); +} + void ndr_print_time_t(struct ndr_print *ndr, const char *name, time_t t) { if (t == (time_t)-1 || t == 0) { -- cgit