kuKernelInitFileName

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

Moderators: cheriff, TyRaNiD

Post Reply
ab5000
Posts: 74
Joined: Tue May 06, 2008 2:37 am

kuKernelInitFileName

Post by ab5000 »

Hi.
Today I was trying to get the current homebrew path from inside the homebrew (I know I can use argp[0] but for style reasons i prefer not to) using kuKernelInitFileName. That's how I call it:

Code: Select all

char str[50];
int ret;

ret = kuKernelInitFileName(str);

printf("%d %s", ret, str);
but the output is this:
0
!
why is this happening? I'm doing something wrong?

Thanks,
ab5000.

Code: Select all

%&#58;include<stdio.h>
int _&#40;int __,int ___,int ____,int _____&#41;
<%for&#40;;____<___;_____=_____*__,____++&#41;;
return _____;%>main&#40;&#41;<%printf
&#40;"%d\n",_&#40;2,5,0,1&#41;&#41;;%>
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

It needs to be called immedately once your module is loaded as the path gets erased soon. Do it from module_start() or in the beginning of the main thread.
ab5000
Posts: 74
Joined: Tue May 06, 2008 2:37 am

Post by ab5000 »

Torch wrote:It needs to be called immedately once your module is loaded as the path gets erased soon. Do it from module_start() or in the beginning of the main thread.
Thanks! :)
I'll try ASAP.

Code: Select all

%&#58;include<stdio.h>
int _&#40;int __,int ___,int ____,int _____&#41;
<%for&#40;;____<___;_____=_____*__,____++&#41;;
return _____;%>main&#40;&#41;<%printf
&#40;"%d\n",_&#40;2,5,0,1&#41;&#41;;%>
Post Reply