Re: CreateFile performance

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



Comments inline:
<r_konjeti@xxxxxxxxxxxx> wrote in message
news:1163082648.727755.307100@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
If many applications are calling driver, each application process
context need a separate handle or duplicate handle for CreateFile(). Is
it same to have a duplicate handle from other process in a given
application process. Or will it make a difference if we call
CreateFile() for each process context.

You want a handle for each process for security reasons. Otherwise an
unauthorized application can try to use you driver as an attack vector.

Will the driver unload if there is handle pending at the user mode for
a device. If the device is removed and handle not closed yet, will it
cause problems? If I implement this scheme, I want to close these file
handle lazy way.

The driver will not unload if there is a reference to it which a handle
owned by a process certainly is a reference so it will not be unloaded.


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
http://www.windrvr.com
Remove StopSpam from the email to reply



.



Relevant Pages

  • Re: CreateFile performance
    ... If many applications are calling driver, ... context need a separate handle or duplicate handle for CreateFile. ... CreateFile() for each process context. ... more than one packet from driver to user mode. ...
    (microsoft.public.development.device.drivers)
  • Re: Steam interface that supports multiple instances of device
    ... driver instance from the registry information. ... Applications call CreateFile ... driver context and an open context. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: processing a large textfile
    ... Then apply the Context Specific Problem Solution Process. ... duplicate entries, from the error i'm getting there are something like ... master file, and put in another file with the basename of the master ...
    (comp.unix.shell)
  • Re: Modifying default context menu
    ... a textbox control, but don't see any way to get access to the default ... If I create my own context menu, is there any way to get the ... functionality of the default context menu items without writing a lot ... I don't think it would be easy to duplicate the 'Undo' ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: Mapping kernel memory into a user mode process
    ... handle was closed by another process, Cleanup will run in its context. ... duplicate the handle. ... callback to map the memory. ... Does this imply that MmUnmapLockedPages is not ...
    (microsoft.public.development.device.drivers)