Re: build error with KdPrintEx by tsindia
tsindia
Tue Feb 14 23:33:38 CST 2006
David,
I have to include both wdm.h and ntddk.h. I Hope I can include both.
Ntddk.h for now is required only for KdPrintEx but wdm.h ofcourse has many
definitions that I need.
Regds.
"David J. Craig" <drivers@yoshimuni.com> wrote in message
news:%2382NauYMGHA.2300@TK2MSFTNGP15.phx.gbl...
> Then why does it say '#include <wdm.h>' below?
>
> "tsindia" <tsindia@newsgroups.nospam> wrote in message
> news:uzw6y%23TMGHA.3432@tk2msftngp13.phx.gbl...
>> David,
>>
>> I have included ntddk.h and I am aware that it isin't supported on
>> 9x.
>> "David J. Craig" <drivers@yoshimuni.com> wrote in message
>> news:%23%23hY$dTMGHA.3460@TK2MSFTNGP15.phx.gbl...
>>> No - duh! Maybe it isn't in wdm.h. Try ntddk.h. It isn't supported on
>>> 9x.
>>>
>>> "tsindia" <tsindia@newsgroups.nospam> wrote in message
>>> news:OplTZSTMGHA.3756@TK2MSFTNGP10.phx.gbl...
>>>> This is why I find the errors funny, as the other drivers are building
>>>> fine with the same XP checked build environment.
>>>>
>>>> I am pasting the error log here for reference and also the headers I am
>>>> including. Maybe this will help.
>>>>
>>>>>amz_usb_ifdrv.cpp(167) : error C3861: 'KdPrintEx': identifier not
>>>>>found, even
>>>> ith argument-dependent lookup
>>>>>amz_usb_ifdrv.cpp(180) : error C3861: 'KdPrintEx': identifier not
>>>>>found, even
>>>> ith argument-dependent lookup
>>>>>amz_usb_ifdrv.cpp(227) : error C3861: 'KdPrintEx': identifier not
>>>>>found, even
>>>> ith argument-dependent lookup
>>>>>amz_usb_ifdrv.cpp(237) : error C3861: 'KdPrintEx': identifier not
>>>>>found, even
>>>> ith argument-dependent lookup
>>>>>amz_usb_ifdrv.cpp(282) : error C3861: 'KdPrintEx': identifier not
>>>>>found, even
>>>> ith argument-dependent lookup
>>>>
>>>> I am including the headers:
>>>>
>>>> #include "stddef.h"
>>>>
>>>> #include "string.h"
>>>>
>>>> #include "ntddk.h"
>>>>
>>>> #include "driver.h"
>>>>
>>>> #include <wdm.h>
>>>>
>>>> #pragma warning(disable:4200) // zero-sized array
>>>>
>>>> #include <usbdi.h>
>>>>
>>>> #include <usbdlib.h>
>>>>
>>>> #include <stdio.h>
>>>>
>>>>
>>>> her's a paste of my sources and makefile too..
>>>>
>>>> TARGETNAME=TspanUsbDrv
>>>> TARGETTYPE=DRIVER
>>>> #DDKROOT=$(_NTDRIVE)$(_NTROOT)
>>>>
>>>> C_DEFINES= $(C_DEFINES) -DWMI_SUPPORT -DUSB2
>>>>
>>>> TARGETPATH=obj
>>>>
>>>> #INCLUDES=$(DDKROOT)\private\ntos\inc;
>>>> INCLUDES=..\inc;..\..\inc
>>>>
>>>> USE_MAPSYM=1
>>>>
>>>> TARGETLIBS = $(DDK_LIB_PATH)\usbd.lib \
>>>> $(DDK_LIB_PATH)\ntoskrnl.lib \
>>>> NcGen.lib
>>>>
>>>> MSC_WARNING_LEVEL=/W3
>>>>
>>>>
>>>> SOURCES= Control.cpp \
>>>> Debug.cpp \
>>>> DriverEntry.cpp \
>>>> ReadWrite.cpp \
>>>> stddcls.cpp \
>>>> amz_init.cpp \
>>>> amz_usb_ifdrv.cpp
>>>>
>>>>
>>>> Makefile:
>>>>
>>>> !IF 0
>>>>
>>>> Copyright (C) Microsoft Corporation, 1996 - 1998
>>>>
>>>> Module Name:
>>>>
>>>> makefile.
>>>>
>>>> !ENDIF
>>>>
>>>> #
>>>> # DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new
>>>> source
>>>> # file to this component. This file merely indirects to the real make
>>>> file
>>>> # that is shared by all the components of Windows NT
>>>> #
>>>>
>>>> #
>>>> # if building in a DDK environment
>>>> #
>>>> !IF defined(DDK_TARGET_OS)
>>>>
>>>> #
>>>> # ensure that said build environment is at least Windows XP
>>>> # 0x500 == Windows 2000
>>>> # 0x501 == Windows XP
>>>> # 0x502 == Windows .NET
>>>> #
>>>> ! IF defined(_NT_TARGET_VERSION) && $(_NT_TARGET_VERSION)>=0x501
>>>> ! INCLUDE $(NTMAKEENV)\makefile.def
>>>> ! ELSE
>>>> ! message BUILDMSG: Warning : The sample "$(MAKEDIR)" is not
>>>> valid for the current OS target.
>>>> ! ENDIF
>>>>
>>>> !ELSE
>>>>
>>>> #
>>>> # not a DDK environment, probably RAZZLE, so build
>>>> #
>>>> ! INCLUDE $(NTMAKEENV)\makefile.def
>>>>
>>>> !ENDIF
>>>>
>>>> "Eliyas Yakub [MSFT]" <eliyasy@online.microsoft.com> wrote in message
>>>> news:O6GKTW0LGHA.2320@TK2MSFTNGP11.phx.gbl...
>>>>>I tried the exact same statement in my driver and it built fine.
>>>>>
>>>>> -Eliyas
>>>>>
>>>>> "tsindia" <tsindia@newsgroups.nospam> wrote in message
>>>>> news:O2BoKYTLGHA.2320@TK2MSFTNGP11.phx.gbl...
>>>>>> This is the way I am using KdPrintEx
>>>>>>
>>>>>> KdPrintEx((DPFLTR_IHVDRIVER_ID, DPFLTR_ERROR_LEVEL,
>>>>>>
>>>>>> "UIFD_open() unable to create driver thread\n"));
>>>>>>
>>>>>> The component_id is what is suggested in DDK for drivers and the
>>>>>> levels are also as suggested in DDK.
>>>>>>
>>>>>> Regds.
>>>>>>
>>>>>>
>>>>>>
>>>>>> "Eliyas Yakub [MSFT]" <eliyasy@online.microsoft.com> wrote in message
>>>>>> news:OYxlQxMLGHA.420@tk2msftngp13.phx.gbl...
>>>>>>> Show us the code. What is the component id you are using?
>>>>>>>
>>>>>>> -Eliyas
>>>>>>>
>>>>>>>
>>>>>>> "tsindia" <tsindia@newsgroups.nospam> wrote in message
>>>>>>> news:%23xDRQ8GLGHA.2696@TK2MSFTNGP14.phx.gbl...
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I am using KdPrintEx in my driver but i keeep getting the
>>>>>>>> 'identifier not found' error. I have included ntddk.h where it is
>>>>>>>> supposed to be defined. I am building teh driver using 'windows
>>>>>>>> checked build environment for XP'. I have looked into teh sample
>>>>>>>> DDK code 'cdrom' which uses KdPrintEx and I see no difference in
>>>>>>>> the way its used in sample and my driver. The cdrom sample builds
>>>>>>>> without errors.
>>>>>>>>
>>>>>>>> Please let me know what mistake I might be making.
>>>>>>>>
>>>>>>>> Regds.
>>>>>>>> Nitin
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>