- We want socket closure notification so we don't leak our socket context when the...
authorCameron Gutman <aicommander@gmail.com>
Fri, 25 Sep 2009 23:44:51 +0000 (23:44 +0000)
committerCameron Gutman <aicommander@gmail.com>
Fri, 25 Sep 2009 23:44:51 +0000 (23:44 +0000)
 - Free socket context in WSHNotify

svn path=/trunk/; revision=43154

reactos/dll/win32/wshtcpip/wshtcpip.c

index b13fabc..bc3fcee 100644 (file)
@@ -312,7 +312,16 @@ WSHNotify(
     IN  HANDLE TdiConnectionObjectHandle,
     IN  DWORD NotifyEvent)
 {
-    UNIMPLEMENTED
+    switch (NotifyEvent)
+    {
+        case WSH_NOTIFY_CLOSE:
+        HeapFree(GetProcessHeap(), 0, HelperDllSocketContext);
+        break;
+
+        default:
+        DPRINT1("Unwanted notification received! (%d)\n", NotifyEvent);
+        break;
+    }
 
     return 0;
 }
@@ -446,6 +455,7 @@ WSHOpenSocket2(
     Context->Flags         = Flags;
 
     *HelperDllSocketContext = Context;
+    *NotificationEvents = WSH_NOTIFY_CLOSE;
 
     return NO_ERROR;
 }