Re: Need help in exporting API for Kernel Mode DLL to Application
- From: "Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT com>
- Date: Fri, 11 Jan 2008 10:23:24 -0700
If you want a more function-oriented API, you could provide a library, or
even a user-mode DLL, that exports some API-type calls, which in turn open
the driver and send it suitable IOCTL values behind the scenes.
Paul T.
"Luca Calligaris" <LucaCalligaris@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:7BD84678-DBA1-4EF3-BD17-FA9AF7EA70EF@xxxxxxxxxxxxxxxx
You cannot call into a kernel DLL from a user application that way. Why
don't
you handle a custom IOCTL_MYTEST in MYD_IOControl and call DeviceIoControl
from your app?
--
Luca Calligaris
www.eurotech.it
"Bhushan" wrote:
Hi All,
I am facing some problem in exporting kernel mode Driver DLL API to
Application in wince 6.0.
I am exporting API using .def file as follows
MYDLL.def looks as below
LIBRARY MYDLL.dll
EXPORTS
MYD_Init @1
MYD_Deinit @2
MYD_Open @3
MYD_Close @4
MYD_Draw @5
MYD_IOControl @6
MYD_PowerDown @7
MYD_PowerUp @8
MYDTest @9
I am calling MYDTEST() function in application
and header file have following declaration in .h for application
__declspec(dllimport) void __cdecl MYDTest(void);
function defination looks as follows
void __cdecl MYDTest(void)
{
.... some code.
}
Compiling and linking is fine. no errors and no warnings.
Driver is loaded in kernel mode.gets loaded and MYD_Init and open and
close functions are called.
When this MYDTest is called in application, compilation and linking is
good.
while running when clicked on icon on touch screen to open the
application nothing happens.
Not even print on first line from WinMain function appears.
when I used dumpbin /expotrs for MYDLL.lib following is the out put
DUMP of Mydll.lib is
Dump of file D:\MYDLL.lib
File Type: LIBRARY
Exports
ordinal name
4 MYD_Close
2 MYD_Deinit
5 MYD_Draw
6 MYD_IOControl
1 MYD_Init
3 MYD_Open
7 MYD_PowerDown
8 MYD_PowerUp
9 MYDTest
Summary
BD .debug$S
14 .idata$2
14 .idata$3
4 .idata$4
4 .idata$5
A .idata$6
and with dumpbin /all is
21 public symbols
3C2 __IMPORT_DESCRIPTOR_MYD
5E2 __NULL_IMPORT_DESCRIPTOR 716
MYD_NULL_THUNK_DATA
9F6 MYD_Init
9F6 __imp_MYD_Init
8C8 MYD_Deinit
8C8__imp_MYD_Deinit
A58 MYD_Open
A58 __imp_MYD_Open
864 MYD_Close
864 __imp_MYD_Close
92C MYD_Draw
92C __imp_MYDE_Draw
98E MYD_IOControl
98E __imp_MYD_IOControl
ABA MYDE_PowerDown
ABA __imp_MYD_PowerDown
B22 MYD_PowerUp
B22 __imp_MYD_PowerUp
B88 __imp_MYDTest
B88 MYDTest
I have also tried using following instead of .def but result is same.
__declspec(dllexport) void __cdecl MYDTest(void)
{
.... some code.
}
Sources file looks as follows
TARGETNAME=MYDLL
TARGETTYPE=DYNLINK
RELEASETYPE=PLATFORM
DEFFILE=MYDLL.def
TARGETLIBS= \
$(_COMMONSDKROOT)\lib\$(_CPUINDPATH)\coredll.lib
SOURCES = \
MYDLL.cpp
Moment is link the MYDLL.lib to application, application wont start
executing after clicking on the touch screen of my test device.
When not linked with this DLL application works fine.
Is there any thing missing,
Any Inputs would be of great help,
Thanks and regards
Bhushan k
.
- Follow-Ups:
- References:
- Need help in exporting API for Kernel Mode DLL to Application
- From: Bhushan
- RE: Need help in exporting API for Kernel Mode DLL to Application
- From: Luca Calligaris
- Need help in exporting API for Kernel Mode DLL to Application
- Prev by Date: Re: barcode scanner device
- Next by Date: Re: ROM-only FS and persisting registry on USB HD
- Previous by thread: RE: Need help in exporting API for Kernel Mode DLL to Application
- Next by thread: Re: Need help in exporting API for Kernel Mode DLL to Application
- Index(es):
Relevant Pages
|