[ros-dev] Use kernel types in include files?
Ged
gedmurphy at gmail.com
Thu Jan 22 17:23:35 CET 2009
EPROCESS is a kmode struct, it has no place in usermode.
Maybe you should be looking to read the PEB
Ged.
-----Original Message-----
From: ros-dev-bounces at reactos.org [mailto:ros-dev-bounces at reactos.org] On
Behalf Of Jun Koi
Sent: 22 January 2009 15:13
To: ros-dev at reactos.org
Subject: Re: [ros-dev] Use kernel types in include files?
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
>
_______________________________________________
Ros-dev mailing list
Ros-dev at reactos.org
http://www.reactos.org/mailman/listinfo/ros-dev
More information about the Ros-dev
mailing list