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

BOOL WINAPI GetConsoleMode (IN HANDLE hConsoleHandle, OUT LPDWORD lpMode)
DWORD WINAPI GetNumberOfConsoleFonts (VOID)
BOOL WINAPI GetNumberOfConsoleInputEvents (IN HANDLE hConsoleInput, OUT LPDWORD lpNumberOfEvents)
COORD WINAPI GetLargestConsoleWindowSize (IN HANDLE hConsoleOutput)
BOOL WINAPI GetConsoleScreenBufferInfo (IN HANDLE hConsoleOutput, OUT PCONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo)
BOOL WINAPI GetConsoleCursorInfo (IN HANDLE hConsoleOutput, OUT PCONSOLE_CURSOR_INFO lpConsoleCursorInfo)
BOOL WINAPI GetNumberOfConsoleMouseButtons (OUT LPDWORD lpNumberOfMouseButtons)
DWORD WINAPI GetConsoleFontInfo (IN HANDLE hConsoleOutput, IN BOOL bMaximumWindow, IN DWORD nLength, OUT PCONSOLE_FONT_INFO lpConsoleFontInfo)
COORD WINAPI GetConsoleFontSize (IN HANDLE hConsoleOutput, IN DWORD nFont)
BOOL WINAPI GetCurrentConsoleFont (IN HANDLE hConsoleOutput, IN BOOL bMaximumWindow, OUT PCONSOLE_FONT_INFO lpConsoleCurrentFont)
BOOL WINAPI SetConsoleMode (IN HANDLE hConsoleHandle, IN DWORD dwMode)
BOOL WINAPI GenerateConsoleCtrlEvent (IN DWORD dwCtrlEvent, IN DWORD dwProcessGroupId)
BOOL WINAPI SetConsoleActiveScreenBuffer (IN HANDLE hConsoleOutput)
BOOL WINAPI FlushConsoleInputBuffer (IN HANDLE hConsoleInput)
BOOL WINAPI SetConsoleScreenBufferSize (IN HANDLE hConsoleOutput, IN COORD dwSize)
BOOL WINAPI SetConsoleCursorPosition (IN HANDLE hConsoleOutput, IN COORD dwCursorPosition)
BOOL WINAPI SetConsoleCursorInfo (IN HANDLE hConsoleOutput, IN CONST CONSOLE_CURSOR_INFO *lpConsoleCursorInfo)
BOOL WINAPI SetConsoleWindowInfo (IN HANDLE hConsoleOutput, IN BOOL bAbsolute, IN CONST SMALL_RECT *lpConsoleWindow)
BOOL APIENTRY ScrollConsoleScreenBufferInternal (IN HANDLE hConsoleOutput, IN CONST SMALL_RECT *lpScrollRectangle, IN CONST SMALL_RECT *lpClipRectangle, IN COORD dwDestinationOrigin, IN CONST CHAR_INFO *lpFill, IN BOOLEAN Unicode)
BOOL APIENTRY ScrollConsoleScreenBufferA (HANDLE hConsoleOutput, CONST SMALL_RECT *lpScrollRectangle, CONST SMALL_RECT *lpClipRectangle, COORD dwDestinationOrigin, CONST CHAR_INFO *lpFill)
 defined(BUILD_WOW6432)

BOOL APIENTRY ScrollConsoleScreenBufferW (HANDLE hConsoleOutput, CONST SMALL_RECT *lpScrollRectangle, CONST SMALL_RECT *lpClipRectangle, COORD dwDestinationOrigin, CONST CHAR_INFO *lpFill)
BOOL WINAPI SetConsoleTextAttribute (IN HANDLE hConsoleOutput, IN WORD wAttributes)
 defined(BUILD_WOW64)

BOOL WINAPI SetConsoleFont (IN HANDLE hConsoleOutput, IN DWORD nFont)
BOOL WINAPI SetConsoleIcon (IN HICON hIcon)
BOOL APIENTRY SetConsoleMaximumWindowSize (HANDLE hConsoleOutput, COORD dwWindowSize)
 defined(BUILD_WOW6432)

UINT WINAPI GetConsoleCP (VOID)
 defined(BUILD_WOW64)

BOOL WINAPI SetConsoleCP (IN UINT wCodePageID)
UINT WINAPI GetConsoleOutputCP (VOID)
NTSTATUS APIENTRY SetConsoleOutputCPInternal (IN UINT wCodePageID)
BOOL WINAPI SetConsoleOutputCP (IN UINT wCodePageID)
 defined(BUILD_WOW6432)

BOOL APIENTRY GetConsoleKeyboardLayoutNameWorker (OUT LPSTR pszLayout, IN BOOL bAnsi)
 defined(BUILD_WOW64)

BOOL GetConsoleKeyboardLayoutNameA (LPSTR pszLayout)
 defined(BUILD_WOW6432)

BOOL GetConsoleKeyboardLayoutNameW (LPWSTR pwszLayout)
HANDLE APIENTRY GetConsoleWindow (VOID)
 defined(BUILD_WOW64)


Function Documentation

BOOL WINAPI FlushConsoleInputBuffer IN HANDLE  hConsoleInput  ) 
 

Definition at line 782 of file ntcon/client/getset.c.

References _CONSOLE_FLUSHINPUTBUFFER_MSG::ConsoleHandle, ConsolepFlushInputBuffer, CsrClientCallServer(), FALSE, GET_CONSOLE_HANDLE, _CONSOLE_FLUSHINPUTBUFFER_MSG::InputHandle, NT_SUCCESS, NULL, SET_LAST_NT_ERROR, TRUE, and _CONSOLE_API_MSG::u.

Referenced by main().

00788 : 00789 00790 hConsoleInput - Supplies an open handle to console input. 00791 00792 Return Value: 00793 00794 TRUE - The operation was successful. 00795 00796 FALSE/NULL - The operation failed. Extended error status is available 00797 using GetLastError. 00798 00799 --*/ 00800 00801 { 00802 00803 CONSOLE_API_MSG m; 00804 PCONSOLE_FLUSHINPUTBUFFER_MSG a = &m.u.FlushConsoleInputBuffer; 00805 00806 a->ConsoleHandle = GET_CONSOLE_HANDLE; 00807 a->InputHandle = hConsoleInput; 00808 CsrClientCallServer( (PCSR_API_MSG)&m, 00809 NULL, 00810 CSR_MAKE_API_NUMBER( CONSRV_SERVERDLL_INDEX, 00811 ConsolepFlushInputBuffer 00812 ), 00813 sizeof( *a ) 00814 ); 00815 if (NT_SUCCESS( m.ReturnValue )) { 00816 return TRUE; 00817 } else { 00818 SET_LAST_NT_ERROR (m.ReturnValue); 00819 return FALSE; 00820 } 00821 00822 }

BOOL WINAPI GenerateConsoleCtrlEvent IN DWORD  dwCtrlEvent,
IN DWORD  dwProcessGroupId
 

Definition at line 674 of file ntcon/client/getset.c.

References _CONSOLE_CTRLEVENT_MSG::ConsoleHandle, ConsolepGenerateCtrlEvent, CsrClientCallServer(), _CONSOLE_CTRLEVENT_MSG::CtrlEvent, FALSE, GET_CONSOLE_HANDLE, NT_SUCCESS, NULL, _CONSOLE_CTRLEVENT_MSG::ProcessGroupId, SET_LAST_ERROR, SET_LAST_NT_ERROR, TRUE, and _CONSOLE_API_MSG::u.

00681 : 00682 00683 dwCtrlEvent - Supplies event(s) to generate. 00684 00685 dwProcessGroupId - Supplies id of process group to generate 00686 event for. Event will be generated in each 00687 process with that id within the console. If 0, 00688 specified event will be generated in all processes 00689 within the console. 00690 00691 Return Value: 00692 00693 TRUE - The operation was successful. 00694 00695 FALSE/NULL - The operation failed. Extended error status is available 00696 using GetLastError. 00697 00698 --*/ 00699 00700 { 00701 00702 CONSOLE_API_MSG m; 00703 PCONSOLE_CTRLEVENT_MSG a = &m.u.GenerateConsoleCtrlEvent; 00704 00705 // 00706 // Check for valid Ctrl Events 00707 // 00708 00709 if ((dwCtrlEvent != CTRL_C_EVENT) && (dwCtrlEvent != CTRL_BREAK_EVENT)) { 00710 SET_LAST_ERROR (ERROR_INVALID_PARAMETER); 00711 return(FALSE); 00712 } 00713 00714 00715 a->ConsoleHandle = GET_CONSOLE_HANDLE; 00716 a->CtrlEvent = dwCtrlEvent; 00717 a->ProcessGroupId = dwProcessGroupId; 00718 CsrClientCallServer( (PCSR_API_MSG)&m, 00719 NULL, 00720 CSR_MAKE_API_NUMBER( CONSRV_SERVERDLL_INDEX, 00721 ConsolepGenerateCtrlEvent 00722 ), 00723 sizeof( *a ) 00724 ); 00725 if (NT_SUCCESS( m.ReturnValue )) { 00726 return TRUE; 00727 } else { 00728 SET_LAST_NT_ERROR (m.ReturnValue); 00729 return FALSE; 00730 } 00731 00732 }

UINT WINAPI GetConsoleCP VOID   ) 
 

defined(BUILD_WOW64)

++

Parameters:

none

Return Value:

The code page id of the current console. a null return value indicates failure.

--

Definition at line 1316 of file ntcon/client/getset.c.

References _CONSOLE_GETCP_MSG::ConsoleHandle, ConsolepGetCP, CsrClientCallServer(), FALSE, GET_CONSOLE_HANDLE, NT_SUCCESS, NULL, _CONSOLE_GETCP_MSG::Output, SET_LAST_NT_ERROR, and _CONSOLE_API_MSG::u.

01320 : 01321 01322 none 01323 01324 Return Value: 01325 01326 The code page id of the current console. a null return value 01327 indicates failure. 01328 01329 --*/ 01330 01331 { 01332 01333 CONSOLE_API_MSG m; 01334 PCONSOLE_GETCP_MSG a = &m.u.GetConsoleCP; 01335 01336 a->ConsoleHandle = GET_CONSOLE_HANDLE; 01337 a->Output = FALSE; 01338 CsrClientCallServer( (PCSR_API_MSG)&m, 01339 NULL, 01340 CSR_MAKE_API_NUMBER( CONSRV_SERVERDLL_INDEX, 01341 ConsolepGetCP 01342 ), 01343 sizeof( *a ) 01344 ); 01345 if (NT_SUCCESS( m.ReturnValue )) { 01346 return a->wCodePageID; 01347 } else { 01348 SET_LAST_NT_ERROR (m.ReturnValue); 01349 return FALSE; 01350 } 01351 01352 }

BOOL WINAPI GetConsoleCursorInfo IN HANDLE  hConsoleOutput,
OUT PCONSOLE_CURSOR_INFO  lpConsoleCursorInfo
 

Definition at line 308 of file ntcon/client/getset.c.

References _CONSOLE_GETCURSORINFO_MSG::ConsoleHandle, ConsolepGetCursorInfo, CsrClientCallServer(), EXCEPTION_EXECUTE_HANDLER, FALSE, GET_CONSOLE_HANDLE, NT_SUCCESS, NULL, _CONSOLE_GETCURSORINFO_MSG::OutputHandle, SET_LAST_ERROR, SET_LAST_NT_ERROR, TRUE, and _CONSOLE_API_MSG::u.

00315 : 00316 00317 hConsoleOutput - Supplies an open handle to console output. 00318 00319 lpConsoleCursorInfo - A pointer to a buffer to receive the 00320 requested information. 00321 00322 Return Value: 00323 00324 TRUE - The operation was successful. 00325 00326 FALSE/NULL - The operation failed. Extended error status is available 00327 using GetLastError. 00328 00329 --*/ 00330 00331 { 00332 00333 CONSOLE_API_MSG m; 00334 PCONSOLE_GETCURSORINFO_MSG a = &m.u.GetConsoleCursorInfo; 00335 00336 a->ConsoleHandle = GET_CONSOLE_HANDLE; 00337 a->OutputHandle = hConsoleOutput; 00338 CsrClientCallServer( (PCSR_API_MSG)&m, 00339 NULL, 00340 CSR_MAKE_API_NUMBER( CONSRV_SERVERDLL_INDEX, 00341 ConsolepGetCursorInfo 00342 ), 00343 sizeof( *a ) 00344 ); 00345 if (NT_SUCCESS( m.ReturnValue )) { 00346 try { 00347 lpConsoleCursorInfo->dwSize = a->CursorSize; 00348 lpConsoleCursorInfo->bVisible = a->Visible; 00349 } except( EXCEPTION_EXECUTE_HANDLER ) { 00350 SET_LAST_ERROR (ERROR_INVALID_ACCESS); 00351 return FALSE; 00352 } 00353 return TRUE; 00354 } else { 00355 SET_LAST_NT_ERROR (m.ReturnValue); 00356 return FALSE; 00357 } 00358 00359 }

DWORD WINAPI GetConsoleFontInfo IN HANDLE  hConsoleOutput,
IN BOOL  bMaximumWindow,
IN DWORD  nLength,
OUT PCONSOLE_FONT_INFO  lpConsoleFontInfo
 

Definition at line 414 of file ntcon/client/getset.c.

References _CONSOLE_GETFONTINFO_MSG::BufPtr, _CONSOLE_GETFONTINFO_MSG::ConsoleHandle, ConsolepGetFontInfo, CsrAllocateCaptureBuffer(), CsrCaptureMessageBuffer(), CsrClientCallServer(), CsrFreeCaptureBuffer(), EXCEPTION_EXECUTE_HANDLER, FALSE, GET_CONSOLE_HANDLE, _CONSOLE_GETFONTINFO_MSG::MaximumWindow, NT_SUCCESS, NULL, _CONSOLE_GETFONTINFO_MSG::NumFonts, _CONSOLE_GETFONTINFO_MSG::OutputHandle, SET_LAST_ERROR, SET_LAST_NT_ERROR, and _CONSOLE_API_MSG::u.

00423 : 00424 00425 hConsoleOutput - Supplies an open handle to console output. 00426 00427 bMaximumWindow - TRUE if caller wants available fonts for the maximum 00428 window size. FALSE if caller wants available fonts for the current 00429 window size. 00430 00431 nLength - Length of buffer in CONSOLE_FONT_INFOs. 00432 00433 lpConsoleFontInfo - A pointer to a buffer to receive the 00434 requested information. 00435 00436 Return Value: 00437 00438 NON-NULL - Returns the number of fonts returned in lpConsoleFontInfo. 00439 00440 FALSE/NULL - The operation failed. Extended error status is available 00441 using GetLastError. 00442 00443 --*/ 00444 00445 { 00446 00447 CONSOLE_API_MSG m; 00448 PCONSOLE_GETFONTINFO_MSG a = &m.u.GetConsoleFontInfo; 00449 PCSR_CAPTURE_HEADER CaptureBuffer; 00450 00451 a->ConsoleHandle = GET_CONSOLE_HANDLE; 00452 a->OutputHandle = hConsoleOutput; 00453 a->MaximumWindow = (BOOLEAN) bMaximumWindow; 00454 a->NumFonts = nLength; 00455 00456 CaptureBuffer = CsrAllocateCaptureBuffer( 1, 00457 nLength * sizeof(CONSOLE_FONT_INFO) 00458 ); 00459 if (CaptureBuffer == NULL) { 00460 SET_LAST_ERROR(ERROR_NOT_ENOUGH_MEMORY); 00461 return FALSE; 00462 } 00463 CsrCaptureMessageBuffer( CaptureBuffer, 00464 NULL, 00465 nLength * sizeof(CONSOLE_FONT_INFO), 00466 (PVOID *) &a->BufPtr 00467 ); 00468 00469 CsrClientCallServer( (PCSR_API_MSG)&m, 00470 CaptureBuffer, 00471 CSR_MAKE_API_NUMBER( CONSRV_SERVERDLL_INDEX, 00472 ConsolepGetFontInfo 00473 ), 00474 sizeof( *a ) 00475 ); 00476 if (NT_SUCCESS( m.ReturnValue )) { 00477 try { 00478 RtlCopyMemory( lpConsoleFontInfo, a->BufPtr, a->NumFonts * sizeof(CONSOLE_FONT_INFO)); 00479 } except( EXCEPTION_EXECUTE_HANDLER ) { 00480 CsrFreeCaptureBuffer( CaptureBuffer ); 00481 SET_LAST_ERROR(ERROR_INVALID_ACCESS); 00482 return 0; 00483 } 00484 } 00485 else { 00486 SET_LAST_NT_ERROR (m.ReturnValue); 00487 } 00488 CsrFreeCaptureBuffer( CaptureBuffer ); 00489 return a->NumFonts; 00490 00491 }

COORD WINAPI GetConsoleFontSize IN HANDLE  hConsoleOutput,
IN DWORD  nFont
 

Definition at line 495 of file ntcon/client/getset.c.

References _CONSOLE_GETFONTSIZE_MSG::ConsoleHandle, ConsolepGetFontSize, CsrClientCallServer(), _CONSOLE_GETFONTSIZE_MSG::FontIndex, GET_CONSOLE_HANDLE, NT_SUCCESS, NULL, _CONSOLE_GETFONTSIZE_MSG::OutputHandle, SET_LAST_NT_ERROR, and _CONSOLE_API_MSG::u.

