DWORD getInterfacePhysicalByIndex(DWORD index, PDWORD len, PBYTE addr, PDWORD type) { HANDLE tcpFile; IFInfo info; NTSTATUS status = openTcpFile( &tcpFile, FILE_READ_DATA ); if( NT_SUCCESS(status) ) { status = getInterfaceInfoByIndex( tcpFile, index, &info ); if( NT_SUCCESS(status) ) getInterfacePhysicalFromInfo( &info, len, addr, type ); closeTcpFile( tcpFile ); } return status; }
DWORD getInterfacePhysicalByName(const char *name, PDWORD len, PBYTE addr, PDWORD type) { HANDLE tcpFile; IFInfo info; NTSTATUS status = openTcpFile( &tcpFile ); if( NT_SUCCESS(status) ) { status = getInterfaceInfoByName( tcpFile, (char *)name, &info ); if( NT_SUCCESS(status) ) getInterfacePhysicalFromInfo( &info, len, addr, type ); closeTcpFile( tcpFile ); } return status; }