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,7 +125,7 @@ FreeConsole(VOID)
NTSTATUS
WriteConsole(PCHAR Buffer,
ConWriteConsole(PCHAR Buffer,
ULONG NumberOfCharsToWrite,
PULONG NumberOfCharsWritten)
{
@ -192,7 +192,7 @@ ReadConsoleA(HANDLE hConsoleInput,
NTSTATUS
ReadConsoleInput(PINPUT_RECORD Buffer)
ConReadConsoleInput(PINPUT_RECORD Buffer)
{
IO_STATUS_BLOCK Iosb;
NTSTATUS Status;
@ -220,7 +220,7 @@ ReadConsoleInput(PINPUT_RECORD Buffer)
NTSTATUS
ReadConsoleOutputCharacters(LPSTR lpCharacter,
ConReadConsoleOutputCharacters(LPSTR lpCharacter,
ULONG nLength,
COORD dwReadCoord,
PULONG lpNumberOfCharsRead)
@ -252,7 +252,7 @@ ReadConsoleOutputCharacters(LPSTR lpCharacter,
NTSTATUS
ReadConsoleOutputAttributes(PUSHORT lpAttribute,
ConReadConsoleOutputAttributes(PUSHORT lpAttribute,
ULONG nLength,
COORD dwReadCoord,
PULONG lpNumberOfAttrsRead)
@ -284,7 +284,7 @@ ReadConsoleOutputAttributes(PUSHORT lpAttribute,
NTSTATUS
WriteConsoleOutputCharacters(LPCSTR lpCharacter,
ConWriteConsoleOutputCharacters(LPCSTR lpCharacter,
ULONG nLength,
COORD dwWriteCoord)
{
@ -323,7 +323,7 @@ WriteConsoleOutputCharacters(LPCSTR lpCharacter,
NTSTATUS
WriteConsoleOutputCharactersW(LPCWSTR lpCharacter,
ConWriteConsoleOutputCharactersW(LPCWSTR lpCharacter,
ULONG nLength,
COORD dwWriteCoord)
{
@ -367,7 +367,7 @@ WriteConsoleOutputCharactersW(LPCWSTR lpCharacter,
NTSTATUS
WriteConsoleOutputAttributes(CONST USHORT *lpAttribute,
ConWriteConsoleOutputAttributes(CONST USHORT *lpAttribute,
ULONG nLength,
COORD dwWriteCoord,
PULONG lpNumberOfAttrsWritten)
@ -407,7 +407,7 @@ WriteConsoleOutputAttributes(CONST USHORT *lpAttribute,
NTSTATUS
FillConsoleOutputAttribute(USHORT wAttribute,
ConFillConsoleOutputAttribute(USHORT wAttribute,
ULONG nLength,
COORD dwWriteCoord,
PULONG lpNumberOfAttrsWritten)
@ -441,7 +441,7 @@ FillConsoleOutputAttribute(USHORT wAttribute,
NTSTATUS
FillConsoleOutputCharacter(CHAR Character,
ConFillConsoleOutputCharacter(CHAR Character,
ULONG Length,
COORD WriteCoord,
PULONG NumberOfCharsWritten)
@ -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,7 +675,7 @@ ConOutChar(CHAR c)
{
ULONG Written;
WriteConsole(&c,
ConWriteConsole(&c,
1,
&Written);
}
@ -686,10 +686,10 @@ ConOutPuts(LPSTR szText)
{
ULONG Written;
WriteConsole(szText,
ConWriteConsole(szText,
strlen(szText),
&Written);
WriteConsole("\n",
ConWriteConsole("\n",
1,
&Written);
}
@ -706,7 +706,7 @@ ConOutPrintf(LPSTR szFormat, ...)
vsprintf(szOut, szFormat, arg_ptr);
va_end(arg_ptr);
WriteConsole(szOut,
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,17 +896,17 @@ SetInputTextXY(SHORT x, SHORT y, SHORT len, PWCHAR Text)
Length = len - 1;
}
FillConsoleOutputAttribute(0x70,
ConFillConsoleOutputAttribute(0x70,
len,
coPos,
&Written);
WriteConsoleOutputCharactersW(Text,
ConWriteConsoleOutputCharactersW(Text,
Length,
coPos);
coPos.X += Length;
FillConsoleOutputCharacter('_',
ConFillConsoleOutputCharacter('_',
1,
coPos,
&Written);
@ -914,7 +914,7 @@ SetInputTextXY(SHORT x, SHORT y, SHORT len, PWCHAR Text)
if (len > Length + 1)
{
coPos.X++;
FillConsoleOutputCharacter(' ',
ConFillConsoleOutputCharacter(' ',
len - Length - 1,
coPos,
&Written);
@ -934,12 +934,12 @@ SetUnderlinedTextXY(SHORT x, SHORT y, PCHAR Text)
Length = strlen(Text);
WriteConsoleOutputCharacters(Text,
ConWriteConsoleOutputCharacters(Text,
Length,
coPos);
coPos.Y++;
FillConsoleOutputCharacter(0xCD,
ConFillConsoleOutputCharacter(0xCD,
Length,
coPos,
&Written);
@ -958,12 +958,12 @@ SetInvertedTextXY(SHORT x, SHORT y, PCHAR Text)
Length = strlen(Text);
FillConsoleOutputAttribute(0x71,
ConFillConsoleOutputAttribute(0x71,
Length,
coPos,
&Written);
WriteConsoleOutputCharacters(Text,
ConWriteConsoleOutputCharacters(Text,
Length,
coPos);
}
@ -981,12 +981,12 @@ SetHighlightedTextXY(SHORT x, SHORT y, PCHAR Text)
Length = strlen(Text);
FillConsoleOutputAttribute(0x1F,
ConFillConsoleOutputAttribute(0x1F,
Length,
coPos,
&Written);
WriteConsoleOutputCharacters(Text,
ConWriteConsoleOutputCharacters(Text,
Length,
coPos);
}
@ -1006,7 +1006,7 @@ PrintTextXY(SHORT x, SHORT y, char* fmt, ...)
coPos.X = x;
coPos.Y = y;
WriteConsoleOutputCharacters(buffer,
ConWriteConsoleOutputCharacters(buffer,
strlen(buffer),
coPos);
}
@ -1034,7 +1034,7 @@ PrintTextXYN(SHORT x, SHORT y, SHORT len, char* fmt, ...)
Length = len - 1;
}
WriteConsoleOutputCharacters(buffer,
ConWriteConsoleOutputCharacters(buffer,
Length,
coPos);
@ -1042,7 +1042,7 @@ PrintTextXYN(SHORT x, SHORT y, SHORT len, char* fmt, ...)
if (len > Length)
{
FillConsoleOutputCharacter(' ',
ConFillConsoleOutputCharacter(' ',
len - Length,
coPos,
&Written);

View file

@ -29,44 +29,53 @@
#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,
ConReadConsoleOutputCharacters(LPSTR lpCharacter,
ULONG nLength,
COORD dwReadCoord,
PULONG lpNumberOfCharsRead);
NTSTATUS
ReadConsoleOutputAttributes(PUSHORT lpAttribute,
ConReadConsoleOutputAttributes(PUSHORT lpAttribute,
ULONG nLength,
COORD dwReadCoord,
PULONG lpNumberOfAttrsRead);
NTSTATUS
WriteConsoleOutputCharacters(LPCSTR lpCharacter,
ConWriteConsoleOutputCharacters(LPCSTR lpCharacter,
ULONG nLength,
COORD dwWriteCoord);
NTSTATUS
WriteConsoleOutputAttributes(CONST USHORT *lpAttribute,
ConWriteConsoleOutputAttributes(CONST USHORT *lpAttribute,
ULONG nLength,
COORD dwWriteCoord,
PULONG lpNumberOfAttrsWritten);
NTSTATUS
FillConsoleOutputAttribute(USHORT wAttribute,
ConFillConsoleOutputAttribute(USHORT wAttribute,
ULONG nLength,
COORD dwWriteCoord,
PULONG lpNumberOfAttrsWritten);
NTSTATUS
FillConsoleOutputCharacter(CHAR Character,
ConFillConsoleOutputCharacter(CHAR Character,
ULONG Length,
COORD WriteCoord,
PULONG NumberOfCharsWritten);

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>