Why didnt TDI_DISCONNECT or TDI_EVENT_DISCONNECT come in windows 2003 web server whe

hi, my name is Kim.
I have a problem at Windows 2003 web server.
I need your help.
Thank you.

[Environment]

  1. OS : Windows 2003 Enterprise Server Service Pack 2
  2. Server Management : Web Application Server(with IIS)

[Description]
My network driver is TDI hook driver. It receives all events of TDI layer, and manages its sessions.
For example, when the event of TDI_CONNECT or TDI_EVENT_CONNECT comes, my driver allocates some memory for the session data.
And when it is TDI_DISCONNECT or TDI_EVENT_DISCONNECT, my driver free the allocated memory.
Then, in the Windows 2003 web server, memory leak is occurred in my driver.
That is because TDI_EVENT_DISCONNECT didn’t come.

In the general, TDI_CONNECT or TDI_EVENT_CONNECT and Accepting makes a session, and the session is freed with TDI_DISCONNECT or TDI_EVENT_DISCONNECT.
For example, the log of my driver;
00000271 853.42016602 MyTdiEventConnect returns with pConnectionContext(0x893e92c8), pAcceptIrp(0x88bbfc88), pFileObjectOfIrp(0x893e9140)
00000272 853.42016602 MyTdiEventConnectComplete returns with MyTransportAdd(0x895c4d78), MyConnEndpoint(0x893e90c0), MyIrp(0x87931a48)
00000273 853.42016602 MyAddSessionEntry - NumberOfSession(10), AddedSessionEntry(0x88baf618), MyConnEndpoint(0x893e90c0), RemoteIP(0x7986a455), RemotePort(20037), LocalPort(445) TCP(6)

00000279 864.76690674 MyTdiEventDisconnect is called!!
00000280 864.76690674 MyTdiEventDisconnect with MyTransportAdd(0x895c4d78), MyConnEndpoint(0x893e90c0), MyIrp(0x88bb5a10)
00000281 864.76690674 MyDeleteSessionEntry with NumberOfSession(9), DeletedSessionEntry(0x88baf618), MyConnEndpoint (0x893e90c0)
00000282 864.76721191 MyTdiDisconnectComplete with MyTransportAdd(0x0), MyConnEndpoint(0x893e90c0), MyIrp (0x88b1e2e8)

But after starting of web server service, the log is changed.
00000614 987.81127930 MyTdiEventConnect returns with pConnectionContext(0x893f08b0), pAcceptIrp(0x893f0810), pFileObject(0x88c35f90)
00000615 987.81134033 MyTdiEventConnectComplete with MyTransportAdd(0x88bfe950), MyConnEndpoint(0x88c35f10), MyIrp(0x896268f8)
00000616 987.81134033 MyAddSessionEntry - NumberOfSession(39), AddSessionEntry(0x8800dab0) MyConnEndpoint(0x88c35f10), RemoteIP(0xc0a8071b), RemotePort(1649), LocalPort(80) TCP(6)
00000617 987.83789063 MyTdiEventConnect returns with pConnectionContext(0x893f08b0), pAcceptIrp(0x893f0810), pFileObject(0x88c35f90)
00000618 987.83789063 MyTdiEventConnectComplete with MyTransportAdd(0x88bfe950), MyConnEndpoint(0x88c35f10), MyIrp(0x896268f8)
00000619 987.83801270 MyAddSessionEntry - NumberOfSession(40), AddSessionEntry(0x8800d200) MyConnEndpoint(0x88c35f10), RemoteIP(0xc0a8071b), RemotePort(1650), LocalPort(80) TCP(6)
00000620 987.87609863 MyTdiEventConnect returns with pConnectionContext(0x893f08b0), pAcceptIrp(0x893f0810), pFileObject(0x88c35f90)
00000621 987.87609863 MyTdiEventConnectComplete with MyTransportAdd(0x88bfe950), MyConnEndpoint(0x88c35f10), MyIrp(0x896268f8)
00000622 987.87615967 MyAddSessionEntry - NumberOfSession(41), AddSessionEntry(0x86faa550) MyConnEndpoint(0x88c35f10), RemoteIP(0xc0a8071b), RemotePort(1651), LocalPort(80) TCP(6)
00000623 987.88861084 MyTdiEventConnect returns with pConnectionContext(0x893f08b0), pAcceptIrp(0x893f0810), pFileObject(0x88c35f90)
00000624 987.88861084 MyTdiEventConnectComplete with MyTransportAdd(0x88bfe950), MyConnEndpoint(0x88c35f10), MyIrp(0x896268f8)
00000625 987.88867188 MyAddSessionEntry - NumberOfSession(42), AddSessionEntry(0x88bfaf28) MyConnEndpoint(0x88c35f10), RemoteIP(0xc0a8071b), RemotePort(1652), LocalPort(80) TCP(6)
00000626 987.90399170 MyTdiEventConnect returns with pConnectionContext(0x893f08b0), pAcceptIrp(0x893f0810), pFileObject(0x88c35f90)
00000627 987.90399170 MyTdiEventConnectComplete with MyTransportAdd(0x88bfe950), MyConnEndpoint(0x88c35f10), MyIrp(0x896268f8)
00000628 987.90399170 MyAddSessionEntry - NumberOfSession(43), AddSessionEntry(0x8800c800) MyConnEndpoint(0x88c35f10), RemoteIP(0xc0a8071b), RemotePort(1653), LocalPort(80) TCP(6)
00000629 987.99432373 MyTdiEventConnect returns with pConnectionContext(0x86fb2da8), pAcceptIrp(0x86fb2d08), pFileObject(0x86fb2c90)
00000630 987.99432373 MyTdiEventConnectComplete with MyTransportAdd(0x88bfe950), MyConnEndpoint(0x86fb2c10), MyIrp(0x88b523e8)
00000631 987.99438477 MyAddSessionEntry - NumberOfSession(44), AddSessionEntry(0x88019e88) MyConnEndpoint(0x86fb2c10), RemoteIP(0xc0a8071b), RemotePort(1654), LocalPort(80) TCP(6)
00000632 988.01763916 MyTdiConnect with AddrObj(0x8800ce40), MyConnEndpoint(0x86fac110), MyIrp(0x88b523e8)
00000633 988.01776123 MyAddSessionEntry - NumberOfSession(45), AddSessionEntry(0x8800b178) MyConnEndpoint(0x86fac110), RemoteIP(0x7986a458), RemotePort(389), LocalPort(1335) TCP(6)
00000634 988.02044678 MyTdiEventConnect returns with pConnectionContext(0x893f08b0), pAcceptIrp(0x893f0810), pFileObject(0x88c35f90)
00000635 988.02044678 MyTdiEventConnectComplete with MyTransportAdd(0x88bfe950), MyConnEndpoint(0x88c35f10), MyIrp(0x880570e8)
00000636 988.02044678 MyAddSessionEntry - NumberOfSession(46), AddSessionEntry(0x88003330) MyConnEndpoint(0x88c35f10), RemoteIP(0xc0a8071b), RemotePort(1655), LocalPort(80) TCP(6)
00000637 988.02227783 MyTdiEventDisconnect is called!!
00000638 988.02227783 MyTdiEventDisconnect with MyTransportAdd(0x8800ce40), MyConnEndpoint(0x86fac110), MyIrp(0x8805d098)
00000639 988.02227783 MyDeleteSessionEntry with NumberOfSession(45), DellSessionEntry(0x8800b178) MyConnEndpoint(0x86fac110)
00000640 988.02233887 MyTdiDisconnectComplete with MyTransportAdd(0x0), MyConnEndpoint(0x86fac110), MyIrp(0x880570e8)

[Questions]

  1. Why is the client trying to connect to web server with the same pConnectionContext(0x893f08b0), pAcceptIrp(0x893f0810), pFileObject(0x88c35f90)? Difference is only client’s port.
  2. Why didn’t TDI_DISCONNECT or TDI_EVENT_DISCONNECT come in windows 2003 web server when the service is started?

Thank you.