[ros-dev] Use kernel types in include files?

Jun Koi junkoi2004 at gmail.com
Thu Jan 22 16:12:59 CET 2009


Please somebody helps me?

I guess I can compile the code in userspace by set a particular macro
(so to deactivate the NTOS_MODE_USER macro), because the kernel code
of ReactOS can do that, too.

Unfortunately I still cannot find how to do that. The code is
complicated compiled in the way I am not familar with, so I am really
struggling here ;-(

Thanks a lot,
Jun

On Tue, Jan 20, 2009 at 12:50 PM, Jun Koi <junkoi2004 at gmail.com> wrote:
> On Tue, Jan 20, 2009 at 11:53 AM, Jun Koi <junkoi2004 at gmail.com> wrote:
>> Hi,
>>
>> I am working on a project to parse the Windows image file. To do that,
>> I must understand the structure of some Windows components, like
>> _EPROCESS. So I took some headers from ReactOS, and write *userland*
>> code like below:
>>
>> ----
>> #include <pstypes.h>
>> #include <stdio.h>
>>
>> int main()
>> {
>>    printf("size of EPROCESS: %d\n", sizeof(struct _EPROCESS));
>>    return 0;
>> }
>> ----
>>
>> The I got the problem: g++ reported that _EPROCESS is incomplete.
>>
>> Clearly this means it doesnt see the structure _EPROCESS, so I took a
>> closer look, and found that _EPROCESS is not defined in user-mode
>> (NTOS_MODE_USER). I tried to fix it by putting
>>
>> #undef NTOS_MODE_USER
>>
>> in front of #include <pstypes>, but that doesnt help.
>>
>> Anybody please tell me if there is any way to fix this?
>>
>> I think I can fix that by modifying the original headers. but that is
>> way too ugly.
>>
>
> I forgot to say that I compiled the above code with command like this:
>
>        g++ $(NDK_INCLUDE) test.c -o test
>
> with NDK_INCLUDE is pointed to a set of header directories.
>
> Thanks,
> J
>


More information about the Ros-dev mailing list