mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
.
This commit is contained in:
@ -745,7 +745,7 @@ bool ECMACryptFile::EncryptOfficeFile(const std::wstring &file_name_inp, const s
|
|||||||
StgCreateDocfile(file_name_out.c_str(), STGM_CREATE|STGM_SHARE_EXCLUSIVE|STGM_READWRITE, 0, &winStorage);
|
StgCreateDocfile(file_name_out.c_str(), STGM_CREATE|STGM_SHARE_EXCLUSIVE|STGM_READWRITE, 0, &winStorage);
|
||||||
|
|
||||||
IStream *winStream = NULL;
|
IStream *winStream = NULL;
|
||||||
#elif
|
#else
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
POLE::Storage *pStorage = new POLE::Storage(file_name_out.c_str());
|
POLE::Storage *pStorage = new POLE::Storage(file_name_out.c_str());
|
||||||
if (!pStorage)return false;
|
if (!pStorage)return false;
|
||||||
@ -763,7 +763,7 @@ bool ECMACryptFile::EncryptOfficeFile(const std::wstring &file_name_inp, const s
|
|||||||
winStorage->CreateStream(L"EncryptedPackage", STGM_CREATE | STGM_READWRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &winStream);
|
winStorage->CreateStream(L"EncryptedPackage", STGM_CREATE | STGM_READWRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &winStream);
|
||||||
winStream->Write(data_out, lengthData, &nWritten);
|
winStream->Write(data_out, lengthData, &nWritten);
|
||||||
winStream->Release();
|
winStream->Release();
|
||||||
#elif
|
#else
|
||||||
pStream = new POLE::Stream(pStorage, L"EncryptedPackage", true, lengthData);
|
pStream = new POLE::Stream(pStorage, L"EncryptedPackage", true, lengthData);
|
||||||
|
|
||||||
pStream->write(data_out, lengthData);
|
pStream->write(data_out, lengthData);
|
||||||
@ -817,7 +817,7 @@ bool ECMACryptFile::EncryptOfficeFile(const std::wstring &file_name_inp, const s
|
|||||||
delete []byteEncryptionInfo;
|
delete []byteEncryptionInfo;
|
||||||
}
|
}
|
||||||
winStream->Release();
|
winStream->Release();
|
||||||
#elif
|
#else
|
||||||
pStream = new POLE::Stream(pStorage, L"EncryptionInfo", true);
|
pStream = new POLE::Stream(pStorage, L"EncryptionInfo", true);
|
||||||
|
|
||||||
if (cryptData.bAgile)
|
if (cryptData.bAgile)
|
||||||
@ -872,7 +872,7 @@ bool ECMACryptFile::EncryptOfficeFile(const std::wstring &file_name_inp, const s
|
|||||||
winStorage->CreateStream(L"DocumentID", STGM_CREATE | STGM_READWRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &winStream);
|
winStorage->CreateStream(L"DocumentID", STGM_CREATE | STGM_READWRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &winStream);
|
||||||
winStream->Write((BYTE*)utfDocumentID.c_str(), utfDocumentID.length(), &nWritten);
|
winStream->Write((BYTE*)utfDocumentID.c_str(), utfDocumentID.length(), &nWritten);
|
||||||
winStream->Release();
|
winStream->Release();
|
||||||
#elif
|
#else
|
||||||
pStream = new POLE::Stream(pStorage, L"DocumentID", true, utfDocumentID.length());
|
pStream = new POLE::Stream(pStorage, L"DocumentID", true, utfDocumentID.length());
|
||||||
|
|
||||||
pStream->write((BYTE*)utfDocumentID.c_str(), utfDocumentID.length());
|
pStream->write((BYTE*)utfDocumentID.c_str(), utfDocumentID.length());
|
||||||
@ -885,7 +885,7 @@ bool ECMACryptFile::EncryptOfficeFile(const std::wstring &file_name_inp, const s
|
|||||||
#if defined(_WIN32) || defined(_WIN64)
|
#if defined(_WIN32) || defined(_WIN64)
|
||||||
if (winStorage)
|
if (winStorage)
|
||||||
winStorage->Release();
|
winStorage->Release();
|
||||||
#elif
|
#else
|
||||||
pStorage->close();
|
pStorage->close();
|
||||||
delete pStorage;
|
delete pStorage;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user