[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

1599.0. "Some trouble with the MCC_AES_CREATE" by BALZAC::MARKOWSKI () Fri Oct 04 1991 08:05

	Hello,

	I am trying to develop a AM with event management and a program
	that generates event and I have some problem using the 
	MCC_AES_CREATE function.
	I have some trouble with the .mcc_b_ver entry of a
        MCC_T_Descriptor.
	First of all, I would like to know what is the function of this
	data and what are the possible values.

	If I set this parameter to 0, MCC_AES_CREATE returns the following 
        error message :
		MCC_S_INV_DESC, invalid string descriptor encountered

	If I set this parameter to 1, I've an access violation.

	Any help would be very appreciated.

	sylviane.



	Here are pieces of my program (the one that does the MCC_EVENT_PUT).


   MCC_A_AES uaf_entity_spec;
   MCC_T_Descriptor uaf_instance_dsc;
   MCC_T_UNSLONG uaf_instance_wildtype;
   MCC_T_UNSLONG uaf_instance_class;
   MCC_T_SimpleName instance_name;
	.
	.       
	.
   MCC_T_CVR mcc_status;


   uaf_entity_spec = MCC_K_NULL_PTR;
   uaf_instance_class = MCC_K_CLASS_UAF;
   uaf_instance_wildtype = MCC_K_AES_NOT_WILD;

   instance_name.sn_b_type = MCC_K_SN_NORMAL;
   instance_name.sn_b_count = 7;
   strncpy(instance_name.sn_b_string,"ABCDEFG",7);

   uaf_instance_dsc.mcc_a_pointer = &instance_name;
   uaf_instance_dsc.mcc_w_curlen = 9;
   uaf_instance_dsc.mcc_w_maxstrlen = 9;
   uaf_instance_dsc.mcc_l_dt = MCC_K_DT_SIMPLE_NAME;
   uaf_instance_dsc.mcc_l_id = MCC_K_ATTR_UNAME;
   uaf_instance_dsc.mcc_b_dtype = DSC_K_DTYPE_T;
   uaf_instance_dsc.mcc_b_class = DSC_K_CLASS_S;
   uaf_instance_dsc.mcc_a_link = MCC_K_NULL_PTR;
   uaf_instance_dsc.mcc_b_flags = 0;
   uaf_instance_dsc.mcc_b_ver = 1;

   mcc_status = mcc_aes_create(&uaf_entity_spec,
			       &uaf_instance_class,
			       &uaf_instance_dsc,
			       &uaf_instance_wildtype);
   if (mcc_status != MCC_S_NORMAL) {
      printf("\nUAF_EVENT_PUT: mcc_create_aes failure ");
      exit(1);
   };   
T.RTitleUserPersonal
Name
DateLines
1599.1Init Entity Spec to NULLNANOVX::ROBERTSKeith Roberts - DECmcc Toolkit TeamFri Oct 04 1991 09:5022
> First of all, I would like to know what is the function of this
> data and what are the possible values... MCC Descriptor 'mcc_b_ver'

This field indicates the version number of the MCC Descriptor.
It should be set to MCC_K_VER_DESCRIPTOR.  Please use the literal and do
not use the constant 1.

> If I set this parameter to 1, I've an access violation.

You have set up everything correctly - except - the 'uaf_entity_spec'
should be initialized to MCC_K_NULL_PTR.  This is because the MCC_A_AES
type is defined as a pointer.  If the value is a NULL, then there is
no AES data defined yet.  If it is non-null, then it points to an existing
AES datatype.  Yours is non-null, and the AES routines follow the pointer
to an ACCVIO !!!

   MCC_A_AES uaf_entity_spec = MCC_K_NULL_PTR;

Good luck



1599.2It still doesn't work ...BALZAC::MARKOWSKIFri Oct 04 1991 10:5818
    
    RE: .1
    
    Hello,
    
    Thank's for your explanations and suggestions. I have followed them but
    I have still the same problem that is an access violation....
    Don't you think it could be a problem with the way I pass the
    parameters to MCC_AES_CREATE ?
    
    Best regards,
    
    sylviane.
    
    
    
    
         
1599.3Bad eyesNANOVX::ROBERTSKeith Roberts - DECmcc Toolkit TeamFri Oct 04 1991 12:037
You had already set the 'uaf_entity_spec' to a NULL - sorry, I didn't
see it before  8}

