fix some MSVC compile problems
[reactos.git] / reactos / lib / crt / process / _cwait.c
index f52dc44..bf4a744 100644 (file)
@@ -2,7 +2,7 @@
  * COPYRIGHT:   See COPYING in the top level directory
  * PROJECT:     ReactOS system libraries
  * FILE:        lib/msvcrt/process/cwait.c
- * PURPOSE:     Waits for a process to exit 
+ * PURPOSE:     Waits for a process to exit
  * PROGRAMER:   Boudewijn Dekker
  * UPDATE HISTORY:
  *              04/03/99: Created
@@ -22,15 +22,15 @@ int _cwait(int* pnStatus, int hProc, int nAction)
     DWORD ExitCode;
 
        nAction = 0;
-       if (WaitForSingleObject((void*)hProc, INFINITE) != WAIT_OBJECT_0) {
+       if (WaitForSingleObject((void*)ULongToPtr(hProc), INFINITE) != WAIT_OBJECT_0) {
                __set_errno(ECHILD);
                return -1;
        }
 
-       if (!GetExitCodeProcess((void*)hProc, &ExitCode))
+       if (!GetExitCodeProcess((void*)ULongToPtr(hProc), &ExitCode))
                return -1;
        if (pnStatus != NULL)
         *pnStatus = (int)ExitCode;
-    CloseHandle((HANDLE)hProc);
+    CloseHandle((HANDLE)ULongToPtr(hProc));
     return hProc;
 }