Can driver use in Vista64,if dose not pass WHQL?

I setup our modem driver in vista64,but can’t use it. This driver can use in Vista32.What can I do now?
Thank you!

Have you digitally signed the driver?


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

wrote in message news:xxxxx@ntdev…
> I setup our modem driver in vista64,but can’t use it. This driver can use in
Vista32.What can I do now?
> Thank you!
>

xxxxx@hotmail.com wrote:

I setup our modem driver in vista64,but can’t use it. This driver can use in Vista32.What can I do now?

Besides the signature, which Maxim mentioned, did you actually build a
64-bit version?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Hi Maxim & Tim,
We have not digitally signed the drvier.
We install wdk for vista, then biuld the driver, there have some link error.Below is the compile information:

WARNING: x64 Native compiling isn’t supported. Using cross compilers.
C:\WinDDK\6000>e:

E:\>cd E:\code\VTC_USBD_X

E:\code\VTC_USBD_X>buildallusbdebug
E:\code\VTC_USBD_X
.\objchk\i386

=== Building USBD_Modem driver…

OSR DDKBUILD.BAT V5.1 - Copyright 1995-2010 OSR, Open Systems Resources, Inc.
WXP 32 BIT BUILD using WXP DDK
The system cannot find the path specified.
build in directory . with arguments (basedir c:\WINDDK\2600)
run build -Ze -MI for chk version in .
BUILD: Compile and Link for AMD64
BUILD: Start time: Sat Dec 01 06:05:51 2007
BUILD: Examining e:\code\vtc_usbd_x\usbd_modem directory for files to compile.
BUILD: Compiling and Linking e:\code\vtc_usbd_x\usbd_modem directory
Precompiling - viausbmodem.h
Compiling - kqueue.c
Compiling - init.c
Compiling - pnp.c
Compiling - usbrelative.c
Compiling - counterrelative.c
Compiling - irpoprelative.c
Compiling - ioctl.c
Compiling - circlebuffer.c
Compiling - readwrite.c
Compiling - open.c
Compiling - power.c
Compiling - busbdbg.c
Compiling - wmi.c
Linking Executable - objchk_wlh_amd64\amd64\viausbmodem.sys
errors in directory e:\code\vtc_usbd_x\usbd_modem
e:\code\vtc_usbd_x\usbd_modem\kqueue.obj : error LNK2001: unresolved external sy
mbol __imp_KeInitializeSpinLock
e:\code\vtc_usbd_x\usbd_modem\init.obj : error LNK2001: unresolved external symb
ol __imp_KeGetCurrentIrql
e:\code\vtc_usbd_x\usbd_modem\readwrite.obj : error LNK2001: unresolved external
symbol KeTickCount
e:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64\viausbmodem.sys : error LNK
1120: 3 unresolved externals
BUILD: Finish time: Sat Dec 01 06:05:52 2007
BUILD: Done

17 files compiled
1 executable built - 4 Errors
=============== build warnings ======================

build complete
building browse information files
ddkbuild complete

Thanks!

qihua wang

My guess is that you either have DDKBUILD set up incorrectly, or
whatever you have wrapped around it is configure incorrectly. Whatever
the cause, it appears that you are using a WDK x86 WXP environment and
trying to link against amd64 files. This will not work.

In my opinion, you need to take a few steps back. First, what is the
exact build you wish:
x86 or x64;
2000, XP, W3K3 or Vista; and
CHK OR FRE

Once you have figured that out, open the appropriate WDK Build Window -
i.e - x64 CHK Vista or x86 CHK WXP or other - change directory to the
root of your project, and type ‘BUILD -ceZ.’ Until this works
correctly, don’t try to build any other way; DDKBUILD is great, but for
the moment, just get this working.

If you do this, I think your linker errors will go away.

Good luck,

mm

xxxxx@hotmail.com wrote:

Hi Maxim & Tim,
We have not digitally signed the drvier.
We install wdk for vista, then biuld the driver, there have some link error.Below is the compile information:

WARNING: x64 Native compiling isn’t supported. Using cross compilers.
C:\WinDDK\6000>e:

E:\>cd E:\code\VTC_USBD_X

E:\code\VTC_USBD_X>buildallusbdebug
E:\code\VTC_USBD_X
.\objchk\i386

=== Building USBD_Modem driver…

OSR DDKBUILD.BAT V5.1 - Copyright 1995-2010 OSR, Open Systems Resources, Inc.
WXP 32 BIT BUILD using WXP DDK
The system cannot find the path specified.
build in directory . with arguments (basedir c:\WINDDK\2600)
run build -Ze -MI for chk version in .
BUILD: Compile and Link for AMD64
BUILD: Start time: Sat Dec 01 06:05:51 2007
BUILD: Examining e:\code\vtc_usbd_x\usbd_modem directory for files to compile.
BUILD: Compiling and Linking e:\code\vtc_usbd_x\usbd_modem directory
Precompiling - viausbmodem.h
Compiling - kqueue.c
Compiling - init.c
Compiling - pnp.c
Compiling - usbrelative.c
Compiling - counterrelative.c
Compiling - irpoprelative.c
Compiling - ioctl.c
Compiling - circlebuffer.c
Compiling - readwrite.c
Compiling - open.c
Compiling - power.c
Compiling - busbdbg.c
Compiling - wmi.c
Linking Executable - objchk_wlh_amd64\amd64\viausbmodem.sys
errors in directory e:\code\vtc_usbd_x\usbd_modem
e:\code\vtc_usbd_x\usbd_modem\kqueue.obj : error LNK2001: unresolved external sy
mbol __imp_KeInitializeSpinLock
e:\code\vtc_usbd_x\usbd_modem\init.obj : error LNK2001: unresolved external symb
ol __imp_KeGetCurrentIrql
e:\code\vtc_usbd_x\usbd_modem\readwrite.obj : error LNK2001: unresolved external
symbol KeTickCount
e:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64\viausbmodem.sys : error LNK
1120: 3 unresolved externals
BUILD: Finish time: Sat Dec 01 06:05:52 2007
BUILD: Done

17 files compiled
1 executable built - 4 Errors
=============== build warnings ======================

build complete
building browse information files
ddkbuild complete

Thanks!

qihua wang

Hi mm,
Thank you very much!
The build we wish is:x64;Vista64;CHK.
We biuld the driver use “Windows Vista and windows server Longhorn x64 checked build environment”,then change directory to the root of our project,and type ‘-ceZ’.There is same link error.
Below is the build information:

E:\code\VTC_USBD_X\USBD_MODEM>BUILD -ceZ
BUILD: Compile and Link for AMD64
BUILD: Start time: Wed Dec 05 04:21:09 2007
BUILD: Examining e:\code\vtc_usbd_x\usbd_modem directory for files to compile.
BUILD: Compiling and Linking e:\code\vtc_usbd_x\usbd_modem directory
Precompiling - viausbmodem.h
Compiling - kqueue.c
Compiling - init.c
Compiling - pnp.c
Compiling - usbrelative.c
Compiling - counterrelative.c
Compiling - irpoprelative.c
Compiling - ioctl.c
Compiling - circlebuffer.c
Compiling - readwrite.c
Compiling - open.c
Compiling - power.c
Compiling - busbdbg.c
Compiling - wmi.c
Linking Executable - objchk_wlh_amd64\amd64\viausbmodem.sys
errors in directory e:\code\vtc_usbd_x\usbd_modem
e:\code\vtc_usbd_x\usbd_modem\kqueue.obj : error LNK2001: unresolved external sy
mbol __imp_KeInitializeSpinLock
e:\code\vtc_usbd_x\usbd_modem\init.obj : error LNK2001: unresolved external symb
ol __imp_KeGetCurrentIrql
e:\code\vtc_usbd_x\usbd_modem\readwrite.obj : error LNK2001: unresolved external
symbol KeTickCount
e:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64\viausbmodem.sys : error LNK
1120: 3 unresolved externals
BUILD: Finish time: Wed Dec 05 04:21:10 2007
BUILD: Done

17 files compiled
1 executable built - 4 Errors

This is content in buildchk_wlh_amd64.log:
BUILD: Examining e:\code\vtc_usbd_x\usbd_modem directory for files to compile.
before AssemblyIdentity_AfterReadAllSources
after AssemblyIdentity_AfterReadAllSources
skipping post pass 0 command
Compiling and Linking e:\code\vtc_usbd_x\usbd_modem *************
‘nmake.exe /nologo BUILDMSG=Stop. -i BUILD_PASS=PASS2 LINKONLY=1 NOPASS0=1 MAKEDIR_RELATIVE_TO_BASEDIR= MAKEDIR_LOWERCASE=e:\code\vtc_usbd_x\usbd_modem’
e:\code\vtc_usbd_x\usbd_modem: TARGETPATH is obj
cl.exe /Iamd64\ /I. /Ic:\winddk\6000\inc\ddk\wdm /Ic:\winddk\6000\inc\ddk\wdm\wxp /Ic:\winddk\6000\inc\ddk\wxp /Ic:\winddk\6000\inc\wxp /Ic:\winddk\6000\inc\crt /Ie:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64 /IC:\WinDDK\6000\inc\api /IC:\WinDDK\6000\inc\api /IC:\WinDDK\6000\inc\ddk /IC:\WinDDK\6000\inc\ddk /IC:\WinDDK\6000\inc\crt /D_WIN64 /D_AMD64_ /DAMD64 /DCONDITION_HANDLING=1 /DNT_INST=0 /DWIN32=100 /D_NT1X_=100 /DWINNT=1 /D_WIN32_WINNT=0x0600 /DWINVER=0x0600 /D_WIN32_IE=0x0700 /DWIN32_LEAN_AND_MEAN=1 /DDEVL=1 /DDBG=1 /D__BUILDMACHINE__=WinDDK /D_DLL=1 /DNDEBUG /DDEPRECATE_DDK_FUNCTIONS=1 /DMSC_NOOPT /DNTDDI_VERSION=0x06000000 /c /Zc:wchar_t- /Zl /Zp8 /Gy -cbstring /W3 /WX /Wp64 /EHs-c- /GR- /GF /GS /Zi /Od /Oi /GL /Zi /Fde:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64\ -DKMDF_MAJOR_VERSION=01 -DKMDF_MINOR_VERSION=005 /homeparams /FIC:\WinDDK\6000\inc\api\warning.h /Yuviausbmodem.h /Fpobjchk_wlh_amd64\amd64\viausbmodem.pch /Ylviausbmodem /Ycviausbmodem.h /Fpobjchk_wlh_amd64\amd64\viausbmodem.pch /Fo"objchk_wlh_amd64\amd64\viausbmodem.obj" /Tc

#include “viausbmodem.h”

Microsoft (R) C/C++ Optimizing Compiler Version 14.00.50727.215 for x64
Copyright (C) Microsoft Corporation. All rights reserved.

cl
/Iamd64\
/I.
/Ic:\winddk\6000\inc\ddk\wdm
/Ic:\winddk\6000\inc\ddk\wdm\wxp
/Ic:\winddk\6000\inc\ddk\wxp
/Ic:\winddk\6000\inc\wxp
/Ic:\winddk\6000\inc\crt
/Ie:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64
/IC:\WinDDK\6000\inc\api
/IC:\WinDDK\6000\inc\api
/IC:\WinDDK\6000\inc\ddk
/IC:\WinDDK\6000\inc\ddk
/IC:\WinDDK\6000\inc\crt
/D_WIN64
/D_AMD64_
/DAMD64

/DCONDITION_HANDLING=1

/DNT_INST=0
/DWIN32=100
/D_NT1X_=100
/DWINNT=1
/D_WIN32_WINNT=0x0600
/DWINVER=0x0600
/D_WIN32_IE=0x0700

/DWIN32_LEAN_AND_MEAN=1
/DDEVL=1
/DDBG=1
/D__BUILDMACHINE__=WinDDK

