Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions runtime/shims/registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ std::vector<Lookup> 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.
// libhttpclient.gdk.dll GDK reference, gaming/gdk/docs/reference/system/httpclient/functions/<name>:
// HCInitialize, HCCleanupAsync, HCSettingsGetTraceLevel, HCHttpCallCreate,
// HCHttpCallCloseHandle, HCHttpCallPerformAsync, HCHttpCallGetRequestUrl,
// HCHttpCallSetTracing, HCHttpCallRequest* and HCHttpCallResponse* return HRESULT.
// HCHttpCallDuplicateHandle returns HCCallHandle (a pointer), and HCTraceImplMessage /
// HCTraceSetEtwEnabled return void, so they stay Other.
const char* const kNotHResult[] = {
"XAsyncCancel", "XAsyncComplete",
"XTaskQueueCloseHandle", "XTaskQueueDispatch", "XTaskQueueGetCurrentProcessTaskQueue",
Expand Down Expand Up @@ -137,6 +143,12 @@ ReturnClass classify(const std::string& dll, const std::string& name) {
if (name == "DStorageGetFactory") return ReturnClass::HResult;
} else if (is_audio_hal_hresult(dll, name)) {
return ReturnClass::HResult;
} else if (dll == "libhttpclient.gdk.dll") {
if (name == "HCInitialize" || name == "HCCleanupAsync" || name == "HCSettingsGetTraceLevel" ||
name == "HCHttpCallCreate" || name == "HCHttpCallCloseHandle" || name == "HCHttpCallPerformAsync" ||
name == "HCHttpCallGetRequestUrl" || name == "HCHttpCallSetTracing" ||
starts_with(name, "HCHttpCallRequest") || starts_with(name, "HCHttpCallResponse"))
return ReturnClass::HResult;
} else if (dll == "xgameruntime.dll") {
if (name == "XGameRuntimeInitialize" || name == "XGameEventWrite") return ReturnClass::HResult;
for (const char* n : kNotHResult)
Expand Down
11 changes: 11 additions & 0 deletions runtime/test/unimplemented_policy_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,17 @@ void test_classification() {
check(cls("acphal.dll", "ApuFree") == ReturnClass::Other, "ApuFree is void");
check(cls("acphal.dll", "ApuMapVirtualAddress") == ReturnClass::Other,
"ApuMapVirtualAddress returns a 32-bit APU address");
check(cls("libHttpClient.GDK.dll", "HCInitialize") == ReturnClass::HResult, "HCInitialize is hresult");
check(cls("libhttpclient.gdk.dll", "HCCleanupAsync") == ReturnClass::HResult, "HCCleanupAsync is hresult");
check(cls("libhttpclient.gdk.dll", "HCHttpCallCreate") == ReturnClass::HResult, "HCHttpCallCreate is hresult");
check(cls("libhttpclient.gdk.dll", "HCHttpCallPerformAsync") == ReturnClass::HResult, "HCHttpCallPerformAsync is hresult");
check(cls("libhttpclient.gdk.dll", "HCHttpCallRequestSetUrl") == ReturnClass::HResult, "HCHttpCallRequest* is hresult");
check(cls("libhttpclient.gdk.dll", "HCHttpCallResponseGetStatusCode") == ReturnClass::HResult,
"HCHttpCallResponse* is hresult");
check(cls("libhttpclient.gdk.dll", "HCHttpCallDuplicateHandle") == ReturnClass::Other,
"HCHttpCallDuplicateHandle returns HCCallHandle, not hresult");
check(cls("libhttpclient.gdk.dll", "HCTraceImplMessage") == ReturnClass::Other,
"HCTraceImplMessage returns void");
check(cls("xgameruntime.dll", "XGameRuntimeInitialize") == ReturnClass::HResult, "XGameRuntimeInitialize");
check(cls("xgameruntime.dll", "XUserAddAsync") == ReturnClass::HResult, "XUser* is hresult");
check(cls("xgameruntime.dll", "XTaskQueueCreate") == ReturnClass::HResult, "XTaskQueueCreate is hresult");
Expand Down
Loading