none
error return value in RopModifyRecipients RRS feed

  • Question

  • I try to create a new message,and I have complete the operation RopCreateMessage and set the mail body and mail subject by RopSetProperties,the above two command is successful and the return value are both 0.
    And then  I issue the RopModifyRecipients, referring to the example in section 4.7 of  [MS-OXCMSG] , and the example in section 4.4 of [MS-OXOMSG], however when I send the data buffer to the server by the interface EcDoRpcExt2,I get the return value 0x000004B6, according to [MS-OXCDATA] which is means RpcFormat (A badly formatted RPC buffer was detected).
    I have printed the data buffer and compared it to the two examples, I have found the structures are identical,except the account information.
    Would any one please tell me where the problem is? Have any one has successful add the recipient to a message referring the protocol example?
    Below is my code,if there are some errors you found ,please tell me. Thank you in advanced!

    //Code begin
     const int columnCount = 12; 
     int rowCount = 1;

     unsigned long recipientPropertyTags[columnCount];
     recipientPropertyTags[0] = 0x0FFE0003; //PidTagObjectType
     recipientPropertyTags[1] = 0x39000003; //PidTagDisplayType
     recipientPropertyTags[2] = 0x39FF001F; //PidTagAddressBookDisplayNamePrintable
     recipientPropertyTags[3] = 0x39FE001F; //PidTagSmtpAddress
     recipientPropertyTags[4] = 0x3A710003; //PidTagSendInternetEncoding
     recipientPropertyTags[5] = 0x39050003; //PidTagDisplayTypeEx
     recipientPropertyTags[6] = 0x5FF6001F; //PidTagRecipientDisplayName
     recipientPropertyTags[7] = 0x5FFD0003; //PidTagRecipientFlags
     recipientPropertyTags[8] = 0x5FFF0003; //PidTagRecipientTrackStatus
     recipientPropertyTags[9] = 0x5FDE0003; //PidTagRecipientResourceState
     recipientPropertyTags[10] = 0x5FDF0003; //PidTagRecipientOrder
     recipientPropertyTags[11] = 0x5FF70102; //PidTagRecipientEntryId

     ModifyRecipientRow recipientRow;    //self define struct, it include the beloe 4 fields
     recipientRow.rowId = 0x00000000;  // rowId is of type unsigned long
     recipientRow.recipientType = 0x01;  //recipientType  is of type unsigned char
     recipientRow.recipientRowSize = 0x010A;   //recipientRowSize  is of type unsigned short
     recipientRow.recipientRow = new unsigned char[recipientRow.recipientRowSize];   //recipientRow  is of type unsigned char*
     memset(recipientRow.recipientRow,0,recipientRow.recipientRowSize);

     int recipientRowPos = 0;     // use as a cursor in array recipientRow
     unsigned short recipientFlags = 0x0651;
     memcpy((void*)&recipientRow.recipientRow[recipientRowPos],&recipientFlags,2);

     recipientRowPos += 2;
     unsigned char addressPrefixUsed = 0x2A;  
     memcpy((void*)&recipientRow.recipientRow[recipientRowPos],&addressPrefixUsed,1);

     recipientRowPos += 1;
     unsigned char displayType = 0x00;
     memcpy((void*)&recipientRow.recipientRow[recipientRowPos],&displayType,1);

     recipientRowPos += 1;
     char* exchangeAddress = "huangjiang";
     int exchangeAddressLen = strlen(exchangeAddress) + 1;
     memcpy((void*)&recipientRow.recipientRow[recipientRowPos],(void*)exchangeAddress,exchangeAddressLen);

     recipientRowPos += exchangeAddressLen;
     wchar_t* displayName = L"huangjiang";
     int displayNameLen = wcslen(displayName) + 1;
     displayNameLen *= 2;
     memcpy((void*)&recipientRow.recipientRow[recipientRowPos],(void*)displayName,displayNameLen);

     recipientRowPos += displayNameLen;
     wchar_t* simpleDisplayName = L"huangjiang";
     int simpleDisplayNameLen = wcslen(simpleDisplayName) + 1;
     simpleDisplayNameLen *= 2;
     memcpy((void*)&recipientRow.recipientRow[recipientRowPos],(void*)simpleDisplayName,simpleDisplayNameLen);

     recipientRowPos += simpleDisplayNameLen;
     unsigned short recipintColumnCount = columnCount;
     memcpy((void*)&recipientRow.recipientRow[recipientRowPos],&recipintColumnCount,2);

     recipientRowPos += 2;
     unsigned char propertyRowFlag = 0x00;
     memcpy((void*)&recipientRow.recipientRow[recipientRowPos],&propertyRowFlag,1);

     recipientRowPos += 1;
     unsigned long pidTagObjectType_value = 0x00000006;
     memcpy((void*)&recipientRow.recipientRow[recipientRowPos],&pidTagObjectType_value,4);

     recipientRowPos += 4;
     unsigned long pidTagDisplayType_value = 0x00000000;
     memcpy((void*)&recipientRow.recipientRow[recipientRowPos],&pidTagDisplayType_value,4);

     recipientRowPos += 4;
     wchar_t* pidTag7BitDisplayName_value = L"huangjiang";
     int pidTag7BitDisplayName_len = wcslen(pidTag7BitDisplayName_value) + 1;
     pidTag7BitDisplayName_len *= 2;
     memcpy((void*)&recipientRow.recipientRow[recipientRowPos],(void*)pidTag7BitDisplayName_value,pidTag7BitDisplayName_len);

     recipientRowPos += pidTag7BitDisplayName_len;
     wchar_t* pidTagSmtpAddress_value = L"huangjiang@tuvabcd.com";
     int pidTagSmtpAddress_len = wcslen(pidTagSmtpAddress_value) + 1;
     pidTagSmtpAddress_len *= 2;
     memcpy((void*)&recipientRow.recipientRow[recipientRowPos],(void*)pidTagSmtpAddress_value,pidTagSmtpAddress_len);

     recipientRowPos += pidTagSmtpAddress_len;
     unsigned long pidTagSendInternetEncoding_value = 0x00000000;
     memcpy((void*)&recipientRow.recipientRow[recipientRowPos],&pidTagSendInternetEncoding_value,4);

     recipientRowPos += 4;
     unsigned long pidTagDisplayTypeEx_value = 0x40000000;
     memcpy((void*)&recipientRow.recipientRow[recipientRowPos],&pidTagDisplayTypeEx_value,4);

     recipientRowPos += 4;
     wchar_t* pidTagRecipientDisplayName_value = L"huangjiang";
     int pidTagRecipientDisplayName_len = wcslen(pidTagRecipientDisplayName_value) + 1;
     pidTagRecipientDisplayName_len *= 2;
     memcpy((void*)&recipientRow.recipientRow[recipientRowPos],(void*)pidTagRecipientDisplayName_value,pidTagRecipientDisplayName_len);

     recipientRowPos += pidTagRecipientDisplayName_len;
     unsigned long pidTagRecipientFlags_value = 0x00000001;
     memcpy((void*)&recipientRow.recipientRow[recipientRowPos],&pidTagRecipientFlags_value,4);

     recipientRowPos += 4;
     unsigned long pidTagRecipientTrackStatus_value = 0x00000000;
     memcpy((void*)&recipientRow.recipientRow[recipientRowPos],&pidTagRecipientTrackStatus_value,4);

     recipientRowPos += 4;
     unsigned long pidTagRecipientResourceState_value = 0x00000000;
     memcpy((void*)&recipientRow.recipientRow[recipientRowPos],&pidTagRecipientResourceState_value,4);

     recipientRowPos += 4;
     unsigned long pidTagRecipientOrder_value = 0x00000000;
     memcpy((void*)&recipientRow.recipientRow[recipientRowPos],&pidTagRecipientOrder_value,4);
     
     unsigned short entryIdSize = 0x0050;
     unsigned long entryIdFlag = 0x00000000;
     unsigned char entryIdProviderUid[16] = {0xDC,0xA7,0x40,0xC8,0xC0,0x42,0x10,0x1A,0xB4,0xB9,0x08,0x00,0x2B,0x2F,0xE1,0x82}; 
     unsigned long entryIdVersion = 0x00000001;
     unsigned long entryIdType = 0x00000000;
     char* entryIdX500dn = "/o=tuvabcd/ou=stuvwabcd/cn=Recipients/cn=huangjiang";
     int entryIdX500dnLen = strlen(entryIdX500dn) + 1; //include '\0'

     recipientRowPos += 4;
     memcpy((void*)&recipientRow.recipientRow[recipientRowPos],&entryIdSize,2);
     recipientRowPos += 2;
     memcpy((void*)&recipientRow.recipientRow[recipientRowPos],&entryIdFlag,4);
     recipientRowPos += 4;
     memcpy((void*)&recipientRow.recipientRow[recipientRowPos],(void*)entryIdProviderUid,16);
     recipientRowPos += 16;
     memcpy((void*)&recipientRow.recipientRow[recipientRowPos],&entryIdVersion,4);
     recipientRowPos += 4;
     memcpy((void*)&recipientRow.recipientRow[recipientRowPos],&entryIdType,4);
     recipientRowPos += 4;
     memcpy((void*)&recipientRow.recipientRow[recipientRowPos],entryIdX500dn,entryIdX500dnLen);


    then I header,ropSize,ropId,logonId,InputHandleIndex,ColumnsCount,RecipientsColumns(recipientPropertyTags),rowCount,and the recipientRow into the data buffer ,and sent to the server. I always received the error return value(000004B6).

    Thank you for reading such long question!

    • Edited by JacobHuang Friday, November 20, 2009 9:07 AM
    Thursday, November 19, 2009 7:22 AM

