Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

getset.c File Reference

#include "precomp.h"

Go to the source code of this file.

Functions

ULONG SrvGetConsoleMode (IN OUT PCSR_API_MSG m, IN OUT PCSR_REPLY_STATUS ReplyStatus)
ULONG SrvGetConsoleNumberOfFonts (IN OUT PCSR_API_MSG m, IN OUT PCSR_REPLY_STATUS ReplyStatus)
ULONG SrvGetConsoleNumberOfInputEvents (IN OUT PCSR_API_MSG m, IN OUT PCSR_REPLY_STATUS ReplyStatus)
ULONG SrvGetConsoleScreenBufferInfo (IN OUT PCSR_API_MSG m, IN OUT PCSR_REPLY_STATUS ReplyStatus)
ULONG SrvGetConsoleCursorInfo (IN OUT PCSR_API_MSG m, IN OUT PCSR_REPLY_STATUS ReplyStatus)
ULONG SrvGetConsoleMouseInfo (IN OUT PCSR_API_MSG m, IN OUT PCSR_REPLY_STATUS ReplyStatus)
ULONG SrvGetConsoleFontInfo (IN OUT PCSR_API_MSG m, IN OUT PCSR_REPLY_STATUS ReplyStatus)
ULONG SrvGetConsoleFontSize (IN OUT PCSR_API_MSG m, IN OUT PCSR_REPLY_STATUS ReplyStatus)
ULONG SrvGetConsoleCurrentFont (IN OUT PCSR_API_MSG m, IN OUT PCSR_REPLY_STATUS ReplyStatus)
ULONG SrvSetConsoleMode (IN OUT PCSR_API_MSG m, IN OUT PCSR_REPLY_STATUS ReplyStatus)
ULONG SrvGenerateConsoleCtrlEvent (IN OUT PCSR_API_MSG m, IN OUT PCSR_REPLY_STATUS ReplyStatus)
ULONG SrvSetConsoleActiveScreenBuffer (IN OUT PCSR_API_MSG m, IN OUT PCSR_REPLY_STATUS ReplyStatus)
ULONG SrvFlushConsoleInputBuffer (IN OUT PCSR_API_MSG m, IN OUT PCSR_REPLY_STATUS ReplyStatus)
ULONG SrvGetLargestConsoleWindowSize (IN OUT PCSR_API_MSG m, IN OUT PCSR_REPLY_STATUS ReplyStatus)
ULONG SrvSetConsoleScreenBufferSize (IN OUT PCSR_API_MSG m, IN OUT PCSR_REPLY_STATUS ReplyStatus)
ULONG SrvSetConsoleCursorPosition (IN OUT PCSR_API_MSG m, IN OUT PCSR_REPLY_STATUS ReplyStatus)
ULONG SrvSetConsoleCursorInfo (IN OUT PCSR_API_MSG m, IN OUT PCSR_REPLY_STATUS ReplyStatus)
ULONG SrvSetConsoleWindowInfo (IN OUT PCSR_API_MSG m, IN OUT PCSR_REPLY_STATUS ReplyStatus)
ULONG SrvScrollConsoleScreenBuffer (IN OUT PCSR_API_MSG m, IN OUT PCSR_REPLY_STATUS ReplyStatus)
VOID UpdatePopups (IN PCONSOLE_INFORMATION Console, IN WORD NewAttributes, IN WORD NewPopupAttributes, IN WORD OldAttributes, IN WORD OldPopupAttributes)
NTSTATUS SetScreenColors (IN PSCREEN_INFORMATION ScreenInfo, IN WORD Attributes, IN WORD PopupAttributes, IN BOOL UpdateWholeScreen)
ULONG SrvSetConsoleTextAttribute (IN OUT PCSR_API_MSG m, IN OUT PCSR_REPLY_STATUS ReplyStatus)
ULONG SrvSetConsoleFont (IN OUT PCSR_API_MSG m, IN OUT PCSR_REPLY_STATUS ReplyStatus)
ULONG SrvSetConsoleIcon (IN OUT PCSR_API_MSG m, IN OUT PCSR_REPLY_STATUS ReplyStatus)
ULONG SrvSetConsoleCP (IN OUT PCSR_API_MSG m, IN OUT PCSR_REPLY_STATUS ReplyStatus)
ULONG SrvGetConsoleCP (IN OUT PCSR_API_MSG m, IN OUT PCSR_REPLY_STATUS ReplyStatus)
ULONG SrvGetConsoleKeyboardLayoutName (IN OUT PCSR_API_MSG m, IN OUT PCSR_REPLY_STATUS ReplyStatus)
ULONG SrvGetConsoleWindow (IN OUT PCSR_API_MSG m, IN OUT PCSR_REPLY_STATUS ReplyStatus)


Function Documentation

NTSTATUS SetScreenColors IN PSCREEN_INFORMATION  ScreenInfo,
IN WORD  Attributes,
IN WORD  PopupAttributes,
IN BOOL  UpdateWholeScreen
 

Definition at line 1002 of file ntcon/server/getset.c.

References ACTIVE_SCREEN_BUFFER, _ATTR_PAIR::Attr, _ROW::AttrRow, _ATTR_ROW::Attrs, CONSOLE_TEXTMODE_BUFFER, ConvertAttrToRGB, _CONSOLE_INFORMATION::hDC, _CONSOLE_INFORMATION::hWnd, _CONSOLE_INFORMATION::LastAttributes, _ATTR_ROW::Length, LOBYTE, _CONSOLE_INFORMATION::PopupCount, SetConsoleBkColor, SHORT, TEXT_VALID_HINT, UpdatePopups(), and WriteToScreen.

Referenced by ConsoleWindowProc(), CreateWindowsWindow(), PropertiesUpdate(), SetActiveScreenBuffer(), and SrvSetConsoleTextAttribute().

01008 { 01009 SHORT i,j; 01010 PROW Row; 01011 WORD DefaultAttributes,DefaultPopupAttributes; 01012 PCONSOLE_INFORMATION Console; 01013 COLORREF rgbBk; 01014 COLORREF rgbText; 01015 01016 Console = ScreenInfo->Console; 01017 rgbBk = ConvertAttrToRGB(Console, LOBYTE(Attributes >> 4)); 01018 rgbBk = GetNearestColor(Console->hDC, rgbBk); 01019 rgbText = ConvertAttrToRGB(Console, LOBYTE(Attributes)); 01020 rgbText = GetNearestColor(Console->hDC, rgbText); 01021 if (ACTIVE_SCREEN_BUFFER(ScreenInfo)) { 01022 SetDCBrushColor(Console->hDC, rgbBk); 01023 SetTextColor(Console->hDC, rgbText); 01024 SetBkColor(Console->hDC, rgbBk); 01025 Console->LastAttributes = Attributes; 01026 SetConsoleBkColor(Console->hWnd, rgbBk); 01027 } 01028 01029 DefaultAttributes = ScreenInfo->Attributes; 01030 DefaultPopupAttributes = ScreenInfo->PopupAttributes; 01031 ScreenInfo->Attributes = Attributes; 01032 ScreenInfo->PopupAttributes = PopupAttributes; 01033 #if defined(FE_IME) 01034 SetUndetermineAttribute( Console ); 01035 #endif 01036 01037 if (UpdateWholeScreen && ScreenInfo->Flags & CONSOLE_TEXTMODE_BUFFER) { 01038 WORD InvertedOldPopupAttributes,InvertedNewPopupAttributes; 01039 01040 InvertedOldPopupAttributes = (WORD)(((DefaultPopupAttributes << 4) & 0xf0) | 01041 ((DefaultPopupAttributes >> 4) & 0x0f)); 01042 InvertedNewPopupAttributes = (WORD)(((PopupAttributes << 4) & 0xf0) | 01043 ((PopupAttributes >> 4) & 0x0f)); 01044 // 01045 // change all chars with default color 01046 // 01047 01048 for (i=0;i<ScreenInfo->ScreenBufferSize.Y;i++) { 01049 Row = &ScreenInfo->BufferInfo.TextInfo.Rows[i]; 01050 for (j=0;j<Row->AttrRow.Length;j++) { 01051 if (Row->AttrRow.Attrs[j].Attr == DefaultAttributes) { 01052 Row->AttrRow.Attrs[j].Attr = Attributes; 01053 } else if (Row->AttrRow.Attrs[j].Attr == DefaultPopupAttributes) { 01054 Row->AttrRow.Attrs[j].Attr = PopupAttributes; 01055 } else if (Row->AttrRow.Attrs[j].Attr == InvertedOldPopupAttributes) { 01056 Row->AttrRow.Attrs[j].Attr = InvertedNewPopupAttributes; 01057 } 01058 } 01059 } 01060 01061 if (Console->PopupCount) 01062 UpdatePopups(Console, 01063 Attributes, 01064 PopupAttributes, 01065 DefaultAttributes, 01066 DefaultPopupAttributes 01067 ); 01068 // force repaint of entire line 01069 ScreenInfo->BufferInfo.TextInfo.Flags &= ~TEXT_VALID_HINT; 01070 WriteToScreen(ScreenInfo,&ScreenInfo->Window); 01071 ScreenInfo->BufferInfo.TextInfo.Flags |= TEXT_VALID_HINT; 01072 } 01073 01074 return STATUS_SUCCESS; 01075 }

ULONG SrvFlushConsoleInputBuffer IN OUT PCSR_API_MSG  m,
IN OUT PCSR_REPLY_STATUS  ReplyStatus
 

Definition at line 524 of file ntcon/server/getset.c.

References ApiPreamble(), _HANDLE_DATA::Buffer, CONSOLE_INPUT_HANDLE, CONSOLE_PERPROCESSDATA, _CONSOLE_FLUSHINPUTBUFFER_MSG::ConsoleHandle, DereferenceIoHandle(), FlushInputBuffer(), _CONSOLE_FLUSHINPUTBUFFER_MSG::InputHandle, NT_SUCCESS, NTSTATUS(), Status, and UnlockConsole().

00528 { 00529 PCONSOLE_FLUSHINPUTBUFFER_MSG a = (PCONSOLE_FLUSHINPUTBUFFER_MSG)&m->u.ApiMessageData; 00530 NTSTATUS Status; 00531 PCONSOLE_INFORMATION Console; 00532 PHANDLE_DATA HandleData; 00533 00534 Status = ApiPreamble(a->ConsoleHandle, 00535 &Console 00536 ); 00537 if (!NT_SUCCESS(Status)) { 00538 return Status; 00539 } 00540 Status = DereferenceIoHandle(CONSOLE_PERPROCESSDATA(), 00541 a->InputHandle, 00542 CONSOLE_INPUT_HANDLE, 00543 GENERIC_WRITE, 00544 &HandleData 00545 ); 00546 if (NT_SUCCESS(Status)) { 00547 Status = FlushInputBuffer(HandleData->Buffer.InputBuffer); 00548 } 00549 UnlockConsole(Console); 00550 return((ULONG) Status); 00551 UNREFERENCED_PARAMETER(ReplyStatus); // get rid of unreferenced parameter warning message 00552 }

ULONG SrvGenerateConsoleCtrlEvent IN OUT PCSR_API_MSG  m,
IN OUT PCSR_REPLY_STATUS  ReplyStatus
 

Definition at line 444 of file ntcon/server/getset.c.

References ApiPreamble(), CONSOLE_PROCESS_HANDLE, _CONSOLE_CTRLEVENT_MSG::ConsoleHandle, _CONSOLE_CTRLEVENT_MSG::CtrlEvent, HandleCtrlEvent(), _CONSOLE_INFORMATION::LimitingProcessId, NT_SUCCESS, NTSTATUS(), PCONSOLE_PROCESS_HANDLE, _CONSOLE_PROCESS_HANDLE::Process, _CONSOLE_CTRLEVENT_MSG::ProcessGroupId, _CONSOLE_INFORMATION::ProcessHandleList, Status, and UnlockConsole().

00448 { 00449 PCONSOLE_CTRLEVENT_MSG a = (PCONSOLE_CTRLEVENT_MSG)&m->u.ApiMessageData; 00450 NTSTATUS Status; 00451 PCONSOLE_INFORMATION Console; 00452 00453 Status = ApiPreamble(a->ConsoleHandle, 00454 &Console 00455 ); 00456 if (!NT_SUCCESS(Status)) { 00457 return Status; 00458 } 00459 try { 00460 // 00461 // Make sure the process group id is valid 00462 // 00463 if (a->ProcessGroupId) { 00464 PCONSOLE_PROCESS_HANDLE ProcessHandleRecord; 00465 PLIST_ENTRY ListHead, ListNext; 00466 00467 Status = STATUS_INVALID_PARAMETER; 00468 ListHead = &Console->ProcessHandleList; 00469 ListNext = ListHead->Flink; 00470 while (ListNext != ListHead) { 00471 ProcessHandleRecord = CONTAINING_RECORD( ListNext, CONSOLE_PROCESS_HANDLE, ListLink ); 00472 ListNext = ListNext->Flink; 00473 if (ProcessHandleRecord->Process->ProcessGroupId == a->ProcessGroupId) { 00474 Status = STATUS_SUCCESS; 00475 break; 00476 } 00477 } 00478 } 00479 if (NT_SUCCESS(Status)) { 00480 Console->LimitingProcessId = a->ProcessGroupId; 00481 HandleCtrlEvent(Console, a->CtrlEvent); 00482 } 00483 00484 } finally { 00485 UnlockConsole(Console); 00486 } 00487 return Status; 00488 UNREFERENCED_PARAMETER(ReplyStatus); // get rid of unreferenced parameter warning message 00489 }

ULONG SrvGetConsoleCP IN OUT PCSR_API_MSG  m,
IN OUT PCSR_REPLY_STATUS  ReplyStatus
 

Definition at line 1359 of file ntcon/server/getset.c.

References ApiPreamble(), _CONSOLE_GETCP_MSG::ConsoleHandle, _CONSOLE_INFORMATION::CP, NT_SUCCESS, NTSTATUS(), _CONSOLE_GETCP_MSG::Output, _CONSOLE_INFORMATION::OutputCP, Status, UnlockConsole(), and _CONSOLE_GETCP_MSG::wCodePageID.

01363 { 01364 PCONSOLE_GETCP_MSG a = (PCONSOLE_GETCP_MSG)&m->u.ApiMessageData; 01365 NTSTATUS Status; 01366 PCONSOLE_INFORMATION Console; 01367 01368 Status = ApiPreamble(a->ConsoleHandle, 01369 &Console 01370 ); 01371 if (!NT_SUCCESS(Status)) { 01372 return Status; 01373 } 01374 if (a->Output) { 01375 a->wCodePageID = Console->OutputCP; 01376 } else { 01377 a->wCodePageID = Console->CP; 01378 } 01379 UnlockConsole(Console); 01380 return STATUS_SUCCESS; 01381 UNREFERENCED_PARAMETER(ReplyStatus); // get rid of unreferenced parameter warning message 01382 }

ULONG SrvGetConsoleCurrentFont IN OUT PCSR_API_MSG  m,
IN OUT PCSR_REPLY_STATUS  ReplyStatus
 

Definition at line 315 of file ntcon/server/getset.c.

References ApiPreamble(), _HANDLE_DATA::Buffer, CONSOLE_OUTPUT_HANDLE, CONSOLE_PERPROCESSDATA, _CONSOLE_GETCURRENTFONT_MSG::ConsoleHandle, DereferenceIoHandle(), _CONSOLE_GETCURRENTFONT_MSG::FontIndex, _CONSOLE_GETCURRENTFONT_MSG::FontSize, GetCurrentFont(), _CONSOLE_GETCURRENTFONT_MSG::MaximumWindow, NT_SUCCESS, NTSTATUS(), _CONSOLE_GETCURRENTFONT_MSG::OutputHandle, Status, and UnlockConsole().

00319 { 00320 PCONSOLE_GETCURRENTFONT_MSG a = (PCONSOLE_GETCURRENTFONT_MSG)&m->u.ApiMessageData; 00321 NTSTATUS Status; 00322 PCONSOLE_INFORMATION Console; 00323 PHANDLE_DATA HandleData; 00324 00325 Status = ApiPreamble(a->ConsoleHandle, 00326 &Console 00327 ); 00328 if (!NT_SUCCESS(Status)) { 00329 return Status; 00330 } 00331 Status = DereferenceIoHandle(CONSOLE_PERPROCESSDATA(), 00332 a->OutputHandle, 00333 CONSOLE_OUTPUT_HANDLE, 00334 GENERIC_READ, 00335 &HandleData 00336 ); 00337 if (NT_SUCCESS(Status)) { 00338 if (HandleData->Buffer.ScreenBuffer->Console->FullScreenFlags & CONSOLE_FULLSCREEN) { 00339 Status = STATUS_FULLSCREEN_MODE; 00340 } else { 00341 Status = GetCurrentFont(HandleData->Buffer.ScreenBuffer, 00342 a->MaximumWindow, 00343 &a->FontIndex, 00344 &a->FontSize 00345 ); 00346 } 00347 } 00348 UnlockConsole(Console); 00349 return((ULONG) Status); 00350 UNREFERENCED_PARAMETER(ReplyStatus); // get rid of unreferenced parameter warning message 00351 }

ULONG SrvGetConsoleCursorInfo IN OUT PCSR_API_MSG  m,
IN OUT PCSR_REPLY_STATUS  ReplyStatus
 

Definition at line 179 of file ntcon/server/getset.c.

References ApiPreamble(), _HANDLE_DATA::Buffer, CONSOLE_OUTPUT_HANDLE, CONSOLE_PERPROCESSDATA, _CONSOLE_GETCURSORINFO_MSG::ConsoleHandle, _CONSOLE_GETCURSORINFO_MSG::CursorSize, DereferenceIoHandle(), NT_SUCCESS, NTSTATUS(), _CONSOLE_GETCURSORINFO_MSG::OutputHandle, Status, UnlockConsole(), and _CONSOLE_GETCURSORINFO_MSG::Visible.

00183 { 00184 PCONSOLE_GETCURSORINFO_MSG a = (PCONSOLE_GETCURSORINFO_MSG)&m->u.ApiMessageData; 00185 NTSTATUS Status; 00186 PCONSOLE_INFORMATION Console; 00187 PHANDLE_DATA HandleData; 00188 00189 Status = ApiPreamble(a->ConsoleHandle, 00190 &Console 00191 ); 00192 if (!NT_SUCCESS(Status)) { 00193 return Status; 00194 } 00195 Status = DereferenceIoHandle(CONSOLE_PERPROCESSDATA(), 00196 a->OutputHandle, 00197 CONSOLE_OUTPUT_HANDLE, 00198 GENERIC_READ, 00199 &HandleData 00200 ); 00201 if (NT_SUCCESS(Status)) { 00202 a->CursorSize = HandleData->Buffer.ScreenBuffer->BufferInfo.TextInfo.CursorSize; 00203 a->Visible = (BOOLEAN) HandleData->Buffer.ScreenBuffer->BufferInfo.TextInfo.CursorVisible; 00204 } 00205 UnlockConsole(Console); 00206 return((ULONG) Status); 00207 UNREFERENCED_PARAMETER(ReplyStatus); // get rid of unreferenced parameter warning message 00208 }

ULONG SrvGetConsoleFontInfo IN OUT PCSR_API_MSG  m,
IN OUT PCSR_REPLY_STATUS  ReplyStatus
 

Definition at line 233 of file ntcon/server/getset.c.

References ApiPreamble(), _HANDLE_DATA::Buffer, _CONSOLE_GETFONTINFO_MSG::BufPtr, CONSOLE_OUTPUT_HANDLE, CONSOLE_PERPROCESSDATA, _CONSOLE_GETFONTINFO_MSG::ConsoleHandle, DereferenceIoHandle(), GetAvailableFonts(), _CONSOLE_GETFONTINFO_MSG::MaximumWindow, NT_SUCCESS, NTSTATUS(), _CONSOLE_GETFONTINFO_MSG::NumFonts, _CONSOLE_GETFONTINFO_MSG::OutputHandle, Status, and UnlockConsole().

00237 { 00238 PCONSOLE_GETFONTINFO_MSG a = (PCONSOLE_GETFONTINFO_MSG)&m->u.ApiMessageData; 00239 NTSTATUS Status; 00240 PCONSOLE_INFORMATION Console; 00241 PHANDLE_DATA HandleData; 00242 00243 Status = ApiPreamble(a->ConsoleHandle, 00244 &Console 00245 ); 00246 if (!NT_SUCCESS(Status)) { 00247 return Status; 00248 } 00249 00250 if (!CsrValidateMessageBuffer(m, &a->BufPtr, a->NumFonts, sizeof(*a->BufPtr))) { 00251 UnlockConsole(Console); 00252 return STATUS_INVALID_PARAMETER; 00253 } 00254 00255 Status = DereferenceIoHandle(CONSOLE_PERPROCESSDATA(), 00256 a->OutputHandle, 00257 CONSOLE_OUTPUT_HANDLE, 00258 GENERIC_READ, 00259 &HandleData 00260 ); 00261 if (NT_SUCCESS(Status)) { 00262 if (HandleData->Buffer.ScreenBuffer->Console->FullScreenFlags & CONSOLE_FULLSCREEN) { 00263 Status = STATUS_FULLSCREEN_MODE; 00264 } else { 00265 Status = GetAvailableFonts(HandleData->Buffer.ScreenBuffer, 00266 a->MaximumWindow, 00267 a->BufPtr, 00268 &a->NumFonts 00269 ); 00270 } 00271 } 00272 UnlockConsole(Console); 00273 return((ULONG) Status); 00274 UNREFERENCED_PARAMETER(ReplyStatus); // get rid of unreferenced parameter warning message 00275 }

ULONG SrvGetConsoleFontSize IN OUT PCSR_API_MSG  m,
IN OUT PCSR_REPLY_STATUS  ReplyStatus
 

Definition at line 278 of file ntcon/server/getset.c.

References ApiPreamble(), _HANDLE_DATA::Buffer, CONSOLE_OUTPUT_HANDLE, CONSOLE_PERPROCESSDATA, _CONSOLE_GETFONTSIZE_MSG::ConsoleHandle, DereferenceIoHandle(), _CONSOLE_GETFONTSIZE_MSG::FontIndex, _CONSOLE_GETFONTSIZE_MSG::FontSize, GetFontSize(), NT_SUCCESS, NTSTATUS(), _CONSOLE_GETFONTSIZE_MSG::OutputHandle, Status, and UnlockConsole().

00282 { 00283 PCONSOLE_GETFONTSIZE_MSG a = (PCONSOLE_GETFONTSIZE_MSG)&m->u.ApiMessageData; 00284 NTSTATUS Status; 00285 PCONSOLE_INFORMATION Console; 00286 PHANDLE_DATA HandleData; 00287 00288 Status = ApiPreamble(a->ConsoleHandle, 00289 &Console 00290 ); 00291 if (!NT_SUCCESS(Status)) { 00292 return Status; 00293 } 00294 Status = DereferenceIoHandle(CONSOLE_PERPROCESSDATA(), 00295 a->OutputHandle, 00296 CONSOLE_OUTPUT_HANDLE, 00297 GENERIC_READ, 00298 &HandleData 00299 ); 00300 if (NT_SUCCESS(Status)) { 00301 if (HandleData->Buffer.ScreenBuffer->Console->FullScreenFlags & CONSOLE_FULLSCREEN) { 00302 Status = STATUS_FULLSCREEN_MODE; 00303 } else { 00304 Status = GetFontSize(a->FontIndex, 00305 &a->FontSize 00306 ); 00307 } 00308 } 00309 UnlockConsole(Console); 00310 return((ULONG) Status); 00311 UNREFERENCED_PARAMETER(ReplyStatus); // get rid of unreferenced parameter warning message 00312 }

ULONG SrvGetConsoleKeyboardLayoutName IN OUT PCSR_API_MSG  m,
IN OUT PCSR_REPLY_STATUS  ReplyStatus
 

Definition at line 1385 of file ntcon/server/getset.c.

References _CONSOLE_GETKEYBOARDLAYOUTNAME_MSG::achLayout, ActivateKeyboardLayout, ApiPreamble(), _CONSOLE_GETKEYBOARDLAYOUTNAME_MSG::awchLayout, _CONSOLE_GETKEYBOARDLAYOUTNAME_MSG::bAnsi, _CONSOLE_GETKEYBOARDLAYOUTNAME_MSG::ConsoleHandle, FALSE, GetNonBiDiKeyboardLayout(), _CONSOLE_INFORMATION::hklActive, NT_SUCCESS, NTSTATUS(), NULL, Status, SystemParametersInfo(), and UnlockConsole().

01389 { 01390 PCONSOLE_GETKEYBOARDLAYOUTNAME_MSG a = (PCONSOLE_GETKEYBOARDLAYOUTNAME_MSG)&m->u.ApiMessageData; 01391 NTSTATUS Status; 01392 PCONSOLE_INFORMATION Console; 01393 01394 Status = ApiPreamble(a->ConsoleHandle, 01395 &Console 01396 ); 01397 if (!NT_SUCCESS(Status)) { 01398 return Status; 01399 } 01400 if (Console->hklActive == NULL) { 01401 // 01402 // hklActive is not set yet. Let's initialize it here. 01403 // 01404 extern void GetNonBiDiKeyboardLayout(HKL * phklActive); 01405 01406 RIPMSG1(RIP_WARNING, "SrvGetConsoleKeyboardLayoutName: hklActive is not initialized. pCon=%p", Console); 01407 01408 SystemParametersInfo(SPI_GETDEFAULTINPUTLANG, 0, &Console->hklActive, FALSE); 01409 GetNonBiDiKeyboardLayout(&Console->hklActive); 01410 } 01411 ActivateKeyboardLayout(Console->hklActive, 0); 01412 if (a->bAnsi) { 01413 GetKeyboardLayoutNameA(a->achLayout); 01414 } else { 01415 GetKeyboardLayoutNameW(a->awchLayout); 01416 } 01417 UnlockConsole(Console); 01418 return STATUS_SUCCESS; 01419 UNREFERENCED_PARAMETER(ReplyStatus); // get rid of unreferenced parameter warning message 01420 }

ULONG SrvGetConsoleMode IN OUT PCSR_API_MSG  m,
IN OUT PCSR_REPLY_STATUS  ReplyStatus
 

Definition at line 33 of file ntcon/server/getset.c.

References ApiPreamble(), _HANDLE_DATA::Buffer, CONSOLE_ANY_HANDLE, CONSOLE_INPUT_HANDLE, CONSOLE_PERPROCESSDATA, CONSOLE_QUICK_EDIT_MODE, CONSOLE_USE_PRIVATE_FLAGS, _CONSOLE_MODE_MSG::ConsoleHandle, DereferenceIoHandle(), _CONSOLE_INFORMATION::Flags, _CONSOLE_MODE_MSG::Handle, _HANDLE_DATA::HandleType, _CONSOLE_INFORMATION::InsertMode, _CONSOLE_MODE_MSG::Mode, NT_SUCCESS, NTSTATUS(), Status, and UnlockConsole().

00037 { 00038 PCONSOLE_MODE_MSG a = (PCONSOLE_MODE_MSG)&m->u.ApiMessageData; 00039 NTSTATUS Status; 00040 PCONSOLE_INFORMATION Console; 00041 PHANDLE_DATA HandleData; 00042 00043 Status = ApiPreamble(a->ConsoleHandle, 00044 &Console 00045 ); 00046 if (!NT_SUCCESS(Status)) { 00047 return Status; 00048 } 00049 Status = DereferenceIoHandle(CONSOLE_PERPROCESSDATA(), 00050 a->Handle, 00051 CONSOLE_ANY_HANDLE, 00052 GENERIC_READ, 00053 &HandleData 00054 ); 00055 if (NT_SUCCESS(Status)) { 00056 00057 // 00058 // check handle type and access 00059 // 00060 00061 if (HandleData->HandleType & CONSOLE_INPUT_HANDLE) { 00062 a->Mode = HandleData->Buffer.InputBuffer->InputMode; 00063 if (Console->Flags & CONSOLE_USE_PRIVATE_FLAGS) { 00064 a->Mode |= ENABLE_PRIVATE_FLAGS; 00065 if (Console->InsertMode) { 00066 a->Mode |= ENABLE_INSERT_MODE; 00067 } 00068 if (Console->Flags & CONSOLE_QUICK_EDIT_MODE) { 00069 a->Mode |= ENABLE_QUICK_EDIT_MODE; 00070 } 00071 } 00072 } else { 00073 a->Mode = HandleData->Buffer.ScreenBuffer->OutputMode; 00074 } 00075 } 00076 UnlockConsole(Console); 00077 return((ULONG) Status); 00078 UNREFERENCED_PARAMETER(ReplyStatus); // get rid of unreferenced parameter warning message 00079 }

ULONG SrvGetConsoleMouseInfo IN OUT PCSR_API_MSG  m,
IN OUT PCSR_REPLY_STATUS  ReplyStatus
 

Definition at line 211 of file ntcon/server/getset.c.

References ApiPreamble(), _CONSOLE_GETMOUSEINFO_MSG::ConsoleHandle, GetMouseButtons(), NT_SUCCESS, NTSTATUS(), _CONSOLE_GETMOUSEINFO_MSG::NumButtons, Status, and UnlockConsole().

00215 { 00216 PCONSOLE_GETMOUSEINFO_MSG a = (PCONSOLE_GETMOUSEINFO_MSG)&m->u.ApiMessageData; 00217 NTSTATUS Status; 00218 PCONSOLE_INFORMATION Console; 00219 00220 Status = ApiPreamble(a->ConsoleHandle, 00221 &Console 00222 ); 00223 if (!NT_SUCCESS(Status)) { 00224 return Status; 00225 } 00226 Status = GetMouseButtons(&a->NumButtons); 00227 UnlockConsole(Console); 00228 return Status; 00229 UNREFERENCED_PARAMETER(ReplyStatus); // get rid of unreferenced parameter warning message 00230 }

ULONG SrvGetConsoleNumberOfFonts IN OUT PCSR_API_MSG  m,
IN OUT PCSR_REPLY_STATUS  ReplyStatus
 

Definition at line 82 of file ntcon/server/getset.c.

References ApiPreamble(), _CONSOLE_GETNUMBEROFFONTS_MSG::ConsoleHandle, _CONSOLE_INFORMATION::FullScreenFlags, GetNumFonts(), NT_SUCCESS, NTSTATUS(), _CONSOLE_GETNUMBEROFFONTS_MSG::NumberOfFonts, Status, and UnlockConsole().

00086 { 00087 PCONSOLE_GETNUMBEROFFONTS_MSG a = (PCONSOLE_GETNUMBEROFFONTS_MSG)&m->u.ApiMessageData; 00088 NTSTATUS Status; 00089 PCONSOLE_INFORMATION Console; 00090 00091 Status = ApiPreamble(a->ConsoleHandle, 00092 &Console 00093 ); 00094 if (!NT_SUCCESS(Status)) { 00095 return Status; 00096 } 00097 if (Console->FullScreenFlags & CONSOLE_FULLSCREEN) { 00098 Status = STATUS_FULLSCREEN_MODE; 00099 } else { 00100 Status = GetNumFonts(&a->NumberOfFonts); 00101 } 00102 UnlockConsole(Console); 00103 return Status; 00104 UNREFERENCED_PARAMETER(ReplyStatus); // get rid of unreferenced parameter warning message 00105 }

ULONG SrvGetConsoleNumberOfInputEvents IN OUT PCSR_API_MSG  m,
IN OUT PCSR_REPLY_STATUS  ReplyStatus
 

Definition at line 108 of file ntcon/server/getset.c.

References ApiPreamble(), _HANDLE_DATA::Buffer, CONSOLE_INPUT_HANDLE, CONSOLE_PERPROCESSDATA, _CONSOLE_GETNUMBEROFINPUTEVENTS_MSG::ConsoleHandle, DereferenceIoHandle(), GetNumberOfReadyEvents(), _CONSOLE_GETNUMBEROFINPUTEVENTS_MSG::InputHandle, NT_SUCCESS, NTSTATUS(), _CONSOLE_GETNUMBEROFINPUTEVENTS_MSG::ReadyEvents, Status, and UnlockConsole().

00112 { 00113 PCONSOLE_GETNUMBEROFINPUTEVENTS_MSG a = (PCONSOLE_GETNUMBEROFINPUTEVENTS_MSG)&m->u.ApiMessageData; 00114 NTSTATUS Status; 00115 PCONSOLE_INFORMATION Console; 00116 PHANDLE_DATA HandleData; 00117 00118 Status = ApiPreamble(a->ConsoleHandle, 00119 &Console 00120 ); 00121 if (!NT_SUCCESS(Status)) { 00122 return Status; 00123 } 00124 Status = DereferenceIoHandle(CONSOLE_PERPROCESSDATA(), 00125 a->InputHandle, 00126 CONSOLE_INPUT_HANDLE, 00127 GENERIC_READ, 00128 &HandleData 00129 ); 00130 if (NT_SUCCESS(Status)) { 00131 Status = GetNumberOfReadyEvents(HandleData->Buffer.InputBuffer, 00132 &a->ReadyEvents 00133 ); 00134 } 00135 UnlockConsole(Console); 00136 return((ULONG) Status); 00137 UNREFERENCED_PARAMETER(ReplyStatus); // get rid of unreferenced parameter warning message 00138 }

ULONG SrvGetConsoleScreenBufferInfo IN OUT PCSR_API_MSG  m,
IN OUT PCSR_REPLY_STATUS  ReplyStatus
 

Definition at line 141 of file ntcon/server/getset.c.

References ApiPreamble(), _CONSOLE_GETSCREENBUFFERINFO_MSG::Attributes, _HANDLE_DATA::Buffer, CONSOLE_OUTPUT_HANDLE, CONSOLE_PERPROCESSDATA, _CONSOLE_GETSCREENBUFFERINFO_MSG::ConsoleHandle, _CONSOLE_GETSCREENBUFFERINFO_MSG::CurrentWindowSize, _CONSOLE_GETSCREENBUFFERINFO_MSG::CursorPosition, DereferenceIoHandle(), GetScreenBufferInformation(), _CONSOLE_GETSCREENBUFFERINFO_MSG::MaximumWindowSize, NT_SUCCESS, NTSTATUS(), _CONSOLE_GETSCREENBUFFERINFO_MSG::OutputHandle, _CONSOLE_GETSCREENBUFFERINFO_MSG::ScrollPosition, _CONSOLE_GETSCREENBUFFERINFO_MSG::Size, Status, and UnlockConsole().

00145 { 00146 PCONSOLE_GETSCREENBUFFERINFO_MSG a = (PCONSOLE_GETSCREENBUFFERINFO_MSG)&m->u.ApiMessageData; 00147 NTSTATUS Status; 00148 PCONSOLE_INFORMATION Console; 00149 PHANDLE_DATA HandleData; 00150 00151 Status = ApiPreamble(a->ConsoleHandle, 00152 &Console 00153 ); 00154 if (!NT_SUCCESS(Status)) { 00155 return Status; 00156 } 00157 Status = DereferenceIoHandle(CONSOLE_PERPROCESSDATA(), 00158 a->OutputHandle, 00159 CONSOLE_OUTPUT_HANDLE, 00160 GENERIC_READ, 00161 &HandleData 00162 ); 00163 if (NT_SUCCESS(Status)) { 00164 Status = GetScreenBufferInformation(HandleData->Buffer.ScreenBuffer, 00165 &a->Size, 00166 &a->CursorPosition, 00167 &a->ScrollPosition, 00168 &a->Attributes, 00169 &a->CurrentWindowSize, 00170 &a->MaximumWindowSize 00171 ); 00172 } 00173 UnlockConsole(Console); 00174 return((ULONG) Status); 00175 UNREFERENCED_PARAMETER(ReplyStatus); // get rid of unreferenced parameter warning message 00176 }

ULONG SrvGetConsoleWindow IN OUT PCSR_API_MSG  m,
IN OUT PCSR_REPLY_STATUS  ReplyStatus
 

Definition at line 1424 of file ntcon/server/getset.c.

References ApiPreamble(), _CONSOLE_GETCONSOLEWINDOW_MSG::ConsoleHandle, _CONSOLE_INFORMATION::hWnd, _CONSOLE_GETCONSOLEWINDOW_MSG::hwnd, NT_SUCCESS, NTSTATUS(), Status, and UnlockConsole().

01428 { 01429 PCONSOLE_GETCONSOLEWINDOW_MSG a = (PCONSOLE_GETCONSOLEWINDOW_MSG)&m->u.ApiMessageData; 01430 NTSTATUS Status; 01431 PCONSOLE_INFORMATION Console; 01432 01433 Status = ApiPreamble(a->ConsoleHandle, 01434 &Console 01435 ); 01436 if (!NT_SUCCESS(Status)) { 01437 return Status; 01438 } 01439 01440 a->hwnd = Console->hWnd; 01441 01442 UnlockConsole(Console); 01443 return STATUS_SUCCESS; 01444 UNREFERENCED_PARAMETER(ReplyStatus); // get rid of unreferenced parameter warning message 01445 }

ULONG SrvGetLargestConsoleWindowSize IN OUT PCSR_API_MSG  m,
IN OUT PCSR_REPLY_STATUS  ReplyStatus
 

Definition at line 555 of file ntcon/server/getset.c.

References ApiPreamble(), _HANDLE_DATA::Buffer, _SCREEN_INFORMATION::Console, CONSOLE_OUTPUT_HANDLE, CONSOLE_PERPROCESSDATA, CONSOLE_TEXTMODE_BUFFER, _CONSOLE_GETLARGESTWINDOWSIZE_MSG::ConsoleHandle, DereferenceIoHandle(), _SCREEN_INFORMATION::Flags, _CONSOLE_INFORMATION::FullScreenFlags, _WINDOW_LIMITS::FullScreenSize, GetWindowLimits(), NT_SUCCESS, NTSTATUS(), _CONSOLE_GETLARGESTWINDOWSIZE_MSG::OutputHandle, SCR_FONTSIZE(), SHORT, _CONSOLE_GETLARGESTWINDOWSIZE_MSG::Size, Status, UnlockConsole(), and WINDOW_LIMITS.

00559 { 00560 PCONSOLE_GETLARGESTWINDOWSIZE_MSG a = (PCONSOLE_GETLARGESTWINDOWSIZE_MSG)&m->u.ApiMessageData; 00561 NTSTATUS Status; 00562 PCONSOLE_INFORMATION Console; 00563 PHANDLE_DATA HandleData; 00564 PSCREEN_INFORMATION ScreenInfo; 00565 WINDOW_LIMITS WindowLimits; 00566 00567 Status = ApiPreamble(a->ConsoleHandle, 00568 &Console 00569 ); 00570 if (!NT_SUCCESS(Status)) { 00571 return Status; 00572 } 00573 Status = DereferenceIoHandle(CONSOLE_PERPROCESSDATA(), 00574 a->OutputHandle, 00575 CONSOLE_OUTPUT_HANDLE, 00576 GENERIC_WRITE, 00577 &HandleData 00578 ); 00579 if (NT_SUCCESS(Status)) { 00580 COORD FontSize; 00581 00582 ScreenInfo = HandleData->Buffer.ScreenBuffer; 00583 if (ScreenInfo->Console->FullScreenFlags & CONSOLE_FULLSCREEN_HARDWARE) { 00584 a->Size.X = 80; 00585 #if defined(FE_SB) 00586 a->Size.Y = CONSOLE_IS_DBCS_OUTPUTCP(Console)?25:50; 00587 #else 00588 a->Size.Y = 50; 00589 #endif 00590 } else { 00591 if (ScreenInfo->Flags & CONSOLE_TEXTMODE_BUFFER) { 00592 FontSize = SCR_FONTSIZE(ScreenInfo); 00593 } else { 00594 FontSize.X = 1; 00595 FontSize.Y = 1; 00596 } 00597 GetWindowLimits(ScreenInfo, &WindowLimits); 00598 a->Size.X = (SHORT)(WindowLimits.FullScreenSize.X / FontSize.X); 00599 a->Size.Y = (SHORT)(WindowLimits.FullScreenSize.Y / FontSize.Y); 00600 } 00601 } 00602 UnlockConsole(Console); 00603 return((ULONG) Status); 00604 UNREFERENCED_PARAMETER(ReplyStatus); // get rid of unreferenced parameter warning message 00605 }

ULONG SrvScrollConsoleScreenBuffer IN OUT PCSR_API_MSG  m,
IN OUT PCSR_REPLY_STATUS  ReplyStatus
 

Definition at line 882 of file ntcon/server/getset.c.

References ApiPreamble(), _HANDLE_DATA::Buffer, CharToWchar(), _CONSOLE_SCROLLSCREENBUFFER_MSG::Clip, _CONSOLE_SCROLLSCREENBUFFER_MSG::ClipRectangle, CONSOLE_OEMFONT_DISPLAY, CONSOLE_OUTPUT_HANDLE, CONSOLE_PERPROCESSDATA, _CONSOLE_SCROLLSCREENBUFFER_MSG::ConsoleHandle, _CONSOLE_INFORMATION::CurrentScreenBuffer, DereferenceIoHandle(), _CONSOLE_SCROLLSCREENBUFFER_MSG::DestinationOrigin, _CONSOLE_SCROLLSCREENBUFFER_MSG::Fill, _SCREEN_INFORMATION::Flags, _CONSOLE_INFORMATION::FullScreenFlags, NT_SUCCESS, NTSTATUS(), NULL, _CONSOLE_INFORMATION::OutputCP, _CONSOLE_SCROLLSCREENBUFFER_MSG::OutputHandle, RealUnicodeToFalseUnicode(), _CONSOLE_SCROLLSCREENBUFFER_MSG::ScrollRectangle, ScrollRegion(), Status, _CONSOLE_SCROLLSCREENBUFFER_MSG::Unicode, and UnlockConsole().

00886 { 00887 PCONSOLE_SCROLLSCREENBUFFER_MSG a = (PCONSOLE_SCROLLSCREENBUFFER_MSG)&m->u.ApiMessageData; 00888 NTSTATUS Status; 00889 PCONSOLE_INFORMATION Console; 00890 PHANDLE_DATA HandleData; 00891 PSMALL_RECT ClipRect; 00892 00893 Status = ApiPreamble(a->ConsoleHandle, 00894 &Console 00895 ); 00896 if (!NT_SUCCESS(Status)) { 00897 return Status; 00898 } 00899 Status = DereferenceIoHandle(CONSOLE_PERPROCESSDATA(), 00900 a->OutputHandle, 00901 CONSOLE_OUTPUT_HANDLE, 00902 GENERIC_WRITE, 00903 &HandleData 00904 ); 00905 if (NT_SUCCESS(Status)) { 00906 00907 if (a->Clip) { 00908 ClipRect = &a->ClipRectangle; 00909 } 00910 else { 00911 ClipRect = NULL; 00912 } 00913 if (!a->Unicode) { 00914 #if defined(FE_SB) 00915 a->Fill.Char.UnicodeChar = CharToWchar(Console, 00916 Console->OutputCP, 00917 &a->Fill.Char.AsciiChar); 00918 #else 00919 a->Fill.Char.UnicodeChar = CharToWchar( 00920 Console->OutputCP, a->Fill.Char.AsciiChar); 00921 #endif 00922 } else if ((Console->CurrentScreenBuffer->Flags & CONSOLE_OEMFONT_DISPLAY) && 00923 !(Console->FullScreenFlags & CONSOLE_FULLSCREEN)) { 00924 RealUnicodeToFalseUnicode(&a->Fill.Char.UnicodeChar, 00925 1, 00926 Console->OutputCP 00927 ); 00928 } 00929 Status = ScrollRegion(HandleData->Buffer.ScreenBuffer, 00930 &a->ScrollRectangle, 00931 ClipRect, 00932 a->DestinationOrigin, 00933 a->Fill 00934 ); 00935 } 00936 UnlockConsole(Console); 00937 return((ULONG) Status); 00938 UNREFERENCED_PARAMETER(ReplyStatus); // get rid of unreferenced parameter warning message 00939 }

ULONG SrvSetConsoleActiveScreenBuffer IN OUT PCSR_API_MSG  m,
IN OUT PCSR_REPLY_STATUS  ReplyStatus
 

Definition at line 492 of file ntcon/server/getset.c.

References ApiPreamble(), _HANDLE_DATA::Buffer, CONSOLE_GRAPHICS_OUTPUT_HANDLE, CONSOLE_OUTPUT_HANDLE, CONSOLE_PERPROCESSDATA, _CONSOLE_SETACTIVESCREENBUFFER_MSG::ConsoleHandle, DereferenceIoHandle(), NT_SUCCESS, NTSTATUS(), _CONSOLE_SETACTIVESCREENBUFFER_MSG::OutputHandle, SetActiveScreenBuffer(), Status, and UnlockConsole().

00496 { 00497 PCONSOLE_SETACTIVESCREENBUFFER_MSG a = (PCONSOLE_SETACTIVESCREENBUFFER_MSG)&m->u.ApiMessageData; 00498 NTSTATUS Status; 00499 PCONSOLE_INFORMATION Console; 00500 PHANDLE_DATA HandleData; 00501 00502 Status = ApiPreamble(a->ConsoleHandle, 00503 &Console 00504 ); 00505 if (!NT_SUCCESS(Status)) { 00506 return Status; 00507 } 00508 Status = DereferenceIoHandle(CONSOLE_PERPROCESSDATA(), 00509 a->OutputHandle, 00510 CONSOLE_GRAPHICS_OUTPUT_HANDLE | CONSOLE_OUTPUT_HANDLE, 00511 GENERIC_WRITE, 00512 &HandleData 00513 ); 00514 if (NT_SUCCESS(Status)) { 00515 Status = SetActiveScreenBuffer(HandleData->Buffer.ScreenBuffer); 00516 } 00517 UnlockConsole(Console); 00518 return((ULONG) Status); 00519 UNREFERENCED_PARAMETER(ReplyStatus); // get rid of unreferenced parameter warning message 00520 }

ULONG SrvSetConsoleCP IN OUT PCSR_API_MSG  m,
IN OUT PCSR_REPLY_STATUS  ReplyStatus
 

Definition at line 1229 of file ntcon/server/getset.c.

References ApiPreamble(), _SCREEN_INFORMATION::BufferInfo, CONSOLE_CLIENTPROCESSHANDLE, CONSOLE_IS_DBCS_ENABLED, _CONSOLE_SETCP_MSG::ConsoleHandle, _CONSOLE_INFORMATION::CP, _CONSOLE_INFORMATION::CurrentScreenBuffer, FALSE, _CONSOLE_INFORMATION::FullScreenFlags, IsAvailableFarEastCodePage(), NT_SUCCESS, NtClose(), NtDuplicateObject(), NtSetEvent(), NTSTATUS(), NULL, OEMCP, _CONSOLE_SETCP_MSG::Output, _CONSOLE_INFORMATION::OutputCP, QueueConsoleMessage(), ReCreateDbcsScreenBuffer(), Status, UINT, UnlockConsole(), _CONSOLE_SETCP_MSG::wCodePageID, and _SCREEN_INFORMATION::Window.

01233 { 01234 PCONSOLE_SETCP_MSG a = (PCONSOLE_SETCP_MSG)&m->u.ApiMessageData; 01235 NTSTATUS Status; 01236 PCONSOLE_INFORMATION Console; 01237 HANDLE hEvent = NULL; 01238 01239 Status = ApiPreamble(a->ConsoleHandle, 01240 &Console 01241 ); 01242 if (!NT_SUCCESS(Status)) { 01243 return Status; 01244 } 01245 if (a->hEvent) { 01246 Status = NtDuplicateObject(CONSOLE_CLIENTPROCESSHANDLE(), 01247 a->hEvent, 01248 NtCurrentProcess(), 01249 &hEvent, 01250 0, 01251 FALSE, 01252 DUPLICATE_SAME_ACCESS 01253 ); 01254 if (!NT_SUCCESS(Status)) { 01255 goto SrvSetConsoleCPFailure; 01256 } 01257 } 01258 01259 if (!IsValidCodePage(a->wCodePageID)) { 01260 Status = STATUS_INVALID_PARAMETER; 01261 goto SrvSetConsoleCPFailure; 01262 } 01263 if ( IsAvailableFarEastCodePage( a->wCodePageID ) && 01264 OEMCP != a->wCodePageID ) 01265 { 01266 Status = STATUS_INVALID_PARAMETER; 01267 goto SrvSetConsoleCPFailure; 01268 } 01269 01270 if ( (a->Output && Console->OutputCP != a->wCodePageID) || 01271 (!a->Output && Console->CP != a->wCodePageID) ) { 01272 01273 UINT CodePage; 01274 01275 if (a->Output) { 01276 01277 // Backup old code page 01278 CodePage = Console->OutputCP; 01279 01280 // Set new code page 01281 Console->OutputCP = a->wCodePageID; 01282 01283 Console->fIsDBCSOutputCP = CONSOLE_IS_DBCS_ENABLED() && IsAvailableFarEastCodePage(Console->OutputCP); 01284 01285 if (!ReCreateDbcsScreenBuffer(Console, CodePage) ) { 01286 RIPMSG1(RIP_WARNING, "SrvSetConsoleCP: ReCreateDbcsScreenBuffer failed. Restoring to CP=%d", 01287 CodePage); 01288 Console->OutputCP = CodePage; 01289 Console->fIsDBCSOutputCP = CONSOLE_IS_DBCS_ENABLED() && IsAvailableFarEastCodePage(CodePage); 01290 Status = STATUS_NO_MEMORY; 01291 goto SrvSetConsoleCPFailure; 01292 } 01293 SetConsoleCPInfo(Console,a->Output); 01294 Status = QueueConsoleMessage(Console, 01295 CM_SET_IME_CODEPAGE, 01296 (WPARAM)hEvent, 01297 MAKELPARAM(a->Output,CodePage) 01298 ); 01299 if (!NT_SUCCESS(Status)) { 01300 goto SrvSetConsoleCPFailure; 01301 } 01302 01303 // load special ROM font, if necessary 01304 01305 #ifdef i386 01306 01307 if (Console->FullScreenFlags & CONSOLE_FULLSCREEN_HARDWARE) { 01308 SetROMFontCodePage(Console->OutputCP, 01309 Console->CurrentScreenBuffer->BufferInfo.TextInfo.ModeIndex); 01310 WriteRegionToScreenHW(Console->CurrentScreenBuffer, 01311 &Console->CurrentScreenBuffer->Window); 01312 } 01313 #endif 01314 01315 01316 } else { 01317 01318 // Backup old code page 01319 CodePage = Console->CP; 01320 01321 // Set new code page 01322 Console->CP = a->wCodePageID; 01323 01324 Console->fIsDBCSCP = CONSOLE_IS_DBCS_ENABLED() && IsAvailableFarEastCodePage(Console->CP); 01325 01326 SetConsoleCPInfo(Console,a->Output); 01327 Status = QueueConsoleMessage(Console, 01328 CM_SET_IME_CODEPAGE, 01329 (WPARAM)hEvent, 01330 MAKELPARAM(a->Output,CodePage) 01331 ); 01332 if (!NT_SUCCESS(Status)) { 01333 goto SrvSetConsoleCPFailure; 01334 } 01335 } 01336 } 01337 else { 01338 if (hEvent) { 01339 NtSetEvent(hEvent, NULL); 01340 NtClose(hEvent); 01341 } 01342 } 01343 01344 UnlockConsole(Console); 01345 return STATUS_SUCCESS; 01346 01347 SrvSetConsoleCPFailure: 01348 if (hEvent) { 01349 NtSetEvent(hEvent, NULL); 01350 NtClose(hEvent); 01351 } 01352 UnlockConsole(Console); 01353 return Status; 01354 01355 UNREFERENCED_PARAMETER(ReplyStatus); // get rid of unreferenced parameter warning message 01356 }

ULONG SrvSetConsoleCursorInfo IN OUT PCSR_API_MSG  m,
IN OUT PCSR_REPLY_STATUS  ReplyStatus
 

Definition at line 738 of file ntcon/server/getset.c.

References ApiPreamble(), _HANDLE_DATA::Buffer, CONSOLE_OUTPUT_HANDLE, CONSOLE_PERPROCESSDATA, _CONSOLE_SETCURSORINFO_MSG::ConsoleHandle, _CONSOLE_SETCURSORINFO_MSG::CursorSize, DereferenceIoHandle(), NT_SUCCESS, NTSTATUS(), _CONSOLE_SETCURSORINFO_MSG::OutputHandle, SetCursorInformation(), Status, UnlockConsole(), and _CONSOLE_SETCURSORINFO_MSG::Visible.

00742 { 00743 PCONSOLE_SETCURSORINFO_MSG a = (PCONSOLE_SETCURSORINFO_MSG)&m->u.ApiMessageData; 00744 NTSTATUS Status; 00745 PCONSOLE_INFORMATION Console; 00746 PHANDLE_DATA HandleData; 00747 00748 Status = ApiPreamble(a->ConsoleHandle, 00749 &Console 00750 ); 00751 if (!NT_SUCCESS(Status)) { 00752 return Status; 00753 } 00754 Status = DereferenceIoHandle(CONSOLE_PERPROCESSDATA(), 00755 a->OutputHandle, 00756 CONSOLE_OUTPUT_HANDLE, 00757 GENERIC_WRITE, 00758 &HandleData 00759 ); 00760 if (NT_SUCCESS(Status)) { 00761 if (a->CursorSize > 100 || a->CursorSize == 0) { 00762 Status = STATUS_INVALID_PARAMETER; 00763 } else { 00764 Status = SetCursorInformation(HandleData->Buffer.ScreenBuffer,a->CursorSize,a->Visible); 00765 } 00766 } 00767 UnlockConsole(Console); 00768 return((ULONG) Status); 00769 UNREFERENCED_PARAMETER(ReplyStatus); // get rid of unreferenced parameter warning message 00770 }

ULONG SrvSetConsoleCursorPosition IN OUT PCSR_API_MSG  m,
IN OUT PCSR_REPLY_STATUS  ReplyStatus
 

Definition at line 662 of file ntcon/server/getset.c.

References AdjustCursorPosition, ApiPreamble(), _HANDLE_DATA::Buffer, _SCREEN_INFORMATION::Console, CONSOLE_OUTPUT_HANDLE, CONSOLE_PERPROCESSDATA, _CONSOLE_SETCURSORPOSITION_MSG::ConsoleHandle, _CONSOLE_SETCURSORPOSITION_MSG::CursorPosition, DereferenceIoHandle(), FALSE, _CONSOLE_INFORMATION::Flags, _CONSOLE_INFORMATION::InputBuffer, NT_SUCCESS, NTSTATUS(), _CONSOLE_SETCURSORPOSITION_MSG::OutputHandle, _SCREEN_INFORMATION::ScreenBufferSize, SetCursorPosition(), SetWindowOrigin(), SHORT, Status, TRUE, UnlockConsole(), and _SCREEN_INFORMATION::Window.

00666 { 00667 PCONSOLE_SETCURSORPOSITION_MSG a = (PCONSOLE_SETCURSORPOSITION_MSG)&m->u.ApiMessageData; 00668 NTSTATUS Status; 00669 PCONSOLE_INFORMATION Console; 00670 PHANDLE_DATA HandleData; 00671 COORD WindowOrigin; 00672 PSCREEN_INFORMATION ScreenInfo; 00673 00674 Status = ApiPreamble(a->ConsoleHandle, 00675 &Console 00676 ); 00677 if (!NT_SUCCESS(Status)) { 00678 return Status; 00679 } 00680 Status = DereferenceIoHandle(CONSOLE_PERPROCESSDATA(), 00681 a->OutputHandle, 00682 CONSOLE_OUTPUT_HANDLE, 00683 GENERIC_WRITE, 00684 &HandleData 00685 ); 00686 if (NT_SUCCESS(Status)) { 00687 00688 ScreenInfo = HandleData->Buffer.ScreenBuffer; 00689 00690 if (a->CursorPosition.X >= ScreenInfo->ScreenBufferSize.X || 00691 a->CursorPosition.Y >= ScreenInfo->ScreenBufferSize.Y || 00692 a->CursorPosition.X < 0 || 00693 a->CursorPosition.Y < 0) { 00694 Status = STATUS_INVALID_PARAMETER; 00695 } else { 00696 Status = SetCursorPosition(ScreenInfo, 00697 a->CursorPosition, 00698 TRUE 00699 ); 00700 } 00701 if (NT_SUCCESS(Status)) { 00702 #if defined(FE_IME) 00703 if (ScreenInfo->Console->Flags & CONSOLE_JUST_VDM_UNREGISTERED){ 00704 if( ScreenInfo->Console->InputBuffer.ImeMode.Open ){ 00705 SHORT ScrollY = 0; 00706 AdjustCursorPosition(ScreenInfo,a->CursorPosition,TRUE,&ScrollY); 00707 a->CursorPosition.Y += ScrollY; 00708 } 00709 Console->Flags &= ~CONSOLE_JUST_VDM_UNREGISTERED; 00710 } 00711 #endif 00712 WindowOrigin.X = 0; 00713 WindowOrigin.Y = 0; 00714 if (ScreenInfo->Window.Left > a->CursorPosition.X) { 00715 WindowOrigin.X = a->CursorPosition.X - ScreenInfo->Window.Left; 00716 } 00717 else if (ScreenInfo->Window.Right < a->CursorPosition.X) { 00718 WindowOrigin.X = a->CursorPosition.X - ScreenInfo->Window.Right; 00719 } 00720 if (ScreenInfo->Window.Top > a->CursorPosition.Y) { 00721 WindowOrigin.Y = a->CursorPosition.Y - ScreenInfo->Window.Top; 00722 } 00723 else if (ScreenInfo->Window.Bottom < a->CursorPosition.Y) { 00724 WindowOrigin.Y = a->CursorPosition.Y - ScreenInfo->Window.Bottom; 00725 } 00726 Status = SetWindowOrigin(ScreenInfo, 00727 FALSE, 00728 WindowOrigin 00729 ); 00730 } 00731 } 00732 UnlockConsole(Console); 00733 return((ULONG) Status); 00734 UNREFERENCED_PARAMETER(ReplyStatus); // get rid of unreferenced parameter warning message 00735 }

ULONG SrvSetConsoleFont IN OUT PCSR_API_MSG  m,
IN OUT PCSR_REPLY_STATUS  ReplyStatus
 

Definition at line 1118 of file ntcon/server/getset.c.

References ApiPreamble(), _HANDLE_DATA::Buffer, _SCREEN_INFORMATION::Console, CONSOLE_OUTPUT_HANDLE, CONSOLE_PERPROCESSDATA, _CONSOLE_SETFONT_MSG::ConsoleHandle, DereferenceIoHandle(), _CONSOLE_SETFONT_MSG::FontIndex, _CONSOLE_INFORMATION::FullScreenFlags, NT_SUCCESS, NTSTATUS(), _CONSOLE_INFORMATION::OutputCP, _CONSOLE_SETFONT_MSG::OutputHandle, SetScreenBufferFont(), Status, and UnlockConsole().

01122 { 01123 PCONSOLE_SETFONT_MSG a = (PCONSOLE_SETFONT_MSG)&m->u.ApiMessageData; 01124 NTSTATUS Status; 01125 PCONSOLE_INFORMATION Console; 01126 PHANDLE_DATA HandleData; 01127 PSCREEN_INFORMATION ScreenInfo; 01128 01129 Status = ApiPreamble(a->ConsoleHandle, 01130 &Console 01131 ); 01132 if (!NT_SUCCESS(Status)) { 01133 return Status; 01134 } 01135 try { 01136 Status = DereferenceIoHandle(CONSOLE_PERPROCESSDATA(), 01137 a->OutputHandle, 01138 CONSOLE_OUTPUT_HANDLE, 01139 GENERIC_WRITE, 01140 &HandleData 01141 ); 01142 if (!NT_SUCCESS(Status)) { 01143 leave; 01144 } 01145 01146 ScreenInfo = HandleData->Buffer.ScreenBuffer; 01147 if (ScreenInfo->Console->FullScreenFlags & CONSOLE_FULLSCREEN) { 01148 Status = STATUS_FULLSCREEN_MODE; 01149 } else { 01150 #if defined(FE_SB) 01151 Status = SetScreenBufferFont(ScreenInfo,a->FontIndex,ScreenInfo->Console->OutputCP); 01152 #else 01153 Status = SetScreenBufferFont(ScreenInfo,a->FontIndex); 01154 #endif 01155 } 01156 } finally { 01157 UnlockConsole(Console); 01158 } 01159 return Status; 01160 UNREFERENCED_PARAMETER(ReplyStatus); // get rid of unreferenced parameter warning message 01161 }

ULONG SrvSetConsoleIcon IN OUT PCSR_API_MSG  m,
IN OUT PCSR_REPLY_STATUS  ReplyStatus
 

Definition at line 1164 of file ntcon/server/getset.c.

References ApiPreamble(), _CONSOLE_SETICON_MSG::ConsoleHandle, CopyIcon(), DestroyIcon, ghDefaultIcon, ghDefaultSmIcon, _CONSOLE_INFORMATION::hIcon, _CONSOLE_SETICON_MSG::hIcon, _CONSOLE_INFORMATION::hSmIcon, _CONSOLE_INFORMATION::hWnd, NT_SUCCESS, NTSTATUS(), NULL, PostMessage(), Status, and UnlockConsole().

01168 { 01169 PCONSOLE_SETICON_MSG a = (PCONSOLE_SETICON_MSG)&m->u.ApiMessageData; 01170 NTSTATUS Status; 01171 PCONSOLE_INFORMATION Console; 01172 HANDLE hIcon; 01173 01174 Status = ApiPreamble(a->ConsoleHandle, 01175 &Console 01176 ); 01177 if (!NT_SUCCESS(Status)) { 01178 return Status; 01179 } 01180 01181 if (a->hIcon == NULL) { 01182 hIcon = ghDefaultIcon; 01183 } else { 01184 hIcon = CopyIcon(a->hIcon); 01185 } 01186 01187 if (hIcon == NULL) { 01188 Status = STATUS_INVALID_PARAMETER; 01189 } else if (hIcon != Console->hIcon) { 01190 PostMessage(Console->hWnd, WM_SETICON, ICON_BIG, (LPARAM)hIcon); 01191 if (Console->hIcon != ghDefaultIcon) { 01192 DestroyIcon(Console->hIcon); 01193 } 01194 Console->hIcon = hIcon; 01195 01196 /* 01197 * Small icon now 01198 */ 01199 if (hIcon != ghDefaultIcon) { 01200 /* 01201 * The new one is not the default, clean-up 01202 */ 01203 if (Console->hSmIcon != NULL && Console->hSmIcon != ghDefaultSmIcon) { 01204 DestroyIcon(Console->hSmIcon); 01205 } 01206 Console->hSmIcon = NULL; 01207 PostMessage(Console->hWnd, WM_SETICON, ICON_SMALL, (LPARAM)NULL); 01208 } else { 01209 /* 01210 * Change to default, so we can use the default small icon 01211 */ 01212 if (Console->hSmIcon != ghDefaultSmIcon) { 01213 if (Console->hSmIcon != NULL) { 01214 DestroyIcon(Console->hSmIcon); 01215 } 01216 Console->hSmIcon = ghDefaultSmIcon; 01217 PostMessage(Console->hWnd, WM_SETICON, ICON_SMALL, (LPARAM)ghDefaultSmIcon); 01218 } 01219 } 01220 } 01221 UnlockConsole(Console); 01222 01223 return Status; 01224 UNREFERENCED_PARAMETER(ReplyStatus); // get rid of unreferenced parameter warning message 01225 }

ULONG SrvSetConsoleMode IN OUT PCSR_API_MSG  m,
IN OUT PCSR_REPLY_STATUS  ReplyStatus
 

Definition at line 354 of file ntcon/server/getset.c.

References ApiPreamble(), _HANDLE_DATA::Buffer, CONSOLE_ANY_HANDLE, CONSOLE_INPUT_HANDLE, CONSOLE_PERPROCESSDATA, CONSOLE_QUICK_EDIT_MODE, CONSOLE_TEXTMODE_BUFFER, CONSOLE_USE_PRIVATE_FLAGS, _CONSOLE_MODE_MSG::ConsoleHandle, _CONSOLE_INFORMATION::CurrentScreenBuffer, DereferenceIoHandle(), FALSE, _SCREEN_INFORMATION::Flags, _CONSOLE_INFORMATION::Flags, _CONSOLE_INFORMATION::FullScreenFlags, _CONSOLE_MODE_MSG::Handle, _HANDLE_DATA::HandleType, INPUT_MODES, _CONSOLE_INFORMATION::InsertMode, _CONSOLE_MODE_MSG::Mode, NT_SUCCESS, NTSTATUS(), OUTPUT_MODES, _CONSOLE_INFORMATION::OutputCP, PRIVATE_MODES, Status, TRUE, UnlockConsole(), and _SCREEN_INFORMATION::Window.

00358 { 00359 PCONSOLE_MODE_MSG a = (PCONSOLE_MODE_MSG)&m->u.ApiMessageData; 00360 NTSTATUS Status; 00361 PCONSOLE_INFORMATION Console; 00362 PHANDLE_DATA HandleData; 00363 00364 Status = ApiPreamble(a->ConsoleHandle, 00365 &Console 00366 ); 00367 if (!NT_SUCCESS(Status)) { 00368 return Status; 00369 } 00370 try { 00371 Status = DereferenceIoHandle(CONSOLE_PERPROCESSDATA(), 00372 a->Handle, 00373 CONSOLE_ANY_HANDLE, 00374 GENERIC_WRITE, 00375 &HandleData 00376 ); 00377 if (!NT_SUCCESS(Status)) { 00378 leave; 00379 } 00380 00381 if (HandleData->HandleType & CONSOLE_INPUT_HANDLE) { 00382 if (a->Mode & ~(INPUT_MODES | PRIVATE_MODES)) { 00383 Status = STATUS_INVALID_PARAMETER; 00384 leave; 00385 } 00386 if ((a->Mode & (ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT)) == ENABLE_ECHO_INPUT) { 00387 Status = STATUS_INVALID_PARAMETER; 00388 leave; 00389 } 00390 if (a->Mode & PRIVATE_MODES) { 00391 Console->Flags |= CONSOLE_USE_PRIVATE_FLAGS; 00392 if (a->Mode & ENABLE_QUICK_EDIT_MODE) { 00393 Console->Flags |= CONSOLE_QUICK_EDIT_MODE; 00394 } else { 00395 Console->Flags &= ~CONSOLE_QUICK_EDIT_MODE; 00396 } 00397 if (a->Mode & ENABLE_INSERT_MODE) { 00398 Console->InsertMode = TRUE; 00399 } else { 00400 Console->InsertMode = FALSE; 00401 } 00402 } else { 00403 Console->Flags &= ~CONSOLE_USE_PRIVATE_FLAGS; 00404 } 00405 00406 #ifdef i386 00407 if (Console->FullScreenFlags & CONSOLE_FULLSCREEN_HARDWARE && 00408 Console->CurrentScreenBuffer->Flags & CONSOLE_TEXTMODE_BUFFER && 00409 (a->Mode & ENABLE_MOUSE_INPUT) != (HandleData->Buffer.InputBuffer->InputMode & ENABLE_MOUSE_INPUT)) { 00410 if (a->Mode & ENABLE_MOUSE_INPUT) { 00411 HandleData->Buffer.InputBuffer->InputMode |= ENABLE_MOUSE_INPUT; 00412 } 00413 #if defined(FE_SB) 00414 // Korean HBIOS doesn't like to reverse mouse pointer. 00415 // Because HBIOS will initialize full screen mode again. 00416 // 949 = Korea WanSung Code Page. 00417 if (Console->OutputCP != 949) { 00418 ReverseMousePointer(Console->CurrentScreenBuffer, 00419 &Console->CurrentScreenBuffer->Window); 00420 } 00421 #else 00422 ReverseMousePointer(Console->CurrentScreenBuffer, 00423 &Console->CurrentScreenBuffer->Window); 00424 #endif 00425 } 00426 #endif 00427 HandleData->Buffer.InputBuffer->InputMode = a->Mode & ~PRIVATE_MODES; 00428 } 00429 else { 00430 if (a->Mode & ~OUTPUT_MODES) { 00431 Status = STATUS_INVALID_PARAMETER; 00432 leave; 00433 } 00434 HandleData->Buffer.ScreenBuffer->OutputMode = a->Mode; 00435 } 00436 } finally { 00437 UnlockConsole(Console); 00438 } 00439 return Status; 00440 UNREFERENCED_PARAMETER(ReplyStatus); // get rid of unreferenced parameter warning message 00441 }

ULONG SrvSetConsoleScreenBufferSize IN OUT PCSR_API_MSG  m,
IN OUT PCSR_REPLY_STATUS  ReplyStatus
 

Definition at line 608 of file ntcon/server/getset.c.

References ApiPreamble(), _HANDLE_DATA::Buffer, CONSOLE_OUTPUT_HANDLE, CONSOLE_PERPROCESSDATA, CONSOLE_WINDOW_SIZE_X, CONSOLE_WINDOW_SIZE_Y, _CONSOLE_SETSCREENBUFFERSIZE_MSG::ConsoleHandle, DereferenceIoHandle(), GetWindowLimits(), _WINDOW_LIMITS::MinimumWindowSize, NT_SUCCESS, NTSTATUS(), _CONSOLE_SETSCREENBUFFERSIZE_MSG::OutputHandle, ResizeScreenBuffer(), _SCREEN_INFORMATION::ScreenBufferSize, _CONSOLE_SETSCREENBUFFERSIZE_MSG::Size, Status, TRUE, and UnlockConsole().

00612 { 00613 PCONSOLE_SETSCREENBUFFERSIZE_MSG a = (PCONSOLE_SETSCREENBUFFERSIZE_MSG)&m->u.ApiMessageData; 00614 NTSTATUS Status; 00615 PCONSOLE_INFORMATION Console; 00616 PHANDLE_DATA HandleData; 00617 PSCREEN_INFORMATION ScreenInfo; 00618 WINDOW_LIMITS WindowLimits; 00619 00620 Status = ApiPreamble(a->ConsoleHandle, 00621 &Console 00622 ); 00623 if (!NT_SUCCESS(Status)) { 00624 return Status; 00625 } 00626 Status = DereferenceIoHandle(CONSOLE_PERPROCESSDATA(), 00627 a->OutputHandle, 00628 CONSOLE_OUTPUT_HANDLE, 00629 GENERIC_WRITE, 00630 &HandleData 00631 ); 00632 if (NT_SUCCESS(Status)) { 00633 00634 ScreenInfo = HandleData->Buffer.ScreenBuffer; 00635 00636 // 00637 // make sure requested screen buffer size isn't smaller than the window 00638 // 00639 00640 GetWindowLimits(ScreenInfo, &WindowLimits); 00641 if (a->Size.X < CONSOLE_WINDOW_SIZE_X(ScreenInfo) || 00642 a->Size.Y < CONSOLE_WINDOW_SIZE_Y(ScreenInfo) || 00643 a->Size.Y < WindowLimits.MinimumWindowSize.Y || 00644 a->Size.X < WindowLimits.MinimumWindowSize.X) { 00645 Status = STATUS_INVALID_PARAMETER; 00646 } 00647 else if (a->Size.X == ScreenInfo->ScreenBufferSize.X && 00648 a->Size.Y == ScreenInfo->ScreenBufferSize.Y) { 00649 Status = STATUS_SUCCESS; 00650 } else { 00651 Status = ResizeScreenBuffer(ScreenInfo, 00652 a->Size, 00653 TRUE); 00654 } 00655 } 00656 UnlockConsole(Console); 00657 return((ULONG) Status); 00658 UNREFERENCED_PARAMETER(ReplyStatus); // get rid of unreferenced parameter warning message 00659 }

ULONG SrvSetConsoleTextAttribute IN OUT PCSR_API_MSG  m,
IN OUT PCSR_REPLY_STATUS  ReplyStatus
 

Definition at line 1078 of file ntcon/server/getset.c.

References ApiPreamble(), _CONSOLE_SETTEXTATTRIBUTE_MSG::Attributes, _HANDLE_DATA::Buffer, CONSOLE_OUTPUT_HANDLE, CONSOLE_PERPROCESSDATA, _CONSOLE_SETTEXTATTRIBUTE_MSG::ConsoleHandle, DereferenceIoHandle(), FALSE, NT_SUCCESS, NTSTATUS(), _CONSOLE_SETTEXTATTRIBUTE_MSG::OutputHandle, SetScreenColors(), Status, UnlockConsole(), and VALID_TEXT_ATTRIBUTES.

01082 { 01083 PCONSOLE_SETTEXTATTRIBUTE_MSG a = (PCONSOLE_SETTEXTATTRIBUTE_MSG)&m->u.ApiMessageData; 01084 NTSTATUS Status; 01085 PCONSOLE_INFORMATION Console; 01086 PHANDLE_DATA HandleData; 01087 01088 Status = ApiPreamble(a->ConsoleHandle, 01089 &Console 01090 ); 01091 if (!NT_SUCCESS(Status)) { 01092 return Status; 01093 } 01094 Status = DereferenceIoHandle(CONSOLE_PERPROCESSDATA(), 01095 a->OutputHandle, 01096 CONSOLE_OUTPUT_HANDLE, 01097 GENERIC_WRITE, 01098 &HandleData 01099 ); 01100 if (NT_SUCCESS(Status)) { 01101 01102 if (a->Attributes & ~VALID_TEXT_ATTRIBUTES) { 01103 Status = STATUS_INVALID_PARAMETER; 01104 } else { 01105 Status = SetScreenColors(HandleData->Buffer.ScreenBuffer, 01106 a->Attributes, 01107 HandleData->Buffer.ScreenBuffer->PopupAttributes, 01108 FALSE 01109 ); 01110 } 01111 } 01112 UnlockConsole(Console); 01113 return((ULONG) Status); 01114 UNREFERENCED_PARAMETER(ReplyStatus); // get rid of unreferenced parameter warning message 01115 }

ULONG SrvSetConsoleWindowInfo IN OUT PCSR_API_MSG  m,
IN OUT PCSR_REPLY_STATUS  ReplyStatus
 

Definition at line 773 of file ntcon/server/getset.c.

References _CONSOLE_SETWINDOWINFO_MSG::Absolute, ACTIVE_SCREEN_BUFFER, ApiPreamble(), _HANDLE_DATA::Buffer, _SCREEN_INFORMATION::BufferInfo, _SCREEN_INFORMATION::Console, CONSOLE_OUTPUT_HANDLE, CONSOLE_PERPROCESSDATA, CONSOLE_VDM_REGISTERED, CONSOLE_WINDOW_SIZE_X, CONSOLE_WINDOW_SIZE_Y, _CONSOLE_SETWINDOWINFO_MSG::ConsoleHandle, DereferenceIoHandle(), FALSE, _CONSOLE_INFORMATION::Flags, _CONSOLE_INFORMATION::FullScreenFlags, GetWindowLimits(), _WINDOW_LIMITS::MaximumWindowSize, NT_SUCCESS, NTSTATUS(), _CONSOLE_INFORMATION::OutputCP, _CONSOLE_SETWINDOWINFO_MSG::OutputHandle, ResizeWindow(), _SCREEN_INFORMATION::ScreenBufferSize, SetWindowOrigin(), SetWindowSize(), SHORT, Status, TRUE, UnlockConsole(), _SCREEN_INFORMATION::Window, _CONSOLE_SETWINDOWINFO_MSG::Window, WINDOW_SIZE_X, WINDOW_SIZE_Y, and WriteToScreen.

00777 { 00778 PCONSOLE_SETWINDOWINFO_MSG a = (PCONSOLE_SETWINDOWINFO_MSG)&m->u.ApiMessageData; 00779 NTSTATUS Status; 00780 PCONSOLE_INFORMATION Console; 00781 PHANDLE_DATA HandleData; 00782 PSCREEN_INFORMATION ScreenInfo; 00783 COORD NewWindowSize; 00784 WINDOW_LIMITS WindowLimits; 00785 00786 Status = ApiPreamble(a->ConsoleHandle, 00787 &Console 00788 ); 00789 if (!NT_SUCCESS(Status)) { 00790 return Status; 00791 } 00792 Status = DereferenceIoHandle(CONSOLE_PERPROCESSDATA(), 00793 a->OutputHandle, 00794 CONSOLE_OUTPUT_HANDLE, 00795 GENERIC_WRITE, 00796 &HandleData 00797 ); 00798 if (NT_SUCCESS(Status)) { 00799 ScreenInfo = HandleData->Buffer.ScreenBuffer; 00800 if (!a->Absolute) { 00801 a->Window.Left += ScreenInfo->Window.Left; 00802 a->Window.Right += ScreenInfo->Window.Right; 00803 a->Window.Top += ScreenInfo->Window.Top; 00804 a->Window.Bottom += ScreenInfo->Window.Bottom; 00805 } 00806 if (a->Window.Right < a->Window.Left || 00807 a->Window.Bottom < a->Window.Top) { 00808 Status = STATUS_INVALID_PARAMETER; 00809 } else { 00810 NewWindowSize.X = (SHORT)(WINDOW_SIZE_X(&a->Window)); 00811 NewWindowSize.Y = (SHORT)(WINDOW_SIZE_Y(&a->Window)); 00812 GetWindowLimits(ScreenInfo, &WindowLimits); 00813 if ((NewWindowSize.X > WindowLimits.MaximumWindowSize.X || 00814 NewWindowSize.Y > WindowLimits.MaximumWindowSize.Y) && 00815 !(ScreenInfo->Console->FullScreenFlags & CONSOLE_FULLSCREEN)) { 00816 Status = STATUS_INVALID_PARAMETER; 00817 } else { 00818 #ifdef i386 00819 if (ScreenInfo->Console->FullScreenFlags & CONSOLE_FULLSCREEN) { 00820 COORD NewOrigin; 00821 00822 if (NewWindowSize.X != (SHORT)(WINDOW_SIZE_X(&ScreenInfo->Window)) || 00823 NewWindowSize.Y != (SHORT)(WINDOW_SIZE_Y(&ScreenInfo->Window))) { 00824 COORD WindowSize; 00825 ULONG ModeIndex; 00826 00827 #if defined(FE_SB) 00828 ModeIndex = MatchWindowSize(ScreenInfo->Console->OutputCP,NewWindowSize,&WindowSize); 00829 #else 00830 ModeIndex = MatchWindowSize(NewWindowSize,&WindowSize); 00831 #endif 00832 if (NewWindowSize.X != WindowSize.X || 00833 NewWindowSize.Y != WindowSize.Y || 00834 WindowSize.X > ScreenInfo->ScreenBufferSize.X || 00835 WindowSize.Y > ScreenInfo->ScreenBufferSize.Y) { 00836 UnlockConsole(Console); 00837 return (ULONG) STATUS_FULLSCREEN_MODE; 00838 } 00839 ScreenInfo->BufferInfo.TextInfo.ModeIndex = ModeIndex; 00840 ResizeWindow(ScreenInfo, 00841 &a->Window, 00842 FALSE 00843 ); 00844 ScreenInfo->BufferInfo.TextInfo.WindowedWindowSize.X = 00845 CONSOLE_WINDOW_SIZE_X(ScreenInfo); 00846 ScreenInfo->BufferInfo.TextInfo.WindowedWindowSize.Y = 00847 CONSOLE_WINDOW_SIZE_Y(ScreenInfo); 00848 if (ScreenInfo->Console->FullScreenFlags & CONSOLE_FULLSCREEN_HARDWARE && 00849 (!(ScreenInfo->Console->Flags & CONSOLE_VDM_REGISTERED)) ) { 00850 SetVideoMode(ScreenInfo); 00851 WriteToScreen(ScreenInfo,&ScreenInfo->Window); 00852 } 00853 } else { 00854 NewOrigin.X = a->Window.Left; 00855 NewOrigin.Y = a->Window.Top; 00856 SetWindowOrigin(ScreenInfo, 00857 TRUE, 00858 NewOrigin 00859 ); 00860 } 00861 } else 00862 #endif 00863 { 00864 Status = ResizeWindow(ScreenInfo, 00865 &a->Window, 00866 TRUE 00867 ); 00868 if (ACTIVE_SCREEN_BUFFER(ScreenInfo)) { 00869 SetWindowSize(ScreenInfo); 00870 WriteToScreen(ScreenInfo,&ScreenInfo->Window); 00871 } 00872 } 00873 } 00874 } 00875 } 00876 UnlockConsole(Console); 00877 return((ULONG) Status); 00878 UNREFERENCED_PARAMETER(ReplyStatus); // get rid of unreferenced parameter warning message 00879 }

VOID UpdatePopups IN PCONSOLE_INFORMATION  Console,
IN WORD  NewAttributes,
IN WORD  NewPopupAttributes,
IN WORD  OldAttributes,
IN WORD  OldPopupAttributes
 

Definition at line 942 of file ntcon/server/getset.c.

References CLE_ALLOCATED, CLE_NO_POPUPS, History, _CLE_POPUP::OldContents, _CLE_POPUP::Region, and SHORT.

Referenced by SetScreenColors().

00958 { 00959 PLIST_ENTRY HistoryListHead, HistoryListNext; 00960 PLIST_ENTRY PopupListHead, PopupListNext; 00961 PCOMMAND_HISTORY History; 00962 PCLE_POPUP Popup; 00963 SHORT i,j; 00964 PCHAR_INFO OldContents; 00965 WORD InvertedOldPopupAttributes,InvertedNewPopupAttributes; 00966 00967 InvertedOldPopupAttributes = (WORD)(((OldPopupAttributes << 4) & 0xf0) | 00968 ((OldPopupAttributes >> 4) & 0x0f)); 00969 InvertedNewPopupAttributes = (WORD)(((NewPopupAttributes << 4) & 0xf0) | 00970 ((NewPopupAttributes >> 4) & 0x0f)); 00971 HistoryListHead = &Console->CommandHistoryList; 00972 HistoryListNext = HistoryListHead->Blink; 00973 while (HistoryListNext != HistoryListHead) { 00974 History = CONTAINING_RECORD( HistoryListNext, COMMAND_HISTORY, ListLink ); 00975 HistoryListNext = HistoryListNext->Blink; 00976 if (History->Flags & CLE_ALLOCATED && !CLE_NO_POPUPS(History)) { 00977 PopupListHead = &History->PopupList; 00978 PopupListNext = PopupListHead->Blink; 00979 while (PopupListNext != PopupListHead) { 00980 Popup = CONTAINING_RECORD( PopupListNext, CLE_POPUP, ListLink ); 00981 PopupListNext = PopupListNext->Blink; 00982 OldContents = Popup->OldContents; 00983 for (i=Popup->Region.Left;i<=Popup->Region.Right;i++) { 00984 for (j=Popup->Region.Top;j<=Popup->Region.Bottom;j++) { 00985 if (OldContents->Attributes == OldAttributes) { 00986 OldContents->Attributes = NewAttributes; 00987 } else if (OldContents->Attributes == OldPopupAttributes) { 00988 OldContents->Attributes = NewPopupAttributes; 00989 } else if (OldContents->Attributes == InvertedOldPopupAttributes) { 00990 OldContents->Attributes = InvertedNewPopupAttributes; 00991 } 00992 OldContents++; 00993 } 00994 } 00995 } 00996 } 00997 } 00998 }


Generated on Sat May 15 19:43:54 2004 for test by doxygen 1.3.7