[KERNEL32]

- Do not use Zw functions from user mode

svn path=/trunk/; revision=56414
This commit is contained in:
Thomas Faber
2012-04-25 10:17:29 +00:00
parent bf4b9fbaad
commit 74de187fd6
6 changed files with 17 additions and 17 deletions
+6 -6
View File
@@ -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;
}
+1 -1
View File
@@ -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;
}
@@ -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 */
+3 -3
View File
@@ -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),
+1 -1
View File
@@ -549,7 +549,7 @@ GetSystemTimes(OUT LPFILETIME lpIdleTime OPTIONAL,
return FALSE;
}
Status = ZwQuerySystemInformation(SystemProcessorPerformanceInformation,
Status = NtQuerySystemInformation(SystemProcessorPerformanceInformation,
ProcPerfInfo,
BufferSize,
&ReturnLength);
+4 -4
View File
@@ -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,