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 create it again, I get an error message: "Unable to create partition".
views:
340answers:
1
+2
A:
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.
Shaihi
2010-04-07 11:54:27
is it going to work with Windows CE 5.0 ?
mack369
2010-04-07 13:20:25
Supposed to. Try it out. Here is the reference for CE 5: http://msdn.microsoft.com/en-us/library/ms886165.aspx
Shaihi
2010-04-08 07:25:00