* Dec C; System Services question....
@ 2000-10-04 4:00 atadashi
2000-10-04 4:00 ` antonio.carlini
0 siblings, 1 reply; 2+ messages in thread
From: atadashi @ 2000-10-04 4:00 UTC (permalink / raw)
Well. I've just about exhausted all my resources. So, as a last
resort I'm posing this question to this newsgroup.
I'm using the System Services routines,
specifically, "SYS$DEVICE_SCAN", from DEC C to locate disk drives on
the current node. I'm running DEC C v5.7-004 on OpenVMS Alpha v7.2-1.
Here is a snipet of the source code:
(The call to the system service...)
if ((iStatus = sys$device_scan(&sReturn_DevName,
&iRetDevNamLength,
&sSearch_DevName,
stItemList,
&stContext)) == SS$_NORMAL)
where parm1 and parm3 are:
struct dsc$descriptor_s sReturn_DevName, sSearch_DevName;
and...
sReturn_DevName.dsc$w_length = iMaxDevNameSize;
sReturn_DevName.dsc$b_dtype = DSC$K_DTYPE_T;
sReturn_DevName.dsc$b_class = DSC$K_CLASS_S;
sReturn_DevName.dsc$a_pointer = sRetDevName;
sSearch_DevName.dsc$w_length = iMaxDevNameSize;
sSearch_DevName.dsc$b_dtype = DSC$K_DTYPE_T;
sSearch_DevName.dsc$b_class = DSC$K_CLASS_S;
sSearch_DevName.dsc$a_pointer = sSearchDevice;
where:
const short int iMaxDevNameSize = 64;
and...
char sSearchDevice[iMaxDevNameSize],
sRetDevName[iMaxDevNameSize];
where parm2 is,
unsigned short int iStatus,
iRetDevNamLength;
where parm4 is,
ILE3 stItemList[2] = {
{ 4, DVS$_DEVCLASS, &iItemCode, iZERO },
{ iZERO, iZERO, iZERO, iZERO }
};
and...
ILE3 is the __NEW_STARLET typedef for an Item_List_3 struct
and...
unsigned long int iItemCode;
and...
DVS$_DEVCLASS is the device class in DVSDEF.H
where parm5 is,
GENERIC_64 stContext; /* __NEW_STARLET union within struct... */
stContext.gen64$q_quadword = iZERO;
Through a FORIEGN command, I am passing the argument for the disk
device as a quoted string, "$1$DUA*";
sprintf(sSearchDevice, "%s", argv[iCount - iONE) ;
The code compiles properly, links properly and runs properly but only
returns an iStatus of 2648 (SS$_NOMOREDEV - no device was found). So,
the call is working but the device search criteria does not seem to be
correct.
The system call documentation indicates the search criteria can be
based on name (string with all relevant wildcards) or device class, or
device type. In my test, I have done just the name string, the name
string AND the device class (disk), and I have altered the command line
argument string as, "DSA*", "DUA*", "$1$DUA*", and "$1$DUA" (...like
you would use with, SHOW DEVICE DUA, to see all dua disk devices)
without success.
If anyone out there has used this system service, could you please help
me?
Thanks.
Sent via Deja.com http://www.deja.com/
Before you buy.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Dec C; System Services question....
2000-10-04 4:00 Dec C; System Services question atadashi
@ 2000-10-04 4:00 ` antonio.carlini
0 siblings, 0 replies; 2+ messages in thread
From: antonio.carlini @ 2000-10-04 4:00 UTC (permalink / raw)
atadashi@my-deja.com wrote:
>
> Well. I've just about exhausted all my resources. So, as a last
> resort I'm posing this question to this newsgroup.
> I'm using the System Services routines,
> specifically, "SYS$DEVICE_SCAN", from DEC C to locate disk drives on
> the current node. I'm running DEC C v5.7-004 on OpenVMS Alpha v7.2-1.
> Here is a snipet of the source code:
Never, ever supply a small complete example of compilable code
that demonstrates the problem. Support people absolutely hate this,
they just love to have to turn your text into compilable code
by hand over several iterations :-)
[snip uncopilable stuff ...]
> where parm4 is,
> ILE3 stItemList[2] = {
> { 4, DVS$_DEVCLASS, &iItemCode, iZERO },
> { iZERO, iZERO, iZERO, iZERO }
> };
> and...
> unsigned long int iItemCode;
you left out "is apparently uninitialised" although since
there doesn't seem to be a complete example it is hard to tell
for sure :-)
> The code compiles properly, links properly and runs properly but only
> returns an iStatus of 2648 (SS$_NOMOREDEV - no device was found). So,
> the call is working but the device search criteria does not seem to be
> correct.
iItemCode almost certainly had junk in it ...
> If anyone out there has used this system service, could you please help
> me?
If the above doesn't sort you out, post a *small* example
that fails (it doesn't need all the fancy command line
parsing stuff ... just hard code the search string to "*"
and don't bother displaying output .. .that's what DEBUG is for).
Antonio
---------------
Antonio Carlini arcarlini@iee.org
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2000-10-04 4:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-10-04 4:00 Dec C; System Services question atadashi
2000-10-04 4:00 ` antonio.carlini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox