private void VerifyMessageSyntaxRequestAndResponseBuffer(object ropSize, byte[][] ropList, List<uint> serverOHTable, byte[] rawData)
{
// Add the debug information
Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R6");
// Verify MS-OXCROPS requirement: MS-OXCROPS_R6
Site.CaptureRequirementIfAreEqual<Type>(
typeof(ushort),
ropSize.GetType(),
6,
@"[In ROP Input and Output Buffers] RopSize (2 bytes): An unsigned integer.");
// Add the debug information
Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R11");
// Verify MS-OXCROPS requirement: MS-OXCROPS_R11
Site.CaptureRequirementIfAreEqual<Type>(
typeof(List<uint>),
serverOHTable.GetType(),
11,
@"[In ROP Input and Output Buffers] ServerObjectHandleTable (variable): An array of 32-bit values.");
int serverOHTableLength = serverOHTable.Count * sizeof(uint);
// The actual bytes count of ServerObjectHandleTable. RPC_HEADER_EXT_LEN:the length of RPC_HEADER_EXT
int actualsOHTableLength = rawData.Length - (ushort)ropSize - RPCHEADEREXTLEN;
// Add the debug information
Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R4675");
// Verify MS-OXCROPS requirement: MS-OXCROPS_R4675
Site.CaptureRequirementIfAreEqual<int>(
serverOHTableLength,
actualsOHTableLength,
4675,
@"[In ROP Input and Output Buffers] ServerObjectHandleTable (variable):The size of this field is equal to the number of bytes of data remaining in the ROP Input and Output Buffers after the RopsList field.");
// Mark byte count of ropList
ushort ropsBytesCount = 0;
foreach (byte[] bytes in ropList)
{
// Get byte count of ropList
ropsBytesCount += (ushort)bytes.Length;
}
// Add the debug information
Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R4673");
// Verify MS-OXCROPS requirement: MS-OXCROPS_R4673
Site.CaptureRequirementIfAreEqual<ushort>(
(ushort)ropSize,
(ushort)(ropsBytesCount + 2),
4673,
@"[In ROP Input and Output Buffers] RopsList (variable): The size of this field is 2 bytes less than the value specified in the RopSize field.");
// Add the debug information
Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R4671");
// Verify MS-OXCROPS requirement: MS-OXCROPS_R4671
Site.CaptureRequirementIfAreEqual<Type>(
typeof(byte[][]),
ropList.GetType(),
4671,
@"[In ROP Input and Output Buffers] RopsList (variable): For a ROP output buffer, this field contains an array of ROP response buffers.");
// Add the debug information
Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R3");
// Verify MS-OXCROPS requirement: MS-OXCROPS_R3
// If the previous requirements can be verified correctly, that is, the response message is parsed in little-endian byte order, this requirement can verified directly.
Site.CaptureRequirement(
3,
@"[In Messages] Unless otherwise specified, buffers and fields in this section are depicted in little-endian byte order.");
}
#endregion