00502 : 00503 00504 hConsoleOutput - Supplies an open handle to console output. 00505 00506 nFont - Supplies the index of the font to return the size of. 00507 00508 Return Value: 00509 00510 The return value is the height and width of each character in the font. 00511 X field contains width. Y field contains height. Font size 00512 is expressed in pixels. If both the x and y sizes are 0, the function 00513 was unsuccessful. Extended error information can be retrieved by calling 00514 the GetLastError function. 00515 00516 --*/ 00517 00518 { 00519 00520 CONSOLE_API_MSG m; 00521 PCONSOLE_GETFONTSIZE_MSG a = &m.u.GetConsoleFontSize; 00522 COORD Dummy; 00523 00524 a->ConsoleHandle = GET_CONSOLE_HANDLE; 00525 a->OutputHandle = hConsoleOutput; 00526 a->FontIndex = nFont; 00527 CsrClientCallServer( (PCSR_API_MSG)&m, 00528 NULL, 00529 CSR_MAKE_API_NUMBER( CONSRV_SERVERDLL_INDEX, 00530 ConsolepGetFontSize 00531 ), 00532 sizeof( *a ) 00533 ); 00534 if (NT_SUCCESS( m.ReturnValue )) { 00535 return a->FontSize; 00536 } else { 00537 SET_LAST_NT_ERROR (m.ReturnValue); 00538 Dummy.X = Dummy.Y = 0; 00539 return Dummy; 00540 } 00541 00542 }

BOOL GetConsoleKeyboardLayoutNameA LPSTR  pszLayout  ) 
 

defined(BUILD_WOW6432)

Definition at line 1598 of file ntcon/client/getset.c.

References GetConsoleKeyboardLayoutNameWorker(), and TRUE.

01600 { 01601 return GetConsoleKeyboardLayoutNameWorker(pszLayout, TRUE); 01602 }

BOOL GetConsoleKeyboardLayoutNameW LPWSTR  pwszLayout  ) 
 

Definition at line 1605 of file ntcon/client/getset.c.

References FALSE, and GetConsoleKeyboardLayoutNameWorker().

01607 { 01608 return GetConsoleKeyboardLayoutNameWorker((LPSTR)pwszLayout, FALSE); 01609 }

BOOL APIENTRY GetConsoleKeyboardLayoutNameWorker OUT LPSTR  pszLayout,
IN BOOL  bAnsi
 

defined(BUILD_WOW64)

++

Parameters:

pszLayout - address of buffer of least 9 characters bAnsi - TRUE want ANSI (8-bit) chars FALSE want Unicode (16-bit) chars

Return Value:

TRUE - success FALSE - failure

--

Definition at line 1543 of file ntcon/client/getset.c.

References _CONSOLE_GETKEYBOARDLAYOUTNAME_MSG::bAnsi, _CONSOLE_GETKEYBOARDLAYOUTNAME_MSG::ConsoleHandle, ConsolepGetKeyboardLayoutName, CsrClientCallServer(), FALSE, GET_CONSOLE_HANDLE, NT_SUCCESS, NULL, SET_LAST_NT_ERROR, TRUE, and _CONSOLE_API_MSG::u.

Referenced by GetConsoleKeyboardLayoutNameA(), and GetConsoleKeyboardLayoutNameW().

01549 : 01550 01551 pszLayout - address of buffer of least 9 characters 01552 bAnsi - TRUE want ANSI (8-bit) chars 01553 FALSE want Unicode (16-bit) chars 01554 01555 Return Value: 01556 01557 TRUE - success 01558 FALSE - failure 01559 01560 --*/ 01561 01562 { 01563 01564 CONSOLE_API_MSG m; 01565 PCONSOLE_GETKEYBOARDLAYOUTNAME_MSG a = &m.u.GetKeyboardLayoutName; 01566 01567 a->ConsoleHandle = GET_CONSOLE_HANDLE; 01568 a->bAnsi = bAnsi; 01569 01570 CsrClientCallServer( (PCSR_API_MSG)&m, 01571 NULL, 01572 CSR_MAKE_API_NUMBER( CONSRV_SERVERDLL_INDEX, 01573 ConsolepGetKeyboardLayoutName 01574 ), 01575 sizeof( *a ) 01576 ); 01577 if (NT_SUCCESS( m.ReturnValue )) { 01578 if (bAnsi) { 01579 strncpy(pszLayout, a->achLayout, 9); 01580 } else { 01581 wcsncpy((LPWSTR)pszLayout, a->awchLayout, 9); 01582 } 01583 return TRUE; 01584 } else { 01585 SET_LAST_NT_ERROR (m.ReturnValue); 01586 return FALSE; 01587 } 01588 01589 }

BOOL WINAPI GetConsoleMode IN HANDLE  hConsoleHandle,
OUT LPDWORD  lpMode
 

Definition at line 29 of file ntcon/client/getset.c.

References _CONSOLE_MODE_MSG::ConsoleHandle, ConsolepGetMode, CsrClientCallServer(), EXCEPTION_EXECUTE_HANDLER, FALSE, GET_CONSOLE_HANDLE, _CONSOLE_MODE_MSG::Handle, NT_SUCCESS, NULL, SET_LAST_ERROR, SET_LAST_NT_ERROR, TRUE, and _CONSOLE_API_MSG::u.

Referenced by main().

00036 : 00037 00038 hConsoleHandle - Supplies a console input or output handle. 00039 00040 lpMode - Supplies a pointer to a dword in which to store the mode. 00041 00042 Input Mode Flags: 00043 00044 ENABLE_LINE_INPUT - line oriented input is on. 00045 00046 ENABLE_ECHO_INPUT - characters will be written to the screen as they are 00047 read. 00048 00049 ENABLE_WINDOW_INPUT - the caller is windows-aware 00050 00051 Output Mode Flags: 00052 00053 ENABLE_LINE_OUTPUT - line oriented output is on. 00054 00055 ENABLE_WRAP_AT_EOL_OUTPUT - the cursor will move to the 00056 beginning of the next line when the end of the row 00057 is reached. 00058 00059 Return Value: 00060 00061 TRUE - The operation was successful. 00062 00063 FALSE/NULL - The operation failed. Extended error status is available 00064 using GetLastError. 00065 00066 00067 --*/ 00068 00069 { 00070 00071 CONSOLE_API_MSG m; 00072 PCONSOLE_MODE_MSG a = &m.u.GetConsoleMode; 00073 00074 a->ConsoleHandle = GET_CONSOLE_HANDLE; 00075 a->Handle = hConsoleHandle; 00076 CsrClientCallServer( (PCSR_API_MSG)&m, 00077 NULL, 00078 CSR_MAKE_API_NUMBER( CONSRV_SERVERDLL_INDEX, 00079 ConsolepGetMode 00080 ), 00081 sizeof( *a ) 00082 ); 00083 if (NT_SUCCESS( m.ReturnValue )) { 00084 try { 00085 *lpMode = a->Mode; 00086 } except( EXCEPTION_EXECUTE_HANDLER ) { 00087 SET_LAST_ERROR (ERROR_INVALID_ACCESS); 00088 return FALSE; 00089 } 00090 return TRUE; 00091 } else { 00092 SET_LAST_NT_ERROR (m.ReturnValue); 00093 return FALSE; 00094 } 00095 00096 }

UINT WINAPI GetConsoleOutputCP VOID   ) 
 

++

Parameters:

none

Return Value:

The code page id of the current console output. a null return value indicates failure.

--

Definition at line 1429 of file ntcon/client/getset.c.

References _CONSOLE_GETCP_MSG::ConsoleHandle, ConsolepGetCP, CsrClientCallServer(), FALSE, GET_CONSOLE_HANDLE, NT_SUCCESS, NULL, _CONSOLE_GETCP_MSG::Output, SET_LAST_NT_ERROR, TRUE, and _CONSOLE_API_MSG::u.

01433 : 01434 01435 none 01436 01437 Return Value: 01438 01439 The code page id of the current console output. a null return value 01440 indicates failure. 01441 01442 --*/ 01443 01444 { 01445 01446 CONSOLE_API_MSG m; 01447 PCONSOLE_GETCP_MSG a = &m.u.GetConsoleCP; 01448 01449 a->ConsoleHandle = GET_CONSOLE_HANDLE; 01450 a->Output = TRUE; 01451 CsrClientCallServer( (PCSR_API_MSG)&m, 01452 NULL, 01453 CSR_MAKE_API_NUMBER( CONSRV_SERVERDLL_INDEX, 01454 ConsolepGetCP 01455 ), 01456 sizeof( *a ) 01457 ); 01458 if (NT_SUCCESS( m.ReturnValue )) { 01459 return a->wCodePageID; 01460 } else { 01461 SET_LAST_NT_ERROR (m.ReturnValue); 01462 return FALSE; 01463 } 01464 01465 }

BOOL WINAPI GetConsoleScreenBufferInfo IN HANDLE  hConsoleOutput,
OUT PCONSOLE_SCREEN_BUFFER_INFO  lpConsoleScreenBufferInfo
 

