[SETUPLIB] Lock the BTRFS volume before installing the new bootsector code.
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sun, 11 Nov 2018 19:31:35 +0000 (20:31 +0100)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sun, 11 Nov 2018 20:55:48 +0000 (21:55 +0100)
commitf527e23aa75e8ae3fa87b075f205513a35789403
treeed553ea69c4db2cdc9bc3fd62d08575db4d84d1a
parentbfb2b88f822733fe3c56cfd9f8edfad4a9742aa9
[SETUPLIB] Lock the BTRFS volume before installing the new bootsector code.

CORE-15334 CORE-15339

The BTRFS driver requires the volume to be locked in order to modify
the first sectors of the partition, even though they are outside the
file-system space / in the reserved area (they are situated before
the super-block at 0x1000) and is in principle allowed by the NT
storage stack.
So we lock here in order to write the bootsector at sector 0.
If locking fails, we ignore and continue nonetheless.

See also the following links for reference:
https://stackoverflow.com/a/12928934
https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-writefile
https://support.microsoft.com/en-us/help/942448/changes-to-the-file-system-and-to-the-storage-stack-to-restrict-direct
base/setup/lib/bootsup.c