pike.git / src / modules / system / nt.c

version» Context lines:

pike.git/src/modules/system/nt.c:773:    *! @note    *! This function is only available on some Win32 systems.    */   void f_LogonUser(INT32 args)   {    LPTSTR username, domain, pw;    DWORD logontype, logonprovider;    HANDLE x;    BOOL ret;    -  check_all_args("LogonUser",args, +  check_all_args(NULL, args,    BIT_STRING, BIT_INT | BIT_STRING, BIT_STRING,    BIT_INT | BIT_VOID, BIT_INT | BIT_VOID,0);       username=(LPTSTR)sp[-args].u.string->str;       if(TYPEOF(sp[1-args]) == T_STRING)    domain=(LPTSTR)sp[1-args].u.string->str;    else    domain=0;   
pike.git/src/modules/system/nt.c:1261:    *! @[NetGetAnyDCName()]    */   void f_NetUserGetInfo(INT32 args)   {    char *to_free1=NULL,*to_free2=NULL;    BYTE *tmp=0;    DWORD level;    LPWSTR server, user;    NET_API_STATUS ret;    -  check_all_args("NetUserGetInfo",args,BIT_STRING|BIT_INT, BIT_STRING, BIT_VOID | BIT_INT, 0); +  check_all_args(NULL,args,BIT_STRING|BIT_INT, BIT_STRING, BIT_VOID | BIT_INT, 0);       if(args>2)    level=sp[2-args].u.integer;    else    level=1;       switch(level)    {    case 0: case 1: case 2: case 3: case 10: case 11: case 20:    break;
pike.git/src/modules/system/nt.c:1357:   {    char *to_free1=NULL;    DWORD level=0;    DWORD filter=0;    LPWSTR server=NULL;    INT32 pos=0;    struct array *a=0;    DWORD resume=0;    NET_API_STATUS ret;    -  check_all_args("NetUserEnum",args,BIT_STRING|BIT_INT|BIT_VOID, BIT_INT|BIT_VOID,BIT_INT|BIT_VOID,0); +  check_all_args(NULL,args,BIT_STRING|BIT_INT|BIT_VOID, BIT_INT|BIT_VOID,BIT_INT|BIT_VOID,0);       switch(args)    {    default:filter=sp[2-args].u.integer;    case 2: level=sp[1-args].u.integer;    switch(level)    {    case 0: case 1: case 2: case 3: case 10: case 11: case 20:    break;    default:
pike.git/src/modules/system/nt.c:1468:   void f_NetGroupEnum(INT32 args)   {    char *to_free1=NULL, *tmp_server=NULL;    DWORD level=0;    LPWSTR server=NULL;    INT32 pos=0;    struct array *a=0;    DWORD resume=0;    NET_API_STATUS ret;    -  check_all_args("NetGroupEnum",args,BIT_STRING|BIT_INT|BIT_VOID, BIT_INT|BIT_VOID,0); +  check_all_args(NULL,args,BIT_STRING|BIT_INT|BIT_VOID, BIT_INT|BIT_VOID,0);       if(args && TYPEOF(sp[-args]) == T_STRING)    server=(LPWSTR)require_wstring1(sp[-args].u.string,&to_free1);       if(args>1 && TYPEOF(sp[1-args]) == T_INT) {    level = sp[1-args].u.integer;    switch(level)    {    case 0: case 1: case 2:    break;
pike.git/src/modules/system/nt.c:1570:   void f_NetLocalGroupEnum(INT32 args)   {    char *to_free1=NULL, *tmp_server=NULL;    DWORD level=0;    LPWSTR server=NULL;    INT32 pos=0;    struct array *a=0;    DWORD resume=0;    NET_API_STATUS ret;    -  check_all_args("NetLocalGroupEnum",args,BIT_STRING|BIT_INT|BIT_VOID, BIT_INT|BIT_VOID,0); +  check_all_args(NULL,args,BIT_STRING|BIT_INT|BIT_VOID, BIT_INT|BIT_VOID,0);       if(args && TYPEOF(sp[-args]) == T_STRING)    server=(LPWSTR)require_wstring1(sp[-args].u.string,&to_free1);       if(args>1 && TYPEOF(sp[1-args]) == T_INT) {    level = sp[1-args].u.integer;    switch(level)    {    case 0: case 1:    break;
pike.git/src/modules/system/nt.c:1676:    char *to_free1=NULL, *to_free2=NULL, *tmp_server=NULL;    DWORD level=0;    LPWSTR server=NULL;    LPWSTR user=NULL;    INT32 pos=0;    struct array *a=0;    DWORD read=0, total=0, e;    NET_API_STATUS ret;    LPBYTE buf=0,ptr;    -  check_all_args("NetUserGetGroups",args,BIT_STRING|BIT_INT, BIT_STRING,BIT_INT|BIT_VOID, 0); +  check_all_args(NULL,args,BIT_STRING|BIT_INT, BIT_STRING,BIT_INT|BIT_VOID, 0);       if(args>0 && TYPEOF(sp[-args]) == T_STRING)    server=(LPWSTR)require_wstring1(sp[-args].u.string,&to_free1);       if(args>1 && TYPEOF(sp[-args+1]) == T_STRING)    user=(LPWSTR)require_wstring1(sp[-args+1].u.string,&to_free2);       if(args>2 && TYPEOF(sp[2-args]) == T_INT) {    level = sp[2-args].u.integer;    switch(level)
pike.git/src/modules/system/nt.c:1788:    DWORD level=0;    DWORD flags=0;    LPWSTR server=NULL;    LPWSTR user=NULL;    INT32 pos=0;    struct array *a=0;    DWORD read=0, total=0, e;    NET_API_STATUS ret;    LPBYTE buf=0,ptr;    -  check_all_args("NetUserGetLocalGroups",args,BIT_STRING|BIT_INT, BIT_STRING,BIT_INT|BIT_VOID, BIT_INT|BIT_VOID, 0); +  check_all_args(NULL,args,BIT_STRING|BIT_INT, BIT_STRING,BIT_INT|BIT_VOID, BIT_INT|BIT_VOID, 0);       if(args>0 && TYPEOF(sp[-args]) == T_STRING)    server=(LPWSTR)require_wstring1(sp[-args].u.string,&to_free1);       if(args>1 && TYPEOF(sp[-args+1]) == T_STRING)    user=(LPWSTR)require_wstring1(sp[-args+1].u.string,&to_free2);       if(args>2 && TYPEOF(sp[2-args]) == T_INT) {    level = sp[2-args].u.integer;    switch(level)
pike.git/src/modules/system/nt.c:1897:   void f_NetGroupGetUsers(INT32 args)   {    char *to_free1=NULL, *to_free2=NULL, *tmp_server=NULL;    DWORD level=0;    LPWSTR server=NULL;    LPWSTR group=NULL;    INT32 pos=0;    struct array *a=0;    DWORD resume=0;    -  check_all_args("NetGroupGetUsers",args,BIT_STRING|BIT_INT|BIT_VOID, BIT_STRING, BIT_INT|BIT_VOID,0); +  check_all_args(NULL,args,BIT_STRING|BIT_INT|BIT_VOID, BIT_STRING, BIT_INT|BIT_VOID,0);       if(args && TYPEOF(sp[-args]) == T_STRING)    server=(LPWSTR)require_wstring1(sp[-args].u.string,&to_free1);       if(args>1 && TYPEOF(sp[1-args]) == T_STRING)    group=(LPWSTR)require_wstring1(sp[1-args].u.string,&to_free2);       if(args>2 && TYPEOF(sp[2-args]) == T_INT) {    level = sp[2-args].u.integer;    switch(level)
pike.git/src/modules/system/nt.c:2014:   void f_NetLocalGroupGetMembers(INT32 args)   {    char *to_free1=NULL, *to_free2=NULL, *tmp_server=NULL;    DWORD level=0;    LPWSTR server=NULL;    LPWSTR group=NULL;    INT32 pos=0;    struct array *a=0;    DWORD resume=0;    -  check_all_args("NetLocalGroupGetMembers",args,BIT_STRING|BIT_INT|BIT_VOID, BIT_STRING, BIT_INT|BIT_VOID,0); +  check_all_args(NULL,args,BIT_STRING|BIT_INT|BIT_VOID, BIT_STRING, BIT_INT|BIT_VOID,0);       if(args && TYPEOF(sp[-args]) == T_STRING)    server=(LPWSTR)require_wstring1(sp[-args].u.string,&to_free1);       if(args>1 && TYPEOF(sp[1-args]) == T_STRING)    group=(LPWSTR)require_wstring1(sp[1-args].u.string,&to_free2);       if(args>2 && TYPEOF(sp[2-args]) == T_INT) {    level = sp[2-args].u.integer;    switch(level)
pike.git/src/modules/system/nt.c:2122:    *! @[NetGroupGetUsers()], @[NetLocalGroupGetMembers()],    *! @[NetGetAnyDCName()]    */   void f_NetGetDCName(INT32 args)   {    char *to_free1=NULL,*to_free2=NULL;    BYTE *tmp=0;    LPWSTR server, domain;    NET_API_STATUS ret;    -  check_all_args("NetGetDCName",args,BIT_STRING|BIT_INT, BIT_STRING, 0); +  check_all_args(NULL,args,BIT_STRING|BIT_INT, BIT_STRING, 0);       if(TYPEOF(sp[-args]) == T_STRING)    {    server=(LPWSTR)require_wstring1(sp[-args].u.string,&to_free1);    if(!server)    Pike_error("Server name string is too wide.\n");    }else{    server=NULL;    }   
pike.git/src/modules/system/nt.c:2191:    *! @[NetGroupGetUsers()], @[NetLocalGroupGetMembers()],    *! @[NetGetDCName()]    */   void f_NetGetAnyDCName(INT32 args)   {    char *to_free1=NULL,*to_free2=NULL;    BYTE *tmp=0;    LPWSTR server, domain;    NET_API_STATUS ret;    -  check_all_args("NetGetAnyDCName",args,BIT_STRING|BIT_INT, BIT_STRING, 0); +  check_all_args(NULL,args,BIT_STRING|BIT_INT, BIT_STRING, 0);       if(TYPEOF(sp[-args]) == T_STRING)    {    server=(LPWSTR)require_wstring1(sp[-args].u.string,&to_free1);    if(!server)    Pike_error("Server name string is too wide.\n");    }else{    server=NULL;    }   
pike.git/src/modules/system/nt.c:2423:    *! This function is only available on some Win32 systems.    *!    */   static void f_NetSessionEnum(INT32 args)   {    LPWSTR server, client, user;    DWORD level;    DWORD resume = 0;    struct array *a=0;    -  check_all_args("NetSessionEnum",args, +  check_all_args(NULL,args,    BIT_INT|BIT_STRING,    BIT_INT|BIT_STRING,    BIT_INT|BIT_STRING,    BIT_INT,    0);       server=get_wstring(sp-args);    client=get_wstring(sp-args+1);    user=get_wstring(sp-args+2);    level=sp[3-args].u.integer;
pike.git/src/modules/system/nt.c:2514:    *! This function is only available on some Win32 systems.    *!    */   static void f_NetWkstaUserEnum(INT32 args)   {    LPWSTR server;    DWORD level;    DWORD resume = 0;    struct array *a=0;    -  check_all_args("NetWkstaUserEnum",args, +  check_all_args(NULL,args,    BIT_INT|BIT_STRING,    BIT_INT,    0);       server=get_wstring(sp-args);    level=sp[1-args].u.integer;       if (level != 0 && level != 1)    Pike_error("Unsupported level: %d.\n", level);   
pike.git/src/modules/system/nt.c:2692:    *!    */   static void f_LookupAccountName(INT32 args)   {    LPCTSTR sys=0;    LPCTSTR acc;    DWORD sidlen, domainlen;    SID_NAME_USE tmp;    char buffer[1];    -  check_all_args("LookupAccountName",args,BIT_INT|BIT_STRING, BIT_STRING,0); +  check_all_args(NULL,args,BIT_INT|BIT_STRING, BIT_STRING,0);    if(TYPEOF(sp[-args]) == T_STRING)    {    if(sp[-args].u.string->size_shift != 0)    Pike_error("System name is wide string.\n");    sys=STR0(sp[-args].u.string);    }    if(sp[1-args].u.string->size_shift != 0)    Pike_error("Account name is wide string.\n");       acc=STR0(sp[1-args].u.string);
pike.git/src/modules/system/nt.c:2983:    PSID owner=0, group=0;    PACL dacl=0, sacl=0;    PSECURITY_DESCRIPTOR desc=0;    DWORD ret;    SECURITY_INFORMATION flags=    OWNER_SECURITY_INFORMATION |    GROUP_SECURITY_INFORMATION |    DACL_SECURITY_INFORMATION;       SE_OBJECT_TYPE type = SE_FILE_OBJECT; -  check_all_args("GetSecurityInfo",args,BIT_STRING, BIT_VOID|BIT_INT, BIT_VOID|BIT_INT, 0); +  check_all_args(NULL,args,BIT_STRING, BIT_VOID|BIT_INT, BIT_VOID|BIT_INT, 0);       switch(args)    {    default: flags=sp[2-args].u.integer;    case 2: type=sp[1-args].u.integer;    case 1: break;    }       if(!(ret=getnamedsecurityinfo(sp[-args].u.string->str,    type,
pike.git/src/modules/system/nt.c:3440:      } /* end GenServerContext */         static void f_sctx_gencontext(INT32 args)   {    struct sctx_storage *sctx = THIS_SCTX;    struct pike_string *in;    BOOL new_conversation = 0;    -  check_all_args("gen_context", args, -  BIT_STRING,0); +  check_all_args(NULL, args, BIT_STRING,0);       in = Pike_sp[-1].u.string;    if (in->size_shift != 0)    Pike_error("Wide strings is not allowed.\n");    sctx->cBuf = sctx->cbMaxMessage;    if (!GenServerContext (in->str, in->len, sctx->buf, &sctx->cBuf,    &sctx->done, !sctx->hctxt_alloced))    {    pop_n_elems(args);    push_int(0);