AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Netzwerke Delphi Protokoll installiert? (WSAEnumProtocols)
Thema durchsuchen
Ansicht
Themen-Optionen

Protokoll installiert? (WSAEnumProtocols)

Ein Thema von CodeX · begonnen am 17. Mai 2009
Antwort Antwort
CodeX

Registriert seit: 30. Okt 2004
471 Beiträge
 
Delphi 12 Athens
 
#1

Protokoll installiert? (WSAEnumProtocols)

  Alt 17. Mai 2009, 00:52
Ich möchte gerne prüfen, ob das Ipv6 Protokoll installiert ist. Das sollte mit der Funktion WSAEnumProtocols aus Winsock2 möglich sein. Leider erhalte ich bei genau diesem Aufruf [LCount := WSAEnumProtocols(nil,LPInfo,LLen);] den Fehler "Access violation at address 00000000. Read of address 00000000." Warum? Muss noch irgendetwas initialisiert werden? Oder ganz anders?

Delphi-Quellcode:
function IPv6Installiert : Boolean;
var
  LLen : LongWord;
  LPInfo, LPCurPtr : LPWSAProtocol_Info;
  LCount : Integer;
  i : Integer;
begin
  Result := False;
  LLen := 0;
  WSAEnumProtocols(nil,nil,LLen);
  GetMem(LPInfo,LLen);

  try
    LCount := WSAEnumProtocols(nil,LPInfo,LLen);
    if LCount <> SOCKET_ERROR then
    begin
      LPCurPtr := LPInfo;
      for i := 0 to LCount-1 do
      begin
        Memo1.Lines.Add(IntToStr(LPCurPtr^.iAddressFamily));
        Result := (LPCurPtr^.iAddressFamily=PF_INET6);
        if Result then
        begin
          Break;
        end;
        Inc(LPCurPtr);
      end;
    end;
  finally
    FreeMem(LPInfo);
  end;
end;
edit: Falls von Belangen: WSAEnumProtocols kommt aus IdWinsock2 (Indy10).
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:49 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz