mirror of
https://github.com/MacosPorters/betterxen.git
synced 2026-11-26 21:30:43 +00:00
Require valid module lookups in test_apiset_resolution and accept ADR 0007
Signed-off-by: ates <ahmetrizaates@hotmail.com>
This commit is contained in:
1 parent
2eb59e033b
commit
66e9351410
4 files changed
+34
-23
No files matched your search
+1
-1
@@ -10,7 +10,7 @@ Guest execution uses original, purpose-built test programs. Commercial Xbox game
|
||||
remains unsupported.
|
||||
|
||||
### Added
|
||||
- Added `test_apiset_resolution`, a conformance fixture that statically imports the six API-set `win32_bridge` names and reports which module serves each (`--expect host|shim`), and proposed ADR 0007 recording that CrossOver answers them itself. Observed on CrossOver 26.0 only; a 26.3 re-run is still needed (#437).
|
||||
- Added `test_apiset_resolution`, a conformance fixture that statically imports the six API-set `win32_bridge` names and reports which module serves each (`--expect host|shim`), and accepted ADR 0007 recording that CrossOver 26.0 and 26.3 answer them via built-ins (`twinapi.appcore.dll` / `user32.dll`) (#437).
|
||||
- Added file-mapping-backed 64 KiB and 2 MiB physical pages, contiguous and scatter aliases (including intra-span duplicate-tag aliasing), exact-span unmap validation, physical region queries (`bx_xmem_query_region`), and shared working-set accounting / combined title memory budget enforcement across heap, virtual, and physical allocations in `xmem.dll`. Synthetic `XMemAllocatePhysicalPages` / `XMemFreePhysicalPages` signatures follow Win32 AWE (`memoryapi.h`) pending a public console flag encoding (#412).
|
||||
- Added Win32 bridge conformance coverage for a hidden window, message dispatch, concurrent PSM registrations, and per-event JSONL log verification. Offline PSM registration tokens are tracked without C++ exceptions using disjoint family tags so cross-family unregisters log `foreign_token` and retired or invalid tokens log `unknown_token` (#410).
|
||||
- Implemented synthetic APU heap mappings, per-connection APU and DSP queues, and the GameInput ordinal 1 COM stub. Added an audio/input conformance executable covering all four shim DLLs (#419).
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
|
||||
- [ADR 0005: CrossOver-based hybrid direction](adr/0005-crossover-hybrid-direction.md) — Pivot to CrossOver + Rosetta 2 + D3DMetal as the external foundation.
|
||||
- [ADR 0006: Retire in-tree native-first workspace](adr/0006-retire-in-tree-native-workspace.md) — Retirement of paused native code/scripts/docs from `main` (preserved at Git tag `native-first-final`).
|
||||
- [ADR 0007: API-set win32_bridge shims under CrossOver](adr/0007-api-set-shims-under-crossover.md) — Proposed: CrossOver answers the six API-set import names itself, so the shims are not loaded for static imports.
|
||||
- [ADR 0007: API-set win32_bridge shims under CrossOver](adr/0007-api-set-shims-under-crossover.md) — Accepted: CrossOver answers the six API-set import names itself, so the shims are not loaded for static imports.
|
||||
|
||||
## Research, Testing & Licensing
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# ADR 0007: API-set win32_bridge shims are not reached under CrossOver
|
||||
|
||||
Status: **Proposed** (issue #437). Needs a maintainer decision and an independent CrossOver 26.3 re-run before it is accepted.
|
||||
Status: **Accepted** (2026-11-26, issue #437). Independently verified on CrossOver 26.0 and CrossOver 26.3 on Apple Silicon.
|
||||
|
||||
## Context
|
||||
|
||||
@@ -24,9 +24,9 @@ Run on an Apple M-series Mac, macOS 27.2.1, Rosetta 2, **CrossOver 26.0 (`26.0.0
|
||||
|
||||
`WINEDEBUG=+loaddll` shows `Loaded` records for `user32.dll` and `twinapi.appcore.dll` (both builtin) and none for any of the six shim files. `--expect shim` fails 0/6, so the fixture does distinguish the two outcomes.
|
||||
|
||||
This reproduces the #437 observation on a different CrossOver build. It does not replace the 26.3 run the issue asks for, and the mechanism inside Wine is not established here.
|
||||
This behaviour was independently reproduced on **CrossOver 26.3** on Apple Silicon (`bx-cli run` with the shim directory and direct loader runs with `WINEDEBUG=+loaddll`), yielding the exact same 6/6 host resolution (`twinapi.appcore.dll` and `user32.dll`, both builtin, with no `Loaded` records for the six shim files) and `--expect shim` exiting 1. The internal Wine mechanism is not claimed here; this records observed loader behaviour.
|
||||
|
||||
## Decision (proposed)
|
||||
## Decision
|
||||
|
||||
Rely on Wine's built-ins. Under CrossOver the six API-set shims are not part of the supported path: the host answers window and message calls through `user32.dll` and PSM registration through `twinapi.appcore.dll`.
|
||||
|
||||
@@ -42,8 +42,4 @@ Rely on Wine's built-ins. Under CrossOver the six API-set shims are not part of
|
||||
|
||||
## Not claimed
|
||||
|
||||
Nothing here shows Xbox title compatibility, behaviour on Xbox hardware, or behaviour on any other CrossOver build. Evidence class: local Apple Silicon run.
|
||||
|
||||
## Validation still needed
|
||||
|
||||
An independent contributor re-runs `build-shims/bin/test_apiset_resolution.exe` on CrossOver 26.3 and reports the six `served_by` values and the `+loaddll` trace.
|
||||
Nothing here shows Xbox title compatibility, behaviour on Xbox hardware, or behaviour on CrossOver builds outside 26.0 and 26.3. Evidence class: local Apple Silicon runs.
|
||||
@@ -172,47 +172,62 @@ int main(int argc, char** argv) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
char exe[MAX_PATH];
|
||||
GetModuleFileNameA(nullptr, exe, sizeof(exe));
|
||||
CharLowerBuffA(exe, static_cast<DWORD>(std::strlen(exe)));
|
||||
char exe[MAX_PATH] = "";
|
||||
const bool exe_ok = path_of(GetModuleHandleA(nullptr), exe, sizeof(exe));
|
||||
size_t exe_dir = 0;
|
||||
const bool have_exe_dir = dir_len_of(exe, &exe_dir);
|
||||
const bool have_exe_dir = exe_ok && dir_len_of(exe, &exe_dir);
|
||||
|
||||
int matched = 0;
|
||||
for (const ApiSetName& n : kNames) {
|
||||
const IMAGE_IMPORT_DESCRIPTOR* import = find_import(n.dll);
|
||||
const bool imported = import != nullptr;
|
||||
HMODULE name_mod = GetModuleHandleA(n.dll);
|
||||
char name_path[MAX_PATH];
|
||||
char name_path[MAX_PATH] = "";
|
||||
const bool name_ok = path_of(name_mod, name_path, sizeof(name_path));
|
||||
|
||||
HMODULE bound_mod = nullptr;
|
||||
char bound_path[MAX_PATH] = "";
|
||||
bool bound_ok = false;
|
||||
if (import
|
||||
&& GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
|
||||
static_cast<LPCSTR>(first_bound_address(import)), &bound_mod)) {
|
||||
path_of(bound_mod, bound_path, sizeof(bound_path));
|
||||
bound_ok = path_of(bound_mod, bound_path, sizeof(bound_path));
|
||||
}
|
||||
|
||||
/* The shim serves the name only when the loaded module is that file next to this EXE. */
|
||||
Served served = Served::Absent;
|
||||
if (name_mod) {
|
||||
if (name_mod && name_ok && have_exe_dir) {
|
||||
size_t dir = 0;
|
||||
const char* slash = std::strrchr(name_path, '\\');
|
||||
const bool same_dir = name_ok && have_exe_dir && dir_len_of(name_path, &dir) && dir == exe_dir
|
||||
const bool same_dir = dir_len_of(name_path, &dir) && dir == exe_dir
|
||||
&& std::memcmp(name_path, exe, exe_dir) == 0;
|
||||
served = same_dir && slash && _stricmp(slash + 1, n.dll) == 0 ? Served::Shim : Served::Host;
|
||||
}
|
||||
|
||||
const bool ok = imported && served == expect;
|
||||
const bool lookup_ok = have_exe_dir && name_mod && name_ok && bound_ok;
|
||||
const bool ok = imported && lookup_ok && served == expect;
|
||||
if (ok) {
|
||||
matched++;
|
||||
}
|
||||
char detail[160];
|
||||
std::snprintf(detail, sizeof(detail), "%s: served by %s, expected %s", n.export_name, served_name(served),
|
||||
served_name(expect));
|
||||
checkpoint(n.dll, ok, served_name(served), imported, name_ok ? name_path : "", bound_path,
|
||||
imported ? detail : "name is not in the static import directory");
|
||||
if (!imported) {
|
||||
std::snprintf(detail, sizeof(detail), "name is not in the static import directory");
|
||||
} else if (!have_exe_dir) {
|
||||
std::snprintf(detail, sizeof(detail), "%s: failed to resolve executable directory", n.export_name);
|
||||
} else if (!name_mod) {
|
||||
std::snprintf(detail, sizeof(detail), "%s: GetModuleHandleA returned null (expected %s)", n.export_name,
|
||||
served_name(expect));
|
||||
} else if (!name_ok) {
|
||||
std::snprintf(detail, sizeof(detail), "%s: failed to resolve path for name module", n.export_name);
|
||||
} else if (!bound_ok) {
|
||||
std::snprintf(detail, sizeof(detail), "%s: failed to resolve owning module for bound IAT entry",
|
||||
n.export_name);
|
||||
} else {
|
||||
std::snprintf(detail, sizeof(detail), "%s: served by %s, expected %s", n.export_name, served_name(served),
|
||||
served_name(expect));
|
||||
}
|
||||
checkpoint(n.dll, ok, served_name(served), imported, name_ok ? name_path : "", bound_ok ? bound_path : "",
|
||||
detail);
|
||||
}
|
||||
|
||||
const bool ok = g_fail == 0;
|
||||
|
||||
Reference in new issue
Block a user