[FORMATTING]
authorEric Kohl <eric.kohl@reactos.org>
Thu, 15 May 2014 16:32:30 +0000 (16:32 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Thu, 15 May 2014 16:32:30 +0000 (16:32 +0000)
Fix indentation and coding style. No code changes!

svn path=/trunk/; revision=63305

reactos/base/setup/usetup/interface/consup.c
reactos/base/setup/usetup/native/console.c
reactos/base/setup/usetup/native/fslist.c
reactos/base/setup/usetup/native/utils/console.c
reactos/base/setup/usetup/native/utils/console.h

index 88fd4b9..fd9ff28 100644 (file)
@@ -43,230 +43,230 @@ SHORT yScreen = 0;
 
 BOOLEAN
 CONSOLE_Init(
-       VOID)
+    VOID)
 {
-       CONSOLE_SCREEN_BUFFER_INFO csbi;
-       if (!HOST_InitConsole())
-               return FALSE;
-
-       StdInput = GetStdHandle(STD_INPUT_HANDLE);
-       StdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
-       if (!GetConsoleScreenBufferInfo(StdOutput, &csbi))
-               return FALSE;
-       xScreen = csbi.dwSize.X;
-       yScreen = 50;//csbi.dwSize.Y;
-       return TRUE;
+    CONSOLE_SCREEN_BUFFER_INFO csbi;
+    if (!HOST_InitConsole())
+        return FALSE;
+
+    StdInput = GetStdHandle(STD_INPUT_HANDLE);
+    StdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
+    if (!GetConsoleScreenBufferInfo(StdOutput, &csbi))
+        return FALSE;
+    xScreen = csbi.dwSize.X;
+    yScreen = 50;//csbi.dwSize.Y;
+    return TRUE;
 }
 
 VOID
 CONSOLE_ConInKey(
-       OUT PINPUT_RECORD Buffer)
+    OUT PINPUT_RECORD Buffer)
 {
-       DWORD Read;
+    DWORD Read;
 
-       while (TRUE)
-       {
-               ReadConsoleInput(StdInput, Buffer, 1, &Read);
+    while (TRUE)
+    {
+        ReadConsoleInput(StdInput, Buffer, 1, &Read);
 
-               if ((Buffer->EventType == KEY_EVENT)
-                && (Buffer->Event.KeyEvent.bKeyDown == TRUE))
-                       break;
-       }
+        if ((Buffer->EventType == KEY_EVENT)
+         && (Buffer->Event.KeyEvent.bKeyDown == TRUE))
+            break;
+    }
 }
 
 VOID
 CONSOLE_ConOutChar(
-       IN CHAR c)
+    IN CHAR c)
 {
-       DWORD Written;
-
-       WriteConsole(
-               StdOutput,
-               &c,
-               1,
-               &Written,
-               NULL);
+    DWORD Written;
+
+    WriteConsole(
+        StdOutput,
+        &c,
+        1,
+        &Written,
+        NULL);
 }
 
 VOID
 CONSOLE_ConOutPuts(
-       IN LPCSTR szText)
+    IN LPCSTR szText)
 {
-       DWORD Written;
-
-       WriteConsole(
-               StdOutput,
-               szText,
-               (ULONG)strlen(szText),
-               &Written,
-               NULL);
-       WriteConsole(
-               StdOutput,
-               "\n",
-               1,
-               &Written,
-               NULL);
+    DWORD Written;
+
+    WriteConsole(
+        StdOutput,
+        szText,
+        (ULONG)strlen(szText),
+        &Written,
+        NULL);
+    WriteConsole(
+        StdOutput,
+        "\n",
+        1,
+        &Written,
+        NULL);
 }
 
 VOID
 CONSOLE_ConOutPrintf(
-       IN LPCSTR szFormat, ...)
+    IN LPCSTR szFormat, ...)
 {
-       CHAR szOut[256];
-       DWORD dwWritten;
-       va_list arg_ptr;
-
-       va_start(arg_ptr, szFormat);
-       vsprintf(szOut, szFormat, arg_ptr);
-       va_end(arg_ptr);
-
-       WriteConsole(
-               StdOutput,
-               szOut,
-               (ULONG)strlen(szOut),
-               &dwWritten,
-               NULL);
+    CHAR szOut[256];
+    DWORD dwWritten;
+    va_list arg_ptr;
+
+    va_start(arg_ptr, szFormat);
+    vsprintf(szOut, szFormat, arg_ptr);
+    va_end(arg_ptr);
+
+    WriteConsole(
+        StdOutput,
+        szOut,
+        (ULONG)strlen(szOut),
+        &dwWritten,
+        NULL);
 }
 
 BOOL
 CONSOLE_Flush(VOID)
 {
-       return FlushConsoleInputBuffer(StdInput);
+    return FlushConsoleInputBuffer(StdInput);
 }
 
 SHORT
 CONSOLE_GetCursorX(VOID)
 {
-       CONSOLE_SCREEN_BUFFER_INFO csbi;
+    CONSOLE_SCREEN_BUFFER_INFO csbi;
 
-       GetConsoleScreenBufferInfo(StdOutput, &csbi);
+    GetConsoleScreenBufferInfo(StdOutput, &csbi);
 
-       return csbi.dwCursorPosition.X;
+    return csbi.dwCursorPosition.X;
 }
 
 SHORT
 CONSOLE_GetCursorY(VOID)
 {
-       CONSOLE_SCREEN_BUFFER_INFO csbi;
+    CONSOLE_SCREEN_BUFFER_INFO csbi;
 
-       GetConsoleScreenBufferInfo(StdOutput, &csbi);
+    GetConsoleScreenBufferInfo(StdOutput, &csbi);
 
-       return csbi.dwCursorPosition.Y;
+    return csbi.dwCursorPosition.Y;
 }
 
 VOID
 CONSOLE_SetCursorType(
-       IN BOOL bInsert,
-       IN BOOL bVisible)
+    IN BOOL bInsert,
+    IN BOOL bVisible)
 {
-       CONSOLE_CURSOR_INFO cci;
+    CONSOLE_CURSOR_INFO cci;
 
-       cci.dwSize = bInsert ? 10 : 99;
-       cci.bVisible = bVisible;
+    cci.dwSize = bInsert ? 10 : 99;
+    cci.bVisible = bVisible;
 
-       SetConsoleCursorInfo(StdOutput, &cci);
+    SetConsoleCursorInfo(StdOutput, &cci);
 }
 
 VOID
 CONSOLE_SetCursorXY(
-       IN SHORT x,
-       IN SHORT y)
+    IN SHORT x,
+    IN SHORT y)
 {
-       COORD coPos;
+    COORD coPos;
 
-       coPos.X = x;
-       coPos.Y = y;
-       SetConsoleCursorPosition(StdOutput, coPos);
+    coPos.X = x;
+    coPos.Y = y;
+    SetConsoleCursorPosition(StdOutput, coPos);
 }
 
 VOID
 CONSOLE_ClearScreen(VOID)
 {
-       COORD coPos;
-       DWORD Written;
-
-       coPos.X = 0;
-       coPos.Y = 0;
-
-       FillConsoleOutputAttribute(
-               StdOutput,
-               FOREGROUND_WHITE | BACKGROUND_BLUE,
-               xScreen * yScreen,
-               coPos,
-               &Written);
-
-       FillConsoleOutputCharacterA(
-               StdOutput,
-               ' ',
-               xScreen * yScreen,
-               coPos,
-               &Written);
+    COORD coPos;
+    DWORD Written;
+
+    coPos.X = 0;
+    coPos.Y = 0;
+
+    FillConsoleOutputAttribute(
+        StdOutput,
+        FOREGROUND_WHITE | BACKGROUND_BLUE,
+        xScreen * yScreen,
+        coPos,
+        &Written);
+
+    FillConsoleOutputCharacterA(
+        StdOutput,
+        ' ',
+        xScreen * yScreen,
+        coPos,
+        &Written);
 }
 
 VOID
 CONSOLE_InvertTextXY(
-       IN SHORT x,
-       IN SHORT y,
-       IN SHORT col,
-       IN SHORT row)
+    IN SHORT x,
+    IN SHORT y,
+    IN SHORT col,
+    IN SHORT row)
 {
-       COORD coPos;
-       DWORD Written;
-
-       for (coPos.Y = y; coPos.Y < y + row; coPos.Y++)
-       {
-               coPos.X = x;
-
-               FillConsoleOutputAttribute(
-                       StdOutput,
-                       FOREGROUND_BLUE | BACKGROUND_WHITE,
-                       col,
-                       coPos,
-                       &Written);
-       }
+    COORD coPos;
+    DWORD Written;
+
+    for (coPos.Y = y; coPos.Y < y + row; coPos.Y++)
+    {
+        coPos.X = x;
+
+        FillConsoleOutputAttribute(
+            StdOutput,
+            FOREGROUND_BLUE | BACKGROUND_WHITE,
+            col,
+            coPos,
+            &Written);
+    }
 }
 
 VOID
 CONSOLE_NormalTextXY(
-       IN SHORT x,
-       IN SHORT y,
-       IN SHORT col,
-       IN SHORT row)
+    IN SHORT x,
+    IN SHORT y,
+    IN SHORT col,
+    IN SHORT row)
 {
-       COORD coPos;
-       DWORD Written;
-
-       for (coPos.Y = y; coPos.Y < y + row; coPos.Y++)
-       {
-               coPos.X = x;
-
-               FillConsoleOutputAttribute(
-                       StdOutput,
-                       FOREGROUND_WHITE | BACKGROUND_BLUE,
-                       col,
-                       coPos,
-                       &Written);
-       }
+    COORD coPos;
+    DWORD Written;
+
+    for (coPos.Y = y; coPos.Y < y + row; coPos.Y++)
+    {
+        coPos.X = x;
+
+        FillConsoleOutputAttribute(
+            StdOutput,
+            FOREGROUND_WHITE | BACKGROUND_BLUE,
+            col,
+            coPos,
+            &Written);
+    }
 }
 
 VOID
 CONSOLE_SetTextXY(
-       IN SHORT x,
-       IN SHORT y,
-       IN LPCSTR Text)
+    IN SHORT x,
+    IN SHORT y,
+    IN LPCSTR Text)
 {
-       COORD coPos;
-       DWORD Written;
-
-       coPos.X = x;
-       coPos.Y = y;
-
-       WriteConsoleOutputCharacterA(
-               StdOutput,
-               Text,
-               (ULONG)strlen(Text),
-               coPos,
-               &Written);
+    COORD coPos;
+    DWORD Written;
+
+    coPos.X = x;
+    coPos.Y = y;
+
+    WriteConsoleOutputCharacterA(
+        StdOutput,
+        Text,
+        (ULONG)strlen(Text),
+        coPos,
+        &Written);
 }
 
 static
@@ -290,164 +290,164 @@ CONSOLE_ClearTextXY(IN SHORT x,
 
 VOID
 CONSOLE_SetInputTextXY(
-       IN SHORT x,
-       IN SHORT y,
-       IN SHORT len,
-       IN LPCWSTR Text)
+    IN SHORT x,
+    IN SHORT y,
+    IN SHORT len,
+    IN LPCWSTR Text)
 {
-       COORD coPos;
-       SHORT Length;
-       DWORD Written;
-
-       coPos.X = x;
-       coPos.Y = y;
-
-       Length = (SHORT)wcslen(Text);
-       if (Length > len - 1)
-               Length = len - 1;
-
-       FillConsoleOutputAttribute(
-               StdOutput,
-               BACKGROUND_WHITE,
-               len,
-               coPos,
-               &Written);
-
-       WriteConsoleOutputCharacterW(
-               StdOutput,
-               Text,
-               (ULONG)Length,
-               coPos,
-               &Written);
-
-       coPos.X += Length;
-       FillConsoleOutputCharacterA(
-               StdOutput,
-               '_',
-               1,
-               coPos,
-               &Written);
-
-       if (len > Length + 1)
-       {
-               coPos.X++;
-               FillConsoleOutputCharacterA(
-                       StdOutput,
-                       ' ',
-                       len - Length - 1,
-                       coPos,
-                       &Written);
-       }
+    COORD coPos;
+    SHORT Length;
+    DWORD Written;
+
+    coPos.X = x;
+    coPos.Y = y;
+
+    Length = (SHORT)wcslen(Text);
+    if (Length > len - 1)
+        Length = len - 1;
+
+    FillConsoleOutputAttribute(
+        StdOutput,
+        BACKGROUND_WHITE,
+        len,
+        coPos,
+        &Written);
+
+    WriteConsoleOutputCharacterW(
+        StdOutput,
+        Text,
+        (ULONG)Length,
+        coPos,
+        &Written);
+
+    coPos.X += Length;
+    FillConsoleOutputCharacterA(
+        StdOutput,
+        '_',
+        1,
+        coPos,
+        &Written);
+
+    if (len > Length + 1)
+    {
+        coPos.X++;
+        FillConsoleOutputCharacterA(
+            StdOutput,
+            ' ',
+            len - Length - 1,
+            coPos,
+            &Written);
+    }
 }
 
 VOID
 CONSOLE_SetUnderlinedTextXY(
-       IN SHORT x,
-       IN SHORT y,
-       IN LPCSTR Text)
+    IN SHORT x,
+    IN SHORT y,
+    IN LPCSTR Text)
 {
-       COORD coPos;
-       DWORD Length;
-       DWORD Written;
-
-       coPos.X = x;
-       coPos.Y = y;
-
-       Length = (ULONG)strlen(Text);
-
-       WriteConsoleOutputCharacterA(
-               StdOutput,
-               Text,
-               Length,
-               coPos,
-               &Written);
-
-       coPos.Y++;
-       FillConsoleOutputCharacterA(
-               StdOutput,
-               0xCD,
-               Length,
-               coPos,
-               &Written);
+    COORD coPos;
+    DWORD Length;
+    DWORD Written;
+
+    coPos.X = x;
+    coPos.Y = y;
+
+    Length = (ULONG)strlen(Text);
+
+    WriteConsoleOutputCharacterA(
+        StdOutput,
+        Text,
+        Length,
+        coPos,
+        &Written);
+
+    coPos.Y++;
+    FillConsoleOutputCharacterA(
+        StdOutput,
+        0xCD,
+        Length,
+        coPos,
+        &Written);
 }
 
 VOID
 CONSOLE_SetStatusText(
-       IN LPCSTR fmt, ...)
+    IN LPCSTR fmt, ...)
 {
-       CHAR Buffer[128];
-       va_list ap;
-       COORD coPos;
-       DWORD Written;
-
-       va_start(ap, fmt);
-       vsprintf(Buffer, fmt, ap);
-       va_end(ap);
-
-       coPos.X = 0;
-       coPos.Y = yScreen - 1;
-
-       FillConsoleOutputAttribute(
-               StdOutput,
-               BACKGROUND_WHITE,
-               xScreen,
-               coPos,
-               &Written);
-
-       FillConsoleOutputCharacterA(
-               StdOutput,
-               ' ',
-               xScreen,
-               coPos,
-               &Written);
-
-       WriteConsoleOutputCharacterA(
-               StdOutput,
-               Buffer,
-               (ULONG)strlen(Buffer),
-               coPos,
-               &Written);
+    CHAR Buffer[128];
+    va_list ap;
+    COORD coPos;
+    DWORD Written;
+
+    va_start(ap, fmt);
+    vsprintf(Buffer, fmt, ap);
+    va_end(ap);
+
+    coPos.X = 0;
+    coPos.Y = yScreen - 1;
+
+    FillConsoleOutputAttribute(
+        StdOutput,
+        BACKGROUND_WHITE,
+        xScreen,
+        coPos,
+        &Written);
+
+    FillConsoleOutputCharacterA(
+        StdOutput,
+        ' ',
+        xScreen,
+        coPos,
+        &Written);
+
+    WriteConsoleOutputCharacterA(
+        StdOutput,
+        Buffer,
+        (ULONG)strlen(Buffer),
+        coPos,
+        &Written);
 }
 
 VOID
 CONSOLE_SetStatusTextX(
     IN SHORT x,
-       IN LPCSTR fmt, ...)
+    IN LPCSTR fmt, ...)
 {
-       CHAR Buffer[128];
-       va_list ap;
-       COORD coPos;
-       DWORD Written;
-
-       va_start(ap, fmt);
-       vsprintf(Buffer, fmt, ap);
-       va_end(ap);
-
-       coPos.X = 0;
-       coPos.Y = yScreen - 1;
-
-       FillConsoleOutputAttribute(
-               StdOutput,
-               BACKGROUND_WHITE,
-               xScreen,
-               coPos,
-               &Written);
-
-       FillConsoleOutputCharacterA(
-               StdOutput,
-               ' ',
-               xScreen,
-               coPos,
-               &Written);
+    CHAR Buffer[128];
+    va_list ap;
+    COORD coPos;
+    DWORD Written;
+
+    va_start(ap, fmt);
+    vsprintf(Buffer, fmt, ap);
+    va_end(ap);
+
+    coPos.X = 0;
+    coPos.Y = yScreen - 1;
+
+    FillConsoleOutputAttribute(
+        StdOutput,
+        BACKGROUND_WHITE,
+        xScreen,
+        coPos,
+        &Written);
+
+    FillConsoleOutputCharacterA(
+        StdOutput,
+        ' ',
+        xScreen,
+        coPos,
+        &Written);
 
     coPos.X = x;
 
-       WriteConsoleOutputCharacterA(
-               StdOutput,
-               Buffer,
-               (ULONG)strlen(Buffer),
-               coPos,
-               &Written);
+    WriteConsoleOutputCharacterA(
+        StdOutput,
+        Buffer,
+        (ULONG)strlen(Buffer),
+        coPos,
+        &Written);
 }
 
 static
@@ -472,15 +472,15 @@ CONSOLE_ClearStatusTextX(IN SHORT x,
 VOID
 CONSOLE_SetStatusTextAutoFitX(
     IN SHORT x,
-       IN LPCSTR fmt, ...)
+    IN LPCSTR fmt, ...)
 {
-       CHAR Buffer[128];
+    CHAR Buffer[128];
     DWORD Length;
-       va_list ap;
+    va_list ap;
 
-       va_start(ap, fmt);
-       vsprintf(Buffer, fmt, ap);
-       va_end(ap);
+    va_start(ap, fmt);
+    vsprintf(Buffer, fmt, ap);
+    va_end(ap);
 
     Length = (ULONG)strlen(Buffer);
 
@@ -496,211 +496,211 @@ CONSOLE_SetStatusTextAutoFitX(
 
 VOID
 CONSOLE_SetInvertedTextXY(
-       IN SHORT x,
-       IN SHORT y,
-       IN LPCSTR Text)
+    IN SHORT x,
+    IN SHORT y,
+    IN LPCSTR Text)
 {
-       COORD coPos;
-       DWORD Length;
-       DWORD Written;
-
-       coPos.X = x;
-       coPos.Y = y;
-
-       Length = (ULONG)strlen(Text);
-
-       FillConsoleOutputAttribute(
-               StdOutput,
-               FOREGROUND_BLUE | BACKGROUND_WHITE,
-               Length,
-               coPos,
-               &Written);
-
-       WriteConsoleOutputCharacterA(
-               StdOutput,
-               Text,
-               Length,
-               coPos,
-               &Written);
+    COORD coPos;
+    DWORD Length;
+    DWORD Written;
+
+    coPos.X = x;
+    coPos.Y = y;
+
+    Length = (ULONG)strlen(Text);
+
+    FillConsoleOutputAttribute(
+        StdOutput,
+        FOREGROUND_BLUE | BACKGROUND_WHITE,
+        Length,
+        coPos,
+        &Written);
+
+    WriteConsoleOutputCharacterA(
+        StdOutput,
+        Text,
+        Length,
+        coPos,
+        &Written);
 }
 
 VOID
 CONSOLE_SetHighlightedTextXY(
-       IN SHORT x,
-       IN SHORT y,
-       IN LPCSTR Text)
+    IN SHORT x,
+    IN SHORT y,
+    IN LPCSTR Text)
 {
-       COORD coPos;
-       DWORD Length;
-       DWORD Written;
-
-       coPos.X = x;
-       coPos.Y = y;
-
-       Length = (ULONG)strlen(Text);
-
-       FillConsoleOutputAttribute(
-               StdOutput,
-               FOREGROUND_WHITE | FOREGROUND_INTENSITY | BACKGROUND_BLUE,
-               Length,
-               coPos,
-               &Written);
-
-       WriteConsoleOutputCharacterA(
-               StdOutput,
-               Text,
-               Length,
-               coPos,
-               &Written);
+    COORD coPos;
+    DWORD Length;
+    DWORD Written;
+
+    coPos.X = x;
+    coPos.Y = y;
+
+    Length = (ULONG)strlen(Text);
+
+    FillConsoleOutputAttribute(
+        StdOutput,
+        FOREGROUND_WHITE | FOREGROUND_INTENSITY | BACKGROUND_BLUE,
+        Length,
+        coPos,
+        &Written);
+
+    WriteConsoleOutputCharacterA(
+        StdOutput,
+        Text,
+        Length,
+        coPos,
+        &Written);
 }
 
 VOID
 CONSOLE_PrintTextXY(
-       IN SHORT x,
-       IN SHORT y,
-       IN LPCSTR fmt, ...)
+    IN SHORT x,
+    IN SHORT y,
+    IN LPCSTR fmt, ...)
 {
-       CHAR buffer[512];
-       va_list ap;
-       COORD coPos;
-       DWORD Written;
-
-       va_start(ap, fmt);
-       vsprintf(buffer, fmt, ap);
-       va_end(ap);
-
-       coPos.X = x;
-       coPos.Y = y;
-
-       WriteConsoleOutputCharacterA(
-               StdOutput,
-               buffer,
-               (ULONG)strlen(buffer),
-               coPos,
-               &Written);
+    CHAR buffer[512];
+    va_list ap;
+    COORD coPos;
+    DWORD Written;
+
+    va_start(ap, fmt);
+    vsprintf(buffer, fmt, ap);
+    va_end(ap);
+
+    coPos.X = x;
+    coPos.Y = y;
+
+    WriteConsoleOutputCharacterA(
+        StdOutput,
+        buffer,
+        (ULONG)strlen(buffer),
+        coPos,
+        &Written);
 }
 
 VOID
 CONSOLE_PrintTextXYN(
-       IN SHORT x,
-       IN SHORT y,
-       IN SHORT len,
-       IN LPCSTR fmt, ...)
+    IN SHORT x,
+    IN SHORT y,
+    IN SHORT len,
+    IN LPCSTR fmt, ...)
 {
-       CHAR buffer[512];
-       va_list ap;
-       COORD coPos;
-       SHORT Length;
-       DWORD Written;
-
-       va_start(ap, fmt);
-       vsprintf(buffer, fmt, ap);
-       va_end(ap);
-
-       coPos.X = x;
-       coPos.Y = y;
-
-       Length = (SHORT)strlen(buffer);
-       if (Length > len - 1)
-               Length = len - 1;
-
-       WriteConsoleOutputCharacterA(
-               StdOutput,
-               buffer,
-               Length,
-               coPos,
-               &Written);
-
-       coPos.X += Length;
-
-       if (len > Length)
-       {
-               FillConsoleOutputCharacterA(
-                       StdOutput,
-                       ' ',
-                       len - Length,
-                       coPos,
-                       &Written);
-       }
+    CHAR buffer[512];
+    va_list ap;
+    COORD coPos;
+    SHORT Length;
+    DWORD Written;
+
+    va_start(ap, fmt);
+    vsprintf(buffer, fmt, ap);
+    va_end(ap);
+
+    coPos.X = x;
+    coPos.Y = y;
+
+    Length = (SHORT)strlen(buffer);
+    if (Length > len - 1)
+        Length = len - 1;
+
+    WriteConsoleOutputCharacterA(
+        StdOutput,
+        buffer,
+        Length,
+        coPos,
+        &Written);
+
+    coPos.X += Length;
+
+    if (len > Length)
+    {
+        FillConsoleOutputCharacterA(
+            StdOutput,
+            ' ',
+            len - Length,
+            coPos,
+            &Written);
+    }
 }
 
 VOID
 CONSOLE_SetStyledText(
-       IN SHORT x,
-       IN SHORT y,
-       IN INT Flags,
-       IN LPCSTR Text)
+    IN SHORT x,
+    IN SHORT y,
+    IN INT Flags,
+    IN LPCSTR Text)
 {
-       COORD coPos;
-       DWORD Length;
+    COORD coPos;
+    DWORD Length;
 
-       coPos.X = x;
-       coPos.Y = y;
+    coPos.X = x;
+    coPos.Y = y;
 
-       Length = (ULONG)strlen(Text);
+    Length = (ULONG)strlen(Text);
 
     if (Flags & TEXT_TYPE_STATUS)
-       {
-               coPos.X = x;
-               coPos.Y = yScreen - 1;
-       }
+    {
+        coPos.X = x;
+        coPos.Y = yScreen - 1;
+    }
     else /* TEXT_TYPE_REGULAR (Default) */
     {
         coPos.X = x;
-               coPos.Y = y;
+        coPos.Y = y;
     }
 
     if (Flags & TEXT_ALIGN_CENTER)
-       {
-               coPos.X = (xScreen - Length) /2; 
-       }
+    {
+        coPos.X = (xScreen - Length) /2; 
+    }
     else if(Flags & TEXT_ALIGN_RIGHT)
-       {
-               coPos.X = coPos.X - Length; 
-
-               if (Flags & TEXT_PADDING_SMALL)
-               {
-                       coPos.X -= 1;
-               }
-               else if (Flags & TEXT_PADDING_MEDIUM)
-               {
-                       coPos.X -= 2; 
-               }
-               else if (Flags & TEXT_PADDING_BIG)
-               {
-                       coPos.X -= 3;
-               }
-       }
-       else /* TEXT_ALIGN_LEFT (Default) */
-       {
-               if (Flags & TEXT_PADDING_SMALL)
-               {
-                       coPos.X += 1;
-               }
-               else if (Flags & TEXT_PADDING_MEDIUM)
-               {
-                       coPos.X += 2; 
-               }               
-               else if (Flags & TEXT_PADDING_BIG)
-               {
-                       coPos.X += 3;
-               }
-       }
-
-       if (Flags & TEXT_TYPE_STATUS)
-       {
+    {
+        coPos.X = coPos.X - Length; 
+
+        if (Flags & TEXT_PADDING_SMALL)
+        {
+            coPos.X -= 1;
+        }
+        else if (Flags & TEXT_PADDING_MEDIUM)
+        {
+            coPos.X -= 2; 
+        }
+        else if (Flags & TEXT_PADDING_BIG)
+        {
+            coPos.X -= 3;
+        }
+    }
+    else /* TEXT_ALIGN_LEFT (Default) */
+    {
+        if (Flags & TEXT_PADDING_SMALL)
+        {
+            coPos.X += 1;
+        }
+        else if (Flags & TEXT_PADDING_MEDIUM)
+        {
+            coPos.X += 2; 
+        }       
+        else if (Flags & TEXT_PADDING_BIG)
+        {
+            coPos.X += 3;
+        }
+    }
+
+    if (Flags & TEXT_TYPE_STATUS)
+    {
         CONSOLE_SetStatusTextX(coPos.X, Text);
-       }
+    }
     else /* TEXT_TYPE_REGULAR (Default) */
     {
         if (Flags & TEXT_STYLE_HIGHLIGHT)
-           {
+        {
             CONSOLE_SetHighlightedTextXY(coPos.X, coPos.Y, Text);
-           }
+        }
         else if (Flags & TEXT_STYLE_UNDERLINE)
-           {
+        {
             CONSOLE_SetUnderlinedTextXY(coPos.X, coPos.Y, Text);
-           }
+        }
         else /* TEXT_STYLE_NORMAL (Default) */
         {
             CONSOLE_SetTextXY(coPos.X, coPos.Y, Text);
index 6971b98..963caa7 100644 (file)
@@ -1,8 +1,7 @@
 #include <usetup.h>
 
 BOOLEAN
-NATIVE_InitConsole(
-       VOID)
+NATIVE_InitConsole(VOID)
 {
-       return (BOOLEAN)AllocConsole();
+    return (BOOLEAN)AllocConsole();
 }
index c1211c8..d00a7c9 100644 (file)
@@ -2,30 +2,29 @@
 
 BOOLEAN
 NATIVE_CreateFileSystemList(
-       IN PFILE_SYSTEM_LIST List)
+    IN PFILE_SYSTEM_LIST List)
 {
-       FS_AddProvider(List, L"FAT", VfatFormat, VfatChkdsk);
+    FS_AddProvider(List, L"FAT", VfatFormat, VfatChkdsk);
 #if 0
-       FS_AddProvider(List, L"EXT2", Ext2Format, Ext2Chkdsk);
+    FS_AddProvider(List, L"EXT2", Ext2Format, Ext2Chkdsk);
 #endif
-       return TRUE;
+    return TRUE;
 }
 
+
 BOOLEAN
 NATIVE_FormatPartition(
-       IN PFILE_SYSTEM_ITEM FileSystem,
-       IN PCUNICODE_STRING DriveRoot,
-       IN PFMIFSCALLBACK Callback)
+    IN PFILE_SYSTEM_ITEM FileSystem,
+    IN PCUNICODE_STRING DriveRoot,
+    IN PFMIFSCALLBACK Callback)
 {
-       NTSTATUS Status;
-
-       Status = FileSystem->FormatFunc(
-               (PUNICODE_STRING)DriveRoot,
-               FMIFS_HARDDISK,          /* MediaFlag */
-               NULL,                    /* Label */
-               FileSystem->QuickFormat, /* QuickFormat */
-               0,                       /* ClusterSize */
-               Callback);               /* Callback */
+    NTSTATUS Status;
 
-       return NT_SUCCESS(Status);
+    Status = FileSystem->FormatFunc((PUNICODE_STRING)DriveRoot,
+                                    FMIFS_HARDDISK,          /* MediaFlag */
+                                    NULL,                    /* Label */
+                                    FileSystem->QuickFormat, /* QuickFormat */
+                                    0,                       /* ClusterSize */
+                                    Callback);               /* Callback */
+    return NT_SUCCESS(Status);
 }
index 21aff2c..327efe3 100644 (file)
 
 /* FUNCTIONS *****************************************************************/
 
-BOOL WINAPI
+BOOL
+WINAPI
 AllocConsole(VOID)
 {
-       UNICODE_STRING ScreenName = RTL_CONSTANT_STRING(L"\\??\\BlueScreen");
-       UNICODE_STRING KeyboardName = RTL_CONSTANT_STRING(L"\\Device\\KeyboardClass0");
-       OBJECT_ATTRIBUTES ObjectAttributes;
-       IO_STATUS_BLOCK IoStatusBlock;
-       NTSTATUS Status;
-
-       /* Open the screen */
-       InitializeObjectAttributes(
-               &ObjectAttributes,
-               &ScreenName,
-               0,
-               NULL,
-               NULL);
-       Status = NtOpenFile(
-               &StdOutput,
-               FILE_ALL_ACCESS,
-               &ObjectAttributes,
-               &IoStatusBlock,
-               FILE_OPEN,
-               FILE_SYNCHRONOUS_IO_ALERT);
-       if (!NT_SUCCESS(Status))
-               return FALSE;
-
-       /* Open the keyboard */
-       InitializeObjectAttributes(
-               &ObjectAttributes,
-               &KeyboardName,
-               0,
-               NULL,
-               NULL);
-       Status = NtOpenFile(
-               &StdInput,
-               FILE_ALL_ACCESS,
-               &ObjectAttributes,
-               &IoStatusBlock,
-               FILE_OPEN,
-               0);
-       if (!NT_SUCCESS(Status))
-               return FALSE;
-
-       return TRUE;
+    UNICODE_STRING ScreenName = RTL_CONSTANT_STRING(L"\\??\\BlueScreen");
+    UNICODE_STRING KeyboardName = RTL_CONSTANT_STRING(L"\\Device\\KeyboardClass0");
+    OBJECT_ATTRIBUTES ObjectAttributes;
+    IO_STATUS_BLOCK IoStatusBlock;
+    NTSTATUS Status;
+
+    /* Open the screen */
+    InitializeObjectAttributes(&ObjectAttributes,
+                               &ScreenName,
+                               0,
+                               NULL,
+                               NULL);
+    Status = NtOpenFile(&StdOutput,
+                        FILE_ALL_ACCESS,
+                        &ObjectAttributes,
+                        &IoStatusBlock,
+                        FILE_OPEN,
+                        FILE_SYNCHRONOUS_IO_ALERT);
+    if (!NT_SUCCESS(Status))
+        return FALSE;
+
+    /* Open the keyboard */
+    InitializeObjectAttributes(&ObjectAttributes,
+                               &KeyboardName,
+                               0,
+                               NULL,
+                               NULL);
+    Status = NtOpenFile(&StdInput,
+                        FILE_ALL_ACCESS,
+                        &ObjectAttributes,
+                        &IoStatusBlock,
+                        FILE_OPEN,
+                        0);
+    if (!NT_SUCCESS(Status))
+        return FALSE;
+
+    return TRUE;
 }
 
-BOOL WINAPI
+
+BOOL
+WINAPI
 AttachConsole(
-       IN DWORD dwProcessId)
+    IN DWORD dwProcessId)
 {
-       return FALSE;
+    return FALSE;
 }
 
