diff --git a/docs/audio_hal_exe_calls.md b/docs/audio_hal_exe_calls.md index c04943c7d5..2195803b3e 100644 --- a/docs/audio_hal_exe_calls.md +++ b/docs/audio_hal_exe_calls.md @@ -66,12 +66,13 @@ open pull request for it. ## What the executable already does about a failure Four of the calls above have a branch for a negative result: `AcpHalCreate`, `AcpHalAllocateShapeContexts`, -`ApuCreateHeap` and `XApuDequeueResult`. An unimplemented import under `LEONIDA_UNIMPLEMENTED=log` returns 0, so a caller -that tests for a negative result sees success with its outputs unset; under `fail` only imports `classify_import` -knows to return an `HRESULT` get `E_NOTIMPL`, and none of these four is on that list (it names only functions the public -documentation describes). So today neither mode makes the executable take its own failure path for the audio hardware. -Whether the title survives that path, or needs the coprocessor, is **unmeasured**: it takes a run to find out, and the -first run reported in #6603 stops earlier, in `D3D12ConfigureVirtualMemoryX`. +`ApuCreateHeap` and `XApuDequeueResult`. An unimplemented import under `LEONIDA_UNIMPLEMENTED=log` returns 0, so a +caller that tests for a negative result sees success with its outputs unset; under `fail` only imports `classify_import` +knows to return an `HRESULT` get `E_NOTIMPL`; all four are on that list now (`runtime/shims/registry.cpp` names the +`AcpHal.dll`, `xapu.dll` and `chad.dll` functions whose shims return an `HRESULT`), but their shims serve them. So today +neither mode makes the executable take its own failure path for the audio hardware. Whether the title survives that +path, or needs the coprocessor, is **unmeasured**: it takes a run to find out, and the first run reported in #6603 stops +earlier, in `D3D12ConfigureVirtualMemoryX`. ## What this does not show diff --git a/runtime/shims/registry.cpp b/runtime/shims/registry.cpp index 59f1da1066..eeb9e4bdac 100644 --- a/runtime/shims/registry.cpp +++ b/runtime/shims/registry.cpp @@ -84,6 +84,8 @@ std::vector g_lookups; // xcrdapi.dll functions/dstoragegetfactory). dstorage_xs.dll is the console name; xcrdapi.dll is a // console module the title may import it from (docs/directstorage.md). dstorage.cpp serves // it; the class is kept for a build without that shim. +// xapu.dll, chad.dll the HRESULT returns of the shims in xapu_queue.cpp (xapu.dll) and xapu_chad.cpp +// (chad.dll); XApuGetResultCount returns uint32_t.XApuGetResultCount returns uint32_t. const char* const kNotHResult[] = { "XAsyncCancel", "XAsyncComplete", "XTaskQueueCloseHandle", "XTaskQueueDispatch", "XTaskQueueGetCurrentProcessTaskQueue", diff --git a/runtime/test/unimplemented_policy_test.cpp b/runtime/test/unimplemented_policy_test.cpp index 796b9a0de1..2ac4f8f03f 100644 --- a/runtime/test/unimplemented_policy_test.cpp +++ b/runtime/test/unimplemented_policy_test.cpp @@ -233,6 +233,17 @@ void test_classification() { "the console dstorage name is hresult"); check(cls("xcrdapi.dll", "DStorageGetFactory") == ReturnClass::HResult, "xcrdapi's DStorageGetFactory is hresult"); check(cls("xcrdapi.dll", "XCrdLeonidaPolicyProbe") == ReturnClass::Other, "other xcrdapi imports are other"); + check(cls("XCRDAPI.dll", "DStorageGetFactory") == ReturnClass::HResult, + "the retail spelling XCRDAPI.dll is hresult, case-insensitively"); + check(cls("dstorage.dll", "DStorageGetFactory") == ReturnClass::HResult, "the PC dstorage name is hresult"); + check(cls("xcrdapi.dll", "DStorageGetFactoryLeonidaPolicyProbe") == ReturnClass::Other, + "another xcrdapi import is other"); + for (const char* name : {"XApuConnect", "XApuDequeueResult", "XApuDisconnect", "XApuEnqueueCommand"}) + check(cls("xapu.dll", name) == ReturnClass::HResult, name); + check(cls("xapu.dll", "XApuGetResultCount") == ReturnClass::Other, "XApuGetResultCount returns uint32_t"); + for (const char* name : {"XDspActivate", "XDspConnectWithMaximumStreamLimit", "XDspDeactivate", "XDspDisconnect", + "XDspSubmitCommand"}) + check(cls("chad.dll", name) == ReturnClass::HResult, name); check(cls("xg_xs.dll", "XGCreateTexture2DComputer") == ReturnClass::Other, "unmeasured xg_xs import is other"); check(cls("xg_xs.dll", "XGCreateTextureComputer") == ReturnClass::Other, "the xg_xs shim's export is bound, not classified here");