Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Drivers > cpp file that includes ntddk.h does not compile on AMD64

Reply
Thread Tools Display Modes

cpp file that includes ntddk.h does not compile on AMD64

 
 
Q33NY
Guest
Posts: n/a

 
      07-22-2010
Hi,

I've posted this question on the VC++ general forum but someone instructed
me to post it here.

I have a cpp program that uses ntddk.h(located in
$(DDK_INSTALL_DIR)\inc\ddk\wnet) - the ddk version is 3790.1830. I am trying
to compile it using MsVStudio2005(via project or Makefile). It works for
target machine X86 and IA64, but when i try to compile it for AMD64, i get
this error:

E:\WINDDK\3790.1830\inc\ddk\wnet\ntddk.h(10139) : error C4430: missing type
specifier - int assumed. Note: C++ does not support default-int

the compiler command is(and the vcvars are set to x86_amd64):

cl /nologo /GS /DWIN32 /D_WIN32 /W3 /D_WINNT /EHsc /c /DZLIB_WINAPI /DNDEBUG
/D_MBCS /MT /D_MT /X /TP /Wp64 /D_AMD64_=1 /DWIN64 /D_WIN64 /I "E:\Program
Files\Microsoft Visual Studio 8\VC\include" /I "E:\Program Files\Microsoft
Platform SDK for Windows Server 2003 R2"\Include /I "E:\Program
Files\Microsoft Platform SDK for Windows Server 2003 R2"\Include\crt /I
..\zlib\include /I E:\WINDDK\3790.1830\inc\ddk\wnet /I
E:\WINDDK\3790.1830\inc\wnet .\Process.cpp /Fo".\int_x64\Process.obj"
Process.cpp


Indeed when i took a look in ntddk.h file i found this:

The following piece of code starts at line 10129:

#define ExInterlockedExchangeUlong(Target, Value, Lock) \
_ExInterlockedExchangeUlong(Target, Value)

__forceinline
//ULONG
_ExInterlockedExchangeUlong (
IN OUT PULONG Target,
IN ULONG Value
)

{

return (ULONG)InterlockedExchange((PLONG)Target, (LONG)Value);
}




It's clear that the return type is missing(I added the "//ULONG" line there
and if i decomment that, it compiles fine on AMD64).

Is this a known issue? Is simply adding the return type a workaround that Ms
encourages?

Note: There's another workaround, using another compiler(well with slightly
different flags) - the one located here: "E:\Program Files\Microsoft Platform
SDK for Windows Server 2003 R2\Bin\win64\x86\AMD64\" - but that is not an
acceptable solution for me.

Regards,

Cristi Fati.


 
Reply With Quote
 
 
 
 
Maxim S. Shatskih
Guest
Posts: n/a

 
      07-22-2010
> I have a cpp program that uses ntddk.h(located in
> $(DDK_INSTALL_DIR)\inc\ddk\wnet) - the ddk version is 3790.1830.


5 years obsolete. Use WDK 6001.18002 for w2k support, and, if you can afford dropping w2k - then the latest Win7 WDK.

Why do you need to include ntddk.h to user-mode project?

--
Maxim S. Shatskih
Windows DDK MVP

http://www.storagecraft.com

 
Reply With Quote
 
Q33NY
Guest
Posts: n/a

 
      07-23-2010
Sadly this is part of the build environment at my work place and probably it
will be updated in the future, but this is not the case now, since it would
mess up many of our components which are working.

the project that i'm working gathers data about the computer that it is
running on(i didn't write the code, i just have to build it for IA64).

But there is a bug in that file right?(i mean if i want to use the vs2005
compiler - cause older compilers automatically assign int as a return type
for a function that doesn't have one)
 
Reply With Quote
 
Tim Roberts
Guest
Posts: n/a

 
      07-25-2010
Q33NY <> wrote:
>...
>the project that i'm working gathers data about the computer that it is
>running on(i didn't write the code, i just have to build it for IA64).


You mean AMD64, right?

>But there is a bug in that file right?


Yes. The 6000 WDK adds the ULONG.
--
Tim Roberts,
Providenza & Boekelheide, Inc.
 
Reply With Quote
 
Q33NY
Guest
Posts: n/a

 
      07-26-2010
I am trying to compile it on IA64, but the AMD64 throws the error. Til now
the amd64 binary was built using another(older) compiler/linker which
automatically added the int return type, but i don't want to do that.


Thank you for your answer, it's just what i needed.

"Tim Roberts" wrote:

> Q33NY <> wrote:
> >...
> >the project that i'm working gathers data about the computer that it is
> >running on(i didn't write the code, i just have to build it for IA64).

>
> You mean AMD64, right?
>
> >But there is a bug in that file right?

>
> Yes. The 6000 WDK adds the ULONG.
> --
> Tim Roberts,
> Providenza & Boekelheide, Inc.
> .
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
testing smart card minidriver leochou Windows Vista Drivers 0 05-31-2010 11:58 AM
Add-Ons "run without permission." OREALLY Internet Explorer 2 01-19-2010 06:09 AM
Leftover folders after Microsoft Update mme000 \(add @yahoo.it to my nick\) Windows Update 21 12-26-2009 10:11 PM
Server 2003 update problem kc66 Windows Update 7 12-22-2009 04:09 PM
Windows 2003 R2 - Missing Disk Space on System drive zinger-uk Windows Server 12 11-29-2009 12:02 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59