In C:\cvs\reactos live: cvs -q -z9 commit -m "renamed MyGetAdaptersInfo to GetAdaptersInfo so that iphlpapi will compile. Also fixed some ANSI/UNICODE-related bugs ( eliminating the warnings )." lib/iphlpapi/iphlpapi.c lib/iphlpapi/makefile

CVSROOT=:ext:royce@osexperts.com:/CVS/ReactOS

svn path=/trunk/; revision=5235
This commit is contained in:
Royce Mitchell III 2003-07-24 01:08:12 +00:00
parent b7fd15bf4b
commit c522666b4e
2 changed files with 10 additions and 8 deletions

View file

@ -115,7 +115,9 @@ GetAdapterIndex(LPWSTR AdapterName, PULONG IfIndex)
/*
* @unimplemented
*/
DWORD WINAPI MyGetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen)
DWORD
WINAPI
GetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen)
{
LONG lErr;
DWORD dwSize;
@ -218,17 +220,17 @@ DWORD WINAPI MyGetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen)
// TODO UINT DhcpEnabled
// TODO PIP_ADDR_STRING CurrentIpAddress
// IP_ADDR_STRING IpAddressList
dwSize = 16; lErr = RegQueryValueEx(hIpConfig, "IPAddress", NULL, NULL, (BYTE*) &pCurrentAdapter->IpAddressList.IpAddress, &dwSize);
dwSize = 16; lErr = RegQueryValueEx(hIpConfig, "SubnetMask", NULL, NULL, (BYTE*) &pCurrentAdapter->IpAddressList.IpMask, &dwSize);
dwSize = 16; lErr = RegQueryValueEx(hIpConfig, _T("IPAddress"), NULL, NULL, (BYTE*) &pCurrentAdapter->IpAddressList.IpAddress, &dwSize);
dwSize = 16; lErr = RegQueryValueEx(hIpConfig, _T("SubnetMask"), NULL, NULL, (BYTE*) &pCurrentAdapter->IpAddressList.IpMask, &dwSize);
if(strstr(pCurrentAdapter->IpAddressList.IpAddress.String, "0.0.0.0") != NULL)
{
dwSize = 16; lErr = RegQueryValueEx(hIpConfig, "DhcpIPAddress", NULL, NULL, (BYTE*) &pCurrentAdapter->IpAddressList.IpAddress, &dwSize);
dwSize = 16; lErr = RegQueryValueEx(hIpConfig, "DhcpSubnetMask", NULL, NULL, (BYTE*) &pCurrentAdapter->IpAddressList.IpMask, &dwSize);
dwSize = 16; lErr = RegQueryValueEx(hIpConfig, _T("DhcpIPAddress"), NULL, NULL, (BYTE*) &pCurrentAdapter->IpAddressList.IpAddress, &dwSize);
dwSize = 16; lErr = RegQueryValueEx(hIpConfig, _T("DhcpSubnetMask"), NULL, NULL, (BYTE*) &pCurrentAdapter->IpAddressList.IpMask, &dwSize);
}
// TODO IP_ADDR_STRING GatewayList
// IP_ADDR_STRING DhcpServer
dwSize = 16; lErr = RegQueryValueEx(hIpConfig, "DhcpServer", NULL, NULL, (BYTE*) &pCurrentAdapter->DhcpServer.IpAddress, &dwSize);
dwSize = 16; lErr = RegQueryValueEx(hIpConfig, "DhcpSubnetMask", NULL, NULL, (BYTE*) &pCurrentAdapter->DhcpServer.IpMask, &dwSize);
dwSize = 16; lErr = RegQueryValueEx(hIpConfig, _T("DhcpServer"), NULL, NULL, (BYTE*) &pCurrentAdapter->DhcpServer.IpAddress, &dwSize);
dwSize = 16; lErr = RegQueryValueEx(hIpConfig, _T("DhcpSubnetMask"), NULL, NULL, (BYTE*) &pCurrentAdapter->DhcpServer.IpMask, &dwSize);
// TODO BOOL HaveWins
// TODO IP_ADDR_STRING PrimaryWinsServer
// TODO IP_ADDR_STRING SecondaryWinsServer

View file

@ -8,7 +8,7 @@ TARGET_NAME = iphlpapi
TARGET_BASE = 0x777c0000
TARGET_CFLAGS = -DUNICODE
TARGET_CFLAGS = -DUNICODE -D_UNICODE
TARGET_SDKLIBS = ntdll.a kernel32.a