Index: trunk/src/kernel32/hmfile.cpp
===================================================================
--- trunk/src/kernel32/hmfile.cpp	(revision 9528)
+++ trunk/src/kernel32/hmfile.cpp	(revision 9530)
@@ -1,3 +1,3 @@
-/* $Id: hmfile.cpp,v 1.36 2002-12-03 11:29:27 sandervl Exp $ */
+/* $Id: hmfile.cpp,v 1.37 2002-12-19 12:55:27 sandervl Exp $ */
 
 /*
@@ -141,4 +141,6 @@
  * Result    :
  * Remark    : TODO: Check if this implementation is complete and 100% correct
+ *		             UTC Time or Localtime ?
+ *                   GetFileTime is changed, Returns UTC-time yet !!!!! 
  * Status    : NO_ERROR - API succeeded
  *             other    - what is to be set in SetLastError
@@ -220,4 +222,5 @@
                     &filetime );
 
+		/* UTC Time or Localtime ? GetFileTime Returns UTC-time yet ? !!!!! */ 
         FileTimeToDosDateTime(&filetime,
                               &filedatetime[0],
@@ -674,5 +677,5 @@
 }
 
-
+//******************************************************************************
 /*****************************************************************************
  * Name      : BOOL HMDeviceFileClass::SetFileTime
@@ -687,5 +690,5 @@
  * Status    :
  *
- * Author    : Patrick Haller [Wed, 1999/06/17 20:44]
+ * Author    : Patrick Haller [Wed, 1999/06/17 20:44] mod. DT
  *****************************************************************************/
 