/D_DLL=1
/DNDEBUG

/DDEPRECATE_DDK_FUNCTIONS=1
/DMSC_NOOPT
/DNTDDI_VERSION=0x06000000

/c
/Zc:wchar_t-
/Zl
/Zp8
/Gy
-cbstring
/W3
/WX
/Wp64

/EHs-c-

/GR-
/GF
/GS
/Zi
/Od
/Oi

/GL
/Zi
/Fde:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64\

-DKMDF_MAJOR_VERSION=01
-DKMDF_MINOR_VERSION=005
/homeparams
/FIC:\WinDDK\6000\inc\api\warning.h

/Ylviausbmodem /Ycviausbmodem.h /Fpobjchk_wlh_amd64\amd64\viausbmodem.pch /Fo"objchk_wlh_amd64\amd64\viausbmodem.obj"

pch_hdr.src
cl.exe @e:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64\cl.rsp
Microsoft (R) C/C++ Optimizing Compiler Version 14.00.50727.215 for x64
Copyright (C) Microsoft Corporation. All rights reserved.

cl /Fo"e:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64/"
/FC

/Iamd64\
/I.
/Ic:\winddk\6000\inc\ddk\wdm
/Ic:\winddk\6000\inc\ddk\wdm\wxp
/Ic:\winddk\6000\inc\ddk\wxp
/Ic:\winddk\6000\inc\wxp
/Ic:\winddk\6000\inc\crt
/Ie:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64
/IC:\WinDDK\6000\inc\api
/IC:\WinDDK\6000\inc\api
/IC:\WinDDK\6000\inc\ddk
/IC:\WinDDK\6000\inc\ddk
/IC:\WinDDK\6000\inc\crt
/D_WIN64
/D_AMD64_
/DAMD64

/DCONDITION_HANDLING=1

/DNT_INST=0
/DWIN32=100
/D_NT1X_=100
/DWINNT=1
/D_WIN32_WINNT=0x0600
/DWINVER=0x0600
/D_WIN32_IE=0x0700

/DWIN32_LEAN_AND_MEAN=1
/DDEVL=1
/DDBG=1
/D__BUILDMACHINE__=WinDDK

/D_DLL=1
/DNDEBUG

/DDEPRECATE_DDK_FUNCTIONS=1
/DMSC_NOOPT
/DNTDDI_VERSION=0x06000000

/c
/Zc:wchar_t-
/Zl
/Zp8
/Gy
-cbstring
/W3
/WX
/Wp64

/EHs-c-

/GR-
/GF
/GS
/Zi
/Od
/Oi

/GL
/Zi
/Fde:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64\

-DKMDF_MAJOR_VERSION=01
-DKMDF_MINOR_VERSION=005
/homeparams
/FIC:\WinDDK\6000\inc\api\warning.h

/Yuviausbmodem.h
/Fpobjchk_wlh_amd64\amd64\viausbmodem.pch
.\kqueue.c .\init.c .\pnp.c .\usbrelative.c .\counterrelative.c .\irpoprelative.c .\ioctl.c .\circlebuffer.c .\readwrite.c .\open.c .\power.c .\busbdbg.c .\wmi.c

kqueue.c
init.c
pnp.c
usbrelative.c
counterrelative.c
irpoprelative.c
ioctl.c
circlebuffer.c
readwrite.c
open.c
power.c
busbdbg.c
wmi.c
link.exe /out:objchk_wlh_amd64\amd64\viausbmodem.sys /machine:amd64 @C:\Users\via\AppData\Local\Temp\nmA3B3.tmp
Microsoft (R) Incremental Linker Version 8.00.50727.215
Copyright (C) Microsoft Corporation. All rights reserved.

/MERGE:_PAGE=PAGE
/MERGE:_TEXT=.text
/SECTION:INIT,d
/OPT:REF
/OPT:ICF
/IGNORE:4198,4010,4037,4039,4065,4070,4078,4087,4089,4221,4108,4088,4218,4218,4235
/INCREMENTAL:NO
/FULLBUILD
/release
/NODEFAULTLIB
/WX
/debug
/debugtype:cv
/version:6.0
/osversion:6.0
/debug
/debugtype:cv,fixup,pdata
/opt:nowin98
C:\WinDDK\6000\lib\wlh\amd64\hotpatch.obj
/functionpadmin:6
/pdbcompress
/STACK:0x40000,0x1000
/driver
/base:0x10000
/subsystem:native,6.00
/entry:GsDriverEntry
/out:objchk_wlh_amd64\amd64\viausbmodem.sys
objchk_wlh_amd64\amd64\viausbmodem.obj
objchk_wlh_amd64\amd64\kqueue.obj
objchk_wlh_amd64\amd64\init.obj
objchk_wlh_amd64\amd64\pnp.obj
objchk_wlh_amd64\amd64\usbrelative.obj
objchk_wlh_amd64\amd64\counterrelative.obj
objchk_wlh_amd64\amd64\irpoprelative.obj
objchk_wlh_amd64\amd64\ioctl.obj
objchk_wlh_amd64\amd64\circlebuffer.obj
objchk_wlh_amd64\amd64\readwrite.obj
objchk_wlh_amd64\amd64\open.obj
objchk_wlh_amd64\amd64\power.obj
objchk_wlh_amd64\amd64\busbdbg.obj
objchk_wlh_amd64\amd64\wmi.obj
C:\WinDDK\6000\lib\wlh\amd64\BufferOverflowK.lib
C:\WinDDK\6000\lib\wlh\amd64\ntoskrnl.lib
C:\WinDDK\6000\lib\wlh\amd64\hal.lib
C:\WinDDK\6000\lib\wlh\amd64\wmilib.lib
C:\WinDDK\6000\lib\wlh\amd64\wdm.lib
C:\WinDDK\6000\lib\wlh\amd64\usbd.lib
C:\WinDDK\6000\lib\wlh\amd64\ntstrsafe.lib
C:\WinDDK\6000\lib\wlh\amd64\ntoskrnl.lib
viausbmodem.obj : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
Microsoft (R) Incremental Linker Version 8.00.50727.215
Copyright (C) Microsoft Corporation. All rights reserved.

/MERGE:_PAGE=PAGE
/MERGE:_TEXT=.text
/SECTION:INIT,d
/OPT:REF
/OPT:ICF
/IGNORE:4198,4010,4037,4039,4065,4070,4078,4087,4089,4221,4108,4088,4218,4218,4235
/INCREMENTAL:NO
/FULLBUILD
/release
/NODEFAULTLIB
/WX
/debug
/debugtype:cv
/version:6.0
/osversion:6.0
/debug
/debugtype:cv,fixup,pdata
/opt:nowin98
C:\WinDDK\6000\lib\wlh\amd64\hotpatch.obj
/functionpadmin:6
/pdbcompress
/STACK:0x40000,0x1000
/driver
/base:0x10000
/subsystem:native,6.00
/entry:GsDriverEntry
/out:objchk_wlh_amd64\amd64\viausbmodem.sys
objchk_wlh_amd64\amd64\viausbmodem.obj
objchk_wlh_amd64\amd64\kqueue.obj
objchk_wlh_amd64\amd64\init.obj
objchk_wlh_amd64\amd64\pnp.obj
objchk_wlh_amd64\amd64\usbrelative.obj
objchk_wlh_amd64\amd64\counterrelative.obj
objchk_wlh_amd64\amd64\irpoprelative.obj
objchk_wlh_amd64\amd64\ioctl.obj
objchk_wlh_amd64\amd64\circlebuffer.obj
objchk_wlh_amd64\amd64\readwrite.obj
objchk_wlh_amd64\amd64\open.obj
objchk_wlh_amd64\amd64\power.obj
objchk_wlh_amd64\amd64\busbdbg.obj
objchk_wlh_amd64\amd64\wmi.obj
C:\WinDDK\6000\lib\wlh\amd64\BufferOverflowK.lib
C:\WinDDK\6000\lib\wlh\amd64\ntoskrnl.lib
C:\WinDDK\6000\lib\wlh\amd64\hal.lib
C:\WinDDK\6000\lib\wlh\amd64\wmilib.lib
C:\WinDDK\6000\lib\wlh\amd64\wdm.lib
C:\WinDDK\6000\lib\wlh\amd64\usbd.lib
C:\WinDDK\6000\lib\wlh\amd64\ntstrsafe.lib
C:\WinDDK\6000\lib\wlh\amd64\ntoskrnl.lib
kqueue.obj : error LNK2001: unresolved external symbol __imp_KeInitializeSpinLock
errors in directory e:\code\vtc_usbd_x\usbd_modem
e:\code\vtc_usbd_x\usbd_modem\kqueue.obj : error LNK2001: unresolved external symbol __imp_KeInitializeSpinLock
init.obj : error LNK2001: unresolved external symbol __imp_KeGetCurrentIrql
e:\code\vtc_usbd_x\usbd_modem\init.obj : error LNK2001: unresolved external symbol __imp_KeGetCurrentIrql
readwrite.obj : error LNK2001: unresolved external symbol KeTickCount
e:\code\vtc_usbd_x\usbd_modem\readwrite.obj : error LNK2001: unresolved external symbol KeTickCount
objchk_wlh_amd64\amd64\viausbmodem.sys : fatal error LNK1120: 3 unresolved externals
e:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64\viausbmodem.sys : error LNK1120: 3 unresolved externals

How about not using illegal system calls from a KMDF driver? I haven’t done
much with KMDF recently, but I suspect you had to fake out declarations to
enable them to compile. This could be a wild-xxx guess, but I am tired and
it is late on a Monday night.

wrote in message news:xxxxx@ntdev…
This is content in buildchk_wlh_amd64.log:
BUILD: Examining e:\code\vtc_usbd_x\usbd_modem directory for files to
compile.
before AssemblyIdentity_AfterReadAllSources
after AssemblyIdentity_AfterReadAllSources
skipping post pass 0 command
Compiling and Linking e:\code\vtc_usbd_x\usbd_modem *************
‘nmake.exe /nologo BUILDMSG=Stop. -i BUILD_PASS=PASS2 LINKONLY=1 NOPASS0=1
MAKEDIR_RELATIVE_TO_BASEDIR=
MAKEDIR_LOWERCASE=e:\code\vtc_usbd_x\usbd_modem’
e:\code\vtc_usbd_x\usbd_modem: TARGETPATH is obj
cl.exe /Iamd64\ /I. /Ic:\winddk\6000\inc\ddk\wdm
/Ic:\winddk\6000\inc\ddk\wdm\wxp /Ic:\winddk\6000\inc\ddk\wxp
/Ic:\winddk\6000\inc\wxp /Ic:\winddk\6000\inc\crt
/Ie:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64
/IC:\WinDDK\6000\inc\api /IC:\WinDDK\6000\inc\api /IC:\WinDDK\6000\inc\ddk
/IC:\WinDDK\6000\inc\ddk /IC:\WinDDK\6000\inc\crt /D_WIN64 /D_AMD64_ /DAMD64
/DCONDITION_HANDLING=1 /DNT_INST=0 /DWIN32=100 /D_NT1X_=100 /DWINNT=1
/D_WIN32_WINNT=0x0600 /DWINVER=0x0600 /D_WIN32_IE=0x0700
/DWIN32_LEAN_AND_MEAN=1 /DDEVL=1 /DDBG=1 /D BUILDMACHINE =WinDDK /D_DLL=1
/DNDEBUG /DDEPRECATE_DDK_FUNCTIONS=1 /DMSC_NOOPT /DNTDDI_VERSION=0x06000000
/c /Zc:wchar_t- /Zl /Zp8 /Gy -cbstring /W3 /WX /Wp64 /EHs-c- /GR- /GF /GS
/Zi /Od /Oi /GL /Zi
/Fde:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64\ -DKMDF_MAJOR_VERSION=01
-DKMDF_MINOR_VERSION=005 /homeparams /FIC:\WinDDK\6000\inc\api\warning.h
/Yuviausbmodem.h /Fpobjchk_wlh_amd64\amd64\viausbmodem.pch /Ylviausbmodem
/Ycviausbmodem.h /Fpobjchk_wlh_amd64\amd64\viausbmodem.pch
/Fo"objchk_wlh_amd64\amd64\viausbmodem.obj" /Tc

