mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:20:51 +01:00
[PR #89] [CLOSED] runtime/shims: shim GetDateFormatEx and GetTimeFormatEx #141
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#141
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/89
Author: @Andretuta
Created: 11/24/2026
Status: ❌ Closed
Base:
main← Head:old-pr/9819📝 Commits (1)
cb6d910runtime/shims: shim GetDateFormatEx and GetTimeFormatEx📊 Changes
4 files changed (+394 additions, -2 deletions)
View changed files
📝
runtime/CMakeLists.txt(+14 -0)➕
runtime/shims/datetime.cpp(+262 -0)➕
runtime/test/datetime_test.cpp(+116 -0)📝
scripts/build_runtime.ps1(+2 -2)📄 Description
Original description (mentions and
#Nreferences are disabled; the numbers refer to the old repository):Clean-room shim for
api-ms-win-core-datetime-l1-1-1.dll,kernel32.dll, andkernelbase.dllexportingGetDateFormatExandGetTimeFormatEx.Why
Static analysis of
game_scarlett_master.exe(local inspection only — zero game bytes/RVAs included) shows 4 direct call sites passingL""(LOCALE_NAME_USER_DEFAULT) and explicit date/time format pictures; any0return immediately throws a C++ exception.Changes
runtime/shims/datetime.cpp:LEONIDA_LOCALEwhenlpLocaleNameis null or empty (matchingGetUserDefaultLocaleName).GetDateFormatEx/GetTimeFormatExfirst; preservesERROR_INVALID_PARAMETERandERROR_INSUFFICIENT_BUFFERcontracts cleanly.LOCALE_NAME_INVARIANTand falls back to a built-in Gregorian date/time picture formatter instead of returning0.0_Init_thread_headersymbols verified viadumpbin /symbols).runtime/test/datetime_test.cppcovering DLL/registry key resolution, RFC/ISO date & 24h time format pictures, buffer size query (cch == 0),ERROR_INSUFFICIENT_BUFFER, invalid date/time fields (ERROR_INVALID_PARAMETER), unknown-locale recovery, and nullSYSTEMTIMElocal-clock formatting.shims/datetime.cppanddatetime_testintoruntime/CMakeLists.txtandscripts/build_runtime.ps1.Verification
ctest -R '^datetime$':PASS (1/1)(datetime_test: PASS (0 failures)).dumpbin /symbolsondatetime.obj:0_Init_thread_headersymbols.gta6rt.exe --dry-run game_scarlett_master.exe: resolves bothGetDateFormatExandGetTimeFormatExviashim.python scripts/check_no_game_data.py,python tests/test_ctest_registration.py(4/4OK),git diff --check.#9677(https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116632010).AI-assisted: yes
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
needs rebase(PR-CONFLICT-LABEL) #206