diff --git a/drivers/filesystems/btrfs/balance.c b/drivers/filesystems/btrfs/balance.c index b7794125deb..ecb80adc1b3 100644 --- a/drivers/filesystems/btrfs/balance.c +++ b/drivers/filesystems/btrfs/balance.c @@ -3599,7 +3599,11 @@ NTSTATUS start_balance(device_extension* Vcb, void* data, ULONG length, KPROCESS Vcb->balance.status = STATUS_SUCCESS; KeInitializeEvent(&Vcb->balance.event, NotificationEvent, !Vcb->balance.paused); +#if defined(__REACTOS__) && (NTDDI_VERSION < NTDDI_VISTA) + Status = PsCreateSystemThread(&Vcb->balance.thread, 0, &system_thread_attributes, NULL, NULL, balance_thread, Vcb); +#else Status = PsCreateSystemThread(&Vcb->balance.thread, 0, NULL, NULL, NULL, balance_thread, Vcb); +#endif if (!NT_SUCCESS(Status)) { ERR("PsCreateSystemThread returned %08x\n", Status); return Status; @@ -3679,7 +3683,11 @@ NTSTATUS look_for_balance_item(_Requires_lock_held_(_Curr_->tree_lock) device_ex Vcb->balance.status = STATUS_SUCCESS; KeInitializeEvent(&Vcb->balance.event, NotificationEvent, !Vcb->balance.paused); +#if defined(__REACTOS__) && (NTDDI_VERSION < NTDDI_VISTA) + Status = PsCreateSystemThread(&Vcb->balance.thread, 0, &system_thread_attributes, NULL, NULL, balance_thread, Vcb); +#else Status = PsCreateSystemThread(&Vcb->balance.thread, 0, NULL, NULL, NULL, balance_thread, Vcb); +#endif if (!NT_SUCCESS(Status)) { ERR("PsCreateSystemThread returned %08x\n", Status); return Status; @@ -3876,7 +3884,11 @@ NTSTATUS remove_device(device_extension* Vcb, void* data, ULONG length, KPROCESS Vcb->balance.status = STATUS_SUCCESS; KeInitializeEvent(&Vcb->balance.event, NotificationEvent, !Vcb->balance.paused); +#if defined(__REACTOS__) && (NTDDI_VERSION < NTDDI_VISTA) + Status = PsCreateSystemThread(&Vcb->balance.thread, 0, &system_thread_attributes, NULL, NULL, balance_thread, Vcb); +#else Status = PsCreateSystemThread(&Vcb->balance.thread, 0, NULL, NULL, NULL, balance_thread, Vcb); +#endif if (!NT_SUCCESS(Status)) { ERR("PsCreateSystemThread returned %08x\n", Status); dev->reloc = false; diff --git a/drivers/filesystems/btrfs/btrfs.c b/drivers/filesystems/btrfs/btrfs.c index 2977667de9a..da102a98136 100644 --- a/drivers/filesystems/btrfs/btrfs.c +++ b/drivers/filesystems/btrfs/btrfs.c @@ -107,7 +107,9 @@ HANDLE degraded_wait_handle = NULL, mountmgr_thread_handle = NULL; bool degraded_wait = true; KEVENT mountmgr_thread_event; bool shutting_down = false; - +#if defined(__REACTOS__) && (NTDDI_VERSION < NTDDI_VISTA) +OBJECT_ATTRIBUTES system_thread_attributes = RTL_CONSTANT_OBJECT_ATTRIBUTES(NULL, OBJ_KERNEL_HANDLE); +#endif #ifdef _DEBUG PFILE_OBJECT comfo = NULL; PDEVICE_OBJECT comdo = NULL; @@ -4020,7 +4022,11 @@ static NTSTATUS create_calc_threads(_In_ PDEVICE_OBJECT DeviceObject) { Vcb->calcthreads.threads[i].DeviceObject = DeviceObject; KeInitializeEvent(&Vcb->calcthreads.threads[i].finished, NotificationEvent, false); +#if defined(__REACTOS__) && (NTDDI_VERSION < NTDDI_VISTA) + Status = PsCreateSystemThread(&Vcb->calcthreads.threads[i].handle, 0, &system_thread_attributes, NULL, NULL, calc_thread, &Vcb->calcthreads.threads[i]); +#else Status = PsCreateSystemThread(&Vcb->calcthreads.threads[i].handle, 0, NULL, NULL, NULL, calc_thread, &Vcb->calcthreads.threads[i]); +#endif if (!NT_SUCCESS(Status)) { ULONG j; @@ -4826,7 +4832,11 @@ static NTSTATUS mount_vol(_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp) { KeInitializeEvent(&Vcb->flush_thread_finished, NotificationEvent, false); +#if defined(__REACTOS__) && (NTDDI_VERSION < NTDDI_VISTA) + Status = PsCreateSystemThread(&Vcb->flush_thread_handle, 0, &system_thread_attributes, NULL, NULL, flush_thread, NewDeviceObject); +#else Status = PsCreateSystemThread(&Vcb->flush_thread_handle, 0, NULL, NULL, NULL, flush_thread, NewDeviceObject); +#endif if (!NT_SUCCESS(Status)) { ERR("PsCreateSystemThread returned %08x\n", Status); goto exit; @@ -5518,7 +5528,11 @@ static void init_serial(bool first_time) { ERR("IoGetDeviceObjectPointer returned %08x\n", Status); if (first_time) { +#if defined(__REACTOS__) && (NTDDI_VERSION < NTDDI_VISTA) + Status = PsCreateSystemThread(&serial_thread_handle, 0, &system_thread_attributes, NULL, NULL, serial_thread, NULL); +#else Status = PsCreateSystemThread(&serial_thread_handle, 0, NULL, NULL, NULL, serial_thread, NULL); +#endif if (!NT_SUCCESS(Status)) { ERR("PsCreateSystemThread returned %08x\n", Status); return; @@ -5990,7 +6004,11 @@ NTSTATUS __stdcall DriverEntry(_In_ PDRIVER_OBJECT DriverObject, _In_ PUNICODE_S IoInvalidateDeviceRelations(bde->buspdo, BusRelations); +#if defined(__REACTOS__) && (NTDDI_VERSION < NTDDI_VISTA) + Status = PsCreateSystemThread(°raded_wait_handle, 0, &system_thread_attributes, NULL, NULL, degraded_wait_thread, NULL); +#else Status = PsCreateSystemThread(°raded_wait_handle, 0, NULL, NULL, NULL, degraded_wait_thread, NULL); +#endif if (!NT_SUCCESS(Status)) WARN("PsCreateSystemThread returned %08x\n", Status); @@ -6013,7 +6031,11 @@ NTSTATUS __stdcall DriverEntry(_In_ PDRIVER_OBJECT DriverObject, _In_ PUNICODE_S KeInitializeEvent(&mountmgr_thread_event, NotificationEvent, false); +#if defined(__REACTOS__) && (NTDDI_VERSION < NTDDI_VISTA) + Status = PsCreateSystemThread(&mountmgr_thread_handle, 0, &system_thread_attributes, NULL, NULL, mountmgr_thread, NULL); +#else Status = PsCreateSystemThread(&mountmgr_thread_handle, 0, NULL, NULL, NULL, mountmgr_thread, NULL); +#endif if (!NT_SUCCESS(Status)) WARN("PsCreateSystemThread returned %08x\n", Status); diff --git a/drivers/filesystems/btrfs/btrfs_drv.h b/drivers/filesystems/btrfs/btrfs_drv.h index 67cb24902c7..7e54e067d5d 100644 --- a/drivers/filesystems/btrfs/btrfs_drv.h +++ b/drivers/filesystems/btrfs/btrfs_drv.h @@ -1756,6 +1756,8 @@ typedef BOOLEAN (*tCcCopyReadEx)(PFILE_OBJECT FileObject, PLARGE_INTEGER FileOff #if defined(__REACTOS__) && (NTDDI_VERSION < NTDDI_VISTA) typedef struct _ECP_LIST ECP_LIST; typedef struct _ECP_LIST *PECP_LIST; + +extern OBJECT_ATTRIBUTES system_thread_attributes; #endif typedef VOID (*tCcSetAdditionalCacheAttributesEx)(PFILE_OBJECT FileObject, ULONG Flags); diff --git a/drivers/filesystems/btrfs/fsctl.c b/drivers/filesystems/btrfs/fsctl.c index 039e828e962..d4e0ec56501 100644 --- a/drivers/filesystems/btrfs/fsctl.c +++ b/drivers/filesystems/btrfs/fsctl.c @@ -4751,7 +4751,11 @@ static NTSTATUS resize_device(device_extension* Vcb, void* data, ULONG len, PIRP space_list_subtract2(&dev->space, NULL, br->size, delta, NULL, NULL); +#if defined(__REACTOS__) && (NTDDI_VERSION < NTDDI_VISTA) + Status = PsCreateSystemThread(&Vcb->balance.thread, 0, &system_thread_attributes, NULL, NULL, balance_thread, Vcb); +#else Status = PsCreateSystemThread(&Vcb->balance.thread, 0, NULL, NULL, NULL, balance_thread, Vcb); +#endif if (!NT_SUCCESS(Status)) { ERR("PsCreateSystemThread returned %08x\n", Status); goto end; diff --git a/drivers/filesystems/btrfs/scrub.c b/drivers/filesystems/btrfs/scrub.c index d1994b7fe63..182f667f301 100644 --- a/drivers/filesystems/btrfs/scrub.c +++ b/drivers/filesystems/btrfs/scrub.c @@ -3292,7 +3292,11 @@ NTSTATUS start_scrub(device_extension* Vcb, KPROCESSOR_MODE processor_mode) { Vcb->scrub.error = STATUS_SUCCESS; KeInitializeEvent(&Vcb->scrub.event, NotificationEvent, !Vcb->scrub.paused); +#if defined(__REACTOS__) && (NTDDI_VERSION < NTDDI_VISTA) + Status = PsCreateSystemThread(&Vcb->scrub.thread, 0, &system_thread_attributes, NULL, NULL, scrub_thread, Vcb); +#else Status = PsCreateSystemThread(&Vcb->scrub.thread, 0, NULL, NULL, NULL, scrub_thread, Vcb); +#endif if (!NT_SUCCESS(Status)) { ERR("PsCreateSystemThread returned %08x\n", Status); return Status; diff --git a/drivers/filesystems/btrfs/send.c b/drivers/filesystems/btrfs/send.c index 4737be0a85a..9f51a24b58f 100644 --- a/drivers/filesystems/btrfs/send.c +++ b/drivers/filesystems/btrfs/send.c @@ -3810,7 +3810,11 @@ NTSTATUS send_subvol(device_extension* Vcb, void* data, ULONG datalen, PFILE_OBJ InterlockedIncrement(&Vcb->running_sends); +#if defined(__REACTOS__) && (NTDDI_VERSION < NTDDI_VISTA) + Status = PsCreateSystemThread(&send->thread, 0, &system_thread_attributes, NULL, NULL, send_thread, context); +#else Status = PsCreateSystemThread(&send->thread, 0, NULL, NULL, NULL, send_thread, context); +#endif if (!NT_SUCCESS(Status)) { ERR("PsCreateSystemThread returned %08x\n", Status); ccb->send = NULL;