#include “viausbmodem.h”

Microsoft (R) C/C++ Optimizing Compiler Version 14.00.50727.215 for x64
Copyright (C) Microsoft Corporation. All rights reserved.

cl
/Iamd64<br> /I.
/Ic:\winddk\6000\inc\ddk\wdm
/Ic:\winddk\6000\inc\ddk\wdm\wxp
/Ic:\winddk\6000\inc\ddk\wxp
/Ic:\winddk\6000\inc\wxp
/Ic:\winddk\6000\inc\crt
/Ie:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64
/IC:\WinDDK\6000\inc\api
/IC:\WinDDK\6000\inc\api
/IC:\WinDDK\6000\inc\ddk
/IC:\WinDDK\6000\inc\ddk
/IC:\WinDDK\6000\inc\crt
/D_WIN64
/D_AMD64_
/DAMD64

/DCONDITION_HANDLING=1

/DNT_INST=0
/DWIN32=100
/D_NT1X_=100
/DWINNT=1
/D_WIN32_WINNT=0x0600
/DWINVER=0x0600
/D_WIN32_IE=0x0700

/DWIN32_LEAN_AND_MEAN=1
/DDEVL=1
/DDBG=1
/D BUILDMACHINE =WinDDK

/D_DLL=1
/DNDEBUG

/DDEPRECATE_DDK_FUNCTIONS=1
/DMSC_NOOPT
/DNTDDI_VERSION=0x06000000

/c
/Zc:wchar_t-
/Zl
/Zp8
/Gy
-cbstring
/W3
/WX
/Wp64

/EHs-c-

/GR-
/GF
/GS
/Zi
/Od
/Oi

/GL
/Zi
/Fde:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64<br>
-DKMDF_MAJOR_VERSION=01
-DKMDF_MINOR_VERSION=005
/homeparams
/FIC:\WinDDK\6000\inc\api\warning.h

/Ylviausbmodem /Ycviausbmodem.h /Fpobjchk_wlh_amd64\amd64\viausbmodem.pch
/Fo"objchk_wlh_amd64\amd64\viausbmodem.obj"

pch_hdr.src
cl.exe @e:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64\cl.rsp
Microsoft (R) C/C++ Optimizing Compiler Version 14.00.50727.215 for x64
Copyright (C) Microsoft Corporation. All rights reserved.

cl /Fo"e:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64/"
/FC

/Iamd64<br> /I.
/Ic:\winddk\6000\inc\ddk\wdm
/Ic:\winddk\6000\inc\ddk\wdm\wxp
/Ic:\winddk\6000\inc\ddk\wxp
/Ic:\winddk\6000\inc\wxp
/Ic:\winddk\6000\inc\crt
/Ie:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64
/IC:\WinDDK\6000\inc\api
/IC:\WinDDK\6000\inc\api
/IC:\WinDDK\6000\inc\ddk
/IC:\WinDDK\6000\inc\ddk
/IC:\WinDDK\6000\inc\crt
/D_WIN64
/D_AMD64_
/DAMD64

/DCONDITION_HANDLING=1

/DNT_INST=0
/DWIN32=100
/D_NT1X_=100
/DWINNT=1
/D_WIN32_WINNT=0x0600
/DWINVER=0x0600
/D_WIN32_IE=0x0700

/DWIN32_LEAN_AND_MEAN=1
/DDEVL=1
/DDBG=1
/D BUILDMACHINE =WinDDK

/D_DLL=1
/DNDEBUG

/DDEPRECATE_DDK_FUNCTIONS=1
/DMSC_NOOPT
/DNTDDI_VERSION=0x06000000

/c
/Zc:wchar_t-
/Zl
/Zp8
/Gy
-cbstring
/W3
/WX
/Wp64

/EHs-c-

/GR-
/GF
/GS
/Zi
/Od
/Oi

/GL
/Zi
/Fde:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64<br>
-DKMDF_MAJOR_VERSION=01
-DKMDF_MINOR_VERSION=005
/homeparams
/FIC:\WinDDK\6000\inc\api\warning.h

/Yuviausbmodem.h
/Fpobjchk_wlh_amd64\amd64\viausbmodem.pch
.\kqueue.c .\init.c .\pnp.c .\usbrelative.c .\counterrelative.c
.\irpoprelative.c .\ioctl.c .\circlebuffer.c .\readwrite.c .\open.c
.\power.c .\busbdbg.c .\wmi.c

kqueue.c
init.c
pnp.c
usbrelative.c
counterrelative.c
irpoprelative.c
ioctl.c
circlebuffer.c
readwrite.c
open.c
power.c
busbdbg.c
wmi.c
link.exe /out:objchk_wlh_amd64\amd64\viausbmodem.sys /machine:amd64
@C:\Users\via\AppData\Local\Temp\nmA3B3.tmp
Microsoft (R) Incremental Linker Version 8.00.50727.215
Copyright (C) Microsoft Corporation. All rights reserved.

/MERGE:_PAGE=PAGE
/MERGE:_TEXT=.text
/SECTION:INIT,d
/OPT:REF
/OPT:ICF
/IGNORE:4198,4010,4037,4039,4065,4070,4078,4087,4089,4221,4108,4088,4218,4218,4235
/INCREMENTAL:NO
/FULLBUILD
/release
/NODEFAULTLIB
/WX
/debug
/debugtype:cv
/version:6.0
/osversion:6.0
/debug
/debugtype:cv,fixup,pdata
/opt:nowin98
C:\WinDDK\6000\lib\wlh\amd64\hotpatch.obj
/functionpadmin:6
/pdbcompress
/STACK:0x40000,0x1000
/driver
/base:0x10000
/subsystem:native,6.00
/entry:GsDriverEntry
/out:objchk_wlh_amd64\amd64\viausbmodem.sys
objchk_wlh_amd64\amd64\viausbmodem.obj
objchk_wlh_amd64\amd64\kqueue.obj
objchk_wlh_amd64\amd64\init.obj
objchk_wlh_amd64\amd64\pnp.obj
objchk_wlh_amd64\amd64\usbrelative.obj
objchk_wlh_amd64\amd64\counterrelative.obj
objchk_wlh_amd64\amd64\irpoprelative.obj
objchk_wlh_amd64\amd64\ioctl.obj
objchk_wlh_amd64\amd64\circlebuffer.obj
objchk_wlh_amd64\amd64\readwrite.obj
objchk_wlh_amd64\amd64\open.obj
objchk_wlh_amd64\amd64\power.obj
objchk_wlh_amd64\amd64\busbdbg.obj
objchk_wlh_amd64\amd64\wmi.obj
C:\WinDDK\6000\lib\wlh\amd64\BufferOverflowK.lib
C:\WinDDK\6000\lib\wlh\amd64\ntoskrnl.lib
C:\WinDDK\6000\lib\wlh\amd64\hal.lib
C:\WinDDK\6000\lib\wlh\amd64\wmilib.lib
C:\WinDDK\6000\lib\wlh\amd64\wdm.lib
C:\WinDDK\6000\lib\wlh\amd64\usbd.lib
C:\WinDDK\6000\lib\wlh\amd64\ntstrsafe.lib
C:\WinDDK\6000\lib\wlh\amd64\ntoskrnl.lib
viausbmodem.obj : MSIL .netmodule or module compiled with /GL found;
restarting link with /LTCG; add /LTCG to the link command line to improve
linker performance
Microsoft (R) Incremental Linker Version 8.00.50727.215
Copyright (C) Microsoft Corporation. All rights reserved.

/MERGE:_PAGE=PAGE
/MERGE:_TEXT=.text
/SECTION:INIT,d
/OPT:REF
/OPT:ICF
/IGNORE:4198,4010,4037,4039,4065,4070,4078,4087,4089,4221,4108,4088,4218,4218,4235
/INCREMENTAL:NO
/FULLBUILD
/release
/NODEFAULTLIB
/WX
/debug
/debugtype:cv
/version:6.0
/osversion:6.0
/debug
/debugtype:cv,fixup,pdata
/opt:nowin98
C:\WinDDK\6000\lib\wlh\amd64\hotpatch.obj
/functionpadmin:6
/pdbcompress
/STACK:0x40000,0x1000
/driver
/base:0x10000
/subsystem:native,6.00
/entry:GsDriverEntry
/out:objchk_wlh_amd64\amd64\viausbmodem.sys
objchk_wlh_amd64\amd64\viausbmodem.obj
objchk_wlh_amd64\amd64\kqueue.obj
objchk_wlh_amd64\amd64\init.obj
objchk_wlh_amd64\amd64\pnp.obj
objchk_wlh_amd64\amd64\usbrelative.obj
objchk_wlh_amd64\amd64\counterrelative.obj
objchk_wlh_amd64\amd64\irpoprelative.obj
objchk_wlh_amd64\amd64\ioctl.obj
objchk_wlh_amd64\amd64\circlebuffer.obj
objchk_wlh_amd64\amd64\readwrite.obj
objchk_wlh_amd64\amd64\open.obj
objchk_wlh_amd64\amd64\power.obj
objchk_wlh_amd64\amd64\busbdbg.obj
objchk_wlh_amd64\amd64\wmi.obj
C:\WinDDK\6000\lib\wlh\amd64\BufferOverflowK.lib
C:\WinDDK\6000\lib\wlh\amd64\ntoskrnl.lib
C:\WinDDK\6000\lib\wlh\amd64\hal.lib
C:\WinDDK\6000\lib\wlh\amd64\wmilib.lib
C:\WinDDK\6000\lib\wlh\amd64\wdm.lib
C:\WinDDK\6000\lib\wlh\amd64\usbd.lib
C:\WinDDK\6000\lib\wlh\amd64\ntstrsafe.lib
C:\WinDDK\6000\lib\wlh\amd64\ntoskrnl.lib
kqueue.obj : error LNK2001: unresolved external symbol
imp_KeInitializeSpinLock
errors in directory e:\code\vtc_usbd_x\usbd_modem
e:\code\vtc_usbd_x\usbd_modem\kqueue.obj : error LNK2001: unresolved
external symbol
imp_KeInitializeSpinLock
init.obj : error LNK2001: unresolved external symbol imp_KeGetCurrentIrql
e:\code\vtc_usbd_x\usbd_modem\init.obj : error LNK2001: unresolved external
symbol
imp_KeGetCurrentIrql
readwrite.obj : error LNK2001: unresolved external symbol KeTickCount
e:\code\vtc_usbd_x\usbd_modem\readwrite.obj : error LNK2001: unresolved
external symbol KeTickCount
objchk_wlh_amd64\amd64\viausbmodem.sys : fatal error LNK1120: 3 unresolved
externals
e:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64\viausbmodem.sys : error
LNK1120: 3 unresolved externals

I believe that the root cause of your problem is that the functions for
which you are getting unresolved reference errors are inline functions
on AMD64:

For example (from wdm.h):

#if defined(X86) && (defined(WDM_INCLUDED) ||
defined(WIN9X_COMPAT_SPINLOCK))

#if (NTDDI_VERSION >= NTDDI_WIN2K)
NTKERNELAPI
VOID
NTAPI
KeInitializeSpinLock (
__out PKSPIN_LOCK SpinLock
);
#endif

#else

FORCEINLINE
VOID
NTAPI
KeInitializeSpinLock (
__out PKSPIN_LOCK SpinLock
)
{
*SpinLock = 0;
}

#endif

