Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Hardware & Devices
  4. Problem in "Openning Driver File"

Problem in "Openning Driver File"

Scheduled Pinned Locked Moved Hardware & Devices
helptutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Pratheep Kenny
    wrote on last edited by
    #1

    Hi all, I have created a device independent driver. For which i want a application launcher. My drivers name is "TestIOCTL" and its symbollic link is "\Device\TestIOCTL ". I now want to open this driver file for which i have used the following code segment. hDevice = CreateFile ("\\DosDevices\\TestIOCTL", 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); The hDevice returns 3 thro GetError() Method meaning File not found. Can anyone tell me how to open this driver file. Thanks In advance. Regards Kenny.

    P M 2 Replies Last reply
    0
    • P Pratheep Kenny

      Hi all, I have created a device independent driver. For which i want a application launcher. My drivers name is "TestIOCTL" and its symbollic link is "\Device\TestIOCTL ". I now want to open this driver file for which i have used the following code segment. hDevice = CreateFile ("\\DosDevices\\TestIOCTL", 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); The hDevice returns 3 thro GetError() Method meaning File not found. Can anyone tell me how to open this driver file. Thanks In advance. Regards Kenny.

      P Offline
      P Offline
      progload
      wrote on last edited by
      #2

      Your API Signature seems to be wrong. You can check it here: http://www.pinvoke.net/default.aspx/kernel32.CreateFile[^] hope that helps.

      1 Reply Last reply
      0
      • P Pratheep Kenny

        Hi all, I have created a device independent driver. For which i want a application launcher. My drivers name is "TestIOCTL" and its symbollic link is "\Device\TestIOCTL ". I now want to open this driver file for which i have used the following code segment. hDevice = CreateFile ("\\DosDevices\\TestIOCTL", 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); The hDevice returns 3 thro GetError() Method meaning File not found. Can anyone tell me how to open this driver file. Thanks In advance. Regards Kenny.

        M Offline
        M Offline
        Mike Dimmick
        wrote on last edited by
        #3

        DosDevices was the name of the user-mode-accessible namespace in NT4. In later versions of the OS this changed. From user-mode, replace \DosDevices with \\.. In C or C++ you will have to escape the backslashes, so use "\\\\.\\TestIOCTL". Source[^].

        Stability. What an interesting concept. -- Chris Maunder

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups