https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e15874b491a3b528eeae0…
commit e15874b491a3b528eeae0dbbf64b29bcfb9c20a9
Author: Amine Khaldi <amine.khaldi(a)reactos.org>
AuthorDate: Fri Dec 8 23:15:31 2017 +0100
[STOBJECT] Improve the existing PCH and make use of it.
---
dll/shellext/stobject/CMakeLists.txt | 9 +++++++--
dll/shellext/stobject/csystray.cpp | 3 ++-
dll/shellext/stobject/csystray.h | 1 +
dll/shellext/stobject/hotplug.cpp | 9 +++------
dll/shellext/stobject/power.cpp | 16 +++++-----------
dll/shellext/stobject/precomp.h | 22 ++++++++--------------
dll/shellext/stobject/stobject.cpp | 3 ---
dll/shellext/stobject/volume.cpp | 3 ---
8 files changed, 26 insertions(+), 40 deletions(-)
diff --git a/dll/shellext/stobject/CMakeLists.txt b/dll/shellext/stobject/CMakeLists.txt
index 341fe672ae..e25e433f6f 100644
--- a/dll/shellext/stobject/CMakeLists.txt
+++ b/dll/shellext/stobject/CMakeLists.txt
@@ -20,13 +20,17 @@ spec2def(stobject.dll stobject.spec)
file(GLOB_RECURSE stobject_rc_deps resources/*.*)
add_rc_deps(stobject.rc ${stobject_rc_deps})
-add_library(stobject SHARED
+list(APPEND SOURCE
csystray.cpp
stobject.cpp
- stobject.rc
hotplug.cpp
power.cpp
volume.cpp
+ precomp.h)
+
+add_library(stobject SHARED
+ ${SOURCE}
+ stobject.rc
${CMAKE_CURRENT_BINARY_DIR}/stobject.def)
set_module_type(stobject win32dll UNICODE)
@@ -48,4 +52,5 @@ add_importlibs(stobject
kernel32
ntdll)
+add_pch(stobject precomp.h SOURCE)
add_cd_file(TARGET stobject DESTINATION reactos/system32 FOR all)
diff --git a/dll/shellext/stobject/csystray.cpp b/dll/shellext/stobject/csystray.cpp
index e4a2afe403..89bd5c5ac0 100644
--- a/dll/shellext/stobject/csystray.cpp
+++ b/dll/shellext/stobject/csystray.cpp
@@ -9,7 +9,8 @@
#include "precomp.h"
-WINE_DEFAULT_DEBUG_CHANNEL(stobject);
+#include <undocshell.h>
+#include <shellutils.h>
SysTrayIconHandlers_t g_IconHandlers [] = {
{ Volume_Init, Volume_Shutdown, Volume_Update, Volume_Message },
diff --git a/dll/shellext/stobject/csystray.h b/dll/shellext/stobject/csystray.h
index b95cd65577..214a4c6549 100644
--- a/dll/shellext/stobject/csystray.h
+++ b/dll/shellext/stobject/csystray.h
@@ -7,6 +7,7 @@
* David Quintana <gigaherz(a)gmail.com>
* Shriraj Sawant a.k.a SR13 <sr.official(a)hotmail.com>
*/
+
#pragma once
extern const GUID CLSID_SysTray;
diff --git a/dll/shellext/stobject/hotplug.cpp b/dll/shellext/stobject/hotplug.cpp
index 4b17a1baf2..5c6d3099a8 100644
--- a/dll/shellext/stobject/hotplug.cpp
+++ b/dll/shellext/stobject/hotplug.cpp
@@ -5,17 +5,14 @@
* PURPOSE: Removable devices notification icon handler
* PROGRAMMERS: Shriraj Sawant a.k.a SR13 <sr.official(a)hotmail.com>
*/
-#include <windows.h>
+
#include "precomp.h"
-#include <mmsystem.h>
-#include <mmddk.h>
-#include <atlstr.h>
+
#include <atlsimpcoll.h>
#include <dbt.h>
-#include <setupapi.h>
#include <cfgmgr32.h>
+#include <shlwapi.h>
-WINE_DEFAULT_DEBUG_CHANNEL(stobject);
#define DISPLAY_NAME_LEN 40
//BOOL WINAPI UnregisterDeviceNotification(HDEVNOTIFY Handle);
diff --git a/dll/shellext/stobject/power.cpp b/dll/shellext/stobject/power.cpp
index a25de28cfb..12382faf7d 100644
--- a/dll/shellext/stobject/power.cpp
+++ b/dll/shellext/stobject/power.cpp
@@ -8,23 +8,17 @@
* David Quintana <gigaherz(a)gmail.com>
*/
-#include <windows.h>
-#include <setupapi.h>
-#include <devguid.h>
-#include <batclass.h>
-
#include "precomp.h"
-#include "powrprof.h"
-#include <mmsystem.h>
-#include <mmddk.h>
-#include <atlstr.h>
+#include <devguid.h>
+#include <winioctl.h>
+#include <powrprof.h>
+#include <windows.h>
+#include <batclass.h>
#define GBS_HASBATTERY 0x1
#define GBS_ONBATTERY 0x2
-WINE_DEFAULT_DEBUG_CHANNEL(stobject);
-
int br_icons[5] = { IDI_BATTCAP0, IDI_BATTCAP1, IDI_BATTCAP2, IDI_BATTCAP3, IDI_BATTCAP4
}; // battery mode icons.
int bc_icons[5] = { IDI_BATTCHA0, IDI_BATTCHA1, IDI_BATTCHA2, IDI_BATTCHA3, IDI_BATTCHA4
}; // charging mode icons.
diff --git a/dll/shellext/stobject/precomp.h b/dll/shellext/stobject/precomp.h
index 64824ba825..cefd8ea16e 100644
--- a/dll/shellext/stobject/precomp.h
+++ b/dll/shellext/stobject/precomp.h
@@ -1,4 +1,5 @@
-#pragma once
+#ifndef _STOBJECT_PRECOMP_H_
+#define _STOBJECT_PRECOMP_H_
#define WIN32_NO_STATUS
#include <stdarg.h>
@@ -12,27 +13,18 @@
#include <windef.h>
#include <winbase.h>
-#include <winreg.h>
-#include <winuser.h>
-#include <wincon.h>
-#include <ddeml.h>
#include <shlguid_undoc.h>
-#include <shlwapi.h>
#include <shlobj.h>
-#include <shlobj_undoc.h>
-#include <shlwapi_undoc.h>
-#include <tchar.h>
#include <strsafe.h>
#include <atlbase.h>
#include <atlcom.h>
#include <atlwin.h>
-#include <undocshell.h>
-#include <shellutils.h>
-
+#include <atlstr.h>
+#include <setupapi.h>
#include <shellapi.h>
#include <wine/debug.h>
-#include <wine/unicode.h>
+WINE_DEFAULT_DEBUG_CHANNEL(stobject);
#include "resource.h"
@@ -82,4 +74,6 @@ extern HRESULT STDMETHODCALLTYPE Power_Message(_In_ CSysTray * pSysTray,
UINT uM
#define POWER_TIMER_ID 2
#define VOLUME_TIMER_ID 3
-#define HOTPLUG_TIMER_ID 4
\ No newline at end of file
+#define HOTPLUG_TIMER_ID 4
+
+#endif /* _STOBJECT_PRECOMP_H_ */
diff --git a/dll/shellext/stobject/stobject.cpp b/dll/shellext/stobject/stobject.cpp
index 3b0683bbe1..455bf70ef9 100644
--- a/dll/shellext/stobject/stobject.cpp
+++ b/dll/shellext/stobject/stobject.cpp
@@ -9,9 +9,6 @@
#include "precomp.h"
-#include <olectl.h>
-#include <atlwin.h>
-
BEGIN_OBJECT_MAP(ObjectMap)
OBJECT_ENTRY(CLSID_SysTray, CSysTray)
END_OBJECT_MAP()
diff --git a/dll/shellext/stobject/volume.cpp b/dll/shellext/stobject/volume.cpp
index b7cb3ff049..a78bda743b 100644
--- a/dll/shellext/stobject/volume.cpp
+++ b/dll/shellext/stobject/volume.cpp
@@ -8,11 +8,8 @@
#include "precomp.h"
-#include <mmsystem.h>
#include <mmddk.h>
-WINE_DEFAULT_DEBUG_CHANNEL(stobject);
-
HICON g_hIconVolume;
HICON g_hIconMute;