阅读:2043回复:0
binfs分区
HANDLE BP_OpenPartition(DWORD dwStartSector, DWORD dwNumSectors, DWORD dwPartType, BOOL fActive, DWORD dwCreationFlags)
{ DWORD dwPartIndex; BOOL fExists; ASSERT (g_pbMBRSector); if (!IsValidMBR()) { DWORD dwFlags = 0; if (dwCreationFlags == PART_OPEN_EXISTING) { RETAILMSG(1, (TEXT("OpenPartition: Invalid MBR. Cannot open existing partition 0x%x.\r\n"), dwPartType)); return INVALID_HANDLE_VALUE; } RETAILMSG(1, (TEXT("OpenPartition: Invalid MBR. Formatting flash.\r\n"))); if (g_FlashInfo.flashType == NOR) { dwFlags |= FORMAT_SKIP_BLOCK_CHECK; } BP_LowLevelFormat (0,g_FlashInfo.dwNumBlocks, dwFlags); dwPartIndex = 0; fExists = FALSE; } else { fExists = GetPartitionTableIndex(dwPartType, fActive, &dwPartIndex); } RETAILMSG(1, (TEXT("OpenPartition: Partition Exists=0x%x for part 0x%x.\r\n"), fExists, dwPartType)); if (fExists) { // Partition was found. if (dwCreationFlags == PART_CREATE_NEW) return INVALID_HANDLE_VALUE; if (g_partStateTable[dwPartIndex].pPartEntry == NULL) { // Open partition. If this is the boot section partition, then file pointer starts after MBR g_partStateTable[dwPartIndex].pPartEntry = (PPARTENTRY)(g_pbMBRSector + PARTTABLE_OFFSET + sizeof(PARTENTRY)*dwPartIndex); g_partStateTable[dwPartIndex].dwDataPointer = 0; } return (HANDLE)&g_partStateTable[dwPartIndex]; } else { // If there are already 4 partitions, or creation flag specified OPEN_EXISTING, fail. if ((dwPartIndex == NUM_PARTS) || (dwCreationFlags == PART_OPEN_EXISTING)) return INVALID_HANDLE_VALUE; // Create new partition return CreatePartition (dwStartSector, dwNumSectors, dwPartType, fActive, dwPartIndex); } return INVALID_HANDLE_VALUE; } 请教各位高手 binfs分区: BP_LowLevelFormat (0,g_FlashInfo.dwNumBlocks, dwFlags); 这个函数的参数要改吗 |
|