-BOOL WINAPI
+
+BOOL
+WINAPI
 FreeConsole(VOID)
 {
-       if (StdInput != INVALID_HANDLE_VALUE)
-               NtClose(StdInput);
+    if (StdInput != INVALID_HANDLE_VALUE)
+        NtClose(StdInput);
 
-       if (StdOutput != INVALID_HANDLE_VALUE)
-               NtClose(StdOutput);
+    if (StdOutput != INVALID_HANDLE_VALUE)
+        NtClose(StdOutput);
 
-       return TRUE;
+    return TRUE;
 }
 
-BOOL WINAPI
+
+BOOL
+WINAPI
 WriteConsole(
-       IN HANDLE hConsoleOutput,
-       IN const VOID* lpBuffer,
-       IN DWORD nNumberOfCharsToWrite,
-       OUT LPDWORD lpNumberOfCharsWritten,
-       IN LPVOID lpReserved)
+    IN HANDLE hConsoleOutput,
+    IN const VOID *lpBuffer,
+    IN DWORD nNumberOfCharsToWrite,
+    OUT LPDWORD lpNumberOfCharsWritten,
+    IN LPVOID lpReserved)
 {
-       IO_STATUS_BLOCK IoStatusBlock;
-       NTSTATUS Status;
-
-       Status = NtWriteFile(
-               hConsoleOutput,
-               NULL,
-               NULL,
-               NULL,
-               &IoStatusBlock,
-               (PVOID)lpBuffer,
-               nNumberOfCharsToWrite,
-               NULL,
-               NULL);
-       if (!NT_SUCCESS(Status))
-               return FALSE;
-
-       *lpNumberOfCharsWritten = IoStatusBlock.Information;
-       return TRUE;
+    IO_STATUS_BLOCK IoStatusBlock;
+    NTSTATUS Status;
+
+    Status = NtWriteFile(hConsoleOutput,
+                         NULL,
+                         NULL,
+                         NULL,
+                         &IoStatusBlock,
+                         (PVOID)lpBuffer,
+                         nNumberOfCharsToWrite,
+                         NULL,
+                         NULL);
+    if (!NT_SUCCESS(Status))
+        return FALSE;
+
+    *lpNumberOfCharsWritten = IoStatusBlock.Information;
+    return TRUE;
 }
 
