[0.4.13][BTRFS] Create system threads with OBJ_KERNEL_HANDLE

CORE-16375 #1914

Thanks to patches author ThFabba.
According to JIRA user 'Zero3k' this allows to format a
BTRFS drive again without INVALID_KERNEL_HANDLE BSOD.

Master remains affected,
our devs wait for upstream integration
This commit is contained in:
Joachim Henze 2019-10-13 22:11:43 +02:00
parent e2e90230d1
commit c722bc867e
6 changed files with 49 additions and 1 deletions

View file

@ -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;