Re: CreateDevice: illegal entry point combination in driver DLL




Thank you Bruce,

Your advice worked.

all my best,
johnh


"Bruce Eitman [eMVP]" wrote:

Yes, but the def file doesn't need to specify the FMD functions, only the
DSK functions.

Take a look at
C:\WINCE500\PUBLIC\COMMON\OAK\DRIVERS\BLOCK\MSFLASHFMD\STRATA\STRATAD

--
Bruce Eitman (eMVP)
Senior Engineer
Bruce.Eitman AT EuroTech DOT com
My BLOG http://geekswithblogs.net/bruceeitman

EuroTech Inc.
www.EuroTech.com

"jhendrix58" <jhendrix58@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:E49CFD04-9A3D-4982-995D-503626048D4A@xxxxxxxxxxxxxxxx
Thank you, Dean,

I think I understand your point, that:

1) the FMD is lower-level than a standard stream driver, and
2) that CreateDevice() expects a standard stream driver.

Consequently, CreateDevice() cannot be expected to successfully process
FMD.

Furthermore, you pointed out that the FAL/FMD working together comprise a
driver and that the FAL exposes DSK_XXX APIs that CreateDevice CAN handle.

OK, that makes sense, but I left am wondering how to do this.

In looking at the FAL source code see that the FAL.lib and the FMD.lib are
to be linking into FLASHDRV.DLL.

Would i do this by creating a >DEF that specifies both FAL and my FMD libs
as inputs and specifies the DSK_XXX APIs as exports and FLASHDRV as the
library?







"Dean Ramsier" wrote:

The FMD interface that you're using is not a standard stream driver.
Instead, it is the lower level portion of an overall FAL/FMD driver. The
FAL component implements the standard driver entry point functions, and
it
calls down to the FMD interface that you write in your driver.

You need to link your FMD together with the FAL in load the resulting
driver.

--
Dean Ramsier - eMVP
BSQUARE Corporation


"jhendrix58" <jhendrix58@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:CE4F79CF-8E29-457F-B72D-85FBD3C44AEB@xxxxxxxxxxxxxxxx
hi all,

I just encountered a something that is puzzling me.

I am developing a Flash Media Driver (FMD) for a CE 5.0 project.

I am attempting to implement a FMD for a Flash. My first step is to
create
a DLL of an essentially empty FMD_XXX functions that just return
success
and
print a debug message when called.

At this point I encountered a failure when the CreateDevices() is
processing
the DLL. The message emitted is "CreateDevice: illegal entry point
combination in driver DLL..."

When stepping through CreateDevices()'s code with a debugger I
discovered
a
complicated "if" statement that validates the presence of several APIs.
It
first validates that FMD_Init() and FMD_Deinit() can be obtained from
the
DLL. Then, if a devicename is present, it proceeds to validate other
API's
were obtained from the DLL. Specifically, it validates that FMD_Read()
and
FMD_Write() were obtained.

The problem is that , according to msdn, the FMD's APIs are only
comprised
of

FMD_Deinit
FMD_EraseBlock
FMD_GetBlockStatus
FMD_GetInfo
FMD_Init
FMD_OEMIoControl
FMD_PowerDown
FMD_PowerUp
FMD_ReadSector
FMD_SetBlockStatus
FMD_WriteSector

As far as I can tell, the FMD does not require a FMD_Read() or
FMD_Write()
APIs.

More detail: while stepping through CreateDevice I saw that the code
was
taking the FMD's prefix, which I set to "FMD" and appended a "1" to it
and
created a "DeviceName" of "FMD1".

Because a Device name was created by the code, the complicated if
statement
I previously described, checks for APIs like FMD_Read(), determines it
is
not
in the DLL and prints out "CreateDevice: illegal entry point
combination
in
driver DLL"

I have the idea that CreateDevice should not be trying to process this
particular DLL.

More details: My registry settings are:

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\NDFMD]

"Dll"="ndfmd.dll"
"Prefix"="DSK"



;; cause the FS to be automatically mounted

[HKEY_LOCAL_MACHINE\System\StorageManager\AutoLoad\MyPDCFS]

"DriverPath"="drivers\\builtin\\NDFMD"


; loadflags == 1 specifies synchronous loading (would async loading be
better?)
"LoadFlags"=dword:00000001



; bootphase == 2 specifies that the file system is loaded after the
mounting
of the user hive
"BootPhase"=dword:00000002



"Dll"="OurFileSystem.dll"

; paging = 0 specifies that paging is disable

"Paging"=dword:00000000



"testint"=dword:00000001



;

[HKEY_LOCAL_MACHINE\System\StorageManager\Profile\NdfmdPro\FATFS]

; accept default FATFS settings, except for the following

"EnableDataCacheWarm"=dword:0 ; disable warming

"EnableFatCacheWarm"=dword:0 ; disable warming

"EnableWriteBack"=dword:0 ; disable write-back cache



; create a profile named 'HDProfile', for the ndfmd partition

[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\HDProfile\]

"Name"="Expermental"

"Folder"="ndfmd"

"PartitionID"=dword:0

"PartitionDriver"=""


What am I getting wrong?






.