diff --git a/reactos/drivers/filesystems/btrfs/CMakeLists.txt b/reactos/drivers/filesystems/btrfs/CMakeLists.txt
index cd3d68d9c61..b39737e3734 100644
--- a/reactos/drivers/filesystems/btrfs/CMakeLists.txt
+++ b/reactos/drivers/filesystems/btrfs/CMakeLists.txt
@@ -25,12 +25,6 @@ list(APPEND SOURCE
add_library(btrfs SHARED ${SOURCE} btrfs.rc)
-if(NOT MSVC)
- replace_compile_flags("-Werror" " ")
-else()
- replace_compile_flags("/we\"4189\"" " ")
-endif()
-
add_definitions(-D__KERNEL__)
set_module_type(btrfs kernelmodedriver)
target_link_libraries(btrfs ntoskrnl_vista ${PSEH_LIB})
diff --git a/reactos/drivers/filesystems/btrfs/create.c b/reactos/drivers/filesystems/btrfs/create.c
index 5a3c4b744bc..e428fef9fb5 100644
--- a/reactos/drivers/filesystems/btrfs/create.c
+++ b/reactos/drivers/filesystems/btrfs/create.c
@@ -15,7 +15,9 @@
* You should have received a copy of the GNU Lesser General Public Licence
* along with WinBtrfs. If not, see . */
+#ifndef __REACTOS__
#include
+#endif /* __REACTOS__ */
#include "btrfs_drv.h"
extern PDEVICE_OBJECT devobj;
diff --git a/reactos/drivers/filesystems/btrfs/fileinfo.c b/reactos/drivers/filesystems/btrfs/fileinfo.c
index 5f6ee5e4a4d..02221d41d3e 100644
--- a/reactos/drivers/filesystems/btrfs/fileinfo.c
+++ b/reactos/drivers/filesystems/btrfs/fileinfo.c
@@ -2984,6 +2984,7 @@ end:
return Status;
}
+#ifndef __REACTOS__
static NTSTATUS STDCALL fill_in_file_standard_link_information(FILE_STANDARD_LINK_INFORMATION* fsli, fcb* fcb, file_ref* fileref, LONG* length) {
TRACE("FileStandardLinkInformation\n");
@@ -2998,6 +2999,7 @@ static NTSTATUS STDCALL fill_in_file_standard_link_information(FILE_STANDARD_LIN
return STATUS_SUCCESS;
}
+#endif /* __REACTOS__ */
typedef struct {
UNICODE_STRING name;
@@ -3280,6 +3282,7 @@ end:
return Status;
}
+#ifndef __REACTOS__
static NTSTATUS STDCALL fill_in_hard_link_information(FILE_LINKS_INFORMATION* fli, fcb* fcb, LONG* length) {
KEY searchkey;
traverse_ptr tp, next_tp;
@@ -3465,6 +3468,7 @@ end:
}
return Status;
}
+#endif /* __REACTOS__ */
static NTSTATUS STDCALL query_info(device_extension* Vcb, PFILE_OBJECT FileObject, PIRP Irp) {
PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation(Irp);
diff --git a/reactos/drivers/filesystems/btrfs/read.c b/reactos/drivers/filesystems/btrfs/read.c
index a0a12d92a1d..9cbe2043a47 100644
--- a/reactos/drivers/filesystems/btrfs/read.c
+++ b/reactos/drivers/filesystems/btrfs/read.c
@@ -602,7 +602,7 @@ NTSTATUS STDCALL drv_read(PDEVICE_OBJECT DeviceObject, PIRP Irp) {
Status = STATUS_SUCCESS;
- try {
+ _SEH2_TRY {
if (!FileObject->PrivateCacheMap) {
CC_FILE_SIZES ccfs;
@@ -635,9 +635,9 @@ NTSTATUS STDCALL drv_read(PDEVICE_OBJECT DeviceObject, PIRP Irp) {
}
TRACE("CcCopyRead finished\n");
}
- } except (EXCEPTION_EXECUTE_HANDLER) {
- Status = GetExceptionCode();
- }
+ } _SEH2_EXCEPT (EXCEPTION_EXECUTE_HANDLER) {
+ Status = _SEH2_GetExceptionCode();
+ } _SEH2_END;
if (NT_SUCCESS(Status)) {
Status = Irp->IoStatus.Status;
diff --git a/reactos/drivers/filesystems/btrfs/write.c b/reactos/drivers/filesystems/btrfs/write.c
index f723c638b88..293182ca228 100644
--- a/reactos/drivers/filesystems/btrfs/write.c
+++ b/reactos/drivers/filesystems/btrfs/write.c
@@ -3086,6 +3086,9 @@ static NTSTATUS STDCALL do_splits(device_extension* Vcb, LIST_ENTRY* rollback) {
if (t->parent) {
LIST_ENTRY* le2;
KEY firstitem = {0xcccccccccccccccc,0xcc,0xcccccccccccccccc};
+#ifdef __REACTOS__
+ (void)firstitem;
+#endif
done_deletions = TRUE;