Welcome Guest.

1Answers

C method of defining C language structure

Asked by: Marilyn King 8 views IT March 18, 2023

The definition of unicode_string in the

Windows kernel is as follows:

TypeDef Struct_Unicode_String {

Ushort length;

USHORT MAXIMLENGTH;

#IFDEF MIDL_PASS

[SIZE_IS (Maximumlength/2), Length_is ((Length)/2)] ushort * buffer;

#Else // Midl_pass

, Length) pwch buffer;

What is the definition method?Why is there such a long string before the variable type, how do you understand?

1 Answers

  1. +4Votes  

    This_Field_SIZ360 Questions and Answers E_bytes_P Iron Tingu Lun Dou Dou Dou Dou Late ART_OPT_ is also a macro. Define the factional rate in no_sal2.h. It is actually an empty macro

    #Define_Field_SIZE_PART_OP T_ (S, C)

    So

    _Fie Live Mixing Li Yu Guard Number LD_SIZE_BYTES_PART_PT_ (Maximumlength, LENGTH) Pwch buff changes to Ya YingEr;

    equivalent to

    Pwch Buffer Auto;

    As for why it is so defined, the most likely reason is that it is compatible with history orThe future version (the first person to write may be the source of the heart of the heart).Can it be defined like this?How to understand

    from unknown

    Griffiths- March 18, 2023 |