# Declaring the structure in API call

**URL:** <https://clarionhub.com/t/declaring-the-structure-in-api-call/7137>\
**Category:** questions\
**Tags:** interop, winapi\
**Created:** [April 29, 2024, 1:11pm UTC](https://clarionhub.com/t/declaring-the-structure-in-api-call/7137 "2024-04-29T13:11:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![djordje.lazovic](https://clarionhub.com/user_avatar/clarionhub.com/djordje.lazovic/32/3676_2.png) [@djordje.lazovic](https://clarionhub.com/u/djordje.lazovic)\
**Post date:** [April 29, 2024, 1:11pm UTC](https://clarionhub.com/t/declaring-the-structure-in-api-call/7137/1 "2024-04-29T13:11:04Z")

</div>

How to declare PEID\_CERTIFICATE pData in API call where PEID\_CERTIFICATE is Pointer to a structure in the call

```auto
EID_MAX_Certificate = 2048
certificateType DWORD

EID_API int WINAPI EidReadCertificate(PEID_CERTIFICATE pData, int certificateType);

typedef struct tagEID_CERTIFICATE
{
	BYTE certificate[EID_MAX_Certificate];
	int certificateSize;
} EID_CERTIFICATE, *PEID_CERTIFICATE;

```

---

<div class="post-metadata">

**Author:** ![anon77170705](https://clarionhub.com/letter_avatar_proxy/v4/letter/a/ecccb3/32.png) [@anon77170705](https://clarionhub.com/u/anon77170705)\
**Post date:** [April 29, 2024, 2:25pm UTC](https://clarionhub.com/t/declaring-the-structure-in-api-call/7137/2 "2024-04-29T14:25:22Z")

</div>

```auto
EID_CERTIFICATE GROUP,TYPE
certificate BYTE,DIM(EID_MAX_Certificate)
certificateSize SIGNED
                 END

   MAP
     MODULE('')
        EidReadCertificate (*EID_CERTIFICATE, SIGNED),SIGNED,PROC,RAW,PASCAL
     END
   END

```

---

<div class="post-metadata">

**Author:** ![CarlBarnes](https://clarionhub.com/user_avatar/clarionhub.com/carlbarnes/32/1859_2.png) [@CarlBarnes](https://clarionhub.com/u/CarlBarnes)\
**Post date:** [April 29, 2024, 10:39pm UTC](https://clarionhub.com/t/declaring-the-structure-in-api-call/7137/3 "2024-04-29T22:39:13Z")

</div>

I would add TYPE to the label the way C prefixes with “tag”. Also labels of parameters so they appear with Intellisense. Added call code example. Did this on my phone so …

```auto
EID_MAX_Certificate Equate(2048)
EID_CERTIFICATE_type GROUP,TYPE
certificate BYTE,DIM(EID_MAX_Certificate)
certificateSize SIGNED
                 END

   MAP
     MODULE('')
        EidReadCertificate (*EID_CERTIFICATE_type pData, SIGNED certificateType),SIGNED,PROC,RAW,PASCAL,dll(1)
     END
   END

Blargggg Procedure()
EDIcert Like(EID_CERTIFICATE_type)
CertType Signed
RV Signed
  Code
  EDIcert.certificateSize = Size(EDIcert) !Wrong ?
  RV = EidReadCertificate( EDIcert, certType)

```

---

<div class="post-metadata">

**Author:** ![djordje.lazovic](https://clarionhub.com/user_avatar/clarionhub.com/djordje.lazovic/32/3676_2.png) [@djordje.lazovic](https://clarionhub.com/u/djordje.lazovic)\
**Post date:** [April 30, 2024, 9:51am UTC](https://clarionhub.com/t/declaring-the-structure-in-api-call/7137/4 "2024-04-30T09:51:46Z")

</div>

Dear also,

Thank you for your valuable and quick reply. I’ll now test it. Keep you posted.

Djordje

![](https://u28649609.ct.sendgrid.net/wf/open?upn=u001.tPWgSNNADGL3Hr9q8Ysj0RRWy-2Fqzszbe-2Fjl59rn6W-2BO-2BuPaft27i59hrKRZJKaH-2FLxxS3FSTCbtdDFZakZa8bW3NStuDPSuDkYiYMiAOL42fZvjwFicAc305Oy-2F4u5a9-2BIvtSvhQc4LDfRWL6hpY4lu7YHGLEOswGs81k4gRz-2F2yh-2FUM1cy0bc8KPBgzbQhJTLZTLxeCv9CKRT0rjBTUmd1j46de9dhKlFy7C2zZ6FZ-2BZhHUnj3HC-2F2NZm2GD50EKQJrynamZOoInxq3tmg4tw-3D-3D)

---

<div class="post-metadata">

**Author:** ![CarlBarnes](https://clarionhub.com/user_avatar/clarionhub.com/carlbarnes/32/1859_2.png) [@CarlBarnes](https://clarionhub.com/u/CarlBarnes)\
**Post date:** [April 30, 2024, 1:46pm UTC](https://clarionhub.com/t/declaring-the-structure-in-api-call/7137/5 "2024-04-30T13:46:01Z")

</div>

> [@CarlBarnes](#):
>
> `! No-> EDIcert.certificateSize = Size(EDIcert) `

I think that line is Not required.

That kind of Struct Size is always first. Read the documentation on this call. It probably is set to the number of the 2000 Bytes used.
