Browse Source

* PChar -> PAnsiChar

Michaël Van Canneyt 2 years ago
parent
commit
5f0fadc575

+ 17 - 17
packages/rtl-extra/src/amiga/sockets.pp

@@ -39,13 +39,13 @@ type
   TUnixSockAddr = packed Record
                   sa_len     : cuchar;
                   family       : sa_family_t;
-                  path:array[0..107] of char;    //104 total for freebsd.
+                  path:array[0..107] of AnsiChar;    //104 total for freebsd.
                   end;
 
 type
   hostent = record
-    h_name     : PChar;
-    h_aliases  : PPChar;
+    h_name     : PAnsiChar;
+    h_aliases  : PPAnsiChar;
     h_addrtype : LongInt;
     h_Length   : LongInt;
     h_addr_list: ^PDWord;
@@ -123,10 +123,10 @@ function bsd_bind(s: LongInt location 'd0'; const name: PSockAddr location 'a0';
 function bsd_listen(s: LongInt location 'd0'; BackLog: LongInt location 'd1'): LongInt; syscall SocketBase 42;
 function bsd_accept(s: LongInt location 'd0'; Addr: PSockaddr location 'a0'; AddrLen: PSockLen location 'a1'): LongInt; syscall SocketBase 48;
 function bsd_connect(s : LongInt location 'd0'; const Name: PSockaddr location 'a0'; NameLen: LongInt location 'd1'): LongInt; syscall SocketBase 54;
-function bsd_sendto(s: LongInt location 'd0'; const Msg: PChar location 'a0'; Len: LongInt location 'd1'; Flags: LongInt location 'd2'; const To_: PSockaddr location 'a1'; ToLen: LongInt location 'd3'): LongInt; syscall SocketBase 60;
-function bsd_send(s: LongInt location 'd0'; const msg: PChar location 'a0'; Len: LongInt location 'd1'; Flags: LongInt location 'd2'): LongInt; syscall SocketBase 66;
-function bsd_recvfrom(s: LongInt location 'd0'; Buf: PChar location 'a0'; Len: LongInt location 'd1'; Flags: LongInt location 'd2'; From: PSockaddr location 'a1'; FromLen: PSockLen location 'a2'): LongInt; syscall SocketBase 72;
-function bsd_recv(s: LongInt location 'd0'; buf: PChar location 'a0'; Len: LongInt location 'd1'; Flags: LongInt location 'd2'): LongInt; syscall SocketBase 78;
+function bsd_sendto(s: LongInt location 'd0'; const Msg: PAnsiChar location 'a0'; Len: LongInt location 'd1'; Flags: LongInt location 'd2'; const To_: PSockaddr location 'a1'; ToLen: LongInt location 'd3'): LongInt; syscall SocketBase 60;
+function bsd_send(s: LongInt location 'd0'; const msg: PAnsiChar location 'a0'; Len: LongInt location 'd1'; Flags: LongInt location 'd2'): LongInt; syscall SocketBase 66;
+function bsd_recvfrom(s: LongInt location 'd0'; Buf: PAnsiChar location 'a0'; Len: LongInt location 'd1'; Flags: LongInt location 'd2'; From: PSockaddr location 'a1'; FromLen: PSockLen location 'a2'): LongInt; syscall SocketBase 72;
+function bsd_recv(s: LongInt location 'd0'; buf: PAnsiChar location 'a0'; Len: LongInt location 'd1'; Flags: LongInt location 'd2'): LongInt; syscall SocketBase 78;
 function bsd_shutdown(s: LongInt location 'd0'; How: LongInt location 'd1'): LongInt; syscall SocketBase 84;
 function bsd_setsockopt(s: LongInt location 'd0'; level: LongInt location 'd1'; optname: LongInt location 'd2'; const optval: Pointer location 'a0'; optlen: LongInt location 'd3') : LongInt; syscall SocketBase 90;
 function bsd_getsockopt(s: LongInt location 'd0'; Level: LongInt location 'd1'; OptName: LongInt location 'd2'; OptVal: Pointer location 'a0'; OptLen: PSockLen location 'a1'): LongInt; syscall SocketBase 96;
@@ -134,9 +134,9 @@ function bsd_getsockname(s: LongInt location 'd0'; HostName: PSockaddr location
 function bsd_getpeername(s: LongInt location 'd0'; HostName: PSockaddr location 'a0'; NameLen: PSockLen location 'a1'): LongInt; syscall SocketBase 108;
 function bsd_closesocket(s: LongInt location 'd0'): LongInt; syscall SocketBase 120;
 function bsd_Errno: LongInt; syscall SocketBase 162;
-function bsd_inet_ntoa(in_: LongWord location 'd0'): PChar; syscall SocketBase 174;
-function bsd_inet_addr(const cp: PChar location 'a0'): LongWord; syscall SocketBase 180;
-function bsd_gethostbyname(const Name: PChar location 'a0'): PHostEnt; syscall SocketBase 210;
+function bsd_inet_ntoa(in_: LongWord location 'd0'): PAnsiChar; syscall SocketBase 174;
+function bsd_inet_addr(const cp: PAnsiChar location 'a0'): LongWord; syscall SocketBase 180;
+function bsd_gethostbyname(const Name: PAnsiChar location 'a0'): PHostEnt; syscall SocketBase 210;
 function bsd_gethostbyaddr(const Addr: PByte location 'a0'; Len: LongInt location 'd0'; Type_: LongInt location 'd1'): PHostEnt; syscall SocketBase 216;
 
 { Amiga-specific functions for passing socket descriptors between threads (processes) }
@@ -155,10 +155,10 @@ function bsd_bind(s: LongInt; const name: PSockAddr; NameLen: LongInt): LongInt;
 function bsd_listen(s: LongInt; BackLog: LongInt): LongInt; syscall ISocket 84;
 function bsd_accept(s: LongInt; Addr: PSockaddr; AddrLen: PSockLen): LongInt; syscall ISocket 88;
 function bsd_connect(s : LongInt; const Name: PSockaddr; NameLen: LongInt): LongInt; syscall ISocket 92;
-function bsd_sendto(s: LongInt; const Msg: PChar; Len: LongInt; Flags: LongInt; const To_: PSockaddr; ToLen: LongInt): LongInt; syscall ISocket 96;
-function bsd_send(s: LongInt; const msg: PChar; Len: LongInt; Flags: LongInt): LongInt; syscall ISocket 100;
-function bsd_recvfrom(s: LongInt; Buf: PChar; Len: LongInt; Flags: LongInt; From: PSockaddr; FromLen: PSockLen): LongInt; syscall ISocket 104;
-function bsd_recv(s: LongInt; buf: PChar; Len: LongInt; Flags: LongInt): LongInt; syscall ISocket 108;
+function bsd_sendto(s: LongInt; const Msg: PAnsiChar; Len: LongInt; Flags: LongInt; const To_: PSockaddr; ToLen: LongInt): LongInt; syscall ISocket 96;
+function bsd_send(s: LongInt; const msg: PAnsiChar; Len: LongInt; Flags: LongInt): LongInt; syscall ISocket 100;
+function bsd_recvfrom(s: LongInt; Buf: PAnsiChar; Len: LongInt; Flags: LongInt; From: PSockaddr; FromLen: PSockLen): LongInt; syscall ISocket 104;
+function bsd_recv(s: LongInt; buf: PAnsiChar; Len: LongInt; Flags: LongInt): LongInt; syscall ISocket 108;
 function bsd_shutdown(s: LongInt; How: LongInt): LongInt; syscall ISocket 112;
 function bsd_setsockopt(s: LongInt; level: LongInt; optname: LongInt; const optval: Pointer; optlen: LongInt) : LongInt; syscall ISocket 116;
 function bsd_getsockopt(s: LongInt; Level: LongInt; OptName: LongInt; OptVal: Pointer; OptLen: PSockLen): LongInt; syscall ISocket 120;
@@ -166,9 +166,9 @@ function bsd_getsockname(s: LongInt; HostName: PSockaddr; NameLen: PSockLen): Lo
 function bsd_getpeername(s: LongInt; HostName: PSockaddr; NameLen: PSockLen): LongInt; syscall ISocket 128;
 function bsd_closesocket(s: LongInt): LongInt; syscall ISocket 136;
 function bsd_Errno: LongInt; syscall ISocket 164;
-function bsd_inet_ntoa(in_: LongWord): PChar; syscall ISocket 172;
-function bsd_inet_addr(const cp: PChar): LongWord; syscall ISocket 176;
-function bsd_gethostbyname(const Name: PChar): PHostEnt; syscall ISocket 196;
+function bsd_inet_ntoa(in_: LongWord): PAnsiChar; syscall ISocket 172;
+function bsd_inet_addr(const cp: PAnsiChar): LongWord; syscall ISocket 176;
+function bsd_gethostbyname(const Name: PAnsiChar): PHostEnt; syscall ISocket 196;
 function bsd_gethostbyaddr(const Addr: PByte; Len: LongInt; Type_: LongInt): PHostEnt; syscall ISocket 200;
 
 { Amiga-specific functions for passing socket descriptors between threads (processes) }

+ 10 - 10
packages/rtl-extra/src/aros/sockets.pp

@@ -38,13 +38,13 @@ type
   TUnixSockAddr = packed Record
                   sa_len     : cuchar;
                   family       : sa_family_t;
-                  path:array[0..107] of char;    //104 total for freebsd.
+                  path:array[0..107] of AnsiChar;    //104 total for freebsd.
                   end;
 
 type
   hostent = record
-    h_name     : PChar;
-    h_aliases  : PPChar;
+    h_name     : PAnsiChar;
+    h_aliases  : PPAnsiChar;
     h_addrtype : LongInt;
     h_Length   : LongInt;
     h_addr_list: ^PDWord;
@@ -120,10 +120,10 @@ function bsd_bind(s: LongInt; const name: PSockAddr; NameLen: LongInt): LongInt;
 function bsd_listen(s: LongInt; BackLog: LongInt): LongInt; syscall SocketBase 7;
 function bsd_accept(s: LongInt; Addr: PSockaddr; AddrLen: PSockLen): LongInt; syscall SocketBase 8;
 function bsd_connect(s : LongInt; const Name: PSockaddr; NameLen: LongInt): LongInt; syscall SocketBase 9;
-function bsd_sendto(s: LongInt; const Msg: PChar; Len: LongInt; Flags: LongInt; const To_: PSockaddr; ToLen: LongInt): LongInt; syscall SocketBase 10;
-function bsd_send(s: LongInt; const msg: PChar; Len: LongInt; Flags: LongInt): LongInt; syscall SocketBase 11;
-function bsd_recvfrom(s: LongInt; Buf: PChar; Len: LongInt; Flags: LongInt; From: PSockaddr; FromLen: PSockLen): LongInt; syscall SocketBase 12;
-function bsd_recv(s: LongInt; buf: PChar; Len: LongInt; Flags: LongInt): LongInt; syscall SocketBase 13;
+function bsd_sendto(s: LongInt; const Msg: PAnsiChar; Len: LongInt; Flags: LongInt; const To_: PSockaddr; ToLen: LongInt): LongInt; syscall SocketBase 10;
+function bsd_send(s: LongInt; const msg: PAnsiChar; Len: LongInt; Flags: LongInt): LongInt; syscall SocketBase 11;
+function bsd_recvfrom(s: LongInt; Buf: PAnsiChar; Len: LongInt; Flags: LongInt; From: PSockaddr; FromLen: PSockLen): LongInt; syscall SocketBase 12;
+function bsd_recv(s: LongInt; buf: PAnsiChar; Len: LongInt; Flags: LongInt): LongInt; syscall SocketBase 13;
 function bsd_shutdown(s: LongInt; How: LongInt): LongInt; syscall SocketBase 14;
 function bsd_setsockopt(s: LongInt; level: LongInt; optname: LongInt; const optval: Pointer; optlen: LongInt) : LongInt; syscall SocketBase 15;
 function bsd_getsockopt(s: LongInt; Level: LongInt; OptName: LongInt; OptVal: Pointer; OptLen: PSockLen): LongInt; syscall SocketBase 16;
@@ -131,9 +131,9 @@ function bsd_getsockname(s: LongInt; HostName: PSockaddr; NameLen: PSockLen): Lo
 function bsd_getpeername(s: LongInt; HostName: PSockaddr; NameLen: PSockLen): LongInt; syscall SocketBase 18;
 function bsd_closesocket(s: LongInt): LongInt; syscall SocketBase 20;
 function bsd_Errno: LongInt; syscall SocketBase 27;
-function bsd_inet_ntoa(in_: LongWord): PChar; syscall SocketBase 29;
-function bsd_inet_addr(const cp: PChar): LongWord; syscall SocketBase 30;
-function bsd_gethostbyname(const Name: PChar): PHostEnt; syscall SocketBase 35;
+function bsd_inet_ntoa(in_: LongWord): PAnsiChar; syscall SocketBase 29;
+function bsd_inet_addr(const cp: PAnsiChar): LongWord; syscall SocketBase 30;
+function bsd_gethostbyname(const Name: PAnsiChar): PHostEnt; syscall SocketBase 35;
 function bsd_gethostbyaddr(const Addr: PByte; Len: LongInt; Type_: LongInt): PHostEnt; syscall SocketBase 36;
 
 Implementation

+ 2 - 2
packages/rtl-extra/src/inc/socketsh.inc

@@ -74,7 +74,7 @@ type
      sin_family  : sa_family_t;
      sin_port    : cushort;
      sin_addr    : in_addr;
-     xpad         : array [0..7] of char; { to get to the size of sockaddr... }
+     xpad         : array [0..7] of AnsiChar; { to get to the size of sockaddr... }
   end;
 
   TInetSockAddr = sockaddr_in;
@@ -146,7 +146,7 @@ type
       sun_len     : cuint8;
     {$endif}
     sun_family    : sa_family_t;
-    sun_path      : array[0..107] of char;
+    sun_path      : array[0..107] of AnsiChar;
   end;
 
   Tsocket=longint;   {To easy porting code from Kylix libc unit to sockets unit.}

+ 75 - 75
packages/rtl-extra/src/netwcomn/winsock.pp

@@ -43,7 +43,7 @@ unit winsock;
        ptOS_INT = ^tOS_INT;
        ptOS_UINT = ^tOS_UINT;
 
-       u_char = char;
+       u_char = AnsiChar;
        u_short = word;
        u_int = tOS_UINT;
        u_long = dword;
@@ -114,17 +114,17 @@ unit winsock;
     type
        hostent = record
           { official name of host  }
-          h_name: pchar;
+          h_name: PAnsiChar;
           { alias list  }
-          h_aliases: ^pchar;
+          h_aliases: ^PAnsiChar;
           { host address type  }
           h_addrtype: SmallInt;
           { length of address  }
           h_length: SmallInt;
           { list of addresses  }
           case byte of
-             0: (h_addr_list: ^pchar);
-             1: (h_addr: ^pchar)
+             0: (h_addr_list: ^PAnsiChar);
+             1: (h_addr: ^PAnsiChar)
        end;
        THostEnt = hostent;
        PHostEnt = ^THostEnt;
@@ -134,8 +134,8 @@ unit winsock;
          fits in an unsigned long -- someday that won't be true!
        }
        netent = record
-          n_name : ^char;        // official name of net
-          n_aliases : ^pchar;    // alias list
+          n_name : ^AnsiChar;        // official name of net
+          n_aliases : ^PAnsiChar;    // alias list
           n_addrtype : SmallInt; // net address type
           n_pad1 : SmallInt;     // ensure right packaging
           n_net : u_long;        // network #
@@ -145,23 +145,23 @@ unit winsock;
 
        servent = record
           { official service name  }
-          s_name : ^char;
+          s_name : ^AnsiChar;
           { alias list  }
-          s_aliases : ^pchar;
+          s_aliases : ^PAnsiChar;
           { port #  }
           s_port : SmallInt;
           n_pad1 : SmallInt;    { ensure right packaging }
           { protocol to use  }
-          s_proto : ^char;
+          s_proto : ^AnsiChar;
        end;
        TServEnt = servent;
        PServEnt = ^TServEnt;
 
        protoent = record
           { official protocol name  }
-          p_name : ^char;
+          p_name : ^AnsiChar;
           { alias list  }
-          p_aliases : ^pchar;
+          p_aliases : ^PAnsiChar;
           { protocol #  }
           p_proto : SmallInt;
           p_pad1 : SmallInt;    { ensure packaging }
@@ -240,11 +240,11 @@ unit winsock;
                   sin_family : SmallInt;                      (* 2 byte *)
                   sin_port : u_short;                         (* 2 byte *)
                   sin_addr : TInAddr;                         (* 4 byte *)
-                  sin_zero : array[0..7] of char;             (* 8 byte *)
+                  sin_zero : array[0..7] of AnsiChar;             (* 8 byte *)
                  );
              1 : ( (* equals to sockaddr, size is 16 byte *)
                   sa_family : SmallInt;                       (* 2 byte *)
-                  sa_data : array[0..13] of char;             (* 14 byte *)
+                  sa_data : array[0..13] of AnsiChar;             (* 14 byte *)
                  );
 
          end;
@@ -279,12 +279,12 @@ unit winsock;
        WSADATA = record
           wVersion : WORD;              { 2 byte, ofs 0 }
           wHighVersion : WORD;          { 2 byte, ofs 2 }
-          szDescription : array[0..(WSADESCRIPTION_LEN+1)-1] of char; { 257 byte, ofs 4 }
-          szSystemStatus : array[0..(WSASYS_STATUS_LEN+1)-1] of char; { 129 byte, ofs 261 }
+          szDescription : array[0..(WSADESCRIPTION_LEN+1)-1] of AnsiChar; { 257 byte, ofs 4 }
+          szSystemStatus : array[0..(WSASYS_STATUS_LEN+1)-1] of AnsiChar; { 129 byte, ofs 261 }
           iMaxSockets : word;           { 2 byte, ofs 390 }
           iMaxUdpDg : word;             { 2 byte, ofs 392 }
           pad1 : SmallInt;              { 2 byte, ofs 394 } { ensure right packaging }
-          lpVendorInfo : pchar;         { 4 byte, ofs 396 }
+          lpVendorInfo : PAnsiChar;         { 4 byte, ofs 396 }
        end;                             { total size 400 }
        TWSAData = WSADATA;
        PWSAData = TWSAData;
@@ -752,7 +752,7 @@ unit winsock;
 
     TWSABUF = record
             len : u_long;
-            buf : ^char;
+            buf : ^AnsiChar;
          end;
     _WSABUF = TWSABUF;
     LPWSABUF = ^TWSABUF;
@@ -866,7 +866,7 @@ unit winsock;
             iSecurityScheme    : longint;
             dwMessageSize      : DWORD;
             dwProviderReserved : DWORD;
-            szProtocol         : array[0..(WSAPROTOCOL_LEN + 1)-1] of CHAR;
+            szProtocol         : array[0..(WSAPROTOCOL_LEN + 1)-1] of AnsiChar;
          end;
        LPWSAPROTOCOL_INFOA = ^TWSAPROTOCOL_INFOA;
        PWSAPROTOCOL_INFOA  = ^TWSAPROTOCOL_INFOA;
@@ -1102,16 +1102,16 @@ unit winsock;
 
        TWSAQuerySetA = record
             dwSize : DWORD;
-            lpszServiceInstanceName : PChar;
+            lpszServiceInstanceName : PAnsiChar;
             lpServiceClassId : LPGUID;
             lpVersion : LPWSAVERSION;
-            lpszComment : PChar;
+            lpszComment : PAnsiChar;
             dwNameSpace : DWORD;
             lpNSProviderId : LPGUID;
-            lpszContext : PChar;
+            lpszContext : PAnsiChar;
             dwNumberOfProtocols : DWORD;
             lpafpProtocols : LPAFPROTOCOLS;
-            lpszQueryString : PChar;
+            lpszQueryString : PAnsiChar;
             dwNumberOfCsAddrs : DWORD;
             lpcsaBuffer : LPCSADDR_INFO;
             dwOutputFlags : DWORD;
@@ -1186,7 +1186,7 @@ unit winsock;
     { Service Installation/Removal Data Types. }
 
        TWSANSClassInfoA = record
-            lpszName    : PChar;
+            lpszName    : PAnsiChar;
             dwNameSpace : DWORD;
             dwValueType : DWORD;
             dwValueSize : DWORD;
@@ -1219,7 +1219,7 @@ unit winsock;
     type
        TWSAServiceClassInfoA = record
             lpServiceClassId     : LPGUID;
-            lpszServiceClassName : PChar;
+            lpszServiceClassName : PAnsiChar;
             dwCount              : DWORD;
             lpClassInfos         : LPWSANSCLASSINFOA;
          end;
@@ -1253,7 +1253,7 @@ unit winsock;
             dwNameSpace   : DWORD;
             fActive       : BOOL;
             dwVersion     : DWORD;
-            lpszIdentifier: PChar;
+            lpszIdentifier: PAnsiChar;
          end;
        PWSANAMESPACE_INFOA = ^TWSANAMESPACE_INFOA;
        LPWSANAMESPACE_INFOA = ^TWSANAMESPACE_INFOA;
@@ -1442,29 +1442,29 @@ unit winsock;
 
      Tsslcipheropts = record
           n : longint;
-          specs : array[0..2] of char;
+          specs : array[0..2] of AnsiChar;
        end;
 
      Tsslclientopts = record
-          cert : PChar;
+          cert : PAnsiChar;
           certlen : longint;
           sidtimeout : time_t;
           sidentries : longint;
-          siddir : PChar;
+          siddir : PAnsiChar;
        end;
 
      Tsslserveropts = record
-          cert : PChar;
+          cert : PAnsiChar;
           certlen : longint;
           sidtimeout : time_t;
           sidentries : longint;
-          siddir : PChar;
+          siddir : PAnsiChar;
        end;
 
   {not suppported }
      {Tsslauthcertopts = record
           _type : longint;
-          func : function (arg:pointer; cert:Pchar; len:longint):longint;cdecl;
+          func : function (arg:pointer; cert:PAnsiChar; len:longint):longint;cdecl;
           arg : pointer;
        end;}
 
@@ -1486,7 +1486,7 @@ unit winsock;
 
   type
      sslrsaencrypthook = record
-          func : function (arg:pointer; blockType:longint; dest:Pchar; destlen:Plongint; src:Pchar;
+          func : function (arg:pointer; blockType:longint; dest:PAnsiChar; destlen:Plongint; src:PAnsiChar;
                        srclen:longint):longint; cdecl;
           arg : pointer;
        end;
@@ -1503,7 +1503,7 @@ unit winsock;
 
   type
      Tsslrsadecrypthook = record
-          func : function (arg:pointer; blockType:longint; dest:Pchar; destlen:Plongint; src:Pchar;
+          func : function (arg:pointer; blockType:longint; dest:PAnsiChar; destlen:Plongint; src:PAnsiChar;
                        srclen:longint):longint; cdecl;
           arg : pointer;
        end;
@@ -1582,7 +1582,7 @@ unit winsock;
   type
      Ttlscipheropts = record
           n : longint;
-          specs : array[0..2] of char;
+          specs : array[0..2] of AnsiChar;
        end;
      Ptlscipheropts = ^Ttlscipheropts;
 
@@ -1591,7 +1591,7 @@ unit winsock;
           walletlen : longint;
           sidtimeout : time_t;
           sidentries : longint;
-          siddir : PChar;  // ^char;
+          siddir : PAnsiChar;  // ^AnsiChar;
           options : pointer;
        end;
      Ptlsclientopts = ^Ttlsclientopts;
@@ -1601,7 +1601,7 @@ unit winsock;
           walletlen : longint;
           sidtimeout : time_t;
           sidentries : longint;
-          siddir : PChar;  // ^char;
+          siddir : PAnsiChar;  // ^AnsiChar;
           options : pointer;
        end;
      Ptlsserveropts = ^Ttlsserveropts;
@@ -1633,7 +1633,7 @@ unit winsock;
   {not suppported }
      {tlsauthcertopts = record
           _type : longint;
-          func : function (arg:pointer; cert:Pchar; len:longint):longint; cdecl;
+          func : function (arg:pointer; cert:PAnsiChar; len:longint):longint; cdecl;
           arg : pointer;
        end;}
 
@@ -1655,7 +1655,7 @@ unit winsock;
 
   type
      Ttlsrsaencrypthook = record
-          func : function (arg:pointer; blockType:longint; dest:Pchar; destlen:Plongint; src:Pchar;
+          func : function (arg:pointer; blockType:longint; dest:PAnsiChar; destlen:Plongint; src:PAnsiChar;
                        srclen:longint):longint; cdecl;
           arg : pointer;
        end;
@@ -1673,7 +1673,7 @@ unit winsock;
 
   type
      Ttlsrsadecrypthook = record
-          func : function (arg:pointer; blockType:longint; dest:Pchar; destlen:Plongint; src:Pchar;
+          func : function (arg:pointer; blockType:longint; dest:PAnsiChar; destlen:Plongint; src:PAnsiChar;
                        srclen:longint):longint; cdecl;
           arg : pointer;
        end;
@@ -1689,7 +1689,7 @@ unit winsock;
 
   type
      Ttlscert = record
-          cert : PChar;
+          cert : PAnsiChar;
           certlen : longint;
        end;
      Ptlscert = ^Ttlscert;
@@ -1820,14 +1820,14 @@ unit winsock;
     {$endif}
 
 {
-Winsock types all buffers as pchar (char *), modern POSIX does it the ANSI
+Winsock types all buffers as PAnsiChar (AnsiChar *), modern POSIX does it the ANSI
 C way with pointer (void *). If the pointer overloaded version doesn't exist,
 a "pointer" will be passed to the "var" version. (bug 3142).
 So if there are var/const versions:
 - To keep ported unix code working, there must be "pointer" variants (ANSI)
-- To keep Delphi/ported C Winsock code working there must be pchar variants
+- To keep Delphi/ported C Winsock code working there must be PAnsiChar variants
         (K&R)
-IOW, there _must_ be 3 versions then: var/const, pchar and pointer}
+IOW, there _must_ be 3 versions then: var/const, PAnsiChar and pointer}
 
     {$ifdef netware}
     function accept(s:TSocket; addr: PSockAddr; addrlen : ptOS_INT) : TSocket;
@@ -1852,13 +1852,13 @@ IOW, there _must_ be 3 versions then: var/const, pchar and pointer}
     function ioctlsocket(s:TSocket; cmd:longint; argp:pu_long):tOS_INT;{$ifdef Netware}cdecl;{$else}stdcall;{$endif}external winsockdll name _fn_ioctlsocket;
     function getpeername(s:TSocket; var name:TSockAddr;var namelen:tOS_INT):tOS_INT;{$ifdef Netware}cdecl;{$else}stdcall;{$endif} external winsockdll name _fn_getpeername;
     function getsockname(s:TSocket; var name:TSockAddr;var namelen:tOS_INT):tOS_INT;{$ifdef Netware}cdecl;{$else}stdcall;{$endif} external winsockdll name _fn_getpeername;
-    function getsockopt(s:TSocket; level:tOS_INT; optname:tOS_INT; optval:pchar;var optlen:tOS_INT):tOS_INT;{$ifdef Netware}cdecl;{$else}stdcall;{$endif} external winsockdll name _fn_getsockopt;
+    function getsockopt(s:TSocket; level:tOS_INT; optname:tOS_INT; optval:PAnsiChar;var optlen:tOS_INT):tOS_INT;{$ifdef Netware}cdecl;{$else}stdcall;{$endif} external winsockdll name _fn_getsockopt;
     function getsockopt(s:TSocket; level:tOS_INT; optname:tOS_INT; optval:pointer;var optlen:tOS_INT):tOS_INT;{$ifdef Netware}cdecl;{$else}stdcall;{$endif} external winsockdll name _fn_getsockopt;
     function getsockopt(s:TSocket; level:tOS_INT; optname:tOS_INT;var optval;var optlen:tOS_INT):tOS_INT;{$ifdef Netware}cdecl;{$else}stdcall;{$endif} external winsockdll name _fn_getsockopt;
     function htonl(hostlong:u_long):u_long;{$ifdef Netware}cdecl;{$else}stdcall;{$endif}external winsockdll name _fn_htonl;
     function htons(hostshort:u_short):u_short;{$ifdef Netware}cdecl;{$else}stdcall;{$endif}external winsockdll name _fn_htons;
-    function inet_addr(cp:pchar):cardinal;{$ifdef Netware}cdecl;{$else}stdcall;{$endif}external winsockdll name _fn_inet_addr;
-    function inet_ntoa(i : TInAddr):pchar;{$ifdef Netware}cdecl;{$else}stdcall;{$endif}external winsockdll name _fn_inet_ntoa;
+    function inet_addr(cp:PAnsiChar):cardinal;{$ifdef Netware}cdecl;{$else}stdcall;{$endif}external winsockdll name _fn_inet_addr;
+    function inet_ntoa(i : TInAddr):PAnsiChar;{$ifdef Netware}cdecl;{$else}stdcall;{$endif}external winsockdll name _fn_inet_ntoa;
     function listen(s:TSocket; backlog:tOS_INT):tOS_INT;{$ifdef Netware}cdecl;{$else}stdcall;{$endif}external winsockdll name _fn_listen;
     { are ntohl and ntohs macros or bsd-functions (for netware) ?? }
     {$ifndef netware}
@@ -1866,35 +1866,35 @@ IOW, there _must_ be 3 versions then: var/const, pchar and pointer}
     function ntohs(netshort:u_short):u_short;{$ifdef Netware}cdecl;{$else}stdcall;{$endif}external winsockdll name 'ntohs';
     {$endif}
 
-    function recv(s:TSocket;buf:pchar; len:tOS_INT; flags:tOS_INT):tOS_INT;{$ifdef Netware}cdecl;{$else}stdcall;{$endif}external winsockdll name _fn_recv;
+    function recv(s:TSocket;buf:PAnsiChar; len:tOS_INT; flags:tOS_INT):tOS_INT;{$ifdef Netware}cdecl;{$else}stdcall;{$endif}external winsockdll name _fn_recv;
     function recv(s:TSocket;buf:pointer; len:tOS_INT; flags:tOS_INT):tOS_INT;{$ifdef Netware}cdecl;{$else}stdcall;{$endif}external winsockdll name _fn_recv;
     function recv(s:TSocket;var buf; len:tOS_INT; flags:tOS_INT):tOS_INT;{$ifdef Netware}cdecl;{$else}stdcall;{$endif}external winsockdll name _fn_recv;
-    function recvfrom(s:TSocket;buf:pchar; len:tOS_INT; flags:tOS_INT;from:PSockAddr; fromlen:ptOS_INT):tOS_INT;{$ifdef Netware}cdecl;{$else}stdcall;{$endif} external winsockdll name _fn_recvfrom;
+    function recvfrom(s:TSocket;buf:PAnsiChar; len:tOS_INT; flags:tOS_INT;from:PSockAddr; fromlen:ptOS_INT):tOS_INT;{$ifdef Netware}cdecl;{$else}stdcall;{$endif} external winsockdll name _fn_recvfrom;
     function recvfrom(s:TSocket;buf:pointer; len:tOS_INT; flags:tOS_INT;from:PSockAddr; fromlen:ptOS_INT):tOS_INT;{$ifdef Netware}cdecl;{$else}stdcall;{$endif} external winsockdll name _fn_recvfrom;
     function recvfrom(s:TSocket;var buf; len:tOS_INT; flags:tOS_INT;Const from:TSockAddr; var fromlen:tOS_INT):tOS_INT;{$ifdef Netware}cdecl;{$else}stdcall;{$endif} external winsockdll name _fn_recvfrom;
     function select(nfds:tOS_INT; readfds,writefds,exceptfds : PFDSet;timeout: PTimeVal):tOS_INT;{$ifdef Netware}cdecl;{$else}stdcall;{$endif} external winsockdll name _fn_select;
     function send(s:TSocket;const buf; len:tOS_INT; flags:tOS_INT):tOS_INT;{$ifdef Netware}cdecl;{$else}stdcall;{$endif} external winsockdll name _fn_send;
-    function send(s:TSocket;buf : pchar; len:tOS_INT; flags:tOS_INT):tOS_INT;{$ifdef Netware}cdecl;{$else}stdcall;{$endif} external winsockdll name _fn_send;
+    function send(s:TSocket;buf : PAnsiChar; len:tOS_INT; flags:tOS_INT):tOS_INT;{$ifdef Netware}cdecl;{$else}stdcall;{$endif} external winsockdll name _fn_send;
     function send(s:TSocket;buf : pointer; len:tOS_INT; flags:tOS_INT):tOS_INT;{$ifdef Netware}cdecl;{$else}stdcall;{$endif} external winsockdll name _fn_send;
-    function sendto(s:TSocket; buf:pchar; len:tOS_INT; flags:tOS_INT;toaddr:PSockAddr; tolen:tOS_INT):tOS_INT;{$ifdef Netware}cdecl;{$else}stdcall;{$endif} external winsockdll name _fn_sendto;
+    function sendto(s:TSocket; buf:PAnsiChar; len:tOS_INT; flags:tOS_INT;toaddr:PSockAddr; tolen:tOS_INT):tOS_INT;{$ifdef Netware}cdecl;{$else}stdcall;{$endif} external winsockdll name _fn_sendto;
     function sendto(s:TSocket; buf:pointer; len:tOS_INT; flags:tOS_INT;toaddr:PSockAddr; tolen:tOS_INT):tOS_INT;{$ifdef Netware}cdecl;{$else}stdcall;{$endif} external winsockdll name _fn_sendto;
     function sendto(s:TSocket; const buf; len:tOS_INT; flags:tOS_INT;Const toaddr:TSockAddr; tolen:tOS_INT):tOS_INT;{$ifdef Netware}cdecl;{$else}stdcall;{$endif}
       external winsockdll name _fn_sendto;
 
-    function setsockopt(s:TSocket; level:tOS_INT; optname:tOS_INT; optval:pchar; optlen:tOS_INT):tOS_INT;{$ifdef Netware}cdecl;{$else}stdcall;{$endif} external winsockdll name _fn_setsockopt;
+    function setsockopt(s:TSocket; level:tOS_INT; optname:tOS_INT; optval:PAnsiChar; optlen:tOS_INT):tOS_INT;{$ifdef Netware}cdecl;{$else}stdcall;{$endif} external winsockdll name _fn_setsockopt;
     function setsockopt(s:TSocket; level:tOS_INT; optname:tOS_INT; Const optval; optlen:tOS_INT):tOS_INT;{$ifdef Netware}cdecl;{$else}stdcall;{$endif} external winsockdll name _fn_setsockopt;
     function setsockopt(s:TSocket; level:tOS_INT; optname:tOS_INT; optval:pointer; optlen:tOS_INT):tOS_INT;{$ifdef Netware}cdecl;{$else}stdcall;{$endif} external winsockdll name _fn_setsockopt;
     function shutdown(s:TSocket; how:tOS_INT):tOS_INT;{$ifdef Netware}cdecl;{$else}stdcall;{$endif} external winsockdll name _fn_shutdown;
     function socket(af:tOS_INT; t:tOS_INT; protocol:tOS_INT):TSocket;{$ifdef Netware}cdecl;{$else}stdcall;{$endif} external winsockdll name _fn_socket;
 
     { Database function prototypes  }
-    function gethostbyaddr(addr:pchar; len:tOS_INT; t:tOS_INT): PHostEnt;{$ifdef Netware}cdecl;{$else}stdcall;{$endif}external winsockdll name _fn_gethostbyaddr;
-    function gethostbyname(name:pchar):PHostEnt;{$ifdef Netware}cdecl;{$else}stdcall;{$endif}external winsockdll name _fn_gethostbyname;
-    function gethostname(name:pchar; namelen:tOS_INT):tOS_INT;{$ifdef Netware}cdecl;{$else}stdcall;{$endif}external winsockdll name _fn_gethostname;
-    function getservbyport(port:tOS_INT; proto:pchar):PServEnt;{$ifdef Netware}cdecl;{$else}stdcall;{$endif}external winsockdll name _fn_getservbyport;
-    function getservbyname(name:pchar; proto:pchar):PServEnt;{$ifdef Netware}cdecl;{$else}stdcall;{$endif}external winsockdll name _fn_getservbyname;
+    function gethostbyaddr(addr:PAnsiChar; len:tOS_INT; t:tOS_INT): PHostEnt;{$ifdef Netware}cdecl;{$else}stdcall;{$endif}external winsockdll name _fn_gethostbyaddr;
+    function gethostbyname(name:PAnsiChar):PHostEnt;{$ifdef Netware}cdecl;{$else}stdcall;{$endif}external winsockdll name _fn_gethostbyname;
+    function gethostname(name:PAnsiChar; namelen:tOS_INT):tOS_INT;{$ifdef Netware}cdecl;{$else}stdcall;{$endif}external winsockdll name _fn_gethostname;
+    function getservbyport(port:tOS_INT; proto:PAnsiChar):PServEnt;{$ifdef Netware}cdecl;{$else}stdcall;{$endif}external winsockdll name _fn_getservbyport;
+    function getservbyname(name:PAnsiChar; proto:PAnsiChar):PServEnt;{$ifdef Netware}cdecl;{$else}stdcall;{$endif}external winsockdll name _fn_getservbyname;
     function getprotobynumber(proto:tOS_INT):PProtoEnt;{$ifdef Netware}cdecl;{$else}stdcall;{$endif}external winsockdll name _fn_getprotobynumber;
-    function getprotobyname(name:pchar):PProtoEnt;{$ifdef Netware}cdecl;{$else}stdcall;{$endif}external winsockdll name _fn_getprotobyname;
+    function getprotobyname(name:PAnsiChar):PProtoEnt;{$ifdef Netware}cdecl;{$else}stdcall;{$endif}external winsockdll name _fn_getprotobyname;
 
     { Microsoft Windows Extension function prototypes  }
     function WSAStartup(wVersionRequired:word;var WSAData:TWSADATA):tOS_INT;
@@ -1908,18 +1908,18 @@ IOW, there _must_ be 3 versions then: var/const, pchar and pointer}
     {$endif}
     function WSACancelBlockingCall:tOS_INT;{$ifdef Netware}cdecl;{$else}stdcall;{$endif}external winsockdll name 'WSACancelBlockingCall';
     {$ifndef netware}
-    function WSAAsyncGetServByName(hWnd:HWND; wMsg:u_int; name:pchar; proto:pchar; buf:pchar;
+    function WSAAsyncGetServByName(hWnd:HWND; wMsg:u_int; name:PAnsiChar; proto:PAnsiChar; buf:PAnsiChar;
                                    buflen:tOS_INT):THandle;stdcall;external winsockdll name 'WSAAsyncGetServByName';
-    function WSAAsyncGetServByPort(hWnd:HWND; wMsg:u_int; port:tOS_INT; proto:pchar; buf:pchar;
+    function WSAAsyncGetServByPort(hWnd:HWND; wMsg:u_int; port:tOS_INT; proto:PAnsiChar; buf:PAnsiChar;
                                    buflen:tOS_INT):THandle;stdcall;external winsockdll name 'WSAAsyncGetServByPort';
-    function WSAAsyncGetProtoByName(hWnd:HWND; wMsg:u_int; name:pchar; buf:pchar; buflen:tOS_INT):THandle;stdcall;
+    function WSAAsyncGetProtoByName(hWnd:HWND; wMsg:u_int; name:PAnsiChar; buf:PAnsiChar; buflen:tOS_INT):THandle;stdcall;
       external winsockdll name 'WSAAsyncGetProtoByName';
-    function WSAAsyncGetProtoByNumber(hWnd:HWND; wMsg:u_int; number:tOS_INT; buf:pchar; buflen:tOS_INT):THandle;stdcall;
+    function WSAAsyncGetProtoByNumber(hWnd:HWND; wMsg:u_int; number:tOS_INT; buf:PAnsiChar; buflen:tOS_INT):THandle;stdcall;
       external winsockdll name 'WSAAsyncGetProtoByNumber';
-    function WSAAsyncGetHostByName(hWnd:HWND; wMsg:u_int; name:pchar; buf:pchar; buflen:tOS_INT):THandle;stdcall;
+    function WSAAsyncGetHostByName(hWnd:HWND; wMsg:u_int; name:PAnsiChar; buf:PAnsiChar; buflen:tOS_INT):THandle;stdcall;
       external winsockdll name 'WSAAsyncGetHostByName';
-    function WSAAsyncGetHostByAddr(hWnd:HWND; wMsg:u_int; addr:pchar; len:tOS_INT; t:tOS_INT;
-                                   buf:pchar; buflen:tOS_INT):THandle;stdcall;
+    function WSAAsyncGetHostByAddr(hWnd:HWND; wMsg:u_int; addr:PAnsiChar; len:tOS_INT; t:tOS_INT;
+                                   buf:PAnsiChar; buflen:tOS_INT):THandle;stdcall;
                                    external winsockdll name 'WSAAsyncGetHostByAddr';
     function WSACancelAsyncRequest(hAsyncTaskHandle:THandle):tOS_INT;stdcall;
       external winsockdll name 'WSACancelAsyncRequest';
@@ -2062,7 +2062,7 @@ IOW, there _must_ be 3 versions then: var/const, pchar and pointer}
     function WSANtohs(s:TSocket;netshort:u_short;var hostshort:u_short):longint;
     {$ifdef Netware}cdecl;{$else}stdcall;{$endif} external winsockdll name 'WSANtohs';
 
-    function WSARecv(s:TSocket;buf:pchar; dwBufferCount:dword;
+    function WSARecv(s:TSocket;buf:PAnsiChar; dwBufferCount:dword;
                      lpNumberOfBytesRecvd,lpFlags : LPDWORD;
                      lpOverlapped:PWSAOVERLAPPED;
                      lpCompletionRoutine:TWSAOVERLAPPED_COMPLETION_ROUTINE):longint;
@@ -2086,7 +2086,7 @@ IOW, there _must_ be 3 versions then: var/const, pchar and pointer}
     function WSARecvDisconnect(s:TSocket;var InboundDisconnectData:TWSABUF):longint;
     {$ifdef Netware}cdecl;{$else}stdcall;{$endif} external winsockdll name 'WSARecvDisconnect';
 
-    function WSARecvFrom(s:TSocket;buf:pchar; dwBufferCount:dword;
+    function WSARecvFrom(s:TSocket;buf:PAnsiChar; dwBufferCount:dword;
                      lpNumberOfBytesRecvd,lpFlags : LPDWORD;
                      lpFrom: PSockaddr;
                      lpFromlen: PDWORD;
@@ -2113,7 +2113,7 @@ IOW, there _must_ be 3 versions then: var/const, pchar and pointer}
     function WSAResetEvent(hEvent:TWSAEVENT):BOOL;
     {$ifdef Netware}cdecl;{$else}stdcall;{$endif} external winsockdll name 'WSAResetEvent';
 
-    function WSASend(s:TSocket;buf:pchar;len:dword;
+    function WSASend(s:TSocket;buf:PAnsiChar;len:dword;
                      NumberOfBytesSent:PDWORD; Flags:dword;
                      lpOverlapped:PWSAOVERLAPPED;
                      lpCompletionRoutine:TWSAOVERLAPPED_COMPLETION_ROUTINE):longint;
@@ -2134,7 +2134,7 @@ IOW, there _must_ be 3 versions then: var/const, pchar and pointer}
     function WSASendDisconnect(s:TSocket;lpOutboundDisconnectData:PWSABUF):longint;
     {$ifdef Netware}cdecl;{$else}stdcall;{$endif} external winsockdll name 'WSASendDisconnect';
 
-    function WSASendTo(s:TSocket;buf:pchar;len:dword;
+    function WSASendTo(s:TSocket;buf:PAnsiChar;len:dword;
                        NumberOfBytesSent:LPDWORD;
                        Flags:dword;
                        lpTo: PSockaddr;
@@ -2176,24 +2176,24 @@ IOW, there _must_ be 3 versions then: var/const, pchar and pointer}
 
     function WSAAddressToString(addr:PSockAddr; len:dword;
                                ProtocolInfo:PWSAPROTOCOL_INFO;
-                               lpszAddressString:pchar;
+                               lpszAddressString:PAnsiChar;
                                lpdwAddressStringLength:lpdword):longint;
     {$ifdef Netware}cdecl;{$else}stdcall;{$endif} external winsockdll name 'WSAAddressToStringA';
 
     function WSAAddressToString(var addr:TSockAddr; len:dword;
                                ProtocolInfo:PWSAPROTOCOL_INFO;
-                               lpszAddressString:pchar;
+                               lpszAddressString:PAnsiChar;
                                var lpdwAddressStringLength:dword):longint;
     {$ifdef Netware}cdecl;{$else}stdcall;{$endif} external winsockdll name 'WSAAddressToStringA';
 
-    function WSAStringToAddress (AddressString  : pchar;
+    function WSAStringToAddress (AddressString  : PAnsiChar;
                                  AddressFamily  : longint;
                                  lpProtocolInfo : PWSAPROTOCOL_INFOA;
                              VAR lpAddress      : TSOCKADDR;
                              VAR lpAddressLength: LONGINT) : longint;
     {$ifdef Netware}cdecl;{$else}stdcall;{$endif} external winsockdll name 'WSAStringToAddressA';
 
-    function WSAStringToAddress (AddressString  : pchar;
+    function WSAStringToAddress (AddressString  : PAnsiChar;
                                  AddressFamily  : longint;
                                  lpProtocolInfo : PWSAPROTOCOL_INFOA;
                                  lpAddress      : PSOCKADDR;
@@ -2235,10 +2235,10 @@ IOW, there _must_ be 3 versions then: var/const, pchar and pointer}
     function WSAEnumNameSpaceProviders(var BufferLength:DWORD;var Buffer:TWSANAMESPACE_INFO):longint;
     {$ifdef Netware}cdecl;{$else}stdcall;{$endif}external winsockdll name 'WSAEnumNameSpaceProvidersA';
 
-    function WSAGetServiceClassNameByClassId(lpServiceClassId:PGUID;lpszServiceClassName:pchar;buflen:PDWORD):longint;
+    function WSAGetServiceClassNameByClassId(lpServiceClassId:PGUID;lpszServiceClassName:PAnsiChar;buflen:PDWORD):longint;
     {$ifdef Netware}cdecl;{$else}stdcall;{$endif}external winsockdll name 'WSAGetServiceClassNameByClassIdA';
 
-    function WSAGetServiceClassNameByClassId(var lpServiceClassId:TGUID;lpszServiceClassName:pchar;var buflen:DWORD):longint;
+    function WSAGetServiceClassNameByClassId(var lpServiceClassId:TGUID;lpszServiceClassName:PAnsiChar;var buflen:DWORD):longint;
     {$ifdef Netware}cdecl;{$else}stdcall;{$endif}external winsockdll name 'WSAGetServiceClassNameByClassIdA';
 
     function WSASetService(lpqsRegInfo:PWSAQUERYSET;essoperation:TWSAESETSERVICEOP;flags:dword):longint;

+ 1 - 1
packages/rtl-extra/src/os2commn/sockets.pp

@@ -609,7 +609,7 @@ const
   EMXLib: string [8] = 'emx.dll'#0;
   CBufLen = 260;
 var
-  CBuf: array [1..CBufLen] of char;
+  CBuf: array [1..CBufLen] of AnsiChar;
 begin
   if not EMXHandles then
    begin

+ 1 - 1
packages/rtl-extra/src/unix/sockets.pp

@@ -40,7 +40,7 @@ type
                     sa_len     : cuchar;
                  {$endif}
                   family       : sa_family_t;
-                  path:array[0..107] of char;    //104 total for freebsd.
+                  path:array[0..107] of AnsiChar;    //104 total for freebsd.
                   end;
 
 const

+ 45 - 45
packages/rtl-extra/src/win/winsock.pp

@@ -41,7 +41,7 @@ unit WinSock;
        tOS_UINT = DWord;
        ptOS_INT = ^tOS_INT;
        ptOS_UINT = ^tOS_UINT;
-       u_char = char;
+       u_char = AnsiChar;
        u_short = word;
        u_int = tOS_UINT;
        u_long = dword;
@@ -101,17 +101,17 @@ unit WinSock;
     type
        hostent = record
           { official name of host  }
-          h_name: pchar;
+          h_name: PAnsiChar;
           { alias list  }
-          h_aliases: ^pchar;
+          h_aliases: ^PAnsiChar;
           { host address type  }
           h_addrtype: SmallInt;
           { length of address  }
           h_length: SmallInt;
           { list of addresses  }
           case byte of
-             0: (h_addr_list: ^pchar);
-             1: (h_addr: ^pchar)
+             0: (h_addr_list: ^PAnsiChar);
+             1: (h_addr: ^PAnsiChar)
        end;
        THostEnt = hostent;
        PHostEnt = ^THostEnt;
@@ -122,9 +122,9 @@ unit WinSock;
        }
        netent = record
           { official name of net  }
-          n_name : ^char;
+          n_name : ^AnsiChar;
           { alias list  }
-          n_aliases : ^pchar;
+          n_aliases : ^PAnsiChar;
           { net address type  }
           n_addrtype : SmallInt;
           n_pad1 : SmallInt;    { ensure right packaging }
@@ -136,12 +136,12 @@ unit WinSock;
 
        servent = record
           { official service name  }
-          s_name : ^char;
+          s_name : ^AnsiChar;
           { alias list  }
-          s_aliases : ^pchar;
+          s_aliases : ^PAnsiChar;
 {$ifdef WIN64}
           { protocol to use  }
-          s_proto : ^char;
+          s_proto : ^AnsiChar;
           { port #  }
           s_port : SmallInt;
 {$else WIN64}
@@ -149,7 +149,7 @@ unit WinSock;
           s_port : SmallInt;
           n_pad1 : SmallInt;    { ensure right packaging }
           { protocol to use  }
-          s_proto : ^char;
+          s_proto : ^AnsiChar;
 {$endif WIN64}
        end;
        TServEnt = servent;
@@ -157,9 +157,9 @@ unit WinSock;
 
        protoent = record
           { official protocol name  }
-          p_name : ^char;
+          p_name : ^AnsiChar;
           { alias list  }
-          p_aliases : ^pchar;
+          p_aliases : ^PAnsiChar;
           { protocol #  }
           p_proto : SmallInt;
           p_pad1 : SmallInt;    { ensure packaging }
@@ -238,11 +238,11 @@ unit WinSock;
                   sin_family : SmallInt;                (* 2 byte *)
                   sin_port : u_short;                   (* 2 byte *)
                   sin_addr : TInAddr;                   (* 4 byte *)
-                  sin_zero : array[0..8-1] of char;     (* 8 byte *)
+                  sin_zero : array[0..8-1] of AnsiChar;     (* 8 byte *)
                  );
              1 : ((* equals to sockaddr, size is 16 byte *)
                   sa_family : Smallint; (* 2 byte *)
-                  sa_data : array[0..14-1] of char;    (* 14 byte *)
+                  sa_data : array[0..14-1] of AnsiChar;    (* 14 byte *)
                  );
        end;
        TSockAddrIn = sockaddr_in;
@@ -278,15 +278,15 @@ unit WinSock;
 {$ifdef win64}
           iMaxSockets : word;           { 2 byte, ofs 390 }
           iMaxUdpDg : word;             { 2 byte, ofs 392 }
-          lpVendorInfo : pchar;         { 4 byte, ofs 396 }
-          szDescription : array[0..WSADESCRIPTION_LEN] of char; { 257 byte, ofs 4 }
-          szSystemStatus : array[0..WSASYS_STATUS_LEN] of char; { 129 byte, ofs 261 }
+          lpVendorInfo : PAnsiChar;         { 4 byte, ofs 396 }
+          szDescription : array[0..WSADESCRIPTION_LEN] of AnsiChar; { 257 byte, ofs 4 }
+          szSystemStatus : array[0..WSASYS_STATUS_LEN] of AnsiChar; { 129 byte, ofs 261 }
 {$else win64}
-          szDescription : array[0..WSADESCRIPTION_LEN] of char; { 257 byte, ofs 4 }
-          szSystemStatus : array[0..WSASYS_STATUS_LEN] of char; { 129 byte, ofs 261 }
+          szDescription : array[0..WSADESCRIPTION_LEN] of AnsiChar; { 257 byte, ofs 4 }
+          szSystemStatus : array[0..WSASYS_STATUS_LEN] of AnsiChar; { 129 byte, ofs 261 }
           iMaxSockets : word;           { 2 byte, ofs 390 }
           iMaxUdpDg : word;             { 2 byte, ofs 392 }
-          lpVendorInfo : pchar;         { 4 byte, ofs 396 }
+          lpVendorInfo : PAnsiChar;         { 4 byte, ofs 396 }
 {$endif win64}
        end;
        TWSAData = WSADATA;
@@ -689,14 +689,14 @@ unit WinSock;
        winsockdll = 'wsock32.dll';
 
 {
-Winsock types all buffers as pchar (char *), modern POSIX does it the ANSI
+Winsock types all buffers as PAnsiChar (AnsiChar *), modern POSIX does it the ANSI
 C way with pointer (void *). If the pointer overloaded version doesn't exist,
 a "pointer" will be passed to the "var" version. (bug 3142).
 So if there are var/const versions:
 - To keep ported unix code working, there must be "pointer" variants (ANSI)
-- To keep Delphi/ported C Winsock code working there must be pchar variants
+- To keep Delphi/ported C Winsock code working there must be PAnsiChar variants
         (K&R)
-IOW, there _must_ be 3 versions then: var/const, pchar and pointer}
+IOW, there _must_ be 3 versions then: var/const, PAnsiChar and pointer}
 
     function accept(s:TSocket; addr: PSockAddr; addrlen : ptOS_INT) : TSocket;stdcall;external winsockdll name 'accept';
     function accept(s:TSocket; addr: PSockAddr; var addrlen : tOS_INT) : TSocket;stdcall;external winsockdll name 'accept';
@@ -712,7 +712,7 @@ IOW, there _must_ be 3 versions then: var/const, pchar and pointer}
       external winsockdll name 'getpeername';
     function getsockname(s:TSocket; var name:TSockAddr;var namelen:tOS_INT):tOS_INT;stdcall;
       external winsockdll name 'getsockname';
-    function getsockopt(s:TSocket; level:tOS_INT; optname:tOS_INT;optval:pchar;var optlen:tOS_INT):tOS_INT;stdcall;
+    function getsockopt(s:TSocket; level:tOS_INT; optname:tOS_INT;optval:PAnsiChar;var optlen:tOS_INT):tOS_INT;stdcall;
       external winsockdll name 'getsockopt';
     function getsockopt(s:TSocket; level:tOS_INT; optname:tOS_INT;optval:pointer;var optlen:tOS_INT):tOS_INT;stdcall;
       external winsockdll name 'getsockopt';
@@ -720,15 +720,15 @@ IOW, there _must_ be 3 versions then: var/const, pchar and pointer}
       external winsockdll name 'getsockopt';
     function htonl(hostlong:u_long):u_long;stdcall;external winsockdll name 'htonl';
     function htons(hostshort:u_short):u_short;stdcall;external winsockdll name 'htons';
-    function inet_addr(cp:pchar):cardinal;stdcall;external winsockdll name 'inet_addr';
-    function inet_ntoa(i : TInAddr):pchar;stdcall;external winsockdll name 'inet_ntoa';
+    function inet_addr(cp:PAnsiChar):cardinal;stdcall;external winsockdll name 'inet_addr';
+    function inet_ntoa(i : TInAddr):PAnsiChar;stdcall;external winsockdll name 'inet_ntoa';
     function listen(s:TSocket; backlog:tOS_INT):tOS_INT;stdcall;external winsockdll name 'listen';
     function ntohl(netlong:u_long):u_long;stdcall;external winsockdll name 'ntohl';
     function ntohs(netshort:u_short):u_short;stdcall;external winsockdll name 'ntohs';
-    function recv(s:TSocket;buf:pchar; len:tOS_INT; flags:tOS_INT):tOS_INT;stdcall;external winsockdll name 'recv';
+    function recv(s:TSocket;buf:PAnsiChar; len:tOS_INT; flags:tOS_INT):tOS_INT;stdcall;external winsockdll name 'recv';
     function recv(s:TSocket;buf:pointer; len:tOS_INT; flags:tOS_INT):tOS_INT;stdcall;external winsockdll name 'recv';
     function recv(s:TSocket;var buf; len:tOS_INT; flags:tOS_INT):tOS_INT;stdcall;external winsockdll name 'recv';
-    function recvfrom(s:TSocket;buf:pchar; len:tOS_INT; flags:tOS_INT;from:PSockAddr; fromlen:ptOS_INT):tOS_INT;stdcall;
+    function recvfrom(s:TSocket;buf:PAnsiChar; len:tOS_INT; flags:tOS_INT;from:PSockAddr; fromlen:ptOS_INT):tOS_INT;stdcall;
       external winsockdll name 'recvfrom';
     function recvfrom(s:TSocket;buf:pointer; len:tOS_INT; flags:tOS_INT;from:PSockAddr; fromlen:ptOS_INT):tOS_INT;stdcall;
       external winsockdll name 'recvfrom';
@@ -738,17 +738,17 @@ IOW, there _must_ be 3 versions then: var/const, pchar and pointer}
       external winsockdll name 'select';
     function send(s:TSocket;Const buf; len:tOS_INT; flags:tOS_INT):tOS_INT;stdcall;
       external winsockdll name 'send';
-    function send(s:TSocket; buf:pchar; len:tOS_INT; flags:tOS_INT):tOS_INT;stdcall;
+    function send(s:TSocket; buf:PAnsiChar; len:tOS_INT; flags:tOS_INT):tOS_INT;stdcall;
       external winsockdll name 'send';
     function send(s:TSocket;buf:pointer; len:tOS_INT; flags:tOS_INT):tOS_INT;stdcall;
       external winsockdll name 'send';
-    function sendto(s:TSocket; buf:pchar; len:tOS_INT; flags:tOS_INT;toaddr:PSockAddr; tolen:tOS_INT):tOS_INT;stdcall;
+    function sendto(s:TSocket; buf:PAnsiChar; len:tOS_INT; flags:tOS_INT;toaddr:PSockAddr; tolen:tOS_INT):tOS_INT;stdcall;
       external winsockdll name 'sendto';
     function sendto(s:TSocket; buf:pointer; len:tOS_INT; flags:tOS_INT;toaddr:PSockAddr; tolen:tOS_INT):tOS_INT;stdcall;
       external winsockdll name 'sendto';
     function sendto(s:TSocket; Const buf; len:tOS_INT; flags:tOS_INT;Const toaddr:TSockAddr; tolen:tOS_INT):tOS_INT;stdcall;
       external winsockdll name 'sendto';
-    function setsockopt(s:TSocket; level:tOS_INT; optname:tOS_INT; optval:pchar; optlen:tOS_INT):tOS_INT;stdcall;
+    function setsockopt(s:TSocket; level:tOS_INT; optname:tOS_INT; optval:PAnsiChar; optlen:tOS_INT):tOS_INT;stdcall;
       external winsockdll name 'setsockopt';
     function setsockopt(s:TSocket; level:tOS_INT; optname:tOS_INT;optval:pointer; optlen:tOS_INT):tOS_INT;stdcall;
       external winsockdll name 'setsockopt';
@@ -760,13 +760,13 @@ IOW, there _must_ be 3 versions then: var/const, pchar and pointer}
       external winsockdll name 'socket';
 
     { Database function prototypes  }
-    function gethostbyaddr(addr:pchar; len:tOS_INT; t:tOS_INT): PHostEnt;stdcall;external winsockdll name 'gethostbyaddr';
-    function gethostbyname(name:pchar):PHostEnt;stdcall;external winsockdll name 'gethostbyname';
-    function gethostname(name:pchar; namelen:tOS_INT):tOS_INT;stdcall;external winsockdll name 'gethostname';
-    function getservbyport(port:tOS_INT; proto:pchar):PServEnt;stdcall;external winsockdll name 'getservbyport';
-    function getservbyname(name:pchar; proto:pchar):PServEnt;stdcall;external winsockdll name 'getservbyname';
+    function gethostbyaddr(addr:PAnsiChar; len:tOS_INT; t:tOS_INT): PHostEnt;stdcall;external winsockdll name 'gethostbyaddr';
+    function gethostbyname(name:PAnsiChar):PHostEnt;stdcall;external winsockdll name 'gethostbyname';
+    function gethostname(name:PAnsiChar; namelen:tOS_INT):tOS_INT;stdcall;external winsockdll name 'gethostname';
+    function getservbyport(port:tOS_INT; proto:PAnsiChar):PServEnt;stdcall;external winsockdll name 'getservbyport';
+    function getservbyname(name:PAnsiChar; proto:PAnsiChar):PServEnt;stdcall;external winsockdll name 'getservbyname';
     function getprotobynumber(proto:tOS_INT):PProtoEnt;stdcall;external winsockdll name 'getprotobynumber';
-    function getprotobyname(name:pchar):PProtoEnt;stdcall;external winsockdll name 'getprotobyname';
+    function getprotobyname(name:PAnsiChar):PProtoEnt;stdcall;external winsockdll name 'getprotobyname';
 
     { Microsoft Windows Extension function prototypes  }
     function WSAStartup(wVersionRequired:word;var WSAData:TWSADATA):tOS_INT;stdcall;
@@ -778,18 +778,18 @@ IOW, there _must_ be 3 versions then: var/const, pchar and pointer}
     function WSAUnhookBlockingHook:tOS_INT;stdcall;external winsockdll name 'WSAUnhookBlockingHook';
     function WSASetBlockingHook(lpBlockFunc:TFarProc):TFarProc;stdcall;external winsockdll name 'WSASetBlockingHook';
     function WSACancelBlockingCall:tOS_INT;stdcall;external winsockdll name 'WSACancelBlockingCall';
-    function WSAAsyncGetServByName(hWnd:HWND; wMsg:u_int; name:pchar; proto:pchar; buf:pchar;
+    function WSAAsyncGetServByName(hWnd:HWND; wMsg:u_int; name:PAnsiChar; proto:PAnsiChar; buf:PAnsiChar;
                                    buflen:tOS_INT):THandle;stdcall;external winsockdll name 'WSAAsyncGetServByName';
-    function WSAAsyncGetServByPort(hWnd:HWND; wMsg:u_int; port:tOS_INT; proto:pchar; buf:pchar;
+    function WSAAsyncGetServByPort(hWnd:HWND; wMsg:u_int; port:tOS_INT; proto:PAnsiChar; buf:PAnsiChar;
                                    buflen:tOS_INT):THandle;stdcall;external winsockdll name 'WSAAsyncGetServByPort';
-    function WSAAsyncGetProtoByName(hWnd:HWND; wMsg:u_int; name:pchar; buf:pchar; buflen:tOS_INT):THandle;stdcall;
+    function WSAAsyncGetProtoByName(hWnd:HWND; wMsg:u_int; name:PAnsiChar; buf:PAnsiChar; buflen:tOS_INT):THandle;stdcall;
       external winsockdll name 'WSAAsyncGetProtoByName';
-    function WSAAsyncGetProtoByNumber(hWnd:HWND; wMsg:u_int; number:tOS_INT; buf:pchar; buflen:tOS_INT):THandle;stdcall;
+    function WSAAsyncGetProtoByNumber(hWnd:HWND; wMsg:u_int; number:tOS_INT; buf:PAnsiChar; buflen:tOS_INT):THandle;stdcall;
       external winsockdll name 'WSAAsyncGetProtoByNumber';
-    function WSAAsyncGetHostByName(hWnd:HWND; wMsg:u_int; name:pchar; buf:pchar; buflen:tOS_INT):THandle;stdcall;
+    function WSAAsyncGetHostByName(hWnd:HWND; wMsg:u_int; name:PAnsiChar; buf:PAnsiChar; buflen:tOS_INT):THandle;stdcall;
       external winsockdll name 'WSAAsyncGetHostByName';
-    function WSAAsyncGetHostByAddr(hWnd:HWND; wMsg:u_int; addr:pchar; len:tOS_INT; t:tOS_INT;
-                                   buf:pchar; buflen:tOS_INT):THandle;stdcall;
+    function WSAAsyncGetHostByAddr(hWnd:HWND; wMsg:u_int; addr:PAnsiChar; len:tOS_INT; t:tOS_INT;
+                                   buf:PAnsiChar; buflen:tOS_INT):THandle;stdcall;
                                    external winsockdll name 'WSAAsyncGetHostByAddr';
     function WSACancelAsyncRequest(hAsyncTaskHandle:THandle):tOS_INT;stdcall;
       external winsockdll name 'WSACancelAsyncRequest';

+ 56 - 56
packages/rtl-extra/src/win/winsock2.pp

@@ -29,7 +29,7 @@ Const
   WINSOCK2_DLL = 'ws2_32.dll';
 
 Type
-  u_char = Char;
+  u_char = AnsiChar;
   u_short = Word;
   u_int = DWord;
   u_long = DWord;
@@ -46,7 +46,7 @@ Type
 {$IFDEF UNICODE}
   PMBChar = PWideChar;
 {$ELSE}
-  PMBChar = PChar;
+  PMBChar = PAnsiChar;
 {$ENDIF}
 
 const
@@ -94,20 +94,20 @@ const
 type
   PHostEnt = ^THostEnt;
   THostEnt = record
-    h_name: PChar;
-    h_aliases: ^PChar;
+    h_name: PAnsiChar;
+    h_aliases: ^PAnsiChar;
     h_addrtype: Smallint;
     h_length: Smallint;
     case Byte of
-      0: (h_addr_list: ^PChar);
-      1: (h_addr: ^PChar)
+      0: (h_addr_list: ^PAnsiChar);
+      1: (h_addr: ^PAnsiChar)
   end;
   hostent = THostEnt;
 
   PNetEnt = ^TNetEnt;
   TNetEnt = record
-    n_name: PChar;
-    n_aliases: ^PChar;
+    n_name: PAnsiChar;
+    n_aliases: ^PAnsiChar;
     n_addrtype: Smallint;
     n_net: u_long;
   end;
@@ -115,22 +115,22 @@ type
 
   PServEnt = ^TServEnt;
   TServEnt = record
-    s_name: PChar;
-    s_aliases: ^PChar;
+    s_name: PAnsiChar;
+    s_aliases: ^PAnsiChar;
 {$ifdef WIN64}
-    s_proto: PChar;
+    s_proto: PAnsiChar;
     s_port: Smallint;
 {$else WIN64}
     s_port: Smallint;
-    s_proto: PChar;
+    s_proto: PAnsiChar;
 {$endif WIN64}
   end;
   servent = TServEnt;
 
   PProtoEnt = ^TProtoEnt;
   TProtoEnt = record
-    p_name: PChar;
-    p_aliases: ^Pchar;
+    p_name: PAnsiChar;
+    p_aliases: ^PAnsiChar;
     p_proto: Smallint;
   end;
   protoent = TProtoEnt;
@@ -424,9 +424,9 @@ type
       0: (sin_family: u_short;
           sin_port: u_short;
           sin_addr: TInAddr;
-          sin_zero: array[0..7] of Char);
+          sin_zero: array[0..7] of AnsiChar);
       1: (sa_family: u_short;
-          sa_data: array[0..13] of Char)
+          sa_data: array[0..13] of AnsiChar)
   end;
   sockaddr_in = TSockAddrIn;
 
@@ -682,15 +682,15 @@ type
 {$ifdef win64}
      iMaxSockets : word;
      iMaxUdpDg : word;
-     lpVendorInfo : pchar;
-     szDescription : array[0..WSADESCRIPTION_LEN] of char;
-     szSystemStatus : array[0..WSASYS_STATUS_LEN] of char;
+     lpVendorInfo : PAnsiChar;
+     szDescription : array[0..WSADESCRIPTION_LEN] of AnsiChar;
+     szSystemStatus : array[0..WSASYS_STATUS_LEN] of AnsiChar;
 {$else win64}
-     szDescription : array[0..WSADESCRIPTION_LEN] of char; { 257 byte, ofs 4 }
-     szSystemStatus : array[0..WSASYS_STATUS_LEN] of char; { 129 byte, ofs 261 }
+     szDescription : array[0..WSADESCRIPTION_LEN] of AnsiChar; { 257 byte, ofs 4 }
+     szSystemStatus : array[0..WSASYS_STATUS_LEN] of AnsiChar; { 129 byte, ofs 261 }
      iMaxSockets : word;           { 2 byte, ofs 390 }
      iMaxUdpDg : word;             { 2 byte, ofs 392 }
-     lpVendorInfo : pchar;         { 4 byte, ofs 396 }
+     lpVendorInfo : PAnsiChar;         { 4 byte, ofs 396 }
 {$endif win64}
   end;
   WSAData = TWSAData;
@@ -713,7 +713,7 @@ type
 
         WSABUF = record
                 len: U_LONG;    { the length of the buffer }
-                buf: PChar;     { the pointer to the buffer }
+                buf: PAnsiChar;     { the pointer to the buffer }
         end {WSABUF};
         PWSABUF = ^WSABUF;
         LPWSABUF = PWSABUF;
@@ -804,7 +804,7 @@ Type
                 iSecurityScheme: Longint;
                 dwMessageSize: LongInt;
                 dwProviderReserved: LongInt;
-                szProtocol: Array[0..WSAPROTOCOL_LEN+1-1] of Char;
+                szProtocol: Array[0..WSAPROTOCOL_LEN+1-1] of AnsiChar;
         end {TWSAProtocol_InfoA};
         PWSAProtocol_InfoA = ^TWSAProtocol_InfoA;
         LPWSAProtocol_InfoA = PWSAProtocol_InfoA;
@@ -1039,16 +1039,16 @@ Type
 
         TWSAQuerySetA = record
                 dwSize: LongInt;
-                lpszServiceInstanceName: PChar;
+                lpszServiceInstanceName: PAnsiChar;
                 lpServiceClassId: PGUID;
                 lpVersion: PWSAVERSION;
-                lpszComment: PChar;
+                lpszComment: PAnsiChar;
                 dwNameSpace: LongInt;
                 lpNSProviderId: PGUID;
-                lpszContext: PChar;
+                lpszContext: PAnsiChar;
                 dwNumberOfProtocols: LongInt;
                 lpafpProtocols: PAFProtocols;
-                lpszQueryString: PChar;
+                lpszQueryString: PAnsiChar;
                 dwNumberOfCsAddrs: LongInt;
                 lpcsaBuffer: PCSADDR_INFO;
                 dwOutputFlags: LongInt;
@@ -1124,7 +1124,7 @@ Type
 
 {       Service Installation/Removal Data Types. }
         TWSANSClassInfoA = record
-                lpszName: PChar;
+                lpszName: PAnsiChar;
                 dwNameSpace: LongInt;
                 dwValueType: LongInt;
                 dwValueSize: LongInt;
@@ -1151,7 +1151,7 @@ Type
 
         TWSAServiceClassInfoA = record
                 lpServiceClassId: PGUID;
-                lpszServiceClassName: PChar;
+                lpszServiceClassName: PAnsiChar;
                 dwCount: LongInt;
                 lpClassInfos: PWSANSClassInfoA;
         end {TWSAServiceClassInfoA};
@@ -1180,7 +1180,7 @@ Type
                 dwNameSpace: LongInt;
                 fActive: LongInt{Bool};
                 dwVersion: LongInt;
-                lpszIdentifier: PChar;
+                lpszIdentifier: PAnsiChar;
         end {TWSANameSpace_InfoA};
         PWSANameSpace_InfoA = ^TWSANameSpace_InfoA;
         LPWSANameSpace_InfoA = PWSANameSpace_InfoA;
@@ -1221,42 +1221,42 @@ function ioctlsocket( const s: TSocket; cmd: Longint; var arg: u_long ): Longint
 function ioctlsocket( const s: TSocket; cmd: Longint; argp: pu_long ): Longint; stdcall;external WINSOCK2_DLL name 'ioctlsocket';
 function getpeername( const s: TSocket; var name: TSockAddr; var namelen: Longint ): Longint; stdcall;external WINSOCK2_DLL name 'getpeername';
 function getsockname( const s: TSocket; var name: TSockAddr; var namelen: Longint ): Longint; stdcall;external WINSOCK2_DLL name 'getsockname';
-function getsockopt( const s: TSocket; const level, optname: Longint; optval: PChar; var optlen: Longint ): Longint; stdcall;external WINSOCK2_DLL name 'getsockopt';
+function getsockopt( const s: TSocket; const level, optname: Longint; optval: PAnsiChar; var optlen: Longint ): Longint; stdcall;external WINSOCK2_DLL name 'getsockopt';
 function getsockopt( const s: TSocket; const level, optname: Longint; optval: Pointer; var optlen: Longint ): Longint; stdcall;external WINSOCK2_DLL name 'getsockopt';
 function getsockopt( const s: TSocket; const level, optname: Longint; var optval; var optlen: Longint ): Longint; stdcall;external WINSOCK2_DLL name 'getsockopt';
 function htonl(hostlong: u_long): u_long; stdcall;external WINSOCK2_DLL name 'htonl';
 function htons(hostshort: u_short): u_short; stdcall;external WINSOCK2_DLL name 'htons';
-function inet_addr(cp: PChar): u_long; stdcall;external WINSOCK2_DLL name 'inet_addr';
-function inet_ntoa(inaddr: TInAddr): PChar; stdcall;external WINSOCK2_DLL name 'inet_ntoa';
+function inet_addr(cp: PAnsiChar): u_long; stdcall;external WINSOCK2_DLL name 'inet_addr';
+function inet_ntoa(inaddr: TInAddr): PAnsiChar; stdcall;external WINSOCK2_DLL name 'inet_ntoa';
 function listen(s: TSocket; backlog: Longint): Longint; stdcall;external WINSOCK2_DLL name 'listen';
 function ntohl(netlong: u_long): u_long; stdcall;external WINSOCK2_DLL name 'ntohl';
 function ntohs(netshort: u_short): u_short; stdcall;external WINSOCK2_DLL name 'ntohs';
 function recv(s: TSocket; var Buf; len, flags: Longint): Longint; stdcall;external WINSOCK2_DLL name 'recv';
-function recv(s: TSocket; Buf: PChar; len, flags: Longint): Longint; stdcall;external WINSOCK2_DLL name 'recv';
+function recv(s: TSocket; Buf: PAnsiChar; len, flags: Longint): Longint; stdcall;external WINSOCK2_DLL name 'recv';
 function recv(s: TSocket; Buf: Pointer; len, flags: Longint): Longint; stdcall;external WINSOCK2_DLL name 'recv';
-function recvfrom(s: TSocket; Buf: PChar; len, flags: Longint; from: PSockAddr; fromlen: PLongint): Longint; stdcall;external WINSOCK2_DLL name 'recvfrom';
+function recvfrom(s: TSocket; Buf: PAnsiChar; len, flags: Longint; from: PSockAddr; fromlen: PLongint): Longint; stdcall;external WINSOCK2_DLL name 'recvfrom';
 function recvfrom(s: TSocket; Buf: Pointer; len, flags: Longint; from: PSockAddr; fromlen: PLongint): Longint; stdcall;external WINSOCK2_DLL name 'recvfrom';
 function recvfrom(s: TSocket; var Buf; len, flags: Longint; const from: TSockAddr; var fromlen: Longint): Longint; stdcall;external WINSOCK2_DLL name 'recvfrom';
 function select(nfds: Longint; readfds, writefds, exceptfds: PFDSet; timeout: PTimeVal): Longint; stdcall;external WINSOCK2_DLL name 'select';
 function send(s: TSocket; const Buf; len, flags: Longint): Longint; stdcall;external WINSOCK2_DLL name 'send';
-function send(s: TSocket; Buf: PChar; len, flags: Longint): Longint; stdcall;external WINSOCK2_DLL name 'send';
+function send(s: TSocket; Buf: PAnsiChar; len, flags: Longint): Longint; stdcall;external WINSOCK2_DLL name 'send';
 function send(s: TSocket; Buf: Pointer; len, flags: Longint): Longint; stdcall;external WINSOCK2_DLL name 'send';
 function sendto(s: TSocket; const Buf; len, flags: Longint; const addrto: TSockAddr; tolen: Longint): Longint; stdcall;external WINSOCK2_DLL name 'sendto';
-function sendto(s: TSocket; Buf: PChar; len, flags: Longint; addrto: PSockAddr; tolen: Longint): Longint; stdcall;external WINSOCK2_DLL name 'sendto';
+function sendto(s: TSocket; Buf: PAnsiChar; len, flags: Longint; addrto: PSockAddr; tolen: Longint): Longint; stdcall;external WINSOCK2_DLL name 'sendto';
 function sendto(s: TSocket; Buf: Pointer; len, flags: Longint; addrto: PSockAddr; tolen: Longint): Longint; stdcall;external WINSOCK2_DLL name 'sendto';
 function setsockopt(s: TSocket; level, optname: Longint; const optval; optlen: Longint): Longint; stdcall;external WINSOCK2_DLL name 'setsockopt';
-function setsockopt(s: TSocket; level, optname: Longint; optval: PChar; optlen: Longint): Longint; stdcall;external WINSOCK2_DLL name 'setsockopt';
+function setsockopt(s: TSocket; level, optname: Longint; optval: PAnsiChar; optlen: Longint): Longint; stdcall;external WINSOCK2_DLL name 'setsockopt';
 function setsockopt(s: TSocket; level, optname: Longint; optval: Pointer; optlen: Longint): Longint; stdcall;external WINSOCK2_DLL name 'setsockopt';
 function shutdown(s: TSocket; how: Longint): Longint; stdcall;external WINSOCK2_DLL name 'shutdown';
 function socket(af, struct, protocol: Longint): TSocket; stdcall;external WINSOCK2_DLL name 'socket';
 
 function gethostbyaddr(addr: Pointer; len, struct: Longint): PHostEnt; stdcall;external WINSOCK2_DLL name 'gethostbyaddr';
-function gethostbyname(name: PChar): PHostEnt; stdcall;external WINSOCK2_DLL name 'gethostbyname';
-function gethostname(name: PChar; len: Longint): Longint; stdcall;external WINSOCK2_DLL name 'gethostname';
-function getservbyport(port: Longint; proto: PChar): PServEnt; stdcall;external WINSOCK2_DLL name 'getservbyport';
-function getservbyname(name, proto: PChar): PServEnt; stdcall;external WINSOCK2_DLL name 'getservbyname';
+function gethostbyname(name: PAnsiChar): PHostEnt; stdcall;external WINSOCK2_DLL name 'gethostbyname';
+function gethostname(name: PAnsiChar; len: Longint): Longint; stdcall;external WINSOCK2_DLL name 'gethostname';
+function getservbyport(port: Longint; proto: PAnsiChar): PServEnt; stdcall;external WINSOCK2_DLL name 'getservbyport';
+function getservbyname(name, proto: PAnsiChar): PServEnt; stdcall;external WINSOCK2_DLL name 'getservbyname';
 function getprotobynumber(proto: Longint): PProtoEnt; stdcall;external WINSOCK2_DLL name 'getprotobynumber';
-function getprotobyname(name: PChar): PProtoEnt; stdcall;external WINSOCK2_DLL name 'getprotobyname';
+function getprotobyname(name: PAnsiChar): PProtoEnt; stdcall;external WINSOCK2_DLL name 'getprotobyname';
 
 function WSAStartup(wVersionRequired: word; var WSData: TWSAData): Longint; stdcall; external WINSOCK2_DLL name 'WSAStartup';
 function WSACleanup: Longint; stdcall; external WINSOCK2_DLL name 'WSACleanup';
@@ -1266,12 +1266,12 @@ function WSAIsBlocking: BOOL; stdcall; external WINSOCK2_DLL name 'WSAIsBlocking
 function WSAUnhookBlockingHook: Longint; stdcall; external WINSOCK2_DLL name 'WSAUnhookBlockingHook';
 function WSASetBlockingHook(lpBlockFunc: TFarProc): TFarProc; stdcall; external WINSOCK2_DLL name 'WSASetBlockingHook';
 function WSACancelBlockingCall: Longint; stdcall; external WINSOCK2_DLL name 'WSACancelBlockingCall';
-function WSAAsyncGetServByName(HWindow: HWND; wMsg: u_int; name, proto, buf: PChar; buflen: Longint): THandle; stdcall; external WINSOCK2_DLL name 'WSAAsyncGetServByName';
-function WSAAsyncGetServByPort( HWindow: HWND; wMsg, port: u_int; proto, buf: PChar; buflen: Longint): THandle; stdcall; external WINSOCK2_DLL name 'WSAAsyncGetServByPort';
-function WSAAsyncGetProtoByName(HWindow: HWND; wMsg: u_int; name, buf: PChar; buflen: Longint): THandle; stdcall; external WINSOCK2_DLL name 'WSAAsyncGetProtoByName';
-function WSAAsyncGetProtoByNumber(HWindow: HWND; wMsg: u_int; number: Longint; buf: PChar; buflen: Longint): THandle; stdcall; external WINSOCK2_DLL name 'WSAAsyncGetProtoByNumber';
-function WSAAsyncGetHostByName(HWindow: HWND; wMsg: u_int; name, buf: PChar; buflen: Longint): THandle; stdcall; external WINSOCK2_DLL name 'WSAAsyncGetHostByName';
-function WSAAsyncGetHostByAddr(HWindow: HWND; wMsg: u_int; addr: PChar; len, struct: Longint; buf: PChar; buflen: Longint): THandle; stdcall; external WINSOCK2_DLL name 'WSAAsyncGetHostByAddr';
+function WSAAsyncGetServByName(HWindow: HWND; wMsg: u_int; name, proto, buf: PAnsiChar; buflen: Longint): THandle; stdcall; external WINSOCK2_DLL name 'WSAAsyncGetServByName';
+function WSAAsyncGetServByPort( HWindow: HWND; wMsg, port: u_int; proto, buf: PAnsiChar; buflen: Longint): THandle; stdcall; external WINSOCK2_DLL name 'WSAAsyncGetServByPort';
+function WSAAsyncGetProtoByName(HWindow: HWND; wMsg: u_int; name, buf: PAnsiChar; buflen: Longint): THandle; stdcall; external WINSOCK2_DLL name 'WSAAsyncGetProtoByName';
+function WSAAsyncGetProtoByNumber(HWindow: HWND; wMsg: u_int; number: Longint; buf: PAnsiChar; buflen: Longint): THandle; stdcall; external WINSOCK2_DLL name 'WSAAsyncGetProtoByNumber';
+function WSAAsyncGetHostByName(HWindow: HWND; wMsg: u_int; name, buf: PAnsiChar; buflen: Longint): THandle; stdcall; external WINSOCK2_DLL name 'WSAAsyncGetHostByName';
+function WSAAsyncGetHostByAddr(HWindow: HWND; wMsg: u_int; addr: PAnsiChar; len, struct: Longint; buf: PAnsiChar; buflen: Longint): THandle; stdcall; external WINSOCK2_DLL name 'WSAAsyncGetHostByAddr';
 function WSACancelAsyncRequest(hAsyncTaskHandle: THandle): Longint; stdcall; external WINSOCK2_DLL name 'WSACancelAsyncRequest';
 function WSAAsyncSelect(s: TSocket; HWindow: HWND; wMsg: u_int; lEvent: Longint): Longint; stdcall; external WINSOCK2_DLL name 'WSAAsyncSelect';
 function __WSAFDIsSet(s: TSOcket; var FDSet: TFDSet): Bool; stdcall; external WINSOCK2_DLL name '__WSAFDIsSet';
@@ -1333,23 +1333,23 @@ function WSASocket ( af, iType, protocol : Longint; lpProtocolInfo : LPWSAProtoc
 function WSAWaitForMultipleEvents( cEvents : DWORD; lphEvents : PWSAEVENT; fWaitAll : LongBool;
         dwTimeout : DWORD; fAlertable : LongBool ): DWORD; stdcall; external WINSOCK2_DLL name 'WSAWaitForMultipleEvents';
 function WSAAddressToStringA( var lpsaAddress : TSockAddr; const dwAddressLength : DWORD; const lpProtocolInfo : LPWSAProtocol_InfoA;
-        const lpszAddressString : PChar; var lpdwAddressStringLength : DWORD ): Longint; stdcall; external WINSOCK2_DLL name 'WSAAddressToStringA';
+        const lpszAddressString : PAnsiChar; var lpdwAddressStringLength : DWORD ): Longint; stdcall; external WINSOCK2_DLL name 'WSAAddressToStringA';
 function WSAAddressToStringW( var lpsaAddress : TSockAddr; const dwAddressLength : DWORD; const lpProtocolInfo : LPWSAProtocol_InfoW;
         const lpszAddressString : PWideChar; var lpdwAddressStringLength : DWORD ): Longint; stdcall; external WINSOCK2_DLL name 'WSAAddressToStringW';
 {$ifndef Unicode}
 function WSAAddressToString( var lpsaAddress : TSockAddr; const dwAddressLength : DWORD; const lpProtocolInfo : LPWSAProtocol_InfoA;
-        const lpszAddressString : PChar; var lpdwAddressStringLength : DWORD ): Longint; stdcall; external WINSOCK2_DLL name 'WSAAddressToStringA';
+        const lpszAddressString : PAnsiChar; var lpdwAddressStringLength : DWORD ): Longint; stdcall; external WINSOCK2_DLL name 'WSAAddressToStringA';
 {$else}
 function WSAAddressToString( var lpsaAddress : TSockAddr; const dwAddressLength : DWORD; const lpProtocolInfo : LPWSAProtocol_InfoW;
         const lpszAddressString : PWideChar; var lpdwAddressStringLength : DWORD ): Longint; stdcall; external WINSOCK2_DLL name 'WSAAddressToStringW';
 {$endif}
 
