类似如下 ".h" 文件:系统版本不同,结构体的 大小、内容 可能是不同的。在 Delphi 下如何实现????#define RASENTRYA struct tagRASENTRYA
RASENTRYA
{
.....#if (WINVER >= 0x401)
//
// Multilink
//
DWORD dwSubEntries;
DWORD dwDialMode;
DWORD dwDialExtraPercent;
DWORD dwDialExtraSampleSeconds;
DWORD dwHangUpExtraPercent;
DWORD dwHangUpExtraSampleSeconds;
//
// Idle timeout
//
DWORD dwIdleDisconnectSeconds;
#endif#if (WINVER >= 0x500) //
// Entry Type
//
DWORD dwType; //
// Encryption type
//
DWORD dwEncryptionType; //
// CustomAuthKey to be used for EAP
//
DWORD dwCustomAuthKey; //
// Guid of the connection
//
GUID guidId; //
// Custom Dial Dll
//
CHAR szCustomDialDll[MAX_PATH]; //
// DwVpnStrategy
//
DWORD dwVpnStrategy;
#endif#if (WINVER >= 0x501)
//
// More RASEO_* options
//
DWORD dwfOptions2; //
// For future use
//
DWORD dwfOptions3; CHAR szDnsSuffix[RAS_MaxDnsSuffix]; DWORD dwTcpWindowSize; CHAR szPrerequisitePbk[MAX_PATH]; CHAR szPrerequisiteEntry[RAS_MaxEntryName + 1]; DWORD dwRedialCount; DWORD dwRedialPause;
#endif
//
// PPP/IPv6
//
#if (WINVER >= 0x600)
RASIPV6ADDR ipv6addrDns;
RASIPV6ADDR ipv6addrDnsAlt;
DWORD dwIPv4InterfaceMetric;
DWORD dwIPv6InterfaceMetric;
#endif
};
RASENTRYA
{
.....#if (WINVER >= 0x401)
//
// Multilink
//
DWORD dwSubEntries;
DWORD dwDialMode;
DWORD dwDialExtraPercent;
DWORD dwDialExtraSampleSeconds;
DWORD dwHangUpExtraPercent;
DWORD dwHangUpExtraSampleSeconds;
//
// Idle timeout
//
DWORD dwIdleDisconnectSeconds;
#endif#if (WINVER >= 0x500) //
// Entry Type
//
DWORD dwType; //
// Encryption type
//
DWORD dwEncryptionType; //
// CustomAuthKey to be used for EAP
//
DWORD dwCustomAuthKey; //
// Guid of the connection
//
GUID guidId; //
// Custom Dial Dll
//
CHAR szCustomDialDll[MAX_PATH]; //
// DwVpnStrategy
//
DWORD dwVpnStrategy;
#endif#if (WINVER >= 0x501)
//
// More RASEO_* options
//
DWORD dwfOptions2; //
// For future use
//
DWORD dwfOptions3; CHAR szDnsSuffix[RAS_MaxDnsSuffix]; DWORD dwTcpWindowSize; CHAR szPrerequisitePbk[MAX_PATH]; CHAR szPrerequisiteEntry[RAS_MaxEntryName + 1]; DWORD dwRedialCount; DWORD dwRedialPause;
#endif
//
// PPP/IPv6
//
#if (WINVER >= 0x600)
RASIPV6ADDR ipv6addrDns;
RASIPV6ADDR ipv6addrDnsAlt;
DWORD dwIPv4InterfaceMetric;
DWORD dwIPv6InterfaceMetric;
#endif
};
{$else}
{$endif}
{$ifdef xxx}
{$else}
{$endif}
之前,要获取版本信息,如何在 语句 "R??? = packed record" 之前来做 获取版本信息的动作 ,并且 {$define xxx} ???