S
snowvalley
Unregistered / Unconfirmed
GUEST, unregistred user!
请问如何转换如下C结构体和共享体到Delphi机构体和共享体?谢谢!
struct __PACKET_BUFFER__
{
BYTE Status;
BYTE AclType;
BYTE NetType;
BYTE TimeType;
ULONG AclId;
union
{
struct
{
USHORT TcpCode : 6;
USHORT Reserved : 10;
};
struct
{
USHORT TcpFin : 1;
USHORT TcpSyn : 1;
USHORT TcpRst : 1;
USHORT TcpPsh : 1;
USHORT TcpAck : 1;
USHORT TcpUrg : 1;
USHORT Direction : 1; // 0: IN, 1: OUT
USHORT SendOrRecv : 1;
USHORT Action : 8;
};
};
BYTE bReserved[2];
BYTE Protocol;
BYTE Week;
BYTE IcmpType;
BYTE IcmpSubType;
ULONG Time;
ULONG SourceIp;
ULONG DestinationIp;
union
{
ULONG Id;
struct
{
ULONG SourcePort : 16;
ULONG DestinationPort : 16;
};
};
ULONG DataBytes;
ULONG ProcessHandle;
char sProcess[16];
};
///////////////////////////////////////////////////////////////////////////////[]
struct __PACKET_DIRECTION__
{
ULONG Id;
struct
{
BYTE Direction : 4;
BYTE Action : 4;
};
BYTE NetType;
struct
{
BYTE AclType : 4;
BYTE Reserved : 2;
BYTE DeleteIn : 1;
BYTE DeleteOut: 1;
};
BYTE Protocol;
ULONG AclId;
ULONG Time;
ULONG ProcessHandle;
ULONG SendData;
ULONG RecvData;
ULONG LocalIp;
ULONG RemoteIp;
USHORT LocalPort;
USHORT RemotePort;
char sProcess[16];
};
struct __PACKET_BUFFER__
{
BYTE Status;
BYTE AclType;
BYTE NetType;
BYTE TimeType;
ULONG AclId;
union
{
struct
{
USHORT TcpCode : 6;
USHORT Reserved : 10;
};
struct
{
USHORT TcpFin : 1;
USHORT TcpSyn : 1;
USHORT TcpRst : 1;
USHORT TcpPsh : 1;
USHORT TcpAck : 1;
USHORT TcpUrg : 1;
USHORT Direction : 1; // 0: IN, 1: OUT
USHORT SendOrRecv : 1;
USHORT Action : 8;
};
};
BYTE bReserved[2];
BYTE Protocol;
BYTE Week;
BYTE IcmpType;
BYTE IcmpSubType;
ULONG Time;
ULONG SourceIp;
ULONG DestinationIp;
union
{
ULONG Id;
struct
{
ULONG SourcePort : 16;
ULONG DestinationPort : 16;
};
};
ULONG DataBytes;
ULONG ProcessHandle;
char sProcess[16];
};
///////////////////////////////////////////////////////////////////////////////[]
struct __PACKET_DIRECTION__
{
ULONG Id;
struct
{
BYTE Direction : 4;
BYTE Action : 4;
};
BYTE NetType;
struct
{
BYTE AclType : 4;
BYTE Reserved : 2;
BYTE DeleteIn : 1;
BYTE DeleteOut: 1;
};
BYTE Protocol;
ULONG AclId;
ULONG Time;
ULONG ProcessHandle;
ULONG SendData;
ULONG RecvData;
ULONG LocalIp;
ULONG RemoteIp;
USHORT LocalPort;
USHORT RemotePort;
char sProcess[16];
};