That being said, I have no idea of what you could be doing to screw up a
standard build using a SOURCES file like this. I don’t mean to be
critical, but it’s very hard to make any sense out of anything that you
posted for a few reasons. The first is that you posted things multiple
times, to multiple threads with different subjects; it makes it very
hard to figure out what you’ve done. Secondly, your posts have some
important differences. The first had some i386 references; these don’t

Please post your the SOURCES file that you processing with ‘BUILD -ceZ.’

mm

David Craig wrote:

How about not using illegal system calls from a KMDF driver? I haven’t done
much with KMDF recently, but I suspect you had to fake out declarations to
enable them to compile. This could be a wild-xxx guess, but I am tired and
it is late on a Monday night.

wrote in message news:xxxxx@ntdev…
> This is content in buildchk_wlh_amd64.log:
> BUILD: Examining e:\code\vtc_usbd_x\usbd_modem directory for files to
> compile.
> before AssemblyIdentity_AfterReadAllSources
> after AssemblyIdentity_AfterReadAllSources
> skipping post pass 0 command
> Compiling and Linking e:\code\vtc_usbd_x\usbd_modem *************
> ‘nmake.exe /nologo BUILDMSG=Stop. -i BUILD_PASS=PASS2 LINKONLY=1 NOPASS0=1
> MAKEDIR_RELATIVE_TO_BASEDIR=
> MAKEDIR_LOWERCASE=e:\code\vtc_usbd_x\usbd_modem’
> e:\code\vtc_usbd_x\usbd_modem: TARGETPATH is obj
> cl.exe /Iamd64\ /I. /Ic:\winddk\6000\inc\ddk\wdm
> /Ic:\winddk\6000\inc\ddk\wdm\wxp /Ic:\winddk\6000\inc\ddk\wxp
> /Ic:\winddk\6000\inc\wxp /Ic:\winddk\6000\inc\crt
> /Ie:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64
> /IC:\WinDDK\6000\inc\api /IC:\WinDDK\6000\inc\api /IC:\WinDDK\6000\inc\ddk
> /IC:\WinDDK\6000\inc\ddk /IC:\WinDDK\6000\inc\crt /D_WIN64 /D_AMD64_ /DAMD64
> /DCONDITION_HANDLING=1 /DNT_INST=0 /DWIN32=100 /D_NT1X_=100 /DWINNT=1
> /D_WIN32_WINNT=0x0600 /DWINVER=0x0600 /D_WIN32_IE=0x0700
> /DWIN32_LEAN_AND_MEAN=1 /DDEVL=1 /DDBG=1 /D BUILDMACHINE =WinDDK /D_DLL=1
> /DNDEBUG /DDEPRECATE_DDK_FUNCTIONS=1 /DMSC_NOOPT /DNTDDI_VERSION=0x06000000
> /c /Zc:wchar_t- /Zl /Zp8 /Gy -cbstring /W3 /WX /Wp64 /EHs-c- /GR- /GF /GS
> /Zi /Od /Oi /GL /Zi
> /Fde:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64\ -DKMDF_MAJOR_VERSION=01
> -DKMDF_MINOR_VERSION=005 /homeparams /FIC:\WinDDK\6000\inc\api\warning.h
> /Yuviausbmodem.h /Fpobjchk_wlh_amd64\amd64\viausbmodem.pch /Ylviausbmodem
> /Ycviausbmodem.h /Fpobjchk_wlh_amd64\amd64\viausbmodem.pch
> /Fo"objchk_wlh_amd64\amd64\viausbmodem.obj" /Tc
>
> #include “viausbmodem.h”
>
> Microsoft (R) C/C++ Optimizing Compiler Version 14.00.50727.215 for x64
> Copyright (C) Microsoft Corporation. All rights reserved.
>
> cl
> /Iamd64<br>> /I.
> /Ic:\winddk\6000\inc\ddk\wdm
> /Ic:\winddk\6000\inc\ddk\wdm\wxp
> /Ic:\winddk\6000\inc\ddk\wxp
> /Ic:\winddk\6000\inc\wxp
> /Ic:\winddk\6000\inc\crt
> /Ie:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64
> /IC:\WinDDK\6000\inc\api
> /IC:\WinDDK\6000\inc\api
> /IC:\WinDDK\6000\inc\ddk
> /IC:\WinDDK\6000\inc\ddk
> /IC:\WinDDK\6000\inc\crt
> /D_WIN64
> /D_AMD64_
> /DAMD64
>
>
> /DCONDITION_HANDLING=1
>
>
> /DNT_INST=0
> /DWIN32=100
> /D_NT1X_=100
> /DWINNT=1
> /D_WIN32_WINNT=0x0600
> /DWINVER=0x0600
> /D_WIN32_IE=0x0700
>
>
>
> /DWIN32_LEAN_AND_MEAN=1
> /DDEVL=1
> /DDBG=1
> /D BUILDMACHINE =WinDDK
>
>
> /D_DLL=1
> /DNDEBUG
>
> /DDEPRECATE_DDK_FUNCTIONS=1
> /DMSC_NOOPT
> /DNTDDI_VERSION=0x06000000
>
>
>
>
> /c
> /Zc:wchar_t-
> /Zl
> /Zp8
> /Gy
> -cbstring
> /W3
> /WX
> /Wp64
>
>
>
>
>
> /EHs-c-
>
> /GR-
> /GF
> /GS
> /Zi
> /Od
> /Oi
>
> /GL
> /Zi
> /Fde:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64<br>>
>
> -DKMDF_MAJOR_VERSION=01
> -DKMDF_MINOR_VERSION=005
> /homeparams
> /FIC:\WinDDK\6000\inc\api\warning.h
>
> /Ylviausbmodem /Ycviausbmodem.h /Fpobjchk_wlh_amd64\amd64\viausbmodem.pch
> /Fo"objchk_wlh_amd64\amd64\viausbmodem.obj"
>
> pch_hdr.src
> cl.exe @e:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64\cl.rsp
> Microsoft (R) C/C++ Optimizing Compiler Version 14.00.50727.215 for x64
> Copyright (C) Microsoft Corporation. All rights reserved.
>
> cl /Fo"e:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64/"
> /FC
>
>
> /Iamd64<br>> /I.
> /Ic:\winddk\6000\inc\ddk\wdm
> /Ic:\winddk\6000\inc\ddk\wdm\wxp
> /Ic:\winddk\6000\inc\ddk\wxp
> /Ic:\winddk\6000\inc\wxp
> /Ic:\winddk\6000\inc\crt
> /Ie:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64
> /IC:\WinDDK\6000\inc\api
> /IC:\WinDDK\6000\inc\api
> /IC:\WinDDK\6000\inc\ddk
> /IC:\WinDDK\6000\inc\ddk
> /IC:\WinDDK\6000\inc\crt
> /D_WIN64
> /D_AMD64_
> /DAMD64
>
>
> /DCONDITION_HANDLING=1
>
>
> /DNT_INST=0
> /DWIN32=100
> /D_NT1X_=100
> /DWINNT=1
> /D_WIN32_WINNT=0x0600
> /DWINVER=0x0600
> /D_WIN32_IE=0x0700
>
>
>
> /DWIN32_LEAN_AND_MEAN=1
> /DDEVL=1
> /DDBG=1
> /D BUILDMACHINE =WinDDK
>
>
> /D_DLL=1
> /DNDEBUG
>
> /DDEPRECATE_DDK_FUNCTIONS=1
> /DMSC_NOOPT
> /DNTDDI_VERSION=0x06000000
>
>
>
>
> /c
> /Zc:wchar_t-
> /Zl
> /Zp8
> /Gy
> -cbstring
> /W3
> /WX
> /Wp64
>
>
>
>
>
> /EHs-c-
>
> /GR-
> /GF
> /GS
> /Zi
> /Od
> /Oi
>
> /GL
> /Zi
> /Fde:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64<br>>
>
> -DKMDF_MAJOR_VERSION=01
> -DKMDF_MINOR_VERSION=005
> /homeparams
> /FIC:\WinDDK\6000\inc\api\warning.h
>
> /Yuviausbmodem.h
> /Fpobjchk_wlh_amd64\amd64\viausbmodem.pch
> .\kqueue.c .\init.c .\pnp.c .\usbrelative.c .\counterrelative.c
> .\irpoprelative.c .\ioctl.c .\circlebuffer.c .\readwrite.c .\open.c
> .\power.c .\busbdbg.c .\wmi.c
>
> kqueue.c
> init.c
> pnp.c
> usbrelative.c
> counterrelative.c
> irpoprelative.c
> ioctl.c
> circlebuffer.c
> readwrite.c
> open.c
> power.c
> busbdbg.c
> wmi.c
> link.exe /out:objchk_wlh_amd64\amd64\viausbmodem.sys /machine:amd64
> @C:\Users\via\AppData\Local\Temp\nmA3B3.tmp
> Microsoft (R) Incremental Linker Version 8.00.50727.215
> Copyright (C) Microsoft Corporation. All rights reserved.
>
> /MERGE:_PAGE=PAGE
> /MERGE:_TEXT=.text
> /SECTION:INIT,d
> /OPT:REF
> /OPT:ICF
> /IGNORE:4198,4010,4037,4039,4065,4070,4078,4087,4089,4221,4108,4088,4218,4218,4235
> /INCREMENTAL:NO
> /FULLBUILD
> /release
> /NODEFAULTLIB
> /WX
> /debug
> /debugtype:cv
> /version:6.0
> /osversion:6.0
> /debug
> /debugtype:cv,fixup,pdata
> /opt:nowin98
> C:\WinDDK\6000\lib\wlh\amd64\hotpatch.obj
> /functionpadmin:6
> /pdbcompress
> /STACK:0x40000,0x1000
> /driver
> /base:0x10000
> /subsystem:native,6.00
> /entry:GsDriverEntry
> /out:objchk_wlh_amd64\amd64\viausbmodem.sys
> objchk_wlh_amd64\amd64\viausbmodem.obj
> objchk_wlh_amd64\amd64\kqueue.obj
> objchk_wlh_amd64\amd64\init.obj
> objchk_wlh_amd64\amd64\pnp.obj
> objchk_wlh_amd64\amd64\usbrelative.obj
> objchk_wlh_amd64\amd64\counterrelative.obj
> objchk_wlh_amd64\amd64\irpoprelative.obj
> objchk_wlh_amd64\amd64\ioctl.obj
> objchk_wlh_amd64\amd64\circlebuffer.obj
> objchk_wlh_amd64\amd64\readwrite.obj
> objchk_wlh_amd64\amd64\open.obj
> objchk_wlh_amd64\amd64\power.obj
> objchk_wlh_amd64\amd64\busbdbg.obj
> objchk_wlh_amd64\amd64\wmi.obj
> C:\WinDDK\6000\lib\wlh\amd64\BufferOverflowK.lib
> C:\WinDDK\6000\lib\wlh\amd64\ntoskrnl.lib
> C:\WinDDK\6000\lib\wlh\amd64\hal.lib
> C:\WinDDK\6000\lib\wlh\amd64\wmilib.lib
> C:\WinDDK\6000\lib\wlh\amd64\wdm.lib
> C:\WinDDK\6000\lib\wlh\amd64\usbd.lib
> C:\WinDDK\6000\lib\wlh\amd64\ntstrsafe.lib
> C:\WinDDK\6000\lib\wlh\amd64\ntoskrnl.lib
> viausbmodem.obj : MSIL .netmodule or module compiled with /GL found;
> restarting link with /LTCG; add /LTCG to the link command line to improve
> linker performance
> Microsoft (R) Incremental Linker Version 8.00.50727.215
> Copyright (C) Microsoft Corporation. All rights reserved.
>
> /MERGE:_PAGE=PAGE
> /MERGE:_TEXT=.text
> /SECTION:INIT,d
> /OPT:REF
> /OPT:ICF
> /IGNORE:4198,4010,4037,4039,4065,4070,4078,4087,4089,4221,4108,4088,4218,4218,4235
> /INCREMENTAL:NO
> /FULLBUILD
> /release
> /NODEFAULTLIB
> /WX
> /debug
> /debugtype:cv
> /version:6.0
> /osversion:6.0
> /debug
> /debugtype:cv,fixup,pdata
> /opt:nowin98
> C:\WinDDK\6000\lib\wlh\amd64\hotpatch.obj
> /functionpadmin:6
> /pdbcompress
> /STACK:0x40000,0x1000
> /driver
> /base:0x10000
> /subsystem:native,6.00
> /entry:GsDriverEntry
> /out:objchk_wlh_amd64\amd64\viausbmodem.sys
> objchk_wlh_amd64\amd64\viausbmodem.obj
> objchk_wlh_amd64\amd64\kqueue.obj
> objchk_wlh_amd64\amd64\init.obj
> objchk_wlh_amd64\amd64\pnp.obj
> objchk_wlh_amd64\amd64\usbrelative.obj
> objchk_wlh_amd64\amd64\counterrelative.obj
> objchk_wlh_amd64\amd64\irpoprelative.obj
> objchk_wlh_amd64\amd64\ioctl.obj
> objchk_wlh_amd64\amd64\circlebuffer.obj
> objchk_wlh_amd64\amd64\readwrite.obj
> objchk_wlh_amd64\amd64\open.obj
> objchk_wlh_amd64\amd64\power.obj
> objchk_wlh_amd64\amd64\busbdbg.obj
> objchk_wlh_amd64\amd64\wmi.obj
> C:\WinDDK\6000\lib\wlh\amd64\BufferOverflowK.lib
> C:\WinDDK\6000\lib\wlh\amd64\ntoskrnl.lib
> C:\WinDDK\6000\lib\wlh\amd64\hal.lib
> C:\WinDDK\6000\lib\wlh\amd64\wmilib.lib
> C:\WinDDK\6000\lib\wlh\amd64\wdm.lib
> C:\WinDDK\6000\lib\wlh\amd64\usbd.lib
> C:\WinDDK\6000\lib\wlh\amd64\ntstrsafe.lib
> C:\WinDDK\6000\lib\wlh\amd64\ntoskrnl.lib
> kqueue.obj : error LNK2001: unresolved external symbol
> imp_KeInitializeSpinLock
> errors in directory e:\code\vtc_usbd_x\usbd_modem
> e:\code\vtc_usbd_x\usbd_modem\kqueue.obj : error LNK2001: unresolved
> external symbol
imp_KeInitializeSpinLock
> init.obj : error LNK2001: unresolved external symbol imp_KeGetCurrentIrql
> e:\code\vtc_usbd_x\usbd_modem\init.obj : error LNK2001: unresolved external
> symbol
imp_KeGetCurrentIrql
> readwrite.obj : error LNK2001: unresolved external symbol KeTickCount
> e:\code\vtc_usbd_x\usbd_modem\readwrite.obj : error LNK2001: unresolved
> external symbol KeTickCount
> objchk_wlh_amd64\amd64\viausbmodem.sys : fatal error LNK1120: 3 unresolved
> externals
> e:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64\viausbmodem.sys : error
> LNK1120: 3 unresolved externals
>
>
>
>

