diff --git a/dll/shellext/zipfldr/CConfirmReplace.cpp b/dll/shellext/zipfldr/CConfirmReplace.cpp index 8ee027a52ec..bf2c3f836e6 100644 --- a/dll/shellext/zipfldr/CConfirmReplace.cpp +++ b/dll/shellext/zipfldr/CConfirmReplace.cpp @@ -10,10 +10,9 @@ class CConfirmReplace : public CDialogImpl { private: - CStringA m_Filename; + CStringW m_Filename; public: - - CConfirmReplace(const char* filename) + CConfirmReplace(LPCWSTR filename) : m_Filename(filename) { } @@ -25,9 +24,9 @@ public: HICON hIcon = LoadIcon(NULL, IDI_EXCLAMATION); SendDlgItemMessage(IDC_EXCLAMATION_ICON, STM_SETICON, (WPARAM)hIcon); - CStringA message; + CStringW message; message.FormatMessage(IDS_OVERWRITEFILE_TEXT, m_Filename.GetString()); - ::SetDlgItemTextA(m_hWnd, IDC_MESSAGE, message); + ::SetDlgItemTextW(m_hWnd, IDC_MESSAGE, message); return TRUE; } @@ -50,10 +49,9 @@ public: END_MSG_MAP() }; - -eZipConfirmResponse _CZipAskReplace(HWND hDlg, PCSTR FullPath) +eZipConfirmResponse _CZipAskReplaceW(HWND hDlg, LPCWSTR FullPath) { - PCSTR Filename = PathFindFileNameA(FullPath); + PCWSTR Filename = PathFindFileNameW(FullPath); CConfirmReplace confirm(Filename); INT_PTR Result = confirm.DoModal(hDlg); switch (Result) diff --git a/dll/shellext/zipfldr/CEnumZipContents.cpp b/dll/shellext/zipfldr/CEnumZipContents.cpp index 0899468f9d7..febc202ee8c 100644 --- a/dll/shellext/zipfldr/CEnumZipContents.cpp +++ b/dll/shellext/zipfldr/CEnumZipContents.cpp @@ -14,14 +14,14 @@ class CEnumZipContents : private: CZipEnumerator mEnumerator; DWORD dwFlags; - CStringA m_Prefix; + CStringW m_Prefix; public: CEnumZipContents() :dwFlags(0) { } - STDMETHODIMP Initialize(IZip* zip, DWORD flags, const char* prefix) + STDMETHODIMP Initialize(IZip* zip, DWORD flags, LPCWSTR prefix) { dwFlags = flags; m_Prefix = prefix; @@ -41,7 +41,7 @@ public: if (celt != 1) return E_FAIL; - CStringA name; + CStringW name; bool dir; unz_file_info64 info; if (mEnumerator.next_unique(m_Prefix, name, dir, info)) @@ -55,7 +55,7 @@ public: } STDMETHODIMP Skip(ULONG celt) { - CStringA name; + CStringW name; bool dir; unz_file_info64 info; while (celt--) @@ -88,7 +88,7 @@ public: }; -HRESULT _CEnumZipContents_CreateInstance(IZip* zip, DWORD flags, const char* prefix, REFIID riid, LPVOID * ppvOut) +HRESULT _CEnumZipContents_CreateInstance(IZip* zip, DWORD flags, LPCWSTR prefix, REFIID riid, LPVOID * ppvOut) { return ShellObjectCreatorInit(zip, flags, prefix, riid, ppvOut); } diff --git a/dll/shellext/zipfldr/CZipEnumerator.hpp b/dll/shellext/zipfldr/CZipEnumerator.hpp index 9948413d908..90a4c52c5ea 100644 --- a/dll/shellext/zipfldr/CZipEnumerator.hpp +++ b/dll/shellext/zipfldr/CZipEnumerator.hpp @@ -10,7 +10,7 @@ struct CZipEnumerator private: CComPtr m_Zip; bool m_First; - CAtlList m_Returned; + CAtlList m_Returned; public: CZipEnumerator() :m_First(true) @@ -33,32 +33,32 @@ public: return true; } - bool next_unique(const char* prefix, CStringA& name, bool& folder, unz_file_info64& info) + bool next_unique(LPCWSTR prefix, CStringW& name, bool& folder, unz_file_info64& info) { - size_t len = strlen(prefix); - CStringA tmp; - while (next(tmp, info)) + size_t len = wcslen(prefix); + CStringW tmpW; + while (next(tmpW, info)) { - if (!_strnicmp(tmp, prefix, len)) + if (!_wcsnicmp(tmpW, prefix, len)) { - int pos = tmp.Find('/', len); + int pos = tmpW.Find(L'/', len); if (pos < 0) { - name = tmp.Mid(len); + name = tmpW.Mid(len); folder = false; } else { - name = tmp.Mid(len, pos - len); + name = tmpW.Mid(len, pos - len); folder = true; } - tmp = name; - tmp.MakeLower(); + tmpW = name; + tmpW.MakeLower(); - POSITION it = m_Returned.Find(tmp); + POSITION it = m_Returned.Find(tmpW); if (!name.IsEmpty() && !it) { - m_Returned.AddTail(tmp); + m_Returned.AddTail(tmpW); return true; } } @@ -66,7 +66,7 @@ public: return false; } - bool next(CStringA& name, unz_file_info64& info) + bool next(CStringW& name, unz_file_info64& info) { int err; @@ -84,10 +84,18 @@ public: err = unzGetCurrentFileInfo64(uf, &info, NULL, 0, NULL, 0, NULL, 0); if (err == UNZ_OK) { - PSTR buf = name.GetBuffer(info.size_filename); - err = unzGetCurrentFileInfo64(uf, NULL, buf, name.GetAllocLength(), NULL, 0, NULL, 0); - name.ReleaseBuffer(info.size_filename); - name.Replace('\\', '/'); + CStringA nameA; + PSTR buf = nameA.GetBuffer(info.size_filename); + err = unzGetCurrentFileInfo64(uf, NULL, buf, nameA.GetAllocLength(), NULL, 0, NULL, 0); + nameA.ReleaseBuffer(info.size_filename); + nameA.Replace('\\', '/'); + + WCHAR wide_name[MAX_PATH]; + if (info.flag & MINIZIP_UTF8_FLAG) + MultiByteToWideChar(CP_UTF8, 0, nameA, -1, wide_name, _countof(wide_name)); + else + MultiByteToWideChar(CP_ACP, 0, nameA, -1, wide_name, _countof(wide_name)); + name = wide_name; } return err == UNZ_OK; } diff --git a/dll/shellext/zipfldr/CZipExtract.cpp b/dll/shellext/zipfldr/CZipExtract.cpp index 20a8087a029..cf2be75a903 100644 --- a/dll/shellext/zipfldr/CZipExtract.cpp +++ b/dll/shellext/zipfldr/CZipExtract.cpp @@ -257,7 +257,7 @@ public: LRESULT OnPassword(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) { CStringA Password; - if (_CZipAskPassword(m_hWnd, NULL, Password) == eAccept) + if (_CZipAskPasswordW(m_hWnd, NULL, Password) == eAccept) { *m_pPassword = Password; } @@ -370,10 +370,10 @@ public: eZipExtractError ExtractSingle( HWND hDlg, - LPCSTR FullPath, + LPCWSTR WideFullPath, bool is_dir, unz_file_info64* Info, - CStringA Name, + CStringW WideName, CStringA Password, bool* bOverwriteAll, const bool* bCancel, @@ -383,7 +383,7 @@ public: int err; BYTE Buffer[2048]; DWORD dwFlags = SHPPFW_DIRCREATE | (is_dir ? SHPPFW_NONE : SHPPFW_IGNOREFILENAME); - HRESULT hr = SHPathPrepareForWriteA(hDlg, NULL, FullPath, dwFlags); + HRESULT hr = SHPathPrepareForWriteW(hDlg, NULL, WideFullPath, dwFlags); if (FAILED_UNEXPECTEDLY(hr)) { *ErrorCode = hr; @@ -415,7 +415,7 @@ public: } } } - Response = _CZipAskPassword(hDlg, Name, Password); + Response = _CZipAskPasswordW(hDlg, WideName, Password); } while (Response == eAccept); if (Response == eSkip) @@ -439,7 +439,8 @@ public: return eOpenError; } - HANDLE hFile = CreateFileA(FullPath, GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); + HANDLE hFile; + hFile = CreateFileW(WideFullPath, GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile == INVALID_HANDLE_VALUE) { DWORD dwErr = GetLastError(); @@ -448,7 +449,8 @@ public: bool bOverwrite = *bOverwriteAll; if (!*bOverwriteAll) { - eZipConfirmResponse Result = _CZipAskReplace(hDlg, FullPath); + eZipConfirmResponse Result; + Result = _CZipAskReplaceW(hDlg, WideFullPath); switch (Result) { case eYesToAll: @@ -467,7 +469,7 @@ public: if (bOverwrite) { - hFile = CreateFileA(FullPath, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + hFile = CreateFileW(WideFullPath, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile == INVALID_HANDLE_VALUE) { dwErr = GetLastError(); @@ -482,7 +484,7 @@ public: if (hFile == INVALID_HANDLE_VALUE) { unzCloseCurrentFile(uf); - DPRINT1("ERROR, CreateFileA: 0x%x (%s)\n", dwErr, *bOverwriteAll ? "Y" : "N"); + DPRINT1("ERROR, CreateFile: 0x%x (%s)\n", dwErr, *bOverwriteAll ? "Y" : "N"); *ErrorCode = dwErr; return eFileError; } @@ -493,9 +495,9 @@ public: if (*bCancel) { CloseHandle(hFile); - BOOL deleteResult = DeleteFileA(FullPath); + BOOL deleteResult = DeleteFileW(WideFullPath); if (!deleteResult) - DPRINT1("ERROR, DeleteFileA: 0x%x\n", GetLastError()); + DPRINT1("ERROR, DeleteFile: 0x%x\n", GetLastError()); return eExtractAbort; } @@ -575,13 +577,13 @@ public: Progress.SendMessage(PBM_SETRANGE32, 0, gi.number_entry); Progress.SendMessage(PBM_SETPOS, 0, 0); - CStringA BaseDirectory = m_Directory; - CStringA Name; + CStringW BaseDirectory = m_Directory; + CStringW WideName; CStringA Password = m_Password; unz_file_info64 Info; int CurrentFile = 0; bool bOverwriteAll = false; - while (zipEnum.next(Name, Info)) + while (zipEnum.next(WideName, Info)) { if (*bCancel) { @@ -589,14 +591,14 @@ public: return false; } - bool is_dir = Name.GetLength() > 0 && Name[Name.GetLength()-1] == '/'; + bool is_dir = WideName.GetLength() > 0 && WideName[WideName.GetLength()-1] == '/'; - char CombinedPath[MAX_PATH * 2] = { 0 }; - PathCombineA(CombinedPath, BaseDirectory, Name); - CStringA FullPath = CombinedPath; - FullPath.Replace('/', '\\'); /* SHPathPrepareForWriteA does not handle '/' */ + WCHAR CombinedPath[MAX_PATH * 2] = { 0 }; + PathCombineW(CombinedPath, BaseDirectory, WideName); + CStringW WideFullPath = CombinedPath; + WideFullPath.Replace(L'/', L'\\'); /* SHPathPrepareForWriteA does not handle '/' */ Retry: - eZipExtractError Result = ExtractSingle(hDlg, FullPath, is_dir, &Info, Name, Password, &bOverwriteAll, bCancel, &err); + eZipExtractError Result = ExtractSingle(hDlg, WideFullPath, is_dir, &Info, WideName, Password, &bOverwriteAll, bCancel, &err); if (Result != eDirectoryError) CurrentFile++; switch (Result) @@ -613,13 +615,13 @@ public: case eDirectoryError: { - char StrippedPath[MAX_PATH] = { 0 }; + WCHAR StrippedPath[MAX_PATH] = { 0 }; - StrCpyNA(StrippedPath, FullPath, _countof(StrippedPath)); + StrCpyNW(StrippedPath, WideFullPath, _countof(StrippedPath)); if (!is_dir) - PathRemoveFileSpecA(StrippedPath); - PathStripPathA(StrippedPath); - if (ShowExtractError(hDlg, (LPCSTR)&StrippedPath, err, eDirectoryError) == IDRETRY) + PathRemoveFileSpecW(StrippedPath); + PathStripPathW(StrippedPath); + if (ShowExtractError(hDlg, StrippedPath, err, eDirectoryError) == IDRETRY) goto Retry; Close(); return false; @@ -627,7 +629,7 @@ public: case eFileError: { - int Result = ShowExtractError(hDlg, FullPath, err, eFileError); + int Result = ShowExtractError(hDlg, WideFullPath, err, eFileError); switch (Result) { case IDABORT: @@ -649,7 +651,7 @@ public: Info.compression_method != Z_DEFLATED && Info.compression_method != Z_BZIP2ED) { - if (ShowExtractError(hDlg, FullPath, Info.compression_method, eOpenError) == IDYES) + if (ShowExtractError(hDlg, WideFullPath, Info.compression_method, eOpenError) == IDYES) break; } Close(); @@ -665,11 +667,11 @@ public: return true; } - int ShowExtractError(HWND hDlg, LPCSTR path, int Error, eZipExtractError ErrorType) + int ShowExtractError(HWND hDlg, LPCWSTR path, int Error, eZipExtractError ErrorType) { - CStringA strTitle(MAKEINTRESOURCEW(IDS_ERRORTITLE)); - CStringA strErr, strText; - PSTR Win32ErrorString; + CStringW strTitle(MAKEINTRESOURCEW(IDS_ERRORTITLE)); + CStringW strErr, strText; + PWSTR Win32ErrorString; if (ErrorType == eFileError || ErrorType == eOpenError) strText.LoadString(IDS_CANTEXTRACTFILE); @@ -680,9 +682,9 @@ public: if (ErrorType == eFileError || HRESULT_FACILITY(Error) == FACILITY_WIN32) { - if (FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, + if (FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, ErrorType == eFileError ? Error : HRESULT_CODE(Error), 0, - (PSTR)&Win32ErrorString, 0, NULL) != 0) + (PWSTR)&Win32ErrorString, 0, NULL) != 0) { strErr.SetString(Win32ErrorString); LocalFree(Win32ErrorString); @@ -693,7 +695,7 @@ public: else if (strErr.GetLength() == 0) strErr.Format(IDS_UNKNOWNERROR, Error); - strText.Append("\r\n\r\n" + strErr); + strText.Append(L"\r\n\r\n" + strErr); UINT mbFlags = MB_ICONWARNING; if (ErrorType == eDirectoryError) @@ -703,7 +705,7 @@ public: else if (ErrorType == eOpenError) mbFlags |= MB_YESNO; - return MessageBoxA(hDlg, strText, strTitle, mbFlags); + return MessageBoxW(hDlg, strText, strTitle, mbFlags); } }; diff --git a/dll/shellext/zipfldr/CZipFolder.hpp b/dll/shellext/zipfldr/CZipFolder.hpp index 29644d95c2b..c38b41d58f7 100644 --- a/dll/shellext/zipfldr/CZipFolder.hpp +++ b/dll/shellext/zipfldr/CZipFolder.hpp @@ -37,7 +37,7 @@ class CZipFolder : public IZip { CStringW m_ZipFile; - CStringA m_ZipDir; + CStringW m_ZipDir; CComHeapPtr m_CurDir; unzFile m_UnzipFile; @@ -158,9 +158,9 @@ public: return GetDisplayNameOf(pidl, 0, &psd->str); case 1: /* Type */ { - SHFILEINFOA shfi; + SHFILEINFOW shfi; DWORD dwAttributes = isDir ? FILE_ATTRIBUTE_DIRECTORY : FILE_ATTRIBUTE_NORMAL; - ULONG_PTR firet = SHGetFileInfoA(zipEntry->Name, dwAttributes, &shfi, sizeof(shfi), SHGFI_USEFILEATTRIBUTES | SHGFI_TYPENAME); + ULONG_PTR firet = SHGetFileInfoW(zipEntry->Name, dwAttributes, &shfi, sizeof(shfi), SHGFI_USEFILEATTRIBUTES | SHGFI_TYPENAME); if (!firet) return E_FAIL; return SHSetStrRet(&psd->str, shfi.szTypeName); @@ -226,7 +226,7 @@ public: { if (riid == IID_IShellFolder) { - CStringA newZipDir = m_ZipDir; + CStringW newZipDir = m_ZipDir; PCUIDLIST_RELATIVE curpidl = pidl; while (curpidl->mkid.cb) { @@ -236,7 +236,7 @@ public: return E_FAIL; } newZipDir += zipEntry->Name; - newZipDir += '/'; + newZipDir += L'/'; curpidl = ILGetNext(curpidl); } @@ -262,7 +262,7 @@ public: if (zipEntry1->ZipType != zipEntry2->ZipType) result = zipEntry1->ZipType - zipEntry2->ZipType; else - result = stricmp(zipEntry1->Name, zipEntry2->Name); + result = _wcsicmp(zipEntry1->Name, zipEntry2->Name); if (!result && zipEntry1->ZipType == ZIP_PIDL_DIRECTORY) { @@ -392,14 +392,8 @@ public: const ZipPidlEntry* zipEntry = _ZipFromIL(*apidl); if (zipEntry) { - CComHeapPtr pathW; - - int len = MultiByteToWideChar(CP_ACP, 0, zipEntry->Name, -1, NULL, 0); - pathW.Allocate(len); - MultiByteToWideChar(CP_ACP, 0, zipEntry->Name, -1, pathW, len); - DWORD dwAttributes = (zipEntry->ZipType == ZIP_PIDL_DIRECTORY) ? FILE_ATTRIBUTE_DIRECTORY : FILE_ATTRIBUTE_NORMAL; - return SHCreateFileExtractIconW(pathW, dwAttributes, riid, ppvOut); + return SHCreateFileExtractIconW(zipEntry->Name, dwAttributes, riid, ppvOut); } } else if (riid == IID_IContextMenu && cidl >= 0) @@ -444,7 +438,7 @@ public: if (!zipEntry) return E_FAIL; - return SHSetStrRet(strRet, (LPCSTR)zipEntry->Name); + return SHSetStrRet(strRet, zipEntry->Name); } STDMETHODIMP SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut) { @@ -621,7 +615,7 @@ public: } - STDMETHODIMP Initialize(PCWSTR zipFile, PCSTR zipDir, PCUIDLIST_ABSOLUTE curDir, PCUIDLIST_RELATIVE pidl) + STDMETHODIMP Initialize(PCWSTR zipFile, PCWSTR zipDir, PCUIDLIST_ABSOLUTE curDir, PCUIDLIST_RELATIVE pidl) { m_ZipFile = zipFile; m_ZipDir = zipDir; diff --git a/dll/shellext/zipfldr/CZipPassword.cpp b/dll/shellext/zipfldr/CZipPassword.cpp index 0a1964a23d1..ecb6071c196 100644 --- a/dll/shellext/zipfldr/CZipPassword.cpp +++ b/dll/shellext/zipfldr/CZipPassword.cpp @@ -10,10 +10,10 @@ class CZipPassword : public CDialogImpl { private: - CStringA m_Filename; + CStringW m_Filename; CStringA* m_pPassword; public: - CZipPassword(const char* filename, CStringA* Password) + CZipPassword(LPCWSTR filename, CStringA* Password) :m_pPassword(Password) { if (filename != NULL) @@ -27,15 +27,15 @@ public: /* No filename, so this is the question before starting to extract */ if (m_Filename.IsEmpty()) { - CStringA message(MAKEINTRESOURCE(IDS_PASSWORD_ZIP_TEXT)); - ::SetDlgItemTextA(m_hWnd, IDC_MESSAGE, message); + CStringW message(MAKEINTRESOURCE(IDS_PASSWORD_ZIP_TEXT)); + ::SetDlgItemTextW(m_hWnd, IDC_MESSAGE, message); ::ShowWindow(GetDlgItem(IDSKIP), SW_HIDE); } else { - CStringA message; + CStringW message; message.FormatMessage(IDS_PASSWORD_FILE_TEXT, m_Filename.GetString()); - ::SetDlgItemTextA(m_hWnd, IDC_MESSAGE, message); + ::SetDlgItemTextW(m_hWnd, IDC_MESSAGE, message); } return TRUE; } @@ -64,10 +64,10 @@ public: END_MSG_MAP() }; -eZipPasswordResponse _CZipAskPassword(HWND hDlg, const char* filename, CStringA& Password) +eZipPasswordResponse _CZipAskPasswordW(HWND hDlg, LPCWSTR filename, CStringA& Password) { if (filename) - filename = PathFindFileNameA(filename); + filename = PathFindFileNameW(filename); CZipPassword password(filename, &Password); INT_PTR Result = password.DoModal(hDlg); switch (Result) diff --git a/dll/shellext/zipfldr/precomp.h b/dll/shellext/zipfldr/precomp.h index b5845168073..110065d3402 100644 --- a/dll/shellext/zipfldr/precomp.h +++ b/dll/shellext/zipfldr/precomp.h @@ -41,6 +41,7 @@ WCHAR* guid2string(REFCLSID iid); #define MINIZIP_PASSWORD_FLAG 1 +#define MINIZIP_UTF8_FLAG (1 << 11) #include "minizip/unzip.h" #include "minizip/ioapi.h" @@ -52,7 +53,7 @@ extern zlib_filefunc64_def g_FFunc; #include "zippidl.hpp" #include "IZip.hpp" -HRESULT _CEnumZipContents_CreateInstance(IZip* zip, DWORD flags, const char* prefix, REFIID riid, LPVOID * ppvOut); +HRESULT _CEnumZipContents_CreateInstance(IZip* zip, DWORD flags, LPCWSTR prefix, REFIID riid, LPVOID * ppvOut); HRESULT _CExplorerCommandProvider_CreateInstance(IContextMenu* zipObject, REFIID riid, LPVOID * ppvOut); HRESULT _CFolderViewCB_CreateInstance(REFIID riid, LPVOID * ppvOut); void _CZipExtract_runWizard(PCWSTR Filename); @@ -64,7 +65,7 @@ enum eZipPasswordResponse eAccept, }; -eZipPasswordResponse _CZipAskPassword(HWND hDlg, const char* filename, CStringA& Password); +eZipPasswordResponse _CZipAskPasswordW(HWND hDlg, LPCWSTR filename, CStringA& Password); enum eZipConfirmResponse { @@ -74,7 +75,7 @@ enum eZipConfirmResponse eCancel }; -eZipConfirmResponse _CZipAskReplace(HWND hDlg, const char* FullPath); +eZipConfirmResponse _CZipAskReplaceW(HWND hDlg, LPCWSTR FullPath); enum eZipExtractError { diff --git a/dll/shellext/zipfldr/zipfldr.cpp b/dll/shellext/zipfldr/zipfldr.cpp index 5dee2d1cb24..73624ea7822 100644 --- a/dll/shellext/zipfldr/zipfldr.cpp +++ b/dll/shellext/zipfldr/zipfldr.cpp @@ -154,7 +154,7 @@ BOOL WINAPI RouteTheCall( IN HWND hWndOwner, IN HINSTANCE hInstance, - IN LPCSTR lpStringArg, + IN LPCWSTR lpStringArg, IN INT Show) { CStringW path = lpStringArg; diff --git a/dll/shellext/zipfldr/zippidl.cpp b/dll/shellext/zipfldr/zippidl.cpp index 09f26cd6f21..6649496dd78 100644 --- a/dll/shellext/zipfldr/zippidl.cpp +++ b/dll/shellext/zipfldr/zippidl.cpp @@ -7,9 +7,9 @@ #include "precomp.h" -LPITEMIDLIST _ILCreate(ZipPidlType Type, LPCSTR lpString, unz_file_info64& info) +LPITEMIDLIST _ILCreate(ZipPidlType Type, LPCWSTR lpString, unz_file_info64& info) { - int cbData = sizeof(ZipPidlEntry) + strlen(lpString); + int cbData = sizeof(ZipPidlEntry) + lstrlenW(lpString) * sizeof(WCHAR); ZipPidlEntry* pidl = (ZipPidlEntry*)SHAlloc(cbData + sizeof(WORD)); if (!pidl) return NULL; @@ -26,15 +26,15 @@ LPITEMIDLIST _ILCreate(ZipPidlType Type, LPCSTR lpString, unz_file_info64& info) pidl->UncompressedSize = info.uncompressed_size; pidl->DosDate = info.dosDate; pidl->Password = info.flag & MINIZIP_PASSWORD_FLAG; + pidl->Utf8 = !!(info.flag & MINIZIP_UTF8_FLAG); } - strcpy(pidl->Name, lpString); + lstrcpyW(pidl->Name, lpString); *(WORD*)((char*)pidl + cbData) = 0; return (LPITEMIDLIST)pidl; } - const ZipPidlEntry* _ZipFromIL(LPCITEMIDLIST pidl) { const ZipPidlEntry* zipPidl = (const ZipPidlEntry*)pidl; diff --git a/dll/shellext/zipfldr/zippidl.hpp b/dll/shellext/zipfldr/zippidl.hpp index 8c81158525f..cb19abdc440 100644 --- a/dll/shellext/zipfldr/zippidl.hpp +++ b/dll/shellext/zipfldr/zippidl.hpp @@ -23,12 +23,12 @@ struct ZipPidlEntry ULONG64 UncompressedSize; ULONG DosDate; BYTE Password; + BYTE Utf8; - char Name[1]; + WCHAR Name[1]; }; #include -LPITEMIDLIST _ILCreate(ZipPidlType Type, LPCSTR lpString, unz_file_info64& info); +LPITEMIDLIST _ILCreate(ZipPidlType Type, LPCWSTR lpString, unz_file_info64& info); const ZipPidlEntry* _ZipFromIL(LPCITEMIDLIST pidl); -