Windows: XP do not mark rdr devices as secure
[openafs.git] / src / WINNT / afsrdr / kernel / fs / AFSInit.cpp
index 83e22f7..c06d472 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,
@@ -392,8 +393,6 @@ DriverEntry( PDRIVER_OBJECT DriverObject,
         AFSFastIoDispatch.AcquireFileForNtCreateSection = AFSFastIoAcquireFile;
         AFSFastIoDispatch.ReleaseFileForNtCreateSection = AFSFastIoReleaseFile;
         AFSFastIoDispatch.FastIoDetachDevice           = AFSFastIoDetachDevice;
-        //AFSFastIoDispatch.AcquireForModWrite           = AFSFastIoAcquireForModWrite;
-        //AFSFastIoDispatch.ReleaseForModWrite           = AFSFastIoReleaseForModWrite;
         AFSFastIoDispatch.MdlRead                      = AFSFastIoMdlRead;
         AFSFastIoDispatch.MdlReadComplete              = AFSFastIoMdlReadComplete;
         AFSFastIoDispatch.PrepareMdlWrite              = AFSFastIoPrepareMdlWrite;
@@ -420,6 +419,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
         //
 
@@ -523,9 +539,9 @@ try_exit:
     __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
     {
 
-        AFSDbgLogMsg( 0,
+        AFSDbgTrace(( 0,
                       0,
-                      "EXCEPTION - AFSRedirFs DriverEntry\n");
+                      "EXCEPTION - AFSRedirFs DriverEntry\n"));
 
         AFSDumpTraceFilesFnc();
     }