/// <summary> /// Verify the fields of structure FILE_FS_FULL_SIZE_INFORMATION /// </summary> /// <param name="info">the instance of FILE_FS_FULL_SIZE_INFORMATION</param> /// <param name="isPerUserQuotasUsed">FILE_VOLUME_QUOTAS in FileSystemAttributes indicate that the file system /// supports per-user quotas.</param> /// <param name="expectedTotalFreeAllocationUnits">the the total number of free allocation units on the disk</param> public void VerifyDataTypeFileFsFullSizeInformationField(FileFsFullSizeInformation info, bool isPerUserQuotasUsed, uint expectedTotalFreeAllocationUnits) { Site.DefaultProtocolDocShortName = "MS-FSCC"; string ServerOS = Site.Properties["ServerOSPlatform"]; if (ServerOS == "Win2k" || ServerOS == "WinXP" || ServerOS == "Win2k3" || ServerOS == "WinVista" || ServerOS == "Win2k8") { if (isPerUserQuotasUsed) { // // Add the debug information // Site.Log.Add(LogEntryKind.Debug, "Verify MS-FSCC_R1981. CallerAvailableAllocationUnits: {0}", info.CallerAvailableAllocationUnits); // // Verify MS-FSCC requirement: MS-FSCC_R1981 // bool isVerifyR1981 = (info.CallerAvailableAllocationUnits < expectedTotalFreeAllocationUnits); Site.CaptureRequirementIfIsTrue( isVerifyR1981, 1981, @"<86> Section 2.5.4: In Windows 2000, Windows XP, Windows Server 2003, Windows Vista, and Windows Server 2008, if per-user quotas are in use, this value[CallerAvailableAllocationUnits] may be less than the total number of free allocation units on the disk."); } } Site.DefaultProtocolDocShortName = Site.Properties["ProtocolShortName"]; }
/// <summary> /// Verify data type FileFsFullSizeInformation /// </summary> /// <param name="fileFsFullSizeInformation"> FileFsFullSizeInformation type data </param> /// <param name="bytesPerSector"> A 32-bit unsigned integer that contains the number of bytes in each sector. </param> public void VerifyDataTypeFileFsFullSizeInformation( FileFsFullSizeInformation fileFsFullSizeInformation, uint bytesPerSector) { Site.DefaultProtocolDocShortName = "MS-FSCC"; // // Add the debug information // Site.Log.Add(LogEntryKind.Debug, "Verify MS-FSCC_R1762 "); // // Verify requirement 1762 // Site.CaptureRequirementIfAreEqual<Type>( typeof(FileFsFullSizeInformation), fileFsFullSizeInformation.GetType(), 1762, @"The message[FileFsFullSizeInformation] contains a FILE_FS_FULL_SIZE_INFORMATION data element."); // // Add the debug information // Site.Log.Add(LogEntryKind.Debug, "Verify MS-FSCC_R1764 Actual TotalAllocationUnits: {0}", fileFsFullSizeInformation.TotalAllocationUnits); // // Verify requirement 1764 // // Verify the type and the value of the TotalAllocationUnits bool isVerifyR1764 = ( fileFsFullSizeInformation.TotalAllocationUnits.GetType() == typeof(Int64) && Marshal.SizeOf(fileFsFullSizeInformation.TotalAllocationUnits) == 8); Site.CaptureRequirementIfIsTrue( isVerifyR1764, 1764, @"[In FILE_FS_FULL_SIZE_INFORMATION]TotalAllocationUnits (8 bytes): A 64-bit signed integer that contains the total number of allocation units on the volume that are available to the user associated with the calling thread."); // // Add the debug information // Site.Log.Add(LogEntryKind.Debug, "Verify MS-FSCC_R1765 Actual TotalAllocationUnits: {0}", fileFsFullSizeInformation.TotalAllocationUnits); // // Verify requirement 1765 // Site.CaptureRequirementIfIsTrue( fileFsFullSizeInformation.TotalAllocationUnits >= 0, 1765, @"[In FILE_FS_FULL_SIZE_INFORMATION]TotalAllocationUnits (8 bytes): The value of this field MUST be greater than or equal to 0.<85>"); // // Add the debug information // Site.Log.Add(LogEntryKind.Debug, "Verify MS-FSCC_R1766 Actual CallerAvailableAllocationUnits: {0}", fileFsFullSizeInformation.CallerAvailableAllocationUnits); // // Verify requirement 1766 // // Verify the type and the value of the CallerAvailableAllocationUnits bool isVerifyR1766 = ( fileFsFullSizeInformation.CallerAvailableAllocationUnits.GetType() == typeof(Int64) && Marshal.SizeOf(fileFsFullSizeInformation.CallerAvailableAllocationUnits) == 8); Site.CaptureRequirementIfIsTrue( isVerifyR1766, 1766, @"[In FILE_FS_FULL_SIZE_INFORMATION]CallerAvailableAllocationUnits (8 bytes): A 64-bit signed integer that contains the total number of free allocation units on the volume that are available to the user associated with the calling thread."); // // Add the debug information // Site.Log.Add(LogEntryKind.Debug, "Verify MS-FSCC_R1767 Actual CallerAvailableAllocationUnits: {0}", fileFsFullSizeInformation.CallerAvailableAllocationUnits); // // Verify requirement 1767 // Site.CaptureRequirementIfIsTrue( fileFsFullSizeInformation.CallerAvailableAllocationUnits >= 0, 1767, @"[In FILE_FS_FULL_SIZE_INFORMATION]CallerAvailableAllocationUnits (8 bytes): The value of this field MUST be greater than or equal to 0.<86>"); // // Add the debug information // Site.Log.Add(LogEntryKind.Debug, "Verify MS-FSCC_R1768 Actual ActualAvailableAllocationUnits: {0}", fileFsFullSizeInformation.ActualAvailableAllocationUnits); // // Verify requirement 1768 // // Verify the type and the value of the actualAvailableAllocationUnits bool isVerifyR1768 = ( fileFsFullSizeInformation.ActualAvailableAllocationUnits.GetType() == typeof(Int64) && Marshal.SizeOf(fileFsFullSizeInformation.ActualAvailableAllocationUnits) == 8); Site.CaptureRequirementIfIsTrue( isVerifyR1768, 1768, @"[In FILE_FS_FULL_SIZE_INFORMATION]ActualAvailableAllocationUnits (8 bytes): A 64-bit signed integer that contains the total number of free allocation units on the volume."); // // Add the debug information // Site.Log.Add(LogEntryKind.Debug, "Verify MS-FSCC_R1769 Actual ActualAvailableAllocationUnits: {0}.", fileFsFullSizeInformation.ActualAvailableAllocationUnits); // // Verify requirement 1769 // Site.CaptureRequirementIfIsTrue( fileFsFullSizeInformation.ActualAvailableAllocationUnits >= 0, 1769, @"[In FILE_FS_FULL_SIZE_INFORMATION]ActualAvailableAllocationUnits (8 bytes): The value of this field MUST be greater than or equal to 0."); // // Add the debug information // Site.Log.Add(LogEntryKind.Debug, "Verify MS-FSCC_R1770 Actual SectorsPerAllocationUnit: {0}", fileFsFullSizeInformation.SectorsPerAllocationUnit); // // Verify requirement 1770 // // Verify the type and the value of the SectorsPerAllocationUnit bool isVerifyR1770 = ( fileFsFullSizeInformation.SectorsPerAllocationUnit.GetType() == typeof(UInt32) && Marshal.SizeOf(fileFsFullSizeInformation.SectorsPerAllocationUnit) == 4); Site.CaptureRequirementIfIsTrue( isVerifyR1770, 1770, @"[In FILE_FS_FULL_SIZE_INFORMATION]SectorsPerAllocationUnit (4 bytes): A 32-bit unsigned integer that contains the number of sectors in each allocation unit."); // // Add the debug information // Site.Log.Add(LogEntryKind.Debug, "Verify MS-FSCC_R1771 Actual BytesPerSector: {0}, Expected BytesPerSector: {1}.", fileFsFullSizeInformation.BytesPerSector, bytesPerSector); // // Verify requirement 1771 // // Verify the type and the value of the BytesPerSector bool isVerifyR1771 = ( fileFsFullSizeInformation.BytesPerSector.GetType() == typeof(UInt32) && fileFsFullSizeInformation.BytesPerSector == bytesPerSector); Site.CaptureRequirementIfIsTrue( isVerifyR1771, 1771, @"[In FILE_FS_FULL_SIZE_INFORMATION]BytesPerSector (4 bytes): A 32-bit unsigned integer that contains the number of bytes in each sector."); Site.DefaultProtocolDocShortName = Site.Properties["ProtocolShortName"]; }