Definition at line 247 of file ntcon/client/getset.c.

References _CONSOLE_GETSCREENBUFFERINFO_MSG::ConsoleHandle, ConsolepGetScreenBufferInfo, CsrClientCallServer(), EXCEPTION_EXECUTE_HANDLER, FALSE, GET_CONSOLE_HANDLE, NT_SUCCESS, NULL, _CONSOLE_GETSCREENBUFFERINFO_MSG::OutputHandle, SET_LAST_ERROR, SET_LAST_NT_ERROR, TRUE, and _CONSOLE_API_MSG::u.

Referenced by Scroll5().

00254 : 00255 00256 hConsoleOutput - Supplies an open handle to console output. 00257 00258 lpConsoleScreenBufferInfo - A pointer to a buffer to receive the 00259 requested information. 00260 00261 Return Value: 00262 00263 TRUE - The operation was successful. 00264 00265 FALSE/NULL - The operation failed. Extended error status is available 00266 using GetLastError. 00267 00268 --*/ 00269 00270 { 00271 00272 CONSOLE_API_MSG m; 00273 PCONSOLE_GETSCREENBUFFERINFO_MSG a = &m.u.GetConsoleScreenBufferInfo; 00274 00275 a->ConsoleHandle = GET_CONSOLE_HANDLE; 00276 a->OutputHandle = hConsoleOutput; 00277 CsrClientCallServer( (PCSR_API_MSG)&m, 00278 NULL, 00279 CSR_MAKE_API_NUMBER( CONSRV_SERVERDLL_INDEX, 00280 ConsolepGetScreenBufferInfo 00281 ), 00282 sizeof( *a ) 00283 ); 00284 if (NT_SUCCESS( m.ReturnValue )) { 00285 try { 00286 lpConsoleScreenBufferInfo->dwSize = a->Size; 00287 lpConsoleScreenBufferInfo->dwCursorPosition = a->CursorPosition; 00288 lpConsoleScreenBufferInfo->wAttributes = a->Attributes; 00289 lpConsoleScreenBufferInfo->srWindow.Left = a->ScrollPosition.X; 00290 lpConsoleScreenBufferInfo->srWindow.Top = a->ScrollPosition.Y; 00291 lpConsoleScreenBufferInfo->srWindow.Right = lpConsoleScreenBufferInfo->srWindow.Left + a->CurrentWindowSize.X-1; 00292 lpConsoleScreenBufferInfo->srWindow.Bottom = lpConsoleScreenBufferInfo->srWindow.Top + a->CurrentWindowSize.Y-1; 00293 lpConsoleScreenBufferInfo->dwMaximumWindowSize = a->MaximumWindowSize; 00294 } except( EXCEPTION_EXECUTE_HANDLER ) { 00295 SET_LAST_ERROR (ERROR_INVALID_ACCESS); 00296 return FALSE; 00297 } 00298 return TRUE; 00299 } else { 00300 SET_LAST_NT_ERROR (m.ReturnValue); 00301 return FALSE; 00302 } 00303 00304 }

HANDLE APIENTRY GetConsoleWindow VOID   ) 
 

defined(BUILD_WOW64)

Definition at line 1617 of file ntcon/client/getset.c.

References _CONSOLE_GETCONSOLEWINDOW_MSG::ConsoleHandle, ConsolepGetConsoleWindow, CsrClientCallServer(), GET_CONSOLE_HANDLE, NT_SUCCESS, NULL, SET_LAST_NT_ERROR, and _CONSOLE_API_MSG::u.

01619 { 01620 01621 CONSOLE_API_MSG m; 01622 PCONSOLE_GETCONSOLEWINDOW_MSG a = &m.u.GetConsoleWindow; 01623 01624 a->ConsoleHandle = GET_CONSOLE_HANDLE; 01625 CsrClientCallServer( (PCSR_API_MSG)&m, 01626 NULL, 01627 CSR_MAKE_API_NUMBER( CONSRV_SERVERDLL_INDEX, 01628 ConsolepGetConsoleWindow 01629 ), 01630 sizeof( *a ) 01631 ); 01632 if (NT_SUCCESS( m.ReturnValue )) { 01633 return a->hwnd; 01634 } else { 01635 SET_LAST_NT_ERROR (m.ReturnValue); 01636 return NULL; 01637 } 01638 01639 }

BOOL WINAPI GetCurrentConsoleFont IN HANDLE  hConsoleOutput,
IN BOOL  bMaximumWindow,
OUT PCONSOLE_FONT_INFO  lpConsoleCurrentFont
 

Definition at line 546 of file ntcon/client/getset.c.

References _CONSOLE_GETCURRENTFONT_MSG::ConsoleHandle, ConsolepGetCurrentFont, CsrClientCallServer(), EXCEPTION_EXECUTE_HANDLER, FALSE, GET_CONSOLE_HANDLE, _CONSOLE_GETCURRENTFONT_MSG::MaximumWindow, NT_SUCCESS, NULL, _CONSOLE_GETCURRENTFONT_MSG::OutputHandle, SET_LAST_ERROR, SET_LAST_NT_ERROR, TRUE, and _CONSOLE_API_MSG::u.

00554 : 00555 00556 hConsoleOutput - Supplies an open handle to console output. 00557 00558 bMaximumWindow - TRUE if caller wants current font for the maximum 00559 window size. FALSE if caller wants current font for the current 00560 window size. 00561 00562 lpConsoleCurrentFont - A pointer to a buffer to receive the 00563 requested information. 00564 00565 Return Value: 00566 00567 TRUE - The operation was successful. 00568 00569 FALSE/NULL - The operation failed. Extended error status is available 00570 using GetLastError. 00571 00572 --*/ 00573 00574 { 00575 00576 CONSOLE_API_MSG m; 00577 PCONSOLE_GETCURRENTFONT_MSG a = &m.u.GetCurrentConsoleFont; 00578 00579 a->ConsoleHandle = GET_CONSOLE_HANDLE; 00580 a->OutputHandle = hConsoleOutput; 00581 a->MaximumWindow = (BOOLEAN) bMaximumWindow; 00582 a->OutputHandle = hConsoleOutput; 00583 CsrClientCallServer( (PCSR_API_MSG)&m, 00584 NULL, 00585 CSR_MAKE_API_NUMBER( CONSRV_SERVERDLL_INDEX, 00586 ConsolepGetCurrentFont 00587 ), 00588 sizeof( *a ) 00589 ); 00590 if (NT_SUCCESS( m.ReturnValue )) { 00591 try { 00592 lpConsoleCurrentFont->dwFontSize = a->FontSize; 00593 lpConsoleCurrentFont->nFont = a->FontIndex; 00594 } except( EXCEPTION_EXECUTE_HANDLER ) { 00595 SET_LAST_ERROR(ERROR_INVALID_ACCESS); 00596 return FALSE; 00597 } 00598 return TRUE; 00599 } else { 00600 SET_LAST_NT_ERROR (m.ReturnValue); 00601 return FALSE; 00602 } 00603 00604 }

COORD WINAPI GetLargestConsoleWindowSize IN HANDLE  hConsoleOutput  ) 
 

Definition at line 198 of file ntcon/client/getset.c.

References _CONSOLE_GETLARGESTWINDOWSIZE_MSG::ConsoleHandle, ConsolepGetLargestWindowSize, CsrClientCallServer(), GET_CONSOLE_HANDLE, NT_SUCCESS, NULL, _CONSOLE_GETLARGESTWINDOWSIZE_MSG::OutputHandle, SET_LAST_NT_ERROR, and _CONSOLE_API_MSG::u.

00207 : 00208 00209 hConsoleOutput - Supplies an open handle to console output. 00210 00211 Return Value: 00212 00213 The return value is the maximum window size in rows and columns. A size 00214 of zero will be returned if an error occurs. Extended error information 00215 can be retrieved by calling the GetLastError function. 00216 00217 --*/ 00218 00219 { 00220 00221 CONSOLE_API_MSG m; 00222 PCONSOLE_GETLARGESTWINDOWSIZE_MSG a = &m.u.GetLargestConsoleWindowSize; 00223 00224 a->ConsoleHandle = GET_CONSOLE_HANDLE; 00225 a->OutputHandle = hConsoleOutput; 00226 CsrClientCallServer( (PCSR_API_MSG)&m, 00227 NULL, 00228 CSR_MAKE_API_NUMBER( CONSRV_SERVERDLL_INDEX, 00229 ConsolepGetLargestWindowSize 00230 ), 00231 sizeof( *a ) 00232 ); 00233 if (NT_SUCCESS( m.ReturnValue )) { 00234 return a->Size; 00235 } else { 00236 COORD Dummy; 00237 Dummy.X = Dummy.Y = 0; 00238 SET_LAST_NT_ERROR (m.ReturnValue); 00239 return Dummy; 00240 } 00241 00242 }

