https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d5132f5ce3b0431718e93…
commit d5132f5ce3b0431718e93b7ea27cab3ed2ff98f3
Author: Oleg Dubinskiy <oleg.dubinskij2013(a)yandex.ua>
AuthorDate: Tue Oct 27 19:25:36 2020 +0200
Commit: Stanislav Motylkov <x86corez(a)gmail.com>
CommitDate: Sun Dec 20 22:06:16 2020 +0300
[BROWSEUI][PSDK] Stubplement ShellTaskScheduler (#3326)
Required by MS Picture and Fax Viewer (shimgvw.dll).
Now it starts properly without replacing any other system files.
CORE-17337
---
dll/win32/browseui/CMakeLists.txt | 2 ++
dll/win32/browseui/CShellTaskScheduler.cpp | 41 +++++++++++++++++++++++++++
dll/win32/browseui/CShellTaskScheduler.h | 36 +++++++++++++++++++++++
dll/win32/browseui/browseui.cpp | 1 +
dll/win32/browseui/browseui.rc | 1 +
dll/win32/browseui/precomp.h | 1 +
dll/win32/browseui/res/shelltaskscheduler.rgs | 13 +++++++++
dll/win32/browseui/resource.h | 1 +
sdk/include/psdk/shlguid.h | 1 +
9 files changed, 97 insertions(+)
diff --git a/dll/win32/browseui/CMakeLists.txt b/dll/win32/browseui/CMakeLists.txt
index eb7070d05ae..9d199f6c996 100644
--- a/dll/win32/browseui/CMakeLists.txt
+++ b/dll/win32/browseui/CMakeLists.txt
@@ -18,6 +18,8 @@ list(APPEND SOURCE
browseui.cpp
browseuiord.cpp
CAutoComplete.cpp
+ CShellTaskScheduler.cpp
+ CShellTaskScheduler.h
CTaskbarList.cpp
CTaskbarList.h
commonbrowser.cpp
diff --git a/dll/win32/browseui/CShellTaskScheduler.cpp
b/dll/win32/browseui/CShellTaskScheduler.cpp
new file mode 100644
index 00000000000..ff1709c3383
--- /dev/null
+++ b/dll/win32/browseui/CShellTaskScheduler.cpp
@@ -0,0 +1,41 @@
+/*
+ * PROJECT: ReactOS browseui
+ * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later)
+ * PURPOSE: IShellTaskScheduler implementation
+ * COPYRIGHT: Copyright 2020 Oleg Dubinskiy (oleg.dubinskij2013(a)yandex.ua)
+ */
+
+#include "precomp.h"
+
+CShellTaskScheduler::CShellTaskScheduler()
+{
+}
+
+CShellTaskScheduler::~CShellTaskScheduler()
+{
+}
+
+// *** IShellTaskScheduler methods ***
+STDMETHODIMP CShellTaskScheduler::AddTask(IRunnableTask *pTask, REFGUID rtoid, DWORD_PTR
lParam, DWORD dwPriority)
+{
+ TRACE("(%p, %u, %d, %d)\n", this, pTask, rtoid, lParam, dwPriority);
+ return E_NOTIMPL;
+}
+
+STDMETHODIMP CShellTaskScheduler::RemoveTasks(REFGUID rtoid, DWORD_PTR lParam, BOOL
fWaitIfRunning)
+{
+ TRACE("(%u, %d, %d)\n", this, rtoid, lParam, fWaitIfRunning);
+ return E_NOTIMPL;
+}
+
+UINT STDMETHODCALLTYPE CShellTaskScheduler::CountTasks(REFGUID rtoid)
+{
+ TRACE("(%u)\n", this, rtoid);
+ return E_NOTIMPL;
+}
+
+STDMETHODIMP CShellTaskScheduler::Status(DWORD dwReleaseStatus, DWORD dwThreadTimeout)
+{
+ TRACE("(%d, %d)\n", this, dwReleaseStatus, dwThreadTimeout);
+ return E_NOTIMPL;
+}
diff --git a/dll/win32/browseui/CShellTaskScheduler.h
b/dll/win32/browseui/CShellTaskScheduler.h
new file mode 100644
index 00000000000..42001c18439
--- /dev/null
+++ b/dll/win32/browseui/CShellTaskScheduler.h
@@ -0,0 +1,36 @@
+/*
+ * PROJECT: ReactOS browseui
+ * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later)
+ * PURPOSE: IShellTaskScheduler implementation
+ * COPYRIGHT: Copyright 2020 Oleg Dubinskiy (oleg.dubinskij2013(a)yandex.ua)
+ */
+
+#pragma once
+
+class CShellTaskScheduler :
+ public CComCoClass<CShellTaskScheduler, &CLSID_ShellTaskScheduler>,
+ public CComObjectRootEx<CComMultiThreadModelNoCS>,
+ public IShellTaskScheduler
+{
+private:
+public:
+ CShellTaskScheduler();
+ ~CShellTaskScheduler();
+
+ // *** IShellTaskScheduler methods ***
+ STDMETHODIMP AddTask(IRunnableTask *pTask, REFGUID rtoid, DWORD_PTR lParam, DWORD
dwPriority);
+ STDMETHODIMP RemoveTasks(REFGUID rtoid, DWORD_PTR lParam, BOOL fWaitIfRunning);
+ virtual UINT STDMETHODCALLTYPE CountTasks(REFGUID rtoid);
+ STDMETHODIMP Status(DWORD dwReleaseStatus, DWORD dwThreadTimeout);
+
+public:
+
+ DECLARE_REGISTRY_RESOURCEID(IDR_SHELLTASKSCHEDULER)
+ DECLARE_NOT_AGGREGATABLE(CShellTaskScheduler)
+
+ DECLARE_PROTECT_FINAL_CONSTRUCT()
+
+ BEGIN_COM_MAP(CShellTaskScheduler)
+ COM_INTERFACE_ENTRY_IID(IID_IShellTaskScheduler, IShellTaskScheduler)
+ END_COM_MAP()
+};
diff --git a/dll/win32/browseui/browseui.cpp b/dll/win32/browseui/browseui.cpp
index 7051e248456..de1f8bb95ad 100644
--- a/dll/win32/browseui/browseui.cpp
+++ b/dll/win32/browseui/browseui.cpp
@@ -150,6 +150,7 @@ OBJECT_ENTRY(CLSID_CCommonBrowser, CCommonBrowser)
OBJECT_ENTRY(CLSID_GlobalFolderSettings, CGlobalFolderSettings)
OBJECT_ENTRY(CLSID_InternetToolbar, CInternetToolbar)
OBJECT_ENTRY(CLSID_CRegTreeOptions, CRegTreeOptions)
+OBJECT_ENTRY(CLSID_ShellTaskScheduler, CShellTaskScheduler)
OBJECT_ENTRY(CLSID_TaskbarList, CTaskbarList)
OBJECT_ENTRY(CLSID_ExplorerBand, CExplorerBand)
OBJECT_ENTRY(CLSID_FileSearchBand, CSearchBar)
diff --git a/dll/win32/browseui/browseui.rc b/dll/win32/browseui/browseui.rc
index 4ff07550482..774e346c0de 100644
--- a/dll/win32/browseui/browseui.rc
+++ b/dll/win32/browseui/browseui.rc
@@ -41,6 +41,7 @@ IDR_COMMONBROWSER REGISTRY "res/commonbrowser.rgs"
IDR_GLOBALFOLDERSETTINGS REGISTRY "res/globalfoldersettings.rgs"
IDR_INTERNETTOOLBAR REGISTRY "res/internettoolbar.rgs"
IDR_REGTREEOPTIONS REGISTRY "res/regtreeoptions.rgs"
+IDR_SHELLTASKSCHEDULER REGISTRY "res/shelltaskscheduler.rgs"
IDR_EXPLORERBAND REGISTRY "res/explorerband.rgs"
IDR_PROGRESSDIALOG REGISTRY "res/progressdialog.rgs"
IDR_AUTOCOMPLETE REGISTRY "res/autocomplete.rgs"
diff --git a/dll/win32/browseui/precomp.h b/dll/win32/browseui/precomp.h
index 27ce5443f45..02c27054544 100644
--- a/dll/win32/browseui/precomp.h
+++ b/dll/win32/browseui/precomp.h
@@ -54,6 +54,7 @@
#include "commonbrowser.h"
#include "globalfoldersettings.h"
#include "regtreeoptions.h"
+#include "CShellTaskScheduler.h"
#include "CTaskbarList.h"
#include "explorerband.h"
#include "CProgressDialog.h"
diff --git a/dll/win32/browseui/res/shelltaskscheduler.rgs
b/dll/win32/browseui/res/shelltaskscheduler.rgs
new file mode 100644
index 00000000000..7d0ea18072c
--- /dev/null
+++ b/dll/win32/browseui/res/shelltaskscheduler.rgs
@@ -0,0 +1,13 @@
+HKCR
+{
+ NoRemove CLSID
+ {
+ ForceRemove {603D3800-BD81-11d0-A3A5-00C04FD706EC} = s 'Background Task
Scheduler'
+ {
+ InprocServer32 = s '%MODULE%'
+ {
+ val ThreadingModel = s 'Apartment'
+ }
+ }
+ }
+}
diff --git a/dll/win32/browseui/resource.h b/dll/win32/browseui/resource.h
index ecb6b0a603b..1890dc0676a 100644
--- a/dll/win32/browseui/resource.h
+++ b/dll/win32/browseui/resource.h
@@ -108,6 +108,7 @@
#define IDR_FILESEARCHBAND 146
#define IDR_FINDFOLDER 147
#define IDR_USERASSIST 148
+#define IDR_SHELLTASKSCHEDULER 149
#define IDS_SMALLICONS 12301
#define IDS_LARGEICONS 12302
diff --git a/sdk/include/psdk/shlguid.h b/sdk/include/psdk/shlguid.h
index 92720114bf3..132f2963fdc 100644
--- a/sdk/include/psdk/shlguid.h
+++ b/sdk/include/psdk/shlguid.h
@@ -105,6 +105,7 @@ DEFINE_GUID(CLSID_ACLMRU, 0x6756a641, 0xde71, 0x11d0, 0x83,
0x1b, 0x00,
DEFINE_GUID(CLSID_ACLCustomMRU, 0x6935db93, 0x21e8, 0x4ccc, 0xbe, 0xb9, 0x9f, 0xe3,
0xc7, 0x7a, 0x29, 0x7a);
DEFINE_GUID(CLSID_UserAssist, 0xdd313e04, 0xfeff, 0x11d1, 0x8e, 0xcd, 0x00, 0x00,
0xf8, 0x7a, 0x47, 0x0c);
+DEFINE_GUID(CLSID_ShellTaskScheduler, 0x603d3800, 0xbd81, 0x11d0, 0xa3, 0xa5, 0x00, 0xc0,
0x4f, 0xd7, 0x06, 0xec);
#define SID_SInternetExplorer IID_IWebBrowserApp
#define SID_SWebBrowserApp IID_IWebBrowserApp