From: Eric on
OS:
WinXP Media Center Edition
Version 2002
Service Pack 2
Hi,
I have a digital picture frame, its basically a USB key, just looks
different. It shows up as my local Drive L: and in Device Manager it shows
up under Disk Drives as "Amlogic Picture Frame USB Device" (5 times)

I can use windows format (right click on drive L: select format) to format
the frame ok.
I'm trying to do the same thing in software.
1 Call Createfile to get a handle to \\.\L: (handle comes back valid)
2 Do a DeviceIoControl to get the IOCTL_GET_DRIVE_GEOMETRY That works
ok, i get reasonable geometry back
MediaType is 11 /*Removable Media*/
Cylinders=15
TracksPerCylinder=255 <= kinda weird but rational

I then Lock the volume using FSCTL_LOCK_VOLUME, result is good, but when i
call DeviceIoControl with IOCTL_DISK_FORMAT_TRACKS I always get "The
request is not supported" from GetLastError()
I setup the FormatParams like this
MediaType=11
StartCylinderNumber=0
EndCylinderNumber=14
StartHeadNumber=0
EndHeadNumber=254

What am i missing?
Thanks
Eric
From: Kellie Fitton on
On Aug 18, 3:24 am, Eric <No...(a)invalid.com> wrote:
> OS:
> WinXP Media Center Edition
> Version 2002
> Service Pack 2
> Hi,
> I have a digital picture frame, its basically a USB key, just looks
> different. It shows up as my local Drive L: and in Device Manager it shows
> up under Disk Drives as "Amlogic Picture Frame USB Device" (5 times)
>
> I can use windows format (right click on drive L: select format) to format
> the frame ok.
> I'm trying to do the same thing in software.
> 1 Call Createfile to get a handle to \\.\L: (handle comes back valid)
> 2 Do a DeviceIoControl to get the IOCTL_GET_DRIVE_GEOMETRY That works
> ok, i get reasonable geometry back
> MediaType is 11 /*Removable Media*/
> Cylinders=15
> TracksPerCylinder=255 <= kinda weird but rational
>
> I then Lock the volume using FSCTL_LOCK_VOLUME, result is good, but when i
> call DeviceIoControl with IOCTL_DISK_FORMAT_TRACKS I always get "The
> request is not supported" from GetLastError()
> I setup the FormatParams like this
> MediaType=11
> StartCylinderNumber=0
> EndCylinderNumber=14
> StartHeadNumber=0
> EndHeadNumber=254
>
> What am i missing?
> Thanks
> Eric


Hi,

The following disk control code are used to format a specified
and contiguous set of tracks on a floppy disk drive:

IOCTL_DISK_FORMAT_TRACKS

IOCTL_DISK_FORMAT_TRACKS_EX

http://msdn2.microsoft.com/en-us/library/aa365161.aspx

http://msdn2.microsoft.com/en-us/library/aa365164.aspx

Kellie.