Example #1
0
int diva_waitc(SceUID fd, SceInt64 *res) {
    int ret;
    u32 k1;

    if(wait_fd >= 0 && fd == datafd) {
        kprintf("waiting (CB) for fd: %08X\n", wait_fd);
        k1 = pspSdkSetK1(0);
        ret = sceIoWaitAsyncCB(wait_fd, res);
        if(ret >= 0) {
            kprintf("Async read completed: %i bytes\n", (u32)*res);
            *res = wait_size;
        }
        sceIoClose(wait_fd);
        wait_fd = -1;
        pspSdkSetK1(k1);
        return ret;
    }
    return sceIoWaitAsyncCB(fd, res);
}
Example #2
0
int myIoWaitAsyncCB(SceUID fd, SceIores *result)
{
	int ret;

	ret = sceIoWaitAsyncCB(fd, result);

	{
		struct NoDrmFd *fds;

		fds = find_nodrm_fd(fd);

		if(fds != NULL && fds->asyncKeySetup) {
			fds->asyncKeySetup = 0;
			*result = 0LL;
			ret = 0;
		}
	}

//	printk("%s: %d -> 0x%08X\r\n", __func__, fd, ret);

	return ret;
}