Home › Forums › Discussions › General Discussion › I’m newbie in kernel programming, TDI program please help!:( › Reply To: I’m newbie in kernel programming, TDI program please help!:(
My virtual disk have a routine function
CDReadIN PDEVICE_OBJECT DeviceObject, IN PIRP Irp).
This routine is called by the I/O system to read or write to a device that we control. When Interupt major function in case IRP_MJ_READ will call to function ReadDataOffset(Filename, offset, length, buffer) for read data from iso file (CD image file). If iso file is local, run OK, but now read iso file from server (Unix) need a socket driver (TDI), a export driver for get data from server. I build a kernel socket driver from TDI use TCP protocol.
In function ReadDataOffset of virtual disk driver I call socket driver functions for make a session with server.
– Create enpoint connection
– Create transport address handle
– Set event handle
– Bind enpoint connection and transport address handle (associate a tdi transport connection)
– Connect to server
– Send command
– Get data to buffer
– Close enpoint connection handle
– Close transport address handle
After finish the first session (finish the first call to ReadDataOffset function), virtual disk request next session (call to ReadDataOffset again), error happend when running at the first command line ASSERT( KeGetCurrentIrql() == PASSIVE_LEVEL ) in socket driver code (the first time no problem). If I remove these command lines, happend will happend immediatly when finnish the first session. Now I can not know what happend and have no solution for it. I’m looking forward to hearing from you, experts.
Thanks in adv.