-HANDLE WINAPI
+
+HANDLE
+WINAPI
 GetStdHandle(
-       IN DWORD nStdHandle)
+    IN DWORD nStdHandle)
 {
-       switch (nStdHandle)
-       {
-               case STD_INPUT_HANDLE:
-                       return StdInput;
-               case STD_OUTPUT_HANDLE:
-                       return StdOutput;
-               default:
-                       return INVALID_HANDLE_VALUE;
-       }
+    switch (nStdHandle)
+    {
+        case STD_INPUT_HANDLE:
+            return StdInput;
+        case STD_OUTPUT_HANDLE:
+            return StdOutput;
+        default:
+            return INVALID_HANDLE_VALUE;
+    }
 }
 
-BOOL WINAPI
+
+BOOL
+WINAPI
 FlushConsoleInputBuffer(
-       IN HANDLE hConsoleInput)
+    IN HANDLE hConsoleInput)
 {
-       LARGE_INTEGER Offset, Timeout;
-       IO_STATUS_BLOCK IoStatusBlock;
-       KEYBOARD_INPUT_DATA InputData;
-       NTSTATUS Status;
-
-       do
-       {
-               Offset.QuadPart = 0;
-               Status = NtReadFile(
-                       hConsoleInput,
-                       NULL,
-                       NULL,
-                       NULL,
-                       &IoStatusBlock,
-                       &InputData,
-                       sizeof(KEYBOARD_INPUT_DATA),
-                       &Offset,
-                       0);
-               if (Status == STATUS_PENDING)
-               {
-                       Timeout.QuadPart = -100;
-                       Status = NtWaitForSingleObject(hConsoleInput, FALSE, &Timeout);
-                       if (Status == STATUS_TIMEOUT)
-                       {
-                               NtCancelIoFile(hConsoleInput, &IoStatusBlock);
-                               return TRUE;
-                       }
-               }
-       } while (NT_SUCCESS(Status));
-       return FALSE;
+    LARGE_INTEGER Offset, Timeout;
+    IO_STATUS_BLOCK IoStatusBlock;
+    KEYBOARD_INPUT_DATA InputData;
+    NTSTATUS Status;
+
+    do
+    {
+        Offset.QuadPart = 0;
+        Status = NtReadFile(hConsoleInput,
+                            NULL,
+                            NULL,
+                            NULL,
+                            &IoStatusBlock,
+                            &InputData,
+                            sizeof(KEYBOARD_INPUT_DATA),
+                            &Offset,
+                            0);
+        if (Status == STATUS_PENDING)
+        {
+            Timeout.QuadPart = -100;
+            Status = NtWaitForSingleObject(hConsoleInput, FALSE, &Timeout);
+            if (Status == STATUS_TIMEOUT)
+            {
+                NtCancelIoFile(hConsoleInput, &IoStatusBlock);
+                return TRUE;
+            }
+        }
+    } while (NT_SUCCESS(Status));
+    return FALSE;
 }
 
-BOOL WINAPI
+
+BOOL
+WINAPI
 ReadConsoleInput(
-       IN HANDLE hConsoleInput,
-       OUT PINPUT_RECORD lpBuffer,
-       IN DWORD nLength,
-       OUT LPDWORD lpNumberOfEventsRead)
+    IN HANDLE hConsoleInput,
+    OUT PINPUT_RECORD lpBuffer,
+    IN DWORD nLength,
+    OUT LPDWORD lpNumberOfEventsRead)
 {
-       LARGE_INTEGER Offset;
-       IO_STATUS_BLOCK IoStatusBlock;
-       KEYBOARD_INPUT_DATA InputData;
-       NTSTATUS Status;
-
-       Offset.QuadPart = 0;
-       Status = NtReadFile(
-               hConsoleInput,
-               NULL,
-               NULL,
-               NULL,
-               &IoStatusBlock,
-               &InputData,
-               sizeof(KEYBOARD_INPUT_DATA),
-               &Offset,
-               0);
-       if (Status == STATUS_PENDING)
-       {
-               Status = NtWaitForSingleObject(hConsoleInput, FALSE, NULL);
-               Status = IoStatusBlock.Status;
-       }
-       if (!NT_SUCCESS(Status))
-               return FALSE;
-
-       lpBuffer->EventType = KEY_EVENT;
-       Status = IntTranslateKey(&InputData, &lpBuffer->Event.KeyEvent);
-       if (!NT_SUCCESS(Status))
-               return FALSE;
-
-       *lpNumberOfEventsRead = 1;
-       return TRUE;
+    LARGE_INTEGER Offset;
+    IO_STATUS_BLOCK IoStatusBlock;
+    KEYBOARD_INPUT_DATA InputData;
+    NTSTATUS Status;
+
+    Offset.QuadPart = 0;
+    Status = NtReadFile(hConsoleInput,
+                        NULL,
+                        NULL,
+                        NULL,
+                        &IoStatusBlock,
+                        &InputData,
+                        sizeof(KEYBOARD_INPUT_DATA),
+                        &Offset,
+                        0);
+    if (Status == STATUS_PENDING)
+    {
+        Status = NtWaitForSingleObject(hConsoleInput, FALSE, NULL);
+        Status = IoStatusBlock.Status;
+    }
+    if (!NT_SUCCESS(Status))
+        return FALSE;
+
+    lpBuffer->EventType = KEY_EVENT;
+    Status = IntTranslateKey(&InputData, &lpBuffer->Event.KeyEvent);
+    if (!NT_SUCCESS(Status))
+        return FALSE;
+
+    *lpNumberOfEventsRead = 1;
+    return TRUE;
 }
 
