Re: calling DLL from a Device Drive

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




"Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx> wrote in message news:uK$Yxl8DHHA.3524@xxxxxxxxxxxxxxxxxxxxxxx
"Gianluca Colucci" <GianlucaColucci@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:7766592F-5991-48F1-AFD5-983E1DC35634@xxxxxxxxxxxxxxxx
Hello!

Ok, read a bit about DeviceIOControl... it is used to send a control code to
a device, which will answer by executing the corresponding operation...

and how can I send information from the device to my DLL/program/service?

Thanks in advance,
Gianluca.

"Vladimir Scherbina" wrote:

Gianluca ,

'Helper application' in this context is an user mode application that uses
DeviceIoControl function to communicate with your driver.

--
Vladimir (Windows SDK MVP)

"Gianluca Colucci" <GianlucaColucci@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:F4C9C439-A832-4378-A03F-B6B2F682C989@xxxxxxxxxxxxxxxx
> Hello Don,
>
> thank you so much for the answer.
> Because as I told you I am completely new to this type of development,
> could
> you kindly explain me what should I do in practice? What do you mean > for
> "helper" application? and in which way could I communicate between
> applications?
>
> any suggestion?
>
> Thanks,
>
> Gianluca.
>
> "Don Burn" wrote:
>
>> The only DLL's that can be called directly from a driver are kernel >> mode
>> DLL's which follow all the rules of drivers. If you need to use a >> user
>> mode DLL, you need a helper application and have the driver >> communicate
>> with the application, which then does a call and returns the result.
>>
>>
>> -- >> Don Burn (MVP, Windows DDK)
>> Windows 2k/XP/2k3 Filesystem and Driver Consulting
>> http://www.windrvr.com
>> Remove StopSpam from the email to reply
>>
>>
>> "Gianluca Colucci" <Gianluca Colucci@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote >> in
>> message news:08A29E37-9AEA-47BB-ADB1-9AEB7293E4E5@xxxxxxxxxxxxxxxx
>> > Hello everybody!
>> >
>> > I am completely new to driver development.
>> > Altough I must realize a driver that communicates with other >> > machines
>> > and
>> > does some complex operations, which are managed by a DLL.
>> >
>> > My question is: is there any way to call a DLL from inside a device
>> > driver
>> > code?
>> > And, can the DLL be written in any language? For example C#?
>> >
>> > Hope to receive your answers soon!
>> > Cheers,
>> > Gianluca.
>>
>>
>>


Note that the user application (at least the driver interface part) in the "inverted call model" as mentioned by Don can only be written in C/C++, not in any of the pure managed languages like C#, VB or C++/CLI .

Willy.


So you are saying that asynchronous I/O cannot be done in any "pure managed languages like C#, VB or C++/CLI ."?

The inverted call is, for all practical purposes, asynchronous I/O. The app makes an asynchronous I/O call with the logical meaning of "complete this call when you have something to tell me".

Async I/O can be done in any of the languages you have mentioned.

The inverted call _is_ the most reliable and robust method for this purpose can can be used effectively in managed languages.

Thomas F. Divine
http://www.pcausa.com

.



Relevant Pages

  • Re: calling DLL from a Device Drive
    ... "Gianluca Colucci" wrote in message ... DeviceIoControl function to communicate with your driver. ...
    (microsoft.public.development.device.drivers)
  • Re: IoQueueWorkItem accessing flag or return value?
    ... I have been looking more into this, and from what I am reading maybe ... DeviceIoControl call can be used to communicate with my driver over ...
    (microsoft.public.development.device.drivers)
  • NDIS to User mode
    ... Applications can communicate with driver using DeviceIoControl. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Cant print from Word 2008 (Excel prints OK)
    ... Printing, however, is actually handled by the printer driver software & the ... a local system it pretty much points the finger at the server configuration. ... connecting the printer directly to my iMac since it needs to be shared ... that it "couldn't communicate with the printer ... ...
    (microsoft.public.mac.office.word)
  • Re: Cant print from Word 2008 (Excel prints OK)
    ... I am using the Gutenprint driver, because with the other driver none of ... applications - including Excel, but not with Word. ... connecting the printer directly to my iMac since it needs to be shared ... that it "couldn't communicate with the printer ... ...
    (microsoft.public.mac.office.word)