我是 JNA 的新手,我想将 DsGetDcName 方法转换为 JNA。
DWORD DsGetDcName(
__in LPCTSTR ComputerName,
__in LPCTSTR DomainName,
__in GUID *DomainGuid,
__in LPCTSTR SiteName,
__in ULONG Flags,
__out PDOMAIN_CONTROLLER_INFO *DomainControllerInfo
);
我已将上述函数转换为 JNA 我将上述参数替换如下
public static class GUID extends Structure {
public int Data1;
public short Data2;
public short Data3;
public byte Data4[]= new byte[8];
}
public static class DOMAIN_CONTROLLER_INFO extends Structure {
public String DomainControllerName;
public String DomainControllerAddress;
public int DomainControllerAddressType;
public GUID DomainGuid; // created Structure above
public String DomainName;
public String DnsForestName;
public int Flags;
public String DcSiteName;
public String ClientSiteName;
}
int DsGetDCName(
String strComputerName,
String strDomainName,
GUID DomainGuid, // static class created extending with structure
String strSiteName,
int iFlags,
DOMAIN_CONTROLLER_INFO DomainControllerInfo // static class created extending with structure
);
上述函数返回997 Error (ERROR IO PENDING)
. 方法声明是正确的。可以在这个问题上提供任何帮助吗?提前致谢。
问候
帕万·库马尔 A.