Hi,
I have written a TDI driver which basically connects and makes calls to TCPIP.sys.
I want this driver to be able to make calls to TCPIP protocol driver at boot time. So specifying a boot start and giving a dependency on TCPIP i am able to start the driver. However I am not able to make connect calls to other hosts at boot time . Each time it returns with error “Destination host unreachable” . I figured that TCPIP may not be fully initialized at the time of making CONNECT request to it using TDI interfaces.
Now i am trying to ensure that TCPIP is up, and able to make connections by registering the TdiRegisterPnPHandlers function with appropriate callbacks. I assume the binding handler will be called with opcode “TDI_PNP_OP_NETREADY” when the TCP stack is up and running . Is there any other way to ensure that the TCP stack is up and able to make connections ??
Also while compiling the driver code, it gives me a linker error that unable to resolve TdiRegisterPnPHandlers. I have included the tdikrnl.h and have also included the tdi.lib in the sources file. Still the error persists.
The error is as below
F:\ProvisionNew\pronet\WIN_NBD_CLIENT\Tdi_client>bld
BUILD: Compile and Link for x86
BUILD: Loading k:\winddk\6001.18000\build.dat…
BUILD: Computing Include file dependencies:
BUILD: Start time: Tue Sep 16 17:43:29 2008
BUILD: Examining f:\provisionnew\pronet\win_nbd_client\tdi_client directory for
files to compile.
BUILD: Saving k:\winddk\6001.18000\build.dat…
BUILD: Compiling and Linking f:\provisionnew\pronet\win_nbd_client\tdi_client di
rectory
_NT_TARGET_VERSION SET TO WS03
Compiling - main.cpp
Linking Executable - objchk_wnet_x86\i386\tdiclient.sys
errors in directory f:\provisionnew\pronet\win_nbd_client\tdi_client
f:\provisionnew\pronet\win_nbd_client\tdi_client\main.obj : error LNK2019: unres
olved external symbol “long __stdcall TdiRegisterPnPHandlers(struct _TDI20_CLIEN
T_INTERFACE_INFO *,unsigned long,void * *)” (?TdiRegisterPnPHandlers@@YGJPAU_TDI
20_CLIENT_INTERFACE_INFO@@KPAPAX@Z) referenced in function “long __stdcall MyReg
isterPnPHandlers(void)” (?MyRegisterPnPHandlers@@YGJXZ)
f:\provisionnew\pronet\win_nbd_client\tdi_client\objchk_wnet_x86\i386\tdiclient.
sys : error LNK1120: 1 unresolved externals
BUILD: Finish time: Tue Sep 16 17:43:31 2008
BUILD: Done
3 files compiled
1 executable built - 2 Errors
My sources file is as below !!
TARGETNAME = TDIClient
TARGETPATH = obj
TARGETTYPE = DRIVER
TARGETLIB = K:\WINDDK\6001.18000\lib\wnet\i386\tdi.lib
SOURCES = main.cpp
The function that i am using the call is
NTSTATUS MyRegisterPnPHandlers()
{
HANDLE Handle = NULL;
TDI20_CLIENT_INTERFACE_INFO tinfo;
tinfo.ClientName = NULL;
tinfo.MajorTdiVersion = TDI_CURRENT_MAJOR_VERSION;
tinfo.MinorTdiVersion = TDI_CURRENT_MINOR_VERSION;
RtlInitUnicodeString(tinfo.ClientName,L"TDIClient");
tinfo.PnPPowerHandler = NULL;
tinfo.BindingHandler = BindCallback;
tinfo.AddAddressHandlerV2 = TDIAddAddressHandler;
tinfo.DelAddressHandlerV2 = TDIDelAddressHandler;
TdiRegisterPnPHandlers(&tinfo,sizeof(tinfo),&Handle);
return STATUS_SUCCESS;
}
I am new to driver development. Any help or suggestions are highly appreciated
Thanks in advance… ![]()