-function WSAStringToAddressA( const AddressString : PChar; const AddressFamily: Longint; const lpProtocolInfo : LPWSAProtocol_InfoA;
+function WSAStringToAddressA( const AddressString : PAnsiChar; const AddressFamily: Longint; const lpProtocolInfo : LPWSAProtocol_InfoA;
         var lpAddress : TSockAddr; var lpAddressLength : Longint ): Longint; stdcall; external WINSOCK2_DLL name 'WSAStringToAddressA';
 function WSAStringToAddressW( const AddressString : PWideChar; const AddressFamily: Longint; const lpProtocolInfo : LPWSAProtocol_InfoA;
         var lpAddress : TSockAddr; var lpAddressLength : Longint ): Longint; stdcall; external WINSOCK2_DLL name 'WSAStringToAddressW';
 {$ifndef Unicode}
-function WSAStringToAddress( const AddressString : PChar; const AddressFamily: Longint; const lpProtocolInfo : LPWSAProtocol_InfoA;
+function WSAStringToAddress( const AddressString : PAnsiChar; const AddressFamily: Longint; const lpProtocolInfo : LPWSAProtocol_InfoA;
         var lpAddress : TSockAddr; var lpAddressLength : Longint ): Longint; stdcall; external WINSOCK2_DLL name 'WSAStringToAddressA';
 {$else}
 function WSAStringToAddress( const AddressString : PWideChar; const AddressFamily: Longint; const lpProtocolInfo : LPWSAProtocol_InfoA;
@@ -1401,12 +1401,12 @@ function WSAEnumNameSpaceProviders( var lpdwBufferLength: DWORD; const lpnspBuff
 function WSAEnumNameSpaceProviders( var lpdwBufferLength: DWORD; const lpnspBuffer: LPWSANameSpace_InfoW ): Longint; stdcall; external WINSOCK2_DLL name 'WSAEnumNameSpaceProvidersW';
 {$endif}
 
-function WSAGetServiceClassNameByClassIdA( const lpServiceClassId: PGUID; lpszServiceClassName: PChar;
+function WSAGetServiceClassNameByClassIdA( const lpServiceClassId: PGUID; lpszServiceClassName: PAnsiChar;
         var lpdwBufferLength: DWORD ): Longint; stdcall; external WINSOCK2_DLL name 'WSAGetServiceClassNameByClassIdA';
 function WSAGetServiceClassNameByClassIdW( const lpServiceClassId: PGUID; lpszServiceClassName: PWideChar;
         var lpdwBufferLength: DWORD ): Longint; stdcall; external WINSOCK2_DLL name 'WSAGetServiceClassNameByClassIdW';
 {$ifndef Unicode}
-function WSAGetServiceClassNameByClassId( const lpServiceClassId: PGUID; lpszServiceClassName: PChar;
+function WSAGetServiceClassNameByClassId( const lpServiceClassId: PGUID; lpszServiceClassName: PAnsiChar;
         var lpdwBufferLength: DWORD ): Longint; stdcall; external WINSOCK2_DLL name 'WSAGetServiceClassNameByClassIdA';
 {$else}
 function WSAGetServiceClassNameByClassId( const lpServiceClassId: PGUID; lpszServiceClassName: PWideChar;

+ 41 - 41
packages/rtl-extra/src/wince/winsock.pp

@@ -94,7 +94,7 @@ unit winsock;
        tOS_UINT = DWord;
        ptOS_INT = ^tOS_INT;
        ptOS_UINT = ^tOS_UINT;
-       u_char = char;
+       u_char = AnsiChar;
        u_short = word;
        u_int = tOS_UINT;
        u_long = dword;
@@ -185,17 +185,17 @@ unit winsock;
     type
        hostent = record
           { official name of host  }
-          h_name: pchar;
+          h_name: PAnsiChar;
           { alias list  }
-          h_aliases: ^pchar;
+          h_aliases: ^PAnsiChar;
           { host address type  }
           h_addrtype: SmallInt;
           { length of address  }
           h_length: SmallInt;
           { list of addresses  }
           case byte of
-             0: (h_addr_list: ^pchar);
-             1: (h_addr: ^pchar)
+             0: (h_addr_list: ^PAnsiChar);
+             1: (h_addr: ^PAnsiChar)
        end;
        THostEnt = hostent;
        PHostEnt = ^THostEnt;
@@ -206,9 +206,9 @@ unit winsock;
        }
        netent = record
           { official name of net  }
-          n_name : ^char;
+          n_name : ^AnsiChar;
           { alias list  }
-          n_aliases : ^pchar;
+          n_aliases : ^PAnsiChar;
           { net address type  }
           n_addrtype : SmallInt;
           n_pad1 : SmallInt;    { ensure right packaging }
@@ -220,23 +220,23 @@ unit winsock;
 
        servent = record
           { official service name  }
-          s_name : ^char;
+          s_name : ^AnsiChar;
           { alias list  }
-          s_aliases : ^pchar;
+          s_aliases : ^PAnsiChar;
           { port #  }
           s_port : SmallInt;
           n_pad1 : SmallInt;    { ensure right packaging }
           { protocol to use  }
-          s_proto : ^char;
+          s_proto : ^AnsiChar;
        end;
        TServEnt = servent;
        PServEnt = ^TServEnt;
 
        protoent = record
           { official protocol name  }
-          p_name : ^char;
+          p_name : ^AnsiChar;
           { alias list  }
-          p_aliases : ^pchar;
+          p_aliases : ^PAnsiChar;
           { protocol #  }
           p_proto : SmallInt;
           p_pad1 : SmallInt;    { ensure packaging }
@@ -318,11 +318,11 @@ unit winsock;
                   sin_family : SmallInt;                (* 2 byte *)
                   sin_port : u_short;                   (* 2 byte *)
                   sin_addr : TInAddr;                   (* 4 byte *)
-                  sin_zero : array[0..8-1] of char;     (* 8 byte *)
+                  sin_zero : array[0..8-1] of AnsiChar;     (* 8 byte *)
                  );
              1 : ((* equals to sockaddr, size is 16 byte *)
                   sa_family : Smallint; (* 2 byte *)
-                  sa_data : array[0..14-1] of char;    (* 14 byte *)
+                  sa_data : array[0..14-1] of AnsiChar;    (* 14 byte *)
                  );
        end;
        TSockAddrIn = sockaddr_in;
@@ -354,12 +354,12 @@ unit winsock;
        WSADATA = record
           wVersion : WORD;              { 2 byte, ofs 0 }
           wHighVersion : WORD;          { 2 byte, ofs 2 }
-          szDescription : array[0..(WSADESCRIPTION_LEN+1)-1] of char; { 257 byte, ofs 4 }
-          szSystemStatus : array[0..(WSASYS_STATUS_LEN+1)-1] of char; { 129 byte, ofs 261 }
+          szDescription : array[0..(WSADESCRIPTION_LEN+1)-1] of AnsiChar; { 257 byte, ofs 4 }
+          szSystemStatus : array[0..(WSASYS_STATUS_LEN+1)-1] of AnsiChar; { 129 byte, ofs 261 }
           iMaxSockets : word;           { 2 byte, ofs 390 }
           iMaxUdpDg : word;             { 2 byte, ofs 392 }
           pad1 : SmallInt;              { 2 byte, ofs 394 } { ensure right packaging }
-          lpVendorInfo : pchar;         { 4 byte, ofs 396 }
+          lpVendorInfo : PAnsiChar;         { 4 byte, ofs 396 }
        end;                             { total size 400 }
        TWSAData = WSADATA;
        PWSAData = ^TWSAData;
@@ -875,14 +875,14 @@ unit winsock;
 
 
 {
-Winsock types all buffers as pchar (char *), modern POSIX does it the ANSI
+Winsock types all buffers as PAnsiChar (AnsiChar *), modern POSIX does it the ANSI
 C way with pointer (void *). If the pointer overloaded version doesn't exist,
 a "pointer" will be passed to the "var" version. (bug 3142).
 So if there are var/const versions:
 - To keep ported unix code working, there must be "pointer" variants (ANSI)
-- To keep Delphi/ported C Winsock code working there must be pchar variants
+- To keep Delphi/ported C Winsock code working there must be PAnsiChar variants
         (K&R)
-IOW, there _must_ be 3 versions then: var/const, pchar and pointer}
+IOW, there _must_ be 3 versions then: var/const, PAnsiChar and pointer}
 
     function accept(s:TSocket; addr: PSockAddr; addrlen : ptOS_INT) : TSocket;external winsockdll name 'accept';
     function accept(s:TSocket; addr: PSockAddr; var addrlen : tOS_INT) : TSocket;external winsockdll name 'accept';
@@ -898,7 +898,7 @@ IOW, there _must_ be 3 versions then: var/const, pchar and pointer}
       external winsockdll name 'getpeername';
     function getsockname(s:TSocket; var name:TSockAddr;var namelen:tOS_INT):tOS_INT;
       external winsockdll name 'getsockname';
-    function getsockopt(s:TSocket; level:tOS_INT; optname:tOS_INT;optval:pchar;var optlen:tOS_INT):tOS_INT;
+    function getsockopt(s:TSocket; level:tOS_INT; optname:tOS_INT;optval:PAnsiChar;var optlen:tOS_INT):tOS_INT;
       external winsockdll name 'getsockopt';
     function getsockopt(s:TSocket; level:tOS_INT; optname:tOS_INT;optval:pointer;var optlen:tOS_INT):tOS_INT;
       external winsockdll name 'getsockopt';
@@ -906,15 +906,15 @@ IOW, there _must_ be 3 versions then: var/const, pchar and pointer}
       external winsockdll name 'getsockopt';
     function htonl(hostlong:u_long):u_long;external winsockdll name 'htonl';
     function htons(hostshort:u_short):u_short;external winsockdll name 'htons';
-    function inet_addr(cp:pchar):cardinal;external winsockdll name 'inet_addr';
-    function inet_ntoa(i : TInAddr):pchar;external winsockdll name 'inet_ntoa';
+    function inet_addr(cp:PAnsiChar):cardinal;external winsockdll name 'inet_addr';
+    function inet_ntoa(i : TInAddr):PAnsiChar;external winsockdll name 'inet_ntoa';
     function listen(s:TSocket; backlog:tOS_INT):tOS_INT;external winsockdll name 'listen';
     function ntohl(netlong:u_long):u_long;external winsockdll name 'ntohl';
     function ntohs(netshort:u_short):u_short;external winsockdll name 'ntohs';
-    function recv(s:TSocket;buf:pchar; len:tOS_INT; flags:tOS_INT):tOS_INT;external winsockdll name 'recv';
+    function recv(s:TSocket;buf:PAnsiChar; len:tOS_INT; flags:tOS_INT):tOS_INT;external winsockdll name 'recv';
     function recv(s:TSocket;buf:pointer; len:tOS_INT; flags:tOS_INT):tOS_INT;external winsockdll name 'recv';
     function recv(s:TSocket;var buf; len:tOS_INT; flags:tOS_INT):tOS_INT;external winsockdll name 'recv';
-    function recvfrom(s:TSocket;buf:pchar; len:tOS_INT; flags:tOS_INT;from:PSockAddr; fromlen:ptOS_INT):tOS_INT;
+    function recvfrom(s:TSocket;buf:PAnsiChar; len:tOS_INT; flags:tOS_INT;from:PSockAddr; fromlen:ptOS_INT):tOS_INT;
       external winsockdll name 'recvfrom';
     function recvfrom(s:TSocket;buf:pointer; len:tOS_INT; flags:tOS_INT;from:PSockAddr; fromlen:ptOS_INT):tOS_INT;
       external winsockdll name 'recvfrom';
@@ -924,17 +924,17 @@ IOW, there _must_ be 3 versions then: var/const, pchar and pointer}
       external winsockdll name 'select';
     function send(s:TSocket;Const buf; len:tOS_INT; flags:tOS_INT):tOS_INT;
       external winsockdll name 'send';
-    function send(s:TSocket; buf:pchar; len:tOS_INT; flags:tOS_INT):tOS_INT;
+    function send(s:TSocket; buf:PAnsiChar; len:tOS_INT; flags:tOS_INT):tOS_INT;
       external winsockdll name 'send';
     function send(s:TSocket;buf:pointer; len:tOS_INT; flags:tOS_INT):tOS_INT;
       external winsockdll name 'send';
-    function sendto(s:TSocket; buf:pchar; len:tOS_INT; flags:tOS_INT;toaddr:PSockAddr; tolen:tOS_INT):tOS_INT;
+    function sendto(s:TSocket; buf:PAnsiChar; len:tOS_INT; flags:tOS_INT;toaddr:PSockAddr; tolen:tOS_INT):tOS_INT;
       external winsockdll name 'sendto';
     function sendto(s:TSocket; buf:pointer; len:tOS_INT; flags:tOS_INT;toaddr:PSockAddr; tolen:tOS_INT):tOS_INT;
       external winsockdll name 'sendto';
     function sendto(s:TSocket; Const buf; len:tOS_INT; flags:tOS_INT;Const toaddr:TSockAddr; tolen:tOS_INT):tOS_INT;
       external winsockdll name 'sendto';
-    function setsockopt(s:TSocket; level:tOS_INT; optname:tOS_INT; optval:pchar; optlen:tOS_INT):tOS_INT;
+    function setsockopt(s:TSocket; level:tOS_INT; optname:tOS_INT; optval:PAnsiChar; optlen:tOS_INT):tOS_INT;
       external winsockdll name 'setsockopt';
     function setsockopt(s:TSocket; level:tOS_INT; optname:tOS_INT;optval:pointer; optlen:tOS_INT):tOS_INT;
       external winsockdll name 'setsockopt';
@@ -946,13 +946,13 @@ IOW, there _must_ be 3 versions then: var/const, pchar and pointer}
       external winsockdll name 'socket';
 
     { Database function prototypes  }
-    function gethostbyaddr(addr:pchar; len:tOS_INT; t:tOS_INT): PHostEnt;external winsockdll name 'gethostbyaddr';
-    function gethostbyname(name:pchar):PHostEnt;external winsockdll name 'gethostbyname';
-    function gethostname(name:pchar; namelen:tOS_INT):tOS_INT;external winsockdll name 'gethostname';
-    function getservbyport(port:tOS_INT; proto:pchar):PServEnt;external winsockdll name 'getservbyport';
-    function getservbyname(name:pchar; proto:pchar):PServEnt;external winsockdll name 'getservbyname';
+    function gethostbyaddr(addr:PAnsiChar; len:tOS_INT; t:tOS_INT): PHostEnt;external winsockdll name 'gethostbyaddr';
+    function gethostbyname(name:PAnsiChar):PHostEnt;external winsockdll name 'gethostbyname';
+    function gethostname(name:PAnsiChar; namelen:tOS_INT):tOS_INT;external winsockdll name 'gethostname';
+    function getservbyport(port:tOS_INT; proto:PAnsiChar):PServEnt;external winsockdll name 'getservbyport';
+    function getservbyname(name:PAnsiChar; proto:PAnsiChar):PServEnt;external winsockdll name 'getservbyname';
     function getprotobynumber(proto:tOS_INT):PProtoEnt;external winsockdll name 'getprotobynumber';
-    function getprotobyname(name:pchar):PProtoEnt;external winsockdll name 'getprotobyname';
+    function getprotobyname(name:PAnsiChar):PProtoEnt;external winsockdll name 'getprotobyname';
 
     { Microsoft Windows Extension function prototypes  }
     function WSAStartup(wVersionRequired:word;var WSAData:TWSADATA):tOS_INT;
@@ -960,7 +960,7 @@ IOW, there _must_ be 3 versions then: var/const, pchar and pointer}
     function WSACleanup:tOS_INT;external winsockdll name 'WSACleanup';
     procedure WSASetLastError(iError:tOS_INT);external winsockdll name 'WSASetLastError';
     function WSAGetLastError:tOS_INT;external winsockdll name 'WSAGetLastError';
-    function WSAAsyncGetHostByName(hWnd:HWND; wMsg:u_int; name:pchar; buf:pchar; buflen:tOS_INT):THandle;
+    function WSAAsyncGetHostByName(hWnd:HWND; wMsg:u_int; name:PAnsiChar; buf:PAnsiChar; buflen:tOS_INT):THandle;
       external winsockdll name 'WSAAsyncGetHostByName';
     function WSACancelAsyncRequest(hAsyncTaskHandle:THandle):tOS_INT;
       external winsockdll name 'WSACancelAsyncRequest';
@@ -988,16 +988,16 @@ IOW, there _must_ be 3 versions then: var/const, pchar and pointer}
     function WSAUnhookBlockingHook:tOS_INT;external winsockdll name 'WSAUnhookBlockingHook';
     function WSASetBlockingHook(lpBlockFunc:TFarProc):TFarProc;external winsockdll name 'WSASetBlockingHook';
     function WSACancelBlockingCall:tOS_INT;external winsockdll name 'WSACancelBlockingCall';
