Re: CE6.0 Exposing Driver Interfaces to an Application



You're confusing a couple of different things. You're correct, the least
complicated mechanism is to create a simple stream driver and expose your
functionality via IOCTLs. However, the interface provided by oalioctl is
for *kernel* ioctls, not device driver ioctls. User mode components can't
call kernel ioctls unless they are exposed via oalioctl. User mode
components can call device driver ioctls though.

Unless your functionality needs to live in the OAL (unlikely) then you just
need to create a simple device driver. You will open the driver with
CreateFile, and access the ioctl using DeviceIoControl.

--
Dean Ramsier - eMVP
BSQUARE Corporation


"jld" <jld@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:A2C0F00D-BF10-49E7-8D07-84CD573CE947@xxxxxxxxxxxxxxxx
Thank you for your answer.

It is my understanding of this issue that the least complicated mechanism
for transferring data to a custom "driver" is to use the stream driver
interface and use IOCTLS to implement generic APIs.

In CE 6.0 these IOCTLS must then be added to public\common\oak\oalioctl in
order for them to be accessed from the application.

Reference: OAL Ioctl Codes
http://blogs.msdn.com/ce_base/archive/2006/11/14/application-compatibility-in-windows-ce-6-0.aspx

The custom IOCTLS are accessed from the application using DeviceIoControl
(?)


"Valter Minute" wrote:

=?Utf-8?B?amxk?= <jld@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
news:86F03121-64E4-4BD6-81B5-E420A3272675@xxxxxxxxxxxxx:

[...]
I found some documentation for creating a stream driver. Are all
drivers forced to be stream drivers and use IOCTLS ?

The drivers that don't support a native peripheral interface (ex: USB
host, display adapter etc.) should be implemented as streaming I/O
drivers and the functions that don't fit the Read/Write model should be
implemented as IOCTLs.
You can write a simple wrapper library that hides the IOCTLs from the
application programmer. This library could be an advantage also for the
driver developer since you can put more controls inside it (ex:
allocate buffers and don't free them while a call is pending etc.)
making your solution more reliable (of course this doesn't mean that
you should put validations and checks only inside the .lib!).



--
Valter Minute
(the reply address of this message is invalid)
(l'indirizzo di reply di questo messaggio non è valido)



.



Relevant Pages

  • Re: Accessing Ndis miniport from user mode application-one more thing
    ... IOCTLs, so I believe we're in agreement there. ... send control requests to your driver (and I believe one normally has a good ... "Please make sure that UDP port XYZ is available only to privileged users", ...
    (microsoft.public.development.device.drivers)
  • Re: RFC: ipath ioctls and their replacements
    ... > objected to the number of ioctls we had. ... > driver that isn't very useful. ... Again this is a generic problem, and the generic interfaces are broken ... If the Infiniband stack is too ugly to use or it is missing features ...
    (Linux-Kernel)
  • RE: Digi Neo 8: linux-2.6.12_r2 jsm driver
    ... Oh, keep in mind, the ioctls are not new. ... Subject: Digi Neo 8: linux-2.6.12_r2 jsm driver ... as the extended features added special ioctls ... , then this interface needs ...
    (Linux-Kernel)
  • Re: ioctl number 0xF3
    ... I didn't mean that as any sort of insult. ... people telling me "implement a generic interface". ... driver and want the users of this driver to have some sort of comfort. ... intended ioctls already implemented. ...
    (Linux-Kernel)
  • Re: The guts of /dev/* ?
    ... > Read the source code. ... > depend on what the specific device driver will do. ... > set by the ioctls for that device. ...
    (comp.os.linux.misc)