mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-07-09 17:25:37 -06:00
sceNpWebApi2CreateUserContext
This commit is contained in:
parent
83956518e3
commit
2aaf8b60cb
@ -8,289 +8,285 @@
|
||||
|
||||
namespace Libraries::Http2 {
|
||||
|
||||
int PS4_SYSV_ABI _Z5dummyv() {
|
||||
s32 PS4_SYSV_ABI sceHttp2AbortRequest() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2AbortRequest() {
|
||||
s32 PS4_SYSV_ABI sceHttp2AddCookie() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2AddCookie() {
|
||||
s32 PS4_SYSV_ABI sceHttp2AddRequestHeader() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2AddRequestHeader() {
|
||||
s32 PS4_SYSV_ABI sceHttp2AuthCacheFlush() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2AuthCacheFlush() {
|
||||
s32 PS4_SYSV_ABI sceHttp2CookieExport() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2CookieExport() {
|
||||
s32 PS4_SYSV_ABI sceHttp2CookieFlush() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2CookieFlush() {
|
||||
s32 PS4_SYSV_ABI sceHttp2CookieImport() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2CookieImport() {
|
||||
s32 PS4_SYSV_ABI sceHttp2CreateCookieBox() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2CreateCookieBox() {
|
||||
s32 PS4_SYSV_ABI sceHttp2CreateRequestWithURL() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2CreateRequestWithURL() {
|
||||
s32 PS4_SYSV_ABI sceHttp2CreateTemplate(s32 ctx_id, char* user_agent, s32 http_ver,
|
||||
s32 auto_proxy_conf) {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2CreateTemplate() {
|
||||
s32 PS4_SYSV_ABI sceHttp2DeleteCookieBox() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2DeleteCookieBox() {
|
||||
s32 PS4_SYSV_ABI sceHttp2DeleteRequest() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2DeleteRequest() {
|
||||
s32 PS4_SYSV_ABI sceHttp2DeleteTemplate() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2DeleteTemplate() {
|
||||
s32 PS4_SYSV_ABI sceHttp2GetAllResponseHeaders() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2GetAllResponseHeaders() {
|
||||
s32 PS4_SYSV_ABI sceHttp2GetAuthEnabled() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2GetAuthEnabled() {
|
||||
s32 PS4_SYSV_ABI sceHttp2GetAutoRedirect() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2GetAutoRedirect() {
|
||||
s32 PS4_SYSV_ABI sceHttp2GetCookie() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2GetCookie() {
|
||||
s32 PS4_SYSV_ABI sceHttp2GetCookieBox() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2GetCookieBox() {
|
||||
s32 PS4_SYSV_ABI sceHttp2GetCookieStats() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2GetCookieStats() {
|
||||
s32 PS4_SYSV_ABI sceHttp2GetMemoryPoolStats() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2GetMemoryPoolStats() {
|
||||
s32 PS4_SYSV_ABI sceHttp2GetResponseContentLength() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2GetResponseContentLength() {
|
||||
s32 PS4_SYSV_ABI sceHttp2GetStatusCode() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2GetStatusCode() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2Init(int net_id, int ssl_id, size_t pool_size, int max_requests) {
|
||||
s32 PS4_SYSV_ABI sceHttp2Init(s32 net_id, s32 ssl_id, u64 pool_size, s32 max_requests) {
|
||||
LOG_ERROR(Lib_Http2, "(DUMMY) called");
|
||||
static int id = 0;
|
||||
static s32 id = 0;
|
||||
return ++id;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2ReadData() {
|
||||
s32 PS4_SYSV_ABI sceHttp2ReadData() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2ReadDataAsync() {
|
||||
s32 PS4_SYSV_ABI sceHttp2ReadDataAsync() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2RedirectCacheFlush() {
|
||||
s32 PS4_SYSV_ABI sceHttp2RedirectCacheFlush() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2RemoveRequestHeader() {
|
||||
s32 PS4_SYSV_ABI sceHttp2RemoveRequestHeader() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2SendRequest() {
|
||||
s32 PS4_SYSV_ABI sceHttp2SendRequest() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2SendRequestAsync() {
|
||||
s32 PS4_SYSV_ABI sceHttp2SendRequestAsync() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2SetAuthEnabled() {
|
||||
s32 PS4_SYSV_ABI sceHttp2SetAuthEnabled() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2SetAuthInfoCallback() {
|
||||
s32 PS4_SYSV_ABI sceHttp2SetAuthInfoCallback() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2SetAutoRedirect() {
|
||||
s32 PS4_SYSV_ABI sceHttp2SetAutoRedirect() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2SetConnectionWaitTimeOut() {
|
||||
s32 PS4_SYSV_ABI sceHttp2SetConnectionWaitTimeOut() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2SetConnectTimeOut() {
|
||||
s32 PS4_SYSV_ABI sceHttp2SetConnectTimeOut() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2SetCookieBox() {
|
||||
s32 PS4_SYSV_ABI sceHttp2SetCookieBox() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2SetCookieMaxNum() {
|
||||
s32 PS4_SYSV_ABI sceHttp2SetCookieMaxNum() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2SetCookieMaxNumPerDomain() {
|
||||
s32 PS4_SYSV_ABI sceHttp2SetCookieMaxNumPerDomain() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2SetCookieMaxSize() {
|
||||
s32 PS4_SYSV_ABI sceHttp2SetCookieMaxSize() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2SetCookieRecvCallback() {
|
||||
s32 PS4_SYSV_ABI sceHttp2SetCookieRecvCallback() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2SetCookieSendCallback() {
|
||||
s32 PS4_SYSV_ABI sceHttp2SetCookieSendCallback() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2SetInflateGZIPEnabled() {
|
||||
s32 PS4_SYSV_ABI sceHttp2SetInflateGZIPEnabled() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2SetMinSslVersion() {
|
||||
s32 PS4_SYSV_ABI sceHttp2SetMinSslVersion() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2SetPreSendCallback() {
|
||||
s32 PS4_SYSV_ABI sceHttp2SetPreSendCallback(s32 template_id, OrbisHttp2PreSendCallback cb_func,
|
||||
void* user_arg) {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2SetRecvTimeOut() {
|
||||
s32 PS4_SYSV_ABI sceHttp2SetRecvTimeOut() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2SetRedirectCallback() {
|
||||
s32 PS4_SYSV_ABI sceHttp2SetRedirectCallback() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2SetRequestContentLength() {
|
||||
s32 PS4_SYSV_ABI sceHttp2SetRequestContentLength() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2SetResolveRetry() {
|
||||
s32 PS4_SYSV_ABI sceHttp2SetResolveRetry() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2SetResolveTimeOut() {
|
||||
s32 PS4_SYSV_ABI sceHttp2SetResolveTimeOut() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2SetSendTimeOut() {
|
||||
s32 PS4_SYSV_ABI sceHttp2SetSendTimeOut() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2SetSslCallback() {
|
||||
s32 PS4_SYSV_ABI sceHttp2SetSslCallback() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2SetTimeOut() {
|
||||
s32 PS4_SYSV_ABI sceHttp2SetTimeOut() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2SslDisableOption() {
|
||||
s32 PS4_SYSV_ABI sceHttp2SslDisableOption() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2SslEnableOption() {
|
||||
s32 PS4_SYSV_ABI sceHttp2SslEnableOption() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2Term() {
|
||||
s32 PS4_SYSV_ABI sceHttp2Term() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceHttp2WaitAsync() {
|
||||
s32 PS4_SYSV_ABI sceHttp2WaitAsync() {
|
||||
LOG_ERROR(Lib_Http2, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
void RegisterLib(Core::Loader::SymbolsResolver* sym) {
|
||||
LIB_FUNCTION("AS45QoYHjc4", "libSceHttp2", 1, "libSceHttp2", _Z5dummyv);
|
||||
LIB_FUNCTION("IZ-qjhRqvjk", "libSceHttp2", 1, "libSceHttp2", sceHttp2AbortRequest);
|
||||
LIB_FUNCTION("flPxnowtvWY", "libSceHttp2", 1, "libSceHttp2", sceHttp2AddCookie);
|
||||
LIB_FUNCTION("nrPfOE8TQu0", "libSceHttp2", 1, "libSceHttp2", sceHttp2AddRequestHeader);
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "common/types.h"
|
||||
#include "core/libraries/network/ssl2.h"
|
||||
|
||||
namespace Core::Loader {
|
||||
class SymbolsResolver;
|
||||
@ -11,62 +12,77 @@ class SymbolsResolver;
|
||||
|
||||
namespace Libraries::Http2 {
|
||||
|
||||
int PS4_SYSV_ABI _Z5dummyv();
|
||||
int PS4_SYSV_ABI sceHttp2AbortRequest();
|
||||
int PS4_SYSV_ABI sceHttp2AddCookie();
|
||||
int PS4_SYSV_ABI sceHttp2AddRequestHeader();
|
||||
int PS4_SYSV_ABI sceHttp2AuthCacheFlush();
|
||||
int PS4_SYSV_ABI sceHttp2CookieExport();
|
||||
int PS4_SYSV_ABI sceHttp2CookieFlush();
|
||||
int PS4_SYSV_ABI sceHttp2CookieImport();
|
||||
int PS4_SYSV_ABI sceHttp2CreateCookieBox();
|
||||
int PS4_SYSV_ABI sceHttp2CreateRequestWithURL();
|
||||
int PS4_SYSV_ABI sceHttp2CreateTemplate();
|
||||
int PS4_SYSV_ABI sceHttp2DeleteCookieBox();
|
||||
int PS4_SYSV_ABI sceHttp2DeleteRequest();
|
||||
int PS4_SYSV_ABI sceHttp2DeleteTemplate();
|
||||
int PS4_SYSV_ABI sceHttp2GetAllResponseHeaders();
|
||||
int PS4_SYSV_ABI sceHttp2GetAuthEnabled();
|
||||
int PS4_SYSV_ABI sceHttp2GetAutoRedirect();
|
||||
int PS4_SYSV_ABI sceHttp2GetCookie();
|
||||
int PS4_SYSV_ABI sceHttp2GetCookieBox();
|
||||
int PS4_SYSV_ABI sceHttp2GetCookieStats();
|
||||
int PS4_SYSV_ABI sceHttp2GetMemoryPoolStats();
|
||||
int PS4_SYSV_ABI sceHttp2GetResponseContentLength();
|
||||
int PS4_SYSV_ABI sceHttp2GetStatusCode();
|
||||
int PS4_SYSV_ABI sceHttp2Init(int net_id, int ssl_id, size_t pool_size, int max_requests);
|
||||
int PS4_SYSV_ABI sceHttp2ReadData();
|
||||
int PS4_SYSV_ABI sceHttp2ReadDataAsync();
|
||||
int PS4_SYSV_ABI sceHttp2RedirectCacheFlush();
|
||||
int PS4_SYSV_ABI sceHttp2RemoveRequestHeader();
|
||||
int PS4_SYSV_ABI sceHttp2SendRequest();
|
||||
int PS4_SYSV_ABI sceHttp2SendRequestAsync();
|
||||
int PS4_SYSV_ABI sceHttp2SetAuthEnabled();
|
||||
int PS4_SYSV_ABI sceHttp2SetAuthInfoCallback();
|
||||
int PS4_SYSV_ABI sceHttp2SetAutoRedirect();
|
||||
int PS4_SYSV_ABI sceHttp2SetConnectionWaitTimeOut();
|
||||
int PS4_SYSV_ABI sceHttp2SetConnectTimeOut();
|
||||
int PS4_SYSV_ABI sceHttp2SetCookieBox();
|
||||
int PS4_SYSV_ABI sceHttp2SetCookieMaxNum();
|
||||
int PS4_SYSV_ABI sceHttp2SetCookieMaxNumPerDomain();
|
||||
int PS4_SYSV_ABI sceHttp2SetCookieMaxSize();
|
||||
int PS4_SYSV_ABI sceHttp2SetCookieRecvCallback();
|
||||
int PS4_SYSV_ABI sceHttp2SetCookieSendCallback();
|
||||
int PS4_SYSV_ABI sceHttp2SetInflateGZIPEnabled();
|
||||
int PS4_SYSV_ABI sceHttp2SetMinSslVersion();
|
||||
int PS4_SYSV_ABI sceHttp2SetPreSendCallback();
|
||||
int PS4_SYSV_ABI sceHttp2SetRecvTimeOut();
|
||||
int PS4_SYSV_ABI sceHttp2SetRedirectCallback();
|
||||
int PS4_SYSV_ABI sceHttp2SetRequestContentLength();
|
||||
int PS4_SYSV_ABI sceHttp2SetResolveRetry();
|
||||
int PS4_SYSV_ABI sceHttp2SetResolveTimeOut();
|
||||
int PS4_SYSV_ABI sceHttp2SetSendTimeOut();
|
||||
int PS4_SYSV_ABI sceHttp2SetSslCallback();
|
||||
int PS4_SYSV_ABI sceHttp2SetTimeOut();
|
||||
int PS4_SYSV_ABI sceHttp2SslDisableOption();
|
||||
int PS4_SYSV_ABI sceHttp2SslEnableOption();
|
||||
int PS4_SYSV_ABI sceHttp2Term();
|
||||
int PS4_SYSV_ABI sceHttp2WaitAsync();
|
||||
enum OrbisHttp2HttpVersion : u32 {
|
||||
ORBIS_HTTP2_VERSION_1_0 = 1,
|
||||
ORBIS_HTTP2_VERSION_1_1 = 2,
|
||||
ORBIS_HTTP2_VERSION_2_0 = 3,
|
||||
};
|
||||
|
||||
// TODO: Figure out the whole struct. What's here is based on libSceNpWebApi2 use.
|
||||
struct OrbisHttp2PreSendCallbackData {
|
||||
void* unk;
|
||||
void* cert;
|
||||
};
|
||||
using OrbisHttp2PreSendCallback = PS4_SYSV_ABI s32 (*)(
|
||||
s32 request_id, s32 ssl_id, OrbisHttp2PreSendCallbackData* data, void* user_arg);
|
||||
|
||||
s32 PS4_SYSV_ABI sceHttp2AbortRequest();
|
||||
s32 PS4_SYSV_ABI sceHttp2AddCookie();
|
||||
s32 PS4_SYSV_ABI sceHttp2AddRequestHeader();
|
||||
s32 PS4_SYSV_ABI sceHttp2AuthCacheFlush();
|
||||
s32 PS4_SYSV_ABI sceHttp2CookieExport();
|
||||
s32 PS4_SYSV_ABI sceHttp2CookieFlush();
|
||||
s32 PS4_SYSV_ABI sceHttp2CookieImport();
|
||||
s32 PS4_SYSV_ABI sceHttp2CreateCookieBox();
|
||||
s32 PS4_SYSV_ABI sceHttp2CreateRequestWithURL();
|
||||
s32 PS4_SYSV_ABI sceHttp2CreateTemplate(s32 ctx_id, char* user_agent, s32 http_ver,
|
||||
s32 auto_proxy_conf);
|
||||
s32 PS4_SYSV_ABI sceHttp2DeleteCookieBox();
|
||||
s32 PS4_SYSV_ABI sceHttp2DeleteRequest();
|
||||
s32 PS4_SYSV_ABI sceHttp2DeleteTemplate();
|
||||
s32 PS4_SYSV_ABI sceHttp2GetAllResponseHeaders();
|
||||
s32 PS4_SYSV_ABI sceHttp2GetAuthEnabled();
|
||||
s32 PS4_SYSV_ABI sceHttp2GetAutoRedirect();
|
||||
s32 PS4_SYSV_ABI sceHttp2GetCookie();
|
||||
s32 PS4_SYSV_ABI sceHttp2GetCookieBox();
|
||||
s32 PS4_SYSV_ABI sceHttp2GetCookieStats();
|
||||
s32 PS4_SYSV_ABI sceHttp2GetMemoryPoolStats();
|
||||
s32 PS4_SYSV_ABI sceHttp2GetResponseContentLength();
|
||||
s32 PS4_SYSV_ABI sceHttp2GetStatusCode();
|
||||
s32 PS4_SYSV_ABI sceHttp2Init(s32 net_id, s32 ssl_id, u64 pool_size, s32 max_requests);
|
||||
s32 PS4_SYSV_ABI sceHttp2ReadData();
|
||||
s32 PS4_SYSV_ABI sceHttp2ReadDataAsync();
|
||||
s32 PS4_SYSV_ABI sceHttp2RedirectCacheFlush();
|
||||
s32 PS4_SYSV_ABI sceHttp2RemoveRequestHeader();
|
||||
s32 PS4_SYSV_ABI sceHttp2SendRequest();
|
||||
s32 PS4_SYSV_ABI sceHttp2SendRequestAsync();
|
||||
s32 PS4_SYSV_ABI sceHttp2SetAuthEnabled();
|
||||
s32 PS4_SYSV_ABI sceHttp2SetAuthInfoCallback();
|
||||
s32 PS4_SYSV_ABI sceHttp2SetAutoRedirect();
|
||||
s32 PS4_SYSV_ABI sceHttp2SetConnectionWaitTimeOut();
|
||||
s32 PS4_SYSV_ABI sceHttp2SetConnectTimeOut();
|
||||
s32 PS4_SYSV_ABI sceHttp2SetCookieBox();
|
||||
s32 PS4_SYSV_ABI sceHttp2SetCookieMaxNum();
|
||||
s32 PS4_SYSV_ABI sceHttp2SetCookieMaxNumPerDomain();
|
||||
s32 PS4_SYSV_ABI sceHttp2SetCookieMaxSize();
|
||||
s32 PS4_SYSV_ABI sceHttp2SetCookieRecvCallback();
|
||||
s32 PS4_SYSV_ABI sceHttp2SetCookieSendCallback();
|
||||
s32 PS4_SYSV_ABI sceHttp2SetInflateGZIPEnabled();
|
||||
s32 PS4_SYSV_ABI sceHttp2SetMinSslVersion();
|
||||
s32 PS4_SYSV_ABI sceHttp2SetPreSendCallback(s32 template_id, OrbisHttp2PreSendCallback cb_func,
|
||||
void* user_arg);
|
||||
s32 PS4_SYSV_ABI sceHttp2SetRecvTimeOut();
|
||||
s32 PS4_SYSV_ABI sceHttp2SetRedirectCallback();
|
||||
s32 PS4_SYSV_ABI sceHttp2SetRequestContentLength();
|
||||
s32 PS4_SYSV_ABI sceHttp2SetResolveRetry();
|
||||
s32 PS4_SYSV_ABI sceHttp2SetResolveTimeOut();
|
||||
s32 PS4_SYSV_ABI sceHttp2SetSendTimeOut();
|
||||
s32 PS4_SYSV_ABI sceHttp2SetSslCallback();
|
||||
s32 PS4_SYSV_ABI sceHttp2SetTimeOut();
|
||||
s32 PS4_SYSV_ABI sceHttp2SslDisableOption();
|
||||
s32 PS4_SYSV_ABI sceHttp2SslEnableOption();
|
||||
s32 PS4_SYSV_ABI sceHttp2Term();
|
||||
s32 PS4_SYSV_ABI sceHttp2WaitAsync();
|
||||
|
||||
void RegisterLib(Core::Loader::SymbolsResolver* sym);
|
||||
} // namespace Libraries::Http2
|
||||
@ -49,14 +49,19 @@ s32 PS4_SYSV_ABI sceNpWebApi2CreateRequest() {
|
||||
s32 PS4_SYSV_ABI sceNpWebApi2CreateUserContext(s32 lib_ctx_id,
|
||||
UserService::OrbisUserServiceUserId user_id) {
|
||||
if (lib_ctx_id >= 0x8000) {
|
||||
LOG_ERROR(Lib_NpWebApi2, "Invalid library context id {:#x}", lib_ctx_id);
|
||||
return ORBIS_NP_WEBAPI2_ERROR_INVALID_LIB_CONTEXT_ID;
|
||||
}
|
||||
if (user_id == UserService::ORBIS_USER_SERVICE_USER_ID_INVALID) {
|
||||
LOG_ERROR(Lib_NpWebApi2, "Invalid user id");
|
||||
return ORBIS_NP_WEBAPI2_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
LOG_ERROR(Lib_NpWebApi2, "(STUBBED) called, lib_ctx_id = {:#x}, user_id = {:#x}", lib_ctx_id,
|
||||
user_id);
|
||||
return ORBIS_OK;
|
||||
LOG_DEBUG(Lib_NpWebApi2, "called, lib_ctx_id = {:#x}, user_id = {:#x}", lib_ctx_id, user_id);
|
||||
s32 user_ctx_id = createUserContext(lib_ctx_id, user_id);
|
||||
if (user_ctx_id > 0) {
|
||||
LOG_INFO(Lib_NpWebApi2, "created user_ctx_id = {:#x}", user_ctx_id);
|
||||
}
|
||||
return user_ctx_id;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceNpWebApi2DeleteRequest(s64 request_id) {
|
||||
@ -90,7 +95,9 @@ s32 PS4_SYSV_ABI sceNpWebApi2Initialize(s32 lib_http_ctx_id, u64 pool_size) {
|
||||
pool_size);
|
||||
|
||||
s32 ctx_id = createLibraryContext(lib_http_ctx_id, nullptr);
|
||||
LOG_INFO(Lib_NpWebApi2, "created ctx_id = {:#x}", ctx_id);
|
||||
if (ctx_id > 0) {
|
||||
LOG_INFO(Lib_NpWebApi2, "created lib_ctx_id = {:#x}", ctx_id);
|
||||
}
|
||||
return ctx_id;
|
||||
}
|
||||
|
||||
@ -99,7 +106,9 @@ s32 PS4_SYSV_ABI sceNpWebApi2InitializeForPresence(s32 lib_http_ctx_id, u64 pool
|
||||
pool_size);
|
||||
|
||||
s32 ctx_id = createLibraryContext(lib_http_ctx_id, nullptr);
|
||||
LOG_INFO(Lib_NpWebApi2, "created ctx_id = {:#x}", ctx_id);
|
||||
if (ctx_id > 0) {
|
||||
LOG_INFO(Lib_NpWebApi2, "created lib_ctx_id = {:#x}", ctx_id);
|
||||
}
|
||||
return ctx_id;
|
||||
}
|
||||
|
||||
@ -117,7 +126,9 @@ s32 PS4_SYSV_ABI sceNpWebApi2IntInitialize(const OrbisNpWebApi2IntInitializeArgs
|
||||
args->lib_http_ctx_id, args->pool_size, args->name ? args->name : "(null)");
|
||||
|
||||
s32 ctx_id = createLibraryContext(args->lib_http_ctx_id, args->name);
|
||||
LOG_INFO(Lib_NpWebApi2, "created ctx_id = {:#x}", ctx_id);
|
||||
if (ctx_id > 0) {
|
||||
LOG_INFO(Lib_NpWebApi2, "created lib_ctx_id = {:#x}", ctx_id);
|
||||
}
|
||||
return ctx_id;
|
||||
}
|
||||
|
||||
@ -134,7 +145,9 @@ s32 PS4_SYSV_ABI sceNpWebApi2IntInitialize2(const OrbisNpWebApi2IntInitialize2Ar
|
||||
args->push_config_group);
|
||||
|
||||
s32 ctx_id = createLibraryContext(args->lib_http_ctx_id, args->name);
|
||||
LOG_INFO(Lib_NpWebApi2, "created ctx_id = {:#x}", ctx_id);
|
||||
if (ctx_id > 0) {
|
||||
LOG_INFO(Lib_NpWebApi2, "created lib_ctx_id = {:#x}", ctx_id);
|
||||
}
|
||||
return ctx_id;
|
||||
}
|
||||
|
||||
|
||||
@ -1,8 +1,107 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/logging/log.h"
|
||||
#include "core/libraries/network/http2.h"
|
||||
#include "core/libraries/np/np_common.h"
|
||||
#include "core/libraries/np/np_error.h"
|
||||
#include "core/libraries/np/np_web_api2/np_web_api2_context.h"
|
||||
|
||||
namespace Libraries::Np::NpWebApi2 {
|
||||
|
||||
};
|
||||
s32 g_current_user_context_id{};
|
||||
|
||||
s32 LibraryContext::CreateUserContext(Libraries::UserService::OrbisUserServiceUserId user_id) {
|
||||
if (this->user_contexts.size() >= 0x10000) {
|
||||
LOG_ERROR(Lib_NpWebApi2, "Too many user contexts");
|
||||
return ORBIS_NP_WEBAPI2_ERROR_USER_CONTEXT_MAX;
|
||||
}
|
||||
|
||||
s32 actual_user_ctx_id = 0;
|
||||
do {
|
||||
g_current_user_context_id++;
|
||||
if (g_current_user_context_id >= 0x10000) {
|
||||
g_current_user_context_id = 1;
|
||||
}
|
||||
actual_user_ctx_id = (this->id << 0x10) | g_current_user_context_id;
|
||||
} while (this->user_contexts.contains(actual_user_ctx_id));
|
||||
|
||||
this->user_contexts[actual_user_ctx_id] = new UserContext(this, actual_user_ctx_id, user_id);
|
||||
return actual_user_ctx_id;
|
||||
}
|
||||
|
||||
UserContext* LibraryContext::GetUserContext(s32 user_ctx_id) {
|
||||
std::scoped_lock lk{this->lock};
|
||||
if (!this->user_contexts.contains(user_ctx_id)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
UserContext* user_ctx = this->user_contexts.at(user_ctx_id);
|
||||
user_ctx->AddUser();
|
||||
return user_ctx;
|
||||
};
|
||||
|
||||
UserContext* LibraryContext::GetUserContextByUserId(
|
||||
Libraries::UserService::OrbisUserServiceUserId user_id) {
|
||||
if (user_id == Libraries::UserService::ORBIS_USER_SERVICE_USER_ID_INVALID) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::scoped_lock lk{this->lock};
|
||||
for (auto& [user_ctx_id, user_ctx] : this->user_contexts) {
|
||||
if (user_ctx->GetUserId() == user_id) {
|
||||
user_ctx->AddUser();
|
||||
return user_ctx;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
};
|
||||
|
||||
s32 PS4_SYSV_ABI internalPreSendCallback(s32 http_request_id, s32 ssl_id,
|
||||
Libraries::Http2::OrbisHttp2PreSendCallbackData* data,
|
||||
void* user_arg) {
|
||||
s64 user_ctx_id = reinterpret_cast<s64>(user_arg);
|
||||
LOG_ERROR(Lib_NpWebApi2,
|
||||
"Unimplemented, http_request_id = {:#x}, ssl_id = {:#x}, user_ctx_id = {:#x}",
|
||||
http_request_id, ssl_id, user_ctx_id);
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 UserContext::Initialize() {
|
||||
const char* name = this->parent_ctx->GetName();
|
||||
|
||||
char sw_version[8];
|
||||
memset(sw_version, 0, sizeof(sw_version));
|
||||
Libraries::Np::NpCommon::sceNpGetSdkVersion(sw_version);
|
||||
|
||||
char user_agent_buf[0x40];
|
||||
memset(user_agent_buf, 0, sizeof(user_agent_buf));
|
||||
if (name) {
|
||||
snprintf(user_agent_buf, sizeof(user_agent_buf), "NpWebApi2/%s (%s)", sw_version, name);
|
||||
} else {
|
||||
snprintf(user_agent_buf, sizeof(user_agent_buf), "NpWebApi2/%s", sw_version);
|
||||
}
|
||||
this->user_agent = std::string{user_agent_buf};
|
||||
|
||||
s32 http_ctx_id = this->parent_ctx->GetHttpCtxId();
|
||||
s32 http_template_id = Libraries::Http2::sceHttp2CreateTemplate(
|
||||
http_ctx_id, user_agent_buf,
|
||||
Libraries::Http2::OrbisHttp2HttpVersion::ORBIS_HTTP2_VERSION_2_0, 0);
|
||||
if (http_template_id < 0) {
|
||||
LOG_ERROR(Lib_NpWebApi2, "Failed to create HTTP template, error = {:#x}", http_template_id);
|
||||
return http_template_id;
|
||||
}
|
||||
|
||||
s32 result = Libraries::Http2::sceHttp2SetPreSendCallback(
|
||||
http_template_id, internalPreSendCallback, reinterpret_cast<void*>(this->id));
|
||||
if (result < 0) {
|
||||
LOG_ERROR(Lib_NpWebApi2, "Failed to set pre-send callback, error = {:#x}", result);
|
||||
return result;
|
||||
}
|
||||
|
||||
// TODO: sceNpPush2 interactions
|
||||
return result;
|
||||
};
|
||||
|
||||
}; // namespace Libraries::Np::NpWebApi2
|
||||
@ -3,14 +3,15 @@
|
||||
|
||||
#include "core/libraries/np/np_web_api2/np_web_api2.h"
|
||||
#include "core/libraries/np/np_web_api2/np_web_api2_push_event.h"
|
||||
#include "core/libraries/system/userservice.h"
|
||||
|
||||
#include <atomic>
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
|
||||
namespace Libraries::Np::NpWebApi2 {
|
||||
|
||||
// Forward declarations to prevent compile issues
|
||||
class LibraryContext;
|
||||
class UserContext;
|
||||
class Request;
|
||||
@ -29,6 +30,16 @@ public:
|
||||
lock.unlock();
|
||||
};
|
||||
|
||||
void AddUser() {
|
||||
std::scoped_lock lk{lock};
|
||||
user_count++;
|
||||
};
|
||||
|
||||
void RemoveUser() {
|
||||
std::scoped_lock lk{lock};
|
||||
user_count--;
|
||||
};
|
||||
|
||||
s32 GetId() {
|
||||
return id;
|
||||
};
|
||||
@ -37,16 +48,74 @@ public:
|
||||
return http_ctx_id;
|
||||
};
|
||||
|
||||
const char* GetName() {
|
||||
return name.empty() ? nullptr : name.data();
|
||||
}
|
||||
|
||||
s32 CreateUserContext(Libraries::UserService::OrbisUserServiceUserId user_id);
|
||||
UserContext* GetUserContext(s32 user_ctx_id);
|
||||
UserContext* GetUserContextByUserId(Libraries::UserService::OrbisUserServiceUserId user_id);
|
||||
|
||||
void RemoveUserContext(s32 user_ctx_id) {
|
||||
std::scoped_lock lk{lock};
|
||||
user_contexts.erase(user_ctx_id);
|
||||
};
|
||||
|
||||
private:
|
||||
s32 id{};
|
||||
s32 http_ctx_id{};
|
||||
s32 user_count{};
|
||||
std::recursive_mutex lock{};
|
||||
std::string name{};
|
||||
std::map<s32, UserContext*> user_contexts{};
|
||||
std::map<s32, PushEventHandle*> push_event_handles{};
|
||||
std::map<s32, PushEventFilter*> push_event_filters{};
|
||||
};
|
||||
|
||||
class UserContext {};
|
||||
class UserContext {
|
||||
public:
|
||||
UserContext(LibraryContext* parent, s32 user_ctx_id,
|
||||
Libraries::UserService::OrbisUserServiceUserId user_id)
|
||||
: parent_ctx(parent), id(user_ctx_id), user_id(user_id) {};
|
||||
|
||||
void Lock() {
|
||||
parent_ctx->Lock();
|
||||
}
|
||||
|
||||
void Unlock() {
|
||||
parent_ctx->Unlock();
|
||||
}
|
||||
|
||||
void AddUser() {
|
||||
parent_ctx->Lock();
|
||||
user_count++;
|
||||
parent_ctx->Unlock();
|
||||
};
|
||||
|
||||
void RemoveUser() {
|
||||
parent_ctx->Lock();
|
||||
user_count--;
|
||||
parent_ctx->Unlock();
|
||||
};
|
||||
|
||||
s32 GetId() {
|
||||
return id;
|
||||
};
|
||||
|
||||
Libraries::UserService::OrbisUserServiceUserId GetUserId() {
|
||||
return user_id;
|
||||
};
|
||||
|
||||
s32 Initialize();
|
||||
|
||||
private:
|
||||
s32 id{};
|
||||
Libraries::UserService::OrbisUserServiceUserId user_id{};
|
||||
s32 user_count{};
|
||||
s32 http_template_id{};
|
||||
LibraryContext* parent_ctx{};
|
||||
std::string user_agent{};
|
||||
};
|
||||
|
||||
class Request {};
|
||||
|
||||
|
||||
@ -2,9 +2,11 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/logging/log.h"
|
||||
#include "core/libraries/network/http2.h"
|
||||
#include "core/libraries/np/np_error.h"
|
||||
#include "core/libraries/np/np_web_api2/np_web_api2_context.h"
|
||||
#include "core/libraries/np/np_web_api2/np_web_api2_internal.h"
|
||||
#include "core/libraries/system/userservice.h"
|
||||
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
@ -19,19 +21,17 @@ s32 createLibraryContext(s32 http_ctx_id, const char* name) {
|
||||
std::scoped_lock lk{g_mutex};
|
||||
|
||||
if (g_lib_contexts.size() >= 0x8000) {
|
||||
LOG_ERROR(Lib_NpWebApi2, "Too many library contexts!");
|
||||
LOG_ERROR(Lib_NpWebApi2, "Too many library contexts");
|
||||
return ORBIS_NP_WEBAPI2_ERROR_LIB_CONTEXT_MAX;
|
||||
}
|
||||
|
||||
// Find next valid ID
|
||||
do {
|
||||
g_current_lib_context_id++;
|
||||
if (g_current_lib_context_id >= 0x8000) {
|
||||
g_current_lib_context_id = 1;
|
||||
}
|
||||
} while(g_lib_contexts.contains(g_current_lib_context_id));
|
||||
} while (g_lib_contexts.contains(g_current_lib_context_id));
|
||||
|
||||
// Create new LibraryContext
|
||||
if (!name) {
|
||||
g_lib_contexts[g_current_lib_context_id] =
|
||||
new LibraryContext(g_current_lib_context_id, http_ctx_id);
|
||||
@ -42,4 +42,50 @@ s32 createLibraryContext(s32 http_ctx_id, const char* name) {
|
||||
return g_current_lib_context_id;
|
||||
};
|
||||
|
||||
LibraryContext* getLibraryContext(s32 lib_ctx_id) {
|
||||
std::scoped_lock lk{g_mutex};
|
||||
|
||||
if (!g_lib_contexts.contains(lib_ctx_id)) {
|
||||
return nullptr;
|
||||
}
|
||||
LibraryContext* lib_ctx = g_lib_contexts.at(lib_ctx_id);
|
||||
lib_ctx->AddUser();
|
||||
return lib_ctx;
|
||||
}
|
||||
|
||||
s32 createUserContext(s32 lib_ctx_id, Libraries::UserService::OrbisUserServiceUserId user_id) {
|
||||
LibraryContext* lib_ctx = getLibraryContext(lib_ctx_id);
|
||||
if (!lib_ctx) {
|
||||
LOG_ERROR(Lib_NpWebApi2, "No library context with id {:#x}", lib_ctx_id);
|
||||
return ORBIS_NP_WEBAPI2_ERROR_LIB_CONTEXT_NOT_FOUND;
|
||||
}
|
||||
|
||||
UserContext* user_ctx = lib_ctx->GetUserContextByUserId(user_id);
|
||||
if (user_ctx) {
|
||||
LOG_ERROR(Lib_NpWebApi2, "User context already exists for user id {}", user_id);
|
||||
user_ctx->RemoveUser();
|
||||
return ORBIS_NP_WEBAPI2_ERROR_USER_CONTEXT_ALREADY_EXIST;
|
||||
}
|
||||
|
||||
s32 user_ctx_id = lib_ctx->CreateUserContext(user_id);
|
||||
if (user_ctx_id < 0) {
|
||||
// user_ctx_id contains an error code, return it.
|
||||
return user_ctx_id;
|
||||
}
|
||||
|
||||
user_ctx = lib_ctx->GetUserContext(user_ctx_id);
|
||||
user_ctx->RemoveUser();
|
||||
|
||||
s32 result = user_ctx->Initialize();
|
||||
if (result < 0) {
|
||||
// Failed to initialize user_ctx, destroy it.
|
||||
lib_ctx->RemoveUserContext(user_ctx_id);
|
||||
delete user_ctx;
|
||||
}
|
||||
|
||||
lib_ctx->RemoveUser();
|
||||
return user_ctx_id;
|
||||
};
|
||||
|
||||
|
||||
}; // namespace Libraries::Np::NpWebApi2
|
||||
@ -1,8 +1,10 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "core/libraries/system/userservice.h"
|
||||
|
||||
namespace Libraries::Np::NpWebApi2 {
|
||||
|
||||
s32 createLibraryContext(s32 http_ctx_id, const char* name);
|
||||
|
||||
s32 createUserContext(s32 lib_ctx_id, Libraries::UserService::OrbisUserServiceUserId user_id);
|
||||
};
|
||||
Loading…
Reference in New Issue
Block a user