示例#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 LPP_Mp4Shutdown(void)
{
    sceMpegFinish();
    if(cbridgeid) LPP_UtilsStopUnloadModule(cbridgeid);
    if(mpegvshid) LPP_UtilsStopUnloadModule(mpegvshid);
    sceUtilityUnloadAvModule(0);
    return 0;
}
示例#3
0
文件: main.c 项目: bensaraceno/PSP
int UnloadModules() {
	int result = sceUtilityUnloadUsbModule(PSP_USB_MODULE_CAM);
	if (result < 0) { printf("Error 0x%08X unloading usbcam.prx.\n", result); }

	result = sceUtilityUnloadUsbModule(PSP_USB_MODULE_ACC);
	if (result < 0) { printf("Error 0x%08X unloading usbacc.prx.\n", result); }

	result = sceUtilityUnloadAvModule(PSP_AV_MODULE_AVCODEC);
	if (result < 0) printf("Error 0x%08X unloading avcodec.prx.\n", result);
	return result;
}
示例#4
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
		}
	}
}