svn commit: samba r3869 - in branches/SAMBA_4_0/source: build/pidl
include librpc/ndr
metze at samba.org
metze at samba.org
Fri Nov 19 02:35:48 GMT 2004
Author: metze
Date: 2004-11-19 02:35:48 +0000 (Fri, 19 Nov 2004)
New Revision: 3869
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3869
Log:
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
Modified:
branches/SAMBA_4_0/source/build/pidl/util.pm
branches/SAMBA_4_0/source/include/smb.h
branches/SAMBA_4_0/source/librpc/ndr/ndr_basic.c
Changeset:
Modified: branches/SAMBA_4_0/source/build/pidl/util.pm
===================================================================
--- branches/SAMBA_4_0/source/build/pidl/util.pm 2004-11-18 23:25:37 UTC (rev 3868)
+++ branches/SAMBA_4_0/source/build/pidl/util.pm 2004-11-19 02:35:48 UTC (rev 3869)
@@ -207,7 +207,7 @@
if ($type =~ /^u?int\d+/) {
return 1;
}
- if ($type =~ /char|short|long|NTTIME|
+ if ($type =~ /char|short|long|NTTIME|NTTIME_1sec|
time_t|error_status_t|boolean32|unsigned32|
HYPER_T|wchar_t|DATA_BLOB|WERROR/x) {
return 1;
Modified: branches/SAMBA_4_0/source/include/smb.h
===================================================================
--- branches/SAMBA_4_0/source/include/smb.h 2004-11-18 23:25:37 UTC (rev 3868)
+++ branches/SAMBA_4_0/source/include/smb.h 2004-11-19 02:35:48 UTC (rev 3869)
@@ -215,6 +215,8 @@
/* 64 bit time (100 nanosec) 1601 - cifs6.txt, section 3.5, page 30 */
typedef uint64_t NTTIME;
+/* 64 bit time (1 sec) 1601 - in the NDR blob but mapped to NTTIME */
+#define NTTIME_1sec NTTIME
/* 8 byte aligned 'hyper' type from MS IDL */
typedef uint64_t HYPER_T;
Modified: branches/SAMBA_4_0/source/librpc/ndr/ndr_basic.c
===================================================================
--- branches/SAMBA_4_0/source/librpc/ndr/ndr_basic.c 2004-11-18 23:25:37 UTC (rev 3868)
+++ branches/SAMBA_4_0/source/librpc/ndr/ndr_basic.c 2004-11-19 02:35:48 UTC (rev 3869)
@@ -951,6 +951,26 @@
}
/*
+ 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
*/
NTSTATUS ndr_push_time_t(struct ndr_push *ndr, time_t t)
@@ -997,7 +1017,10 @@
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 @@
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) {
More information about the samba-cvs
mailing list