Debian Codegraph @

plugins/wcx/sevenzip/src/platform/sevenziphlp.pas

raw
1 unit SevenZipHlp;
2
3 {$mode delphi}
4
5 interface
6
7 uses
8 Classes, SysUtils, ActiveX;
9
10 procedure VarStringClear(var PropVariant: TPropVariant);
11 function BinaryToUnicode(const bstrVal: TBstr): UnicodeString;
12
13 implementation
14
15 uses
16 Windows;
17
18 procedure VarStringClear(var PropVariant: TPropVariant);
19 begin
20 PropVariant.vt:= VT_EMPTY;
21 SysFreeString(PropVariant.bstrVal);
22 end;
23
24 function BinaryToUnicode(const bstrVal: TBstr): UnicodeString;
25 var
26 PropSize: Cardinal;
27 begin
28 PropSize:= SysStringByteLen(bstrVal);
29 SetLength(Result, PropSize div SizeOf(WideChar));
30 Move(bstrVal^, PWideChar(Result)^, PropSize);
31 end;
32
33 end.