![]() |
GetInterfaces() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Public Function |
Declared in: Interfaces.h |
BOOL GetInterfaces();
Retreive the list of all the interfaces
if (!m_iMaxInterfaces) { //structure not allocated ReportError("GetInterfaces","You constructed the class with 0 parameter!"); //Exit return FALSE; } try { //Allocate a socket SOCKET aSocket; aSocket=socket(AF_INET,SOCK_DGRAM,0); //Check it's valid if (aSocket==INVALID_SOCKET) { //Report it SetLastError("GetInterfaces"); //Exit return FALSE; } //Get the interface list unsigned long ulBytes; if (WSAIoctl(aSocket, SIO_GET_INTERFACE_LIST, NULL, NULL, m_pInfo, sizeof(INTERFACE_INFO)*m_iMaxInterfaces, &ulBytes, NULL, NULL)) { //Damn error SetLastError("GetInterfaces"); //Close the socket closesocket(aSocket); //Exit return FALSE; } //Check how many structures we have m_iStructures=ulBytes/sizeof(INTERFACE_INFO); //Set our position to zero m_iPosition=0; //Close the socket closesocket(aSocket); //Done return TRUE; } ERROR_HANDLER_RETURN("GetInterfaces",FALSE)
![]() |
Site content copyright © 2003 Komodia LTD.. See the About page for additional notices. This page last updated: 24 Feb 2003. |