Services/HTTP: Stubbed the Initialize function.

This commit is contained in:
B3n30 2018-07-21 18:54:06 -05:00 committed by Subv
parent 28124c053a
commit 1f865fd524
2 changed files with 35 additions and 1 deletions

View File

@ -9,9 +9,26 @@
namespace Service {
namespace HTTP {
void HTTP_C::Initialize(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x1, 1, 4);
const u32 shmem_size = rp.Pop<u32>();
rp.PopPID();
shared_memory = rp.PopObject<Kernel::SharedMemory>();
if (shared_memory) {
shared_memory->name = "HTTP_C:shared_memory";
}
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
// This returns 0xd8a0a046 if no network connection is available.
// Just assume we are always connected.
rb.Push(RESULT_SUCCESS);
LOG_WARNING(Service_HTTP, "(STUBBED) called, shared memory size: {}", shmem_size);
}
HTTP_C::HTTP_C() : ServiceFramework("http:C", 32) {
static const FunctionInfo functions[] = {
{0x00010044, nullptr, "Initialize"},
{0x00010044, &HTTP_C::Initialize, "Initialize"},
{0x00020082, nullptr, "CreateContext"},
{0x00030040, nullptr, "CloseContext"},
{0x00040040, nullptr, "CancelConnection"},

View File

@ -4,6 +4,7 @@
#pragma once
#include "core/hle/kernel/shared_memory.h"
#include "core/hle/service/service.h"
namespace Service {
@ -12,6 +13,22 @@ namespace HTTP {
class HTTP_C final : public ServiceFramework<HTTP_C> {
public:
HTTP_C();
private:
/**
* HTTP_C::Initialize service function
* Inputs:
* 1 : POST buffer size
* 2 : 0x20
* 3 : 0x0 (Filled with process ID by ARM11 Kernel)
* 4 : 0x0
* 5 : POST buffer memory block handle
* Outputs:
* 1 : Result of function, 0 on success, otherwise error code
*/
void Initialize(Kernel::HLERequestContext& ctx);
Kernel::SharedPtr<Kernel::SharedMemory> shared_memory = nullptr;
};
void InstallInterfaces(SM::ServiceManager& service_manager);