mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 02:15:47 +00:00
[KERNEL32]
Limit indentation by avoiding many "if ()" imbrications. svn path=/trunk/; revision=59657
This commit is contained in:
parent
dcff1c6eb9
commit
e3cc5db0e6
1 changed files with 21 additions and 23 deletions
|
@ -60,30 +60,28 @@ StuffStdHandle(IN HANDLE ProcessHandle,
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
HANDLE DuplicatedHandle;
|
HANDLE DuplicatedHandle;
|
||||||
SIZE_T Dummy;
|
SIZE_T NumberOfBytesWritten;
|
||||||
|
|
||||||
/* Is there a handle to duplicate? */
|
/* If there is no handle to duplicate, return immediately */
|
||||||
if (StandardHandle)
|
if (!StandardHandle) return;
|
||||||
{
|
|
||||||
/* Duplicate it */
|
/* Duplicate the handle */
|
||||||
Status = NtDuplicateObject(NtCurrentProcess(),
|
Status = NtDuplicateObject(NtCurrentProcess(),
|
||||||
StandardHandle,
|
StandardHandle,
|
||||||
ProcessHandle,
|
ProcessHandle,
|
||||||
&DuplicatedHandle,
|
&DuplicatedHandle,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
DUPLICATE_SAME_ACCESS |
|
DUPLICATE_SAME_ACCESS |
|
||||||
DUPLICATE_SAME_ATTRIBUTES);
|
DUPLICATE_SAME_ATTRIBUTES);
|
||||||
if (NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status)) return;
|
||||||
{
|
|
||||||
/* Write it */
|
/* Write it */
|
||||||
NtWriteVirtualMemory(ProcessHandle,
|
NtWriteVirtualMemory(ProcessHandle,
|
||||||
Address,
|
Address,
|
||||||
&DuplicatedHandle,
|
&DuplicatedHandle,
|
||||||
sizeof(HANDLE),
|
sizeof(HANDLE),
|
||||||
&Dummy);
|
&NumberOfBytesWritten);
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue