如何定义和QUOT; UCHAR * POINTER_32"和"无效* POINTER_32"在德尔福类型?定义、类型、德尔福、UCHAR

2023-09-07 23:00:54 作者:﹏有一种放弃叫心如死水╮

翻译 IP_OPTION_INFORMATION32 和的 ICMP_ECHO_REPLY32 为64位编译我得到了stucked数据类型的结构使用那里。从参考结构的定义:

Translating the IP_OPTION_INFORMATION32 and ICMP_ECHO_REPLY32 structures for 64-bit compiler I got stucked with data types to use there. Structure definitions from the reference:

的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;

我会翻译这种方式(德尔福XE2,64位目标平台)。正如你所看到的,我不知道要用于结构的 OptionsData 字段是什么类型的:

I would translate this way (for Delphi XE2, 64-bit target platform). As you can see, I don't 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结构:

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;

有关德尔福XE2 64位目标平台,我会写:

For Delphi XE2 64-bit target platform 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;

问:

你如何定义的 UCHAR * POINTER_32 VOID * POINTER_32 类型在Delphi中的64位平台的目标?据我所知,目前还没有32位的指针类型可用于64位平台的目标,我只是不喜欢它是定义如作为的Int32 键入: - )

Question:

How would you define the UCHAR * POINTER_32 and VOID * POINTER_32 types in Delphi for 64-bit platform target ? As far as I know, there is no 32-bit pointer type available for 64-bit platform target and I just don't like it to be defined e.g. as a Int32 type :-)

什么是最precise翻译所提到的类型?

What is the most precise translation for the mentioned types ?

推荐答案

什么 POINTER_32 是覆盖在另一个堆栈溢出问题的问题:的