-BOOL WINAPI
+
+BOOL
+WINAPI
 WriteConsoleOutputCharacterA(
-       HANDLE hConsoleOutput,
-       IN LPCSTR lpCharacter,
-       IN DWORD nLength,
-       IN COORD dwWriteCoord,
-       OUT LPDWORD lpNumberOfCharsWritten)
+    HANDLE hConsoleOutput,
+    IN LPCSTR lpCharacter,
+    IN DWORD nLength,
+    IN COORD dwWriteCoord,
+    OUT LPDWORD lpNumberOfCharsWritten)
 {
-       IO_STATUS_BLOCK IoStatusBlock;
-       PCHAR Buffer;
-       COORD *pCoord;
-       PCHAR pText;
-       NTSTATUS Status;
-
-       Buffer = (CHAR*) RtlAllocateHeap(
-               ProcessHeap,
-               0,
-               nLength + sizeof(COORD));
-       pCoord = (COORD *)Buffer;
-       pText = (PCHAR)(pCoord + 1);
-
-       *pCoord = dwWriteCoord;
-       memcpy(pText, lpCharacter, nLength);
-
-       Status = NtDeviceIoControlFile(
-               hConsoleOutput,
-               NULL,
-               NULL,
-               NULL,
-               &IoStatusBlock,
-               IOCTL_CONSOLE_WRITE_OUTPUT_CHARACTER,
-               NULL,
-               0,
-               Buffer,
-               nLength + sizeof(COORD));
-
-       RtlFreeHeap(
-               ProcessHeap,
-               0,
-               Buffer);
-       if (!NT_SUCCESS(Status))
-               return FALSE;
-
-       *lpNumberOfCharsWritten = IoStatusBlock.Information;
-       return TRUE;
+    IO_STATUS_BLOCK IoStatusBlock;
+    PCHAR Buffer;
+    COORD *pCoord;
+    PCHAR pText;
+    NTSTATUS Status;
+
+    Buffer = (CHAR*)RtlAllocateHeap(ProcessHeap,
+                                    0,
+                                    nLength + sizeof(COORD));
+    pCoord = (COORD *)Buffer;
+    pText = (PCHAR)(pCoord + 1);
+
+    *pCoord = dwWriteCoord;
+    memcpy(pText, lpCharacter, nLength);
+
+    Status = NtDeviceIoControlFile(hConsoleOutput,
+                                   NULL,
+                                   NULL,
+                                   NULL,
+                                   &IoStatusBlock,
+                                   IOCTL_CONSOLE_WRITE_OUTPUT_CHARACTER,
+                                   NULL,
+                                   0,
+                                   Buffer,
+                                   nLength + sizeof(COORD));
+
+    RtlFreeHeap(ProcessHeap, 0, Buffer);
+    if (!NT_SUCCESS(Status))
+        return FALSE;
+
+    *lpNumberOfCharsWritten = IoStatusBlock.Information;
+    return TRUE;
 }
 
-BOOL WINAPI
+
+BOOL
+WINAPI
 WriteConsoleOutputCharacterW(
-       HANDLE hConsoleOutput,
-       IN LPCWSTR lpCharacter,
-       IN DWORD nLength,
-       IN COORD dwWriteCoord,
-       OUT LPDWORD lpNumberOfCharsWritten)
+    HANDLE hConsoleOutput,
+    IN LPCWSTR lpCharacter,
+    IN DWORD nLength,
+    IN COORD dwWriteCoord,
+    OUT LPDWORD lpNumberOfCharsWritten)
 {
-       IO_STATUS_BLOCK IoStatusBlock;
-       PCHAR Buffer;
-       COORD *pCoord;
-       PCHAR pText;
-       NTSTATUS Status;
-       ULONG i;
-
-       Buffer = (CHAR*) RtlAllocateHeap(
-               ProcessHeap,
-               0,
-               nLength + sizeof(COORD));
-       pCoord = (COORD *)Buffer;
-       pText = (PCHAR)(pCoord + 1);
-
-       *pCoord = dwWriteCoord;
-
-       /* FIXME: use real unicode->oem conversion */
-       for (i = 0; i < nLength; i++)
-               pText[i] = (CHAR)lpCharacter[i];
-
-       Status = NtDeviceIoControlFile(
-               hConsoleOutput,
-               NULL,
-               NULL,
-               NULL,
-               &IoStatusBlock,
-               IOCTL_CONSOLE_WRITE_OUTPUT_CHARACTER,
-               NULL,
-               0,
-               Buffer,
-               nLength + sizeof(COORD));
-
-       RtlFreeHeap(
-               ProcessHeap,
-               0,
-               Buffer);
-       if (!NT_SUCCESS(Status))
-               return FALSE;
-
-       *lpNumberOfCharsWritten = IoStatusBlock.Information;
-       return TRUE;
+    IO_STATUS_BLOCK IoStatusBlock;
+    PCHAR Buffer;
+    COORD *pCoord;
+    PCHAR pText;
+    NTSTATUS Status;
+    ULONG i;
+
+    Buffer = (CHAR*)RtlAllocateHeap(ProcessHeap,
+                                    0,
+                                    nLength + sizeof(COORD));
+    pCoord = (COORD *)Buffer;
+    pText = (PCHAR)(pCoord + 1);
+
+    *pCoord = dwWriteCoord;
+
+    /* FIXME: use real unicode->oem conversion */
+    for (i = 0; i < nLength; i++)
+        pText[i] = (CHAR)lpCharacter[i];
+
+    Status = NtDeviceIoControlFile(hConsoleOutput,
+                                   NULL,
+                                   NULL,
+                                   NULL,
+                                   &IoStatusBlock,
+                                   IOCTL_CONSOLE_WRITE_OUTPUT_CHARACTER,
+                                   NULL,
+                                   0,
+                                   Buffer,
+                                   nLength + sizeof(COORD));
+
+    RtlFreeHeap(ProcessHeap, 0, Buffer);
+    if (!NT_SUCCESS(Status))
+        return FALSE;
+
+    *lpNumberOfCharsWritten = IoStatusBlock.Information;
+    return TRUE;
 }
 
-BOOL WINAPI
+
+BOOL
+WINAPI
 FillConsoleOutputAttribute(
-       IN HANDLE hConsoleOutput,
-       IN WORD wAttribute,
-       IN DWORD nLength,
-       IN COORD dwWriteCoord,
-       OUT LPDWORD lpNumberOfAttrsWritten)
+    IN HANDLE hConsoleOutput,
+    IN WORD wAttribute,
+    IN DWORD nLength,
+    IN COORD dwWriteCoord,
+    OUT LPDWORD lpNumberOfAttrsWritten)
 {
-       IO_STATUS_BLOCK IoStatusBlock;
-       OUTPUT_ATTRIBUTE Buffer;
-       NTSTATUS Status;
-
-       Buffer.wAttribute = wAttribute;
-       Buffer.nLength    = nLength;
-       Buffer.dwCoord    = dwWriteCoord;
-
-       Status = NtDeviceIoControlFile(
-               hConsoleOutput,
-               NULL,
-               NULL,
-               NULL,
-               &IoStatusBlock,
-               IOCTL_CONSOLE_FILL_OUTPUT_ATTRIBUTE,
-               &Buffer,
-               sizeof(OUTPUT_ATTRIBUTE),
-               &Buffer,
-               sizeof(OUTPUT_ATTRIBUTE));
-
-       if (!NT_SUCCESS(Status))
-               return FALSE;
-
-       *lpNumberOfAttrsWritten = Buffer.dwTransfered;
-       return TRUE;
+    IO_STATUS_BLOCK IoStatusBlock;
+    OUTPUT_ATTRIBUTE Buffer;
+    NTSTATUS Status;
+
+    Buffer.wAttribute = wAttribute;
+    Buffer.nLength    = nLength;
+    Buffer.dwCoord    = dwWriteCoord;
+
+    Status = NtDeviceIoControlFile(hConsoleOutput,
+                                   NULL,
+                                   NULL,
+                                   NULL,
+                                   &IoStatusBlock,
+                                   IOCTL_CONSOLE_FILL_OUTPUT_ATTRIBUTE,
+                                   &Buffer,
+                                   sizeof(OUTPUT_ATTRIBUTE),
+                                   &Buffer,
+                                   sizeof(OUTPUT_ATTRIBUTE));
+    if (!NT_SUCCESS(Status))
+        return FALSE;
+
+    *lpNumberOfAttrsWritten = Buffer.dwTransfered;
+    return TRUE;
 }
 
