L
lb_icesea79
Unregistered / Unconfirmed
GUEST, unregistred user!
NET_API_STATUS NetUserSetGroups(LPCWSTR servername, LPCWSTR username, DWORD Level, LPBYTE buf, DWORD num_entries);<br><br>function NetUserSetGroups(servername, username: LPCWSTR; level: DWORD; buf: Pointer; num_entries: DWORD): NET_API_STATUS;<br> stdcall;external 'Netapi32.DLL' name 'NetUserSetGroups';<br><br>function TForm1.lbNetUserSetGroups2(AUser: String): DWORD;<br>var<br> ws_tmp, ws_tmp2: WideString;<br> AGroups: TGROUP_USERS_INFO_0;<br> num_entries : DWORD;<br>begin<br> ws_tmp := AUser;<br> num_entries := 0;<br> ws_tmp2 := 'Guests';<br> AGroups.grui0_name := PWideChar(ws_tmp2);<br> Result:=NetUserSetGroups(nil, PWideChar(ws_tmp), num_entries, @AGroups, 1);<br> Memo1.Lines.Add(PrintError('NetUserSetGroups'));<br>end;<br><br>运行结果:NetUserSetGroups 调用失败 997 (重叠 I/O 操作在进行中。)