compiler error C2371 -- how to fix?

So for those of you that have been helping with my enduring adventure of building a driver here is another issue I just started having.

My driver has the following #includes and compiles and runs fine.
#include “ntddk.h”
#include “ntdddisk.h”
#include “ntstrsafe.h”

However as soon as I added
#include “ntifs.h”

In order to support using ZwSetObjectSecurity and using RtlCreateAcl, RtlAddAccessAllowedAce,
RtlCreateSecurityDescriptor, & RtlSetDaclSecurityDescriptor. I now get the following two errors:

1>c:\winddk\7600.16385.0\inc\ddk\ntifs.h(85) : error C2371: ‘PEPROCESS’ : redefi
nition; different basic types
1>c:\winddk\7600.16385.0\inc\ddk\ntifs.h(86) : error C2371: ‘PETHREAD’ : redefin
ition; different basic types

How can I resolve this?

Brian

Never mind… after looking through the offending files “ntddk.h” and “ntifs.h” I saw that ntddk.h had a statement to look for ntifs.h, so just moved ntifs.h above ntddk.h and the errors went away… imagine that.

Replace ntddk.h with ntifs.h the latter is a super set.

Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

-----Original Message-----
From: xxxxx@gmail.com [mailto:xxxxx@gmail.com]
Posted At: Wednesday, March 31, 2010 8:07 PM
Posted To: ntdev
Conversation: compiler error C2371 – how to fix?
Subject: compiler error C2371 – how to fix?

So for those of you that have been helping with my enduring adventure
of
building a driver here is another issue I just started having.

My driver has the following #includes and compiles and runs fine.
#include “ntddk.h”
#include “ntdddisk.h”
#include “ntstrsafe.h”

However as soon as I added
#include “ntifs.h”

In order to support using ZwSetObjectSecurity and using RtlCreateAcl,
RtlAddAccessAllowedAce, RtlCreateSecurityDescriptor, &
RtlSetDaclSecurityDescriptor. I now get the following two errors:

1>c:\winddk\7600.16385.0\inc\ddk\ntifs.h(85) : error C2371:
‘PEPROCESS’
1>: redefi
nition; different basic types
1>c:\winddk\7600.16385.0\inc\ddk\ntifs.h(86) : error C2371: ‘PETHREAD’
:
1>redefin
ition; different basic types

How can I resolve this?

Brian

__________ Information from ESET Smart Security, version of virus
signature
database 4989 (20100331) __________

The message was checked by ESET Smart Security.

http://www.eset.com

Thanks Don!

Brian

On Mar 31, 2010, at 4:33 PM, “Don Burn” wrote:

> Replace ntddk.h with ntifs.h the latter is a super set.
>
>
> Don Burn (MVP, Windows DKD)
> Windows Filesystem and Driver Consulting
> Website: http://www.windrvr.com
> Blog: http://msmvps.com/blogs/WinDrvr
>
>
>
>
>> -----Original Message-----
>> From: xxxxx@gmail.com [mailto:xxxxx@gmail.com]
>> Posted At: Wednesday, March 31, 2010 8:07 PM
>> Posted To: ntdev
>> Conversation: compiler error C2371 – how to fix?
>> Subject: compiler error C2371 – how to fix?
>>
>> So for those of you that have been helping with my enduring adventure
> of
>> building a driver here is another issue I just started having.
>>
>> My driver has the following #includes and compiles and runs fine.
>> #include “ntddk.h”
>> #include “ntdddisk.h”
>> #include “ntstrsafe.h”
>>
>> However as soon as I added
>> #include “ntifs.h”
>>
>> In order to support using ZwSetObjectSecurity and using RtlCreateAcl,
>> RtlAddAccessAllowedAce, RtlCreateSecurityDescriptor, &
>> RtlSetDaclSecurityDescriptor. I now get the following two errors:
>>
>> 1>c:\winddk\7600.16385.0\inc\ddk\ntifs.h(85) : error C2371:
> ‘PEPROCESS’
>> 1>: redefi
>> nition; different basic types
>> 1>c:\winddk\7600.16385.0\inc\ddk\ntifs.h(86) : error C2371:
>> ‘PETHREAD’
> :
>> 1>redefin
>> ition; different basic types
>>
>> How can I resolve this?
>>
>> Brian
>>
>>
>> Information from ESET Smart Security, version of virus
> signature
>> database 4989 (20100331)

>>
>> The message was checked by ESET Smart Security.
>>
>> http://www.eset.com
>>
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer