From 60e5c1864536c2c112fc1aa9574a59799a302247 Mon Sep 17 00:00:00 2001
From: peter <peter@freepascal.org>
Date: Tue, 1 Apr 2003 15:57:41 +0000
Subject: [PATCH]   * made THandle platform dependent and unique type

---
 rtl/go32v2/sysutils.pp  | 8 +++++++-
 rtl/objpas/filutilh.inc | 8 ++++----
 rtl/os2/sysutils.pp     | 8 +++++++-
 rtl/posix/sysutils.pp   | 8 ++++++--
 rtl/unix/sysutils.pp    | 8 +++++++-
 rtl/win32/sysutils.pp   | 9 +++++++--
 6 files changed, 38 insertions(+), 11 deletions(-)

diff --git a/rtl/go32v2/sysutils.pp b/rtl/go32v2/sysutils.pp
index 2cbc697c49..97f2a39b7c 100644
--- a/rtl/go32v2/sysutils.pp
+++ b/rtl/go32v2/sysutils.pp
@@ -24,6 +24,9 @@ interface
 uses
   go32,dos;
 
+type
+  THandle = type Longint;
+
 { Include platform independent interface part }
 {$i sysutilh.inc}
 
@@ -751,7 +754,10 @@ Finalization
 end.
 {
   $Log$
-  Revision 1.13  2003-03-29 18:21:42  hajny
+  Revision 1.14  2003-04-01 15:57:41  peter
+    * made THandle platform dependent and unique type
+
+  Revision 1.13  2003/03/29 18:21:42  hajny
     * DirectoryExists declaration changed to that one from fixes branch
 
   Revision 1.12  2003/03/28 19:06:59  peter
diff --git a/rtl/objpas/filutilh.inc b/rtl/objpas/filutilh.inc
index 53b8ab5604..7ff666aadb 100644
--- a/rtl/objpas/filutilh.inc
+++ b/rtl/objpas/filutilh.inc
@@ -14,9 +14,6 @@
 
  **********************************************************************}
 
-Type
-  THandle = Longint;
-
 Type
   TSearchRec = Record
     Time : Longint;
@@ -85,7 +82,10 @@ Function FileSearch (Const Name, DirList : String) : String;
 
 {
   $Log$
-  Revision 1.9  2003-03-29 18:21:41  hajny
+  Revision 1.10  2003-04-01 15:57:41  peter
+    * made THandle platform dependent and unique type
+
+  Revision 1.9  2003/03/29 18:21:41  hajny
     * DirectoryExists declaration changed to that one from fixes branch
 
   Revision 1.8  2003/03/28 19:06:59  peter
diff --git a/rtl/os2/sysutils.pp b/rtl/os2/sysutils.pp
index 8fc346d1e6..5c0881e866 100644
--- a/rtl/os2/sysutils.pp
+++ b/rtl/os2/sysutils.pp
@@ -25,6 +25,9 @@ interface
 uses
  Dos;
 
+type
+  THandle = type Longint;
+
 { Include platform independent interface part }
 {$i sysutilh.inc}
 
@@ -983,7 +986,10 @@ end.
 
 {
   $Log$
-  Revision 1.26  2003-03-31 02:18:39  yuri
+  Revision 1.27  2003-04-01 15:57:41  peter
+    * made THandle platform dependent and unique type
+
+  Revision 1.26  2003/03/31 02:18:39  yuri
   FileClose bug fixed (again ;))
 
   Revision 1.25  2003/03/29 19:14:16  yuri
diff --git a/rtl/posix/sysutils.pp b/rtl/posix/sysutils.pp
index 40835b95de..42fca9eed4 100644
--- a/rtl/posix/sysutils.pp
+++ b/rtl/posix/sysutils.pp
@@ -21,7 +21,8 @@ interface
 { force ansistrings }
 {$H+}
 
-
+type
+  THandle = type Longint;
 
 { Include platform independent interface part }
 {$i sysutilh.inc}
@@ -547,7 +548,10 @@ Finalization
 end.
 {
     $Log$
-    Revision 1.5  2003-03-29 15:36:58  hajny
+    Revision 1.6  2003-04-01 15:57:41  peter
+      * made THandle platform dependent and unique type
+
+    Revision 1.5  2003/03/29 15:36:58  hajny
       * DirectoryExists merged from the fixes branch
 
     Revision 1.4  2003/03/29 15:16:26  hajny
diff --git a/rtl/unix/sysutils.pp b/rtl/unix/sysutils.pp
index a88d23b562..81ecb1d46f 100644
--- a/rtl/unix/sysutils.pp
+++ b/rtl/unix/sysutils.pp
@@ -24,6 +24,9 @@ interface
 uses
   Unix,errors;
 
+type
+  THandle = type Longint;
+
 { Include platform independent interface part }
 {$i sysutilh.inc}
 
@@ -491,7 +494,10 @@ end.
 {
 
   $Log$
-  Revision 1.17  2003-03-30 10:38:00  armin
+  Revision 1.18  2003-04-01 15:57:41  peter
+    * made THandle platform dependent and unique type
+
+  Revision 1.17  2003/03/30 10:38:00  armin
   * corrected typo in DirectoryExists
 
   Revision 1.16  2003/03/29 18:21:42  hajny
diff --git a/rtl/win32/sysutils.pp b/rtl/win32/sysutils.pp
index ae4148dd34..dcc3311391 100644
--- a/rtl/win32/sysutils.pp
+++ b/rtl/win32/sysutils.pp
@@ -30,6 +30,8 @@ uses
 {$i sysutilh.inc}
 
 type
+  THandle = Windows.Handle;
+
   TSystemTime = Windows.TSystemTime;
 
   EWin32Error = class(Exception)
@@ -191,7 +193,7 @@ var
   Handle: THandle;
   FindData: TWin32FindData;
 begin
-  Handle := FindFirstFile(Pchar(FileName), @FindData);
+  Handle := FindFirstFile(Pchar(Directory), @FindData);
   Result:=(Handle <> INVALID_HANDLE_VALUE) and
           ((FindData.dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY) = FILE_ATTRIBUTE_DIRECTORY);
   If Result then
@@ -683,7 +685,10 @@ Finalization
 end.
 {
   $Log$
-  Revision 1.21  2003-03-29 18:21:42  hajny
+  Revision 1.22  2003-04-01 15:57:41  peter
+    * made THandle platform dependent and unique type
+
+  Revision 1.21  2003/03/29 18:21:42  hajny
     * DirectoryExists declaration changed to that one from fixes branch
 
   Revision 1.20  2003/03/28 19:06:59  peter