@@ -695,30 +698,9 @@
                                     LPFILETIME pFT3)
 {
- WORD creationdate = 0, creationtime = 0;
- WORD lastaccessdate = 0, lastaccesstime = 0;
- WORD lastwritedate = 0, lastwritetime = 0;
-
     dprintfl(("KERNEL32: HMDeviceFileClass::SetFileTime %s(%08xh,%08xh,%08xh,%08xh)\n",
               lpHMDeviceName, pHMHandleData, pFT1, pFT2, pFT3));
 
-    if(pFT1 && pFT1->dwLowDateTime && pFT1->dwHighDateTime) {
-        FileTimeToDosDateTime(pFT1, &creationdate, &creationtime);
-    }
-
-    if(pFT2 && pFT2->dwLowDateTime && pFT2->dwHighDateTime) {
-        FileTimeToDosDateTime(pFT2, &lastaccessdate, &lastaccesstime);
-    }
-
-    if(pFT3 && pFT3->dwLowDateTime && pFT3->dwHighDateTime) {
-        FileTimeToDosDateTime(pFT3, &lastwritedate, &lastwritetime);
-    }
-
-    if(OSLibDosSetFileTime(pHMHandleData->hHMHandle,
-                           creationdate, creationtime,
-                           lastaccessdate, lastaccesstime,
-                           lastwritedate, lastwritetime))
-    {
-        return TRUE;
-    }
+    if(OSLibDosSetFileTime(pHMHandleData->hHMHandle, pFT1, pFT2, pFT3)) return TRUE;
+
     dprintf(("SetFileTime failed with error %d", GetLastError()));
     return FALSE;
@@ -737,5 +719,5 @@
  * Status    :
  *
- * Author    : SvL
+ * Author    : SvL mod. DT
  *****************************************************************************/
 
@@ -745,9 +727,4 @@
                                     LPFILETIME pFT3)
 {
- WORD creationdate, creationtime;
- WORD lastaccessdate, lastaccesstime;
- WORD lastwritedate, lastwritetime;
- BOOL rc;
-
   if(!pFT1 && !pFT2 && !pFT3) {//TODO: does NT do this?
     dprintf(("ERROR: GetFileTime: invalid parameter!"));
@@ -756,20 +733,5 @@
   }
 
-  if(OSLibDosGetFileTime(pHMHandleData->hHMHandle,
-                         &creationdate, &creationtime,
-                         &lastaccessdate, &lastaccesstime,
-                         &lastwritedate, &lastwritetime))
-  {
-    if(pFT1) {
-        DosDateTimeToFileTime(creationdate, creationtime, pFT1);
-    }
-    if(pFT2) {
-        DosDateTimeToFileTime(lastaccessdate, lastaccesstime, pFT2);
-    }
-    if(pFT3) {
-        DosDateTimeToFileTime(lastwritedate, lastwritetime, pFT3);
-    }
-    return TRUE;
-  }
+  if(OSLibDosGetFileTime(pHMHandleData->hHMHandle, pFT1, pFT2, pFT3)) return TRUE;
   dprintf(("GetFileTime failed with error %d", GetLastError()));
   return FALSE;
Index: trunk/src/kernel32/oslibdos.cpp
===================================================================
--- trunk/src/kernel32/oslibdos.cpp	(revision 9528)
+++ trunk/src/kernel32/oslibdos.cpp	(revision 9530)
@@ -1,3 +1,3 @@
-/* $Id: oslibdos.cpp,v 1.109 2002-09-26 16:06:07 sandervl Exp $ */
+/* $Id: oslibdos.cpp,v 1.110 2002-12-19 12:55:27 sandervl Exp $ */
 /*
  * Wrappers for OS/2 Dos* API
@@ -673,10 +673,18 @@
     dosDate = *(USHORT*)pDate;
 
+    //time we get from OS2 is local time; win32 expects file time (UTC)
     ret = DosDateTimeToFileTime(dosDate, dosTime, &dummy);
-    if(ret == FALSE) {
-        return FALSE;
-    }
-    //time we get from OS2 is local time; win32 expects file time (UTC)
-    ret = LocalFileTimeToFileTime(&dummy, pFT);
+    if(ret) ret = LocalFileTimeToFileTime(&dummy, pFT);
+    return ret;
+}
+//******************************************************************************
+//******************************************************************************
+BOOL pmFileTimeToDateTime(FILETIME *pFT, FDATE *pDate, FTIME *pTime)
+{
+    BOOL 	ret;
+    FILETIME dummy;
+    //time we get from win32 is file time (UTC); OS2 expects local time
+    ret = FileTimeToLocalFileTime(pFT, &dummy);
+    if (ret) ret = FileTimeToDosDateTime(&dummy, (WORD*)pDate, (WORD*)pTime);
     return ret;
 }
@@ -1391,7 +1399,6 @@
 //******************************************************************************
 //******************************************************************************
-BOOL OSLibDosSetFileTime(DWORD hFile, WORD creationdate, WORD creationtime,
-                         WORD lastaccessdate, WORD lastaccesstime,
-                         WORD lastwritedate, WORD lastwritetime)
+BOOL OSLibDosSetFileTime(DWORD hFile,  LPFILETIME pFT1,
+                         LPFILETIME pFT2, LPFILETIME pFT3)
 {
   FILESTATUS3 fileInfo;
@@ -1400,18 +1407,9 @@
   rc = DosQueryFileInfo(hFile, FIL_STANDARD, &fileInfo, sizeof(fileInfo));
 
-  if(rc == NO_ERROR)
-  {
-    if(creationdate && creationtime) {
-        fileInfo.fdateCreation   = *(FDATE *)&creationdate;
-        fileInfo.ftimeCreation   = *(FTIME *)&creationtime;
-    }
-    if(lastaccessdate && lastaccesstime) {
-        fileInfo.fdateLastAccess = *(FDATE *)&lastaccessdate;
-        fileInfo.ftimeLastAccess = *(FTIME *)&lastaccesstime;
-    }
-    if(lastwritedate && lastwritetime) {
-        fileInfo.fdateLastWrite  = *(FDATE *)&lastwritedate;
-        fileInfo.ftimeLastWrite  = *(FTIME *)&lastwritetime;
-    }
+  if (rc == NO_ERROR)
+  {
+	if (pFT1) pmFileTimeToDateTime(pFT1, &fileInfo.fdateCreation,  &fileInfo.ftimeCreation);
+	if (pFT2) pmFileTimeToDateTime(pFT2, &fileInfo.fdateLastAccess,&fileInfo.ftimeLastAccess);
+	if (pFT3) pmFileTimeToDateTime(pFT3, &fileInfo.fdateLastWrite, &fileInfo.ftimeLastWrite);
 
     rc = DosSetFileInfo(hFile, FIL_STANDARD, &fileInfo, sizeof(fileInfo));
@@ -1428,7 +1426,6 @@
 //******************************************************************************
 //******************************************************************************
-BOOL OSLibDosGetFileTime(DWORD hFile, WORD *creationdate, WORD *creationtime,
-                         WORD *lastaccessdate, WORD *lastaccesstime,
-                         WORD *lastwritedate, WORD *lastwritetime)
+BOOL OSLibDosGetFileTime(DWORD hFile, LPFILETIME pFT1,
+                         LPFILETIME pFT2, LPFILETIME pFT3)
 {
   FILESTATUS3 fileInfo;
@@ -1439,12 +1436,8 @@
   if(rc == NO_ERROR)
   {
-    *creationdate   = *(WORD *)&fileInfo.fdateCreation;
-    *creationtime   = *(WORD *)&fileInfo.ftimeCreation;
-    *lastaccessdate = *(WORD *)&fileInfo.fdateLastAccess;
-    *lastaccesstime = *(WORD *)&fileInfo.ftimeLastAccess;
-    *lastwritedate  = *(WORD *)&fileInfo.fdateLastWrite;
-    *lastwritetime  = *(WORD *)&fileInfo.ftimeLastWrite;
-  }
-
+  	if (pFT1) pmDateTimeToFileTime(&fileInfo.fdateCreation,  &fileInfo.ftimeCreation,  pFT1);
+  	if (pFT2) pmDateTimeToFileTime(&fileInfo.fdateLastAccess,&fileInfo.ftimeLastAccess,pFT2);
+  	if (pFT3) pmDateTimeToFileTime(&fileInfo.fdateLastWrite, &fileInfo.ftimeLastWrite, pFT3);
+  }
   if(rc)
   {
Index: trunk/src/kernel32/oslibdos.h
===================================================================
--- trunk/src/kernel32/oslibdos.h	(revision 9528)
+++ trunk/src/kernel32/oslibdos.h	(revision 9530)
@@ -1,3 +1,3 @@
-/* $Id: oslibdos.h,v 1.48 2002-08-22 14:21:27 sandervl Exp $ */
+/* $Id: oslibdos.h,v 1.49 2002-12-19 12:55:27 sandervl Exp $ */
 
 /*
@@ -99,11 +99,11 @@
 BOOL  OSLibDosGetFileInformationByHandle(DWORD hFile, BY_HANDLE_FILE_INFORMATION* pHFI);
 
-BOOL  OSLibDosSetFileTime(DWORD hFile, WORD creationdate, WORD creationtime,
-                          WORD lastaccessdate, WORD lastaccesstime,
-                          WORD lastwritedate, WORD lastwritetime);
-
-BOOL  OSLibDosGetFileTime(DWORD hFile, WORD *creationdate, WORD *creationtime,
-                          WORD *lastaccessdate, WORD *lastaccesstime,
-                          WORD *lastwritedate, WORD *lastwritetime);
+BOOL  OSLibDosSetFileTime(DWORD hFile, LPFILETIME pFT1,
+                                    LPFILETIME pFT2,
+                                    LPFILETIME pFT3);
+
+BOOL  OSLibDosGetFileTime(DWORD hFile, LPFILETIME pFT1,
+                                    LPFILETIME pFT2,
+                                    LPFILETIME pFT3);
 
 DWORD OSLibDosSetFilePointer(DWORD hFile, DWORD OffsetLow, DWORD *OffsetHigh, DWORD method);
