The RtlInitString routine initializes a counted string of 8-bit characters.
VOID RtlInitString( _Out_ PSTRING DestinationString, _In_opt_ PCSZ SourceString );
A pointer to the STRING structure to be initialized. The Ntdef.h header file defines this structure to be identical to the ANSI_STRING structure.
A pointer to a null-terminated character string. This string is used to initialize the counted string pointed to by DestinationString.
This routine initializes a counted character string.
The routine copies the SourceString pointer value to the Buffer member of the STRING structure pointed to by DestinationString. The Length member of this structure is set to the length, in bytes, of the source string, excluding the terminating null. The MaximumLength member of the structure is set to the length, in bytes, of the source string, including the terminating null. If SourceString is NULL, Length and MaximumLength are both set to zero.
RtlInitString does not alter the source string pointed to by SourceString.
The RTL_CONSTANT_STRING macro creates a string or Unicode string structure to hold a counted string.
STRING RTL_CONSTANT_STRING( [in] PCSZ SourceString ); UNICODE_STRING RTL_CONSTANT_STRING( [in] PCWSTR SourceString );
RTL_CONSTANT_STRING returns either a string structure or Unicode string structure.
You can use RTL_CONSTANT_STRING to initialize global variables.
|Windows version||Available starting with Windows 2000. Available starting with Windows 2000.|
|Header||wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)|
|IRQL||See Remarks section.|