× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Thank you, Charles! Your explanation on *VARSIZE makes sense. Also, I had
tried previously to use literals in the hash call, but that gave a compiler
error. CONST solved that issue.

Also, thanks to Jon and Barbara for the explanations they provided!

- Dan

On Mon, Apr 2, 2018 at 9:41 AM, Charles Wilt <charles.wilt@xxxxxxxxx> wrote:

Dan,

The only parm you can legitimately use options(*VARSIZE) on is InputData
(if you'd decided to define it as char(16773000)) and ErrorCode

The key thing with options(*VARSIZE), is that there has to be some way for
the callee to know how much data was actually passed.

InputData has a matching length parm, LengthOfInputData. ErrorCode has a
structure in which the first 4 bytes tell the callee how much space is
available.

I'd do the PR like so:

dcl-pr hash extproc('Qc3CalculateHash');

InputData pointer value;

LengthOfInputData int( 10) const;
InputDataFormatName char( 8) const;
AlgorithmDescription char( 20) const;
AlgorithmDescriptionFormatName char( 8) const;
CryptographicServiceProvider char( 1) const;
CryptographicDeviceName char( 10) const;
Hash char( 16) ;
ErrorCode char( 300) options(*varsize);
end-pr;

You don't need any of the CONST, but I always use them to indicate which
parms are INPUT only. Plus they'd allow you to code the call like so

hash( %addr( DataToHash : *DATA) : inputlen: 'DATA0100':
QC3D0500: 'ALGD0500': cryptoserv:
cryptoDev: HashValue: errorCD);

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.