#ifndef _PHNT_NTDEF_H
#ifndef _NTDEF_
//
// Strings
//
typedef struct _STRING
{
    USHORT Length;
    USHORT MaximumLength;
    _Field_size_bytes_part_opt_(MaximumLength, Length) PCHAR Buffer;
} STRING, *PSTRING, ANSI_STRING, *PANSI_STRING, OEM_STRING, *POEM_STRING;
View code on GitHub// ntdef.h
typedef struct _STRING {
  USHORT Length;
  USHORT MaximumLength;
  PCHAR  Buffer;
} STRING;
View the official Win32 API reference// winternl.h
typedef struct _STRING {
  USHORT Length;
  USHORT MaximumLength;
  PCHAR  Buffer;
} STRING;
View the official Win32 API referenceThis structure is documented in Windows Driver Kit and in Windows SDK.
The ANSI_STRING structure defines a counted string used for ANSI strings.
LengthThe length in bytes of the string stored in the buffer pointed to by Buffer.
MaximumLengthThe length in bytes of the buffer pointed to by Buffer.
BufferPointer to a buffer used to contain a string of characters.
Buffer.size_isBuffer.size_is.MaximumLengthBuffer.length_isBuffer.length_is.LengthThe ANSI_STRING structure is used to pass ANSI strings. Use the RtlInitAnsiString routine to initialize an ANSI_STRING.
If the string is null-terminated, Length does not include the terminating NULL.
The MaximumLength is used to indicate the length of Buffer so that if the string is passed to a conversion routine such as RtlUnicodeStringToAnsiString the returned string does not exceed the buffer size.
Used with the RtlUnicodeStringToOemString function.
LengthThe length of the buffer.
MaximumLengthThe maximum length of the buffer.
BufferThe address of the buffer.
The data type used in the DestinationString parameter of the RtlUnicodeStringToOemString function,  POEM_STRING, is defined as:
typedef PSTRING POEM_STRING;