Process Hacker Discussion Forum

 
Eko

Help with the code

23 Aug 2013 18:25

Hi,
I'm not a C language master, and so ran into trouble trying to figure PH code. I need help with structure field definition, particularly the one with the colon down there, I mark it with <=, what does it mean?
typedef struct _SECTION_IMAGE_INFORMATION
{
    PVOID TransferAddress;
    ULONG ZeroBits;
    SIZE_T MaximumStackSize;
    SIZE_T CommittedStackSize;
    ULONG SubSystemType;
    Union
    {
        struct
        {
            USHORT SubSystemMinorVersion;
            USHORT SubSystemMajorVersion;
        };
        ULONG SubSystemVersion;
    };
    ULONG GpValue;
    USHORT ImageCharacteristics;
    USHORT DllCharacteristics;
    USHORT Machine;
    BOOLEAN ImageContainsCode;
    Union
    {
        UCHAR ImageFlags;
        struct
        {
            UCHAR ComPlusNativeReady : 1; <= this and the next 5 members below
            UCHAR ComPlusILOnly : 1;
            UCHAR ImageDynamicallyRelocated : 1;
            UCHAR ImageMappedFlat : 1;
            UCHAR BaseBelow4gb : 1;
            UCHAR Reserved : 3;
        };
    };
    ULONG LoaderFlags;
    ULONG ImageFileSize;
    ULONG CheckSum;
SECTION_IMAGE_INFORMATION, *PSECTION_IMAGE_INFORMATION;
I need to port it for use with VB6 if possible, or VB.Net maybe. By the way, VB6 does not support structure union, so if any of you guys can help, please explain. One more thing, how many bits are there in a UCHAR anyway, I need to find a compatible type for this too :oops:

Any guidance or help is appreciated. Thanks.