Commit in reactos/lib/kernel32/file on MAIN
iocompl.c+8-161.16 -> 1.17
-correct return value/last error
-make use of macros for stu conversion
-pass NULL timeout for INFINITE wait instead of waiting for 292000 years;-D

reactos/lib/kernel32/file
iocompl.c 1.16 -> 1.17
diff -u -r1.16 -r1.17
--- iocompl.c	25 Nov 2004 22:18:16 -0000	1.16
+++ iocompl.c	6 Dec 2004 14:37:11 -0000	1.17
@@ -1,4 +1,4 @@
-/* $Id: iocompl.c,v 1.16 2004/11/25 22:18:16 ion Exp $
+/* $Id: iocompl.c,v 1.17 2004/12/06 14:37:11 gdalsnes Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
@@ -34,7 +34,7 @@
 
    if ( ExistingCompletionPort == NULL && FileHandle == INVALID_HANDLE_VALUE ) 
    {
-      SetLastErrorByStatus (STATUS_INVALID_PARAMETER);
+      SetLastError(ERROR_INVALID_PARAMETER);
       return FALSE;
    }
 
@@ -109,30 +109,22 @@
 
    if (!lpNumberOfBytesTransferred||!lpCompletionKey||!lpOverlapped)
    {
-      return ERROR_INVALID_PARAMETER;
+      SetLastError(ERROR_INVALID_PARAMETER);
+      return FALSE;
    }
 
    if (dwMilliseconds != INFINITE)
    {
-      /*
-       * System time units are 100 nanoseconds (a nanosecond is a billionth of
-       * a second).
-       */
-      Interval.QuadPart = -((ULONGLONG)dwMilliseconds * 10000);
+      Interval.QuadPart = RELATIVE_TIME(MILLIS_TO_100NS(dwMilliseconds));
    }  
-   else
-   {
-      /* Approximately 292000 years hence */
-      Interval.QuadPart = -0x7FFFFFFFFFFFFFFFLL;
-   }
 
    errCode = NtRemoveIoCompletion(CompletionHandle,
                                   (PVOID*)lpCompletionKey,
                                   (PVOID*)lpNumberOfBytesTransferred,
                                   &IoStatus,
-                                  &Interval);
+                                  dwMilliseconds == INFINITE ? NULL : &Interval);
 
-   if (!NT_SUCCESS(errCode) ) {
+   if (!NT_SUCCESS(errCode)) {
       *lpOverlapped = NULL;
       SetLastErrorByStatus(errCode);
       return FALSE;
@@ -142,7 +134,7 @@
 
    if (!NT_SUCCESS(IoStatus.Status)){
       //failed io operation
-      SetLastErrorByStatus (IoStatus.Status);
+      SetLastErrorByStatus(IoStatus.Status);
       return FALSE;
    }
 
CVSspam 0.2.8