ANSI_STRING to String/PChar
Delphi-Quellcode:
var A: PANSI_STRING;
S: AnsiString;
P: PAnsiChar;
SetString(S, A.Buffer, A.Length);
P := PAnsiChar(S);
ANSI_STRING are not terminated with #0
[add]
Length = current length of the string
MaximumLength = maximum size of the buffer
see at
ANSI_STRING