Newsgroups : Borland : borland.public.delphi.internet.winsock : 2005 May : help SetIfEntry

www.cryer.info
Managed Newsgroup Archive

help SetIfEntry

Subject:help SetIfEntry
Posted by:"ryan" (gyt518..@hotmail.com)
Date:Tue, 17 May 2005 22:48:10

hi ,I want to disable my netcard,but the below code is  available in
winxp,but is invalid in window2000!


think you for any advise!

var
  dwIfNumber:DWORD;
  mibIfRow:MIB_IFROW;
  dwResult:Dword; dwIndex:integer;
begin
  dwResult:=NO_ERROR;
  dwResult := GetNumberOfInterfaces(dwIfNumber);
  if (NO_ERROR <> dwResult) then
  begin
        //  return dwResult;
  end;

  for dwIndex:=1 to dwIfNumber do
  begin
    mibIfRow.dwIndex := dwIndex;
    dwResult := GetIfEntry(@mibIfRow);
    if (NO_ERROR <>dwResult) then
    begin
      //return dwResult;
    end;
    mibIfRow.dwAdminStatus :=2; //MIB_IF_ADMIN_STATUS_DOWN;
    mibIfRow.dwOperStatus :=2;
   //  dwResult := SetIfEntry(mibIfRow)=NO_ERROR;
    if SetIfEntry(mibIfRow)=NO_ERROR then caption :='ok' else caption :='no'
  end;

Replies:

www.cryer.info
Managed Newsgroup Archive