#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 reference
This structure is documented in Windows Driver Kit and in Windows SDK.
The ANSI_STRING structure defines a counted string used for ANSI strings.
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.
Buffer.size_is
Buffer.size_is.MaximumLength
Buffer.length_is
Buffer.length_is.Length
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.
Used with the RtlUnicodeStringToOemString function.
Length
The length of the buffer.
MaximumLength
The maximum length of the buffer.
Buffer
The 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;