-BOOL WINAPI
+
+BOOL
+WINAPI
 FillConsoleOutputCharacterA(
-       IN HANDLE hConsoleOutput,
-       IN CHAR cCharacter,
-       IN DWORD nLength,
-       IN COORD dwWriteCoord,
-       OUT LPDWORD lpNumberOfCharsWritten)
+    IN HANDLE hConsoleOutput,
+    IN CHAR cCharacter,
+    IN DWORD nLength,
+    IN COORD dwWriteCoord,
+    OUT LPDWORD lpNumberOfCharsWritten)
 {
-       IO_STATUS_BLOCK IoStatusBlock;
-       OUTPUT_CHARACTER Buffer;
-       NTSTATUS Status;
-
-       Buffer.cCharacter = cCharacter;
-       Buffer.nLength = nLength;
-       Buffer.dwCoord = dwWriteCoord;
-
-       Status = NtDeviceIoControlFile(
-               hConsoleOutput,
-               NULL,
-               NULL,
-               NULL,
-               &IoStatusBlock,
-               IOCTL_CONSOLE_FILL_OUTPUT_CHARACTER,
-               &Buffer,
-               sizeof(OUTPUT_CHARACTER),
-               &Buffer,
-               sizeof(OUTPUT_CHARACTER));
-       if (!NT_SUCCESS(Status))
-               return FALSE;
-
-       *lpNumberOfCharsWritten = Buffer.dwTransfered;
-       return TRUE;
+    IO_STATUS_BLOCK IoStatusBlock;
+    OUTPUT_CHARACTER Buffer;
+    NTSTATUS Status;
+
+    Buffer.cCharacter = cCharacter;
+    Buffer.nLength = nLength;
+    Buffer.dwCoord = dwWriteCoord;
+
+    Status = NtDeviceIoControlFile(hConsoleOutput,
+                                   NULL,
+                                   NULL,
+                                   NULL,
+                                   &IoStatusBlock,
+                                   IOCTL_CONSOLE_FILL_OUTPUT_CHARACTER,
+                                   &Buffer,
+                                   sizeof(OUTPUT_CHARACTER),
+                                   &Buffer,
+                                   sizeof(OUTPUT_CHARACTER));
+    if (!NT_SUCCESS(Status))
+        return FALSE;
+
+    *lpNumberOfCharsWritten = Buffer.dwTransfered;
+    return TRUE;
 }
 
-BOOL WINAPI
+
+BOOL
+WINAPI
 GetConsoleScreenBufferInfo(
-       IN HANDLE hConsoleOutput,
-       OUT PCONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo)
+    IN HANDLE hConsoleOutput,
+    OUT PCONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo)
 {
-       IO_STATUS_BLOCK IoStatusBlock;
-       NTSTATUS Status;
-
-       Status = NtDeviceIoControlFile(
-               hConsoleOutput,
-               NULL,
-               NULL,
-               NULL,
-               &IoStatusBlock,
-               IOCTL_CONSOLE_GET_SCREEN_BUFFER_INFO,
-               NULL,
-               0,
-               lpConsoleScreenBufferInfo,
-               sizeof(CONSOLE_SCREEN_BUFFER_INFO));
-       return NT_SUCCESS(Status);
+    IO_STATUS_BLOCK IoStatusBlock;
+    NTSTATUS Status;
+
+    Status = NtDeviceIoControlFile(hConsoleOutput,
+                                   NULL,
+                                   NULL,
+                                   NULL,
+                                   &IoStatusBlock,
+                                   IOCTL_CONSOLE_GET_SCREEN_BUFFER_INFO,
+                                   NULL,
+                                   0,
+                                   lpConsoleScreenBufferInfo,
+                                   sizeof(CONSOLE_SCREEN_BUFFER_INFO));
+    return NT_SUCCESS(Status);
 }
 
-BOOL WINAPI
+
+BOOL
+WINAPI
 SetConsoleCursorInfo(
-       IN HANDLE hConsoleOutput,
-       IN const CONSOLE_CURSOR_INFO* lpConsoleCursorInfo)
+    IN HANDLE hConsoleOutput,
+    IN const CONSOLE_CURSOR_INFO *lpConsoleCursorInfo)
 {
-       IO_STATUS_BLOCK IoStatusBlock;
-       NTSTATUS Status;
-
-       Status = NtDeviceIoControlFile(
-               hConsoleOutput,
-               NULL,
-               NULL,
-               NULL,
-               &IoStatusBlock,
-               IOCTL_CONSOLE_SET_CURSOR_INFO,
-               (PCONSOLE_CURSOR_INFO)lpConsoleCursorInfo,
-               sizeof(CONSOLE_CURSOR_INFO),
-               NULL,
-               0);
-       return NT_SUCCESS(Status);
+    IO_STATUS_BLOCK IoStatusBlock;
+    NTSTATUS Status;
+
+    Status = NtDeviceIoControlFile(hConsoleOutput,
+                                   NULL,
+                                   NULL,
+                                   NULL,
+                                   &IoStatusBlock,
+                                   IOCTL_CONSOLE_SET_CURSOR_INFO,
+                                   (PCONSOLE_CURSOR_INFO)lpConsoleCursorInfo,
+                                   sizeof(CONSOLE_CURSOR_INFO),
+                                   NULL,
+                                   0);
+    return NT_SUCCESS(Status);
 }
 
-BOOL WINAPI
+
+BOOL
+WINAPI
 SetConsoleCursorPosition(
-       IN HANDLE hConsoleOutput,
-       IN COORD dwCursorPosition)
+    IN HANDLE hConsoleOutput,
+    IN COORD dwCursorPosition)
 {
-       CONSOLE_SCREEN_BUFFER_INFO ConsoleScreenBufferInfo;
-       IO_STATUS_BLOCK IoStatusBlock;
-       NTSTATUS Status;
-
-       Status = GetConsoleScreenBufferInfo(hConsoleOutput, &ConsoleScreenBufferInfo);
-       if (!NT_SUCCESS(Status))
-               return FALSE;
-
-       ConsoleScreenBufferInfo.dwCursorPosition.X = dwCursorPosition.X;
-       ConsoleScreenBufferInfo.dwCursorPosition.Y = dwCursorPosition.Y;
-
-       Status = NtDeviceIoControlFile(
-               hConsoleOutput,
-               NULL,
-               NULL,
-               NULL,
-               &IoStatusBlock,
-               IOCTL_CONSOLE_SET_SCREEN_BUFFER_INFO,
-               &ConsoleScreenBufferInfo,
-               sizeof(CONSOLE_SCREEN_BUFFER_INFO),
-               NULL,
-               0);
-
-       return NT_SUCCESS(Status);
+    CONSOLE_SCREEN_BUFFER_INFO ConsoleScreenBufferInfo;
+    IO_STATUS_BLOCK IoStatusBlock;
+    NTSTATUS Status;
+
+    Status = GetConsoleScreenBufferInfo(hConsoleOutput, &ConsoleScreenBufferInfo);
+    if (!NT_SUCCESS(Status))
+        return FALSE;
+
+    ConsoleScreenBufferInfo.dwCursorPosition.X = dwCursorPosition.X;
+    ConsoleScreenBufferInfo.dwCursorPosition.Y = dwCursorPosition.Y;
+
+    Status = NtDeviceIoControlFile(hConsoleOutput,
+                                   NULL,
+                                   NULL,
+                                   NULL,
+                                   &IoStatusBlock,
+                                   IOCTL_CONSOLE_SET_SCREEN_BUFFER_INFO,
+                                   &ConsoleScreenBufferInfo,
+                                   sizeof(CONSOLE_SCREEN_BUFFER_INFO),
+                                   NULL,
+                                   0);
+    return NT_SUCCESS(Status);
 }
 