DWORD WINAPI GetNumberOfConsoleFonts VOID   ) 
 

Definition at line 100 of file ntcon/client/getset.c.

References _CONSOLE_GETNUMBEROFFONTS_MSG::ConsoleHandle, ConsolepGetNumberOfFonts, CsrClientCallServer(), FALSE, GET_CONSOLE_HANDLE, NT_SUCCESS, NULL, SET_LAST_NT_ERROR, and _CONSOLE_API_MSG::u.

00106 : 00107 00108 none. 00109 00110 Return Value: 00111 00112 NON-NULL - Returns the number of fonts available. 00113 00114 FALSE/NULL - The operation failed. 00115 Extended error status is available using GetLastError. 00116 00117 --*/ 00118 00119 { 00120 00121 CONSOLE_API_MSG m; 00122 PCONSOLE_GETNUMBEROFFONTS_MSG a = &m.u.GetNumberOfConsoleFonts; 00123 00124 a->ConsoleHandle = GET_CONSOLE_HANDLE; 00125 CsrClientCallServer( (PCSR_API_MSG)&m, 00126 NULL, 00127 CSR_MAKE_API_NUMBER( CONSRV_SERVERDLL_INDEX, 00128 ConsolepGetNumberOfFonts 00129 ), 00130 sizeof( *a ) 00131 ); 00132 if (NT_SUCCESS( m.ReturnValue )) { 00133 return a->NumberOfFonts; 00134 } else { 00135 SET_LAST_NT_ERROR (m.ReturnValue); 00136 return FALSE; 00137 } 00138 00139 }

BOOL WINAPI GetNumberOfConsoleInputEvents IN HANDLE  hConsoleInput,
OUT LPDWORD  lpNumberOfEvents
 

Definition at line 144 of file ntcon/client/getset.c.

References _CONSOLE_GETNUMBEROFINPUTEVENTS_MSG::ConsoleHandle, ConsolepGetNumberOfInputEvents, CsrClientCallServer(), EXCEPTION_EXECUTE_HANDLER, FALSE, GET_CONSOLE_HANDLE, _CONSOLE_GETNUMBEROFINPUTEVENTS_MSG::InputHandle, NT_SUCCESS, NULL, SET_LAST_ERROR, SET_LAST_NT_ERROR, TRUE, and _CONSOLE_API_MSG::u.

00151 : 00152 00153 hConsoleInput - Supplies an open handle to console input. 00154 00155 lpNumberOfEvents - Pointer to number of events in input buffer. 00156 00157 Return Value: 00158 00159 TRUE - The operation was successful. 00160 00161 FALSE/NULL - The operation failed. 00162 Extended error status is available using GetLastError. 00163 00164 --*/ 00165 00166 { 00167 00168 CONSOLE_API_MSG m; 00169 PCONSOLE_GETNUMBEROFINPUTEVENTS_MSG a = &m.u.GetNumberOfConsoleInputEvents; 00170 00171 a->ConsoleHandle = GET_CONSOLE_HANDLE; 00172 a->InputHandle = hConsoleInput; 00173 CsrClientCallServer( (PCSR_API_MSG)&m, 00174 NULL, 00175 CSR_MAKE_API_NUMBER( CONSRV_SERVERDLL_INDEX, 00176 ConsolepGetNumberOfInputEvents 00177 ), 00178 sizeof( *a ) 00179 ); 00180 if (NT_SUCCESS( m.ReturnValue )) { 00181 try { 00182 *lpNumberOfEvents = a->ReadyEvents; 00183 } except( EXCEPTION_EXECUTE_HANDLER ) { 00184 SET_LAST_ERROR (ERROR_INVALID_ACCESS); 00185 return FALSE; 00186 } 00187 return TRUE; 00188 } 00189 else { 00190 SET_LAST_NT_ERROR (m.ReturnValue); 00191 return FALSE; 00192 } 00193 00194 }

BOOL WINAPI GetNumberOfConsoleMouseButtons OUT LPDWORD  lpNumberOfMouseButtons  ) 
 

Definition at line 363 of file ntcon/client/getset.c.

References _CONSOLE_GETMOUSEINFO_MSG::ConsoleHandle, ConsolepGetMouseInfo, CsrClientCallServer(), EXCEPTION_EXECUTE_HANDLER, FALSE, GET_CONSOLE_HANDLE, NT_SUCCESS, NULL, SET_LAST_ERROR, SET_LAST_NT_ERROR, TRUE, and _CONSOLE_API_MSG::u.

00369 : 00370 00371 hConsoleInput - Supplies an open handle to console input. 00372 00373 lpNumberOfMouseButtons - pointer to the number of mouse buttons 00374 00375 Return Value: 00376 00377 TRUE - The operation was successful. 00378 00379 FALSE/NULL - The operation failed. Extended error status is available 00380 using GetLastError. 00381 00382 --*/ 00383 00384 { 00385 00386 CONSOLE_API_MSG m; 00387 PCONSOLE_GETMOUSEINFO_MSG a = &m.u.GetConsoleMouseInfo; 00388 00389 a->ConsoleHandle = GET_CONSOLE_HANDLE; 00390 CsrClientCallServer( (PCSR_API_MSG)&m, 00391 NULL, 00392 CSR_MAKE_API_NUMBER( CONSRV_SERVERDLL_INDEX, 00393 ConsolepGetMouseInfo 00394 ), 00395 sizeof( *a ) 00396 ); 00397 if (NT_SUCCESS( m.ReturnValue )) { 00398 try { 00399 *lpNumberOfMouseButtons = a->NumButtons; 00400 } except( EXCEPTION_EXECUTE_HANDLER ) { 00401 SET_LAST_ERROR (ERROR_INVALID_ACCESS); 00402 return FALSE; 00403 } 00404 return TRUE; 00405 } else { 00406 SET_LAST_NT_ERROR (m.ReturnValue); 00407 return FALSE; 00408 } 00409 00410 }

BOOL APIENTRY ScrollConsoleScreenBufferA HANDLE  hConsoleOutput,
CONST SMALL_RECT *  lpScrollRectangle,
CONST SMALL_RECT *  lpClipRectangle,
COORD  dwDestinationOrigin,
CONST CHAR_INFO *  lpFill
 

defined(BUILD_WOW6432)

Definition at line 1115 of file ntcon/client/getset.c.

References FALSE, and ScrollConsoleScreenBufferInternal().

01122 { 01123 return ScrollConsoleScreenBufferInternal(hConsoleOutput, 01124 lpScrollRectangle, 01125 lpClipRectangle, 01126 dwDestinationOrigin, 01127 lpFill, 01128 FALSE); 01129 }

BOOL APIENTRY ScrollConsoleScreenBufferInternal IN HANDLE  hConsoleOutput,
IN CONST SMALL_RECT *  lpScrollRectangle,
IN CONST SMALL_RECT *  lpClipRectangle,
IN COORD  dwDestinationOrigin,
IN CONST CHAR_INFO *  lpFill,
IN BOOLEAN  Unicode
 

Definition at line 1036 of file ntcon/client/getset.c.

References _CONSOLE_SCROLLSCREENBUFFER_MSG::Clip, _CONSOLE_SCROLLSCREENBUFFER_MSG::ClipRectangle, _CONSOLE_SCROLLSCREENBUFFER_MSG::ConsoleHandle, ConsolepScrollScreenBuffer, CsrClientCallServer(), _CONSOLE_SCROLLSCREENBUFFER_MSG::DestinationOrigin, EXCEPTION_EXECUTE_HANDLER, FALSE, _CONSOLE_SCROLLSCREENBUFFER_MSG::Fill, GET_CONSOLE_HANDLE, NT_SUCCESS, NULL, _CONSOLE_SCROLLSCREENBUFFER_MSG::OutputHandle, _CONSOLE_SCROLLSCREENBUFFER_MSG::ScrollRectangle, SET_LAST_ERROR, SET_LAST_NT_ERROR, TRUE, _CONSOLE_API_MSG::u, Unicode, and _CONSOLE_SCROLLSCREENBUFFER_MSG::Unicode.

Referenced by ScrollConsoleScreenBufferA(), and ScrollConsoleScreenBufferW().

