1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

r8581: fixed handling of 64 bit integers in rpc calls from ejs

This commit is contained in:
Andrew Tridgell 2005-07-19 06:07:10 +00:00 committed by Gerald (Jerry) Carter
parent 58d7a1e6a3
commit 2ae6a33846

View File

@ -136,56 +136,50 @@ NTSTATUS ejs_pull_hyper(struct ejs_rpc *ejs,
struct MprVar *v, const char *name, uint64_t *r)
{
NDR_CHECK(mprGetVar(&v, name));
*r = mprVarToInteger(v);
*r = mprVarToNumber(v);
return NT_STATUS_OK;
}
NTSTATUS ejs_push_hyper(struct ejs_rpc *ejs,
struct MprVar *v, const char *name, const uint64_t *r)
{
return mprSetVar(v, name, mprCreateIntegerVar(*r));
return mprSetVar(v, name, mprCreateNumberVar(*r));
}
NTSTATUS ejs_pull_dlong(struct ejs_rpc *ejs,
struct MprVar *v, const char *name, uint64_t *r)
{
NDR_CHECK(mprGetVar(&v, name));
*r = mprVarToInteger(v);
return NT_STATUS_OK;
return ejs_pull_hyper(ejs, v, name, r);
}
NTSTATUS ejs_push_dlong(struct ejs_rpc *ejs,
struct MprVar *v, const char *name, const uint64_t *r)
{
return mprSetVar(v, name, mprCreateIntegerVar(*r));
return ejs_push_hyper(ejs, v, name, r);
}
NTSTATUS ejs_pull_udlong(struct ejs_rpc *ejs,
struct MprVar *v, const char *name, uint64_t *r)
{
NDR_CHECK(mprGetVar(&v, name));
*r = mprVarToInteger(v);
return NT_STATUS_OK;
return ejs_pull_hyper(ejs, v, name, r);
}
NTSTATUS ejs_push_udlong(struct ejs_rpc *ejs,
struct MprVar *v, const char *name, const uint64_t *r)
{
return mprSetVar(v, name, mprCreateIntegerVar(*r));
return ejs_push_hyper(ejs, v, name, r);
}
NTSTATUS ejs_pull_NTTIME(struct ejs_rpc *ejs,
struct MprVar *v, const char *name, uint64_t *r)
{
NDR_CHECK(mprGetVar(&v, name));
*r = mprVarToInteger(v);
return NT_STATUS_OK;
return ejs_pull_hyper(ejs, v, name, r);
}
NTSTATUS ejs_push_NTTIME(struct ejs_rpc *ejs,
struct MprVar *v, const char *name, const uint64_t *r)
{
return mprSetVar(v, name, mprCreateIntegerVar(*r));
return ejs_push_hyper(ejs, v, name, r);
}