title: problem with GetIpForwardTable Implementation in Delphi 7
body: <p>I have put together this code for viewing Routing Table in My delphi App.</p>
  
  <pre><code>  PMIB_IPFORWARDROW = ^TMibIpForwardRow;
  TMibIpForwardRow=packed record
  dwForwardDest:DWORD;
  dwForwardMask:DWORD;
  dwForwardPolicy:DWORD;
  dwForwardNextHop:DWORD;
  dwForwardIfIndex:DWORD;
  dwForwardType:DWORD;
  dwForwardProto:DWORD;
  dwForwardAge:DWORD;
  dwForwardNextHopAS:DWORD;
  dwForwardMetric1:DWORD;
  dwForwardMetric2:DWORD;
  dwForwardMetric3:DWORD;
  dwForwardMetric4:DWORD;
  dwForwardMetric5:DWORD;
  end;
  
  PMIB_IPFORWARDTABLE=^TMibIpForwardTable ;
  TMibIpForwardTable=packed record
  dwNumEntries:DWORD;
  table:array [0..ANY_SIZE-1] of TMibIpForwardRow;
  end;
  </code></pre>
  
  <p>The Declaration of the Function is :</p>
  
  <pre><code> getIpForwardTable: function (pIpForwardTable:PMIB_IPFORWARDTABLE; pdwSize:PULONG; bOrder:BOOL):DWORD; stdcall;
  </code></pre>
  
  <p>And the Function for Implementation is:</p>
  
  <pre><code>  procedure GetRouteTable;
   var
   Error:DWORD;
   pRouteTable:PMIB_IPFORWARDTABLE ;
     dwSize:ULONG;
    //dwSize:ULONG;
    TableSize:Integer;
   begin
    try
      dwSize:=0;
      GetMem(pRouteTable,SizeOf(TMibIpForwardTable));
     Error:=GetIpForwardTable(pRouteTable,@dwSize,FALSE);// Error at this line
     if Error=NO_ERROR then
     begin
       ShowMessage(IntToStr(Error));
  
      end
      else
          ShowMessage(IntToStr(Error));
     except
       on E:Exception do
       ShowMessage(E.ClassName+':'+E.Message);
       end;
     end;
  </code></pre>
  
  <p>I am getting Error code=122. Please help in correcting this Error.</p>
  
  <p>Thanks in Advance </p>
  
  <h2>edit</h2>
  
  <p>I have tried this combo too but it didnt work</p>
  
  <pre><code>  Error:=GetIpForwardTable(nil,@dwSize,FALSE);
    if Error=ERROR_INSUFFICIENT_BUFFER then
      ShowMessage(IntToStr(Error))
    else
    begin
      GetMem(pRouteTable,dwSize);
    Error:=getIpForwardTable(pRouteTable,@dwSize,False);
     if Error=NO_ERROR then
    begin
      ShowMessage(IntToStr(Error));
    end
    else
      ShowMessage(IntToStr(Error));
  </code></pre>