Author: mjmartin
Date: Tue May 12 12:58:38 2009
New Revision: 40893

URL: http://svn.reactos.org/svn/reactos?rev=40893&view=rev
Log:
- CreateFileMapping: SetLastError to ERROR_ALREADY_EXISTS for sections that 
already exists.
  SetLastError to ERROR_SUCCESS on success for all API's.
  More kernel32_winetest fixes for virtual.

Modified:
    trunk/reactos/dll/win32/kernel32/mem/section.c

Modified: trunk/reactos/dll/win32/kernel32/mem/section.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/mem/section.c?rev=40893&r1=40892&r2=40893&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/mem/section.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/mem/section.c [iso-8859-1] Tue May 12 
12:58:38 2009
@@ -138,13 +138,21 @@
                              flProtect,
                              Attributes,
                              hFile);
-    if (!NT_SUCCESS(Status))
-    {
-        /* We failed */
-        SetLastErrorByStatus(Status);
-        return NULL;
-    }
-
+    
+    if (Status == STATUS_OBJECT_NAME_EXISTS)
+    {
+        SetLastError(ERROR_ALREADY_EXISTS);
+        return SectionHandle;
+    }
+
+    if (!NT_SUCCESS(Status))
+    {
+        /* We failed */
+        SetLastErrorByStatus(Status);
+        return NULL;
+    }
+
+    SetLastError(ERROR_SUCCESS);
     /* Return the section */
     return SectionHandle;
 }
@@ -211,6 +219,7 @@
         return NULL;
     }
 
+    SetLastError(ERROR_SUCCESS);
     /* Return the base */
     return ViewBase;
 }
@@ -253,6 +262,7 @@
         return FALSE;
     }
 
+    SetLastError(ERROR_SUCCESS);
     /* Otherwise, return sucess */
     return TRUE;
 }
@@ -343,6 +353,7 @@
         return NULL;
     }
 
+    SetLastError(ERROR_SUCCESS);
     /* Otherwise, return the handle */
     return SectionHandle;
 }
@@ -374,6 +385,7 @@
         return FALSE;
     }
 
+    SetLastError(ERROR_SUCCESS);
     /* Return success */
     return TRUE;
 }

Reply via email to