Microsoft.Protocols.TestSuites.MS_OXCPERM.MS_OXCPERMAdapter.CreateMessageByLogonUser C# (CSharp) Method

CreateMessageByLogonUser() public method

Create a new message in the mail box folder of the user configured by "AdminUserName" by the logon user.
public CreateMessageByLogonUser ( ) : uint
return uint
        public uint CreateMessageByLogonUser()
        {
            RopCreateMessageRequest createMessageRequest = new RopCreateMessageRequest();
            RopCreateMessageResponse createMessageResponse;
            createMessageRequest.RopId = 0x06; // RopId 0x06 indicates RopCreateMessage
            createMessageRequest.LogonId = 0x00; // The logonId 0x00 is associated with this operation.
            createMessageRequest.InputHandleIndex = 0x00; // This index specifies the location 0x00 in the Server Object Handle Table where the handle for the input Server Object is stored. 
            createMessageRequest.OutputHandleIndex = 0x01; // This index specifies the location 0x01 in the Server Object Handle Table where the handle for the output Server Object is stored. 
            createMessageRequest.CodePageId = 0x0FFF; // Code page of Logon object is used
            createMessageRequest.FolderId = this.ropLogonResponse.FolderIds[4]; // Create a message in INBOX which root is mailbox 
            createMessageRequest.AssociatedFlag = 0x00; // NOT an FAI message
            this.responseSOHs = this.DoRopCall(createMessageRequest, this.inobjHandle, ref this.response, ref this.rawData);
            createMessageResponse = (RopCreateMessageResponse)this.response;
            if (UINT32SUCCESS != createMessageResponse.ReturnValue)
            {
                return createMessageResponse.ReturnValue;
            }

            uint targetMessageHandle = this.responseSOHs[0][createMessageResponse.OutputHandleIndex];

            RopSaveChangesMessageRequest saveChangesMessageRequest;
            RopSaveChangesMessageResponse saveChangesMessageResponse;
            saveChangesMessageRequest.RopId = 0x0C; // RopId 0x0C indicates RopSaveChangesMessage
            saveChangesMessageRequest.LogonId = 0x00; // The logonId 0x00 is associated with this operation.
            saveChangesMessageRequest.InputHandleIndex = 0x00; // This index specifies the location 0x00 in the Server Object Handle Table where the handle for the input Server Object is stored. 
            saveChangesMessageRequest.ResponseHandleIndex = 0x01; // This index specifies the location 0x01 in the Server Object Handle Table where the handle for the output Server Object is stored. 
            saveChangesMessageRequest.SaveFlags = 0x0C; // ForceSave
            this.DoRopCall(saveChangesMessageRequest, targetMessageHandle, ref this.response, ref this.rawData);
            saveChangesMessageResponse = (RopSaveChangesMessageResponse)this.response;

            if (saveChangesMessageResponse.ReturnValue == UINT32SUCCESS)
            {
                if (this.currentLogonUser == this.User2)
                {
                    this.messageIdsCreatedByOther.Add(saveChangesMessageResponse.MessageId);
                }
                else
                {
                    this.ownedMessageIds.Add(saveChangesMessageResponse.MessageId);
                }
            }

            // RopRelease created message 
            this.ReleaseObject(targetMessageHandle);

            return UINT32SUCCESS;
        }
MS_OXCPERMAdapter