Commit f54c7205 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

kernel32: Use IOCTL_CONDRV_GET_INPUT_INFO in CONSOLE_GetNumHistoryEntries.

parent 36fc962f
......@@ -1009,16 +1009,11 @@ BOOL CONSOLE_AppendHistory(const WCHAR* ptr)
*
*
*/
unsigned CONSOLE_GetNumHistoryEntries(void)
unsigned CONSOLE_GetNumHistoryEntries(HANDLE console)
{
unsigned ret = -1;
SERVER_START_REQ(get_console_input_info)
{
req->handle = 0;
if (!wine_server_call_err( req )) ret = reply->history_index;
}
SERVER_END_REQ;
return ret;
struct condrv_input_info info;
BOOL ret = DeviceIoControl( console, IOCTL_CONDRV_GET_INPUT_INFO, NULL, 0, &info, sizeof(info), NULL, NULL );
return ret ? info.history_index : ~0;
}
/******************************************************************
......
......@@ -24,7 +24,7 @@
/* console.c */
extern int CONSOLE_GetHistory(int idx, WCHAR* buf, int buf_len) 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 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)
{
ctx->histPos = CONSOLE_GetNumHistoryEntries();
ctx->histPos = CONSOLE_GetNumHistoryEntries(ctx->hConIn);
ctx->histSize = ctx->histPos + 1;
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 history_mode; /* whether we duplicate 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 input_count; /* number of available input records */
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.history_mode = console->history_mode;
info.history_size = console->history_size;
info.history_index = console->history_index;
info.edition_mode = console->edition_mode;
info.input_count = console->recnum;
info.win = console->win;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment