要想使用NetLocalGroupEnum,应该引用那个单元文件。(50分)

  • 主题发起人 主题发起人 clxia
  • 开始时间 开始时间
C

clxia

Unregistered / Unconfirmed
GUEST, unregistred user!
在使用NetLocalGroupEnum等网络API时,应该引用那些单元文件,<br>或者需要什么其它的条件。请各位大侠帮忙。
 
d5 and d6 都没有声明的头文件。<br>自己根据win32sdk的说明写头文件吧。
 
该函数9x不支持。我给出它的原型,您自己想怎样声明吧,对了,知道以后别忘了给<br>大家贴出来。<br>&nbsp; NET_API_STATUS NetLocalGroupEnum(LPWSTR servername,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DWORD level,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;LPBYTE *bufptr,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DWORD prefmaxlen,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;LPDWORD entriesread,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;LPDWORD totalentries,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;LPDWORD resumehandle);<br>参数说明:<br>&nbsp;servername : 指向 Unicode 字符串的指针,该字符串包含了执行该函数的远程服务<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 器名。空指针或者空串表示本地计算机。<br>&nbsp; level &nbsp; &nbsp; : &nbsp;返回参数bufptr所指信息的信息级别,为以下值之一:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp;: &nbsp;返回用户本地组组名。所返回的缓冲区是 LOCALGROUP_INFO_0 <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 结构数组。<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1 &nbsp;: &nbsp;返回用户本地组属性。所返回的缓冲区是 LOCALGROUP_INFO_1 <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 结构数组。<br>&nbsp;*bufptr &nbsp; : &nbsp;指向返回信息结构的指针。该缓冲区应由函数NetApiBufferFree释放。<br>&nbsp; prefmaxlen &nbsp;: &nbsp;所返回数据的首选最大长度,以8位字节为单位。<br>&nbsp;entriesread &nbsp;: &nbsp;指向DWORD的指针,该DWORD包含了实际的枚举项数。<br>&nbsp;totalentries : &nbsp;指向DWORD的指针,该DWORD包含了从当前可恢复位置开始的所有可能<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 被枚举的项数。<br>&nbsp;resumehandle : &nbsp;指向DWORD的指针,该DWORD包含了恢复句柄,该句柄用于继续执行一<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 个已经存在的本地组查询。第一次调用时,该句柄为0,以后调用时,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 该句柄值不变。如果恢复句柄NULL,那么不返回恢复句柄。<br>返回值:<br>&nbsp; &nbsp; &nbsp; &nbsp;如果函数调用成功,返回值为 NERR_Success。如果函数调用失败,那么返回值是以<br>&nbsp; 下值之一:<br>&nbsp; &nbsp; ERROR_ACCESS_DENIED &nbsp; : &nbsp;用户不能访问所需的信息。<br>&nbsp; &nbsp; NERR_InvalidComputer &nbsp;: &nbsp;计算机名无效。<br>&nbsp; &nbsp; ERROR_MORE_DATA &nbsp; &nbsp; &nbsp; : &nbsp;再次调用该函数可返回其余项。<br><br>附:头文件:Imaccess.h; 输入库: netapi32.lib。<br><br><br>
 
暂时可以使用这个吧,但是还有写没有确定的。如返回值,其实应该定义成Const,没有那个.h文件,不能翻译了。<br>function NetLocalGroupEnum(servername: LPWSTR; level: DWORD; var bufptr: PByte;<br>prefmaxlen: DWORD; entriesread: PWORD; totalentries: PWORD; resumehandle: PWORD): Longint; stdcall;<br>external 'netapi32.DLL' name 'NetLocalGroupEnum';<br>
 
多人接受答案了。
 
后退
顶部