I am trying to make a call to DhcpGetClientInfo in a .net process composed as 64 bits.
[DllImport(@"dhcpsapi.dll", CharSet = CharSet.Unicode, SetLastError = true)]
internal static extern UInt32 DhcpGetClientInfo(
String ServerIpAddress,
ref DHCP_SEARCH_INFO SearchInfo,
out IntPtr ClientInfo);
Some points to note
- When a process is compiled as 32 bits, it works.
- The returned error code is 20013. Which corresponds to the error codes : "An error occurred while accessing the DHCP JET database. For this error, see the DHCP server event log." However, there is nothing on the server in the event log. I also ensured that all special DHCP logs were enabled and nothing appeared there.
Simon source
share