diff --git a/runtime/shims/registry.cpp b/runtime/shims/registry.cpp index 59f1da1066..04ce70b584 100644 --- a/runtime/shims/registry.cpp +++ b/runtime/shims/registry.cpp @@ -84,6 +84,12 @@ 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. +// libhttpclient.gdk.dll GDK reference, gaming/gdk/docs/reference/system/httpclient/functions/: +// 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", @@ -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) diff --git a/runtime/test/unimplemented_policy_test.cpp b/runtime/test/unimplemented_policy_test.cpp index 796b9a0de1..4f6f46fdfc 100644 --- a/runtime/test/unimplemented_policy_test.cpp +++ b/runtime/test/unimplemented_policy_test.cpp @@ -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");