01047 : 01048 01049 hConsoleOutput - Supplies an open handle to console output. 01050 01051 lpScrollRectangle - Pointer to region within screen buffer to move. 01052 01053 lpClipRectangle - Pointer to region within screen buffer that may be 01054 affected by this scroll. This pointer may be NULL. 01055 01056 dwDestinationOrigin - Upper left corner of new location of ScrollRectangle 01057 contents. 01058 01059 lpFill - Pointer to structure containing new contents of ScrollRectangle region. 01060 01061 Return Value: 01062 01063 TRUE - The operation was successful. 01064 01065 FALSE/NULL - The operation failed. Extended error status is available 01066 using GetLastError. 01067 01068 --*/ 01069 01070 { 01071 01072 CONSOLE_API_MSG m; 01073 PCONSOLE_SCROLLSCREENBUFFER_MSG a = &m.u.ScrollConsoleScreenBuffer; 01074 01075 a->ConsoleHandle = GET_CONSOLE_HANDLE; 01076 a->OutputHandle = hConsoleOutput; 01077 a->Unicode = Unicode; 01078 try { 01079 a->ScrollRectangle = *lpScrollRectangle; 01080 if (lpClipRectangle != NULL) { 01081 a->Clip = TRUE; 01082 a->ClipRectangle = *lpClipRectangle; 01083 } 01084 else { 01085 a->Clip = FALSE; 01086 } 01087 a->Fill = *lpFill; 01088 a->DestinationOrigin = dwDestinationOrigin; 01089 } except( EXCEPTION_EXECUTE_HANDLER ) { 01090 SET_LAST_ERROR(ERROR_INVALID_ACCESS); 01091 return FALSE; 01092 } 01093 CsrClientCallServer( (PCSR_API_MSG)&m, 01094 NULL, 01095 CSR_MAKE_API_NUMBER( CONSRV_SERVERDLL_INDEX, 01096 ConsolepScrollScreenBuffer 01097 ), 01098 sizeof( *a ) 01099 ); 01100 if (NT_SUCCESS( m.ReturnValue )) { 01101 return TRUE; 01102 } else { 01103 SET_LAST_NT_ERROR (m.ReturnValue); 01104 return FALSE; 01105 } 01106 01107 }

BOOL APIENTRY ScrollConsoleScreenBufferW HANDLE  hConsoleOutput,
CONST SMALL_RECT *  lpScrollRectangle,
CONST SMALL_RECT *  lpClipRectangle,
COORD  dwDestinationOrigin,
CONST CHAR_INFO *  lpFill
 

Definition at line 1133 of file ntcon/client/getset.c.

References ScrollConsoleScreenBufferInternal(), and TRUE.

01140 { 01141 return ScrollConsoleScreenBufferInternal(hConsoleOutput, 01142 lpScrollRectangle, 01143 lpClipRectangle, 01144 dwDestinationOrigin, 01145 lpFill, 01146 TRUE); 01147 }

BOOL WINAPI SetConsoleActiveScreenBuffer IN HANDLE  hConsoleOutput  ) 
 

Definition at line 736 of file ntcon/client/getset.c.

References _CONSOLE_SETACTIVESCREENBUFFER_MSG::ConsoleHandle, ConsolepSetActiveScreenBuffer, CsrClientCallServer(), FALSE, GET_CONSOLE_HANDLE, NT_SUCCESS, NULL, _CONSOLE_SETACTIVESCREENBUFFER_MSG::OutputHandle, SET_LAST_NT_ERROR, TRUE, and _CONSOLE_API_MSG::u.

Referenced by main().

00742 : 00743 00744 hConsoleOutput - Supplies an open handle to console output. The screen 00745 buffer attached to this handle becomes the displayed screen buffer. 00746 00747 Return Value: 00748 00749 TRUE - The operation was successful. 00750 00751 FALSE/NULL - The operation failed. Extended error status is available 00752 using GetLastError. 00753 00754 --*/ 00755 00756 { 00757 00758 CONSOLE_API_MSG m; 00759 PCONSOLE_SETACTIVESCREENBUFFER_MSG a = &m.u.SetConsoleActiveScreenBuffer; 00760 00761 a->ConsoleHandle = GET_CONSOLE_HANDLE; 00762 a->OutputHandle = hConsoleOutput; 00763 CsrClientCallServer( (PCSR_API_MSG)&m, 00764 NULL, 00765 CSR_MAKE_API_NUMBER( CONSRV_SERVERDLL_INDEX, 00766 ConsolepSetActiveScreenBuffer 00767 ), 00768 sizeof( *a ) 00769 ); 00770 if (NT_SUCCESS( m.ReturnValue )) { 00771 return TRUE; 00772 } else { 00773 SET_LAST_NT_ERROR (m.ReturnValue); 00774 return FALSE; 00775 } 00776 00777 }

BOOL WINAPI SetConsoleCP IN UINT  wCodePageID  ) 
 

++

Parameters:

wCodePageID - the code page is to set for the current console.

Return Value:

TRUE - The operation was successful.

FALSE/NULL - The operation failed. Extended error status is available using GetLastError.

--

Definition at line 1356 of file ntcon/client/getset.c.

References _CONSOLE_SETCP_MSG::ConsoleHandle, ConsolepSetCP, CsrClientCallServer(), FALSE, GET_CONSOLE_HANDLE, NT_SUCCESS, NtClose(), NtCreateEvent(), NTSTATUS(), NtWaitForSingleObject(), NULL, _CONSOLE_SETCP_MSG::Output, SET_LAST_NT_ERROR, Status, TRUE, _CONSOLE_API_MSG::u, and _CONSOLE_SETCP_MSG::wCodePageID.

