关于netusergetinfo

suylei 2003-09-03 04:11:13
我如下定义:
function netusergetinfo(servername:pwidechar;username:pwidechar;level:dword;buffer:pointer):longint; stdcall; external 'netapi32.dll'

可是在调用时提示:无法定位程序输入点netusergetinfo于动态链接库netapi32.dll

如何解决。谢谢
...全文
85 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
suylei 2003-09-04
  • 打赏
  • 举报
回复
上述问题已解决可不能得到正确的值,程序如下 :
type
USER_INFO_1=record
usri1_name:pwidechar;
usri1_password:pwidechar;
usri1_password_age:dword;
usri1_priv:dword;
usri1_home_dir:pwidechar;
usri1_comment:pwidechar;
usri1_flags:dword;
usri1_script_path:pwidechar;
end;
buffer=^USER_INFO_1;



//function NetUserAdd(Server:PWideChar;Level:DWORD;Buf:pointer;ParmError
//:dword):LongInt;stdcall; external 'netapi32.dll'

function netusergetinfo(servername:pwidechar;username:pwidechar;level:dword;buffer:pointer):longint; stdcall; external 'netapi32.dll' name 'NetUserGetInfo';

procedure TForm1.Button1Click(Sender: TObject);
var
buf:buffer;
begin
getmem(buf,sizeof(USER_INFO_1));
with buf^ do
begin
netusergetinfo(nil,'www',1,pointer(buf));
edit1.Text:=usri1_name;
//edit2.Text:=usri1_password;
edit3.text:= inttostr(usri1_password_age);
edit4.text:=inttostr(usri1_priv);
edit5.text:=usri1_home_dir;
edit6.text:= usri1_comment;
edit7.Text:=inttostr(usri1_flags);
edit8.text:= usri1_script_path;


freemem(buf);
end;

end;

end.
Eastunfail 2003-09-03
  • 打赏
  • 举报
回复
如果你没有指定函数的入口点,编译器将用你所声明的函数作为默认的入口点,而入口点是要去分大小写的

估计入口点是NetUserGetInfo,那么就改为:
function netusergetinfo(servername:pwidechar;username:pwidechar;level:dword;buffer:pointer):longint; stdcall; external 'netapi32.dll' name 'NetUserGetInfo';

1,184

社区成员

发帖
与我相关
我的任务
社区描述
Delphi Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