private uint GetCreatedFolderHandle(uint openedFolderHandle, int tempFolderIndex)
{
RopCreateFolderRequest createFolderRequest = new RopCreateFolderRequest();
RopCreateFolderResponse createFolderResponse;
createFolderRequest.RopId = (byte)RopId.RopCreateFolder;
createFolderRequest.LogonId = TestSuiteBase.LogonId;
createFolderRequest.InputHandleIndex = TestSuiteBase.InputHandleIndex0;
createFolderRequest.OutputHandleIndex = TestSuiteBase.OutputHandleIndex1;
createFolderRequest.FolderType = (byte)FolderType.Genericfolder;
createFolderRequest.UseUnicodeStrings = Convert.ToByte(TestSuiteBase.Zero);
createFolderRequest.OpenExisting = TestSuiteBase.NonZero;
createFolderRequest.Reserved = TestSuiteBase.Reserved;
// Set DisplayName, which specifies the name of the created folder.
createFolderRequest.DisplayName = Encoding.ASCII.GetBytes(TestSuiteBase.DisplayNameAndCommentForNonSearchFolder + tempFolderIndex + "\0");
// Set Comment, which specifies the folder comment that is associated with the created folder.
createFolderRequest.Comment = Encoding.ASCII.GetBytes(TestSuiteBase.DisplayNameAndCommentForNonSearchFolder + tempFolderIndex + "\0");
// Add the debug information
Site.Log.Add(LogEntryKind.Debug, "Begin to send the RopCreateFolder request in GetCreatedFolderHandle method.");
// Send the RopCreateFolder request to create folder.
this.responseSOHs = cropsAdapter.ProcessSingleRop(
createFolderRequest,
openedFolderHandle,
ref this.response,
ref this.rawData,
RopResponseType.SuccessResponse);
createFolderResponse = (RopCreateFolderResponse)response;
Site.Assert.AreEqual<uint>(
TestSuiteBase.SuccessReturnValue,
createFolderResponse.ReturnValue,
"if ROP succeeds, ReturnValue of its response will be 0 (success)");
// Get the handle of the created folder.
uint createdFolderHandle = responseSOHs[0][createFolderResponse.OutputHandleIndex];
return createdFolderHandle;
}