Answers

  • I know the what is the problem,Thanks for Tom  all the same.
    The problem is that the addressPrefixUsed must not contain the '\0', so the length should minus one.
    • Marked as answer by JacobHuang Tuesday, November 24, 2009 7:29 AM
    Tuesday, November 24, 2009 7:29 AM

All replies

  • JacobHuang,

    One of our engineers will be following up with you shortly in regards to this inquiry.

    Dominic Michael Salemno
    Senior Support Escalation Engineer
    US-CSS DSC Protocols Team
    Thursday, November 19, 2009 4:34 PM
  • Hi Jacob,

    Can you post a hex dump of the request buffer as the error code ecRpcFormat (0x000004B6) is pretty generic?


    Developer Consultant
    Thursday, November 19, 2009 4:59 PM
    Moderator
  • Hi,Tom below is the hex dump,Thank you in advanced!




    L0x00:  00 00 04 00 52 01 52 01 4A 01 0E 01 00 0C 00 03
    L0x01:  00 FE 0F 03 00 00 39 1F 00 FF 39 1F 00 FE 39 03
    L0x02:  00 71 3A 03 00 05 39 1F 00 F6 5F 03 00 FD 5F 03
    L0x03:  00 FF 5F 03 00 DE 5F 03 00 DF 5F 02 01 F7 5F 01
    L0x04:  00 00 00 00 00 01 0A 01 51 06 2A 00 68 75 61 6E
    L0x05:  67 6A 69 61 6E 67 00 68 00 75 00 61 00 6E 00 67
    L0x06:  00 6A 00 69 00 61 00 6E 00 67 00 00 00 68 00 75
    L0x07:  00 61 00 6E 00 67 00 6A 00 69 00 61 00 6E 00 67
    L0x08:  00 00 00 0C 00 00 06 00 00 00 00 00 00 00 68 00
    L0x09:  75 00 61 00 6E 00 67 00 6A 00 69 00 61 00 6E 00
    L0x0A:  67 00 00 00 68 00 75 00 61 00 6E 00 67 00 6A 00
    L0x0B:  69 00 61 00 6E 00 67 00 40 00 74 00 75 00 76 00
    L0x0C:  61 00 62 00 63 00 64 00 2E 00 63 00 6F 00 6D 00
    L0x0D:  00 00 00 00 00 00 00 00 00 40 68 00 75 00 61 00
    L0x0E:  6E 00 67 00 6A 00 69 00 61 00 6E 00 67 00 00 00
    L0x0F:  01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    L0x10:  50 00 00 00 00 00 DC A7 40 C8 C0 42 10 1A B4 B9
    L0x11:  08 00 2B 2F E1 82 01 00 00 00 00 00 00 00 2F 6F
    L0x12:  3D 74 75 76 61 62 63 64 2F 6F 75 3D 73 74 75 76
    L0x13:  77 61 62 63 64 2F 63 6E 3D 52 65 63 69 70 69 65
    L0x14:  6E 74 73 2F 63 6E 3D 68 75 61 6E 67 6A 69 61 6E
    L0x15:  67 00 E7 06 00 00 FF FF FF FF

    Friday, November 20, 2009 9:30 AM
  • Jacob,

    Thank you for the data. 

    I will be on holiday next week so I have asked Mark Miller from the Protocol Customer Support team to take on your issue in my absence. 

    Thanks!

    Developer Consultant
    Friday, November 20, 2009 7:38 PM
    Moderator
  • Tom ,
    Wish you have a happy holiday, looking forward to Mark 's reply.Thank you for your reply.

    Jacob
    Saturday, November 21, 2009 5:59 AM
  • I know the what is the problem,Thanks for Tom  all the same.
    The problem is that the addressPrefixUsed must not contain the '\0', so the length should minus one.
    • Marked as answer by JacobHuang Tuesday, November 24, 2009 7:29 AM
    Tuesday, November 24, 2009 7:29 AM
  • Jacob,

    Thank you for sharing this information back with the community. I am glad the problem has been resolved.

    Dominic Michael Salemno
    Senior Support Escalation Engineer
    US-CSS DSC Protocols Team
    Tuesday, November 24, 2009 3:40 PM