History:
Translation of IP_OPTION_INFORMATION32 and ICMP_ECHO_REPLY32 structures for a 64-bit compiler. I am stuck with using data types. Definitions of structures from a link:
Structure IP_OPTION_INFORMATION32:
typedef struct _IP_OPTION_INFORMATION32 { UCHAR Ttl; UCHAR Tos; UCHAR Flags; UCHAR OptionsSize; UCHAR * POINTER_32 OptionsData; } IP_OPTION_INFORMATION32, *PIP_OPTION_INFORMATION32;
I would translate this path (for Delphi XE2, 64-bit target platform). As you can see, I do not know what type to use for the OptionsData field of the structure:
IP_OPTION_INFORMATION32 = record Ttl: UCHAR; Tos: UCHAR; Flags: UCHAR; OptionsSize: UCHAR; OptionsData: // what should I use here for UCHAR * POINTER_32 ? end;
ICMP_ECHO_REPLY32 structure:
typedef struct icmp_echo_reply32 { IPAddr Address; ULONG Status; ULONG RoundTripTime; USHORT DataSize; USHORT Reserved; VOID * POINTER_32 Data; struct ip_option_information32 Options; } ICMP_ECHO_REPLY32, *PICMP_ECHO_REPLY32;
For a 64-bit target platform Delphi XE2 I would write:
ICMP_ECHO_REPLY32 = record Address: TIPAddr; // defined before Status: ULONG; RoundTripTime: ULONG; DataSize: USHORT; Reserved: USHORT; Data: // what should I use here for VOID * POINTER_32 ? Options: IP_OPTION_INFORMATION32; end;
Question:
How do you define the types UCHAR * POINTER_32 and VOID * POINTER_32 in Delphi for the target platform of a 64-bit platform? As far as I know, a 32-bit pointer type is available for the target platform of a 64-bit platform, and I just don’t like that it is defined, for example. as type Int32
What is the most accurate translation for these types?
source share