STRING structure (ntdef.h)

The ANSI_STRING structure defines a counted string used for ANSI strings.

Syntax

typedef struct _STRING {
  USHORT Length;
  USHORT MaximumLength;
  PCHAR  Buffer;
} STRING;

Members

Length

The length in bytes of the string stored in the buffer pointed to by Buffer.

MaximumLength

The length in bytes of the buffer pointed to by Buffer.

Buffer

Pointer to a buffer used to contain a string of characters.

Remarks

The 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.

Requirements

Requirement Value
Header ntdef.h (include Wdm.h, Ntddk.h)

See also

OEM_STRING

RtlAnsiStringToUnicodeSize

RtlAnsiStringToUnicodeString

RtlFreeAnsiString

RtlInitAnsiString

RtlUnicodeStringToAnsiSize

RtlUnicodeStringToAnsiString

UNICODE_STRING