https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b28272c545845084d8233…
commit b28272c545845084d8233162fb9e22e6fc88c822
Author: Amine Khaldi <amine.khaldi(a)reactos.org>
AuthorDate: Sun Nov 26 14:16:29 2017 +0100
[SHELLBTRFS] Add a PCH.
---
dll/shellext/shellbtrfs/CMakeLists.txt | 13 +++++++++----
dll/shellext/shellbtrfs/balance.h | 2 ++
dll/shellext/shellbtrfs/contextmenu.h | 2 ++
dll/shellext/shellbtrfs/devices.h | 2 ++
dll/shellext/shellbtrfs/factory.h | 2 ++
dll/shellext/shellbtrfs/guid.c | 13 +++++++++++++
dll/shellext/shellbtrfs/iconoverlay.h | 2 ++
dll/shellext/shellbtrfs/precomp.h | 29 +++++++++++++++++++++++++++++
dll/shellext/shellbtrfs/propsheet.h | 2 ++
dll/shellext/shellbtrfs/recv.h | 2 ++
dll/shellext/shellbtrfs/scrub.h | 2 ++
dll/shellext/shellbtrfs/send.h | 2 ++
dll/shellext/shellbtrfs/shellext.h | 2 ++
dll/shellext/shellbtrfs/volpropsheet.h | 2 ++
14 files changed, 73 insertions(+), 4 deletions(-)
diff --git a/dll/shellext/shellbtrfs/CMakeLists.txt b/dll/shellext/shellbtrfs/CMakeLists.txt
index fd11cc123c..6802f6b108 100644
--- a/dll/shellext/shellbtrfs/CMakeLists.txt
+++ b/dll/shellext/shellbtrfs/CMakeLists.txt
@@ -3,6 +3,8 @@ set_cpp(WITH_RUNTIME WITH_EXCEPTIONS WITH_STL)
remove_definitions(-D_WIN32_WINNT=0x502)
add_definitions(-D_WIN32_WINNT=0x603)
+include_directories(${REACTOS_SOURCE_DIR}/drivers/filesystems/btrfs)
+
spec2def(shellbtrfs.dll shellbtrfs.spec)
list(APPEND SOURCE
@@ -18,16 +20,19 @@ list(APPEND SOURCE
scrub.cpp
send.cpp
volpropsheet.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/shellbtrfs.def)
+ precomp.h)
-include_directories(
- ${REACTOS_SOURCE_DIR}/drivers/filesystems/btrfs)
+add_library(shellbtrfs SHARED
+ ${SOURCE}
+ guid.c
+ shellbtrfs.rc
+ ${CMAKE_CURRENT_BINARY_DIR}/shellbtrfs.def)
file(GLOB shellbtrfs_rc_deps *.ico)
add_rc_deps(shellbtrfs.rc ${shellbtrfs_rc_deps})
-add_library(shellbtrfs SHARED ${SOURCE} shellbtrfs.rc)
set_module_type(shellbtrfs win32dll UNICODE)
target_link_libraries(shellbtrfs uuid)
add_importlibs(shellbtrfs advapi32 advapi32_vista ole32 shell32 shlwapi user32 comctl32 uxtheme setupapi comdlg32 gdi32 msvcrt kernel32_vista kernel32 ntdll)
+add_pch(shellbtrfs precomp.h SOURCE)
add_cd_file(TARGET shellbtrfs DESTINATION reactos/system32 FOR all)
diff --git a/dll/shellext/shellbtrfs/balance.h b/dll/shellext/shellbtrfs/balance.h
index 262f29923b..0c07de4c2c 100644
--- a/dll/shellext/shellbtrfs/balance.h
+++ b/dll/shellext/shellbtrfs/balance.h
@@ -15,6 +15,8 @@
* You should have received a copy of the GNU Lesser General Public Licence
* along with WinBtrfs. If not, see <http://www.gnu.org/licenses/>. */
+#pragma once
+
#include <windows.h>
#ifndef __REACTOS__
#include "../btrfsioctl.h"
diff --git a/dll/shellext/shellbtrfs/contextmenu.h b/dll/shellext/shellbtrfs/contextmenu.h
index d9d32ed91c..12779f422b 100644
--- a/dll/shellext/shellbtrfs/contextmenu.h
+++ b/dll/shellext/shellbtrfs/contextmenu.h
@@ -15,6 +15,8 @@
* You should have received a copy of the GNU Lesser General Public Licence
* along with WinBtrfs. If not, see <http://www.gnu.org/licenses/>. */
+#pragma once
+
#include <shlobj.h>
extern LONG objs_loaded;
diff --git a/dll/shellext/shellbtrfs/devices.h b/dll/shellext/shellbtrfs/devices.h
index 218a244ff3..e6b949abd9 100644
--- a/dll/shellext/shellbtrfs/devices.h
+++ b/dll/shellext/shellbtrfs/devices.h
@@ -15,6 +15,8 @@
* You should have received a copy of the GNU Lesser General Public Licence
* along with WinBtrfs. If not, see <http://www.gnu.org/licenses/>. */
+#pragma once
+
#ifndef __REACTOS__
#include <windows.h>
#include <winternl.h>
diff --git a/dll/shellext/shellbtrfs/factory.h b/dll/shellext/shellbtrfs/factory.h
index af8b46bf8e..8575e61f52 100644
--- a/dll/shellext/shellbtrfs/factory.h
+++ b/dll/shellext/shellbtrfs/factory.h
@@ -15,6 +15,8 @@
* You should have received a copy of the GNU Lesser General Public Licence
* along with WinBtrfs. If not, see <http://www.gnu.org/licenses/>. */
+#pragma once
+
extern LONG objs_loaded;
typedef enum {
diff --git a/dll/shellext/shellbtrfs/guid.c b/dll/shellext/shellbtrfs/guid.c
new file mode 100644
index 0000000000..2396fb1c59
--- /dev/null
+++ b/dll/shellext/shellbtrfs/guid.c
@@ -0,0 +1,13 @@
+/* DO NOT USE THE PRECOMPILED HEADER FOR THIS FILE! */
+
+#define WIN32_NO_STATuS
+#define _INC_WINDOWS
+#define COM_NO_WINDOWS_H
+
+#include <windef.h>
+#include <winbase.h>
+#include <initguid.h>
+#define DEVICE_TYPE ULONG
+#include <ntddstor.h>
+
+/* NO CODE HERE, THIS IS JUST REQUIRED FOR THE GUID DEFINITIONS */
diff --git a/dll/shellext/shellbtrfs/iconoverlay.h b/dll/shellext/shellbtrfs/iconoverlay.h
index efcc1e7b79..24276ddcb9 100644
--- a/dll/shellext/shellbtrfs/iconoverlay.h
+++ b/dll/shellext/shellbtrfs/iconoverlay.h
@@ -15,6 +15,8 @@
* You should have received a copy of the GNU Lesser General Public Licence
* along with WinBtrfs. If not, see <http://www.gnu.org/licenses/>. */
+#pragma once
+
#include <shlobj.h>
extern LONG objs_loaded;
diff --git a/dll/shellext/shellbtrfs/precomp.h b/dll/shellext/shellbtrfs/precomp.h
new file mode 100644
index 0000000000..dde8baa9f1
--- /dev/null
+++ b/dll/shellext/shellbtrfs/precomp.h
@@ -0,0 +1,29 @@
+#ifndef _SHELLBTRFS_PRECOMP_H_
+#define _SHELLBTRFS_PRECOMP_H_
+
+#include <stddef.h>
+#include <stdio.h>
+#include <string>
+#include <sys/stat.h>
+#define WIN32_NO_STATUS
+#include <windows.h>
+#define STRSAFE_NO_DEPRECATE
+#include <strsafe.h>
+#define NO_SHLWAPI_STRFCNS
+#include <shlwapi.h>
+#include <ntddstor.h>
+#include <ndk/iofuncs.h>
+#include <ndk/rtlfuncs.h>
+#include <shlobj.h>
+#include <shellext.h>
+#include <btrfsioctl.h>
+#include <uxtheme.h>
+
+#include "contextmenu.h"
+#include "factory.h"
+#include "iconoverlay.h"
+#include "propsheet.h"
+#include "resource.h"
+#include "volpropsheet.h"
+
+#endif /* _SHELLBTRFS_PRECOMP_H_ */
diff --git a/dll/shellext/shellbtrfs/propsheet.h b/dll/shellext/shellbtrfs/propsheet.h
index 90d9fc0874..1920dbb940 100644
--- a/dll/shellext/shellbtrfs/propsheet.h
+++ b/dll/shellext/shellbtrfs/propsheet.h
@@ -15,6 +15,8 @@
* You should have received a copy of the GNU Lesser General Public Licence
* along with WinBtrfs. If not, see <http://www.gnu.org/licenses/>. */
+#pragma once
+
#include <shlobj.h>
#include <deque>
#include <string>
diff --git a/dll/shellext/shellbtrfs/recv.h b/dll/shellext/shellbtrfs/recv.h
index 85e93298c5..8301a20f28 100644
--- a/dll/shellext/shellbtrfs/recv.h
+++ b/dll/shellext/shellbtrfs/recv.h
@@ -15,6 +15,8 @@
* You should have received a copy of the GNU Lesser General Public Licence
* along with WinBtrfs. If not, see <http://www.gnu.org/licenses/>. */
+#pragma once
+
#include <shlobj.h>
#include <string>
#include <vector>
diff --git a/dll/shellext/shellbtrfs/scrub.h b/dll/shellext/shellbtrfs/scrub.h
index 8ac94ac0a1..daae71255e 100644
--- a/dll/shellext/shellbtrfs/scrub.h
+++ b/dll/shellext/shellbtrfs/scrub.h
@@ -15,6 +15,8 @@
* You should have received a copy of the GNU Lesser General Public Licence
* along with WinBtrfs. If not, see <http://www.gnu.org/licenses/>. */
+#pragma once
+
#include <windows.h>
#ifndef __REACTOS__
#include "../btrfs.h"
diff --git a/dll/shellext/shellbtrfs/send.h b/dll/shellext/shellbtrfs/send.h
index 713031b359..5d1b939aa9 100644
--- a/dll/shellext/shellbtrfs/send.h
+++ b/dll/shellext/shellbtrfs/send.h
@@ -15,6 +15,8 @@
* You should have received a copy of the GNU Lesser General Public Licence
* along with WinBtrfs. If not, see <http://www.gnu.org/licenses/>. */
+#pragma once
+
#ifdef __REACTOS__
#include "btrfs.h"
#include <stdlib.h>
diff --git a/dll/shellext/shellbtrfs/shellext.h b/dll/shellext/shellbtrfs/shellext.h
index 152f4a1254..a31c44bada 100644
--- a/dll/shellext/shellbtrfs/shellext.h
+++ b/dll/shellext/shellbtrfs/shellext.h
@@ -15,6 +15,8 @@
* You should have received a copy of the GNU Lesser General Public Licence
* along with WinBtrfs. If not, see <http://www.gnu.org/licenses/>. */
+#pragma once
+
#define ISOLATION_AWARE_ENABLED 1
#define STRSAFE_NO_DEPRECATE
diff --git a/dll/shellext/shellbtrfs/volpropsheet.h b/dll/shellext/shellbtrfs/volpropsheet.h
index a0e618b423..6600dbbf4b 100644
--- a/dll/shellext/shellbtrfs/volpropsheet.h
+++ b/dll/shellext/shellbtrfs/volpropsheet.h
@@ -15,6 +15,8 @@
* You should have received a copy of the GNU Lesser General Public Licence
* along with WinBtrfs. If not, see <http://www.gnu.org/licenses/>. */
+#pragma once
+
#include <shlobj.h>
#ifndef __REACTOS__
#include "../btrfsioctl.h"
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9ecbbe2a338619c9d9f7c…
commit 9ecbbe2a338619c9d9f7c52a6e7af24adc5fb174
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Sun Nov 26 14:01:04 2017 +0100
[NTOSKRNL] Use ExAllocatePoolWithQuotaTag() when allocating SystemBuffer for the IRP
That way, in case the system lacks memory, an exception is thrown and IRP isn't sent
to the device with NULL SystemBuffer.
CORE-14048
---
ntoskrnl/io/iomgr/iofunc.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/ntoskrnl/io/iomgr/iofunc.c b/ntoskrnl/io/iomgr/iofunc.c
index bde78e4f96..19f54e070d 100644
--- a/ntoskrnl/io/iomgr/iofunc.c
+++ b/ntoskrnl/io/iomgr/iofunc.c
@@ -516,9 +516,9 @@ IopDeviceFsIoControl(IN HANDLE DeviceHandle,
{
/* Allocate the System Buffer */
Irp->AssociatedIrp.SystemBuffer =
- ExAllocatePoolWithTag(PoolType,
- BufferLength,
- TAG_SYS_BUF);
+ ExAllocatePoolWithQuotaTag(PoolType,
+ BufferLength,
+ TAG_SYS_BUF);
/* Check if we got a buffer */
if (InputBuffer)
@@ -563,9 +563,9 @@ IopDeviceFsIoControl(IN HANDLE DeviceHandle,
{
/* Allocate the System Buffer */
Irp->AssociatedIrp.SystemBuffer =
- ExAllocatePoolWithTag(PoolType,
- InputBufferLength,
- TAG_SYS_BUF);
+ ExAllocatePoolWithQuotaTag(PoolType,
+ InputBufferLength,
+ TAG_SYS_BUF);
/* Copy into the System Buffer */
RtlCopyMemory(Irp->AssociatedIrp.SystemBuffer,