开发者

how to create partition on windows CE device

开发者 https://www.devze.com 2022-12-26 03:38 出处:网络
Is there any tool to create a new partition on windows CE device? Device has a NAND flash memory and initially there were two partitions. Using Storage manager in Control Panel I was able to delete o

Is there any tool to create a new partition on windows CE device?

Device has a NAND flash memory and initially there were two partitions. Using Storage manager in Control Panel I was able to delete one partition but when I want to creat开发者_运维百科e it again, I get an error message: "Unable to create partition".


With the source code of Windows CE 6 you get the BootPart library source code. The location for the source is WINCE600\PUBLIC\COMMON\OAK\DRIVERS\ETHDBG\BOOTPART.

Inside Bootpart.cpp you can find the function BP_OpenPartition that opens/creates a new partition. It basically adds information to the MBR.


The above solution is a bit low level. Here is a way to do it through Win32 API (taken from here):

  • Call OpenStore to get a handle to the store
  • Dismount the store using DismountStore
  • FindFirstPartition/FindNextPartition will iterate over existing partitions and DeletePartition will delete those that can be deleted.
  • GetStoreInfo will get you the number of sectors available for creating a new partition ((STOREINFO.snBiggestPartCreatable)
  • Use CreatePartition to create the partition.

All the pointers to the functions and more information about the storage manager can be found here: Storage Manager Reference


You can see that the links I provided indicate that the functions work on both Windows Mobile 6 and Windows CE 6. Non of the functions are new functionality so they should also work with Windows CE 5.

0

精彩评论

暂无评论...
验证码 换一张
取 消