#include <ntfslib.h>
#include <debug.h>
Go to the source code of this file.
◆ NDEBUG
◆ FillBiosParametersBlock()
Definition at line 37 of file bootsect.c.
38{
39
40
43
45
49}
#define SECTORS_PER_TRACK
#define SECTORS_PER_CLUSTER
Referenced by WriteBootSector().
◆ FillExBiosParametersBlock()
Definition at line 53 of file bootsect.c.
54{
55
56
59
60 ExBiosParametersBlock->MftLocation =
LAYOUT.MftLcn;
61 ExBiosParametersBlock->MftMirrLocation =
LAYOUT.MftMirrLcn;
62
63 ExBiosParametersBlock->ClustersPerMftRecord =
LAYOUT.ClustersPerMftRecord;
64 ExBiosParametersBlock->ClustersPerIndexRecord =
LAYOUT.ClustersPerIndexRecord;
65
66 ExBiosParametersBlock->SerialNumber =
LAYOUT.SerialNumber;
67}
Referenced by WriteBootSector().
◆ FillJumpInstruction()
◆ FillOemId()
◆ WriteBackupBootSector()
Definition at line 75 of file bootsect.c.
76{
82
84 if (!Sector)
86
89
91
97 Sector,
98 Bps,
102 {
103 DPRINT1(
"Backup boot sector write failed (Status %lx)\n",
Status);
104 }
105
107
109}
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
_In_ PIO_STATUS_BLOCK IoStatusBlock
#define NT_SUCCESS(StatCode)
NTSYSAPI NTSTATUS NTAPI NtWriteFile(IN HANDLE hFile, IN HANDLE hEvent OPTIONAL, IN PIO_APC_ROUTINE IoApcRoutine OPTIONAL, IN PVOID IoApcContext OPTIONAL, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN PVOID WriteBuffer, IN ULONG WriteBufferLength, IN PLARGE_INTEGER FileOffset OPTIONAL, IN PULONG LockOperationKey OPTIONAL)
_In_ ULONG _In_ ULONG Offset
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define STATUS_INSUFFICIENT_RESOURCES
Referenced by WriteBootSector().
◆ WriteBootSector()
Definition at line 112 of file bootsect.c.
113{
120
121
122
124
126 if (!BootRegion)
127 {
129 }
130
132
134
137
140
142
143
150 BootRegion,
155 {
156 DPRINT1(
"BootSector write failed. NtWriteFile() failed (Status %lx)\n",
Status);
159 }
160
161
163
165
167}
static VOID FillExBiosParametersBlock(OUT PEXTENDED_BIOS_PARAMETERS_BLOCK ExBiosParametersBlock)
static VOID FillBiosParametersBlock(OUT PBIOS_PARAMETERS_BLOCK BiosParametersBlock)
static NTSTATUS WriteBackupBootSector(IN PBOOT_SECTOR BootSector)
static VOID FillJumpInstruction(OUT PBOOT_SECTOR BootSector)
static VOID FillOemId(OUT PBOOT_SECTOR BootSector)
struct _BOOT_SECTOR * PBOOT_SECTOR
#define BYTES_PER_CLUSTER
__kernel_entry _Inout_ _Inout_ PSIZE_T RegionSize
struct _BootSector BootSector
Referenced by NtfsFormat().