Windows: RDR DeviceObject Characteristics
[openafs.git] / src / WINNT / afsrdr / kernel / fs / AFSInit.cpp
index 8ff1be2..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;
@@ -177,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))
@@ -214,6 +205,14 @@ DriverEntry( PDRIVER_OBJECT DriverObject,
         }
 
         //
+        // Initialize the debug log and dump file interface
+        //
+
+        AFSInitializeDbgLog();
+
+        AFSInitializeDumpFile();
+
+        //
         // Setup the registry string
         //
 
@@ -261,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,
@@ -422,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
         //
 
@@ -525,9 +541,9 @@ try_exit:
     __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
-        AFSDbgLogMsg( 0,
+        AFSDbgTrace(( 0,
                       0,
-                      "EXCEPTION - AFSRedirFs DriverEntry\n");
+                      "EXCEPTION - AFSRedirFs DriverEntry\n"));
 
         AFSDumpTraceFilesFnc();
     }