The ShortNameLength
member of FILE_BOTH_DIR_INFORMATION structure is declared as follows:
typedef struct FILE_BOTH_DIR_INFORMATION {
...
CCHAR ShortNameLength;
...
};
From the explanation of CCHAR
type, CCHAR
is a 8-bit Windows (ANSI) character. So, it is equivalent to AnsiChar
in Delphi, right? However, the description of ShortNameLength member of FILE_BOTH_DIR_INFORMATION
structure says,
“ShortNameLength
specifies the length, in bytes, of the short file name string.”
The statement makes me think that the CCHAR
equivalent is Byte
in Delphi. Another example is the NumberOfProcessors
member of SYSTEM_BASIC_INFORMATION
which is declared in winternl.h
as follows:
typedef struct _SYSTEM_BASIC_INFORMATION {
BYTE Reserved1[24];
PVOID Reserved2[4];
CCHAR NumberOfProcessors;
}
Once again, the CCHAR
type seems to be used in a Byte
context, rather than AnsiChar
context.
Now, I confuse, whether to use AnsiChar
or Byte
as a CCHAR
equivalent in Delphi.
Note
JwaWinType.pas
of JEDI Windows API declares CCHAR
as AnsiChar
.