Share via


BP_OpenPartition (Windows CE 5.0)

Send Feedback

This function opens or creates a partition.

HANDLE BP_OpenPartition(DWORD dwStartSector, DWORD dwNumSectors,DWORD dwPartType,BOOL fActive,DWORD dwCreationFlags);

Parameters

  • dwStartSector
    [in] Logical sector to the start of the partition. This value should be set to NEXT_FREE_LOC if no sector is specified. This parameter is ignored if an existing partition is opened.
  • dwNumSectors
    [in] Number of logical sectors of the partition. This value can be set to USE_REMAINING_SPACE to indicate that the remaining space on the flash for the partition should be used. The USE_REMAINING_SPACE value should only be used when creating an extended partition. This parameter is ignored if an existing partition is opened.
  • dwPartType
    [in] Type of partition to open or create. The following table shows the possible values for dwPartType.
    Value Description
    PART_BOOTSECTION Creates a boot section that can be used to store boot arguments. All flash blocks in the partition are marked as read-only.
    PART_BINFS Creates a BinFS partition. All flash blocks in the partition are marked as read-only.
    PART_EXTENDED Creates an extended partition that can be used to store one or more data partitions, such as FATFS. If dwStartSector is not on a block boundary then it is incremented to start at the next block boundary.
  • fActive
    [in] Set to TRUE to indicate that the partition is active. Set to FALSE for inactive.
  • dwCreationFlags
    [in] Value that stores information for opening or creating a partition. The following table shows the possible values for dwCreationFlags.
    Value Description
    PART_CREATE_NEW Creates a partition. Fails if a partition already exists.
    PART_OPEN_EXISTING Opens an existing partition. Fails if the partition does not exist.
    PART_OPEN_ALWAYS Creates a partition if it does not exist or opens a partition if it does exist.

Return Values

Returns a handle to the partition on success. Returns INVALID_HANDLE_VALUE on an error.

Requirements

OS Versions: Windows CE .NET 4.2 and later.
Header: Bootpart.h
Link Library: Bootpart.lib

See Also

BinFS and the Bootpart Library | Flash Media Drivers

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.