[kernel32]
[reactos.git] / reactos / dll / win32 / kernel32 / misc / utils.c
index 2c830ce..cebd500 100644 (file)
@@ -257,6 +257,8 @@ BasepCreateStack(HANDLE hProcess,
     /* Now set up some basic Initial TEB Parameters */
     InitialTeb->AllocatedStackBase = (PVOID)Stack;
     InitialTeb->StackBase = (PVOID)(Stack + StackReserve);
+    InitialTeb->PreviousStackBase = NULL;
+    InitialTeb->PreviousStackLimit = NULL;
     
     /* Update the Stack Position */
     Stack += StackReserve - StackCommit;
@@ -412,10 +414,14 @@ BasepMapFile(IN LPCWSTR lpApplicationName,
     RelativeName.Handle = NULL;
 
     /* Find the application name */
-    RtlDosPathNameToNtPathName_U(lpApplicationName,
-                                 ApplicationName,
-                                 NULL,
-                                 &RelativeName);
+    if (!RtlDosPathNameToNtPathName_U(lpApplicationName,
+                                      ApplicationName,
+                                      NULL,
+                                      &RelativeName))
+    {
+        return STATUS_OBJECT_PATH_NOT_FOUND;
+    }
+
     DPRINT("ApplicationName %wZ\n", ApplicationName);
     DPRINT("RelativeName %wZ\n", &RelativeName.DosPath);
     
@@ -442,7 +448,7 @@ BasepMapFile(IN LPCWSTR lpApplicationName,
     if (!NT_SUCCESS(Status))
     {
         DPRINT1("Failed to open file\n");
-        SetLastErrorByStatus (Status);
+        SetLastErrorByStatus(Status);
         return Status;
     }