Skip to content

Add kernel32, user32 and oleaut32 APIs the Delphi compilers call - #158

Open
cweerm wants to merge 2 commits into
decompals:mainfrom
cweerm:delphi-apis
Open

cweerm wants to merge 2 commits into
decompals:mainfrom
cweerm:delphi-apis

Conversation

@cweerm

@cweerm cweerm commented Oct 28, 2026

Copy link
Copy Markdown

Win32 APIs called by the Delphi 11 command-line compilers (dcc32.exe, dcc64.exe, dcclinux64.exe) that wibo did not implement.

Builds on #157: the named file mappings here need that PR's memfd-backed sections, so this branch contains its commit. Only the last commit is new; I'll rebase once #157 merges.

kernel32:

  • Files and volumes: AreFileApisANSI, FindFirstFileExW, GetFileSizeEx, SearchPathA, FindFirstVolumeW, FindNextVolumeW, FindVolumeClose (the host filesystem is reported as one volume).
  • Mappings and memory: named sections in CreateFileMappingA/W (a second create returns the existing object and sets ERROR_ALREADY_EXISTS), OpenFileMappingA/W, and VirtualQueryEx for the current process.
  • Modules: LoadLibraryExA.
  • System info: GetNativeSystemInfo, VerSetConditionMask, VerifyVersionInfoW.
  • Locale: GetThreadLocale, SetThreadLocale, GetThreadUILanguage, GetThreadPreferredUILanguages, SetThreadPreferredUILanguages, EnumCalendarInfoW, CompareStringOrdinal.
  • Sync: SetCriticalSectionSpinCount (spinning is not modelled).

user32: CharLowerBuffW, CharToOemBuffA (ANSI and OEM share one code page in wibo, so it copies).

oleaut32, new module: SysAllocStringLen, SysFreeString.

New fixtures: test_bstr, test_charbuff, test_findvolume, test_getfilesizeex, test_searchpath, test_versioninfo. Extended: test_createfilemapping, test_critical_section, test_external_dll, test_findfile, test_locale, test_virtualquery.

Testing:

  • The repo CI workflow, run on this branch in my fork: all pass except test_namedpipe, see below.
  • Every new and extended fixture passes under Wine 9.0. On Windows (GitHub windows-latest) all pass except test_findfile and test_locale, which stop at existing upstream checks before reaching the new ones.
  • Two checks were adjusted to what Windows does: SysAllocStringLen(NULL, n) only guarantees the terminator, and test_versioninfo skips VER_GREATER/VER_LESS at the current major, where Windows 10 returns TRUE and Wine returns FALSE.

test_namedpipe fails in the Ubuntu 32-bit CI jobs on current main as well (test_namedpipe.c:64, seen in a fork CI run of d394386), so that failure is not from this PR.

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant