Re: How to use Ramdisk and MyFSD from CE 3.0 to CE.NET by KevinSong
KevinSong
Wed Dec 17 03:50:48 CST 2003
Thank you very much!! Jeremy!
I read your message very well.
I had added debug message to MyFSD source. this make a file(debugxxx.txt).
if MyFSD worked, I will see debug message in the debugxxx.txt file.
I have to some question about FormatPartitionEX().
Well, I wanna link the function FormatPartitionEX() with the dll MyFSD.
I presumed that the order of calling the functions be as follows.
OpenStore(); - CreatePartitionEx() - OpenPartition(); -
FormatPartitionEx();
However, I did call the functions as I described, but I'd got a FALSE return
from the function CreatePartitionEX().
Did I make a wrong order of calling the functions?
If then, what is the right order ?
When calling the function CreatePartitionEX() there is a parameter
"PartitionName",
how can I get that parameter ?
May I set that parameter arbitrarily ? At present, I set arbitrary value for
that parameter.
And I set the Sector Number as 2048 (= Ramdisk Size / 512).
Is it ok ?
Followings are the codes that I used.
Where is wrong this code?
HANDLE hDevice = ActivateDevice(g_szDrvRegPath, 0);
.
.
.
hStore = OpenStore(L"DSK1:");
if(hStore == (HANDLE)INVALID_HANDLE_VALUE || hStore ==
(HANDLE)ERROR_DEVICE_NOT_AVAILABLE)
{
TRACE1(L"OpenStore() : Failed! return %d\n", hStore);
return FALSE;
}
TRACE1(L"OpenStore() : Success! return %d\n", hStore);
bCreate = CreatePartitionEx(hStore, (LPCTSTR)L"MyFSD", 0x3F,
(SECTORNUM)2048);
if(bCreate == FALSE)
{
TRACE0(L"CreatePartitionEx : Failed! return \n");
return FALSE;
}
TRACE1(L"CreatePartitionEx(): Success! return %d\n", hStore);
hPartition = OpenPartition(hStore, (LPCTSTR)L"MyFSD");
if(hPartition == INVALID_HANDLE_VALUE)
{
TRACE1(L"OpenPartition() : Failed! return %d\n", hPartition);
return FALSE;
}
TRACE1(L"OpenPartition(): Success! return %d\n", hStore);
bFormat = FormatPartitionEx(hPartition, 0x3F, FALSE);
if(bFormat == FALSE)
{
TRACE0(L"FormatPartitionEx() : Failed! return \n");
return FALSE;
}
TRACE0(L"FormatPartitionEx() : Successed and Loaded MyFSD! return \n");
"Jeremy Sherrill" <jeremyinbox@hotmail.com> wrote in message
news:eCdiDYAxDHA.1088@tk2msftngp13.phx.gbl...
> > Anyone know how to Install Ramdisk with MyFSD.
> >
> > I succeed Ramdisk Compile. but, "MyFSD" don't worked.
> You need to tell us exactly what didn't work about it. Did you set
> breakpoints in MyFSD? Where? You should have breakpoints in two places
at
> this point: DllMain and MyFSD_MountDisk. Tell us whether or not those
> functions are called. Also, if MyFSD.dll is being loaded, you will see
> something like this in your debug output:
> >>> Loading module MyFSD.dll at address 0x01F20000-0x01F40000
>
> > I insert into debug message. but this FSD don't make debug info.
> FSDs do not make debug info automatically, this is correct. You must set
up
> your debug zones manually in the code for MyFSD. The Platform Builder
> doccumentation has adequate descriptions of this, you should be able to
> implement it. If not, ask that question in a seperate thread because it
is
> a seperate topic.
>
> > I had set registry below.
> >
> > 1. Do i must add any code or any work?
> >
> > 2. How to set "3F"=MyFSD from registry key "PartitionTable".
> > I don't understand 3F value. how to set this value.
>
> You already set this value. Look below at your registry, "3F"="MyFSD".
> Good enough! All you need to do now is call FormatPartitionEx on any
> partition that you want, passing 0x3F as bPartType. That will tell the
> partition driver to set the partition ID on the specified partition to
0x3F.
> Since that value is associated with MyFSD in the registry, Windows CE will
> automatically load MyFSD.DLL and call MyFSD_MountDisk when you mount the
> volume. Mount the volume by either rebooting or by dismounting and
> remounting in the Storage Manager. Since you are using a RAM disk, you
will
> have to dismount and remount in the Storage Manager because rebooting will
> erase the contents of your RAM disk.
>
> The partition ID serves the same purpose as the DefaultFileSystem entry in
> the registry. It tells CE which file system should mount a volume. Using
a
> partition ID has the added benefit of allowing a block device to be
> formatted with any file system and mount the proper file system, so long
as
> the partition ID on the volume is associated in the registry with a proper
> file system.
>
> 4.2 is the first version of CE to utilize partition types in this way.
> Previous .NET versions (4.0, 4.1) use the DefaultFileSystem entry in the
> registry to decide which FSD to load, and CE 3.0 requires that the block
> driver call LoadFSD.
>
> Jeremy
>
> >
> > [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\RamDisk3]
> > "Name"="RAM Disk"
> > "Folder"="RamDisk"
> > "AutoMount"=dword:1
> > "AutoPart"=dword:1
> > "AutoFormat"=dword:1
> > "MountFlags"=dword:0
> > "DefaultFileSystem"="MyFSD"
> >
> > [HKEY_LOCAL_MACHINE\System\StorageManager\MyFSD]
> > "Dll"="MyFSD.DLL"
> >
> > [HKEY_LOCAL_MACHINE\System\StorageManager\PartitionTable]
> > "3F"="MyFSD"
> >
> >
> >
> > "Jeremy Sherrill" <jeremyinbox@hotmail.com> wrote in message
> > news:eHv$iBduDHA.2456@TK2MSFTNGP12.phx.gbl...
> > > Kevin,
> > >
> > > First things first, scrap the ram disk from CE 3.0 and use the CE.NET
> > > version (wince420\public\common\oak\drivers\block\ramdisk). CE.NET no
> > > longer requires the block driver to call LoadFSD. Instead, a system
of
> > > driver profiles and defaults is used. CE 4.2 loads FSDs based on the
> > > partition type of the partition as it exists on the disk. For CE.NET,
> use
> > > the following registry keys to load MyFSD for a RAM disk:
> > >
> > > [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\RamDisk3]
> > > "Name"="RAM Disk"
> > > "Folder"="RamDisk"
> > > "AutoMount"=dword:1
> > > "AutoPart"=dword:1
> > > "AutoFormat"=dword:1
> > > "MountFlags"=dword:0
> > > "DefaultFileSystem"="MyFSD"
> > >
> > > [HKEY_LOCAL_MACHINE\System\StorageManager\MyFSD]
> > > "Dll"="MyFSD.DLL"
> > >
> > > The DefaultFileSystem entry in the ram disk profile refers to a
registry
> > key
> > > in HKEY_LOCAL_MACHINE\System\StorageManager which contains info about
> the
> > > FSD to be loaded. For CE 4.2, it is best to call FormatPartitionEx to
> set
> > > the partition type to a unique value that will associate the partition
> > with
> > > MyFSD. To associate a partition type with MyFSD in CE 4.2, add the
> > > following registry entry:
> > >
> > > [HKEY_LOCAL_MACHINE\System\StorageManager\PartitionTable]
> > > "XY"="MyFSD"
> > >
> > > Replace XY with your unique partition type. By doing this, you
> guarantee
> > > that any partition that is formatted with the MyFSD file system is
> mounted
> > > with MyFSD.
> > >
> > > Jeremy
> > >
> > >
> > > "KevinSong" <songjh98@chol.com> wrote in message
> > > news:ew36rSUuDHA.2132@TK2MSFTNGP10.phx.gbl...
> > > >
> > > > How to use Ramdisk and MyFSD from CE 3.0 to CE.NET
> > > >
> > > > Hi there
> > > > I am porting Ramdisk driver and MyFSD driver CE3.0 to CE.Net.
> > > > This module work fine CE 3.0. but CE.Net don't work.
> > > >
> > > > RAMDISK device is visible Explorer on CE3.0, but .Net is net seen.
> > > > And MyFSD Load is failed(LoadFSDEx()). Then, How to load MyFSD and
> link
> > > > Ramdisk.
> > > > I looking for newsgroup this information. but I don't understand
> > Registry
> > > > setting and How to load MyFSD.
> > > >
> > > > Anybody send me some information. Please.
> > > > I'm sorry. I don't speak english very well. ^__^
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>