From 8a0e0f8cc1f93d4f5fe205de75cacd2265017395 Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <2546789017@qq.com> Date: Mon, 25 Jul 2022 10:35:29 +0800 Subject: QtBase: Windows: Replace some deprecated API usages Microsoft recommends to use CoInitializeEx() and SetWindowLongPtr()/GetWindowLongPtr() in new code. Use COINIT_DISABLE_OLE1DDE to avoid overhead of initializing and using obsolete technology. Pick-to: 6.4 Change-Id: I9d16943e864d4487dd4f46fd9325579c298c52b9 Reviewed-by: Oliver Wolff --- tests/auto/corelib/io/qfile/tst_qfile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/auto/corelib/io') diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index fe412641f5..828a90e86e 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -1546,7 +1546,7 @@ static QString getWorkingDirectoryForLink(const QString &linkFileName) HRESULT hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (void **)&psl); if (hres == CO_E_NOTINITIALIZED) { // COM was not initialized neededCoInit = true; - CoInitialize(NULL); + CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE); hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (void **)&psl); } -- cgit v1.2.3