2 * PROJECT: ReactOS Zip Shell Extension
3 * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4 * PURPOSE: zip pidl handling
5 * COPYRIGHT: Copyright 2017 Mark Jansen (mark.jansen@reactos.org)
10 LPITEMIDLIST
_ILCreate(ZipPidlType Type
, LPCSTR lpString
, unz_file_info64
& info
)
12 int cbData
= sizeof(ZipPidlEntry
) + strlen(lpString
);
13 ZipPidlEntry
* pidl
= (ZipPidlEntry
*)SHAlloc(cbData
+ sizeof(WORD
));
17 ZeroMemory(pidl
, cbData
+ sizeof(WORD
));
20 pidl
->MagicType
= 'z';
23 if (Type
!= ZIP_PIDL_DIRECTORY
)
25 pidl
->CompressedSize
= info
.compressed_size
;
26 pidl
->UncompressedSize
= info
.uncompressed_size
;
27 pidl
->DosDate
= info
.dosDate
;
28 pidl
->Password
= info
.flag
& 1;
31 strcpy(pidl
->Name
, lpString
);
32 *(WORD
*)((char*)pidl
+ cbData
) = 0;
34 return (LPITEMIDLIST
)pidl
;
38 const ZipPidlEntry
* _ZipFromIL(LPCITEMIDLIST pidl
)
40 const ZipPidlEntry
* zipPidl
= (const ZipPidlEntry
*)pidl
;
41 if (zipPidl
->MagicType
== 'z')