-    function WSAAsyncGetServByName(hWnd:HWND; wMsg:u_int; name:pchar; proto:pchar; buf:pchar;
+    function WSAAsyncGetServByName(hWnd:HWND; wMsg:u_int; name:PAnsiChar; proto:PAnsiChar; buf:PAnsiChar;
                                    buflen:tOS_INT):THandle;external winsockdll name 'WSAAsyncGetServByName';
-    function WSAAsyncGetServByPort(hWnd:HWND; wMsg:u_int; port:tOS_INT; proto:pchar; buf:pchar;
+    function WSAAsyncGetServByPort(hWnd:HWND; wMsg:u_int; port:tOS_INT; proto:PAnsiChar; buf:PAnsiChar;
                                    buflen:tOS_INT):THandle;external winsockdll name 'WSAAsyncGetServByPort';
-    function WSAAsyncGetProtoByName(hWnd:HWND; wMsg:u_int; name:pchar; buf:pchar; buflen:tOS_INT):THandle;
+    function WSAAsyncGetProtoByName(hWnd:HWND; wMsg:u_int; name:PAnsiChar; buf:PAnsiChar; buflen:tOS_INT):THandle;
       external winsockdll name 'WSAAsyncGetProtoByName';
-    function WSAAsyncGetProtoByNumber(hWnd:HWND; wMsg:u_int; number:tOS_INT; buf:pchar; buflen:tOS_INT):THandle;
+    function WSAAsyncGetProtoByNumber(hWnd:HWND; wMsg:u_int; number:tOS_INT; buf:PAnsiChar; buflen:tOS_INT):THandle;
       external winsockdll name 'WSAAsyncGetProtoByNumber';
-    function WSAAsyncGetHostByAddr(hWnd:HWND; wMsg:u_int; addr:pchar; len:tOS_INT; t:tOS_INT;
-                                   buf:pchar; buflen:tOS_INT):THandle;
+    function WSAAsyncGetHostByAddr(hWnd:HWND; wMsg:u_int; addr:PAnsiChar; len:tOS_INT; t:tOS_INT;
+                                   buf:PAnsiChar; buflen:tOS_INT):THandle;
                                    external winsockdll name 'WSAAsyncGetHostByAddr';
     function WSARecvEx(s:TSocket;var buf; len:tOS_INT; flags:ptOS_INT):tOS_INT;
       external winsockdll name 'WSARecvEx';

+ 51 - 51
packages/rtl-extra/src/wince/winsock2.pp

@@ -37,7 +37,7 @@ Const
 {$ENDIF WINCE}
 
 Type
-  u_char = Char;
+  u_char = AnsiChar;
   u_short = Word;
   u_int = DWord;
   u_long = DWord;
@@ -54,7 +54,7 @@ Type
 {$IFDEF UNICODE}
         PMBChar = PWideChar;
 {$ELSE}
-        PMBChar = PChar;
+        PMBChar = PAnsiChar;
 {$ENDIF}
 
 const
@@ -93,35 +93,35 @@ const
 type
   PHostEnt = ^THostEnt;
   THostEnt = record
-    h_name: PChar;
-    h_aliases: ^PChar;
+    h_name: PAnsiChar;
+    h_aliases: ^PAnsiChar;
     h_addrtype: Smallint;
     h_length: Smallint;
     case Byte of
-      0: (h_addr_list: ^PChar);
-      1: (h_addr: ^PChar)
+      0: (h_addr_list: ^PAnsiChar);
+      1: (h_addr: ^PAnsiChar)
   end;
 
   PNetEnt = ^TNetEnt;
   TNetEnt = record
-    n_name: PChar;
-    n_aliases: ^PChar;
+    n_name: PAnsiChar;
+    n_aliases: ^PAnsiChar;
     n_addrtype: Smallint;
     n_net: u_long;
   end;
 
   PServEnt = ^TServEnt;
   TServEnt = record
-    s_name: PChar;
-    s_aliases: ^PChar;
+    s_name: PAnsiChar;
+    s_aliases: ^PAnsiChar;
     s_port: Smallint;
-    s_proto: PChar;
+    s_proto: PAnsiChar;
   end;
 
   PProtoEnt = ^TProtoEnt;
   TProtoEnt = record
-    p_name: PChar;
-    p_aliases: ^Pchar;
+    p_name: PAnsiChar;
+    p_aliases: ^PAnsiChar;
     p_proto: Smallint;
   end;
 
@@ -380,9 +380,9 @@ type
       0: (sin_family: u_short;
           sin_port: u_short;
           sin_addr: TInAddr;
-          sin_zero: array[0..7] of Char);
+          sin_zero: array[0..7] of AnsiChar);
       1: (sa_family: u_short;
-          sa_data: array[0..13] of Char)
+          sa_data: array[0..13] of AnsiChar)
   end;
 
   { Structure used by kernel to store most addresses. }
