Stop a module, "Music_prx"

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
ne0h
Posts: 386
Joined: Thu Feb 21, 2008 2:15 am

Stop a module, "Music_prx"

Post by ne0h »

Hi,
I'm try to unload Music_prx plugin, because whit it I've some problems!
I've writed this function:

Code: Select all

// Unload Music_prx
SceModule2* Module2 = ne0h_KernelFindModuleByName("Music_prx");
if(Module2!=NULL)
{
    printf("Try to unload...\n");
    ne0h_KernelStopUnloadModule(Module2->modid);
}
else{
    printf("\nMusic_prx s not loaded!\n");
}
The main programm is user mode, and the functions ne0h_* is exported from kernel mode prx's...
I've a lot of function in this prx and all works fine...
This is the exported functions:

Code: Select all

int ne0h_KernelStopUnloadModule(SceUID modID)
{
    k1 = pspSdkSetK1(0);
    
    int status;
    
    sceKernelStopModule(modID, 0, NULL, &status, NULL);
    
    sceKernelUnloadModule(modID);
    
    pspSdkSetK1(k1);
    
    return 0;
}


SceModule2* ne0h_KernelFindModuleByName(const char *modname)
{
    k1 = pspSdkSetK1(0);
    
    SceModule2* Module2 = sceKernelFindModuleByName(modname);
    
    pspSdkSetK1(k1);
    
    return Module2;
}
The programm crash while trying to stop\unload the module...
Post Reply