GetIpAddrTable函数的用法

来源:互联网 发布:c语言二级辅导温度转换 编辑:程序博客网 时间:2024/04/30 12:26
IP助手函数里面能找到的。(mmsdn中ip   helper函数族)  
  另外这些函数还包括网卡的一些设置。  
  增加一个IP地址。  
  。。。很多呀  
  下面这个函数是得到一个数组的。  
  GetIpAddrTable  
   
  The   GetIpAddrTable   function   retrieves   the   interface–to–IP   address   mapping   table.  
   
   
  DWORD   GetIpAddrTable(  
      PMIB_IPADDRTABLE   pIpAddrTable,  
      PULONG   pdwSize,  
      BOOL   bOrder  
  );  
   
  Parameters  
  pIpAddrTable    
  [out]   Pointer   to   a   buffer   that   receives   the  interface–to–IP   address   mapping   table   as   a   MIB_IPADDRTABLE  structure.    
  pdwSize    
  [in,   out]   On   input,  specifies   the   size   of   the   buffer   pointed   to   by   the  pIpAddrTable   parameter.    
  On   output,   if   the  buffer   is   not   large   enough   to   hold   the   returned  mapping   table,   the   function   sets   this   parameter   equal  to   the   required   buffer   size.  
   
  bOrder    
  [in]   Specifies   whether   the   returned   mapping   table  should   be   sorted   in   ascending   order   by   IP   address.   If  this   parameter   is   TRUE,   the   table   is   sorted.    
  Return   Values  
  If   the   function   succeeds,   the   return   value   is   NO_ERROR.  
   
  If   the   function   fails,   the   return   value   is   one   of   the   following   error   codes.  
   
  Return   Code   Description    
  ERROR_INSUFFICIENT_BUFFER   The   buffer   pointed   to   by   the  pIpAddrTable   parameter   is   not   large   enough.   The   required  size   is   returned   in   the   DWORD   variable   pointed   to  by   the   pdwSize   parameter.    
  ERROR_INVALID_PARAMETER  The   pdwSize   parameter   is   NULL,   or   GetIpAddrTable   is  unable   to   write   to   the   memory   pointed   to   by   the  pdwSize   parameter.    
  ERROR_NOT_SUPPORTED   This   function  is   not   supported   on   the   operating   system   in   use   on  the   local   system.    
  Other   Use   FormatMessage   to   obtain   the   message   string   for   the   returned   error.
原创粉丝点击