@@ -412,12 +412,12 @@ const
 type
      sockaddr_storage = record
        ss_family:SmallInt;                          // Address family.
-       __ss_pad1:array[0.._SS_PAD1SIZE-1] of char;  // 6 byte pad, this is to make
+       __ss_pad1:array[0.._SS_PAD1SIZE-1] of AnsiChar;  // 6 byte pad, this is to make
                                                     // implementation specific pad up to
                                                     // alignment field that follows explicit
                                                     // in the data structure.
        __ss_align:Int64;                            // Field to force desired structure.
-       __ss_pad2:array[0.._SS_PAD2SIZE-1] of char;  // 112 byte pad to achieve desired size;
+       __ss_pad2:array[0.._SS_PAD2SIZE-1] of AnsiChar;  // 112 byte pad to achieve desired size;
                                                     // _SS_MAXSIZE value minus size of
                                                     // ss_family, __ss_pad1, and
                                                     // __ss_align fields is 112.
@@ -654,11 +654,11 @@ type
   TWSAData = record
     wVersion: Word;
     wHighVersion: Word;
-    szDescription: array[0..WSADESCRIPTION_LEN] of Char;
-    szSystemStatus: array[0..WSASYS_STATUS_LEN] of Char;
+    szDescription: array[0..WSADESCRIPTION_LEN] of AnsiChar;
+    szSystemStatus: array[0..WSASYS_STATUS_LEN] of AnsiChar;
     iMaxSockets: Word;
     iMaxUdpDg: Word;