The rest of the code looks Ok.  You've setup the SimpleName correctly
(which most people don't!)  I can't think of anything else 

8(
1599.4Look someplace elseTOOK::GUERTINDon't fight fire with flamesFri Oct 04 1991 13:128
    Keith is right (as usual).  There is nothing wrong with the code you
    entered.  The problem is elsewhere.
    
    If you want proof, I actually compiled, linked and ran it with no problems!
    
    (I can post the log file if you wish.)
    
    -Matt.
1599.5MCC routines in main program ?BALZAC::MARKOWSKIFri Oct 04 1991 13:1413
        
	Hello,

	I have run my program as a main program (ie not as an AM) under debug 
	and found that the access violation happens in the routine 
	MCC_THREAD_DEFER_ALERT...

	The question is : Can I really call MCC_AES_CREATE and MCC_EVENT_PUT 
	in a program that is not an access module ?

	Thanks,

	Sylviane
1599.6Wait a minute. 1+1 <> 2 ??TOOK::GUERTINDon't fight fire with flamesFri Oct 04 1991 13:309
    I ran it using callable MCC (i.e, as main program), with no problems.
    
    What version of MCC are you running?  Can you give us a
    directory/date/size of sys$share:mcc_kernel_shr.exe?
    
    Is it possible to post the *entire* main module?
    
    -Matt.
    
1599.7Here's my log file...TOOK::GUERTINDon't fight fire with flamesFri Oct 04 1991 13:3290
$ type x.c
#include <mcc_interface_def.h>
#include <mcc_descrip.h>
#include <mcc_msg.h>
#include <stdio.h>

#define MCC_K_CLASS_UAF 1
#define MCC_K_ATTR_UNAME 2

int main()
{
   MCC_A_AES uaf_entity_spec;
   MCC_T_Descriptor uaf_instance_dsc;
   MCC_T_UNSLONG uaf_instance_wildtype;
   MCC_T_UNSLONG uaf_instance_class;
   MCC_T_SimpleName instance_name;
   MCC_T_CVR mcc_status;


   uaf_entity_spec = MCC_K_NULL_PTR;
   uaf_instance_class = MCC_K_CLASS_UAF;
   uaf_instance_wildtype = MCC_K_AES_NOT_WILD;

   instance_name.sn_b_type = MCC_K_SN_NORMAL;
   instance_name.sn_b_count = 7;
   strncpy(instance_name.sn_b_string,"ABCDEFG",7);

   uaf_instance_dsc.mcc_a_pointer = &instance_name;
   uaf_instance_dsc.mcc_w_curlen = 9;
   uaf_instance_dsc.mcc_w_maxstrlen = 9;
   uaf_instance_dsc.mcc_l_dt = MCC_K_DT_SIMPLE_NAME;
   uaf_instance_dsc.mcc_l_id = MCC_K_ATTR_UNAME;
   uaf_instance_dsc.mcc_b_dtype = DSC_K_DTYPE_T;
   uaf_instance_dsc.mcc_b_class = DSC_K_CLASS_S;
   uaf_instance_dsc.mcc_a_link = MCC_K_NULL_PTR;
   uaf_instance_dsc.mcc_b_flags = 0;
   uaf_instance_dsc.mcc_b_ver = 1;

   mcc_status = mcc_aes_create(&uaf_entity_spec,
			       &uaf_instance_class,
			       &uaf_instance_dsc,
			       &uaf_instance_wildtype);
   if (mcc_status != MCC_S_NORMAL) {
      printf("\nUAF_EVENT_PUT: mcc_create_aes failure ");
      exit(1);

   };   
}
$ cc/noopt/debug x.c
$ link/debug x.obj,sys$share:mcc_kernel_init.obj,sys$input:/opt
sys$share:mcc_kernel_shr.exe/share
sys$share:vaxcrtl.exe/share
^Z
$ run/debug x.exe

         VAX DEBUG Version V5.4-019

%DEBUG-I-INITIAL, language is C, module set to X
%DEBUG-I-NOTATMAIN, type GO to get to start of main program
%DEBUG-I-DEFKEY, DEFAULT key F17 has been defined
%DEBUG-I-DEFKEY, DEFAULT key F18 has been defined
%DEBUG-I-DEFKEY, DEFAULT key F19 has been defined
%DEBUG-I-DEFKEY, DEFAULT key F20 has been defined
DBG> Set Mode Screen; Set Step Nosource
DBG> g
 SRC: module X -scroll-source
  2019:
  2020:    mcc_status = mcc_aes_create(&uaf_entity_spec,
  2021:                                &uaf_instance_class,
  2022:                                &uaf_instance_dsc,
  2023:                                &uaf_instance_wildtype);
->2024:    if (mcc_status != MCC_S_NORMAL) {
  2025:       printf("\nUAF_EVENT_PUT: mcc_create_aes failure ");
  2026:       exit(1);
  2027:
  2028:    };
  2029: }
 OUT -output
stepped to X\main\%LINE 2015
stepped to X\main\%LINE 2016
stepped to X\main\%LINE 2017
stepped to X\main\%LINE 2018
stepped to X\main\%LINE 2023
stepped to X\main\%LINE 2024
X\main\mcc_status:      %MCC-S-NORMAL, normal successful completion
 PROMPT -error-program-prompt
DBG> Step
DBG> ex/cond mcc_status
DBG>  Exit
    
1599.8MCC_AES_CREATE works now !BALZAC::MARKOWSKIFri Oct 04 1991 13:5721
        
	RE: .7

	Hello,

	I've found my error looking at your log trace. The problem is in 
	the way I link my program :

		$ link/debug my_program,-
		             sys$input:/opt
			     sys$library:mcc_kernel_shr.exe/share

	I haven't specified : SYS$SHARE:MCC_KERNEL_INIT.OBJ ( and got no
	error at link ... ).

	Now it works !

	Thank's to all of you for help.

	sylviane.