Пример #1
0
	void FileSharingWidget::stopDownloading()
	{
		assert(isState(State::PlainFile_Downloading) ||
			   isState(State::ImageFile_Downloading));

		if (isState(State::PlainFile_Downloading))
		{
			setState(State::PlainFile_MetainfoLoaded);
			connectFileDownloadSignals(false);
		}

        if (isState(State::ImageFile_Downloading))
        {
            setState(State::ImageFile_MetainfoLoaded);
            connectImageDownloadedSignal(false);
        }

		Ui::GetDispatcher()->abortSharedFileDownloading(
			ContactUin_,
			FsInfo_->GetUri(),
			getCurrentProcessId()
		);

		resetCurrentProcessId();

		BytesTransferred_ = 0;
        Ui::GetDispatcher()->post_stats_to_core(core::stats::stats_event_names::filesharing_download_cancel);
	}
Пример #2
0
u32 updateMenu() {
	PLGLOADER_INFO *plgLoaderInfo = (void*)0x07000000;
	plgLoaderInfo->gamePluginPid = getCurrentProcessId();
	plgLoaderInfo->gamePluginMenuAddr = (u32)&gamePluginMenu;

	u32 ret = 0;
	u32 hProcess;
	u32 homeMenuPid = plgGetIoBase(5);

	if (homeMenuPid == 0) {
		return 1;
	}

	ret = svc_openProcess(&hProcess, homeMenuPid);
	if (ret != 0) {
		return ret;
	}

	copyRemoteMemory(hProcess, &(plgLoaderInfo->gamePluginPid), CURRENT_PROCESS_HANDLE, &(plgLoaderInfo->gamePluginPid), 8);

	final: