[BRANCHES]
[reactos.git] / reactos / subsystems / win / basesrv / init.c
index 49e9485..ef98ed3 100644 (file)
@@ -9,6 +9,7 @@
 /* INCLUDES *******************************************************************/
 
 #include "basesrv.h"
+#include "vdm.h"
 
 #include <winreg.h>
 
@@ -569,6 +570,14 @@ BaseInitializeStaticServerData(IN PCSR_SERVER_DLL LoadedServerDll)
     LoadedServerDll->SharedSection = BaseStaticServerData;
 }
 
+VOID
+NTAPI
+BaseSrvDisconnect(PCSR_PROCESS Process)
+{
+    /* Cleanup the VDM console records */
+    BaseSrvCleanupVdmRecords(HandleToUlong(Process->ClientId.UniqueProcess));
+}
+
 CSR_SERVER_DLL_INIT(ServerDllInitialization)
 {
     /* Setup the DLL Object */
@@ -581,7 +590,7 @@ CSR_SERVER_DLL_INIT(ServerDllInitialization)
 #endif
     LoadedServerDll->SizeOfProcessData = 0;
     LoadedServerDll->ConnectCallback = NULL;
-    LoadedServerDll->DisconnectCallback = NULL;
+    LoadedServerDll->DisconnectCallback = BaseSrvDisconnect;
     LoadedServerDll->ShutdownProcessCallback = NULL;
 
     BaseSrvDllInstance = LoadedServerDll->ServerHandle;
@@ -591,6 +600,9 @@ CSR_SERVER_DLL_INIT(ServerDllInitialization)
     /* Initialize DOS devices management */
     BaseInitDefineDosDevice();
 
+    /* Initialize VDM support */
+    BaseInitializeVDM();
+
     /* All done */
     return STATUS_SUCCESS;
 }