From 74de187fd671de7614b078f09a8cebfce9756871 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Wed, 25 Apr 2012 10:17:29 +0000 Subject: [PATCH] [KERNEL32] - Do not use Zw functions from user mode svn path=/trunk/; revision=56414 --- reactos/dll/win32/kernel32/client/compname.c | 12 ++++++------ reactos/dll/win32/kernel32/client/dllmain.c | 2 +- reactos/dll/win32/kernel32/client/file/filemap.c | 4 ++-- reactos/dll/win32/kernel32/client/proc.c | 6 +++--- reactos/dll/win32/kernel32/client/time.c | 2 +- reactos/dll/win32/kernel32/client/utils.c | 8 ++++---- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/reactos/dll/win32/kernel32/client/compname.c b/reactos/dll/win32/kernel32/client/compname.c index 4b404e1f501..8b5784f7b69 100644 --- a/reactos/dll/win32/kernel32/client/compname.c +++ b/reactos/dll/win32/kernel32/client/compname.c @@ -57,7 +57,7 @@ GetComputerNameFromRegistry(LPWSTR RegistryKey, NULL, NULL); - Status = ZwOpenKey(&KeyHandle, + Status = NtOpenKey(&KeyHandle, KEY_READ, &ObjectAttributes); if (!NT_SUCCESS(Status)) @@ -70,21 +70,21 @@ GetComputerNameFromRegistry(LPWSTR RegistryKey, 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 @@ SetComputerNameToRegistry(LPCWSTR RegistryKey, (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; } diff --git a/reactos/dll/win32/kernel32/client/dllmain.c b/reactos/dll/win32/kernel32/client/dllmain.c index 0b34785c9bb..e7f7a721f73 100644 --- a/reactos/dll/win32/kernel32/client/dllmain.c +++ b/reactos/dll/win32/kernel32/client/dllmain.c @@ -322,7 +322,7 @@ DllMain(HANDLE hDll, if (!NT_SUCCESS(Status)) { DPRINT1("Failed to connect to CSR (Status %lx)\n", Status); - ZwTerminateProcess(NtCurrentProcess(), Status); + NtTerminateProcess(NtCurrentProcess(), Status); return FALSE; } diff --git a/reactos/dll/win32/kernel32/client/file/filemap.c b/reactos/dll/win32/kernel32/client/file/filemap.c index 220e1373ef8..4b6f90573f8 100644 --- a/reactos/dll/win32/kernel32/client/file/filemap.c +++ b/reactos/dll/win32/kernel32/client/file/filemap.c @@ -195,7 +195,7 @@ MapViewOfFileEx(HANDLE hFileMappingObject, } /* Map the section */ - Status = ZwMapViewOfSection(hFileMappingObject, + Status = NtMapViewOfSection(hFileMappingObject, NtCurrentProcess(), &ViewBase, 0, @@ -326,7 +326,7 @@ OpenFileMappingW(IN DWORD dwDesiredAccess, } /* Open the section */ - Status = ZwOpenSection(&SectionHandle, dwDesiredAccess, &ObjectAttributes); + Status = NtOpenSection(&SectionHandle, dwDesiredAccess, &ObjectAttributes); if (!NT_SUCCESS(Status)) { /* We failed */ diff --git a/reactos/dll/win32/kernel32/client/proc.c b/reactos/dll/win32/kernel32/client/proc.c index 4c7048ad0ec..5ef7eddbd83 100644 --- a/reactos/dll/win32/kernel32/client/proc.c +++ b/reactos/dll/win32/kernel32/client/proc.c @@ -889,7 +889,7 @@ BasePushProcessParameters(IN ULONG ParameterFlags, /* 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 @@ BasePushProcessParameters(IN ULONG ParameterFlags, if (!NT_SUCCESS(Status)) goto FailPath; /* Write the Environment Block */ - Status = ZwWriteVirtualMemory(ProcessHandle, + Status = NtWriteVirtualMemory(ProcessHandle, ProcessParameters->Environment, lpEnvironment, EnviroSize, @@ -2947,7 +2947,7 @@ GetAppName: /* 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), diff --git a/reactos/dll/win32/kernel32/client/time.c b/reactos/dll/win32/kernel32/client/time.c index 992f063b124..ff729d2c749 100644 --- a/reactos/dll/win32/kernel32/client/time.c +++ b/reactos/dll/win32/kernel32/client/time.c @@ -549,7 +549,7 @@ GetSystemTimes(OUT LPFILETIME lpIdleTime OPTIONAL, return FALSE; } - Status = ZwQuerySystemInformation(SystemProcessorPerformanceInformation, + Status = NtQuerySystemInformation(SystemProcessorPerformanceInformation, ProcPerfInfo, BufferSize, &ReturnLength); diff --git a/reactos/dll/win32/kernel32/client/utils.c b/reactos/dll/win32/kernel32/client/utils.c index 2a24e5bfe70..3cf44f0e591 100644 --- a/reactos/dll/win32/kernel32/client/utils.c +++ b/reactos/dll/win32/kernel32/client/utils.c @@ -408,7 +408,7 @@ BaseCreateStack(HANDLE hProcess, /* Reserve memory for the stack */ Stack = 0; - Status = ZwAllocateVirtualMemory(hProcess, + Status = NtAllocateVirtualMemory(hProcess, (PVOID*)&Stack, 0, &StackReserve, @@ -442,7 +442,7 @@ BaseCreateStack(HANDLE hProcess, } /* Allocate memory for the stack */ - Status = ZwAllocateVirtualMemory(hProcess, + Status = NtAllocateVirtualMemory(hProcess, (PVOID*)&Stack, 0, &StackCommit, @@ -452,7 +452,7 @@ BaseCreateStack(HANDLE hProcess, { 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 @@ BaseCreateStack(HANDLE hProcess, { /* Set the guard page */ GuardPageSize = PAGE_SIZE; - Status = ZwProtectVirtualMemory(hProcess, + Status = NtProtectVirtualMemory(hProcess, (PVOID*)&Stack, &GuardPageSize, PAGE_GUARD | PAGE_READWRITE,