/// <summary> /// Verify the response by sending the ROP RopIdFromLongTermId /// </summary> /// <param name="request">The structure of ROP RopIdFromLongTermId request.</param> /// <param name="response">The structure of ROP RopIdFromLongTermId response.</param> private void VerifyRopIdFromLongTermId(RopIdFromLongTermIdRequest request, RopIdFromLongTermIdResponse response) { if (response.ReturnValue == 0) { ulong globalCounter = 0; for (int i = 0; i < 6; i++) { globalCounter += ((ulong)request.LongTermId.GlobalCounter[i]) << (i * 8); } globalCounter = globalCounter << 16; // The last 2 bytes of the Folder ID or Message ID are not fixed. ulong maskedObjectId = response.ObjectId & ~(ulong)0xFFFF; // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCSTOR_R59721"); // If the returned ObjectId is associated with the requested GlobalCounter, indicates the ROP's functionality is consistent with its description. this.Site.CaptureRequirementIfAreEqual<ulong>( globalCounter, maskedObjectId, 59721, @"[in RopIdFromLongTermId ROP] The RopIdFromLongTermId ROP ([MS-OXCROPS] section 2.2.3.9) is used to obtain the Folder ID or Message ID, as specified in [MS-OXCDATA] sections 2.2.4.1 or 2.2.4.2, given the LongTermID, as specified in [MS-OXCDATA] section 2.2.1.3.1."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCSTOR_R458"); // Verify MS-OXCSTOR requirement: MS-OXCSTOR_R458 this.Site.CaptureRequirementIfAreEqual<ulong>( globalCounter, maskedObjectId, 458, @"[In RopIdFromLongTermId ROP Success Response Buffer] ObjectId: Contains the Folder ID or Message ID, as specified in [MS-OXCDATA] sections 2.2.1.1 or 2.2.1.2, that is mapped from the given LongTermID as specified in [MS-OXCDATA] section 2.2.1.3.1."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCSTOR_R459"); // Verify MS-OXCSTOR requirement: MS-OXCSTOR_R459 // The underlying structure for LongTermId is parsed as structure as REPLGUID(128-bit) with the specified sequence, if GlobalCounter is associated with the given short-term ID,this requirement can be verified. Site.CaptureRequirementIfAreEqual<ulong>( globalCounter, maskedObjectId, 459, @"[In RopIdFromLongTermId ROP Success Response Buffer] ObjectId: The Folder ID or Message ID is a 64-bit value composed of the 16-bit replica ID (REPLID) followed by the 48-bit global counter portion of the given LongTermID."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCSTOR_R1253"); // Verify MS-OXCSTOR requirement: MS-OXCSTOR_R1253 this.Site.CaptureRequirementIfAreEqual<ulong>( globalCounter, maskedObjectId, 1253, @"[In Receiving a RopIdFromLongTermId ROP Request] The Folder ID or Message ID consists of the 16-bit REPLID followed by the 48-bit global counter portion of the given LongTermID."); } }
/// <summary> /// Convert longTermId to id. /// </summary> /// <param name="serverId">server id.</param> /// <param name="longTermId">longTerm id.</param> /// <returns>Converted short term id.</returns> private ulong GetIdFromLongTerm(int serverId, LongTermId longTermId) { RopIdFromLongTermIdRequest ropIdFromLongTermRequest = new RopIdFromLongTermIdRequest(); RopIdFromLongTermIdResponse ropIdFromLongTermResponse = new RopIdFromLongTermIdResponse(); ropIdFromLongTermRequest.RopId = 0x44; ropIdFromLongTermRequest.LogonId = 0x00; ropIdFromLongTermRequest.InputHandleIndex = 0x00; ropIdFromLongTermRequest.LongTermId = longTermId; ropIdFromLongTermResponse = (RopIdFromLongTermIdResponse)this.Process(serverId, ropIdFromLongTermRequest, this.logonHandleOut); return ropIdFromLongTermResponse.ObjectId; }
/// <summary> /// Get the object ID form specified LongTermId. /// </summary> /// <param name="longTermID">The specified LongTermID.</param> /// <param name="logonHandle">The logon handle.</param> /// <returns>Return the object ID that mapping with specified LongTermID.</returns> protected ulong GetObjectIdFormLongTermID(LongTermId longTermID, uint logonHandle) { RopIdFromLongTermIdRequest ropIdFromLongTermIdRequest = new RopIdFromLongTermIdRequest() { RopId = (byte)RopId.RopIdFromLongTermId, LogonId = CommonLogonId, InputHandleIndex = CommonInputHandleIndex, LongTermId = longTermID, }; this.ResponseSOHs = this.MSOXCMSGAdapter.DoRopCall(ropIdFromLongTermIdRequest, logonHandle, ref this.response, ref this.rawData, GetPropertiesFlags.None); RopIdFromLongTermIdResponse ropIdFromLongTermIdResponse = (RopIdFromLongTermIdResponse)this.response; Site.Assert.AreEqual<uint>(TestSuiteBase.Success, ropIdFromLongTermIdResponse.ReturnValue, "Call RopIdFromLongTermId should be success."); return ropIdFromLongTermIdResponse.ObjectId; }