David, thanks, will try again tomorrow.

Does it perhaps want to factor differently? Perhaps something more like 

(*extern "OS" entryPoint)(const char *);

or something? Otherwise aren't you saying that the pointer itself is extern?

Don't let me confuse the issue -- it is not CSRSI that I am calling. Header
for CSRSI is in SYS1.SAMPLIB somewhere but is printed in the callable
services manual. They have something they call csrsi_byaddr that looks
exactly like what I am trying to accomplish but it is bracketed with #ifndef
__cplusplus which is what leads me to think that perhaps this linkage is not
supported for C++.

No, have not taken the XPLINK leap. One of these days.

Charles

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On
Behalf Of David Crayford
Sent: Monday, July 16, 2012 7:17 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: How call from C++ thru function pointer to assembler?

extern "OS" (*entryPoint)(const char *) is the correct declaration for C++.

I have called OS linkage functions from the CVT in C++ without problems. 
Where is the header file for CSRSI?

Are you XPLINK?


On 17/07/2012 10:10 AM, Charles Mills wrote:
> Another way of saying what I am trying to do is what you do if you are 
> calling from C++ any MVS callable service or something like that using 
> the pointer somewhere off of the CVT.
>
> Looking at the header file for CSRSI it looks like perhaps you can't 
> do it from C++.
>
> Charles
>
> -----Original Message-----
> From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] 
> On Behalf Of Charles Mills
> Sent: Monday, July 16, 2012 5:14 PM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: How call from C++ thru function pointer to assembler?
>
> Does anyone know the answer to this?
>
> I have an assembler function whose address I know at run-time in C++. 
> I define and store it like this
>
> void __cdecl (*entryPoint)(const char *); entryPoint = (void (__cdecl 
> *)(const char *))(myVoidStar); printf("entryPoint is %p\n", 
> entryPoint);
>
> Printf prints the correct address (DFFD058, FWIW) so I am good so far.
>
> I then call it with
> (entryPoint)(record);
>
> and I end up S0C6ing out in the weeds at 27F5023B.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to