-    lpVendorInfo: PChar;
+    lpVendorInfo: PAnsiChar;
   end;
 
 {       WSAOVERLAPPED = Record
@@ -679,7 +679,7 @@ type
 
         WSABUF = record
                 len: U_LONG;    { the length of the buffer }
-                buf: PChar;     { the pointer to the buffer }
+                buf: PAnsiChar;     { the pointer to the buffer }
         end {WSABUF};
         PWSABUF = ^WSABUF;
         LPWSABUF = PWSABUF;
@@ -769,7 +769,7 @@ Type
                 iSecurityScheme: Longint;
                 dwMessageSize: LongInt;
                 dwProviderReserved: LongInt;
-                szProtocol: Array[0..WSAPROTOCOL_LEN+1-1] of Char;
+                szProtocol: Array[0..WSAPROTOCOL_LEN+1-1] of AnsiChar;
         end {TWSAProtocol_InfoA};
         PWSAProtocol_InfoA = ^TWSAProtocol_InfoA;
         LPWSAProtocol_InfoA = PWSAProtocol_InfoA;
@@ -977,16 +977,16 @@ Type
 
         TWSAQuerySetA = record
                 dwSize: LongInt;
-                lpszServiceInstanceName: PChar;
+                lpszServiceInstanceName: PAnsiChar;
                 lpServiceClassId: PGUID;
                 lpVersion: PWSAVERSION;
-                lpszComment: PChar;
+                lpszComment: PAnsiChar;
                 dwNameSpace: LongInt;
                 lpNSProviderId: PGUID;
-                lpszContext: PChar;
+                lpszContext: PAnsiChar;
                 dwNumberOfProtocols: LongInt;
                 lpafpProtocols: PAFProtocols;
-                lpszQueryString: PChar;
+                lpszQueryString: PAnsiChar;
                 dwNumberOfCsAddrs: LongInt;
                 lpcsaBuffer: PCSADDR_INFO;
                 dwOutputFlags: LongInt;
@@ -1050,7 +1050,7 @@ Type
 
 {       Service Installation/Removal Data Types. }
         TWSANSClassInfoA = record
-                lpszName: PChar;
+                lpszName: PAnsiChar;
                 dwNameSpace: LongInt;
                 dwValueType: LongInt;
                 dwValueSize: LongInt;
@@ -1077,7 +1077,7 @@ Type
 
         TWSAServiceClassInfoA = record
                 lpServiceClassId: PGUID;
-                lpszServiceClassName: PChar;
+                lpszServiceClassName: PAnsiChar;
                 dwCount: LongInt;
                 lpClassInfos: PWSANSClassInfoA;
         end {TWSAServiceClassInfoA};
@@ -1106,7 +1106,7 @@ Type
                 dwNameSpace: LongInt;
                 fActive: LongInt{Bool};
                 dwVersion: LongInt;
-                lpszIdentifier: PChar;
+                lpszIdentifier: PAnsiChar;
         end {TWSANameSpace_InfoA};
         PWSANameSpace_InfoA = ^TWSANameSpace_InfoA;
         LPWSANameSpace_InfoA = PWSANameSpace_InfoA;
@@ -1147,41 +1147,41 @@ function connect( const s: TSocket; name: PSockAddr; namelen: Longint): Longint;
 function connect( const s: TSocket; const name: TSockAddr; namelen: Longint): Longint; external WINSOCK2_DLL name 'connect';
 
 function gethostbyaddr(addr: Pointer; len, struct: Longint): PHostEnt; external WINSOCK2_DLL name 'gethostbyaddr';
-function gethostbyname(name: PChar): PHostEnt; external WINSOCK2_DLL name 'gethostbyname';
-function gethostname(name: PChar; len: Longint): Longint; external WINSOCK2_DLL name 'gethostname';
+function gethostbyname(name: PAnsiChar): PHostEnt; external WINSOCK2_DLL name 'gethostbyname';
+function gethostname(name: PAnsiChar; len: Longint): Longint; external WINSOCK2_DLL name 'gethostname';
 function getpeername( const s: TSocket; var name: TSockAddr; var namelen: Longint ): Longint; external WINSOCK2_DLL name 'getpeername';
-function getprotobyname(name: PChar): PProtoEnt; external WINSOCK2_DLL name 'getprotobyname';
+function getprotobyname(name: PAnsiChar): PProtoEnt; external WINSOCK2_DLL name 'getprotobyname';
 function getprotobynumber(proto: Longint): PProtoEnt; external WINSOCK2_DLL name 'getprotobynumber';
-function getservbyport(port: Longint; proto: PChar): PServEnt; external WINSOCK2_DLL name 'getservbyport';
-function getservbyname(name, proto: PChar): PServEnt; external WINSOCK2_DLL name 'getservbyname';
+function getservbyport(port: Longint; proto: PAnsiChar): PServEnt; external WINSOCK2_DLL name 'getservbyport';
+function getservbyname(name, proto: PAnsiChar): PServEnt; external WINSOCK2_DLL name 'getservbyname';
 function getsockname( const s: TSocket; var name: TSockAddr; var namelen: Longint ): Longint; external WINSOCK2_DLL name 'getsockname';
-function getsockopt( const s: TSocket; const level, optname: Longint; optval: PChar; var optlen: Longint ): Longint; external WINSOCK2_DLL name 'getsockopt';
+function getsockopt( const s: TSocket; const level, optname: Longint; optval: PAnsiChar; var optlen: Longint ): Longint; external WINSOCK2_DLL name 'getsockopt';
 function getsockopt( const s: TSocket; const level, optname: Longint; optval: Pointer; var optlen: Longint ): Longint; external WINSOCK2_DLL name 'getsockopt';
 function getsockopt( const s: TSocket; const level, optname: Longint; var optval; var optlen: Longint ): Longint; external WINSOCK2_DLL name 'getsockopt';
 function htonl(hostlong: u_long): u_long; external WINSOCK2_DLL name 'htonl';
 function htons(hostshort: u_short): u_short; external WINSOCK2_DLL name 'htons';
-function inet_addr(cp: PChar): u_long; external WINSOCK2_DLL name 'inet_addr';
-function inet_ntoa(inaddr: TInAddr): PChar; external WINSOCK2_DLL name 'inet_ntoa';
+function inet_addr(cp: PAnsiChar): u_long; external WINSOCK2_DLL name 'inet_addr';
+function inet_ntoa(inaddr: TInAddr): PAnsiChar; external WINSOCK2_DLL name 'inet_ntoa';
 function ioctlsocket( const s: TSocket; cmd: Longint; var arg: u_long ): Longint; external WINSOCK2_DLL name 'ioctlsocket';
 function ioctlsocket( const s: TSocket; cmd: Longint; argp: pu_long ): Longint; external WINSOCK2_DLL name 'ioctlsocket';
 function listen(s: TSocket; backlog: Longint): Longint; external WINSOCK2_DLL name 'listen';
 function ntohl(netlong: u_long): u_long; external WINSOCK2_DLL name 'ntohl';
 function ntohs(netshort: u_short): u_short; external WINSOCK2_DLL name 'ntohs';
 function recv(s: TSocket; var Buf; len, flags: Longint): Longint; external WINSOCK2_DLL name 'recv';
-function recv(s: TSocket; Buf: PChar; len, flags: Longint): Longint; external WINSOCK2_DLL name 'recv';
+function recv(s: TSocket; Buf: PAnsiChar; len, flags: Longint): Longint; external WINSOCK2_DLL name 'recv';
 function recv(s: TSocket; Buf: Pointer; len, flags: Longint): Longint; external WINSOCK2_DLL name 'recv';
-function recvfrom(s: TSocket; Buf: PChar; len, flags: Longint; from: PSockAddr; fromlen: PLongint): Longint; external WINSOCK2_DLL name 'recvfrom';
+function recvfrom(s: TSocket; Buf: PAnsiChar; len, flags: Longint; from: PSockAddr; fromlen: PLongint): Longint; external WINSOCK2_DLL name 'recvfrom';
 function recvfrom(s: TSocket; Buf: Pointer; len, flags: Longint; from: PSockAddr; fromlen: PLongint): Longint; external WINSOCK2_DLL name 'recvfrom';
 function recvfrom(s: TSocket; var Buf; len, flags: Longint; const from: TSockAddr; var fromlen: Longint): Longint; external WINSOCK2_DLL name 'recvfrom';
 function select(nfds: Longint; readfds, writefds, exceptfds: PFDSet; timeout: PTimeVal): Longint; external WINSOCK2_DLL name 'select';
 function send(s: TSocket; const Buf; len, flags: Longint): Longint; external WINSOCK2_DLL name 'send';
-function send(s: TSocket; Buf: PChar; len, flags: Longint): Longint; external WINSOCK2_DLL name 'send';
+function send(s: TSocket; Buf: PAnsiChar; len, flags: Longint): Longint; external WINSOCK2_DLL name 'send';
 function send(s: TSocket; Buf: Pointer; len, flags: Longint): Longint; external WINSOCK2_DLL name 'send';
 function sendto(s: TSocket; const Buf; len, flags: Longint; const addrto: TSockAddr; tolen: Longint): Longint; external WINSOCK2_DLL name 'sendto';
-function sendto(s: TSocket; Buf: PChar; len, flags: Longint; addrto: PSockAddr; tolen: Longint): Longint; external WINSOCK2_DLL name 'sendto';
+function sendto(s: TSocket; Buf: PAnsiChar; len, flags: Longint; addrto: PSockAddr; tolen: Longint): Longint; external WINSOCK2_DLL name 'sendto';
 function sendto(s: TSocket; Buf: Pointer; len, flags: Longint; addrto: PSockAddr; tolen: Longint): Longint; external WINSOCK2_DLL name 'sendto';
 function setsockopt(s: TSocket; level, optname: Longint; const optval; optlen: Longint): Longint; external WINSOCK2_DLL name 'setsockopt';
-function setsockopt(s: TSocket; level, optname: Longint; optval: PChar; optlen: Longint): Longint; external WINSOCK2_DLL name 'setsockopt';
+function setsockopt(s: TSocket; level, optname: Longint; optval: PAnsiChar; optlen: Longint): Longint; external WINSOCK2_DLL name 'setsockopt';
 function setsockopt(s: TSocket; level, optname: Longint; optval: Pointer; optlen: Longint): Longint; external WINSOCK2_DLL name 'setsockopt';
 function shutdown(s: TSocket; how: Longint): Longint; external WINSOCK2_DLL name 'shutdown';
 function socket(af, struct, protocol: Longint): TSocket; external WINSOCK2_DLL name 'socket';
@@ -1190,7 +1190,7 @@ function socket(af, struct, protocol: Longint): TSocket; external WINSOCK2_DLL n
 function WSAAccept( s : TSocket; addr : TSockAddr; addrlen : PLongint; lpfnCondition : LPCONDITIONPROC; dwCallbackData : DWORD ): TSocket;  external WINSOCK2_DLL name 'WSAAccept';
 function WSAAddressToStringW( var lpsaAddress : TSockAddr; const dwAddressLength : DWORD; const lpProtocolInfo : LPWSAProtocol_InfoW;
         const lpszAddressString : PWideChar; var lpdwAddressStringLength : DWORD ): Longint;  external WINSOCK2_DLL name 'WSAAddressToStringW';
-function WSAAsyncGetHostByName(HWindow: HWND; wMsg: u_int; name, buf: PChar; buflen: Longint): THandle;  external WINSOCK2_DLL name 'WSAAsyncGetHostByName';
+function WSAAsyncGetHostByName(HWindow: HWND; wMsg: u_int; name, buf: PAnsiChar; buflen: Longint): THandle;  external WINSOCK2_DLL name 'WSAAsyncGetHostByName';
 function WSAAsyncSelect(s: TSocket; HWindow: HWND; wMsg: u_int; lEvent: Longint): Longint;  external WINSOCK2_DLL name 'WSAAsyncSelect';
 function WSACancelAsyncRequest(hAsyncTaskHandle: THandle): Longint;  external WINSOCK2_DLL name 'WSACancelAsyncRequest';
 function WSACleanup: Longint;  external WINSOCK2_DLL name 'WSACleanup';
@@ -1256,11 +1256,11 @@ function WSAIsBlocking: BOOL;  external WINSOCK2_DLL name 'WSAIsBlocking';
 function WSAUnhookBlockingHook: Longint;  external WINSOCK2_DLL name 'WSAUnhookBlockingHook';
 function WSASetBlockingHook(lpBlockFunc: TFarProc): TFarProc;  external WINSOCK2_DLL name 'WSASetBlockingHook';
 function WSACancelBlockingCall: Longint;  external WINSOCK2_DLL name 'WSACancelBlockingCall';
-function WSAAsyncGetServByName(HWindow: HWND; wMsg: u_int; name, proto, buf: PChar; buflen: Longint): THandle;  external WINSOCK2_DLL name 'WSAAsyncGetServByName';
-function WSAAsyncGetServByPort( HWindow: HWND; wMsg, port: u_int; proto, buf: PChar; buflen: Longint): THandle;  external WINSOCK2_DLL name 'WSAAsyncGetServByPort';
-function WSAAsyncGetProtoByName(HWindow: HWND; wMsg: u_int; name, buf: PChar; buflen: Longint): THandle;  external WINSOCK2_DLL name 'WSAAsyncGetProtoByName';
-function WSAAsyncGetProtoByNumber(HWindow: HWND; wMsg: u_int; number: Longint; buf: PChar; buflen: Longint): THandle;  external WINSOCK2_DLL name 'WSAAsyncGetProtoByNumber';
-function WSAAsyncGetHostByAddr(HWindow: HWND; wMsg: u_int; addr: PChar; len, struct: Longint; buf: PChar; buflen: Longint): THandle;  external WINSOCK2_DLL name 'WSAAsyncGetHostByAddr';
+function WSAAsyncGetServByName(HWindow: HWND; wMsg: u_int; name, proto, buf: PAnsiChar; buflen: Longint): THandle;  external WINSOCK2_DLL name 'WSAAsyncGetServByName';
+function WSAAsyncGetServByPort( HWindow: HWND; wMsg, port: u_int; proto, buf: PAnsiChar; buflen: Longint): THandle;  external WINSOCK2_DLL name 'WSAAsyncGetServByPort';
+function WSAAsyncGetProtoByName(HWindow: HWND; wMsg: u_int; name, buf: PAnsiChar; buflen: Longint): THandle;  external WINSOCK2_DLL name 'WSAAsyncGetProtoByName';
+function WSAAsyncGetProtoByNumber(HWindow: HWND; wMsg: u_int; number: Longint; buf: PAnsiChar; buflen: Longint): THandle;  external WINSOCK2_DLL name 'WSAAsyncGetProtoByNumber';
+function WSAAsyncGetHostByAddr(HWindow: HWND; wMsg: u_int; addr: PAnsiChar; len, struct: Longint; buf: PAnsiChar; buflen: Longint): THandle;  external WINSOCK2_DLL name 'WSAAsyncGetHostByAddr';
 
 function WSADuplicateSocketA( s : TSocket; dwProcessId : DWORD; lpProtocolInfo : LPWSAProtocol_InfoA ) : Longint;  external WINSOCK2_DLL name 'WSADuplicateSocketA';
 function WSADuplicateSocketW( s : TSocket; dwProcessId : DWORD; lpProtocolInfo : LPWSAProtocol_InfoW ) : Longint;  external WINSOCK2_DLL name 'WSADuplicateSocketW';
@@ -1273,10 +1273,10 @@ function WSASendDisconnect( s : TSocket; lpOutboundDisconnectData : LPWSABUF ):
 function WSASocketA( af, iType, protocol : Longint; lpProtocolInfo : LPWSAProtocol_InfoA; g : GROUP; dwFlags : DWORD ): TSocket;  external WINSOCK2_DLL name 'WSASocketA';
 function WSASocket( af, iType, protocol : Longint; lpProtocolInfo : LPWSAProtocol_Info; g : GROUP; dwFlags : DWORD ): TSocket;  external WINSOCK2_DLL name 'WSASocket';
 function WSAAddressToStringA( var lpsaAddress : TSockAddr; const dwAddressLength : DWORD; const lpProtocolInfo : LPWSAProtocol_InfoA;
-        const lpszAddressString : PChar; var lpdwAddressStringLength : DWORD ): Longint;  external WINSOCK2_DLL name 'WSAAddressToStringA';
+        const lpszAddressString : PAnsiChar; var lpdwAddressStringLength : DWORD ): Longint;  external WINSOCK2_DLL name 'WSAAddressToStringA';
 function WSAAddressToString( var lpsaAddress : TSockAddr; const dwAddressLength : DWORD; const lpProtocolInfo : LPWSAProtocol_Info;
         const lpszAddressString : PMBChar; var lpdwAddressStringLength : DWORD ): Longint;  external WINSOCK2_DLL name 'WSAAddressToString';
