How to create partition in flash and access flash in application?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance





There are two questions I met:



1.I want to create two partition in flash. How to do ?

The flash is M-System's mDOC (DiskOnChip) G3.



2.I want to access flash directly in application. But I always failed, GOD
save me~~~~



I read the document downloaded from M-System¡¯s site. It tells me to do like
the following steps:



1. In platform.reg :



[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\TrueFFS]

¡°Dll¡± = ¡°TrueFFS.dll¡±

¡°Prefix¡± = ¡°DSK¡±

¡°Order¡± = dword:1

¡°Ioctl¡± = dword:4

¡°FSD¡± = ¡°FATFS.DLL¡±

¡°WindowBase¡± = dword:d0000

¡°DocBase10¡± = dword:d8000

¡°DeviceArrayIndex¡± = dword:0

"IClass"="{A4E7EDDA-E575-4252-9D6B-4195D48BB865}" ;CE.NET only



2£®In application:



hDev= CreateFile(TEXT("DSK1:"),

GENERIC_READ|GENERIC_WRITE,

0,

NULL,

OPEN_EXISTING,

0,

NULL);

if(hDev ==INVALID_HANDLE_VALUE)

{

TRACE(TEXT("Binding DiskOnChip driver failed .error

%ld\n"),GetLastError());

hDev = NULL;

return 1;

}

//Calling GetInfo extended function

TRACE(TEXT("Calling GetInfo\n"));

// get DiskOnChip information

if(DeviceIoControl(hDev,

FL_IOCTL_GET_INFO,

NULL,

0,

&diskInfoOutput,

sizeof(flDiskInfoOutput),

&dwGarbage,

NULL));



But I always can not CreateFile successfully by this way.



Who can tell me what else should I do? Is there any wrong Parameter?



I¡¯m depressed with it for several days. Please help me!!!


.



Relevant Pages