mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
terminal-win: use proper NTAPI callback for FLS
Fixes crash when FLS data is attempted to be cleared.
This affects only 32-bit build where the calling convention were not
matching the expected one. It has to be __stdcall in this case.
Fixes: 3372e17d
This commit is contained in:
@@ -632,6 +632,11 @@ void terminal_set_mouse_input(bool enable)
|
||||
}
|
||||
}
|
||||
|
||||
static VOID NTAPI fls_free_cb(PVOID ptr)
|
||||
{
|
||||
talloc_free(ptr);
|
||||
}
|
||||
|
||||
void terminal_init(void)
|
||||
{
|
||||
CONSOLE_SCREEN_BUFFER_INFO cinfo;
|
||||
@@ -653,6 +658,6 @@ void terminal_init(void)
|
||||
GetConsoleScreenBufferInfo(hSTDOUT, &cinfo);
|
||||
stdoutAttrs = cinfo.wAttributes;
|
||||
|
||||
tmp_buffers_key = FlsAlloc((PFLS_CALLBACK_FUNCTION)talloc_free);
|
||||
tmp_buffers_key = FlsAlloc(fls_free_cb);
|
||||
utf8_output = SetConsoleOutputCP(CP_UTF8);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user