01362 : 01363 01364 wCodePageID - the code page is to set for the current console. 01365 01366 Return Value: 01367 01368 TRUE - The operation was successful. 01369 01370 FALSE/NULL - The operation failed. Extended error status is available 01371 using GetLastError. 01372 01373 01374 --*/ 01375 01376 { 01377 01378 CONSOLE_API_MSG m; 01379 PCONSOLE_SETCP_MSG a = &m.u.SetConsoleCP; 01380 NTSTATUS Status; 01381 01382 a->ConsoleHandle = GET_CONSOLE_HANDLE; 01383 a->Output = FALSE; 01384 a->wCodePageID = wCodePageID; 01385 #if defined(FE_SB) 01386 Status = NtCreateEvent(&(a->hEvent), 01387 EVENT_ALL_ACCESS, 01388 NULL, 01389 SynchronizationEvent, 01390 (BOOLEAN)FALSE 01391 ); 01392 if (!NT_SUCCESS(Status)) { 01393 SET_LAST_NT_ERROR(Status); 01394 return FALSE; 01395 } 01396 #endif 01397 CsrClientCallServer( (PCSR_API_MSG)&m, 01398 NULL, 01399 CSR_MAKE_API_NUMBER( CONSRV_SERVERDLL_INDEX, 01400 ConsolepSetCP 01401 ), 01402 sizeof( *a ) 01403 ); 01404 if (NT_SUCCESS( m.ReturnValue )) { 01405 #if defined(FE_SB) 01406 NTSTATUS Status; 01407 01408 Status = NtWaitForSingleObject(a->hEvent, FALSE, NULL); 01409 NtClose(a->hEvent); 01410 if (Status != 0) { 01411 SET_LAST_NT_ERROR(Status); 01412 return FALSE; 01413 } 01414 #endif 01415 return TRUE; 01416 } else { 01417 #if defined(FE_SB) 01418 NtClose(a->hEvent); 01419 #endif 01420 SET_LAST_NT_ERROR (m.ReturnValue); 01421 return FALSE; 01422 } 01423 01424 }

BOOL WINAPI SetConsoleCursorInfo IN HANDLE  hConsoleOutput,
IN CONST CONSOLE_CURSOR_INFO *  lpConsoleCursorInfo
 

Definition at line 925 of file ntcon/client/getset.c.

References _CONSOLE_SETCURSORINFO_MSG::ConsoleHandle, ConsolepSetCursorInfo, CsrClientCallServer(), _CONSOLE_SETCURSORINFO_MSG::CursorSize, EXCEPTION_EXECUTE_HANDLER, FALSE, GET_CONSOLE_HANDLE, NT_SUCCESS, NULL, _CONSOLE_SETCURSORINFO_MSG::OutputHandle, SET_LAST_ERROR, SET_LAST_NT_ERROR, TRUE, _CONSOLE_API_MSG::u, and _CONSOLE_SETCURSORINFO_MSG::Visible.

00932 : 00933 00934 hConsoleOutput - Supplies an open handle to console output. 00935 00936 lpConsoleCursorOrigin - A pointer to a buffer containing the data 00937 to set. 00938 00939 Return Value: 00940 00941 TRUE - The operation was successful. 00942 00943 FALSE/NULL - The operation failed. Extended error status is available 00944 using GetLastError. 00945 00946 --*/ 00947 00948 { 00949 00950 CONSOLE_API_MSG m; 00951 PCONSOLE_SETCURSORINFO_MSG a = &m.u.SetConsoleCursorInfo; 00952 00953 a->ConsoleHandle = GET_CONSOLE_HANDLE; 00954 a->OutputHandle = hConsoleOutput; 00955 try { 00956 a->CursorSize = lpConsoleCursorInfo->dwSize; 00957 a->Visible = (BOOLEAN) lpConsoleCursorInfo->bVisible; 00958 } except( EXCEPTION_EXECUTE_HANDLER ) { 00959 SET_LAST_ERROR(ERROR_INVALID_ACCESS); 00960 return FALSE; 00961 } 00962 CsrClientCallServer( (PCSR_API_MSG)&m, 00963 NULL, 00964 CSR_MAKE_API_NUMBER( CONSRV_SERVERDLL_INDEX, 00965 ConsolepSetCursorInfo 00966 ), 00967 sizeof( *a ) 00968 ); 00969 if (NT_SUCCESS( m.ReturnValue )) { 00970 return TRUE; 00971 } else { 00972 SET_LAST_NT_ERROR (m.ReturnValue); 00973 return FALSE; 00974 } 00975 00976 }

BOOL WINAPI SetConsoleCursorPosition IN HANDLE  hConsoleOutput,
IN COORD  dwCursorPosition
 

Definition at line 876 of file ntcon/client/getset.c.

References _CONSOLE_SETCURSORPOSITION_MSG::ConsoleHandle, ConsolepSetCursorPosition, CsrClientCallServer(), _CONSOLE_SETCURSORPOSITION_MSG::CursorPosition, FALSE, GET_CONSOLE_HANDLE, NT_SUCCESS, NULL, _CONSOLE_SETCURSORPOSITION_MSG::OutputHandle, SET_LAST_NT_ERROR, TRUE, and _CONSOLE_API_MSG::u.

00883 : 00884 00885 hConsoleOutput - Supplies an open handle to console output. 00886 00887 dwCursorPosition - Position of cursor in screen buffer 00888 00889 Return Value: 00890 00891 TRUE - The operation was successful. 00892 00893 FALSE/NULL - The operation failed. Extended error status is available 00894 using GetLastError. 00895 00896 --*/ 00897 00898 { 00899 00900 CONSOLE_API_MSG m; 00901 PCONSOLE_SETCURSORPOSITION_MSG a = &m.u.SetConsoleCursorPosition; 00902 00903 a->ConsoleHandle = GET_CONSOLE_HANDLE; 00904 a->OutputHandle = hConsoleOutput; 00905 a->CursorPosition = dwCursorPosition; 00906 CsrClientCallServer( (PCSR_API_MSG)&m, 00907 NULL, 00908 CSR_MAKE_API_NUMBER( CONSRV_SERVERDLL_INDEX, 00909 ConsolepSetCursorPosition 00910 ), 00911 sizeof( *a ) 00912 ); 00913 if (NT_SUCCESS( m.ReturnValue )) { 00914 return TRUE; 00915 } else { 00916 SET_LAST_NT_ERROR (m.ReturnValue); 00917 return FALSE; 00918 } 00919 00920 00921 }

BOOL WINAPI SetConsoleFont IN HANDLE  hConsoleOutput,
IN DWORD  nFont
 

Definition at line 1203 of file ntcon/client/getset.c.

References _CONSOLE_SETFONT_MSG::ConsoleHandle, ConsolepSetFont, CsrClientCallServer(), FALSE, _CONSOLE_SETFONT_MSG::FontIndex, GET_CONSOLE_HANDLE, NT_SUCCESS, NULL, _CONSOLE_SETFONT_MSG::OutputHandle, SET_LAST_NT_ERROR, TRUE, and _CONSOLE_API_MSG::u.

01210 : 01211 01212 hConsoleOutput - Supplies an open handle to console output. 01213 01214 nFont - Number of font to set as current font 01215 01216 Return Value: 01217 01218 TRUE - The operation was successful. 01219 01220 FALSE/NULL - The operation failed. Extended error status is available 01221 using GetLastError. 01222 01223 --*/ 01224 01225 { 01226 01227 CONSOLE_API_MSG m; 01228 PCONSOLE_SETFONT_MSG a = &m.u.SetConsoleFont; 01229 01230 a->ConsoleHandle = GET_CONSOLE_HANDLE; 01231 a->OutputHandle = hConsoleOutput; 01232 a->FontIndex = nFont; 01233 CsrClientCallServer( (PCSR_API_MSG)&m, 01234 NULL, 01235 CSR_MAKE_API_NUMBER( CONSRV_SERVERDLL_INDEX, 01236 ConsolepSetFont 01237 ), 01238 sizeof( *a ) 01239 ); 01240 if (NT_SUCCESS( m.ReturnValue )) { 01241 return TRUE; 01242 } else { 01243 SET_LAST_NT_ERROR (m.ReturnValue); 01244 return FALSE; 01245 } 01246 01247 }

BOOL WINAPI SetConsoleIcon IN HICON  hIcon  ) 
 

Definition at line 1251 of file ntcon/client/getset.c.

References _CONSOLE_SETICON_MSG::ConsoleHandle, ConsolepSetIcon, CsrClientCallServer(), FALSE, GET_CONSOLE_HANDLE, _CONSOLE_SETICON_MSG::hIcon, NT_SUCCESS, NULL, SET_LAST_NT_ERROR, TRUE, and _CONSOLE_API_MSG::u.

01257 : 01258 01259 hIcon - Supplies an icon handle. 01260 01261 Return Value: 01262 01263 TRUE - The operation was successful. 01264 01265 FALSE/NULL - The operation failed. Extended error status is available 01266 using GetLastError. 01267 01268 --*/ 01269 01270 { 01271 01272 CONSOLE_API_MSG m; 01273 PCONSOLE_SETICON_MSG a = &m.u.SetConsoleIcon; 01274 01275 a->ConsoleHandle = GET_CONSOLE_HANDLE; 01276 a->hIcon = hIcon; 01277 CsrClientCallServer( (PCSR_API_MSG)&m, 01278 NULL, 01279 CSR_MAKE_API_NUMBER( CONSRV_SERVERDLL_INDEX, 01280 ConsolepSetIcon 01281 ), 01282 sizeof( *a ) 01283 ); 01284 if (NT_SUCCESS( m.ReturnValue )) { 01285 return TRUE; 01286 } else { 01287 SET_LAST_NT_ERROR (m.ReturnValue); 01288 return FALSE; 01289 } 01290 01291 }

BOOL APIENTRY SetConsoleMaximumWindowSize HANDLE  hConsoleOutput,
COORD  dwWindowSize
 

defined(BUILD_WOW6432)

Definition at line 1299 of file ntcon/client/getset.c.

References TRUE.

01303 { 01304 UNREFERENCED_PARAMETER(hConsoleOutput); 01305 UNREFERENCED_PARAMETER(dwWindowSize); 01306 01307 return TRUE; 01308 }

BOOL WINAPI SetConsoleMode IN HANDLE  hConsoleHandle,
IN DWORD  dwMode
 

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

References _CONSOLE_MODE_MSG::ConsoleHandle, ConsolepSetMode, CsrClientCallServer(), FALSE, GET_CONSOLE_HANDLE, _CONSOLE_MODE_MSG::Handle, _CONSOLE_MODE_MSG::Mode, NT_SUCCESS, NULL, SET_LAST_NT_ERROR, TRUE, and _CONSOLE_API_MSG::u.

Referenced by main(), and PrintPair().

00615 : 00616 00617 hConsoleHandle - Supplies a console input or output handle. 00618 00619 dwMode - Supplies mode. 00620 00621 Input Mode Flags: 00622 00623 ENABLE_LINE_INPUT - line oriented input is on. 00624 00625 ENABLE_ECHO_INPUT - characters will be written to the screen as they are 00626 read. 00627 00628 ENABLE_WINDOW_INPUT - the caller is windows-aware 00629 00630 Output Mode Flags: 00631 00632 ENABLE_LINE_OUTPUT - line oriented output is on. 00633 00634 ENABLE_WRAP_AT_EOL_OUTPUT - the cursor will move to the 00635 beginning of the next line when the end of the row 00636 is reached. 00637 00638 00639 Return Value: 00640 00641 TRUE - The operation was successful. 00642 00643 FALSE/NULL - The operation failed. Extended error status is available 00644 using GetLastError. 00645 00646 --*/ 00647 00648 { 00649 00650 CONSOLE_API_MSG m; 00651 PCONSOLE_MODE_MSG a = &m.u.SetConsoleMode; 00652 00653 a->ConsoleHandle = GET_CONSOLE_HANDLE; 00654 a->Handle = hConsoleHandle; 00655 a->Mode = dwMode; 00656 CsrClientCallServer( (PCSR_API_MSG)&m, 00657 NULL, 00658 CSR_MAKE_API_NUMBER( CONSRV_SERVERDLL_INDEX, 00659 ConsolepSetMode 00660 ), 00661 sizeof( *a ) 00662 ); 00663 if (NT_SUCCESS( m.ReturnValue )) { 00664 return TRUE; 00665 } else { 00666 SET_LAST_NT_ERROR (m.ReturnValue); 00667 return FALSE; 00668 } 00669 00670 }

BOOL WINAPI SetConsoleOutputCP IN UINT  wCodePageID  ) 
 

