[PATCH v44 0/27] MR10291: Fix GetModuleFileName string termination
After Windows XP the string termination behavior of GetModuleFileName was changed to always terminate the path returned, even if the buffer is insufficient to contain the null terminator. -- v44: kernel32: Fix string termination of GetModuleFileName Add tests for GetModuleFileName string termination. advapi32: Implement LockServiceDatabase() and UnlockServiceDatabase(). services: Add proper handle management to LockServiceDatabase() and UnlockServiceDatabase(). advapi32/tests: Add some tests for LockServiceDatabase(). winex11: Update queue input time on WM_TAKE_FOCUS. cabinet: Add stubs for compressor/decompressor. windows.web: Implement JsonObject typed getters. windows.web: Support boolean & number value creation. windows.web: Implement JsonArray element getters. windows.web: Support json object parsing. windows.web: Add a IMap_HSTRING_IInspectable to json objects. windows.web: Support json array parsing. windows.web: Stub JsonArray runtime class. windows.web: Skip whitespace in json_buffer_take. windows.web: Rename JsonObject class methods. server: Share more code between 32- and 64-bit PE data directory handling. server: Add a helper function to trace a Unicode string. winhttp: Always buffer response data. winhttp: Introduce struct read_buffer. vbscript: Return "Object required" error (424) instead of E_FAIL/E_NOTIMPL. vbscript: Fix crash in ReDim on uninitialized dynamic arrays. vbscript: Implement GetRef. vbscript: Improve some error codes in the parser. vbscript: Improve some error codes in the lexer. vbscript: Improve some error codes in the compiler. vbscript: Add error code tests for compile errors. This merge request has too many patches to be relayed via email. Please visit the URL below to see the contents of the merge request. https://gitlab.winehq.org/wine/wine/-/merge_requests/10291
On Thu Mar 26 23:40:59 2026 +0000, eric pouech wrote:
didn't retest it, but the len \< size code path should already be handled in ntdll and i'd move this above the done: label (so you don't to init the status to O) and handle it in ``` if (status == STATUS_BUFFER_TOO_SMALL && size) filename[size - 1] = L'\0'; ``` I've moved the code from the done section but kept the `filename[len] = 0` in this function so the termination semantics are explicit in this API.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/10291#note_133956
participants (1)
-
Trent Waddington (@trent.waddington)