xxxxx@hotmail.com wrote:

This is content in buildchk_wlh_amd64.log:

cl
/Iamd64\
/I.
/Ic:\winddk\6000\inc\ddk\wdm
/Ic:\winddk\6000\inc\ddk\wdm\wxp
/Ic:\winddk\6000\inc\ddk\wxp
/Ic:\winddk\6000\inc\wxp
/Ic:\winddk\6000\inc\crt
/Ie:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64
/IC:\WinDDK\6000\inc\api
/IC:\WinDDK\6000\inc\api
/IC:\WinDDK\6000\inc\ddk
/IC:\WinDDK\6000\inc\ddk
/IC:\WinDDK\6000\inc\crt
/D_WIN64
/D_AMD64_
/DAMD64

What we are seeing here is a confusing mix of concepts from the older
DDKs and the newer DDKs, and a confusing mix of X86 and AMD64
constructs. Many of the include file paths in this list are from the
older DDKs, and do not exist with the 6000 Vista DDK.

I noticed that your first log file showed you were using DDKBUILD.BAT
which was trying to use the much older 2600 DDK. My guess is that
DDKBUILD.BAT has generated a “sources” file for you that is not
compatible with the WDK, or perhaps has set environment variables that
are not compatible.

As was already suggested, post your ENTIRE sources file, and I’ll bet we
find the problem.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

ddkbuild does not generate sources files, it just runs the selected ddk’s
setenv.bat and then executes build.exe with the appropriate parameters. As
you suggest, the OP should post his sources file. The command line to
ddkbuild might help. Finally, just opening a build shell and running build
in that shell without using ddkbuild will elmiinate ddkbuild from the
equation.

On Dec 4, 2007 1:14 PM, Tim Roberts wrote:

> xxxxx@hotmail.com wrote:
> > This is content in buildchk_wlh_amd64.log:
> > …
> > cl
> > /Iamd64<br>> > /I.
> > /Ic:\winddk\6000\inc\ddk\wdm
> > /Ic:\winddk\6000\inc\ddk\wdm\wxp
> > /Ic:\winddk\6000\inc\ddk\wxp
> > /Ic:\winddk\6000\inc\wxp
> > /Ic:\winddk\6000\inc\crt
> > /Ie:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64
> > /IC:\WinDDK\6000\inc\api
> > /IC:\WinDDK\6000\inc\api
> > /IC:\WinDDK\6000\inc\ddk
> > /IC:\WinDDK\6000\inc\ddk
> > /IC:\WinDDK\6000\inc\crt
> > /D_WIN64
> > /D_AMD64_
> > /DAMD64
> >
>
> What we are seeing here is a confusing mix of concepts from the older
> DDKs and the newer DDKs, and a confusing mix of X86 and AMD64
> constructs. Many of the include file paths in this list are from the
> older DDKs, and do not exist with the 6000 Vista DDK.
>
> I noticed that your first log file showed you were using DDKBUILD.BAT
> which was trying to use the much older 2600 DDK. My guess is that
> DDKBUILD.BAT has generated a “sources” file for you that is not
> compatible with the WDK, or perhaps has set environment variables that
> are not compatible.
>
> As was already suggested, post your ENTIRE sources file, and I’ll bet we
> find the problem.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> 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
>


Mark Roddy

I’m glad to see that I wasn’t losing my mind late last night. Perhaps
his path is just out of order?

mm

Mark Roddy wrote:

ddkbuild does not generate sources files, it just runs the selected
ddk’s setenv.bat and then executes build.exe with the appropriate
parameters. As you suggest, the OP should post his sources file. The
command line to ddkbuild might help. Finally, just opening a build shell
and running build in that shell without using ddkbuild will elmiinate
ddkbuild from the equation.

On Dec 4, 2007 1:14 PM, Tim Roberts > mailto:xxxxx> wrote:
>
> xxxxx@hotmail.com mailto:xxxxx wrote:
> > This is content in buildchk_wlh_amd64.log:
> > …
> > cl
> > /Iamd64<br>> > /I.
> > /Ic:\winddk\6000\inc\ddk\wdm
> > /Ic:\winddk\6000\inc\ddk\wdm\wxp
> > /Ic:\winddk\6000\inc\ddk\wxp
> > /Ic:\winddk\6000\inc\wxp
> > /Ic:\winddk\6000\inc\crt
> > /Ie:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64
> > /IC:\WinDDK\6000\inc\api
> > /IC:\WinDDK\6000\inc\api
> > /IC:\WinDDK\6000\inc\ddk
> > /IC:\WinDDK\6000\inc\ddk
> > /IC:\WinDDK\6000\inc\crt
> > /D_WIN64
> > /D_AMD64_
> > /DAMD64
> >
>
> What we are seeing here is a confusing mix of concepts from the older
> DDKs and the newer DDKs, and a confusing mix of X86 and AMD64
> constructs. Many of the include file paths in this list are from the
> older DDKs, and do not exist with the 6000 Vista DDK.
>
> I noticed that your first log file showed you were using DDKBUILD.BAT
> which was trying to use the much older 2600 DDK. My guess is that
> DDKBUILD.BAT has generated a “sources” file for you that is not
> compatible with the WDK, or perhaps has set environment variables that
> are not compatible.
>
> As was already suggested, post your ENTIRE sources file, and I’ll
> bet we
> find the problem.
>
> –
> Tim Roberts, xxxxx@probo.com mailto:xxxxx
> Providenza & Boekelheide, Inc.
>
>
> —
> 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
>
>
>
>
> –
> Mark Roddy</mailto:xxxxx></mailto:xxxxx></mailto:xxxxx>

Thank you all of you!
this is my source file content:

!IF 0

Copyright (c) 2000 Microsoft Corporation

Module Name:

sources.

Abstract:

This file specifies the target component being built and the list of
sources files needed to build that component. Also specifies optional
compiler switches and libraries that are unique for the component being
built.

!ENDIF

TARGETNAME=viausbmodem
TARGETPATH=obj
TARGETTYPE=DRIVER

PRECOMPILED_INCLUDE=viausbmodem.h
PRECOMPILED_PCH=viausbmodem.pch
PRECOMPILED_OBJ=viausbmodem.obj

TARGETPATH=obj

INCLUDES=$(BASEDIR)\inc\ddk\wdm; \
$(BASEDIR)\inc\ddk\wdm\wxp; \
$(BASEDIR)\inc\ddk\wxp; \
$(BASEDIR)\inc\wxp; \
$(BASEDIR)\inc\crt
USE_MAPSYM=1

TARGETLIBS=$(DDK_LIB_PATH)\wdm.lib \
$(DDK_LIB_PATH)\usbd.lib \
$(DDK_LIB_PATH)\ntstrsafe.lib \
$(DDK_LIB_PATH)\ntoskrnl.lib

MSC_WARNING_LEVEL=/W3 /WX

SOURCES=\
kqueue.c \
init.c \
pnp.c \
usbrelative.c \
counterrelative.c \
irpoprelative.c \
ioctl.c \
circlebuffer.c \
readwrite.c \
open.c \
power.c \
busbdbg.c \
wmi.c

Thanks!
qihua

xxxxx@hotmail.com wrote:

Thank you all of you!
this is my source file content:

Unless you work for Microsoft, you don’t want their Copyright statement
in your code.

TARGETNAME=viausbmodem
TARGETPATH=obj
TARGETTYPE=DRIVER

PRECOMPILED_INCLUDE=viausbmodem.h
PRECOMPILED_PCH=viausbmodem.pch
PRECOMPILED_OBJ=viausbmodem.obj

TARGETPATH=obj

That line is a duplicate. By the way, make sure to delete your
pre-compiled header file after changing your sources.

INCLUDES=$(BASEDIR)\inc\ddk\wdm; \
$(BASEDIR)\inc\ddk\wdm\wxp; \
$(BASEDIR)\inc\ddk\wxp; \
$(BASEDIR)\inc\wxp; \
$(BASEDIR)\inc\crt

You shouldn’t need any of those. Those are all old names, and there are
better ways to specify them.

The rest of this looks fairly innocent. Try replacing this with
INCLUDES=
and see if it does any better.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

  1. Just to be clear, if you build your product by entering the
    directory with this file and typing ‘BUILD -ceZ,’ you get the linker
    errors you reported earlier?

  2. If so, I would try commenting out the ‘INCLUDES’ statement. You
    shouldn’t need it by default, and those directories aren’t correct for
    the WDK anyway. If they happen to exist, you’re going to have different
    problems.

  3. MAP_SYM is for use only with Win98. It shouldn’t cause any probles
    that I know of, but I wonder what is it doing here, as you’ve had a bit
    of mix and match going on.

  4. I would also try commenting out the ‘TARGETLIBS’ statement and see
    what happens. The inclusion of both wdm.lib ntoskrnl.lib is curious.

I don’t know what you’re particular issue is, but somewhere along the
way, you have redirected BUILD incorrectly, because there is nothing
unique, as far as I can tell, about your driver, so this should not be
happening. Assuming nothing above helps you and you don’t get some
better advice, did this ever work? If it has, you changed something,
and if it hasn’t, I would consider starting over with a clean
installation of the WDK (after removing any other ones) and a new
SOURCES file. I realize that sucks, but what you are trying to do ought
to be very straightforward, and since it isn’t working, I’m thinking
that you are either leaving something out, or you have some sort of
installation problem.

Good luck,

mm

xxxxx@hotmail.com wrote:

Thank you all of you!
this is my source file content:

!IF 0

Copyright (c) 2000 Microsoft Corporation

Module Name:

sources.

Abstract:

This file specifies the target component being built and the list of
sources files needed to build that component. Also specifies optional
compiler switches and libraries that are unique for the component being
built.

!ENDIF

TARGETNAME=viausbmodem
TARGETPATH=obj
TARGETTYPE=DRIVER

PRECOMPILED_INCLUDE=viausbmodem.h
PRECOMPILED_PCH=viausbmodem.pch
PRECOMPILED_OBJ=viausbmodem.obj

TARGETPATH=obj

INCLUDES=$(BASEDIR)\inc\ddk\wdm; \
$(BASEDIR)\inc\ddk\wdm\wxp; \
$(BASEDIR)\inc\ddk\wxp; \
$(BASEDIR)\inc\wxp; \
$(BASEDIR)\inc\crt
USE_MAPSYM=1

TARGETLIBS=$(DDK_LIB_PATH)\wdm.lib \
$(DDK_LIB_PATH)\usbd.lib \
$(DDK_LIB_PATH)\ntstrsafe.lib \
$(DDK_LIB_PATH)\ntoskrnl.lib

MSC_WARNING_LEVEL=/W3 /WX

SOURCES=\
kqueue.c \
init.c \
pnp.c \
usbrelative.c \
counterrelative.c \
irpoprelative.c \
ioctl.c \
circlebuffer.c \
readwrite.c \
open.c \
power.c \
busbdbg.c \
wmi.c

Thanks!
qihua

Hi Tim,
Thank you!
I modify source file:

TARGETNAME=viausbmodem
TARGETPATH=obj
TARGETTYPE=DRIVER

PRECOMPILED_INCLUDE=viausbmodem.h
PRECOMPILED_PCH=viausbmodem.pch
PRECOMPILED_OBJ=viausbmodem.obj

INCLUDES=

USE_MAPSYM=1

TARGETLIBS=$(DDK_LIB_PATH)\wdm.lib \
$(DDK_LIB_PATH)\usbd.lib \
$(DDK_LIB_PATH)\ntstrsafe.lib \
$(DDK_LIB_PATH)\ntoskrnl.lib

MSC_WARNING_LEVEL=/W3 /WX

SOURCES=\
kqueue.c \
init.c \
pnp.c \
usbrelative.c \
counterrelative.c \
irpoprelative.c \
ioctl.c \
circlebuffer.c \
readwrite.c \
open.c \
power.c \
busbdbg.c \
wmi.c

If it is right?
Befor build I delete folder “objchk_wlh_amd64”.
The build information is below:

E:\code\VTC_USBD_X\USBD_MODEM>build -cez
BUILD: Compile and Link for AMD64
BUILD: Start time: Thu Dec 06 00:55:33 2007
BUILD: Examining e:\code\vtc_usbd_x\usbd_modem directory for files to compile.
BUILD: Compiling and Linking e:\code\vtc_usbd_x\usbd_modem directory
Precompiling - viausbmodem.h
Compiling - kqueue.c
Compiling - init.c
Compiling - pnp.c
Compiling - usbrelative.c
Compiling - counterrelative.c
Compiling - irpoprelative.c
Compiling - ioctl.c
Compiling - circlebuffer.c
Compiling - readwrite.c
Compiling - open.c
Compiling - power.c
Compiling - busbdbg.c
Compiling - wmi.c
Linking Executable - objchk_wlh_amd64\amd64\viausbmodem.sys
errors in directory e:\code\vtc_usbd_x\usbd_modem
e:\code\vtc_usbd_x\usbd_modem\kqueue.obj : error LNK2001: unresolved external sy
mbol __imp_KeInitializeSpinLock
e:\code\vtc_usbd_x\usbd_modem\init.obj : error LNK2001: unresolved external symb
ol __imp_KeGetCurrentIrql
e:\code\vtc_usbd_x\usbd_modem\readwrite.obj : error LNK2001: unresolved external
symbol KeTickCount
e:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64\viausbmodem.sys : error LNK
1120: 3 unresolved externals
BUILD: Finish time: Thu Dec 06 00:55:34 2007
BUILD: Done

17 files compiled
1 executable built - 4 Errors

E:\code\VTC_USBD_X\USBD_MODEM>

The log information is below:

BUILD: Examining e:\code\vtc_usbd_x\usbd_modem directory for files to compile.
before AssemblyIdentity_AfterReadAllSources
after AssemblyIdentity_AfterReadAllSources
skipping post pass 0 command
Compiling and Linking e:\code\vtc_usbd_x\usbd_modem *************
‘nmake.exe /nologo BUILDMSG=Stop. -i BUILD_PASS=PASS2 LINKONLY=1 NOPASS0=1 MAKEDIR_RELATIVE_TO_BASEDIR= MAKEDIR_LOWERCASE=e:\code\vtc_usbd_x\usbd_modem’
e:\code\vtc_usbd_x\usbd_modem: TARGETPATH is obj
cl.exe /Iamd64\ /I. /Ie:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64 /IC:\WinDDK\6000\inc\api /IC:\WinDDK\6000\inc\api /IC:\WinDDK\6000\inc\ddk /IC:\WinDDK\6000\inc\ddk /IC:\WinDDK\6000\inc\crt /D_WIN64 /D_AMD64_ /DAMD64 /DCONDITION_HANDLING=1 /DNT_INST=0 /DWIN32=100 /D_NT1X_=100 /DWINNT=1 /D_WIN32_WINNT=0x0600 /DWINVER=0x0600 /D_WIN32_IE=0x0700 /DWIN32_LEAN_AND_MEAN=1 /DDEVL=1 /DDBG=1 /D__BUILDMACHINE__=WinDDK /D_DLL=1 /DNDEBUG /DDEPRECATE_DDK_FUNCTIONS=1 /DMSC_NOOPT /DNTDDI_VERSION=0x06000000 /c /Zc:wchar_t- /Zl /Zp8 /Gy -cbstring /W3 /WX /Wp64 /EHs-c- /GR- /GF /GS /Zi /Od /Oi /GL /Zi /Fde:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64\ -DKMDF_MAJOR_VERSION=01 -DKMDF_MINOR_VERSION=005 /homeparams /FIC:\WinDDK\6000\inc\api\warning.h /Yuviausbmodem.h /Fpobjchk_wlh_amd64\amd64\viausbmodem.pch /Ylviausbmodem /Ycviausbmodem.h /Fpobjchk_wlh_amd64\amd64\viausbmodem.pch /Fo"objchk_wlh_amd64\amd64\viausbmodem.obj" /Tc

#include “viausbmodem.h”

Microsoft (R) C/C++ Optimizing Compiler Version 14.00.50727.215 for x64
Copyright (C) Microsoft Corporation. All rights reserved.

cl
/Iamd64\
/I.
/Ie:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64
/IC:\WinDDK\6000\inc\api
/IC:\WinDDK\6000\inc\api
/IC:\WinDDK\6000\inc\ddk
/IC:\WinDDK\6000\inc\ddk
/IC:\WinDDK\6000\inc\crt
/D_WIN64
/D_AMD64_
/DAMD64

/DCONDITION_HANDLING=1

/DNT_INST=0
/DWIN32=100
/D_NT1X_=100
/DWINNT=1
/D_WIN32_WINNT=0x0600
/DWINVER=0x0600
/D_WIN32_IE=0x0700

/DWIN32_LEAN_AND_MEAN=1
/DDEVL=1
/DDBG=1
/D__BUILDMACHINE__=WinDDK

/D_DLL=1
/DNDEBUG

/DDEPRECATE_DDK_FUNCTIONS=1
/DMSC_NOOPT
/DNTDDI_VERSION=0x06000000

/c
/Zc:wchar_t-
/Zl
/Zp8
/Gy
-cbstring
/W3
/WX
/Wp64

/EHs-c-

/GR-
/GF
/GS
/Zi
/Od
/Oi

/GL
/Zi
/Fde:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64\

-DKMDF_MAJOR_VERSION=01
-DKMDF_MINOR_VERSION=005
/homeparams
/FIC:\WinDDK\6000\inc\api\warning.h

/Ylviausbmodem /Ycviausbmodem.h /Fpobjchk_wlh_amd64\amd64\viausbmodem.pch /Fo"objchk_wlh_amd64\amd64\viausbmodem.obj"

pch_hdr.src
cl.exe @e:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64\cl.rsp
Microsoft (R) C/C++ Optimizing Compiler Version 14.00.50727.215 for x64
Copyright (C) Microsoft Corporation. All rights reserved.

cl /Fo"e:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64/"
/FC

/Iamd64\
/I.
/Ie:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64
/IC:\WinDDK\6000\inc\api
/IC:\WinDDK\6000\inc\api
/IC:\WinDDK\6000\inc\ddk
/IC:\WinDDK\6000\inc\ddk
/IC:\WinDDK\6000\inc\crt
/D_WIN64
/D_AMD64_
/DAMD64

/DCONDITION_HANDLING=1

/DNT_INST=0
/DWIN32=100
/D_NT1X_=100
/DWINNT=1
/D_WIN32_WINNT=0x0600
/DWINVER=0x0600
/D_WIN32_IE=0x0700

/DWIN32_LEAN_AND_MEAN=1
/DDEVL=1
/DDBG=1
/D__BUILDMACHINE__=WinDDK

/D_DLL=1
/DNDEBUG

/DDEPRECATE_DDK_FUNCTIONS=1
/DMSC_NOOPT
/DNTDDI_VERSION=0x06000000

/c
/Zc:wchar_t-
/Zl
/Zp8
/Gy
-cbstring
/W3
/WX
/Wp64

/EHs-c-

/GR-
/GF
/GS
/Zi
/Od
/Oi

/GL
/Zi
/Fde:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64\

-DKMDF_MAJOR_VERSION=01
-DKMDF_MINOR_VERSION=005
/homeparams
/FIC:\WinDDK\6000\inc\api\warning.h

/Yuviausbmodem.h
/Fpobjchk_wlh_amd64\amd64\viausbmodem.pch
.\kqueue.c .\init.c .\pnp.c .\usbrelative.c .\counterrelative.c .\irpoprelative.c .\ioctl.c .\circlebuffer.c .\readwrite.c .\open.c .\power.c .\busbdbg.c .\wmi.c

kqueue.c
init.c
pnp.c
usbrelative.c
counterrelative.c
irpoprelative.c
ioctl.c
circlebuffer.c
readwrite.c
open.c
power.c
busbdbg.c
wmi.c
link.exe /out:objchk_wlh_amd64\amd64\viausbmodem.sys /machine:amd64 @C:\Users\via\AppData\Local\Temp\nm7B68.tmp
Microsoft (R) Incremental Linker Version 8.00.50727.215
Copyright (C) Microsoft Corporation. All rights reserved.

