annulla
Visualizzazione dei risultati per 
Cerca invece 
Intendevi dire: 

pointer to a 32 byte buffer

Dear GerdW,
 
As u told i changed bATRLen as input. But still reports same buffer error.
 
Mathan
0 Kudos
Messaggio 11 di 33
2.546Visualizzazioni
Hi mathan,

why do you wire 255 to the bPTRLen input, when 32 would be ok? But I guess this is probably not the source of the problem...

As I only seldomly use DLLs, my knowledge comes to an end hereSmiley Triste
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Messaggio 12 di 33
2.542Visualizzazioni

Hai GerdW,

Sorry for disturbing you again and again.

The output ATR array becomes 0 since it was initialized. Will it be a problem? As per the configuration of dll, the ATR input should be - pointer to a 32 byte buffer.

Thanks,

Mathan

Note: Learning new things will give experience and that is the starting point of our knowledge and it never ends....

0 Kudos
Messaggio 13 di 33
2.540Visualizzazioni
Hi Mathan,

arrays will always handed over to the dll by a pointer (it's done in the call configuration). That's why you should provide this U8 array of length 32...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Messaggio 14 di 33
2.523Visualizzazioni

Dear GerdW,

So you are telling this....

For ATRlen input, i have to give 32 as input and it should be configured as U32 and passed as pointer to value.

For ATR input, i have to use "initialize array" with 32 as dimension size, 0 as input element and output of "init array" was given as input to ATR input of dll. ATR was configured as array with U8 data and passed as array data pointer with minimum length as ATRlength.

Am i correct? any modifications required?

Thanks,

Mathan

0 Kudos
Messaggio 15 di 33
2.518Visualizzazioni
Hi Mathan,

PTR is given as U8 array of length 32, as you already did.
PTRLen should be given as value, not as pointer to value - MSDN is describing it as "DWord". (Scalar values are usually given as value, not as reference/pointer to value...)

As I wrote before I'm not a dll guru. That's how I would do it...


Message Edited by GerdW on 05-05-2008 02:08 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Messaggio 16 di 33
2.514Visualizzazioni

Thanks GerdW,

I will try as per ur suggestion and update you the status little later.

Thanks

Mathan

0 Kudos
Messaggio 17 di 33
2.507Visualizzazioni
In this case, as well as the previous case, your fundamental problem is not undestanding data types. You are trying to call Windows API functions. MSDN clearly spells out the prototypes for those functions, and you can also find out what all these "DWORD", "LPTSRT", and "LPDWORD" types are. "LPDWORD" is a pointer to a DWORD. From MSDN:
pcbAtrLen

On input, supplies the length of the pbAtr buffer. On output, receives the number of bytes in the ATR string (32 bytes maximum). If this buffer length is specified as SCARD_AUTOALLOCATE, then pbAtr is converted to a pointer to a byte pointer, and it receives the address of a block of memory that contains the multiple-string structure.


Thus, the function is expecting a pointer to an integer so that it can write the actual number of bytes that it wrote to the pbAtr buffer that you should be supplying to the function.
Messaggio 18 di 33
2.489Visualizzazioni

Dear smercurio,

I got understand about datatypes clearly now. Still i need some clarifications.

As you told, how to specify buffer length as scard_autoallocate?

For pbAtr, "init array with 32 as dimension size and zero as element" can be given as input?

 

Thanks,

Mathan

0 Kudos
Messaggio 19 di 33
2.468Visualizzazioni

Dear GerdW,

In MSDN,


pbAtr
[out] Pointer to a 32-byte buffer that receives the ATR string from the currently inserted card, if available.
pbcAtrLen
[out] Pointer to a DWORD to receive the number of bytes in the ATR string (32 bytes maximum).


So pbAtrLen is a "pointer to value" only i think as smercurio told.

0 Kudos
Messaggio 20 di 33
2.467Visualizzazioni