For Programmers: Free Programming Magazines  


Home > Archive > Smartphone Developer Forum > March 2006 > How do you format a Storage Card on the device?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How do you format a Storage Card on the device?
John Nossluap

2006-03-21, 3:57 am

Is it possible to format a storage card (minisd) on device side?
Something like the Win32 API function SHFormatDrive() perhaps..

Managed or unmanaged, official or an unofficial way of accomplishing
it doesn't initially matter.
riki

2006-03-21, 7:58 am

John Nossluap wrote:
> Is it possible to format a storage card (minisd) on device side?
> Something like the Win32 API function SHFormatDrive() perhaps..
>
> Managed or unmanaged, official or an unofficial way of accomplishing
> it doesn't initially matter.


officially the storage manager is designed for this:
http://msdn.microsoft.com/library/d...erfunctions.asp

the trouble is the lib file isn't in the SDK and i can't remember off
hand which dll implments these functions.

riki


----
No man is an island, but then, no man is a potato salad, either.
ThemeChanger for Smartphone : http://homepages.inspire.net.nz/~gambit/
AbstractStart for Smartphone :
http://homepages.inspire.net.nz/~gambit/AbstractStart/
Latest Betas have WM5 layout and speed dial support
John Nossluap

2006-03-21, 7:58 am

riki wrote:

> officially the storage manager is designed for this:
> http://msdn.microsoft.com/library/d...erfunctions.asp
>
> the trouble is the lib file isn't in the SDK and i can't remember off
> hand which dll implments these functions.


Wonderful riki, at least it's a start.

Unfortunately Google didn't provide any leads to where I could get my
hands on the library. Most ppl seems to wonder the same thing? Do you
think you have to be an OEM and sign a Platform Builder contract with MS
or something to get it and the rest of the kit stuff?
Yaroslav Goncharov

2006-03-21, 10:09 pm

Take a look at IOCTL_DISK_FORMAT_VOLUME:
http://msdn.microsoft.com/library/d...rmat_volume.asp

--
Yaroslav Goncharov
Spb Software House


"John Nossluap" <noadress@nodomain.com> wrote in message
news:eFDaDwMTGHA.4340@tk2msftngp13.phx.gbl...
> Is it possible to format a storage card (minisd) on device side? Something
> like the Win32 API function SHFormatDrive() perhaps..
>
> Managed or unmanaged, official or an unofficial way of accomplishing
> it doesn't initially matter.



John Nossluap

2006-03-21, 10:09 pm

Yaroslav Goncharov wrote:
> Take a look at IOCTL_DISK_FORMAT_VOLUME:
> http://msdn.microsoft.com/library/d...rmat_volume.asp
>


Thanks! I'll try both methods. I've located the storeapi library now as
well.

What's really the difference between formatting a card using the Store
Manager API functions (FormatStore/FormatPartition) and the
IOCTL_DISK_FORMAT_VOLUME/DeviceIOControl combo if we're assuming the
target file system should be FAT?
Yaroslav Goncharov

2006-03-22, 4:06 am

The method below is also supported on older Windows CE 3.0 based platforms
(e. g. Pocket PC 2002).

--
Yaroslav Goncharov
Spb Software House


"John Nossluap" <noadress@nodomain.com> wrote in message
news:uydCUAQTGHA.5172@TK2MSFTNGP12.phx.gbl...
> Yaroslav Goncharov wrote:
>
> Thanks! I'll try both methods. I've located the storeapi library now as
> well.
>
> What's really the difference between formatting a card using the Store
> Manager API functions (FormatStore/FormatPartition) and the
> IOCTL_DISK_FORMAT_VOLUME/DeviceIOControl combo if we're assuming the
> target file system should be FAT?



John Nossluap

2006-03-22, 4:06 am

Yaroslav Goncharov wrote:

> The method below is also supported on older Windows CE 3.0 based platforms
> (e. g. Pocket PC 2002).


The DeviceIOControl method seems to work great under my 2003SE PocketPC
device but not on Smartphones using the same OS.

Under Smartphone devices DeviceIOControl fails and GetLastError()
returns 31 (ERROR_GEN_FAILURE = A device attached to the system is not
functioning.)

Isnt this IOCTL action supported on SE2003 Smartphones?
Yaroslav Goncharov

2006-03-23, 4:13 am

Is there a chance that a storage card is mounted under a different path on
this Smartphone device (i.e. not \Storage Card) and you used a wrong
argument in CreateFile?

--
Yaroslav Goncharov
Spb Software House


"John Nossluap" <noadress@nodomain.com> wrote in message
news:O7hZc4YTGHA.5924@TK2MSFTNGP09.phx.gbl...
> Yaroslav Goncharov wrote:
>
>
> The DeviceIOControl method seems to work great under my 2003SE PocketPC
> device but not on Smartphones using the same OS.
>
> Under Smartphone devices DeviceIOControl fails and GetLastError() returns
> 31 (ERROR_GEN_FAILURE = A device attached to the system is not
> functioning.)
>
> Isnt this IOCTL action supported on SE2003 Smartphones?



John Nossluap

2006-03-23, 8:08 am

Yaroslav Goncharov wrote:
> Is there a chance that a storage card is mounted under a different path on
> this Smartphone device (i.e. not \Storage Card) and you used a wrong
> argument in CreateFile?


No, I verified it multiple times, and I seem to receive a valid handle
from CreateFile. Its always the DeviceIOControl call that fails under
Smartphone devices.

Hasn't anyone tried to format a card on a SP2003SE?
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com