/MERGE:_PAGE=PAGE
/MERGE:_TEXT=.text
/SECTION:INIT,d
/OPT:REF
/OPT:ICF
/IGNORE:4198,4010,4037,4039,4065,4070,4078,4087,4089,4221,4108,4088,4218,4218,4235
/INCREMENTAL:NO
/FULLBUILD
/release
/NODEFAULTLIB
/WX
/debug
/debugtype:cv
/version:6.0
/osversion:6.0
/debug
/debugtype:cv,fixup,pdata
/opt:nowin98
C:\WinDDK\6000\lib\wlh\amd64\hotpatch.obj
/functionpadmin:6
/pdbcompress
/STACK:0x40000,0x1000
/driver
/base:0x10000
/subsystem:native,6.00
/entry:GsDriverEntry
/out:objchk_wlh_amd64\amd64\viausbmodem.sys
objchk_wlh_amd64\amd64\viausbmodem.obj
objchk_wlh_amd64\amd64\kqueue.obj
objchk_wlh_amd64\amd64\init.obj
objchk_wlh_amd64\amd64\pnp.obj
objchk_wlh_amd64\amd64\usbrelative.obj
objchk_wlh_amd64\amd64\counterrelative.obj
objchk_wlh_amd64\amd64\irpoprelative.obj
objchk_wlh_amd64\amd64\ioctl.obj
objchk_wlh_amd64\amd64\circlebuffer.obj
objchk_wlh_amd64\amd64\readwrite.obj
objchk_wlh_amd64\amd64\open.obj
objchk_wlh_amd64\amd64\power.obj
objchk_wlh_amd64\amd64\busbdbg.obj
objchk_wlh_amd64\amd64\wmi.obj
C:\WinDDK\6000\lib\wlh\amd64\BufferOverflowK.lib
C:\WinDDK\6000\lib\wlh\amd64\ntoskrnl.lib
C:\WinDDK\6000\lib\wlh\amd64\hal.lib
C:\WinDDK\6000\lib\wlh\amd64\wmilib.lib
C:\WinDDK\6000\lib\wlh\amd64\wdm.lib
C:\WinDDK\6000\lib\wlh\amd64\usbd.lib
C:\WinDDK\6000\lib\wlh\amd64\ntstrsafe.lib
C:\WinDDK\6000\lib\wlh\amd64\ntoskrnl.lib
viausbmodem.obj : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
Microsoft (R) Incremental Linker Version 8.00.50727.215
Copyright (C) Microsoft Corporation. All rights reserved.

/MERGE:_PAGE=PAGE
/MERGE:_TEXT=.text
/SECTION:INIT,d
/OPT:REF
/OPT:ICF
/IGNORE:4198,4010,4037,4039,4065,4070,4078,4087,4089,4221,4108,4088,4218,4218,4235
/INCREMENTAL:NO
/FULLBUILD
/release
/NODEFAULTLIB
/WX
/debug
/debugtype:cv
/version:6.0
/osversion:6.0
/debug
/debugtype:cv,fixup,pdata
/opt:nowin98
C:\WinDDK\6000\lib\wlh\amd64\hotpatch.obj
/functionpadmin:6
/pdbcompress
/STACK:0x40000,0x1000
/driver
/base:0x10000
/subsystem:native,6.00
/entry:GsDriverEntry
/out:objchk_wlh_amd64\amd64\viausbmodem.sys
objchk_wlh_amd64\amd64\viausbmodem.obj
objchk_wlh_amd64\amd64\kqueue.obj
objchk_wlh_amd64\amd64\init.obj
objchk_wlh_amd64\amd64\pnp.obj
objchk_wlh_amd64\amd64\usbrelative.obj
objchk_wlh_amd64\amd64\counterrelative.obj
objchk_wlh_amd64\amd64\irpoprelative.obj
objchk_wlh_amd64\amd64\ioctl.obj
objchk_wlh_amd64\amd64\circlebuffer.obj
objchk_wlh_amd64\amd64\readwrite.obj
objchk_wlh_amd64\amd64\open.obj
objchk_wlh_amd64\amd64\power.obj
objchk_wlh_amd64\amd64\busbdbg.obj
objchk_wlh_amd64\amd64\wmi.obj
C:\WinDDK\6000\lib\wlh\amd64\BufferOverflowK.lib
C:\WinDDK\6000\lib\wlh\amd64\ntoskrnl.lib
C:\WinDDK\6000\lib\wlh\amd64\hal.lib
C:\WinDDK\6000\lib\wlh\amd64\wmilib.lib
C:\WinDDK\6000\lib\wlh\amd64\wdm.lib
C:\WinDDK\6000\lib\wlh\amd64\usbd.lib
C:\WinDDK\6000\lib\wlh\amd64\ntstrsafe.lib
C:\WinDDK\6000\lib\wlh\amd64\ntoskrnl.lib
kqueue.obj : error LNK2001: unresolved external symbol __imp_KeInitializeSpinLock
errors in directory e:\code\vtc_usbd_x\usbd_modem
e:\code\vtc_usbd_x\usbd_modem\kqueue.obj : error LNK2001: unresolved external symbol __imp_KeInitializeSpinLock
init.obj : error LNK2001: unresolved external symbol __imp_KeGetCurrentIrql
e:\code\vtc_usbd_x\usbd_modem\init.obj : error LNK2001: unresolved external symbol __imp_KeGetCurrentIrql
readwrite.obj : error LNK2001: unresolved external symbol KeTickCount
e:\code\vtc_usbd_x\usbd_modem\readwrite.obj : error LNK2001: unresolved external symbol KeTickCount
objchk_wlh_amd64\amd64\viausbmodem.sys : fatal error LNK1120: 3 unresolved externals
e:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64\viausbmodem.sys : error LNK1120: 3 unresolved externals

Try this:
You might need to add this line:
TARGETLIBS= $(DDK_LIB_PATH)\ntstrsafe.lib

