diff options
Diffstat (limited to 'source4/librpc/ndr')
-rw-r--r-- | source4/librpc/ndr/libndr.h | 12 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr_basic.c | 4 |
2 files changed, 11 insertions, 5 deletions
diff --git a/source4/librpc/ndr/libndr.h b/source4/librpc/ndr/libndr.h index 1cec8d4c2a..fe817bfdcd 100644 --- a/source4/librpc/ndr/libndr.h +++ b/source4/librpc/ndr/libndr.h @@ -200,12 +200,18 @@ enum ndr_err_code { #define ndr_size_uint16(t, p, flags) (NDR_SIZE_ALIGN(t, 2, flags) + 2) #define ndr_size_int32(t, p, flags) (NDR_SIZE_ALIGN(t, 4, flags) + 4) #define ndr_size_uint32(t, p, flags) (NDR_SIZE_ALIGN(t, 4, flags) + 4) -#define ndr_size_int64(t, p, flags) (NDR_SIZE_ALIGN(t, 8, flags) + 8) -#define ndr_size_uint64(t, p, flags) (NDR_SIZE_ALIGN(t, 8, flags) + 8) #define ndr_size_ptr(t, p, flags) (NDR_SIZE_ALIGN(t, 4, flags) + 4) +/* + * [u]int64 uses 4 Byte alignment + * and HYPER_T uses 8 Byte alignment + */ +#define ndr_size_int64(t, p, flags) (NDR_SIZE_ALIGN(t, 4, flags) + 8) +#define ndr_size_uint64(t, p, flags) (NDR_SIZE_ALIGN(t, 4, flags) + 8) +#define ndr_size_HYPER_T(t, p, flags) (NDR_SIZE_ALIGN(t, 8, flags) + 8) + #define ndr_size_NTTIME(t, p, flags) ndr_size_uint64(t, p, flags) -#define ndr_size_NTTIME_1sec(t, p, flags) ndr_size_NTTIME(t, p, flags) +#define ndr_size_NTTIME_1sec(t, p, flags) ndr_size_HYPER_T(t, p, flags) #define ndr_size_WERROR(t, p, flags) ndr_size_uint32(t, p, flags) #define ndr_size_NTSTATUS(t, p, flags) ndr_size_uint32(t, p, flags) diff --git a/source4/librpc/ndr/ndr_basic.c b/source4/librpc/ndr/ndr_basic.c index 3959e91563..315dc76059 100644 --- a/source4/librpc/ndr/ndr_basic.c +++ b/source4/librpc/ndr/ndr_basic.c @@ -960,7 +960,7 @@ NTSTATUS ndr_pull_NTTIME(struct ndr_pull *ndr, NTTIME *t) NTSTATUS ndr_push_NTTIME_1sec(struct ndr_push *ndr, NTTIME t) { t /= 10000000; - NDR_CHECK(ndr_push_uint64(ndr, t)); + NDR_CHECK(ndr_push_HYPER_T(ndr, t)); return NT_STATUS_OK; } @@ -969,7 +969,7 @@ NTSTATUS ndr_push_NTTIME_1sec(struct ndr_push *ndr, NTTIME t) */ NTSTATUS ndr_pull_NTTIME_1sec(struct ndr_pull *ndr, NTTIME *t) { - NDR_CHECK(ndr_pull_uint64(ndr, t)); + NDR_CHECK(ndr_pull_HYPER_T(ndr, t)); (*t) *= 10000000; return NT_STATUS_OK; } |