Ejemplo n.º 1
0
void GSP_GPU::RegisterInterruptRelayQueue(Kernel::HLERequestContext& ctx) {
    IPC::RequestParser rp(ctx, 0x13, 1, 2);
    u32 flags = rp.Pop<u32>();

    auto interrupt_event = rp.PopObject<Kernel::Event>();
    // TODO(mailwl): return right error code instead assert
    ASSERT_MSG((interrupt_event != nullptr), "handle is not valid!");

    interrupt_event->SetName("GSP_GSP_GPU::interrupt_event");

    SessionData* session_data = GetSessionData(ctx.Session());
    session_data->interrupt_event = std::move(interrupt_event);
    session_data->registered = true;

    IPC::RequestBuilder rb = rp.MakeBuilder(2, 2);

    if (first_initialization) {
        // This specific code is required for a successful initialization, rather than 0
        first_initialization = false;
        rb.Push(RESULT_FIRST_INITIALIZATION);
    } else {
        rb.Push(RESULT_SUCCESS);
    }

    rb.Push(session_data->thread_id);
    rb.PushCopyObjects(shared_memory);

    LOG_DEBUG(Service_GSP, "called, flags=0x{:08X}", flags);
}
Ejemplo n.º 2
0
void GSP_GPU::UnregisterInterruptRelayQueue(Kernel::HLERequestContext& ctx) {
    IPC::RequestParser rp(ctx, 0x14, 0, 0);

    SessionData* session_data = GetSessionData(ctx.Session());
    session_data->interrupt_event = nullptr;
    session_data->registered = false;

    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
    rb.Push(RESULT_SUCCESS);

    LOG_DEBUG(Service_GSP, "called");
}
Ejemplo n.º 3
0
void CWaveSession::ProcessSessionDetailsResponse()
{
	ASSERT(m_lpRequest != NULL);

	CCurlUTF8StringReader * lpReader = (CCurlUTF8StringReader *)m_lpRequest->GetReader();

	ASSERT(lpReader != NULL);

	if (m_lpRequest->GetResult() != CURLE_OK)
	{
		m_nLoginError = WLE_NETWORK;
	}
	else
	{
		wstring szResponse(lpReader->GetString());
		wstring szSessionData(GetSessionData(szResponse));

		if (szSessionData.empty())
		{
			m_nLoginError = WLE_AUTHENTICATE;
		}
		else
		{
			m_szEmailAddress = GetKeyFromSessionResponse(L"username", szSessionData);
			m_szSessionID = GetKeyFromSessionResponse(L"sessionid", szSessionData);
			m_szProfileID = GetKeyFromSessionResponse(L"id", szSessionData);

			// The sticky session ID must survive log off and log on requests. If
			// we fail to retrieve the SID, the sticky session ID is cleared and
			// we retrieve it here on the next retry.

			if (m_szStickySessionID.empty())
			{
				m_szStickySessionID = GetKeyFromSessionResponse(L"sticky_session", szSessionData);
			}

			if (
				!m_szEmailAddress.empty() &&
				!m_szSessionID.empty() &&
				!m_szStickySessionID.empty() &&
				!m_szProfileID.empty()
			) {
				m_nLoginError = WLE_SUCCESS;
			}
			else
			{
				m_nLoginError = WLE_AUTHENTICATE;
			}
		}
	}
	
	delete lpReader;
	delete m_lpRequest;

	m_lpRequest = NULL;
	m_nRequesting = WSR_NONE;

	if (m_nLoginError == WLE_SUCCESS)
	{
		SignalProgress(WCS_GOT_SESSION_DETAILS);

		ResetChannelParameters();

		PostSIDRequest();
	}
	else if (m_nState == WSS_RECONNECTING)
	{
		NextReconnect();
	}
	else
	{
		m_nState = WSS_OFFLINE;

		SignalProgress(WCS_FAILED);
	}
}
Ejemplo n.º 4
0
void GSP_GPU::ClientDisconnected(std::shared_ptr<Kernel::ServerSession> server_session) {
    SessionData* session_data = GetSessionData(server_session);
    if (active_thread_id == session_data->thread_id)
        ReleaseRight(session_data);
    SessionRequestHandler::ClientDisconnected(server_session);
}