[FORMATTING]

Fix indentation and coding style. No code changes!

svn path=/trunk/; revision=63305
This commit is contained in:
Eric Kohl 2014-05-15 16:32:30 +00:00
parent 8afc11c2e4
commit ac2f92611e
5 changed files with 872 additions and 854 deletions

View file

@ -1,8 +1,7 @@
#include <usetup.h>
BOOLEAN
NATIVE_InitConsole(
VOID)
NATIVE_InitConsole(VOID)
{
return (BOOLEAN)AllocConsole();
}

View file

@ -11,6 +11,7 @@ NATIVE_CreateFileSystemList(
return TRUE;
}
BOOLEAN
NATIVE_FormatPartition(
IN PFILE_SYSTEM_ITEM FileSystem,
@ -19,13 +20,11 @@ NATIVE_FormatPartition(
{
NTSTATUS Status;
Status = FileSystem->FormatFunc(
(PUNICODE_STRING)DriveRoot,
Status = FileSystem->FormatFunc((PUNICODE_STRING)DriveRoot,
FMIFS_HARDDISK, /* MediaFlag */
NULL, /* Label */
FileSystem->QuickFormat, /* QuickFormat */
0, /* ClusterSize */
Callback); /* Callback */
return NT_SUCCESS(Status);
}

View file

@ -36,7 +36,8 @@
/* FUNCTIONS *****************************************************************/
BOOL WINAPI
BOOL
WINAPI
AllocConsole(VOID)
{
UNICODE_STRING ScreenName = RTL_CONSTANT_STRING(L"\\??\\BlueScreen");
@ -46,14 +47,12 @@ AllocConsole(VOID)
NTSTATUS Status;
/* Open the screen */
InitializeObjectAttributes(
&ObjectAttributes,
InitializeObjectAttributes(&ObjectAttributes,
&ScreenName,
0,
NULL,
NULL);
Status = NtOpenFile(
&StdOutput,
Status = NtOpenFile(&StdOutput,
FILE_ALL_ACCESS,
&ObjectAttributes,
&IoStatusBlock,
@ -63,14 +62,12 @@ AllocConsole(VOID)
return FALSE;
/* Open the keyboard */
InitializeObjectAttributes(
&ObjectAttributes,
InitializeObjectAttributes(&ObjectAttributes,
&KeyboardName,
0,
NULL,
NULL);
Status = NtOpenFile(
&StdInput,
Status = NtOpenFile(&StdInput,
FILE_ALL_ACCESS,
&ObjectAttributes,
&IoStatusBlock,
@ -82,14 +79,18 @@ AllocConsole(VOID)
return TRUE;
}
BOOL WINAPI
BOOL
WINAPI
AttachConsole(
IN DWORD dwProcessId)
{
return FALSE;
}
BOOL WINAPI
BOOL
WINAPI
FreeConsole(VOID)
{
if (StdInput != INVALID_HANDLE_VALUE)
@ -101,7 +102,9 @@ FreeConsole(VOID)
return TRUE;
}
BOOL WINAPI
BOOL
WINAPI
WriteConsole(
IN HANDLE hConsoleOutput,
IN const VOID *lpBuffer,
@ -112,8 +115,7 @@ WriteConsole(
IO_STATUS_BLOCK IoStatusBlock;
NTSTATUS Status;
Status = NtWriteFile(
hConsoleOutput,
Status = NtWriteFile(hConsoleOutput,
NULL,
NULL,
NULL,
@ -129,7 +131,9 @@ WriteConsole(
return TRUE;
}
HANDLE WINAPI
HANDLE
WINAPI
GetStdHandle(
IN DWORD nStdHandle)
{
@ -144,7 +148,9 @@ GetStdHandle(
}
}
BOOL WINAPI
BOOL
WINAPI
FlushConsoleInputBuffer(
IN HANDLE hConsoleInput)
{
@ -156,8 +162,7 @@ FlushConsoleInputBuffer(
do
{
Offset.QuadPart = 0;
Status = NtReadFile(
hConsoleInput,
Status = NtReadFile(hConsoleInput,
NULL,
NULL,
NULL,
@ -180,7 +185,9 @@ FlushConsoleInputBuffer(
return FALSE;
}
BOOL WINAPI
BOOL
WINAPI
ReadConsoleInput(
IN HANDLE hConsoleInput,
OUT PINPUT_RECORD lpBuffer,
@ -193,8 +200,7 @@ ReadConsoleInput(
NTSTATUS Status;
Offset.QuadPart = 0;
Status = NtReadFile(
hConsoleInput,
Status = NtReadFile(hConsoleInput,
NULL,
NULL,
NULL,
@ -220,7 +226,9 @@ ReadConsoleInput(
return TRUE;
}
BOOL WINAPI
BOOL
WINAPI
WriteConsoleOutputCharacterA(
HANDLE hConsoleOutput,
IN LPCSTR lpCharacter,
@ -234,8 +242,7 @@ WriteConsoleOutputCharacterA(
PCHAR pText;
NTSTATUS Status;
Buffer = (CHAR*) RtlAllocateHeap(
ProcessHeap,
Buffer = (CHAR*)RtlAllocateHeap(ProcessHeap,
0,
nLength + sizeof(COORD));
pCoord = (COORD *)Buffer;
@ -244,8 +251,7 @@ WriteConsoleOutputCharacterA(
*pCoord = dwWriteCoord;
memcpy(pText, lpCharacter, nLength);
Status = NtDeviceIoControlFile(
hConsoleOutput,
Status = NtDeviceIoControlFile(hConsoleOutput,
NULL,
NULL,
NULL,
@ -256,10 +262,7 @@ WriteConsoleOutputCharacterA(
Buffer,
nLength + sizeof(COORD));
RtlFreeHeap(
ProcessHeap,
0,
Buffer);
RtlFreeHeap(ProcessHeap, 0, Buffer);
if (!NT_SUCCESS(Status))
return FALSE;
@ -267,7 +270,9 @@ WriteConsoleOutputCharacterA(
return TRUE;
}
BOOL WINAPI
BOOL
WINAPI
WriteConsoleOutputCharacterW(
HANDLE hConsoleOutput,
IN LPCWSTR lpCharacter,
@ -282,8 +287,7 @@ WriteConsoleOutputCharacterW(
NTSTATUS Status;
ULONG i;
Buffer = (CHAR*) RtlAllocateHeap(
ProcessHeap,
Buffer = (CHAR*)RtlAllocateHeap(ProcessHeap,
0,
nLength + sizeof(COORD));
pCoord = (COORD *)Buffer;
@ -295,8 +299,7 @@ WriteConsoleOutputCharacterW(
for (i = 0; i < nLength; i++)
pText[i] = (CHAR)lpCharacter[i];
Status = NtDeviceIoControlFile(
hConsoleOutput,
Status = NtDeviceIoControlFile(hConsoleOutput,
NULL,
NULL,
NULL,
@ -307,10 +310,7 @@ WriteConsoleOutputCharacterW(
Buffer,
nLength + sizeof(COORD));
RtlFreeHeap(
ProcessHeap,
0,
Buffer);
RtlFreeHeap(ProcessHeap, 0, Buffer);
if (!NT_SUCCESS(Status))
return FALSE;
@ -318,7 +318,9 @@ WriteConsoleOutputCharacterW(
return TRUE;
}
BOOL WINAPI
BOOL
WINAPI
FillConsoleOutputAttribute(
IN HANDLE hConsoleOutput,
IN WORD wAttribute,
@ -334,8 +336,7 @@ FillConsoleOutputAttribute(
Buffer.nLength = nLength;
Buffer.dwCoord = dwWriteCoord;
Status = NtDeviceIoControlFile(
hConsoleOutput,
Status = NtDeviceIoControlFile(hConsoleOutput,
NULL,
NULL,
NULL,
@ -345,7 +346,6 @@ FillConsoleOutputAttribute(
sizeof(OUTPUT_ATTRIBUTE),
&Buffer,
sizeof(OUTPUT_ATTRIBUTE));
if (!NT_SUCCESS(Status))
return FALSE;
@ -353,7 +353,9 @@ FillConsoleOutputAttribute(
return TRUE;
}
BOOL WINAPI
BOOL
WINAPI
FillConsoleOutputCharacterA(
IN HANDLE hConsoleOutput,
IN CHAR cCharacter,
@ -369,8 +371,7 @@ FillConsoleOutputCharacterA(
Buffer.nLength = nLength;
Buffer.dwCoord = dwWriteCoord;
Status = NtDeviceIoControlFile(
hConsoleOutput,
Status = NtDeviceIoControlFile(hConsoleOutput,
NULL,
NULL,
NULL,
@ -387,7 +388,9 @@ FillConsoleOutputCharacterA(
return TRUE;
}
BOOL WINAPI
BOOL
WINAPI
GetConsoleScreenBufferInfo(
IN HANDLE hConsoleOutput,
OUT PCONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo)
@ -395,8 +398,7 @@ GetConsoleScreenBufferInfo(
IO_STATUS_BLOCK IoStatusBlock;
NTSTATUS Status;
Status = NtDeviceIoControlFile(
hConsoleOutput,
Status = NtDeviceIoControlFile(hConsoleOutput,
NULL,
NULL,
NULL,
@ -409,7 +411,9 @@ GetConsoleScreenBufferInfo(
return NT_SUCCESS(Status);
}
BOOL WINAPI
BOOL
WINAPI
SetConsoleCursorInfo(
IN HANDLE hConsoleOutput,
IN const CONSOLE_CURSOR_INFO *lpConsoleCursorInfo)
@ -417,8 +421,7 @@ SetConsoleCursorInfo(
IO_STATUS_BLOCK IoStatusBlock;
NTSTATUS Status;
Status = NtDeviceIoControlFile(
hConsoleOutput,
Status = NtDeviceIoControlFile(hConsoleOutput,
NULL,
NULL,
NULL,
@ -431,7 +434,9 @@ SetConsoleCursorInfo(
return NT_SUCCESS(Status);
}
BOOL WINAPI
BOOL
WINAPI
SetConsoleCursorPosition(
IN HANDLE hConsoleOutput,
IN COORD dwCursorPosition)
@ -447,8 +452,7 @@ SetConsoleCursorPosition(
ConsoleScreenBufferInfo.dwCursorPosition.X = dwCursorPosition.X;
ConsoleScreenBufferInfo.dwCursorPosition.Y = dwCursorPosition.Y;
Status = NtDeviceIoControlFile(
hConsoleOutput,
Status = NtDeviceIoControlFile(hConsoleOutput,
NULL,
NULL,
NULL,
@ -458,11 +462,12 @@ SetConsoleCursorPosition(
sizeof(CONSOLE_SCREEN_BUFFER_INFO),
NULL,
0);
return NT_SUCCESS(Status);
}
BOOL WINAPI
BOOL
WINAPI
SetConsoleTextAttribute(
IN HANDLE hConsoleOutput,
IN WORD wAttributes)
@ -470,8 +475,7 @@ SetConsoleTextAttribute(
IO_STATUS_BLOCK IoStatusBlock;
NTSTATUS Status;
Status = NtDeviceIoControlFile(
hConsoleOutput,
Status = NtDeviceIoControlFile(hConsoleOutput,
NULL,
NULL,
NULL,
@ -484,7 +488,9 @@ SetConsoleTextAttribute(
return NT_SUCCESS(Status);
}
BOOL WINAPI
BOOL
WINAPI
SetConsoleOutputCP(
IN UINT wCodepage)
{
@ -494,8 +500,7 @@ SetConsoleOutputCP(
hConsoleOutput = GetStdHandle(STD_OUTPUT_HANDLE);
Status = NtDeviceIoControlFile(
hConsoleOutput,
Status = NtDeviceIoControlFile(hConsoleOutput,
NULL,
NULL,
NULL,

View file

@ -26,14 +26,17 @@
#pragma once
BOOL WINAPI
BOOL
WINAPI
AllocConsole(VOID);
BOOL WINAPI
BOOL
WINAPI
AttachConsole(
IN DWORD dwProcessId);
BOOL WINAPI
BOOL
WINAPI
FillConsoleOutputAttribute(
IN HANDLE hConsoleOutput,
IN WORD wAttribute,
@ -41,7 +44,8 @@ FillConsoleOutputAttribute(
IN COORD dwWriteCoord,
OUT LPDWORD lpNumberOfAttrsWritten);
BOOL WINAPI
BOOL
WINAPI
FillConsoleOutputCharacterA(
IN HANDLE hConsoleOutput,
IN CHAR cCharacter,
@ -49,41 +53,49 @@ FillConsoleOutputCharacterA(
IN COORD dwWriteCoord,
OUT LPDWORD lpNumberOfCharsWritten);
BOOL WINAPI
BOOL
WINAPI
FreeConsole(VOID);
BOOL WINAPI
BOOL
WINAPI
GetConsoleScreenBufferInfo(
IN HANDLE hConsoleOutput,
OUT PCONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo);
HANDLE WINAPI
HANDLE
WINAPI
GetStdHandle(
IN DWORD nStdHandle);
BOOL WINAPI
BOOL
WINAPI
ReadConsoleInput(
IN HANDLE hConsoleInput,
OUT PINPUT_RECORD lpBuffer,
IN DWORD nLength,
OUT LPDWORD lpNumberOfEventsRead);
BOOL WINAPI
BOOL
WINAPI
SetConsoleCursorInfo(
IN HANDLE hConsoleOutput,
IN const CONSOLE_CURSOR_INFO *lpConsoleCursorInfo);
BOOL WINAPI
BOOL
WINAPI
SetConsoleCursorPosition(
IN HANDLE hConsoleOutput,
IN COORD dwCursorPosition);
BOOL WINAPI
BOOL
WINAPI
SetConsoleTextAttribute(
IN HANDLE hConsoleOutput,
IN WORD wAttributes);
BOOL WINAPI
BOOL
WINAPI
WriteConsole(
IN HANDLE hConsoleOutput,
IN const VOID *lpBuffer,
@ -91,7 +103,8 @@ WriteConsole(
OUT LPDWORD lpNumberOfCharsWritten,
IN LPVOID lpReserved);
BOOL WINAPI
BOOL
WINAPI
WriteConsoleOutputCharacterA(
HANDLE hConsoleOutput,
IN LPCSTR lpCharacter,
@ -99,7 +112,8 @@ WriteConsoleOutputCharacterA(
IN COORD dwWriteCoord,
OUT LPDWORD lpNumberOfCharsWritten);
BOOL WINAPI
BOOL
WINAPI
WriteConsoleOutputCharacterW(
HANDLE hConsoleOutput,
IN LPCSTR lpCharacter,
@ -107,7 +121,8 @@ WriteConsoleOutputCharacterW(
IN COORD dwWriteCoord,
OUT LPDWORD lpNumberOfCharsWritten);
BOOL WINAPI
BOOL
WINAPI
SetConsoleOutputCP(
IN UINT wCodePageID
);