I'm trying to create this structure in Golang -
typedef struct FILE_ID_DESCRIPTOR {
DWORD dwSize;
FILE_ID_TYPE Type;
union {
LARGE_INTEGER FileId;
GUID ObjectId;
FILE_ID_128 ExtendedFileId;
} DUMMYUNIONNAME;
} FILE_ID_DESCRIPTOR, *LPFILE_ID_DESCRIPTOR;
As you can see, this depends on union of three in which unknown is FILE_ID_128
and another structure called FILE_ID_TYPE
so I stumbled upon this, which is FILE_ID_128
s and the _FILE_ID_TYPE
structure is here and here
typedef enum _FILE_ID_TYPE {
FileIdType,
ObjectIdType,
ExtendedFileIdType,
MaximumFileIdType
} FILE_ID_TYPE, *PFILE_ID_TYPE;
And doing after doing some research, I found out that enum is const in Go but in Go, we can not have a named const so maybe a struct(?) and union are byte slices. But I could not find what MaximumFileIdType
meant and how to implement that in Go. Thanks in advance.
Also, reference that I am following.