Previous Next

ANSI_STRING

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

typedef struct _STRING {
  USHORT  Length;
  USHORT  MaximumLength;
  PCHAR  Buffer;
} ANSI_STRING *PANSI_STRING;

Members

Length
The length in bytes of the string stored in Buffer.
MaximumLength
The maximum length in bytes of Buffer.
Buffer
Pointer to a buffer used to contain a string of characters.

Headers

Defined in ntdef.h. Include wdm.h or ntddk.h.

Comments

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

See Also

OEM_STRING, UNICODE_STRING, RtlAnsiStringToUnicodeSize, RtlAnsiStringToUnicodeString, RtlFreeAnsiString, RtlInitAnsiString, RtlUnicodeStringToAnsiSize, RtlUnicodeStringToAnsiString