28 Sep
2022
28 Sep
'22
3:45 p.m.
eric pouech (@epo) commented about dlls/kernelbase/console.c:
WCHAR *ptr = HeapAlloc( GetProcessHeap(), 0, sizeof(WCHAR) * size ); DWORD ret;
- if (!ptr) return 0; - ret = GetConsoleTitleW( ptr, size ); - if (ret) + if (!ptr) { - WideCharToMultiByte( GetConsoleOutputCP(), 0, ptr, ret + 1, title, size, NULL, NULL); - ret = strlen(title); + SetLastError( ERROR_NOT_ENOUGH_MEMORY );
I don't think you need to call SetLastError; HeapAlloc should already have set it -- https://gitlab.winehq.org/wine/wine/-/merge_requests/930#note_9563