J
Jonson
the code as follow:
DWORD dwRet;
IP_ADAPTER_INFO adapterInfo;
ULONG ulSize = sizeof(IP_ADAPTER_INFO);
dwRet = GetAdaptersInfo(&adapterInfo,&ulSize);
if (dwRet == ERROR_SUCCESS)
{
USES_CONVERSION;
dwRet = GetAdapterIndex
(A2WadapterInfo.AdapterName),&m_ulIfIndex);
if (dwRet != NO_ERROR)
TraceErrorMsg(dwRet);
else
{
unsigned long ulNTEContext, ulNTEInstance;
dwRet = AddIPAddress(0xDC702AD5, 0xFFFFFF00,
m_ulIfIndex, &ulNTEContext, &ulNTEInstance);
if (dwRet != NO_ERROR)
TraceErrorMsg(dwRet);
}
}
else
TraceErrorMsg(dwRet);
Calling the GetAdapterIndex function always returns error
(error code = 55:The specified network resource or device
is no longer available);
and calling AddIPAddress function always returns error
(error code = 87:The parameter is incorrect).
why? Thanks for any advise.
DWORD dwRet;
IP_ADAPTER_INFO adapterInfo;
ULONG ulSize = sizeof(IP_ADAPTER_INFO);
dwRet = GetAdaptersInfo(&adapterInfo,&ulSize);
if (dwRet == ERROR_SUCCESS)
{
USES_CONVERSION;
dwRet = GetAdapterIndex
(A2WadapterInfo.AdapterName),&m_ulIfIndex);
if (dwRet != NO_ERROR)
TraceErrorMsg(dwRet);
else
{
unsigned long ulNTEContext, ulNTEInstance;
dwRet = AddIPAddress(0xDC702AD5, 0xFFFFFF00,
m_ulIfIndex, &ulNTEContext, &ulNTEInstance);
if (dwRet != NO_ERROR)
TraceErrorMsg(dwRet);
}
}
else
TraceErrorMsg(dwRet);
Calling the GetAdapterIndex function always returns error
(error code = 55:The specified network resource or device
is no longer available);
and calling AddIPAddress function always returns error
(error code = 87:The parameter is incorrect).
why? Thanks for any advise.