Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
b411470b
Kaydet (Commit)
b411470b
authored
May 30, 2017
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
vcl: replace dynamic lookups of Windows 7 APIs with static calls
Change-Id: I5d4c4bb98e271e69c45b8e7f989f9b21d287c0bb
üst
5158c16a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
79 deletions
+38
-79
pdfwriter_impl.cxx
vcl/source/gdi/pdfwriter_impl.cxx
+2
-25
salinst.cxx
vcl/win/app/salinst.cxx
+36
-54
No files found.
vcl/source/gdi/pdfwriter_impl.cxx
Dosyayı görüntüle @
b411470b
...
@@ -100,10 +100,7 @@
...
@@ -100,10 +100,7 @@
#ifdef _WIN32
#ifdef _WIN32
// WinCrypt headers for PDF signing
// WinCrypt headers for PDF signing
// Note: this uses Windows 7 APIs and requires the relevant data types;
// Note: this uses Windows 7 APIs and requires the relevant data types
// the functions that don't exist in WinXP must be looked up at runtime!
#undef _WIN32_WINNT
#define _WIN32_WINNT _WIN32_WINNT_WIN7
#include <prewin.h>
#include <prewin.h>
#include <wincrypt.h>
#include <wincrypt.h>
#include <postwin.h>
#include <postwin.h>
...
@@ -6222,17 +6219,6 @@ NSSCMSMessage *CreateCMSMessage(PRTime* time,
...
@@ -6222,17 +6219,6 @@ NSSCMSMessage *CreateCMSMessage(PRTime* time,
#ifdef _WIN32
#ifdef _WIN32
typedef BOOL (WINAPI *PointerTo_CryptRetrieveTimeStamp)(LPCWSTR wszUrl,
DWORD dwRetrievalFlags,
DWORD dwTimeout,
LPCSTR pszHashId,
const CRYPT_TIMESTAMP_PARA *pPara,
const BYTE *pbData,
DWORD cbData,
PCRYPT_TIMESTAMP_CONTEXT *ppTsContext,
PCCERT_CONTEXT *ppTsSigner,
HCERTSTORE phStore);
namespace
namespace
{
{
...
@@ -6958,15 +6944,6 @@ bool PDFWriter::Sign(PDFSignContext& rContext)
...
@@ -6958,15 +6944,6 @@ bool PDFWriter::Sign(PDFSignContext& rContext)
if( !rContext.m_aSignTSA.isEmpty() )
if( !rContext.m_aSignTSA.isEmpty() )
{
{
PointerTo_CryptRetrieveTimeStamp crts = reinterpret_cast<PointerTo_CryptRetrieveTimeStamp>(GetProcAddress(LoadLibrary("crypt32.dll"), "CryptRetrieveTimeStamp"));
if (!crts)
{
SAL_WARN("vcl.pdfwriter", "Could not find the CryptRetrieveTimeStamp function in crypt32.dll: " << WindowsErrorString(GetLastError()));
CryptMsgClose(hMsg);
CertFreeCertificateContext(pCertContext);
return false;
}
HCRYPTMSG hDecodedMsg = CryptMsgOpenToDecode(PKCS_7_ASN_ENCODING | X509_ASN_ENCODING,
HCRYPTMSG hDecodedMsg = CryptMsgOpenToDecode(PKCS_7_ASN_ENCODING | X509_ASN_ENCODING,
CMSG_DETACHED_FLAG,
CMSG_DETACHED_FLAG,
CMSG_SIGNED,
CMSG_SIGNED,
...
@@ -7047,7 +7024,7 @@ bool PDFWriter::Sign(PDFSignContext& rContext)
...
@@ -7047,7 +7024,7 @@ bool PDFWriter::Sign(PDFSignContext& rContext)
aTsPara.cExtension = 0;
aTsPara.cExtension = 0;
aTsPara.rgExtension = nullptr;
aTsPara.rgExtension = nullptr;
if (!
(*crts)
(SAL_W(rContext.m_aSignTSA.getStr()),
if (!
CryptRetrieveTimeStamp
(SAL_W(rContext.m_aSignTSA.getStr()),
0,
0,
10000,
10000,
szOID_NIST_sha256,
szOID_NIST_sha256,
...
...
vcl/win/app/salinst.cxx
Dosyayı görüntüle @
b411470b
...
@@ -913,65 +913,47 @@ void WinSalInstance::AddToRecentDocumentList(const OUString& rFileUrl, const OUS
...
@@ -913,65 +913,47 @@ void WinSalInstance::AddToRecentDocumentList(const OUString& rFileUrl, const OUS
{
{
if
(
aSalShlData
.
mbW7
)
if
(
aSalShlData
.
mbW7
)
{
{
typedef
HRESULT
(
WINAPI
*
SHCREATEITEMFROMPARSINGNAME
)(
PCWSTR
,
IBindCtx
*
,
REFIID
,
void
**
ppv
);
IShellItem
*
pShellItem
=
nullptr
;
SHCREATEITEMFROMPARSINGNAME
pSHCreateItemFromParsingName
=
reinterpret_cast
<
SHCREATEITEMFROMPARSINGNAME
>
(
GetProcAddress
(
GetModuleHandleW
(
L"shell32.dll"
),
"SHCreateItemFromParsingName"
));
if
(
pSHCreateItemFromParsingName
)
HRESULT
hr
=
SHCreateItemFromParsingName
(
SAL_W
(
system_path
.
getStr
()),
nullptr
,
IID_PPV_ARGS
(
&
pShellItem
));
{
IShellItem
*
pShellItem
=
nullptr
;
HRESULT
hr
=
pSHCreateItemFromParsingName
(
SAL_W
(
system_path
.
getStr
()),
nullptr
,
IID_PPV_ARGS
(
&
pShellItem
)
);
if
(
SUCCEEDED
(
hr
)
&&
pShellItem
)
if
(
SUCCEEDED
(
hr
)
&&
pShellItem
)
{
OUString
sApplicationName
;
if
(
rDocumentService
==
"com.sun.star.text.TextDocument"
||
rDocumentService
==
"com.sun.star.text.GlobalDocument"
||
rDocumentService
==
"com.sun.star.text.WebDocument"
||
rDocumentService
==
"com.sun.star.xforms.XMLFormDocument"
)
sApplicationName
=
"Writer"
;
else
if
(
rDocumentService
==
"com.sun.star.sheet.SpreadsheetDocument"
||
rDocumentService
==
"com.sun.star.chart2.ChartDocument"
)
sApplicationName
=
"Calc"
;
else
if
(
rDocumentService
==
"com.sun.star.presentation.PresentationDocument"
)
sApplicationName
=
"Impress"
;
else
if
(
rDocumentService
==
"com.sun.star.drawing.DrawingDocument"
)
sApplicationName
=
"Draw"
;
else
if
(
rDocumentService
==
"com.sun.star.formula.FormulaProperties"
)
sApplicationName
=
"Math"
;
else
if
(
rDocumentService
==
"com.sun.star.sdb.DatabaseDocument"
||
rDocumentService
==
"com.sun.star.sdb.OfficeDatabaseDocument"
||
rDocumentService
==
"com.sun.star.sdb.RelationDesign"
||
rDocumentService
==
"com.sun.star.sdb.QueryDesign"
||
rDocumentService
==
"com.sun.star.sdb.TableDesign"
||
rDocumentService
==
"com.sun.star.sdb.DataSourceBrowser"
)
sApplicationName
=
"Base"
;
if
(
!
sApplicationName
.
isEmpty
()
)
{
{
OUString
sApplicationName
;
OUString
sApplicationID
(
"TheDocumentFoundation.LibreOffice."
);
sApplicationID
+=
sApplicationName
;
if
(
rDocumentService
==
"com.sun.star.text.TextDocument"
||
rDocumentService
==
"com.sun.star.text.GlobalDocument"
||
rDocumentService
==
"com.sun.star.text.WebDocument"
||
rDocumentService
==
"com.sun.star.xforms.XMLFormDocument"
)
sApplicationName
=
"Writer"
;
else
if
(
rDocumentService
==
"com.sun.star.sheet.SpreadsheetDocument"
||
rDocumentService
==
"com.sun.star.chart2.ChartDocument"
)
sApplicationName
=
"Calc"
;
else
if
(
rDocumentService
==
"com.sun.star.presentation.PresentationDocument"
)
sApplicationName
=
"Impress"
;
else
if
(
rDocumentService
==
"com.sun.star.drawing.DrawingDocument"
)
sApplicationName
=
"Draw"
;
else
if
(
rDocumentService
==
"com.sun.star.formula.FormulaProperties"
)
sApplicationName
=
"Math"
;
else
if
(
rDocumentService
==
"com.sun.star.sdb.DatabaseDocument"
||
rDocumentService
==
"com.sun.star.sdb.OfficeDatabaseDocument"
||
rDocumentService
==
"com.sun.star.sdb.RelationDesign"
||
rDocumentService
==
"com.sun.star.sdb.QueryDesign"
||
rDocumentService
==
"com.sun.star.sdb.TableDesign"
||
rDocumentService
==
"com.sun.star.sdb.DataSourceBrowser"
)
sApplicationName
=
"Base"
;
if
(
!
sApplicationName
.
isEmpty
()
)
{
OUString
sApplicationID
(
"TheDocumentFoundation.LibreOffice."
);
sApplicationID
+=
sApplicationName
;
#if _WIN32_WINNT < _WIN32_WINNT_WIN7
// just define Windows 7 only constant locally...
#define SHARD_APPIDINFO 0x00000004
#endif
typedef
struct
{
IShellItem
*
psi
;
PCWSTR
pszAppID
;
}
DummyShardAppIDInfo
;
DummyShardAppIDInfo
info
;
SHARDAPPIDINFO
info
;
info
.
psi
=
pShellItem
;
info
.
psi
=
pShellItem
;
info
.
pszAppID
=
SAL_W
(
sApplicationID
.
getStr
());
info
.
pszAppID
=
SAL_W
(
sApplicationID
.
getStr
());
SHAddToRecentDocs
(
SHARD_APPIDINFO
,
&
info
);
SHAddToRecentDocs
(
SHARD_APPIDINFO
,
&
info
);
return
;
return
;
}
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment