none
WinCE6 file handle issue kernel to app RRS feed

  • Question

  • Hi,

    I recently converted a driver from User Space to Kernel Space.  It had an interface library that I just replaced function pointers with IOCTLs... all works fine.  This device driver uses another interface to use another device driver.  When the driver was in User Space, we could pass the same handle that is used to communicate to the other device driver so our API can also talk to it.

    When I moved it the driver to Kernel, this handle (created in Kernel via CreateFile) is not valid in User Space (API).  Is there any way I can "translate" it?  Not sure if I need to use DuplicateHandle or where to place it (API? Driver?).  Any thoughts would be great.

    Thanks!

    Thursday, February 9, 2012 7:30 PM

All replies

  • DuplicateHandle will but work I suggest to use CeDriverDuplicateCallerHandle (http://msdn.microsoft.com/en-us/library/ee486213(v=winembedded.60).aspx) which wraps the call to DuplicateHandle saving you from getting the caller/target porcesses handles, etc. You will call the function from the driver


    Luca Calligaris lucaDOTcalligarisATeurotechDOTcom www.eurotech.com Check my blog: http://lcalligaris.wordpress.com

    Thursday, February 9, 2012 8:52 PM
  • Thanks for the reply... simply forgot to reply back.  I ended up using a "Named Event" instead - seemed easier at the time, because we had a bigger issue to deal with.  The bigger issue is a function we relied on moved to a Kernel Only call - took me forever to find that one.
    Friday, November 30, 2012 9:58 PM