mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-19 21:19:31 +02:00
+ SysUnicodeStringToNtStr() helper
git-svn-id: branches/cpstrrtl@25040 -
This commit is contained in:
parent
2e9b642a3b
commit
fd0a2ac365
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user