DWORD dwLastLogSector = LastLogSector();
if (dwLastLogSector == INVALID_ADDR)
return INVALID_HANDLE_VALUE;
// Determine the number of blocks to reserve for the FAL compaction when creating an extended partition.
DWORD dwReservedBlocks = g_FlashInfo.dwNumBlocks / PERCENTAGE_OF_MEDIA_TO_RESERVE;
if((dwReservedBlocks = g_FlashInfo.dwNumBlocks / PERCENTAGE_OF_MEDIA_TO_RESERVE) < MINIMUM_FLASH_BLOCKS_TO_RESERVE) {
dwReservedBlocks = MINIMUM_FLASH_BLOCKS_TO_RESERVE;
}