AFSDeviceExt *pDeviceExt = NULL;
UNICODE_STRING uniFsRtlRegisterUncProviderEx;
FsRtlRegisterUncProviderEx_t pFsRtlRegisterUncProviderEx = NULL;
+ RTL_OSVERSIONINFOW sysVersion;
+ ULONG ulDeviceCharacteristics = FILE_REMOTE_DEVICE;
__Enter
{
+ RtlZeroMemory( &sysVersion,
+ sizeof( RTL_OSVERSIONINFOW));
+
+ sysVersion.dwOSVersionInfoSize = sizeof( RTL_OSVERSIONINFOW);
+
+ RtlGetVersion( &sysVersion);
+
RtlInitUnicodeString( &uniDeviceName,
AFS_RDR_DEVICE_NAME);
pFsRtlRegisterUncProviderEx = (FsRtlRegisterUncProviderEx_t)MmGetSystemRoutineAddress(&uniFsRtlRegisterUncProviderEx);
+ //
+ // On 32-bit Windows XP, do not set FILE_DEVICE_SECURE_OPEN
+ // flag as it interferes with initial access to \\afs from
+ // limited user accounts.
+ //
+
+ if(!(sysVersion.dwMajorVersion == 5 &&
+ sysVersion.dwMinorVersion == 1))
+ {
+
+ ulDeviceCharacteristics |= FILE_DEVICE_SECURE_OPEN;
+ }
+
ntStatus = IoCreateDevice( AFSDriverObject,
sizeof( AFSDeviceExt),
pFsRtlRegisterUncProviderEx ? NULL : &uniDeviceName,
FILE_DEVICE_NETWORK_FILE_SYSTEM,
- FILE_REMOTE_DEVICE,
+ ulDeviceCharacteristics,
FALSE,
&AFSRDRDeviceObject);
if( !NT_SUCCESS( ntStatus))
{
- AFSDbgLogMsg( AFS_SUBSYSTEM_INIT_PROCESSING,
+ AFSDbgTrace(( AFS_SUBSYSTEM_INIT_PROCESSING,
AFS_TRACE_LEVEL_ERROR,
"AFSInitRDRDevice IoCreateDevice failure %08lX\n",
- ntStatus);
+ ntStatus));
try_return( ntStatus);
}
if ( !NT_SUCCESS(ntStatus))
{
- AFSDbgLogMsg( AFS_SUBSYSTEM_INIT_PROCESSING,
+ AFSDbgTrace(( AFS_SUBSYSTEM_INIT_PROCESSING,
AFS_TRACE_LEVEL_ERROR,
"AFSInitRDRDevice AFSInitRdrFcb failure %08lX\n",
- ntStatus);
+ ntStatus));
try_return( ntStatus);
}
AFSRDRDeviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
//
+ // Increase the StackSize to support the extra stack frame required
+ // for use of IoCompletion routines.
+ //
+
+ AFSRDRDeviceObject->StackSize++;
+
+ //
// Register this device with MUP with FilterMgr if Vista or above
//
0);
if ( !NT_SUCCESS( ntStatus))
{
- AFSDbgLogMsg( AFS_SUBSYSTEM_INIT_PROCESSING,
+ AFSDbgTrace(( AFS_SUBSYSTEM_INIT_PROCESSING,
AFS_TRACE_LEVEL_ERROR,
"AFSInitRDRDevice FsRtlRegisterUncProvider failure %08lX\n",
- ntStatus);
+ ntStatus));
}
}
else
}
else
{
- AFSDbgLogMsg( AFS_SUBSYSTEM_INIT_PROCESSING,
+ AFSDbgTrace(( AFS_SUBSYSTEM_INIT_PROCESSING,
AFS_TRACE_LEVEL_ERROR,
"AFSInitRDRDevice FsRtlRegisterUncProvider failure %08lX\n",
- ntStatus);
+ ntStatus));
}
}
if( !NT_SUCCESS( ntStatus))
{
- AFSDbgLogMsg( AFS_SUBSYSTEM_INIT_PROCESSING,
+ AFSDbgTrace(( AFS_SUBSYSTEM_INIT_PROCESSING,
AFS_TRACE_LEVEL_ERROR,
"AFSInitializeRedirector AFSLoadLibrary failure %08lX\n",
- ntStatus);
+ ntStatus));
try_return( ntStatus);
}
if( AFSDumpFileLocation.Buffer == NULL)
{
- AFSDbgLogMsg( AFS_SUBSYSTEM_INIT_PROCESSING,
+ AFSDbgTrace(( AFS_SUBSYSTEM_INIT_PROCESSING,
AFS_TRACE_LEVEL_ERROR,
- "AFSInitializeRedirector AFS_GENERIC_MEMORY_23_TAG allocation error\n");
+ "AFSInitializeRedirector AFS_GENERIC_MEMORY_23_TAG allocation error\n"));
try_return( ntStatus = STATUS_INSUFFICIENT_RESOURCES);
}
}
//
+ // Global Reparse Point Policy
+ //
+
+ pDevExt->Specific.RDR.ReparsePointPolicy = RedirInitInfo->GlobalReparsePointPolicy;
+
+ //
// Are we performing direct to service IO?
//
RedirInitInfo->CacheFileNameLength == 0)
{
- AFSDbgLogMsg( AFS_SUBSYSTEM_INIT_PROCESSING,
+ AFSDbgTrace(( AFS_SUBSYSTEM_INIT_PROCESSING,
AFS_TRACE_LEVEL_ERROR,
"AFSInitializeRedirector Unable to initialize cache file %08lX\n",
- ntStatus);
+ ntStatus));
try_return( ntStatus);
}
if( RedirInitInfo->CacheFileNameLength == 0)
{
- AFSDbgLogMsg( AFS_SUBSYSTEM_INIT_PROCESSING,
+ AFSDbgTrace(( AFS_SUBSYSTEM_INIT_PROCESSING,
AFS_TRACE_LEVEL_ERROR,
- "AFSInitializeRedirector CacheMdl == NULL\n");
+ "AFSInitializeRedirector CacheMdl == NULL\n"));
try_return( ntStatus = STATUS_INVALID_PARAMETER);
}
if( pDevExt->Specific.RDR.CacheFile.Buffer == NULL)
{
- AFSDbgLogMsg( AFS_SUBSYSTEM_INIT_PROCESSING,
+ AFSDbgTrace(( AFS_SUBSYSTEM_INIT_PROCESSING,
AFS_TRACE_LEVEL_ERROR,
- "AFSInitializeRedirector AFS_GENERIC_MEMORY_24_TAG allocation failure\n");
+ "AFSInitializeRedirector AFS_GENERIC_MEMORY_24_TAG allocation failure\n"));
try_return( ntStatus = STATUS_INSUFFICIENT_RESOURCES);
}
if( !NT_SUCCESS( ntStatus))
{
- AFSDbgLogMsg( AFS_SUBSYSTEM_INIT_PROCESSING,
+ AFSDbgTrace(( AFS_SUBSYSTEM_INIT_PROCESSING,
AFS_TRACE_LEVEL_ERROR,
"AFSInitializeRedirector ZwOpenFile failure %08lX\n",
- ntStatus);
+ ntStatus));
try_return( ntStatus);
}
if( !NT_SUCCESS( ntStatus))
{
- AFSDbgLogMsg( AFS_SUBSYSTEM_INIT_PROCESSING,
+ AFSDbgTrace(( AFS_SUBSYSTEM_INIT_PROCESSING,
AFS_TRACE_LEVEL_ERROR,
"AFSInitializeRedirector ObReferenceObjectByHandle failure %08lX\n",
- ntStatus);
+ ntStatus));
try_return( ntStatus);
}
if ( !NT_SUCCESS( ntStatus))
{
- AFSDbgLogMsg( AFS_SUBSYSTEM_INIT_PROCESSING,
+ AFSDbgTrace(( AFS_SUBSYSTEM_INIT_PROCESSING,
AFS_TRACE_LEVEL_ERROR,
"AFSInitializeRedirector AFSInitializeLibrary failure %08lX\n",
- ntStatus);
+ ntStatus));
}
try_exit:
if( pFcb == NULL)
{
- AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+ AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
AFS_TRACE_LEVEL_ERROR,
- "AFSInitRdrFcb Failed to allocate the root fcb\n");
+ "AFSInitRdrFcb Failed to allocate the root fcb\n"));
try_return( ntStatus = STATUS_INSUFFICIENT_RESOURCES);
}
if( pNPFcb == NULL)
{
- AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+ AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
AFS_TRACE_LEVEL_ERROR,
- "AFSInitRdrFcb Failed to allocate the non-paged fcb\n");
+ "AFSInitRdrFcb Failed to allocate the non-paged fcb\n"));
try_return( ntStatus = STATUS_INSUFFICIENT_RESOURCES);
}
ExInitializeResourceLite( &pNPFcb->Resource);
- AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+ AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
AFS_TRACE_LEVEL_VERBOSE,
"AFSInitRootFcb Acquiring Fcb lock %p EXCL %08lX\n",
&pNPFcb->Resource,
- PsGetCurrentThread());
+ PsGetCurrentThread()));
ExInitializeResourceLite( &pNPFcb->PagingResource);