defined(BUILD_WOW6432)

++

Parameters:

wCodePageID - the code page is to set for the current console output.

Return Value:

TRUE - The operation was successful.

FALSE/NULL - The operation failed. Extended error status is available using GetLastError.

--

Definition at line 1501 of file ntcon/client/getset.c.

References FALSE, NT_SUCCESS, NTSTATUS(), SET_LAST_NT_ERROR, SetConsoleOutputCPInternal(), SetTEBLangID(), Status, and TRUE.

01507 : 01508 01509 wCodePageID - the code page is to set for the current console output. 01510 01511 Return Value: 01512 01513 TRUE - The operation was successful. 01514 01515 FALSE/NULL - The operation failed. Extended error status is available 01516 using GetLastError. 01517 01518 01519 --*/ 01520 01521 { 01522 01523 NTSTATUS Status; 01524 01525 Status = SetConsoleOutputCPInternal(wCodePageID); 01526 01527 if(NT_SUCCESS(Status)) { 01528 SetTEBLangID(); 01529 return TRUE; 01530 } 01531 else { 01532 SET_LAST_NT_ERROR (Status); 01533 return FALSE; 01534 } 01535 }

NTSTATUS APIENTRY SetConsoleOutputCPInternal IN UINT  wCodePageID  ) 
 

Definition at line 1469 of file ntcon/client/getset.c.

References _CONSOLE_SETCP_MSG::ConsoleHandle, ConsolepSetCP, CsrClientCallServer(), GET_CONSOLE_HANDLE, NULL, _CONSOLE_SETCP_MSG::Output, TRUE, _CONSOLE_API_MSG::u, and _CONSOLE_SETCP_MSG::wCodePageID.

Referenced by SetConsoleOutputCP().

01472 { 01473 CONSOLE_API_MSG m; 01474 PCONSOLE_SETCP_MSG a = &m.u.SetConsoleCP; 01475 01476 a->ConsoleHandle = GET_CONSOLE_HANDLE; 01477 a->Output = TRUE; 01478 a->wCodePageID = wCodePageID; 01479 #if defined(FE_SB) 01480 a->hEvent = NULL; 01481 #endif 01482 01483 CsrClientCallServer( (PCSR_API_MSG)&m, 01484 NULL, 01485 CSR_MAKE_API_NUMBER( CONSRV_SERVERDLL_INDEX, 01486 ConsolepSetCP 01487 ), 01488 sizeof( *a ) 01489 ); 01490 01491 return m.ReturnValue; 01492 }

BOOL WINAPI SetConsoleScreenBufferSize IN HANDLE  hConsoleOutput,
IN COORD  dwSize
 

Definition at line 827 of file ntcon/client/getset.c.

References _CONSOLE_SETSCREENBUFFERSIZE_MSG::ConsoleHandle, ConsolepSetScreenBufferSize, CsrClientCallServer(), FALSE, GET_CONSOLE_HANDLE, NT_SUCCESS, NULL, _CONSOLE_SETSCREENBUFFERSIZE_MSG::OutputHandle, SET_LAST_NT_ERROR, _CONSOLE_SETSCREENBUFFERSIZE_MSG::Size, TRUE, and _CONSOLE_API_MSG::u.

00834 : 00835 00836 hConsoleInput - Supplies an open handle to console input. 00837 00838 dwSize - New size of screen buffer in rows and columns 00839 00840 Return Value: 00841 00842 TRUE - The operation was successful. 00843 00844 FALSE/NULL - The operation failed. Extended error status is available 00845 using GetLastError. 00846 00847 --*/ 00848 00849 { 00850 00851 CONSOLE_API_MSG m; 00852 PCONSOLE_SETSCREENBUFFERSIZE_MSG a = &m.u.SetConsoleScreenBufferSize; 00853 00854 a->ConsoleHandle = GET_CONSOLE_HANDLE; 00855 a->OutputHandle = hConsoleOutput; 00856 a->Size = dwSize; 00857 CsrClientCallServer( (PCSR_API_MSG)&m, 00858 NULL, 00859 CSR_MAKE_API_NUMBER( CONSRV_SERVERDLL_INDEX, 00860 ConsolepSetScreenBufferSize 00861 ), 00862 sizeof( *a ) 00863 ); 00864 if (NT_SUCCESS( m.ReturnValue )) { 00865 return TRUE; 00866 } else { 00867 SET_LAST_NT_ERROR (m.ReturnValue); 00868 return FALSE; 00869 } 00870 00871 00872 }

BOOL WINAPI SetConsoleTextAttribute IN HANDLE  hConsoleOutput,
IN WORD  wAttributes
 

defined(BUILD_WOW64)

Definition at line 1155 of file ntcon/client/getset.c.

References _CONSOLE_SETTEXTATTRIBUTE_MSG::Attributes, _CONSOLE_SETTEXTATTRIBUTE_MSG::ConsoleHandle, ConsolepSetTextAttribute, CsrClientCallServer(), FALSE, GET_CONSOLE_HANDLE, NT_SUCCESS, NULL, _CONSOLE_SETTEXTATTRIBUTE_MSG::OutputHandle, SET_LAST_NT_ERROR, TRUE, and _CONSOLE_API_MSG::u.

01162 : 01163 01164 hConsoleOutput - Supplies an open handle to console output. 01165 01166 wAttributes - Character display attributes. 01167 01168 Return Value: 01169 01170 TRUE - The operation was successful. 01171 01172 FALSE/NULL - The operation failed. Extended error status is available 01173 using GetLastError. 01174 01175 --*/ 01176 01177 { 01178 01179 CONSOLE_API_MSG m; 01180 PCONSOLE_SETTEXTATTRIBUTE_MSG a = &m.u.SetConsoleTextAttribute; 01181 01182 a->ConsoleHandle = GET_CONSOLE_HANDLE; 01183 a->OutputHandle = hConsoleOutput; 01184 a->Attributes = wAttributes; 01185 CsrClientCallServer( (PCSR_API_MSG)&m, 01186 NULL, 01187 CSR_MAKE_API_NUMBER( CONSRV_SERVERDLL_INDEX, 01188 ConsolepSetTextAttribute 01189 ), 01190 sizeof( *a ) 01191 ); 01192 if (NT_SUCCESS( m.ReturnValue )) { 01193 return TRUE; 01194 } else { 01195 SET_LAST_NT_ERROR (m.ReturnValue); 01196 return FALSE; 01197 } 01198 01199 }

BOOL WINAPI SetConsoleWindowInfo IN HANDLE  hConsoleOutput,
IN BOOL  bAbsolute,
IN CONST SMALL_RECT *  lpConsoleWindow
 

Definition at line 980 of file ntcon/client/getset.c.

References _CONSOLE_SETWINDOWINFO_MSG::Absolute, _CONSOLE_SETWINDOWINFO_MSG::ConsoleHandle, ConsolepSetWindowInfo, CsrClientCallServer(), EXCEPTION_EXECUTE_HANDLER, FALSE, GET_CONSOLE_HANDLE, NT_SUCCESS, NULL, _CONSOLE_SETWINDOWINFO_MSG::OutputHandle, SET_LAST_ERROR, SET_LAST_NT_ERROR, TRUE, _CONSOLE_API_MSG::u, and _CONSOLE_SETWINDOWINFO_MSG::Window.

00988 : 00989 00990 hConsoleOutput - Supplies an open handle to console output. 00991 00992 lpConsoleWindow - A pointer to a rectangle containing the new 00993 dimensions of the console window in screen buffer coordinates. 00994 00995 Return Value: 00996 00997 TRUE - The operation was successful. 00998 00999 FALSE/NULL - The operation failed. Extended error status is available 01000 using GetLastError. 01001 01002 --*/ 01003 01004 { 01005 01006 CONSOLE_API_MSG m; 01007 PCONSOLE_SETWINDOWINFO_MSG a = &m.u.SetConsoleWindowInfo; 01008 01009 a->ConsoleHandle = GET_CONSOLE_HANDLE; 01010 a->OutputHandle = hConsoleOutput; 01011 a->Absolute = bAbsolute; 01012 try { 01013 a->Window = *lpConsoleWindow; 01014 } except( EXCEPTION_EXECUTE_HANDLER ) { 01015 SET_LAST_ERROR(ERROR_INVALID_ACCESS); 01016 return FALSE; 01017 } 01018 CsrClientCallServer( (PCSR_API_MSG)&m, 01019 NULL, 01020 CSR_MAKE_API_NUMBER( CONSRV_SERVERDLL_INDEX, 01021 ConsolepSetWindowInfo 01022 ), 01023 sizeof( *a ) 01024 ); 01025 if (NT_SUCCESS( m.ReturnValue )) { 01026 return TRUE; 01027 } else { 01028 SET_LAST_NT_ERROR (m.ReturnValue); 01029 return FALSE; 01030 } 01031 01032 }


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