mirror of
https://github.com/samba-team/samba.git
synced 2024-12-25 23:21:54 +03:00
r7254: Add a mprWERROR() function with the same attributes as mprNTSTATUS.
This commit is contained in:
parent
54ff16b9a1
commit
2fa6f7bb2b
@ -189,3 +189,27 @@ struct MprVar mprNTSTATUS(NTSTATUS status)
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
turn a WERROR into a MprVar object with lots of funky properties
|
||||
*/
|
||||
struct MprVar mprWERROR(WERROR status)
|
||||
{
|
||||
struct MprVar res, val;
|
||||
|
||||
res = mprCreateObjVar("werror", MPR_DEFAULT_HASH_SIZE);
|
||||
|
||||
val = mprCreateStringVar(win_errstr(status), 1);
|
||||
mprCreateProperty(&res, "errstr", &val);
|
||||
|
||||
val = mprCreateIntegerVar(W_ERROR_V(status));
|
||||
mprCreateProperty(&res, "v", &val);
|
||||
|
||||
val = mprCreateBoolVar(W_ERROR_IS_OK(status));
|
||||
mprCreateProperty(&res, "is_ok", &val);
|
||||
|
||||
val = mprCreateBoolVar(True);
|
||||
mprCreateProperty(&res, "is_err", &val);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user