Home | Info | Community | Development | myReactOS | Contact Us
[static]
Definition at line 51 of file fatx.c.
Referenced by FatxFormat().
{ IO_STATUS_BLOCK IoStatusBlock; NTSTATUS Status; PUCHAR NewBootSector; LARGE_INTEGER FileOffset; /* Allocate buffer for new bootsector */ NewBootSector = (PUCHAR)RtlAllocateHeap(RtlGetProcessHeap(), 0, sizeof(FATX_BOOT_SECTOR)); if (NewBootSector == NULL) return STATUS_INSUFFICIENT_RESOURCES; /* Zero the new bootsector */ memset(NewBootSector, 0, sizeof(FATX_BOOT_SECTOR)); /* Copy FAT16 BPB to new bootsector */ memcpy(NewBootSector, BootSector, 18); /* FAT16 BPB length (up to (not including) Res2) */ /* Write sector 0 */ FileOffset.QuadPart = 0ULL; Status = NtWriteFile(FileHandle, NULL, NULL, NULL, &IoStatusBlock, NewBootSector, sizeof(FATX_BOOT_SECTOR), &FileOffset, NULL); if (!NT_SUCCESS(Status)) { DPRINT("NtWriteFile() failed (Status %lx)\n", Status); RtlFreeHeap(RtlGetProcessHeap(), 0, NewBootSector); return Status; } VfatxUpdateProgress(Context, 1); /* Free the new boot sector */ RtlFreeHeap(RtlGetProcessHeap(), 0, NewBootSector); return Status; }