Use W32API.

svn path=/trunk/; revision=15957
This commit is contained in:
Filip Navara 2005-06-17 09:46:21 +00:00
parent 204dc0088b
commit a50fde81ae
7 changed files with 146 additions and 135 deletions

View file

@ -48,7 +48,7 @@ static SHORT yScreen = 0;
NTSTATUS
GetConsoleScreenBufferInfo(PCONSOLE_SCREEN_BUFFER_INFO ConsoleScreenBufferInfo);
ConGetConsoleScreenBufferInfo(PCONSOLE_SCREEN_BUFFER_INFO ConsoleScreenBufferInfo);
/* FUNCTIONS *****************************************************************/
@ -56,7 +56,7 @@ GetConsoleScreenBufferInfo(PCONSOLE_SCREEN_BUFFER_INFO ConsoleScreenBufferInfo);
NTSTATUS
AllocConsole(VOID)
ConAllocConsole(VOID)
{
OBJECT_ATTRIBUTES ObjectAttributes;
IO_STATUS_BLOCK IoStatusBlock;
@ -98,7 +98,7 @@ AllocConsole(VOID)
if (!NT_SUCCESS(Status))
return(Status);
GetConsoleScreenBufferInfo(&csbi);
ConGetConsoleScreenBufferInfo(&csbi);
xScreen = csbi.dwSize.X;
yScreen = csbi.dwSize.Y;
@ -108,7 +108,7 @@ AllocConsole(VOID)
VOID
FreeConsole(VOID)
ConFreeConsole(VOID)
{
DPRINT("FreeConsole() called\n");
@ -125,9 +125,9 @@ FreeConsole(VOID)
NTSTATUS
WriteConsole(PCHAR Buffer,
ULONG NumberOfCharsToWrite,
PULONG NumberOfCharsWritten)
ConWriteConsole(PCHAR Buffer,
ULONG NumberOfCharsToWrite,
PULONG NumberOfCharsWritten)
{
IO_STATUS_BLOCK IoStatusBlock;
NTSTATUS Status = STATUS_SUCCESS;
@ -192,7 +192,7 @@ ReadConsoleA(HANDLE hConsoleInput,
NTSTATUS
ReadConsoleInput(PINPUT_RECORD Buffer)
ConReadConsoleInput(PINPUT_RECORD Buffer)
{
IO_STATUS_BLOCK Iosb;
NTSTATUS Status;
@ -220,10 +220,10 @@ ReadConsoleInput(PINPUT_RECORD Buffer)
NTSTATUS
ReadConsoleOutputCharacters(LPSTR lpCharacter,
ULONG nLength,
COORD dwReadCoord,
PULONG lpNumberOfCharsRead)
ConReadConsoleOutputCharacters(LPSTR lpCharacter,
ULONG nLength,
COORD dwReadCoord,
PULONG lpNumberOfCharsRead)
{
IO_STATUS_BLOCK IoStatusBlock;
OUTPUT_CHARACTER Buffer;
@ -252,10 +252,10 @@ ReadConsoleOutputCharacters(LPSTR lpCharacter,
NTSTATUS
ReadConsoleOutputAttributes(PUSHORT lpAttribute,
ULONG nLength,
COORD dwReadCoord,
PULONG lpNumberOfAttrsRead)
ConReadConsoleOutputAttributes(PUSHORT lpAttribute,
ULONG nLength,
COORD dwReadCoord,
PULONG lpNumberOfAttrsRead)
{
IO_STATUS_BLOCK IoStatusBlock;
OUTPUT_ATTRIBUTE Buffer;
@ -284,9 +284,9 @@ ReadConsoleOutputAttributes(PUSHORT lpAttribute,
NTSTATUS
WriteConsoleOutputCharacters(LPCSTR lpCharacter,
ULONG nLength,
COORD dwWriteCoord)
ConWriteConsoleOutputCharacters(LPCSTR lpCharacter,
ULONG nLength,
COORD dwWriteCoord)
{
IO_STATUS_BLOCK IoStatusBlock;
PCHAR Buffer;
@ -323,9 +323,9 @@ WriteConsoleOutputCharacters(LPCSTR lpCharacter,
NTSTATUS
WriteConsoleOutputCharactersW(LPCWSTR lpCharacter,
ULONG nLength,
COORD dwWriteCoord)
ConWriteConsoleOutputCharactersW(LPCWSTR lpCharacter,
ULONG nLength,
COORD dwWriteCoord)
{
IO_STATUS_BLOCK IoStatusBlock;
PCHAR Buffer;
@ -367,10 +367,10 @@ WriteConsoleOutputCharactersW(LPCWSTR lpCharacter,
NTSTATUS
WriteConsoleOutputAttributes(CONST USHORT *lpAttribute,
ULONG nLength,
COORD dwWriteCoord,
PULONG lpNumberOfAttrsWritten)
ConWriteConsoleOutputAttributes(CONST USHORT *lpAttribute,
ULONG nLength,
COORD dwWriteCoord,
PULONG lpNumberOfAttrsWritten)
{
IO_STATUS_BLOCK IoStatusBlock;
PUSHORT Buffer;
@ -407,10 +407,10 @@ WriteConsoleOutputAttributes(CONST USHORT *lpAttribute,
NTSTATUS
FillConsoleOutputAttribute(USHORT wAttribute,
ULONG nLength,
COORD dwWriteCoord,
PULONG lpNumberOfAttrsWritten)
ConFillConsoleOutputAttribute(USHORT wAttribute,
ULONG nLength,
COORD dwWriteCoord,
PULONG lpNumberOfAttrsWritten)
{
IO_STATUS_BLOCK IoStatusBlock;
OUTPUT_ATTRIBUTE Buffer;
@ -441,10 +441,10 @@ FillConsoleOutputAttribute(USHORT wAttribute,
NTSTATUS
FillConsoleOutputCharacter(CHAR Character,
ULONG Length,
COORD WriteCoord,
PULONG NumberOfCharsWritten)
ConFillConsoleOutputCharacter(CHAR Character,
ULONG Length,
COORD WriteCoord,
PULONG NumberOfCharsWritten)
{
IO_STATUS_BLOCK IoStatusBlock;
OUTPUT_CHARACTER Buffer;
@ -562,7 +562,7 @@ SetConsoleMode(HANDLE hConsoleHandle,
NTSTATUS
GetConsoleScreenBufferInfo(PCONSOLE_SCREEN_BUFFER_INFO ConsoleScreenBufferInfo)
ConGetConsoleScreenBufferInfo(PCONSOLE_SCREEN_BUFFER_INFO ConsoleScreenBufferInfo)
{
IO_STATUS_BLOCK IoStatusBlock;
NTSTATUS Status;
@ -583,7 +583,7 @@ GetConsoleScreenBufferInfo(PCONSOLE_SCREEN_BUFFER_INFO ConsoleScreenBufferInfo)
NTSTATUS
SetConsoleCursorInfo(PCONSOLE_CURSOR_INFO lpConsoleCursorInfo)
ConSetConsoleCursorInfo(PCONSOLE_CURSOR_INFO lpConsoleCursorInfo)
{
IO_STATUS_BLOCK IoStatusBlock;
NTSTATUS Status;
@ -604,13 +604,13 @@ SetConsoleCursorInfo(PCONSOLE_CURSOR_INFO lpConsoleCursorInfo)
NTSTATUS
SetConsoleCursorPosition(COORD dwCursorPosition)
ConSetConsoleCursorPosition(COORD dwCursorPosition)
{
CONSOLE_SCREEN_BUFFER_INFO ConsoleScreenBufferInfo;
IO_STATUS_BLOCK IoStatusBlock;
NTSTATUS Status;
Status = GetConsoleScreenBufferInfo(&ConsoleScreenBufferInfo);
Status = ConGetConsoleScreenBufferInfo(&ConsoleScreenBufferInfo);
if (!NT_SUCCESS(Status))
return(Status);
@ -633,7 +633,7 @@ SetConsoleCursorPosition(COORD dwCursorPosition)
NTSTATUS
SetConsoleTextAttribute(USHORT wAttributes)
ConSetConsoleTextAttribute(USHORT wAttributes)
{
IO_STATUS_BLOCK IoStatusBlock;
NTSTATUS Status;
@ -661,7 +661,7 @@ ConInKey(PINPUT_RECORD Buffer)
while (TRUE)
{
ReadConsoleInput(Buffer);
ConReadConsoleInput(Buffer);
if ((Buffer->EventType == KEY_EVENT) &&
(Buffer->Event.KeyEvent.bKeyDown == TRUE))
@ -675,9 +675,9 @@ ConOutChar(CHAR c)
{
ULONG Written;
WriteConsole(&c,
1,
&Written);
ConWriteConsole(&c,
1,
&Written);
}
@ -686,12 +686,12 @@ ConOutPuts(LPSTR szText)
{
ULONG Written;
WriteConsole(szText,
strlen(szText),
&Written);
WriteConsole("\n",
1,
&Written);
ConWriteConsole(szText,
strlen(szText),
&Written);
ConWriteConsole("\n",
1,
&Written);
}
@ -706,9 +706,9 @@ ConOutPrintf(LPSTR szFormat, ...)
vsprintf(szOut, szFormat, arg_ptr);
va_end(arg_ptr);
WriteConsole(szOut,
strlen(szOut),
&dwWritten);
ConWriteConsole(szOut,
strlen(szOut),
&dwWritten);
}
@ -720,7 +720,7 @@ GetCursorX(VOID)
{
CONSOLE_SCREEN_BUFFER_INFO csbi;
GetConsoleScreenBufferInfo(&csbi);
ConGetConsoleScreenBufferInfo(&csbi);
return(csbi.dwCursorPosition.X);
}
@ -731,7 +731,7 @@ GetCursorY(VOID)
{
CONSOLE_SCREEN_BUFFER_INFO csbi;
GetConsoleScreenBufferInfo(&csbi);
ConGetConsoleScreenBufferInfo(&csbi);
return(csbi.dwCursorPosition.Y);
}
@ -743,7 +743,7 @@ GetScreenSize(SHORT *maxx,
{
CONSOLE_SCREEN_BUFFER_INFO csbi;
GetConsoleScreenBufferInfo(&csbi);
ConGetConsoleScreenBufferInfo(&csbi);
if (maxx)
*maxx = csbi.dwSize.X;
@ -762,7 +762,7 @@ SetCursorType(BOOL bInsert,
cci.dwSize = bInsert ? 10 : 99;
cci.bVisible = bVisible;
SetConsoleCursorInfo(&cci);
ConSetConsoleCursorInfo(&cci);
}
@ -774,7 +774,7 @@ SetCursorXY(SHORT x,
coPos.X = x;
coPos.Y = y;
SetConsoleCursorPosition(coPos);
ConSetConsoleCursorPosition(coPos);
}
@ -896,28 +896,28 @@ SetInputTextXY(SHORT x, SHORT y, SHORT len, PWCHAR Text)
Length = len - 1;
}
FillConsoleOutputAttribute(0x70,
len,
coPos,
&Written);
ConFillConsoleOutputAttribute(0x70,
len,
coPos,
&Written);
WriteConsoleOutputCharactersW(Text,
Length,
coPos);
ConWriteConsoleOutputCharactersW(Text,
Length,
coPos);
coPos.X += Length;
FillConsoleOutputCharacter('_',
1,
coPos,
&Written);
ConFillConsoleOutputCharacter('_',
1,
coPos,
&Written);
if (len > Length + 1)
{
coPos.X++;
FillConsoleOutputCharacter(' ',
len - Length - 1,
coPos,
&Written);
ConFillConsoleOutputCharacter(' ',
len - Length - 1,
coPos,
&Written);
}
}
@ -934,15 +934,15 @@ SetUnderlinedTextXY(SHORT x, SHORT y, PCHAR Text)
Length = strlen(Text);
WriteConsoleOutputCharacters(Text,
Length,
coPos);
ConWriteConsoleOutputCharacters(Text,
Length,
coPos);
coPos.Y++;
FillConsoleOutputCharacter(0xCD,
Length,
coPos,
&Written);
ConFillConsoleOutputCharacter(0xCD,
Length,
coPos,
&Written);
}
@ -958,14 +958,14 @@ SetInvertedTextXY(SHORT x, SHORT y, PCHAR Text)
Length = strlen(Text);
FillConsoleOutputAttribute(0x71,
Length,
coPos,
&Written);
ConFillConsoleOutputAttribute(0x71,
Length,
coPos,
&Written);
WriteConsoleOutputCharacters(Text,
Length,
coPos);
ConWriteConsoleOutputCharacters(Text,
Length,
coPos);
}
@ -981,14 +981,14 @@ SetHighlightedTextXY(SHORT x, SHORT y, PCHAR Text)
Length = strlen(Text);
FillConsoleOutputAttribute(0x1F,
Length,
coPos,
&Written);
ConFillConsoleOutputAttribute(0x1F,
Length,
coPos,
&Written);
WriteConsoleOutputCharacters(Text,
Length,
coPos);
ConWriteConsoleOutputCharacters(Text,
Length,
coPos);
}
@ -1006,9 +1006,9 @@ PrintTextXY(SHORT x, SHORT y, char* fmt, ...)
coPos.X = x;
coPos.Y = y;
WriteConsoleOutputCharacters(buffer,
strlen(buffer),
coPos);
ConWriteConsoleOutputCharacters(buffer,
strlen(buffer),
coPos);
}
@ -1034,18 +1034,18 @@ PrintTextXYN(SHORT x, SHORT y, SHORT len, char* fmt, ...)
Length = len - 1;
}
WriteConsoleOutputCharacters(buffer,
Length,
coPos);
ConWriteConsoleOutputCharacters(buffer,
Length,
coPos);
coPos.X += Length;
if (len > Length)
{
FillConsoleOutputCharacter(' ',
len - Length,
coPos,
&Written);
ConFillConsoleOutputCharacter(' ',
len - Length,
coPos,
&Written);
}
}

View file

@ -29,47 +29,56 @@
#include <ntos/keyboard.h>
#define AllocConsole ConAllocConsole
#define FreeConsole ConFreeConsole
#define ReadConsoleOutputCharacters ConReadConsoleOutputCharacters
#define ReadConsoleOutputAttributes ConReadConsoleOutputAttributes
#define WriteConsoleOutputCharacters ConWriteConsoleOutputCharacters
#define WriteConsoleOutputAttributes ConWriteConsoleOutputAttributes
#define FillConsoleOutputAttribute ConFillConsoleOutputAttribute
#undef FillConsoleOutputCharacter
#define FillConsoleOutputCharacter ConFillConsoleOutputCharacter
NTSTATUS
AllocConsole(VOID);
ConAllocConsole(VOID);
VOID
FreeConsole(VOID);
ConFreeConsole(VOID);
NTSTATUS
ReadConsoleOutputCharacters(LPSTR lpCharacter,
ULONG nLength,
COORD dwReadCoord,
PULONG lpNumberOfCharsRead);
ConReadConsoleOutputCharacters(LPSTR lpCharacter,
ULONG nLength,
COORD dwReadCoord,
PULONG lpNumberOfCharsRead);
NTSTATUS
ReadConsoleOutputAttributes(PUSHORT lpAttribute,
ULONG nLength,
COORD dwReadCoord,
PULONG lpNumberOfAttrsRead);
ConReadConsoleOutputAttributes(PUSHORT lpAttribute,
ULONG nLength,
COORD dwReadCoord,
PULONG lpNumberOfAttrsRead);
NTSTATUS
WriteConsoleOutputCharacters(LPCSTR lpCharacter,
ULONG nLength,
COORD dwWriteCoord);
ConWriteConsoleOutputCharacters(LPCSTR lpCharacter,
ULONG nLength,
COORD dwWriteCoord);
NTSTATUS
WriteConsoleOutputAttributes(CONST USHORT *lpAttribute,
ULONG nLength,
COORD dwWriteCoord,
PULONG lpNumberOfAttrsWritten);
ConWriteConsoleOutputAttributes(CONST USHORT *lpAttribute,
ULONG nLength,
COORD dwWriteCoord,
PULONG lpNumberOfAttrsWritten);
NTSTATUS
FillConsoleOutputAttribute(USHORT wAttribute,
ULONG nLength,
COORD dwWriteCoord,
PULONG lpNumberOfAttrsWritten);
ConFillConsoleOutputAttribute(USHORT wAttribute,
ULONG nLength,
COORD dwWriteCoord,
PULONG lpNumberOfAttrsWritten);
NTSTATUS
FillConsoleOutputCharacter(CHAR Character,
ULONG Length,
COORD WriteCoord,
PULONG NumberOfCharsWritten);
ConFillConsoleOutputCharacter(CHAR Character,
ULONG Length,
COORD WriteCoord,
PULONG NumberOfCharsWritten);
#if 0
NTSTATUS

View file

@ -44,7 +44,7 @@ static BOOLEAN HasCurrentCabinet = FALSE;
static WCHAR CurrentCabinetName[MAX_PATH];
NTSTATUS
CreateDirectory(PWCHAR DirectoryName)
SetupCreateDirectory(PWCHAR DirectoryName)
{
OBJECT_ATTRIBUTES ObjectAttributes;
IO_STATUS_BLOCK IoStatusBlock;

View file

@ -28,7 +28,7 @@
#define __FILESUP_H__
NTSTATUS
CreateDirectory(PWCHAR DirectoryName);
SetupCreateDirectory(PWCHAR DirectoryName);
NTSTATUS
SetupCopyFile(PWCHAR SourceFileName,

View file

@ -1 +1 @@
#include <ddk/ntddk.h>
#include <ntos.h>

View file

@ -536,7 +536,7 @@ CheckUnattendedSetup(VOID)
* Number of the next page.
*/
static PAGE_NUMBER
StartPage(PINPUT_RECORD Ir)
SetupStartPage(PINPUT_RECORD Ir)
{
SYSTEM_DEVICE_INFORMATION Sdi;
NTSTATUS Status;
@ -2896,7 +2896,7 @@ PrepareCopyPageInfFile(HINF InfFile,
}
/* Create the install directory */
Status = CreateDirectory(PathBuffer);
Status = SetupCreateDirectory(PathBuffer);
if (!NT_SUCCESS(Status) && Status != STATUS_OBJECT_NAME_COLLISION)
{
DPRINT("Creating directory '%S' failed: Status = 0x%08lx", PathBuffer, Status);
@ -2967,7 +2967,7 @@ PrepareCopyPageInfFile(HINF InfFile,
DPRINT("FullPath: '%S'\n", PathBuffer);
Status = CreateDirectory(PathBuffer);
Status = SetupCreateDirectory(PathBuffer);
if (!NT_SUCCESS(Status) && Status != STATUS_OBJECT_NAME_COLLISION)
{
DPRINT("Creating directory '%S' failed: Status = 0x%08lx", PathBuffer, Status);
@ -3808,7 +3808,7 @@ NtProcessStartup(PPEB Peb)
{
/* Start page */
case START_PAGE:
Page = StartPage(&Ir);
Page = SetupStartPage(&Ir);
break;
/* License page */

View file

@ -2,7 +2,9 @@
<bootstrap base="reactos/system32" nameoncd="smss.exe" />
<include base="usetup">.</include>
<include base="zlib">.</include>
<define name="__USE_W32API" />
<define name="_DISABLE_TIDENTS" />
<define name="_WIN32_WINNT">0x0502</define>
<linkerflag>-lgcc</linkerflag>
<library>zlib</library>
<library>vfatlib</library>