From: Hugh McMaster hugh.mcmaster@outlook.com
--- dlls/kernel32/tests/console.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c index 09ac8250e4f..2a071900f3c 100644 --- a/dlls/kernel32/tests/console.c +++ b/dlls/kernel32/tests/console.c @@ -38,6 +38,7 @@ static BOOL (WINAPI *pGetConsoleScreenBufferInfoEx)(HANDLE, CONSOLE_SCREEN_BUFFE static BOOL (WINAPI *pGetCurrentConsoleFontEx)(HANDLE, BOOL, CONSOLE_FONT_INFOEX *); static HANDLE (WINAPI *pOpenConsoleW)(LPCWSTR,DWORD,BOOL,DWORD); static BOOL (WINAPI *pSetConsoleInputExeNameA)(LPCSTR); +static BOOL (WINAPI *pSetConsoleScreenBufferInfoEx)(HANDLE, CONSOLE_SCREEN_BUFFER_INFOEX *); static BOOL (WINAPI *pSetCurrentConsoleFontEx)(HANDLE, BOOL, CONSOLE_FONT_INFOEX *); static BOOL (WINAPI *pVerifyConsoleIoHandle)(HANDLE handle);
@@ -89,6 +90,7 @@ static void init_function_pointers(void) KERNEL32_GET_PROC(GetCurrentConsoleFontEx); KERNEL32_GET_PROC(OpenConsoleW); KERNEL32_GET_PROC(SetConsoleInputExeNameA); + KERNEL32_GET_PROC(SetConsoleScreenBufferInfoEx); KERNEL32_GET_PROC(SetCurrentConsoleFontEx); KERNEL32_GET_PROC(VerifyConsoleIoHandle);
@@ -1072,9 +1074,9 @@ static void test_new_screen_buffer_color_attributes(HANDLE hConOut) HANDLE hConOut2; WORD orig_attr, orig_popup, attr;
- if (!pGetConsoleScreenBufferInfoEx) + if (!pGetConsoleScreenBufferInfoEx || !pSetConsoleScreenBufferInfoEx) { - win_skip("GetConsoleScreenBufferInfoEx not available.\n"); + win_skip("GetConsoleScreenBufferInfoEx or SetConsoleScreenBufferInfoEx not available.\n"); return; }
@@ -1124,7 +1126,7 @@ static void test_new_screen_buffer_color_attributes(HANDLE hConOut)
/* Test inheritance of different Popup Attributes */ csbi.wPopupAttributes = attr; - ret = SetConsoleScreenBufferInfoEx(hConOut, &csbi); + ret = pSetConsoleScreenBufferInfoEx(hConOut, &csbi); ok(ret, "SetConsoleScreenBufferInfoEx failed: error %lu\n", GetLastError());
hConOut2 = CreateConsoleScreenBuffer(GENERIC_READ|GENERIC_WRITE, 0, NULL, @@ -1144,7 +1146,7 @@ static void test_new_screen_buffer_color_attributes(HANDLE hConOut) ok(csbi2.wPopupAttributes == orig_attr, "Popup Attributes should match Character Attributes\n");
csbi.wPopupAttributes = orig_popup; - ret = SetConsoleScreenBufferInfoEx(hConOut, &csbi); + ret = pSetConsoleScreenBufferInfoEx(hConOut, &csbi); ok(ret, "SetConsoleScreenBufferInfoEx failed: error %lu\n", GetLastError()); }
@@ -4201,13 +4203,9 @@ static void test_FreeConsole(void) static void test_SetConsoleScreenBufferInfoEx(HANDLE std_output) { BOOL ret; - HANDLE hmod; HANDLE std_input = CreateFileA("CONIN$", GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0); - BOOL (WINAPI *pSetConsoleScreenBufferInfoEx)(HANDLE, CONSOLE_SCREEN_BUFFER_INFOEX *); CONSOLE_SCREEN_BUFFER_INFOEX info;
- hmod = GetModuleHandleA("kernel32.dll"); - pSetConsoleScreenBufferInfoEx = (void *)GetProcAddress(hmod, "SetConsoleScreenBufferInfoEx"); if (!pGetConsoleScreenBufferInfoEx || !pSetConsoleScreenBufferInfoEx) { win_skip("GetConsoleScreenBufferInfoEx or SetConsoleScreenBufferInfoEx not available.\n");