[RAPPS] Replace Extract with FDI for handling .cab

FDI allows to have user-defined callbacks for file handling.
Since it doesn't provide support for Unicode we convert strings to
multi-byte UTF-8 and handle them appropriately in the callbacks. They
are properly null-terminated so FDI won't choke when doing operations
with strings.

Thanks to hbelusca and mjansen for the help.

CORE-14466
This commit is contained in:
Alexander Shaposhnikov 2018-02-25 15:20:00 +02:00
parent 602db40277
commit 9591550116
No known key found for this signature in database
GPG key ID: 2BC6459908479EFC
7 changed files with 348 additions and 90 deletions

View file

@ -14,12 +14,16 @@ VOID ShowPopupMenu(HWND hwnd, UINT MenuID, UINT DefaultItem);
BOOL StartProcess(ATL::CStringW &Path, BOOL Wait);
BOOL StartProcess(LPWSTR lpPath, BOOL Wait);
BOOL GetStorageDirectory(ATL::CStringW &lpDirectory);
BOOL ExtractFilesFromCab(LPCWSTR lpCabName, LPCWSTR lpOutputPath);
VOID InitLogs();
VOID FreeLogs();
BOOL WriteLogMessage(WORD wType, DWORD dwEventID, LPCWSTR lpMsg);
BOOL GetInstalledVersion(ATL::CStringW *pszVersion, const ATL::CStringW &szRegName);
BOOL ExtractFilesFromCab(const ATL::CStringW& szCabName,
const ATL::CStringW& szCabDir,
const ATL::CStringW& szOutputDir);
class CConfigParser
{
// Locale names cache