[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference azur::mcc

Title:DECmcc user notes file. Does not replace IPMT.
Notice:Use IPMT for problems. Newsletter location in note 6187
Moderator:TAEC::BEROUD
Created:Mon Aug 21 1989
Last Modified:Wed Jun 04 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:6497
Total number of notes:27359

2252.0. "mcc_mir_read_attr_data problem" by HLRG02::STEEG (DECmcc PABX AM development) Mon Feb 03 1992 06:27

Hello,

I have the following problem with using the mcc_mir_read_attr_data routine.

I create a descriptor with maxstrlen = 1000.
Then I call the mcc_mir_read_attr_data routine.
	The returned status = MCC_S_NORMAL , but
	the curlen is now 1146.

But the SRM says: 
	If not enough output buffer space is passed, this routine will return
	an error condition value of MCC_S_INSUFBUFFER with the correct lenght
	in the return length field. 

Is this a known bug or do I something wrong.
At the end of this note I add some code.

I am using DECmcc V1.1 on a VS3100-32Mb


Regards,
	Henk.


--------------------------------------------------------------------------------

  attributes=malloc(1000);

 /* create descriptor for list of status attributes */
  if(status == MCC_S_NORMAL)
   {
     attributes_dsc.mcc_b_dtype = DSC_K_DTYPE_BU;
     attributes_dsc.mcc_b_class = DSC_K_CLASS_S;
     attributes_dsc.mcc_a_pointer = attributes;
     attributes_dsc.mcc_w_maxstrlen = 1000;
     attributes_dsc.mcc_w_curlen = 0;
     attributes_dsc.mcc_l_dt = MCC_K_DT_UNSIGNED8;
     attributes_dsc.mcc_b_flags = 0;
     attributes_dsc.mcc_b_ver = 1;
     attributes_dsc.mcc_a_link = MCC_K_NULL_PTR;
   }

  /* create handle necessary for get value of attribute */
  if(status == MCC_S_NORMAL)
     status = mcc_ahs_create(&pabxacc_attr_handle);

  /* get attributes list from private attribute repository */
  if(status == MCC_S_NORMAL)
     status = mcc_mir_read_attr_data( &pabxacc_attr_rep_id,
                                      &pabxacc_mir_instance_key,
                                      &MCC_K_ATTR_PRT_STATUS,
                                      pabxacc_attr_handle,
                                      &attributes_dsc,
                                      MCC_K_NULL_PTR,
                                      MCC_K_NULL_PTR,
                                      &MCC_K_NULL_PTR,
                                      &MCC_K_NULL_PTR);
printf("***\n");
printf("STATUS = %d\n",status);
printf("attributes_dsc.mcc_w_curlen = %d\n",attributes_dsc.mcc_w_curlen);
printf("***\n");


-------------------------------------------------------------------------------

The output of the printf's is:


***
STATUS = 52854793
attributes_dsc.mcc_w_curlen = 1146
***
T.RTitleUserPersonal
Name
DateLines
2252.1Nope. Never saw that one before.TOOK::GUERTINDon't fight fire with flamesMon Feb 03 1992 08:067
    Is the actual length really 1146 bytes long?  Or is that a garbage
    value?
    
    But the way the last two arguments must pass the address 0
    (MCC_K_NULL_PTR) by VALUE, not by reference.
    
    -Matt.
2252.2more infoHLRG02::STEEGDECmcc PABX AM developmentMon Feb 03 1992 09:029
Hi Matt

	1146 bytes is the real length, but this value is variable.


	
Thanks for quick reply

-Henk.
2252.3Well, I couldn;t wait any longer, so I tried it...TOOK::GUERTINDon't fight fire with flamesMon Feb 03 1992 14:237
    Hey! You found a bug.  On a MCC_MIR_READ_ATTR_DATA() call, Class S
    descriptors do not return MCC_S_INSUFBUFFER!  Just before returning
    from the routine, the CVR get over-written with MCC_S_NORMAL.  Sorry
    about that.  Class-D descriptors work as advertised.  I will QAR this.
    Thanks, and sorry for the screw up.
    
    -Matt.