implementation of TouchFileTimes()

Thomas Weidenmueller wine-patches at reactsoft.com
Sat Jul 24 06:08:29 CDT 2004


Implementation of TouchFileTimes() in ReactOS, Thanks to Florian Stinglmayr for submitting a rough draft  ;) 

-------------- next part --------------
Index: dlls/imagehlp/imagehlp_main.c
===================================================================
RCS file: /home/wine/wine/dlls/imagehlp/imagehlp_main.c,v
retrieving revision 1.17
diff -u -r1.17 imagehlp_main.c
--- dlls/imagehlp/imagehlp_main.c	5 Apr 2004 22:50:45 -0000	1.17
+++ dlls/imagehlp/imagehlp_main.c	24 Jul 2004 10:59:36 -0000
@@ -61,12 +61,20 @@
 /***********************************************************************
  *           TouchFileTimes (IMAGEHLP.@)
  */
-BOOL WINAPI TouchFileTimes(
-  HANDLE FileHandle, LPSYSTEMTIME lpSystemTime)
+/***********************************************************************
+ *           TouchFileTimes (IMAGEHLP.@)
+ */
+BOOL WINAPI TouchFileTimes(HANDLE FileHandle, LPSYSTEMTIME lpSystemTime)
 {
-  FIXME("(%p, %p): stub\n",
-    FileHandle, lpSystemTime
-  );
-  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-  return FALSE;
+  FILETIME FileTime;
+  SYSTEMTIME SystemTime;
+
+  if(lpSystemTime == NULL)
+  {
+    GetSystemTime(&SystemTime);
+    lpSystemTime = &SystemTime;
+  }
+
+  return (SystemTimeToFileTime(lpSystemTime, &FileTime) &&
+          SetFileTime(FileHandle, NULL, NULL, &FileTime));
 }


More information about the wine-patches mailing list