kernel32: Use IOCTL_CONDRV_GET_INPUT_INFO in CONSOLE_GetNumHistoryEntries.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
36fc962f5c
commit
f54c7205b6
|
@ -1009,16 +1009,11 @@ BOOL CONSOLE_AppendHistory(const WCHAR* ptr)
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
unsigned CONSOLE_GetNumHistoryEntries(void)
|
unsigned CONSOLE_GetNumHistoryEntries(HANDLE console)
|
||||||
{
|
{
|
||||||
unsigned ret = -1;
|
struct condrv_input_info info;
|
||||||
SERVER_START_REQ(get_console_input_info)
|
BOOL ret = DeviceIoControl( console, IOCTL_CONDRV_GET_INPUT_INFO, NULL, 0, &info, sizeof(info), NULL, NULL );
|
||||||
{
|
return ret ? info.history_index : ~0;
|
||||||
req->handle = 0;
|
|
||||||
if (!wine_server_call_err( req )) ret = reply->history_index;
|
|
||||||
}
|
|
||||||
SERVER_END_REQ;
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
/* console.c */
|
/* console.c */
|
||||||
extern int CONSOLE_GetHistory(int idx, WCHAR* buf, int buf_len) DECLSPEC_HIDDEN;
|
extern int CONSOLE_GetHistory(int idx, WCHAR* buf, int buf_len) DECLSPEC_HIDDEN;
|
||||||
extern BOOL CONSOLE_AppendHistory(const WCHAR *p) DECLSPEC_HIDDEN;
|
extern BOOL CONSOLE_AppendHistory(const WCHAR *p) DECLSPEC_HIDDEN;
|
||||||
extern unsigned CONSOLE_GetNumHistoryEntries(void) DECLSPEC_HIDDEN;
|
extern unsigned CONSOLE_GetNumHistoryEntries(HANDLE) DECLSPEC_HIDDEN;
|
||||||
extern void CONSOLE_FillLineUniform(HANDLE hConsoleOutput, int i, int j, int len, LPCHAR_INFO lpFill) DECLSPEC_HIDDEN;
|
extern void CONSOLE_FillLineUniform(HANDLE hConsoleOutput, int i, int j, int len, LPCHAR_INFO lpFill) DECLSPEC_HIDDEN;
|
||||||
extern BOOL CONSOLE_GetEditionMode(HANDLE, int*) DECLSPEC_HIDDEN;
|
extern BOOL CONSOLE_GetEditionMode(HANDLE, int*) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
|
|
|
@ -408,7 +408,7 @@ static WCHAR* WCEL_GetHistory(WCEL_Context* ctx, int idx)
|
||||||
|
|
||||||
static void WCEL_HistoryInit(WCEL_Context* ctx)
|
static void WCEL_HistoryInit(WCEL_Context* ctx)
|
||||||
{
|
{
|
||||||
ctx->histPos = CONSOLE_GetNumHistoryEntries();
|
ctx->histPos = CONSOLE_GetNumHistoryEntries(ctx->hConIn);
|
||||||
ctx->histSize = ctx->histPos + 1;
|
ctx->histSize = ctx->histPos + 1;
|
||||||
ctx->histCurr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WCHAR));
|
ctx->histCurr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WCHAR));
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,6 +74,7 @@ struct condrv_input_info
|
||||||
unsigned int output_cp; /* console output codepage */
|
unsigned int output_cp; /* console output codepage */
|
||||||
unsigned int history_mode; /* whether we duplicate lines in history */
|
unsigned int history_mode; /* whether we duplicate lines in history */
|
||||||
unsigned int history_size; /* number of lines in history */
|
unsigned int history_size; /* number of lines in history */
|
||||||
|
unsigned int history_index; /* number of used lines in history */
|
||||||
unsigned int edition_mode; /* index to the edition mode flavors */
|
unsigned int edition_mode; /* index to the edition mode flavors */
|
||||||
unsigned int input_count; /* number of available input records */
|
unsigned int input_count; /* number of available input records */
|
||||||
condrv_handle_t win; /* renderer window handle */
|
condrv_handle_t win; /* renderer window handle */
|
||||||
|
|
|
@ -1595,6 +1595,7 @@ static int console_input_ioctl( struct fd *fd, ioctl_code_t code, struct async *
|
||||||
info.output_cp = console->output_cp;
|
info.output_cp = console->output_cp;
|
||||||
info.history_mode = console->history_mode;
|
info.history_mode = console->history_mode;
|
||||||
info.history_size = console->history_size;
|
info.history_size = console->history_size;
|
||||||
|
info.history_index = console->history_index;
|
||||||
info.edition_mode = console->edition_mode;
|
info.edition_mode = console->edition_mode;
|
||||||
info.input_count = console->recnum;
|
info.input_count = console->recnum;
|
||||||
info.win = console->win;
|
info.win = console->win;
|
||||||
|
|
Loading…
Reference in New Issue