diff options
Diffstat (limited to 'source3/rpc_parse/parse_misc.c')
-rw-r--r-- | source3/rpc_parse/parse_misc.c | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/source3/rpc_parse/parse_misc.c b/source3/rpc_parse/parse_misc.c index 532b7ccc7f..541d2d771f 100644 --- a/source3/rpc_parse/parse_misc.c +++ b/source3/rpc_parse/parse_misc.c @@ -115,6 +115,7 @@ static BOOL smb_io_utime(const char *desc, UTIME *t, prs_struct *ps, int depth) BOOL smb_io_time(const char *desc, NTTIME *nttime, prs_struct *ps, int depth) { + uint32 low, high; if (nttime == NULL) return False; @@ -124,11 +125,13 @@ BOOL smb_io_time(const char *desc, NTTIME *nttime, prs_struct *ps, int depth) if(!prs_align(ps)) return False; - if(!prs_uint32("low ", ps, depth, &nttime->low)) /* low part */ + if(!prs_uint32("low ", ps, depth, &low)) /* low part */ return False; - if(!prs_uint32("high", ps, depth, &nttime->high)) /* high part */ + if(!prs_uint32("high", ps, depth, &high)) /* high part */ return False; + *nttime = (((uint64_t)high << 32) + low); + return True; } @@ -1762,10 +1765,25 @@ BOOL smb_io_unistr3(const char *desc, UNISTR3 *name, prs_struct *ps, int depth) /******************************************************************* Stream a uint64_struct ********************************************************************/ -BOOL prs_uint64(const char *name, prs_struct *ps, int depth, UINT64_S *data64) +BOOL prs_uint64(const char *name, prs_struct *ps, int depth, uint64 *data64) { - return prs_uint32(name, ps, depth+1, &data64->low) && - prs_uint32(name, ps, depth+1, &data64->high); + if (UNMARSHALLING(ps)) { + uint32 high, low; + + if (!prs_uint32(name, ps, depth+1, &low)) + return False; + + if (!prs_uint32(name, ps, depth+1, &high)) + return False; + + *data64 = ((uint64_t)high << 32) + low; + + return True; + } else { + uint32 high = (*data64) >> 32, low = (*data64) & 0xFFFFFFFF; + return prs_uint32(name, ps, depth+1, &low) && + prs_uint32(name, ps, depth+1, &high); + } } /******************************************************************* |