示例#1
0
static int unload_util(int module)
{
#ifdef UTILITY_UNLOAD_MODULE_FILE
	int ret;
#endif
	dbg_printf("Unloading 0x%08X\n", module);

	if (isImported(sceUtilityUnloadModule))
		return sceUtilityUnloadModule(module);
	else if (module <= PSP_MODULE_NET_SSL && isImported(sceUtilityUnloadNetModule))
		return sceUtilityUnloadNetModule(module + PSP_NET_MODULE_COMMON - PSP_MODULE_NET_COMMON);
	else if (module == PSP_MODULE_USB_PSPCM && isImported(sceUtilityUnloadUsbModule))
		return sceUtilityUnloadUsbModule(PSP_USB_MODULE_PSPCM);
	else if (module <= PSP_MODULE_USB_GPS && isImported(sceUtilityUnloadUsbModule))
		return sceUtilityUnloadUsbModule(module + PSP_USB_MODULE_MIC - PSP_MODULE_USB_MIC);
	else if (module <= PSP_MODULE_AV_G729 && isImported(sceUtilityUnloadAvModule))
		return sceUtilityUnloadAvModule(module + PSP_MODULE_AV_AVCODEC - PSP_AV_MODULE_AVCODEC);
	else
#ifdef UTILITY_UNLOAD_MODULE_FILE
	{
		ret = sceKernelStopModule(module, 0, NULL, NULL, NULL);
		return ret ? ret : sceKernelUnloadModule(module);
	}
#else
		return SCE_KERNEL_ERROR_ERROR;
#endif
}
示例#2
0
int AdhocShutdown(void)
{	
	sceNetAdhocctlDisconnect();
	
	sceNetAdhocctlDelHandler(0);
	
	sceNetAdhocctlTerm(); 
	
	sceNetAdhocTerm();
	
	sceNetTerm();
	
	sceUtilityUnloadNetModule(PSP_NET_MODULE_ADHOC);
	
	sceUtilityUnloadNetModule(PSP_NET_MODULE_COMMON);
	
	return 1;
}
示例#3
0
int unloadNetCommon()
{
	if (isImported(sceUtilityUnloadNetModule))
		return sceUtilityUnloadNetModule(PSP_NET_MODULE_COMMON);
	else if (isImported(sceUtilityUnloadModule))
		return sceUtilityUnloadModule(PSP_MODULE_NET_COMMON);
	else
		return SCE_KERNEL_ERROR_ERROR;
}
示例#4
0
文件: adhoc.c 项目: 173210/mvspsp
int adhocUnloadModules(void)
{
#ifdef KERNEL_MODE
	return 0;
#else
	if (devkit_version >= 0x02000010)
	{
		int error;

		if ((error = sceUtilityUnloadNetModule(PSP_NET_MODULE_ADHOC)) < 0)
			return error;

		if ((error = sceUtilityUnloadNetModule(PSP_NET_MODULE_COMMON)) < 0)
			return error;

		return 0;
	}
	return -1;
#endif
}
示例#5
0
文件: main.c 项目: CDragu/pspsdk
void unloadNetModules()
{
	sceUtilityUnloadNetModule(PSP_NET_MODULE_SSL);
	sceUtilityUnloadNetModule(PSP_NET_MODULE_HTTP);
	sceUtilityUnloadNetModule(PSP_NET_MODULE_PARSEHTTP);
	sceUtilityUnloadNetModule(PSP_NET_MODULE_PARSEURI);
	sceUtilityUnloadNetModule(PSP_NET_MODULE_INET);
	sceUtilityUnloadNetModule(PSP_NET_MODULE_COMMON);
}
示例#6
0
void unload_utils()
{
	int module;
	int ret;
	int i;

	if (isImported(sceUtilityUnloadModule)) {
		//Unload modules in reverse order
		if (globals->module_sdk_version > 0x06020010) {
			ret = sceUtilityUnloadModule(PSP_MODULE_AV_MP3);
			if (ret < 0)
				dbg_printf("%s: Unloading 0x%08X failed 0x%08X\n",
					__func__, PSP_MODULE_AV_MP3, ret);
		}

		for(i = sizeof(modules) / sizeof(int) - 1; i >= 0; i--) {
			ret = sceUtilityUnloadModule(modules[i]);
			if (ret < 0)
				dbg_printf("%s: Unloading 0x%08X failed 0x%08X\n",
					__func__, modules[i], ret);
		}

		if (!globals->isEmu || sceNetIsImported)
			for(i = sizeof(netModules) / sizeof(int) - 1; i >= 0; i--) {
				ret = sceUtilityUnloadModule(netModules[i]);
				if (ret < 0)
					dbg_printf("%s: Unloading 0x%08X failed 0x%08X\n",
						__func__, netModules[i], ret);
			}
	} else {
		if (isImported(sceUtilityUnloadNetModule))
			for (module = 7; module >= 1; module--) {
				ret = sceUtilityUnloadNetModule(module);
				if (ret < 0)
					dbg_printf("%s: Unloading net module %d failed 0x%08X\n",
						__func__, module, ret);
			}

		if (isImported(sceUtilityUnloadUsbModule))
			for (module = 5; module >= 1; module--) {
				ret = sceUtilityUnloadUsbModule(module);
				if (ret < 0)
					dbg_printf("%s: Unloading USB module %d failed 0x%08X\n",
						__func__, module, ret);
			}

		if (isImported(sceUtilityUnloadAvModule)) {
			for (module = 7; module >= 5; module--) {
				ret = sceUtilityUnloadAvModule(module);
				if (ret < 0)
					dbg_printf("%s: Unloading AV module %d failed 0x%08X\n",
						__func__, module, ret);
			}

			if (globals->module_sdk_version <= 0x06020010)
				module--; // Skip PSP_AV_MODULE_MP3

			while (module >= 1) {
				ret = sceUtilityUnloadAvModule(module);
				if (ret < 0)
					dbg_printf("%s: Unloading AV module %d failed 0x%08X\n",
						__func__, module, ret);

				module--;
			}
		} else {
#ifdef UTILITY_AV_AVCODEC_PATH
			sceKernelStopModule(avcodec_modid, 0, NULL, NULL, NULL);
			sceKernelUnloadModule(avcodec_modid);
#endif
#ifdef UTILITY_AV_SASCORE_PATH
			sceKernelStopModule(sascore_modid, 0, NULL, NULL, NULL);
			sceKernelUnloadModule(sascore_modid);
#endif
#ifdef UTILITY_AV_ATRAC3PLUS_PATH
			sceKernelStopModule(atrac3plus_modid, 0, NULL, NULL, NULL);
			sceKernelUnloadModule(atrac3plus_modid);
#endif
#ifdef UTILITY_AV_MPEGBASE_PATH
			sceKernelStopModule(mpegbase_modid, 0, NULL, NULL, NULL);
			sceKernelUnloadModule(mpegbase_modid);
#endif
		}
	}
}