I'm translating a C++ Windows API to a delphi *.pas file.
I have this C Struct returned by a function
typedef struct _WLAN_HOSTED_NETWORK_STATUS {
WLAN_HOSTED_NETWORK_STATE HostedNetworkState;
GUID IPDeviceID;
DOT11_MAC_ADDRESS wlanHostedNetworkBSSID;
DOT11_PHY_TYPE dot11PhyType;
ULONG ulChannelFrequency;
DWORD dwNumberOfPeers;
WLAN_HOSTED_NETWORK_PEER_STATE PeerList[1];
} WLAN_HOSTED_NETWORK_STATUS, *PWLAN_HOSTED_NETWORK_STATUS;
I translated to this:
type
_WLAN_HOSTED_NETWORK_STATUS = record
HostedNetworkState : WLAN_HOSTED_NETWORK_STATE;
IPDeviceID : GUID;
wlanHostedNetworkBSSID : DOT11_MAC_ADDRESS;
dot11PhyType : DOT11_PHY_TYPE;
ulChannelFrequency : ULONG;
dwNumberOfPeers : DWORD;
PeerList : Array [0..1] of WLAN_HOSTED_NETWORK_PEER_STATE;
end;
WLAN_HOSTED_NETWORK_STATUS = _WLAN_HOSTED_NETWORK_STATUS;
PWLAN_HOSTED_NETWORK_STATUS = _WLAN_HOSTED_NETWORK_STATUS;
but I not found on MSDN reference what is this GUID
type of IPDeviceID
it is a primitive type? how do I hold this value?
Remarks. A GUID is a 128-bit integer (16 bytes) that can be used across all computers and networks wherever a unique identifier is required. Such an identifier has a very low probability of being duplicated.
A GUID can be used for people, cars, files, webpages, colors, anything. With regular registration numbers, you start counting at 1 and numbers can overlap. Social Security Number 123-45-6789 is different from ISBN 123456789 which is different from barcode 123456789.
The globally unique identifier (GUID) data type in SQL Server is represented by the uniqueidentifier data type, which stores a 16-byte binary value. A GUID is a binary number, and its main use is as an identifier that must be unique in a network that has many computers at many sites.
Types and variants of GUIDs There are five different versions of GUIDs, most of which follow the RFC 4122 specification.
Global Unique Identification number show sources.
The Delphi equivalent is TGUID
.
The Delphi documentation contains some examples of how to use this type and its associated helper function.
GUID structure, also known as UUID, is a widely used 128-bit value type which represents globally unique identifiers.
typedef struct _GUID {
DWORD Data1;
WORD Data2;
WORD Data3;
BYTE Data4[8];
} GUID;
A quick check reveals that Delphi already has this type, named TGuid
in module System
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With