On Wed, 13 May 2009 08:06:03 -0500, Cristi Terpea <[email protected]> wrote:
>I tried using assembly code ( >https://ls2.cmich.edu/cgi-bin/wa?A2=ind9806&L=C370-L&P=968 ) to call it but >still I get a protection exception. > >I tested with: > >void main() { > SVC_REGISTER *r15 = NULL, *r00 = NULL, *r01; > char dsname[44] = "IBMUSER.TESTUP"; > char volume[6] = "S6SYS1"; > r01 = malloc(16); > memset(r01, 0, 16); > memcpy(r01, "\xc1\x00", 2); > r01 += 4; > r01 = (unsigned int*)dsname; > r01 += 4; > r01 = (unsigned int*)volume; > r01 += 4; > r01 = malloc(140); > CCasvc(27, r15, r00, r01); >} > >What am I doing wrong? I'm not completely sure, as I've never tried this in C/C++, but in part I think your problem is that you've lost the original value of r01 (from that malloc(16) call), which is what you need to pass to the OBTAIN SVC. Why don't you simply call an assembler subroutine and have it do an OBTAIN? Building SVC parameter lists "by hand" is both complex and very error-prone. -- Walt Farrell, CISSP IBM STSM, z/OS Security Design ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html

