+ SysUnicodeStringToNtStr() helper

git-svn-id: branches/cpstrrtl@25040 -
This commit is contained in:
Jonas Maebe 2013-07-04 22:28:05 +00:00
parent 2e9b642a3b
commit fd0a2ac365

View File

@ -372,6 +372,17 @@ begin
aNtStr.Buffer[i] := aText[i];
end;
procedure SysUnicodeStringToNtStr(var aNtStr: TNtUnicodeString; const s: UnicodeString);
var
i: Integer;
begin
aNtStr.Length := Length(s) * SizeOf(WideChar);
aNtStr.MaximumLength := aNtStr.Length;
aNtStr.Buffer := GetMem(aNtStr.Length);
if aNtStr.Length<>0 then
Move(s[1],aNtStr.Buffer[0],aNtStr.Length);
end;
procedure SysFreeNtStr(var aNtStr: TNtUnicodeString);
begin
if aNtStr.Buffer <> Nil then begin