-function WSAStringToAddressA( const AddressString : PChar; const AddressFamily: Longint; const lpProtocolInfo : LPWSAProtocol_InfoA;
+function WSAStringToAddressA( const AddressString : PAnsiChar; const AddressFamily: Longint; const lpProtocolInfo : LPWSAProtocol_InfoA;
         var lpAddress : TSockAddr; var lpAddressLength : Longint ): Longint;  external WINSOCK2_DLL name 'WSAStringToAddressA';
 function WSAStringToAddress( const AddressString : PMBChar; const AddressFamily: Longint; const lpProtocolInfo : LPWSAProtocol_Info;
         var lpAddress : TSockAddr; var lpAddressLength : Longint ): Longint;  external WINSOCK2_DLL name 'WSAStringToAddress';
@@ -1298,7 +1298,7 @@ function WSAGetServiceClassInfo( const lpProviderId : PGUID; const lpServiceClas
         lpServiceClassInfo : LPWSAServiceClassInfo ): Longint;  external WINSOCK2_DLL name 'WSAGetServiceClassInfo';
 function WSAEnumNameSpaceProvidersA( var lpdwBufferLength: DWORD; const lpnspBuffer: LPWSANameSpace_InfoA ): Longint;  external WINSOCK2_DLL name 'WSAEnumNameSpaceProvidersA';
 function WSAEnumNameSpaceProviders( var lpdwBufferLength: DWORD; const lpnspBuffer: LPWSANameSpace_Info ): Longint;  external WINSOCK2_DLL name 'WSAEnumNameSpaceProviders';
-function WSAGetServiceClassNameByClassIdA( const lpServiceClassId: PGUID; lpszServiceClassName: PChar;
+function WSAGetServiceClassNameByClassIdA( const lpServiceClassId: PGUID; lpszServiceClassName: PAnsiChar;
         var lpdwBufferLength: DWORD ): Longint;  external WINSOCK2_DLL name 'WSAGetServiceClassNameByClassIdA';
 function WSAGetServiceClassNameByClassIdW( const lpServiceClassId: PGUID; lpszServiceClassName: PWideChar;
         var lpdwBufferLength: DWORD ): Longint;  external WINSOCK2_DLL name 'WSAGetServiceClassNameByClassIdW';