コード例 #1
0
ファイル: iofilemgr.c プロジェクト: himanshugoel2797/VHL
int hook_sceIoChstat(const char *file, SceIoStat *stat, int bits)
{
        sceKernelCheckCallback();

        char tmpPath[MAX_PATH_LENGTH];
        char *tmp=TranslateVFS(tmpPath, file);
        return sceIoChstat(tmp, stat, bits);
}
コード例 #2
0
ファイル: iofilemgr.c プロジェクト: himanshugoel2797/VHL
int hook_sceIoMkdir(const char *dir, SceMode mode)
{
        sceKernelCheckCallback();

        char tmpPath[MAX_PATH_LENGTH];
        char *tmp=TranslateVFS(tmpPath, dir);
        return sceIoMkdir(tmp, mode);
}
コード例 #3
0
ファイル: iofilemgr.c プロジェクト: himanshugoel2797/VHL
int hook_sceIoRmdir(const char *path)
{
        sceKernelCheckCallback();

        char tmpPath[MAX_PATH_LENGTH];
        char *tmp=TranslateVFS(tmpPath, path);
        return sceIoRmdir(tmp);
}
コード例 #4
0
ファイル: iofilemgr.c プロジェクト: himanshugoel2797/VHL
int hook_sceIoRemove(const char *file)
{
        sceKernelCheckCallback();

        char tmpPath[MAX_PATH_LENGTH];
        char *tmp=TranslateVFS(tmpPath, file);
        return sceIoRemove(tmp);
}
コード例 #5
0
ファイル: iofilemgr.c プロジェクト: himanshugoel2797/VHL
SceUID hook_sceIoDopen(const char *dirname)
{
        sceKernelCheckCallback();

        char tmpPath[MAX_PATH_LENGTH];
        char *tmp=TranslateVFS(tmpPath, dirname);
        return sceIoDopen(tmp);
}
コード例 #6
0
ファイル: iofilemgr.c プロジェクト: himanshugoel2797/VHL
SceUID hook_sceIoOpen(const char* path, int flags, SceMode m)
{
        sceKernelCheckCallback();

        char tmpPath[MAX_PATH_LENGTH];
        char *tmp = TranslateVFS(tmpPath, path);
        return sceIoOpen(tmp, flags, m);
}
コード例 #7
0
ファイル: iofilemgr.c プロジェクト: himanshugoel2797/VHL
int hook_sceIoRename (const char *oldname, const char *newname)
{
        sceKernelCheckCallback();

        char o_tmpPath[MAX_PATH_LENGTH];
        char n_tmpPath[MAX_PATH_LENGTH];
        char *o_tmp = TranslateVFS(o_tmpPath, oldname);
        char *n_tmp = TranslateVFS(n_tmpPath, newname);

        return sceIoRename(o_tmp, n_tmp);
}
コード例 #8
0
ファイル: mstick.c プロジェクト: HomerSp/pspautotests
int main(int argc, char **argv) {
    SceUID cb_id;
 
    cb_id = sceKernelCreateCallback("MSCB", ms_callback, (void *)0x777);
	printf("cb_id: %08X\n", (cb_id > 0) ? 1 : 0);
    printf("MScmRegisterMSInsertEjectCallback: %08X\n", MScmRegisterMSInsertEjectCallback(cb_id));
    printf("sceKernelCheckCallback: %08X\n", sceKernelCheckCallback());
    printf("MScmUnregisterMSInsertEjectCallback: %08X\n", MScmUnregisterMSInsertEjectCallback(cb_id));
	printf("sceKernelDeleteCallback: %08X\n", sceKernelDeleteCallback(cb_id));
	
    return 0;
}
コード例 #9
0
ファイル: umd.c プロジェクト: HomerSp/pspautotests
int main(int argc, char **argv) {
	int umdCbCallbackId;
	int result;
	
	umdCbCallbackId = sceKernelCreateCallback("umdHandler", umdHandler, (void *)0x1234);
	
	result = sceUmdRegisterUMDCallBack(umdCbCallbackId);
	printf("%08X\n", result);
	
	printf("%d\n", sceKernelCheckCallback());
	
	result = sceUmdUnRegisterUMDCallBack(umdCbCallbackId);
	printf("%08X\n", result);

	result = sceUmdUnRegisterUMDCallBack(umdCbCallbackId);
	printf("%08X\n", result);

	return 0;
}
コード例 #10
0
extern "C" int main(int argc, char *argv[]) {
	Callback cb("notify", &cbFunc, NULL);

	checkpointNext("Objects:");
	testNotify("  Normal", cb, 0x1337);
	testNotify("  NULL", 0, 0x1337);
	testNotify("  Invalid", 0xDEADBEEF, 0x1337);
	cb.Delete();
	testNotify("  Deleted", cb, 0x1337);

	cb.Create("notify", &cbFunc, NULL);
	checkpointNext("Values:");
	testNotify("  Zero", cb, 0);
	testNotify("  DEADBEEF", cb, 0xDEADBEEF);

	checkpointNext("Notifies:");
	int result = 0;
	for (int i = 0; i < 10000; ++i) {
		result = sceKernelNotifyCallback(cb, 1);
		if (result != 0) {
			checkpoint("  Failed at %d: %08x", i, result);
			break;
		}
	}
	if (result == 0) {
		checkpoint("  10000 notifies: OK");
	}

	checkpoint("sceKernelDelayThreadCB: %08x", sceKernelDelayThreadCB(1000));

	checkpointNext("Different thread:");
	{
		CallbackSleeper waiter1("better priority sleeping thread", 0x10);
		CallbackSleeper waiter2("worse priority sleeping thread", 0x30);
		sceKernelDelayThread(1000);
		sceKernelNotifyCallback(waiter1.callbackID(), 0x1337);
		sceKernelNotifyCallback(waiter2.callbackID(), 0x1337);
		sceKernelDelayThread(1000);
	}

	checkpointNext("Return value:");
	{
		CallbackSleeper waiter("sleeping thread");
		waiter.setReturn(0x1337);
		sceKernelDelayThread(1000);
		testNotify("  Notify #1", waiter.callbackID(), 0x1337);
		sceKernelDelayThread(1000);
		testNotify("  Notify #2", waiter.callbackID(), 0x1337);
		sceKernelDelayThread(1000);
	}

	checkpointNext("Recursion:");
	{
		SelfNotifier waiter("sleeping thread");
		sceKernelDelayThread(1000);
		testNotify("  Notify #1", waiter.callbackID(), 0x1337);
		sceKernelDelayThread(1000);
	}

	checkpointNext("Mixing types:");
	checkpoint("  scePowerRegisterCallback (causes notify): %08x", scePowerRegisterCallback(0, cb));
	testNotify("  Manual notify", cb, 0x1337);
	checkpoint("  sceKernelDelayThreadCB: %08x", sceKernelDelayThreadCB(1000));

	checkpointNext("Order:");
	Callback cb1("notify1", &cbFunc, (void *)0xABC00001);
	Callback cb2("notify2", &cbFunc, (void *)0xABC00002);
	Callback cb3("notify3", &cbFunc, (void *)0xABC00003);
	testNotify("  Notify cb #2", cb2, 0xDEF00001);
	testNotify("  Notify cb #1", cb1, 0xDEF00002);
	testNotify("  Notify cb #3", cb3, 0xDEF00003);
	checkpoint("  sceKernelCheckCallback: %08x", sceKernelCheckCallback());

	return 0;
}