Author: tfaber
Date: Wed Apr 25 10:17:29 2012
New Revision: 56414

URL: http://svn.reactos.org/svn/reactos?rev=56414&view=rev
Log:
[KERNEL32]
- Do not use Zw functions from user mode

Modified:
    trunk/reactos/dll/win32/kernel32/client/compname.c
    trunk/reactos/dll/win32/kernel32/client/dllmain.c
    trunk/reactos/dll/win32/kernel32/client/file/filemap.c
    trunk/reactos/dll/win32/kernel32/client/proc.c
    trunk/reactos/dll/win32/kernel32/client/time.c
    trunk/reactos/dll/win32/kernel32/client/utils.c

Modified: trunk/reactos/dll/win32/kernel32/client/compname.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/compname.c?rev=56414&r1=56413&r2=56414&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/compname.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/compname.c [iso-8859-1] Wed Apr 25 
10:17:29 2012
@@ -57,7 +57,7 @@
                                NULL,
                                NULL);
 
-    Status = ZwOpenKey(&KeyHandle,
+    Status = NtOpenKey(&KeyHandle,
                        KEY_READ,
                        &ObjectAttributes);
     if (!NT_SUCCESS(Status))
@@ -70,21 +70,21 @@
     KeyInfo = RtlAllocateHeap(RtlGetProcessHeap(), 0, KeyInfoSize);
     if (KeyInfo == NULL)
     {
-        ZwClose(KeyHandle);
+        NtClose(KeyHandle);
         SetLastError(ERROR_OUTOFMEMORY);
         return FALSE;
     }
 
     RtlInitUnicodeString(&ValueName, ValueNameStr);
 
-    Status = ZwQueryValueKey(KeyHandle,
+    Status = NtQueryValueKey(KeyHandle,
                              &ValueName,
                              KeyValuePartialInformation,
                              KeyInfo,
                              KeyInfoSize,
                              &ReturnSize);
 
-    ZwClose(KeyHandle);
+    NtClose(KeyHandle);
 
     if (!NT_SUCCESS(Status))
     {
@@ -396,13 +396,13 @@
                            (wcslen (lpBuffer) + 1) * sizeof(WCHAR));
     if (!NT_SUCCESS(Status))
     {
-        ZwClose(KeyHandle);
+        NtClose(KeyHandle);
         BaseSetLastNTError(Status);
         return FALSE;
     }
 
     NtFlushKey(KeyHandle);
-    ZwClose(KeyHandle);
+    NtClose(KeyHandle);
 
     return TRUE;
 }

Modified: trunk/reactos/dll/win32/kernel32/client/dllmain.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/dllmain.c?rev=56414&r1=56413&r2=56414&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/dllmain.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/dllmain.c [iso-8859-1] Wed Apr 25 
10:17:29 2012
@@ -322,7 +322,7 @@
         if (!NT_SUCCESS(Status))
         {
             DPRINT1("Failed to connect to CSR (Status %lx)\n", Status);
-            ZwTerminateProcess(NtCurrentProcess(), Status);
+            NtTerminateProcess(NtCurrentProcess(), Status);
             return FALSE;
         }
 

Modified: trunk/reactos/dll/win32/kernel32/client/file/filemap.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/file/filemap.c?rev=56414&r1=56413&r2=56414&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/file/filemap.c [iso-8859-1] 
(original)
+++ trunk/reactos/dll/win32/kernel32/client/file/filemap.c [iso-8859-1] Wed Apr 
25 10:17:29 2012
@@ -195,7 +195,7 @@
     }
 
     /* Map the section */
-    Status = ZwMapViewOfSection(hFileMappingObject,
+    Status = NtMapViewOfSection(hFileMappingObject,
                                 NtCurrentProcess(),
                                 &ViewBase,
                                 0,
@@ -326,7 +326,7 @@
     }
 
     /* Open the section */
-    Status = ZwOpenSection(&SectionHandle, dwDesiredAccess, &ObjectAttributes);
+    Status = NtOpenSection(&SectionHandle, dwDesiredAccess, &ObjectAttributes);
     if (!NT_SUCCESS(Status))
     {
         /* We failed */

Modified: trunk/reactos/dll/win32/kernel32/client/proc.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/proc.c?rev=56414&r1=56413&r2=56414&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/proc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/proc.c [iso-8859-1] Wed Apr 25 
10:17:29 2012
@@ -889,7 +889,7 @@
         /* Allocate and Initialize new Environment Block */
         Size = EnviroSize;
         ProcessParameters->Environment = NULL;
-        Status = ZwAllocateVirtualMemory(ProcessHandle,
+        Status = NtAllocateVirtualMemory(ProcessHandle,
                                          
(PVOID*)&ProcessParameters->Environment,
                                          0,
                                          &Size,
@@ -898,7 +898,7 @@
         if (!NT_SUCCESS(Status)) goto FailPath;
 
         /* Write the Environment Block */
-        Status = ZwWriteVirtualMemory(ProcessHandle,
+        Status = NtWriteVirtualMemory(ProcessHandle,
                                       ProcessParameters->Environment,
                                       lpEnvironment,
                                       EnviroSize,
@@ -2947,7 +2947,7 @@
     /* FIXME: Allow CREATE_SEPARATE only for WOW Apps, once we have that. */
 
     /* Get some information about the executable */
-    Status = ZwQuerySection(hSection,
+    Status = NtQuerySection(hSection,
                             SectionImageInformation,
                             &SectionImageInfo,
                             sizeof(SectionImageInfo),

Modified: trunk/reactos/dll/win32/kernel32/client/time.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/time.c?rev=56414&r1=56413&r2=56414&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/time.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/time.c [iso-8859-1] Wed Apr 25 
10:17:29 2012
@@ -549,7 +549,7 @@
         return FALSE;
     }
 
-    Status = ZwQuerySystemInformation(SystemProcessorPerformanceInformation,
+    Status = NtQuerySystemInformation(SystemProcessorPerformanceInformation,
                                       ProcPerfInfo,
                                       BufferSize,
                                       &ReturnLength);

Modified: trunk/reactos/dll/win32/kernel32/client/utils.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/utils.c?rev=56414&r1=56413&r2=56414&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/utils.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/utils.c [iso-8859-1] Wed Apr 25 
10:17:29 2012
@@ -408,7 +408,7 @@
 
     /* Reserve memory for the stack */
     Stack = 0;
-    Status = ZwAllocateVirtualMemory(hProcess,
+    Status = NtAllocateVirtualMemory(hProcess,
                                      (PVOID*)&Stack,
                                      0,
                                      &StackReserve,
@@ -442,7 +442,7 @@
     }
 
     /* Allocate memory for the stack */
-    Status = ZwAllocateVirtualMemory(hProcess,
+    Status = NtAllocateVirtualMemory(hProcess,
                                      (PVOID*)&Stack,
                                      0,
                                      &StackCommit,
@@ -452,7 +452,7 @@
     {
         DPRINT1("Failure to allocate stack\n");
         GuardPageSize = 0;
-        ZwFreeVirtualMemory(hProcess, (PVOID*)&Stack, &GuardPageSize, 
MEM_RELEASE);
+        NtFreeVirtualMemory(hProcess, (PVOID*)&Stack, &GuardPageSize, 
MEM_RELEASE);
         return Status;
     }
 
@@ -464,7 +464,7 @@
     {
         /* Set the guard page */
         GuardPageSize = PAGE_SIZE;
-        Status = ZwProtectVirtualMemory(hProcess,
+        Status = NtProtectVirtualMemory(hProcess,
                                         (PVOID*)&Stack,
                                         &GuardPageSize,
                                         PAGE_GUARD | PAGE_READWRITE,


Reply via email to