Windows: RDR DeviceObject Characteristics
[openafs.git] / src / WINNT / afsrdr / kernel / fs / AFSInit.cpp
index 5ad3ba0..25e11b0 100644 (file)
@@ -68,8 +68,7 @@ DriverEntry( PDRIVER_OBJECT DriverObject,
 {
 
     NTSTATUS ntStatus = STATUS_SUCCESS;
-    AFSDeviceExt    *pDeviceExt;
-    ULONG ulTimeIncrement = 0;
+    AFSDeviceExt    *pDeviceExt = NULL;
     UNICODE_STRING uniSymLinkName;
     UNICODE_STRING uniDeviceName;
     ULONG ulIndex = 0;
@@ -108,6 +107,8 @@ DriverEntry( PDRIVER_OBJECT DriverObject,
 
         AFSReadServerName();
 
+        AFSReadMountRootName();
+
         RtlZeroMemory( &sysVersion,
                        sizeof( RTL_OSVERSIONINFOW));
 
@@ -175,14 +176,6 @@ DriverEntry( PDRIVER_OBJECT DriverObject,
             ntStatus = STATUS_SUCCESS;
         }
 
-        //
-        // Initialize the debug log and dump file interface
-        //
-
-        AFSInitializeDbgLog();
-
-        AFSInitializeDumpFile();
-
 #if DBG
 
         if( BooleanFlagOn( AFSDebugFlags, AFS_DBG_FLAG_BREAK_ON_ENTRY))
@@ -212,6 +205,14 @@ DriverEntry( PDRIVER_OBJECT DriverObject,
         }
 
         //
+        // Initialize the debug log and dump file interface
+        //
+
+        AFSInitializeDbgLog();
+
+        AFSInitializeDumpFile();
+
+        //
         // Setup the registry string
         //
 
@@ -259,7 +260,7 @@ DriverEntry( PDRIVER_OBJECT DriverObject,
                                          sizeof( AFSDeviceExt),
                                          &uniDeviceName,
                                          FILE_DEVICE_NETWORK_FILE_SYSTEM,
-                                         0,
+                                         FILE_DEVICE_SECURE_OPEN | FILE_REMOTE_DEVICE,
                                          FALSE,
                                          &SDDL_DEVOBJ_SYS_ALL_ADM_RWX_WORLD_RWX_RES_RWX,
                                          (LPCGUID)&GUID_SD_AFS_REDIRECTOR_CONTROL_OBJECT,
@@ -420,6 +421,23 @@ DriverEntry( PDRIVER_OBJECT DriverObject,
         AFSSysProcess = PsGetCurrentProcessId();
 
         //
+        // Initialize the worker Queues and their syncrhonization structures
+        //
+
+        KeInitializeEvent( &pDeviceExt->Specific.Control.WorkerQueueHasItems,
+                           SynchronizationEvent,
+                           FALSE);
+
+        ExInitializeResourceLite( &pDeviceExt->Specific.Control.QueueLock);
+
+        KeInitializeEvent( &pDeviceExt->Specific.Control.IOWorkerQueueHasItems,
+                           SynchronizationEvent,
+                           FALSE);
+
+        ExInitializeResourceLite( &pDeviceExt->Specific.Control.IOQueueLock);
+
+
+        //
         // Register for shutdown notification
         //
 
@@ -520,12 +538,14 @@ try_exit:
             ExDeleteResourceLite( &AFSDbgLogLock);
         }
     }
-    __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+    __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
-        AFSDbgLogMsg( 0,
+        AFSDbgTrace(( 0,
                       0,
-                      "EXCEPTION - AFSRedirFs DriverEntry\n");
+                      "EXCEPTION - AFSRedirFs DriverEntry\n"));
+
+        AFSDumpTraceFilesFnc();
     }
 
     return ntStatus;