mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 23:42:57 +00:00
[FORMATTING] Replace tabs by spaces
Replace some DPRINT1 by DPRINT svn path=/trunk/; revision=23084
This commit is contained in:
parent
2f8950ce51
commit
72185bb72b
2 changed files with 124 additions and 124 deletions
|
@ -60,7 +60,7 @@ ConioConsoleCtrlEventTimeout(DWORD Event, PCSRSS_PROCESS_DATA ProcessData, DWORD
|
||||||
{
|
{
|
||||||
HANDLE Thread;
|
HANDLE Thread;
|
||||||
|
|
||||||
DPRINT("ConioConsoleCtrlEvent Parent ProcessId = %x\n", ProcessData->ProcessId);
|
DPRINT("ConioConsoleCtrlEvent Parent ProcessId = %x\n", ProcessData->ProcessId);
|
||||||
|
|
||||||
if (ProcessData->CtrlDispatcher)
|
if (ProcessData->CtrlDispatcher)
|
||||||
{
|
{
|
||||||
|
@ -191,7 +191,7 @@ CsrInitConsole(PCSRSS_CONSOLE Console)
|
||||||
CloseHandle(Console->ActiveEvent);
|
CloseHandle(Console->ActiveEvent);
|
||||||
return STATUS_INSUFFICIENT_RESOURCES;
|
return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! GuiMode)
|
if (! GuiMode)
|
||||||
{
|
{
|
||||||
Status = TuiInitConsole(Console);
|
Status = TuiInitConsole(Console);
|
||||||
|
@ -223,7 +223,7 @@ CsrInitConsole(PCSRSS_CONSOLE Console)
|
||||||
DeleteCriticalSection(&Console->Header.Lock);
|
DeleteCriticalSection(&Console->Header.Lock);
|
||||||
CloseHandle(Console->ActiveEvent);
|
CloseHandle(Console->ActiveEvent);
|
||||||
HeapFree(Win32CsrApiHeap, 0, NewBuffer);
|
HeapFree(Win32CsrApiHeap, 0, NewBuffer);
|
||||||
DPRINT1("CsrInitConsoleScreenBuffer: failed\n");
|
DPRINT1("CsrInitConsoleScreenBuffer: failed\n");
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -310,8 +310,8 @@ CSR_API(CsrAllocConsole)
|
||||||
if (NewConsole || !ProcessData->bInheritHandles)
|
if (NewConsole || !ProcessData->bInheritHandles)
|
||||||
{
|
{
|
||||||
/* Insert the Objects */
|
/* Insert the Objects */
|
||||||
Status = Win32CsrInsertObject(ProcessData,
|
Status = Win32CsrInsertObject(ProcessData,
|
||||||
&Request->Data.AllocConsoleRequest.InputHandle,
|
&Request->Data.AllocConsoleRequest.InputHandle,
|
||||||
&Console->Header);
|
&Console->Header);
|
||||||
if (! NT_SUCCESS(Status))
|
if (! NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
@ -320,15 +320,15 @@ CSR_API(CsrAllocConsole)
|
||||||
ProcessData->Console = 0;
|
ProcessData->Console = 0;
|
||||||
return Request->Status = Status;
|
return Request->Status = Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = Win32CsrInsertObject(ProcessData,
|
Status = Win32CsrInsertObject(ProcessData,
|
||||||
&Request->Data.AllocConsoleRequest.OutputHandle,
|
&Request->Data.AllocConsoleRequest.OutputHandle,
|
||||||
&Console->ActiveBuffer->Header);
|
&Console->ActiveBuffer->Header);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("Failed to insert object\n");
|
DPRINT1("Failed to insert object\n");
|
||||||
ConioDeleteConsole((Object_t *) Console);
|
ConioDeleteConsole((Object_t *) Console);
|
||||||
Win32CsrReleaseObject(ProcessData,
|
Win32CsrReleaseObject(ProcessData,
|
||||||
Request->Data.AllocConsoleRequest.InputHandle);
|
Request->Data.AllocConsoleRequest.InputHandle);
|
||||||
ProcessData->Console = 0;
|
ProcessData->Console = 0;
|
||||||
return Request->Status = Status;
|
return Request->Status = Status;
|
||||||
|
@ -336,12 +336,12 @@ CSR_API(CsrAllocConsole)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Duplicate the Event */
|
/* Duplicate the Event */
|
||||||
if (!DuplicateHandle(GetCurrentProcess(),
|
if (!DuplicateHandle(GetCurrentProcess(),
|
||||||
ProcessData->Console->ActiveEvent,
|
ProcessData->Console->ActiveEvent,
|
||||||
ProcessData->Process,
|
ProcessData->Process,
|
||||||
&ProcessData->ConsoleEvent,
|
&ProcessData->ConsoleEvent,
|
||||||
EVENT_ALL_ACCESS,
|
EVENT_ALL_ACCESS,
|
||||||
FALSE,
|
FALSE,
|
||||||
0))
|
0))
|
||||||
{
|
{
|
||||||
DPRINT1("DuplicateHandle() failed: %d\n", GetLastError);
|
DPRINT1("DuplicateHandle() failed: %d\n", GetLastError);
|
||||||
|
@ -623,13 +623,13 @@ CSR_API(CsrReadConsole)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* otherwise, we will treat the backspace just like any other char and let the client decide what to do */
|
/* otherwise, we will treat the backspace just like any other char and let the client decide what to do */
|
||||||
Console->WaitingChars--;
|
Console->WaitingChars--;
|
||||||
ConioUnlockConsole(Console);
|
ConioUnlockConsole(Console);
|
||||||
HeapFree(Win32CsrApiHeap, 0, Input);
|
HeapFree(Win32CsrApiHeap, 0, Input);
|
||||||
Request->Data.ReadConsoleRequest.NrCharactersRead++;
|
Request->Data.ReadConsoleRequest.NrCharactersRead++;
|
||||||
Buffer[i] = Input->InputEvent.Event.KeyEvent.uChar.AsciiChar;
|
Buffer[i] = Input->InputEvent.Event.KeyEvent.uChar.AsciiChar;
|
||||||
return Request->Status;
|
return Request->Status;
|
||||||
}
|
}
|
||||||
Request->Data.ReadConsoleRequest.nCharsCanBeDeleted--;
|
Request->Data.ReadConsoleRequest.nCharsCanBeDeleted--;
|
||||||
Input->Echoed = TRUE; /* mark as echoed so we don't echo it below */
|
Input->Echoed = TRUE; /* mark as echoed so we don't echo it below */
|
||||||
|
@ -724,7 +724,7 @@ inline BOOLEAN ConioIsEqualRect(
|
||||||
RECT *Rect2)
|
RECT *Rect2)
|
||||||
{
|
{
|
||||||
return ((Rect1->left == Rect2->left) && (Rect1->right == Rect2->right) &&
|
return ((Rect1->left == Rect2->left) && (Rect1->right == Rect2->right) &&
|
||||||
(Rect1->top == Rect2->top) && (Rect1->bottom == Rect2->bottom));
|
(Rect1->top == Rect2->top) && (Rect1->bottom == Rect2->bottom));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline BOOLEAN ConioGetIntersection(
|
inline BOOLEAN ConioGetIntersection(
|
||||||
|
@ -947,7 +947,7 @@ CSR_API(CsrWriteConsole)
|
||||||
DPRINT("CsrWriteConsole\n");
|
DPRINT("CsrWriteConsole\n");
|
||||||
|
|
||||||
if (Request->Header.u1.s1.TotalLength
|
if (Request->Header.u1.s1.TotalLength
|
||||||
< CSR_API_MESSAGE_HEADER_SIZE(CSRSS_WRITE_CONSOLE)
|
< CSR_API_MESSAGE_HEADER_SIZE(CSRSS_WRITE_CONSOLE)
|
||||||
+ (Request->Data.WriteConsoleRequest.NrCharactersToWrite * CharSize))
|
+ (Request->Data.WriteConsoleRequest.NrCharactersToWrite * CharSize))
|
||||||
{
|
{
|
||||||
DPRINT1("Invalid request size\n");
|
DPRINT1("Invalid request size\n");
|
||||||
|
@ -956,10 +956,10 @@ CSR_API(CsrWriteConsole)
|
||||||
return Request->Status = STATUS_INVALID_PARAMETER;
|
return Request->Status = STATUS_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
Status = ConioConsoleFromProcessData(ProcessData, &Console);
|
Status = ConioConsoleFromProcessData(ProcessData, &Console);
|
||||||
|
|
||||||
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE);
|
||||||
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
|
Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE);
|
||||||
|
|
||||||
if (! NT_SUCCESS(Status))
|
if (! NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
return Request->Status = Status;
|
return Request->Status = Status;
|
||||||
|
@ -967,16 +967,16 @@ CSR_API(CsrWriteConsole)
|
||||||
|
|
||||||
if(Request->Data.WriteConsoleRequest.Unicode)
|
if(Request->Data.WriteConsoleRequest.Unicode)
|
||||||
{
|
{
|
||||||
Length = WideCharToMultiByte(Console->CodePage, 0,
|
Length = WideCharToMultiByte(Console->CodePage, 0,
|
||||||
(PWCHAR)Request->Data.WriteConsoleRequest.Buffer,
|
(PWCHAR)Request->Data.WriteConsoleRequest.Buffer,
|
||||||
Request->Data.WriteConsoleRequest.NrCharactersToWrite,
|
Request->Data.WriteConsoleRequest.NrCharactersToWrite,
|
||||||
NULL, 0, NULL, NULL);
|
NULL, 0, NULL, NULL);
|
||||||
Buffer = RtlAllocateHeap(GetProcessHeap(), 0, Length);
|
Buffer = RtlAllocateHeap(GetProcessHeap(), 0, Length);
|
||||||
if (Buffer)
|
if (Buffer)
|
||||||
{
|
{
|
||||||
WideCharToMultiByte(Console->CodePage, 0,
|
WideCharToMultiByte(Console->CodePage, 0,
|
||||||
(PWCHAR)Request->Data.WriteConsoleRequest.Buffer,
|
(PWCHAR)Request->Data.WriteConsoleRequest.Buffer,
|
||||||
Request->Data.WriteConsoleRequest.NrCharactersToWrite,
|
Request->Data.WriteConsoleRequest.NrCharactersToWrite,
|
||||||
Buffer, Length, NULL, NULL);
|
Buffer, Length, NULL, NULL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -988,7 +988,7 @@ CSR_API(CsrWriteConsole)
|
||||||
{
|
{
|
||||||
Buffer = (PCHAR)Request->Data.WriteConsoleRequest.Buffer;
|
Buffer = (PCHAR)Request->Data.WriteConsoleRequest.Buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Buffer)
|
if (Buffer)
|
||||||
{
|
{
|
||||||
Status = ConioLockScreenBuffer(ProcessData, Request->Data.WriteConsoleRequest.ConsoleHandle, &Buff);
|
Status = ConioLockScreenBuffer(ProcessData, Request->Data.WriteConsoleRequest.ConsoleHandle, &Buff);
|
||||||
|
@ -1096,11 +1096,11 @@ ConioProcessChar(PCSRSS_CONSOLE Console,
|
||||||
DPRINT1("Console_Api Ctrl-C\n");
|
DPRINT1("Console_Api Ctrl-C\n");
|
||||||
current_entry = Console->ProcessList.Flink;
|
current_entry = Console->ProcessList.Flink;
|
||||||
while (current_entry != &Console->ProcessList)
|
while (current_entry != &Console->ProcessList)
|
||||||
{
|
{
|
||||||
current = CONTAINING_RECORD(current_entry, CSRSS_PROCESS_DATA, ProcessEntry);
|
current = CONTAINING_RECORD(current_entry, CSRSS_PROCESS_DATA, ProcessEntry);
|
||||||
current_entry = current_entry->Flink;
|
current_entry = current_entry->Flink;
|
||||||
ConioConsoleCtrlEvent((DWORD)CTRL_C_EVENT, current);
|
ConioConsoleCtrlEvent((DWORD)CTRL_C_EVENT, current);
|
||||||
}
|
}
|
||||||
HeapFree(Win32CsrApiHeap, 0, KeyEventRecord);
|
HeapFree(Win32CsrApiHeap, 0, KeyEventRecord);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1111,30 +1111,30 @@ ConioProcessChar(PCSRSS_CONSOLE Console,
|
||||||
|| VK_DOWN == KeyEventRecord->InputEvent.Event.KeyEvent.wVirtualKeyCode))
|
|| VK_DOWN == KeyEventRecord->InputEvent.Event.KeyEvent.wVirtualKeyCode))
|
||||||
{
|
{
|
||||||
if (KeyEventRecord->InputEvent.Event.KeyEvent.bKeyDown)
|
if (KeyEventRecord->InputEvent.Event.KeyEvent.bKeyDown)
|
||||||
{
|
{
|
||||||
/* scroll up or down */
|
/* scroll up or down */
|
||||||
if (NULL == Console)
|
if (NULL == Console)
|
||||||
{
|
{
|
||||||
DPRINT1("No Active Console!\n");
|
DPRINT1("No Active Console!\n");
|
||||||
HeapFree(Win32CsrApiHeap, 0, KeyEventRecord);
|
HeapFree(Win32CsrApiHeap, 0, KeyEventRecord);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (VK_UP == KeyEventRecord->InputEvent.Event.KeyEvent.wVirtualKeyCode)
|
if (VK_UP == KeyEventRecord->InputEvent.Event.KeyEvent.wVirtualKeyCode)
|
||||||
{
|
{
|
||||||
/* only scroll up if there is room to scroll up into */
|
/* only scroll up if there is room to scroll up into */
|
||||||
if (Console->ActiveBuffer->ShowY != ((Console->ActiveBuffer->CurrentY + 1) %
|
if (Console->ActiveBuffer->ShowY != ((Console->ActiveBuffer->CurrentY + 1) %
|
||||||
Console->ActiveBuffer->MaxY))
|
Console->ActiveBuffer->MaxY))
|
||||||
{
|
{
|
||||||
Console->ActiveBuffer->ShowY = (Console->ActiveBuffer->ShowY +
|
Console->ActiveBuffer->ShowY = (Console->ActiveBuffer->ShowY +
|
||||||
Console->ActiveBuffer->MaxY - 1) %
|
Console->ActiveBuffer->MaxY - 1) %
|
||||||
Console->ActiveBuffer->MaxY;
|
Console->ActiveBuffer->MaxY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (Console->ActiveBuffer->ShowY != Console->ActiveBuffer->CurrentY)
|
else if (Console->ActiveBuffer->ShowY != Console->ActiveBuffer->CurrentY)
|
||||||
/* only scroll down if there is room to scroll down into */
|
/* only scroll down if there is room to scroll down into */
|
||||||
{
|
{
|
||||||
if (Console->ActiveBuffer->ShowY % Console->ActiveBuffer->MaxY !=
|
if (Console->ActiveBuffer->ShowY % Console->ActiveBuffer->MaxY !=
|
||||||
Console->ActiveBuffer->CurrentY)
|
Console->ActiveBuffer->CurrentY)
|
||||||
{
|
{
|
||||||
if (((Console->ActiveBuffer->CurrentY + 1) % Console->ActiveBuffer->MaxY) !=
|
if (((Console->ActiveBuffer->CurrentY + 1) % Console->ActiveBuffer->MaxY) !=
|
||||||
(Console->ActiveBuffer->ShowY + Console->ActiveBuffer->MaxY) %
|
(Console->ActiveBuffer->ShowY + Console->ActiveBuffer->MaxY) %
|
||||||
|
@ -1208,30 +1208,30 @@ ConioProcessChar(PCSRSS_CONSOLE Console,
|
||||||
{
|
{
|
||||||
/* walk the input queue looking for a char to backspace */
|
/* walk the input queue looking for a char to backspace */
|
||||||
for (TempInput = (ConsoleInput *) Console->InputEvents.Blink;
|
for (TempInput = (ConsoleInput *) Console->InputEvents.Blink;
|
||||||
TempInput != (ConsoleInput *) &Console->InputEvents
|
TempInput != (ConsoleInput *) &Console->InputEvents
|
||||||
&& (KEY_EVENT == TempInput->InputEvent.EventType
|
&& (KEY_EVENT == TempInput->InputEvent.EventType
|
||||||
|| ! TempInput->InputEvent.Event.KeyEvent.bKeyDown
|
|| ! TempInput->InputEvent.Event.KeyEvent.bKeyDown
|
||||||
|| '\b' == TempInput->InputEvent.Event.KeyEvent.uChar.AsciiChar);
|
|| '\b' == TempInput->InputEvent.Event.KeyEvent.uChar.AsciiChar);
|
||||||
TempInput = (ConsoleInput *) TempInput->ListEntry.Blink)
|
TempInput = (ConsoleInput *) TempInput->ListEntry.Blink)
|
||||||
{
|
{
|
||||||
/* NOP */;
|
/* NOP */;
|
||||||
}
|
}
|
||||||
/* if we found one, delete it, otherwise, wake the client */
|
/* if we found one, delete it, otherwise, wake the client */
|
||||||
if (TempInput != (ConsoleInput *) &Console->InputEvents)
|
if (TempInput != (ConsoleInput *) &Console->InputEvents)
|
||||||
{
|
{
|
||||||
/* delete previous key in queue, maybe echo backspace to screen, and do not place backspace on queue */
|
/* delete previous key in queue, maybe echo backspace to screen, and do not place backspace on queue */
|
||||||
RemoveEntryList(&TempInput->ListEntry);
|
RemoveEntryList(&TempInput->ListEntry);
|
||||||
if (TempInput->Echoed)
|
if (TempInput->Echoed)
|
||||||
{
|
{
|
||||||
ConioWriteConsole(Console, Console->ActiveBuffer,
|
ConioWriteConsole(Console, Console->ActiveBuffer,
|
||||||
&KeyEventRecord->InputEvent.Event.KeyEvent.uChar.AsciiChar,
|
&KeyEventRecord->InputEvent.Event.KeyEvent.uChar.AsciiChar,
|
||||||
1, TRUE);
|
1, TRUE);
|
||||||
}
|
}
|
||||||
HeapFree(Win32CsrApiHeap, 0, TempInput);
|
HeapFree(Win32CsrApiHeap, 0, TempInput);
|
||||||
RemoveEntryList(&KeyEventRecord->ListEntry);
|
RemoveEntryList(&KeyEventRecord->ListEntry);
|
||||||
HeapFree(Win32CsrApiHeap, 0, KeyEventRecord);
|
HeapFree(Win32CsrApiHeap, 0, KeyEventRecord);
|
||||||
Console->WaitingChars -= 2;
|
Console->WaitingChars -= 2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SetEvent(Console->ActiveEvent);
|
SetEvent(Console->ActiveEvent);
|
||||||
|
@ -1395,15 +1395,15 @@ ConioProcessKey(MSG *msg, PCSRSS_CONSOLE Console, BOOL TextMode)
|
||||||
LastVirtualKey = msg->wParam;
|
LastVirtualKey = msg->wParam;
|
||||||
|
|
||||||
DPRINT ("csrss: %s %s %s %s %02x %02x '%c' %04x\n",
|
DPRINT ("csrss: %s %s %s %s %02x %02x '%c' %04x\n",
|
||||||
Down ? "down" : "up ",
|
Down ? "down" : "up ",
|
||||||
(msg->message == WM_CHAR || msg->message == WM_SYSCHAR) ?
|
(msg->message == WM_CHAR || msg->message == WM_SYSCHAR) ?
|
||||||
"char" : "key ",
|
"char" : "key ",
|
||||||
ConInRec->Fake ? "fake" : "real",
|
ConInRec->Fake ? "fake" : "real",
|
||||||
ConInRec->NotChar ? "notc" : "char",
|
ConInRec->NotChar ? "notc" : "char",
|
||||||
VirtualScanCode,
|
VirtualScanCode,
|
||||||
VirtualKeyCode,
|
VirtualKeyCode,
|
||||||
(AsciiChar >= ' ') ? AsciiChar : '.',
|
(AsciiChar >= ' ') ? AsciiChar : '.',
|
||||||
ShiftState);
|
ShiftState);
|
||||||
|
|
||||||
if (! ConInRec->Fake || ! ConInRec->NotChar)
|
if (! ConInRec->Fake || ! ConInRec->NotChar)
|
||||||
{
|
{
|
||||||
|
@ -1590,7 +1590,7 @@ CSR_API(CsrWriteConsoleOutputChar)
|
||||||
CharSize = (Request->Data.WriteConsoleOutputCharRequest.Unicode ? sizeof(WCHAR) : sizeof(CHAR));
|
CharSize = (Request->Data.WriteConsoleOutputCharRequest.Unicode ? sizeof(WCHAR) : sizeof(CHAR));
|
||||||
|
|
||||||
if (Request->Header.u1.s1.TotalLength
|
if (Request->Header.u1.s1.TotalLength
|
||||||
< CSR_API_MESSAGE_HEADER_SIZE(CSRSS_WRITE_CONSOLE_OUTPUT_CHAR)
|
< CSR_API_MESSAGE_HEADER_SIZE(CSRSS_WRITE_CONSOLE_OUTPUT_CHAR)
|
||||||
+ (Request->Data.WriteConsoleOutputCharRequest.Length * CharSize))
|
+ (Request->Data.WriteConsoleOutputCharRequest.Length * CharSize))
|
||||||
{
|
{
|
||||||
DPRINT1("Invalid request size\n");
|
DPRINT1("Invalid request size\n");
|
||||||
|
@ -1606,16 +1606,16 @@ CSR_API(CsrWriteConsoleOutputChar)
|
||||||
{
|
{
|
||||||
if(Request->Data.WriteConsoleOutputCharRequest.Unicode)
|
if(Request->Data.WriteConsoleOutputCharRequest.Unicode)
|
||||||
{
|
{
|
||||||
Length = WideCharToMultiByte(Console->CodePage, 0,
|
Length = WideCharToMultiByte(Console->CodePage, 0,
|
||||||
(PWCHAR)Request->Data.WriteConsoleOutputCharRequest.String,
|
(PWCHAR)Request->Data.WriteConsoleOutputCharRequest.String,
|
||||||
Request->Data.WriteConsoleOutputCharRequest.Length,
|
Request->Data.WriteConsoleOutputCharRequest.Length,
|
||||||
NULL, 0, NULL, NULL);
|
NULL, 0, NULL, NULL);
|
||||||
tmpString = String = RtlAllocateHeap(GetProcessHeap(), 0, Length);
|
tmpString = String = RtlAllocateHeap(GetProcessHeap(), 0, Length);
|
||||||
if (String)
|
if (String)
|
||||||
{
|
{
|
||||||
WideCharToMultiByte(Console->CodePage, 0,
|
WideCharToMultiByte(Console->CodePage, 0,
|
||||||
(PWCHAR)Request->Data.WriteConsoleOutputCharRequest.String,
|
(PWCHAR)Request->Data.WriteConsoleOutputCharRequest.String,
|
||||||
Request->Data.WriteConsoleOutputCharRequest.Length,
|
Request->Data.WriteConsoleOutputCharRequest.Length,
|
||||||
String, Length, NULL, NULL);
|
String, Length, NULL, NULL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1627,7 +1627,7 @@ CSR_API(CsrWriteConsoleOutputChar)
|
||||||
{
|
{
|
||||||
String = (PCHAR)Request->Data.WriteConsoleOutputCharRequest.String;
|
String = (PCHAR)Request->Data.WriteConsoleOutputCharRequest.String;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (String)
|
if (String)
|
||||||
{
|
{
|
||||||
Status = ConioLockScreenBuffer(ProcessData,
|
Status = ConioLockScreenBuffer(ProcessData,
|
||||||
|
@ -1781,9 +1781,9 @@ CSR_API(CsrReadInputEvent)
|
||||||
|
|
||||||
if (Done && !Input->Fake)
|
if (Done && !Input->Fake)
|
||||||
{
|
{
|
||||||
Request->Data.ReadInputRequest.MoreEvents = TRUE;
|
Request->Data.ReadInputRequest.MoreEvents = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
RemoveEntryList(&Input->ListEntry);
|
RemoveEntryList(&Input->ListEntry);
|
||||||
|
|
||||||
|
@ -1794,14 +1794,14 @@ CSR_API(CsrReadInputEvent)
|
||||||
{
|
{
|
||||||
ConioInputEventToAnsi(Console, &Request->Data.ReadInputRequest.Input);
|
ConioInputEventToAnsi(Console, &Request->Data.ReadInputRequest.Input);
|
||||||
}
|
}
|
||||||
Done = TRUE;
|
Done = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Input->InputEvent.EventType == KEY_EVENT)
|
if (Input->InputEvent.EventType == KEY_EVENT)
|
||||||
{
|
{
|
||||||
if (0 != (Console->Mode & ENABLE_LINE_INPUT)
|
if (0 != (Console->Mode & ENABLE_LINE_INPUT)
|
||||||
&& Input->InputEvent.Event.KeyEvent.bKeyDown
|
&& Input->InputEvent.Event.KeyEvent.bKeyDown
|
||||||
&& '\r' == Input->InputEvent.Event.KeyEvent.uChar.AsciiChar)
|
&& '\r' == Input->InputEvent.Event.KeyEvent.uChar.AsciiChar)
|
||||||
{
|
{
|
||||||
Console->WaitingLines--;
|
Console->WaitingLines--;
|
||||||
}
|
}
|
||||||
|
@ -2215,7 +2215,7 @@ CSR_API(CsrCreateScreenBuffer)
|
||||||
if (Console->ActiveBuffer)
|
if (Console->ActiveBuffer)
|
||||||
{
|
{
|
||||||
Buff->MaxX = Console->ActiveBuffer->MaxX;
|
Buff->MaxX = Console->ActiveBuffer->MaxX;
|
||||||
Buff->MaxY = Console->ActiveBuffer->MaxY;
|
Buff->MaxY = Console->ActiveBuffer->MaxY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Buff->MaxX == 0)
|
if (Buff->MaxX == 0)
|
||||||
|
@ -2694,15 +2694,15 @@ CSR_API(CsrReadConsoleOutputChar)
|
||||||
Xpos++;
|
Xpos++;
|
||||||
|
|
||||||
if (Xpos == Buff->MaxX)
|
if (Xpos == Buff->MaxX)
|
||||||
{
|
{
|
||||||
Xpos = 0;
|
Xpos = 0;
|
||||||
Ypos++;
|
Ypos++;
|
||||||
|
|
||||||
if (Ypos == Buff->MaxY)
|
if (Ypos == Buff->MaxY)
|
||||||
{
|
{
|
||||||
Ypos = 0;
|
Ypos = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
*ReadBuffer = 0;
|
*ReadBuffer = 0;
|
||||||
|
@ -2820,7 +2820,7 @@ CSR_API(CsrGetNumberOfConsoleInputEvents)
|
||||||
if (!Input->Fake)
|
if (!Input->Fake)
|
||||||
{
|
{
|
||||||
NumEvents++;
|
NumEvents++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ConioUnlockConsole(Console);
|
ConioUnlockConsole(Console);
|
||||||
|
@ -3045,8 +3045,8 @@ CSR_API(CsrWriteConsoleInput)
|
||||||
|
|
||||||
Record->Echoed = FALSE;
|
Record->Echoed = FALSE;
|
||||||
Record->Fake = FALSE;
|
Record->Fake = FALSE;
|
||||||
//Record->InputEvent = *InputRecord++;
|
//Record->InputEvent = *InputRecord++;
|
||||||
memcpy(&Record->InputEvent, &InputRecord[i], sizeof(INPUT_RECORD));
|
memcpy(&Record->InputEvent, &InputRecord[i], sizeof(INPUT_RECORD));
|
||||||
if (KEY_EVENT == Record->InputEvent.EventType)
|
if (KEY_EVENT == Record->InputEvent.EventType)
|
||||||
{
|
{
|
||||||
/* FIXME - convert from unicode to ascii!! */
|
/* FIXME - convert from unicode to ascii!! */
|
||||||
|
@ -3335,7 +3335,7 @@ CSR_API(CsrStartScreenSaver)
|
||||||
{
|
{
|
||||||
STARTUPINFOW si;
|
STARTUPINFOW si;
|
||||||
PROCESS_INFORMATION pi;
|
PROCESS_INFORMATION pi;
|
||||||
WCHAR szCmdline[MAX_PATH];
|
WCHAR szCmdline[MAX_PATH];
|
||||||
|
|
||||||
HKEY hKey;
|
HKEY hKey;
|
||||||
WCHAR szBuffer[MAX_PATH];
|
WCHAR szBuffer[MAX_PATH];
|
||||||
|
@ -3345,33 +3345,33 @@ CSR_API(CsrStartScreenSaver)
|
||||||
|
|
||||||
/* FIXME :
|
/* FIXME :
|
||||||
1. Make it unicode and ansi compatible with TCHAR
|
1. Make it unicode and ansi compatible with TCHAR
|
||||||
|
|
||||||
2. Return state it is running if a tree try start it
|
2. Return state it is running if a tree try start it
|
||||||
one more screen saver when we already have one
|
one more screen saver when we already have one
|
||||||
screen saver running
|
screen saver running
|
||||||
|
|
||||||
3. Use GetLongPath or GetPathName so we can use %SystemRoot% in
|
3. Use GetLongPath or GetPathName so we can use %SystemRoot% in
|
||||||
the key that will make it posible for livecd have a preview screen
|
the key that will make it posible for livecd have a preview screen
|
||||||
saver install.
|
saver install.
|
||||||
|
|
||||||
4. Move the code to winlogon SAS and screen saver must run in
|
4. Move the code to winlogon SAS and screen saver must run in
|
||||||
the secuar desktop. But current our Winlogon does not working
|
the secuar desktop. But current our Winlogon does not working
|
||||||
well with SAS and with Secure desktop, So I (Magnus Olsen aka GreatLord)
|
well with SAS and with Secure desktop, So I (Magnus Olsen aka GreatLord)
|
||||||
add the code here as w3seek recommended
|
add the code here as w3seek recomandete
|
||||||
*/
|
*/
|
||||||
|
|
||||||
result = RegOpenKeyExW(HKEY_CURRENT_USER, L"Control Panel\\Desktop", 0, KEY_ALL_ACCESS, &hKey);
|
result = RegOpenKeyExW(HKEY_CURRENT_USER, L"Control Panel\\Desktop", 0, KEY_QUERY_VALUE, &hKey);
|
||||||
if (result == ERROR_SUCCESS)
|
if (result == ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
result = RegQueryValueExW(hKey, L"SCRNSAVE.EXE", 0, &varType, (LPBYTE)szBuffer, &bufferSize);
|
result = RegQueryValueExW(hKey, L"SCRNSAVE.EXE", 0, &varType, (LPBYTE)szBuffer, &bufferSize);
|
||||||
if(result == ERROR_SUCCESS)
|
if(result == ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
swprintf(szCmdline, L"%s /s",szBuffer);
|
swprintf(szCmdline, L"%s /s",szBuffer);
|
||||||
DPRINT1("CsrStartScreenSaver : OK %S, Name %S\n", szCmdline, szBuffer);
|
DPRINT("CsrStartScreenSaver : OK %S, Name %S\n", szCmdline, szBuffer);
|
||||||
ZeroMemory( &si, sizeof(si) );
|
ZeroMemory( &si, sizeof(si) );
|
||||||
si.cb = sizeof(si);
|
si.cb = sizeof(si);
|
||||||
ZeroMemory( &pi, sizeof(pi) );
|
ZeroMemory( &pi, sizeof(pi) );
|
||||||
if(CreateProcessW( NULL, szCmdline, NULL, NULL, FALSE, 0, NULL,NULL,&si, &pi ))
|
if(CreateProcessW( NULL, szCmdline, NULL, NULL, FALSE, 0, NULL,NULL,&si, &pi ))
|
||||||
{
|
{
|
||||||
CloseHandle( pi.hProcess );
|
CloseHandle( pi.hProcess );
|
||||||
CloseHandle( pi.hThread );
|
CloseHandle( pi.hThread );
|
||||||
|
@ -3379,27 +3379,27 @@ CSR_API(CsrStartScreenSaver)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GetSystemDirectoryW(szCmdline,MAX_PATH);
|
GetSystemDirectoryW(szCmdline,MAX_PATH);
|
||||||
wprintf(szCmdline, L"%s\\%s /s",szCmdline,szBuffer);
|
wprintf(szCmdline, L"%s\\%s /s",szCmdline,szBuffer);
|
||||||
DPRINT1("CsrStartScreenSaver : OK %S, Name %S\n", szCmdline, szBuffer);
|
DPRINT("CsrStartScreenSaver : OK %S, Name %S\n", szCmdline, szBuffer);
|
||||||
ZeroMemory( &si, sizeof(si) );
|
ZeroMemory( &si, sizeof(si) );
|
||||||
si.cb = sizeof(si);
|
si.cb = sizeof(si);
|
||||||
ZeroMemory( &pi, sizeof(pi) );
|
ZeroMemory( &pi, sizeof(pi) );
|
||||||
if(CreateProcessW( NULL, szCmdline, NULL, NULL, FALSE, 0, NULL,NULL,&si, &pi ))
|
if(CreateProcessW( NULL, szCmdline, NULL, NULL, FALSE, 0, NULL,NULL,&si, &pi ))
|
||||||
{
|
{
|
||||||
CloseHandle( pi.hProcess );
|
CloseHandle( pi.hProcess );
|
||||||
CloseHandle( pi.hThread );
|
CloseHandle( pi.hThread );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DPRINT1("CsrStartScreenSaver : failed 0x%08X\n", result);
|
DPRINT("CsrStartScreenSaver : failed 0x%08X\n", result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RegCloseKey(hKey);
|
RegCloseKey(hKey);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DPRINT1("CsrStartScreenSaver : failed to RegOpenKeyExW 0x%08X\n", result);
|
DPRINT1("CsrStartScreenSaver : failed to RegOpenKeyExW (error 0x%lx)\n", result);
|
||||||
}
|
}
|
||||||
return Request->Status = STATUS_SUCCESS;
|
return Request->Status = STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,7 +167,7 @@ ScreenSaverThreadMain(PVOID StartContext)
|
||||||
UINT ScreenSaverTimeOut = 0;
|
UINT ScreenSaverTimeOut = 0;
|
||||||
BOOL nPreviousState = FALSE;
|
BOOL nPreviousState = FALSE;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
BOOL FristTime = TRUE;
|
BOOL FirstTime = TRUE;
|
||||||
|
|
||||||
|
|
||||||
KeSetPriorityThread(&PsGetCurrentThread()->Tcb,
|
KeSetPriorityThread(&PsGetCurrentThread()->Tcb,
|
||||||
|
@ -217,13 +217,13 @@ ScreenSaverThreadMain(PVOID StartContext)
|
||||||
(nPreviousState == FALSE))
|
(nPreviousState == FALSE))
|
||||||
{
|
{
|
||||||
BOOL nPreviousState = FALSE;
|
BOOL nPreviousState = FALSE;
|
||||||
DPRINT1("Keyboard and Mouse TimeOut Starting Screen Saver ...\n");
|
DPRINT("Keyboard and Mouse TimeOut Starting Screen Saver ...\n");
|
||||||
DPRINT1(" %I64d Keyboard Timeout Value\n",DiffTimeKeyboard.QuadPart);
|
DPRINT(" %I64d Keyboard Timeout Value\n",DiffTimeKeyboard.QuadPart);
|
||||||
DPRINT1(" %I64d Mouse Timeout Value \n",DiffTimeMouse.QuadPart);
|
DPRINT(" %I64d Mouse Timeout Value \n",DiffTimeMouse.QuadPart);
|
||||||
DPRINT1(" %I64d TimeOut \n",DiffTimeMouse.QuadPart);
|
DPRINT(" %I64d TimeOut \n",DiffTimeMouse.QuadPart);
|
||||||
|
|
||||||
if (FristTime == FALSE)
|
if (FirstTime == FALSE)
|
||||||
{
|
{
|
||||||
CSR_API_MESSAGE Request;
|
CSR_API_MESSAGE Request;
|
||||||
CsrInit();
|
CsrInit();
|
||||||
Request.Type = MAKE_CSR_API(START_SCREEN_SAVER, CSR_GUI);
|
Request.Type = MAKE_CSR_API(START_SCREEN_SAVER, CSR_GUI);
|
||||||
|
@ -231,11 +231,11 @@ ScreenSaverThreadMain(PVOID StartContext)
|
||||||
co_CsrNotifyScreenSaver(&Request );
|
co_CsrNotifyScreenSaver(&Request );
|
||||||
|
|
||||||
IntSystemParametersInfo(SPI_SETSCREENSAVERRUNNING, TRUE, &nPreviousState, 0);
|
IntSystemParametersInfo(SPI_SETSCREENSAVERRUNNING, TRUE, &nPreviousState, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FristTime = FALSE;
|
FirstTime = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( (DiffTimeMouse.QuadPart < Timeout.QuadPart) &&
|
if ( (DiffTimeMouse.QuadPart < Timeout.QuadPart) &&
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue