Index: wince/wininc/base.inc
===================================================================
--- wince/wininc/base.inc	(revision 5038)
+++ wince/wininc/base.inc	(working copy)
@@ -256,7 +256,7 @@
      SIZE_T = Cardinal;        //+winnt
 {$ifdef UNICODE}
      TBYTE = word;
-     TCHAR = word;
+     TCHAR = widechar;
      BCHAR = word;
 {$else}
      TBYTE = byte;
@@ -265,7 +265,7 @@
 {$endif}
 
      UCHAR = byte;          //windef
-     WCHAR = WideChar;      //winnt
+//     WCHAR = WideChar;      //winnt
 
      UINT   = Cardinal;     //windef
      ULONG  = Cardinal;     //windef
Index: wince/sockets.pp
===================================================================
--- wince/sockets.pp	(revision 5038)
+++ wince/sockets.pp	(working copy)
@@ -284,7 +284,7 @@
 
 Function SocketPair(Domain,SocketType,Protocol:Longint;var Pair:TSockArray):Longint;
 begin
-  SocketPair:=fpsocketpair(domain,sockettype,protocol,@pair);
+  SocketPair:=fpsocketpair(domain,sockettype,protocol,@pair[1]);
 end;
 
 { mimic the linux fpWrite/fpRead calls for the file/text socket wrapper }
Index: wince/dos.pp
===================================================================
--- wince/dos.pp	(revision 5038)
+++ wince/dos.pp	(working copy)
@@ -256,7 +256,7 @@
       repeat
         if fd.dwFileAttributes and dev_attr = dev_attr then begin
           len:=0;
-          while fd.cFileName[len] <> 0 do
+          while fd.cFileName[len] <> #0 do
             Inc(len);
           len:=(len + 2)*SizeOf(WideChar);
           GetMem(DriveNames[i], len);
Index: wince/sysutils.pp
===================================================================
--- wince/sysutils.pp	(revision 5038)
+++ wince/sysutils.pp	(working copy)
@@ -290,7 +290,7 @@
   WinToDosTime(F.FindData.ftLastWriteTime,F.Time);
   f.size:=F.FindData.NFileSizeLow;
   f.attr:=F.FindData.dwFileAttributes;
-  PWideCharToString(@F.FindData.cFileName, f.Name);
+  PWideCharToString(@F.FindData.cFileName[0], f.Name);
   Result:=0;
 end;
 
@@ -631,7 +631,7 @@
          nil,
          ErrorCode,
          0,
-         @MsgBuffer,                 { This function allocs the memory }
+         PWideChar(@MsgBuffer),    { This function allocs the memory (in this case you pass a PPwidechar)}
          0,
          nil);
   while (len > 0) and (MsgBuffer[len - 1] <= #32) do
@@ -737,7 +737,7 @@
   WinCEMajorVersion:=versionInfo.dwMajorVersion;
   WinCEMinorVersion:=versionInfo.dwMinorVersion;
   WinCEBuildNumber:=versionInfo.dwBuildNumber;
-  i:=WideToAnsiBuf(@versioninfo.szCSDVersion, -1, @WinCECSDVersion[1], SizeOf(WinCECSDVersion) - 1);
+  i:=WideToAnsiBuf(@versioninfo.szCSDVersion[0], -1, @WinCECSDVersion[1], SizeOf(WinCECSDVersion) - 1);
   if i <> 0 then
     WinCECSDVersion[0]:=chr(i - 1);
 end;
Index: win/wininc/base.inc
===================================================================
--- win/wininc/base.inc	(revision 5038)
+++ win/wininc/base.inc	(working copy)
@@ -243,7 +243,7 @@
 
 {$ifdef UNICODE}
      TBYTE = word;
-     TCHAR = word;
+     TCHAR = widechar;
      BCHAR = word;
 {$else}
      TBYTE = byte;
@@ -252,7 +252,7 @@
 {$endif}
 
      UCHAR = byte;
-     WCHAR = WideChar;
+//     WCHAR = WideChar;
 
      UINT   = cardinal;
      ULONG  = cardinal;
