"\USER ", /\ Domain of user queue \/
"\NO "); /\ Allow pointer data \/
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
/\ If an exception occurred, the API would have returned the \/
/\ exception in the error code parameter. The bytes available \/
/\ field will be set to zero if no exception occurred and greater \/
/\ than zero if an exception did occur. \/
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
if (error_code.ec_fields.Bytes_Available > ð)
{
printf("ATTEMPT TO CREATE A USER QUEUE FAILED WITH EXCEPTION:%.7s",
error_code.ec_fields.Exception_Id);
exit(1);
}
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
/\ Send information to the queue. \/
/\ \/
/\ We will need to use MI instructions to accomplish this. \/
/\ There are three steps that must be done: \/
/\ \/
/\ 1. Resolve a system pointer to the library containing the user \/
/\ queue object. \/
/\ 2. Using the system pointer to the library, resolve a system \/
/\ pointer to user queue object in the library. \/
/\ 3. Enqueue the entry using the system pointer for the user \/
/\ queue. \/
/\ \/
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
/\ First we must resolve to library QUEUELIB. \/
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
memset(rslvsp_template.Obj.Name,' ',3ð);
memcpy(rslvsp_template.Obj.Name,"QUEUELIB",8);
rslvsp_template.Obj.Type_Subtype = _Library; /\ found in milib.h \/
rslvsp_template.Auth = _AUTH_NONE; /\ found in milib.h \/
_RSLVSP6(&queuelib_sysptr, /\ system pointer to be set \/
&rslvsp_template, /\ resolve template \/
&rslvsp_template.Auth); /\ authority to set in sysptr \/
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
/\ We can now resolve to the user queue object. We will pass the \/
/\ system pointer to library QUEUELIB to RSLVSP so the resolve \/
/\ will only search library QUEUELIB for the user queue object. \/
/\ This is necessary so that we ensure that we are using the \/
/\ correct object. \/
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
memset(rslvsp_template.Obj.Name,' ',3ð);
memcpy(rslvsp_template.Obj.Name, "EXAMPLEQ", 8);
rslvsp_template.Obj.Type_Subtype = _Usrq; /\ found in milib.h \/
rslvsp_template.Auth = _AUTH_ALL; /\ found in milib.h \/
_RSLVSP8(&user_queue_obj_sysptr, /\ system pointer to be set \/
&rslvsp_template, /\ resolve template \/
A-20 System API Programming V4R1