-BOOL WINAPI
+
+BOOL
+WINAPI
 SetConsoleTextAttribute(
-       IN HANDLE hConsoleOutput,
-       IN WORD wAttributes)
+    IN HANDLE hConsoleOutput,
+    IN WORD wAttributes)
 {
-       IO_STATUS_BLOCK IoStatusBlock;
-       NTSTATUS Status;
-
-       Status = NtDeviceIoControlFile(
-               hConsoleOutput,
-               NULL,
-               NULL,
-               NULL,
-               &IoStatusBlock,
-               IOCTL_CONSOLE_SET_TEXT_ATTRIBUTE,
-               &wAttributes,
-               sizeof(USHORT),
-               NULL,
-               0);
-       return NT_SUCCESS(Status);
+    IO_STATUS_BLOCK IoStatusBlock;
+    NTSTATUS Status;
+
+    Status = NtDeviceIoControlFile(hConsoleOutput,
+                                   NULL,
+                                   NULL,
+                                   NULL,
+                                   &IoStatusBlock,
+                                   IOCTL_CONSOLE_SET_TEXT_ATTRIBUTE,
+                                   &wAttributes,
+                                   sizeof(USHORT),
+                                   NULL,
+                                   0);
+    return NT_SUCCESS(Status);
 }
 
-BOOL WINAPI
+
+BOOL
+WINAPI
 SetConsoleOutputCP(
-       IN UINT wCodepage)
+    IN UINT wCodepage)
 {
-       HANDLE hConsoleOutput;
-       IO_STATUS_BLOCK IoStatusBlock;
-       NTSTATUS Status;
-
-       hConsoleOutput = GetStdHandle(STD_OUTPUT_HANDLE);
-
-       Status = NtDeviceIoControlFile(
-               hConsoleOutput,
-               NULL,
-               NULL,
-               NULL,
-               &IoStatusBlock,
-               IOCTL_CONSOLE_LOADFONT,
-               &wCodepage,
-               sizeof(ULONG),
-               NULL,
-               0);
-       return NT_SUCCESS(Status);
+    HANDLE hConsoleOutput;
+    IO_STATUS_BLOCK IoStatusBlock;
+    NTSTATUS Status;
+
+    hConsoleOutput = GetStdHandle(STD_OUTPUT_HANDLE);
+
+    Status = NtDeviceIoControlFile(hConsoleOutput,
+                                   NULL,
+                                   NULL,
+                                   NULL,
+                                   &IoStatusBlock,
+                                   IOCTL_CONSOLE_LOADFONT,
+                                   &wCodepage,
+                                   sizeof(ULONG),
+                                   NULL,
+                                   0);
+    return NT_SUCCESS(Status);
 }
 
 
index feb8982..c202170 100644 (file)
 
 #pragma once
 
-BOOL WINAPI
+BOOL
+WINAPI
 AllocConsole(VOID);
 
-BOOL WINAPI
+BOOL
+WINAPI
 AttachConsole(
-       IN DWORD dwProcessId);
+    IN DWORD dwProcessId);
 
-BOOL WINAPI
+BOOL
+WINAPI
 FillConsoleOutputAttribute(
-       IN HANDLE hConsoleOutput,
-       IN WORD wAttribute,
-       IN DWORD nLength,
-       IN COORD dwWriteCoord,
-       OUT LPDWORD lpNumberOfAttrsWritten);
-
-BOOL WINAPI
+    IN HANDLE hConsoleOutput,
+    IN WORD wAttribute,
+    IN DWORD nLength,
+    IN COORD dwWriteCoord,
+    OUT LPDWORD lpNumberOfAttrsWritten);
+
+BOOL
+WINAPI
 FillConsoleOutputCharacterA(
-       IN HANDLE hConsoleOutput,
-       IN CHAR cCharacter,
-       IN DWORD nLength,
-       IN COORD dwWriteCoord,
-       OUT LPDWORD lpNumberOfCharsWritten);
-
-BOOL WINAPI
+    IN HANDLE hConsoleOutput,
+    IN CHAR cCharacter,
+    IN DWORD nLength,
+    IN COORD dwWriteCoord,
+    OUT LPDWORD lpNumberOfCharsWritten);
+
+BOOL
+WINAPI
 FreeConsole(VOID);
 
-BOOL WINAPI
+BOOL
+WINAPI
 GetConsoleScreenBufferInfo(
-       IN HANDLE hConsoleOutput,
-       OUT PCONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo);
+    IN HANDLE hConsoleOutput,
+    OUT PCONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo);
 
-HANDLE WINAPI
+HANDLE
+WINAPI
 GetStdHandle(
-       IN DWORD nStdHandle);
+    IN DWORD nStdHandle);
 
-BOOL WINAPI
+BOOL
+WINAPI
 ReadConsoleInput(
-       IN HANDLE hConsoleInput,
-       OUT PINPUT_RECORD lpBuffer,
-       IN DWORD nLength,
-       OUT LPDWORD lpNumberOfEventsRead);
+    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);
+    IN HANDLE hConsoleOutput,
+    IN const CONSOLE_CURSOR_INFO *lpConsoleCursorInfo);
 
-BOOL WINAPI
+BOOL
+WINAPI
 SetConsoleCursorPosition(
-       IN HANDLE hConsoleOutput,
-       IN COORD dwCursorPosition);
+    IN HANDLE hConsoleOutput,
+    IN COORD dwCursorPosition);
 
-BOOL WINAPI
+BOOL
+WINAPI
 SetConsoleTextAttribute(
-       IN HANDLE hConsoleOutput,
-       IN WORD wAttributes);
+    IN HANDLE hConsoleOutput,
+    IN WORD wAttributes);
 
-BOOL WINAPI
+BOOL
+WINAPI
 WriteConsole(
-       IN HANDLE hConsoleOutput,
-       IN const VOID* lpBuffer,
-       IN DWORD nNumberOfCharsToWrite,
-       OUT LPDWORD lpNumberOfCharsWritten,
-       IN LPVOID lpReserved);
-
-BOOL WINAPI
+    IN HANDLE hConsoleOutput,
+    IN const VOID *lpBuffer,
+    IN DWORD nNumberOfCharsToWrite,
+    OUT LPDWORD lpNumberOfCharsWritten,
+    IN LPVOID lpReserved);
+
+BOOL
+WINAPI
 WriteConsoleOutputCharacterA(
-       HANDLE hConsoleOutput,
-       IN LPCSTR lpCharacter,
-       IN DWORD nLength,
-       IN COORD dwWriteCoord,
-       OUT LPDWORD lpNumberOfCharsWritten);
-
-BOOL WINAPI
+    HANDLE hConsoleOutput,
+    IN LPCSTR lpCharacter,
+    IN DWORD nLength,
+    IN COORD dwWriteCoord,
+    OUT LPDWORD lpNumberOfCharsWritten);
+
+BOOL
+WINAPI
 WriteConsoleOutputCharacterW(
-       HANDLE hConsoleOutput,
-       IN LPCSTR lpCharacter,
-       IN DWORD nLength,
-       IN COORD dwWriteCoord,
-       OUT LPDWORD lpNumberOfCharsWritten);
-
-BOOL WINAPI
+    HANDLE hConsoleOutput,
+    IN LPCSTR lpCharacter,
+    IN DWORD nLength,
+    IN COORD dwWriteCoord,
+    OUT LPDWORD lpNumberOfCharsWritten);
+
+BOOL
+WINAPI
 SetConsoleOutputCP(
-       IN UINT wCodePageID
+    IN UINT wCodePageID
 );
 
 /* EOF */