I'm currently trying to run the NdisProt driver given by WinDDK 2003. I've build and installed the driver successfully.
It comes with a test utility named uiotest
When I build the utility with make it runs correctly.
When I create a blank win32 application solution with Visual Studio 2005 it cannot connect to the driver during CreateFile( "\\.\\NdisProt"
[...])`. The call always returns an invalid handle. I suspect that my project is not built exactly the same as with make. Here is the content of the "sources" file used by make
TARGETNAME=uiotest
TARGETPATH=obj
TARGETTYPE=PROGRAM
C_DEFINES=$(C_DEFINES) -D_WIN32WIN_
# MSC_WARNING_LEVEL=/W4
UMTYPE=console
USE_MSVCRT=1
TARGETLIBS=\
$(SDK_LIB_PATH)\user32.lib
INCLUDES=..\sys
SOURCES=\
uiotest.c
I've added the lib path and include path to my project
here is what make returns from the ddk environement
cl -nologo -Ii386\ -I. -ID:\WINDDK\3790~1.183\inc\mfc42 -I..\sys -Iobjfre_wxp_x8
6\i386 -ID:\WINDDK\3790~1.183\inc\wxp -ID:\WINDDK\3790~1.183\inc\wxp -ID:\WINDDK
\3790~1.183\inc\crt -D_X86_=1 -Di386=1 -DSTD_CALL -DCONDITION_HANDLING=1 -DNT
_INST=0 -DWIN32=100 -D_NT1X_=100 -DWINNT=1 -D_WIN32_WINNT=0x0501 /DWINVER=0x0501
-D_WIN32_IE=0x0603 -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1 -D__BUILDMACHINE__=WinDD
K -DFPO=0 -DNDEBUG -D_DLL=1 -D_MT=1 -D_WIN32WIN_ /c /Zl /Zp8 /Gy /Gm- /W3
/WX /Gz /GX- /GR- /GF /GS /G6 /Ze /Gi- /QIfdiv- /hotpatch -Z7 /Oxs /Oy- -F
ID:\WINDDK\3790~1.183\inc\wxp\warning.h .\uiotest.c
uiotest.c
link -out:objfre_wxp_x86\i386\uiotest.exe -machine:ix86 @C:\Temp\nm88BE.
tmp
Microsoft (R) Incremental Linker Version 7.10.4035
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
-INCREMENTAL:NO
-FULLBUILD
/release
-NODEFAULTLIB
/WX
-debug
-debugtype:cv
-version:5.1
-osversion:5.1
/functionpadmin:5
/safeseh
/opt:nowin98
-merge:.rdata=.text
/pdbcompress
-STACK:0x40000,0x2000
/tsaware
-subsystem:console,4.00
-base:@D:\WINDDK\3790~1.183\bin\coffbase.txt,usermode
-entry:mainCRTStartup
objfre_wxp_x86\i386\uiotest.obj
D:\WINDDK\3790~1.183\lib\wxp\i386\BufferOverflowU.lib
D:\WINDDK\3790~1.183\lib\crt\i386\msvcrt.lib
D:\WINDDK\3790~1.183\lib\wxp\i386\advapi32.lib
D:\WINDDK\3790~1.183\lib\wxp\i386\kernel32.lib
D:\WINDDK\3790~1.183\lib\wxp\i386\user32.lib
D:\WINDDK\3790~1.183\lib\wxp\i386\sehupd.lib
I'm not too sure about what to check to know what's going on so any help would be appreciable. The new project compiles and run, but the CreateFile()
fails with INVALID_HANDLE_VALUE