-------------------------------------------------------------------------------- TARGETNAME=viausbmodem TARGETTYPE=DRIVER PRECOMPILED_INCLUDE=viausbmodem.h PRECOMPILED_PCH=viausbmodem.pch PRECOMPILED_OBJ=viausbmodem.objMSC_WARNING_LEVEL=/W3 /WX SOURCES=\ kqueue.c \ init.c \ pnp.c \ usbrelative.c \ counterrelative.c \ irpoprelative.c \ ioctl.c \ circlebuffer.c \ readwrite.c \ open.c \ power.c \ busbdbg.c \ wmi.c -------------------------------------------------------------------------------- wrote in message news:xxxxx@ntdev…> Hi Tim,> Thank you!> I modify source file:> --------------------------------------------------------------------------------> TARGETNAME=viausbmodem> TARGETPATH=obj> TARGETTYPE=DRIVER>> PRECOMPILED_INCLUDE=viausbmodem.h> PRECOMPILED_PCH=viausbmodem.pch> PRECOMPILED_OBJ=viausbmodem.obj>> INCLUDES=>> USE_MAPSYM=1>> TARGETLIBS=$(DDK_LIB_PATH)\wdm.lib &gt; $(DDK_LIB_PATH)\usbd.lib &gt; $(DDK_LIB_PATH)\ntstrsafe.lib &gt; $(DDK_LIB_PATH)\ntoskrnl.lib>> MSC_WARNING_LEVEL=/W3 /WX>> SOURCES=&gt; kqueue.c &gt; init.c &gt; pnp.c &gt; usbrelative.c &gt; counterrelative.c &gt; irpoprelative.c &gt; ioctl.c &gt; circlebuffer.c &gt; readwrite.c &gt; open.c &gt; power.c &gt; busbdbg.c &gt; wmi.c> --------------------------------------------------------------------------------> If it is right?> Befor build I delete folder “objchk_wlh_amd64”.> The build information is below:> --------------------------------------------------------------------------------> E:\code\VTC_USBD_X\USBD_MODEM>build -cez> BUILD: Compile and Link for AMD64> BUILD: Start time: Thu Dec 06 00:55:33 2007> BUILD: Examining e:\code\vtc_usbd_x\usbd_modem directory for files tocompile.> BUILD: Compiling and Linking e:\code\vtc_usbd_x\usbd_modem directory> Precompiling - viausbmodem.h> Compiling - kqueue.c> Compiling - init.c> Compiling - pnp.c> Compiling - usbrelative.c> Compiling - counterrelative.c> Compiling - irpoprelative.c> Compiling - ioctl.c> Compiling - circlebuffer.c> Compiling - readwrite.c> Compiling - open.c> Compiling - power.c> Compiling - busbdbg.c> Compiling - wmi.c> Linking Executable - objchk_wlh_amd64\amd64\viausbmodem.sys> errors in directory e:\code\vtc_usbd_x\usbd_modem> e:\code\vtc_usbd_x\usbd_modem\kqueue.obj : error LNK2001: unresolvedexternal sy> mbol imp_KeInitializeSpinLock> e:\code\vtc_usbd_x\usbd_modem\init.obj : error LNK2001: unresolvedexternal symb> ol imp_KeGetCurrentIrql> e:\code\vtc_usbd_x\usbd_modem\readwrite.obj : error LNK2001: unresolvedexternal> symbol KeTickCount> e:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64\viausbmodem.sys :error LNK> 1120: 3 unresolved externals> BUILD: Finish time: Thu Dec 06 00:55:34 2007> BUILD: Done>> 17 files compiled> 1 executable built - 4 Errors>> E:\code\VTC_USBD_X\USBD_MODEM>> --------------------------------------------------------------------------------> The log information is below:> --------------------------------------------------------------------------------> BUILD: Examining e:\code\vtc_usbd_x\usbd_modem directory for files tocompile.> before AssemblyIdentity_AfterReadAllSources> after AssemblyIdentity_AfterReadAllSources> skipping post pass 0 command> Compiling and Linking e:\code\vtc_usbd_x\usbd_modem ************* > ‘nmake.exe /nologo BUILDMSG=Stop. -i BUILD_PASS=PASS2 LINKONLY=1 NOPASS0=1MAKEDIR_RELATIVE_TO_BASEDIR=MAKEDIR_LOWERCASE=e:\code\vtc_usbd_x\usbd_modem’> e:\code\vtc_usbd_x\usbd_modem: TARGETPATH is obj> cl.exe /Iamd64\ /I. /Ie:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64/IC:\WinDDK\6000\inc\api /IC:\WinDDK\6000\inc\api /IC:\WinDDK\6000\inc\ddk/IC:\WinDDK\6000\inc\ddk /IC:\WinDDK\6000\inc\crt /D_WIN64 /D_AMD64_ /DAMD64/DCONDITION_HANDLING=1 /DNT_INST=0 /DWIN32=100 /D_NT1X_=100 /DWINNT=1/D_WIN32_WINNT=0x0600 /DWINVER=0x0600 /D_WIN32_IE=0x0700/DWIN32_LEAN_AND_MEAN=1 /DDEVL=1 /DDBG=1 /D BUILDMACHINE =WinDDK /D_DLL=1/DNDEBUG /DDEPRECATE_DDK_FUNCTIONS=1 /DMSC_NOOPT /DNTDDI_VERSION=0x06000000/c /Zc:wchar_t- /Zl /Zp8 /Gy -cbstring /W3 /WX /Wp64 /EHs-c- /GR- /GF /GS/Zi /Od /Oi /GL /Zi/Fde:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64\ -DKMDF_MAJOR_VERSION=01 -DKMDF_MINOR_VERSION=005 /homeparams/FIC:\WinDDK\6000\inc\api\warning.h /Yuviausbmodem.h/Fpobjchk_wlh_amd64\amd64\viausbmodem.pch /Ylviausbmodem /Ycviausbmodem.h/Fpobjchk_wlh_amd64\amd64\viausbmodem.pch/Fo"objchk_wlh_amd64\amd64\viausbmodem.obj" /Tc>> #include “viausbmodem.h”>> Microsoft (R) C/C++ Optimizing Compiler Version 14.00.50727.215 for x64> Copyright (C) Microsoft Corporation. All rights reserved.>> cl> /Iamd64&gt; /I.> /Ie:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64> /IC:\WinDDK\6000\inc\api> /IC:\WinDDK\6000\inc\api> /IC:\WinDDK\6000\inc\ddk> /IC:\WinDDK\6000\inc\ddk> /IC:\WinDDK\6000\inc\crt> /D_WIN64> /D_AMD64_> /DAMD64>>> /DCONDITION_HANDLING=1>>> /DNT_INST=0> /DWIN32=100> /D_NT1X_=100> /DWINNT=1> /D_WIN32_WINNT=0x0600> /DWINVER=0x0600> /D_WIN32_IE=0x0700>>>> /DWIN32_LEAN_AND_MEAN=1> /DDEVL=1> /DDBG=1> /D BUILDMACHINE =WinDDK>>> /D_DLL=1> /DNDEBUG>> /DDEPRECATE_DDK_FUNCTIONS=1> /DMSC_NOOPT> /DNTDDI_VERSION=0x06000000>>>>> /c> /Zc:wchar_t-> /Zl> /Zp8> /Gy> -cbstring> /W3> /WX> /Wp64>>>>>> /EHs-c->> /GR-> /GF> /GS> /Zi> /Od> /Oi>> /GL> /Zi> /Fde:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64&gt;>> -DKMDF_MAJOR_VERSION=01> -DKMDF_MINOR_VERSION=005> /homeparams> /FIC:\WinDDK\6000\inc\api\warning.h>> /Ylviausbmodem /Ycviausbmodem.h/Fpobjchk_wlh_amd64\amd64\viausbmodem.pch/Fo"objchk_wlh_amd64\amd64\viausbmodem.obj">> pch_hdr.src> cl.exe @e:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64\cl.rsp> Microsoft (R) C/C++ Optimizing Compiler Version 14.00.50727.215 for x64> Copyright (C) Microsoft Corporation. All rights reserved.>> cl /Fo"e:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64/"> /FC>>> /Iamd64&gt; /I.> /Ie:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64> /IC:\WinDDK\6000\inc\api> /IC:\WinDDK\6000\inc\api> /IC:\WinDDK\6000\inc\ddk> /IC:\WinDDK\6000\inc\ddk> /IC:\WinDDK\6000\inc\crt> /D_WIN64> /D_AMD64_> /DAMD64>>> /DCONDITION_HANDLING=1>>> /DNT_INST=0> /DWIN32=100> /D_NT1X_=100> /DWINNT=1> /D_WIN32_WINNT=0x0600> /DWINVER=0x0600> /D_WIN32_IE=0x0700>>>> /DWIN32_LEAN_AND_MEAN=1> /DDEVL=1> /DDBG=1> /D BUILDMACHINE =WinDDK>>> /D_DLL=1> /DNDEBUG>> /DDEPRECATE_DDK_FUNCTIONS=1> /DMSC_NOOPT> /DNTDDI_VERSION=0x06000000>>>>> /c> /Zc:wchar_t-> /Zl> /Zp8> /Gy> -cbstring> /W3> /WX> /Wp64>>>>>> /EHs-c->> /GR-> /GF> /GS> /Zi> /Od> /Oi>> /GL> /Zi> /Fde:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64&gt;>> -DKMDF_MAJOR_VERSION=01> -DKMDF_MINOR_VERSION=005> /homeparams> /FIC:\WinDDK\6000\inc\api\warning.h>> /Yuviausbmodem.h> /Fpobjchk_wlh_amd64\amd64\viausbmodem.pch> .\kqueue.c .\init.c .\pnp.c .\usbrelative.c .\counterrelative.c.\irpoprelative.c .\ioctl.c .\circlebuffer.c .\readwrite.c .\open.c.\power.c .\busbdbg.c .\wmi.c>> kqueue.c> init.c> pnp.c> usbrelative.c> counterrelative.c> irpoprelative.c> ioctl.c> circlebuffer.c> readwrite.c> open.c> power.c> busbdbg.c> wmi.c> link.exe /out:objchk_wlh_amd64\amd64\viausbmodem.sys /machine:xxxxx@C:\Users\via\AppData\Local\Temp\nm7B68.tmp> Microsoft (R) Incremental Linker Version 8.00.50727.215> Copyright (C) Microsoft Corporation. All rights reserved.>> /MERGE:_PAGE=PAGE> /MERGE:_TEXT=.text> /SECTION:INIT,d> /OPT:REF> /OPT:ICF>/IGNORE:4198,4010,4037,4039,4065,4070,4078,4087,4089,4221,4108,4088,4218,4218,4235> /INCREMENTAL:NO> /FULLBUILD> /release> /NODEFAULTLIB> /WX> /debug> /debugtype:cv> /version:6.0> /osversion:6.0> /debug> /debugtype:cv,fixup,pdata> /opt:nowin98> C:\WinDDK\6000\lib\wlh\amd64\hotpatch.obj> /functionpadmin:6> /pdbcompress> /STACK:0x40000,0x1000> /driver> /base:0x10000> /subsystem:native,6.00> /entry:GsDriverEntry> /out:objchk_wlh_amd64\amd64\viausbmodem.sys> objchk_wlh_amd64\amd64\viausbmodem.obj> objchk_wlh_amd64\amd64\kqueue.obj> objchk_wlh_amd64\amd64\init.obj> objchk_wlh_amd64\amd64\pnp.obj> objchk_wlh_amd64\amd64\usbrelative.obj> objchk_wlh_amd64\amd64\counterrelative.obj> objchk_wlh_amd64\amd64\irpoprelative.obj> objchk_wlh_amd64\amd64\ioctl.obj> objchk_wlh_amd64\amd64\circlebuffer.obj> objchk_wlh_amd64\amd64\readwrite.obj> objchk_wlh_amd64\amd64\open.obj> objchk_wlh_amd64\amd64\power.obj> objchk_wlh_amd64\amd64\busbdbg.obj> objchk_wlh_amd64\amd64\wmi.obj> C:\WinDDK\6000\lib\wlh\amd64\BufferOverflowK.lib> C:\WinDDK\6000\lib\wlh\amd64\ntoskrnl.lib> C:\WinDDK\6000\lib\wlh\amd64\hal.lib> C:\WinDDK\6000\lib\wlh\amd64\wmilib.lib> C:\WinDDK\6000\lib\wlh\amd64\wdm.lib> C:\WinDDK\6000\lib\wlh\amd64\usbd.lib> C:\WinDDK\6000\lib\wlh\amd64\ntstrsafe.lib> C:\WinDDK\6000\lib\wlh\amd64\ntoskrnl.lib> viausbmodem.obj : MSIL .netmodule or module compiled with /GL found;restarting link with /LTCG; add /LTCG to the link command line to improvelinker performance> Microsoft (R) Incremental Linker Version 8.00.50727.215> Copyright (C) Microsoft Corporation. All rights reserved.>> /MERGE:_PAGE=PAGE> /MERGE:_TEXT=.text> /SECTION:INIT,d> /OPT:REF> /OPT:ICF>/IGNORE:4198,4010,4037,4039,4065,4070,4078,4087,4089,4221,4108,4088,4218,4218,4235> /INCREMENTAL:NO> /FULLBUILD> /release> /NODEFAULTLIB> /WX> /debug> /debugtype:cv> /version:6.0> /osversion:6.0> /debug> /debugtype:cv,fixup,pdata> /opt:nowin98> C:\WinDDK\6000\lib\wlh\amd64\hotpatch.obj> /functionpadmin:6> /pdbcompress> /STACK:0x40000,0x1000> /driver> /base:0x10000> /subsystem:native,6.00> /entry:GsDriverEntry> /out:objchk_wlh_amd64\amd64\viausbmodem.sys> objchk_wlh_amd64\amd64\viausbmodem.obj> objchk_wlh_amd64\amd64\kqueue.obj> objchk_wlh_amd64\amd64\init.obj> objchk_wlh_amd64\amd64\pnp.obj> objchk_wlh_amd64\amd64\usbrelative.obj> objchk_wlh_amd64\amd64\counterrelative.obj> objchk_wlh_amd64\amd64\irpoprelative.obj> objchk_wlh_amd64\amd64\ioctl.obj> objchk_wlh_amd64\amd64\circlebuffer.obj> objchk_wlh_amd64\amd64\readwrite.obj> objchk_wlh_amd64\amd64\open.obj> objchk_wlh_amd64\amd64\power.obj> objchk_wlh_amd64\amd64\busbdbg.obj> objchk_wlh_amd64\amd64\wmi.obj> C:\WinDDK\6000\lib\wlh\amd64\BufferOverflowK.lib> C:\WinDDK\6000\lib\wlh\amd64\ntoskrnl.lib> C:\WinDDK\6000\lib\wlh\amd64\hal.lib> C:\WinDDK\6000\lib\wlh\amd64\wmilib.lib> C:\WinDDK\6000\lib\wlh\amd64\wdm.lib> C:\WinDDK\6000\lib\wlh\amd64\usbd.lib> C:\WinDDK\6000\lib\wlh\amd64\ntstrsafe.lib> C:\WinDDK\6000\lib\wlh\amd64\ntoskrnl.lib> kqueue.obj : error LNK2001: unresolved external symbol imp_KeInitializeSpinLock> errors in directory e:\code\vtc_usbd_x\usbd_modem> e:\code\vtc_usbd_x\usbd_modem\kqueue.obj : error LNK2001: unresolvedexternal symbol imp_KeInitializeSpinLock> init.obj : error LNK2001: unresolved external symbol imp_KeGetCurrentIrql> e:\code\vtc_usbd_x\usbd_modem\init.obj : error LNK2001: unresolvedexternal symbol imp_KeGetCurrentIrql> readwrite.obj : error LNK2001: unresolved external symbol KeTickCount> e:\code\vtc_usbd_x\usbd_modem\readwrite.obj : error LNK2001: unresolvedexternal symbol KeTickCount> objchk_wlh_amd64\amd64\viausbmodem.sys : fatal error LNK1120: 3 unresolvedexternals> e:\code\vtc_usbd_x\usbd_modem\objchk_wlh_amd64\amd64\viausbmodem.sys :error LNK1120: 3 unresolved externals> -------------------------------------------------------------------------------->

Hi David:
Thank you!
I modify the source file as your suggestion,but the link error is still exit.
The source file is:

TARGETNAME=viausbmodem
TARGETTYPE=DRIVER

PRECOMPILED_INCLUDE=viausbmodem.h
PRECOMPILED_PCH=viausbmodem.pch
PRECOMPILED_OBJ=viausbmodem.obj

MSC_WARNING_LEVEL=/W3 /WX

TARGETLIBS= $(DDK_LIB_PATH)\ntstrsafe.lib \
$(DDK_LIB_PATH)\usbd.lib

SOURCES=\
kqueue.c \
init.c \
pnp.c \
usbrelative.c \
counterrelative.c \
irpoprelative.c \
ioctl.c \
circlebuffer.c \
readwrite.c \
open.c \
power.c \
busbdbg.c \
wmi.c

Thanks!

Hi MM,
Thank you for your suggestions!
I modified my source file as your suggestion,but the link error is still exist.
I think if there is no function bodies for KeInitializeSpinLock,KeGetCurrentIrql and KeTickCount in the lib for amd64?

xxxxx@hotmail.com wrote:

Hi MM,
Thank you for your suggestions!
I modified my source file as your suggestion,but the link error is still exist.
I think if there is no function bodies for KeInitializeSpinLock,KeGetCurrentIrql and KeTickCount in the lib for amd64?

That’s correct. They are macros. There shouldn’t BE any external
references. That’s why this is so odd. It’s like you are using the x86
include files with the amd64 libraries.

If you are allowed to do so, why don’t you zip up your entire source
directory and email it to me privately. I’ll build it in my 6000 WDK
environment and see what happens.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.