NTSTATUS ntStatus = STATUS_SUCCESS;
AFSDeviceExt *pDeviceExt;
- ULONG ulTimeIncrement = 0;
UNICODE_STRING uniDeviceName;
ULONG ulIndex = 0;
UNICODE_STRING uniRoutine;
- RTL_OSVERSIONINFOW sysVersion;
BOOLEAN bExit = FALSE;
RegistryPath->Buffer,
RegistryPath->Length);
- RtlZeroMemory( &sysVersion,
+ RtlZeroMemory( &AFSRtlSysVersion,
sizeof( RTL_OSVERSIONINFOW));
- sysVersion.dwOSVersionInfoSize = sizeof( RTL_OSVERSIONINFOW);
+ AFSRtlSysVersion.dwOSVersionInfoSize = sizeof( RTL_OSVERSIONINFOW);
- RtlGetVersion( &sysVersion);
+ RtlGetVersion( &AFSRtlSysVersion);
#if 0
//
// Mandatory Labels only exist on those operating systems.
//
- if( sysVersion.dwMajorVersion >= 6)
+ if( AFSRtlSysVersion.dwMajorVersion >= 6)
{
RtlInitUnicodeString( &uniRoutine,
L"RtlSetSaclSecurityDescriptor");
AFSRtlSetSaclSecurityDescriptor = (PAFSRtlSetSaclSecurityDescriptor)MmGetSystemRoutineAddress( &uniRoutine);
}
+#endif
+
+ RtlInitUnicodeString( &uniRoutine,
+ L"RtlSetGroupSecurityDescriptor");
+
+ AFSRtlSetGroupSecurityDescriptor = (PAFSRtlSetGroupSecurityDescriptor)MmGetSystemRoutineAddress( &uniRoutine);
+
ntStatus = AFSCreateDefaultSecurityDescriptor();
if( !NT_SUCCESS( ntStatus))
ntStatus = STATUS_SUCCESS;
}
-#endif
+
//
- // Initilize the control device
+ // Initialize the control device
//
RtlInitUnicodeString( &uniDeviceName,
ntStatus = IoCreateDevice( DriverObject,
sizeof( AFSDeviceExt),
&uniDeviceName,
- FILE_DEVICE_DISK_FILE_SYSTEM,
+ FILE_DEVICE_NETWORK_FILE_SYSTEM,
0,
FALSE,
&AFSLibraryDeviceObject);
}
//
- // Initialize the worker thread pool
+ // Initialize the worker thread pool counts.
//
- ntStatus = AFSInitializeWorkerPool();
+ pDeviceExt->Specific.Library.WorkerCount = 0;
- if( !NT_SUCCESS( ntStatus))
- {
-
- AFSPrint("AFS DriverEntry Failed to initialize worker pool Status %08lX\n", ntStatus);
-
- try_return( ntStatus);
- }
+ pDeviceExt->Specific.Library.IOWorkerCount = 0;
//
// Fill in the dispatch table
AFSPrint("AFSLibrary DriverEntry failed to initialize %08lX\n", ntStatus);
- if( AFSLibraryDeviceObject != NULL)
- {
-
- AFSRemoveWorkerPool();
- }
-
if( AFSRegistryPath.Buffer != NULL)
{
- ExFreePool( AFSRegistryPath.Buffer);
+ AFSLibExFreePoolWithTag( AFSRegistryPath.Buffer,
+ AFS_GENERIC_MEMORY_13_TAG);
}
if( AFSLibraryDeviceObject != NULL)
}
}
}
- __except( AFSExceptionFilter( GetExceptionCode(), GetExceptionInformation()) )
+ __except( AFSExceptionFilter( __FUNCTION__, GetExceptionCode(), GetExceptionInformation()) )
{
AFSPrint( "EXCEPTION - AFS DriverEntry\n");
+
+ AFSDumpTraceFilesFnc();
}
return ntStatus;
AFSUnload( IN PDRIVER_OBJECT DriverObject)
{
+ UNREFERENCED_PARAMETER(DriverObject);
if( AFSGlobalRoot != NULL)
{
if( AFSRegistryPath.Buffer != NULL)
{
- ExFreePool( AFSRegistryPath.Buffer);
+ AFSLibExFreePoolWithTag( AFSRegistryPath.Buffer,
+ AFS_GENERIC_MEMORY_13_TAG);
}
AFSCloseLibrary();
if( AFSDefaultSD != NULL)
{
- ExFreePool( AFSDefaultSD);
+
+ AFSLibExFreePoolWithTag( AFSDefaultSD,
+ AFS_GENERIC_MEMORY_27_TAG);
}
if( AFSLibraryDeviceObject != NULL)