Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1062539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:38:36+00:00 2026-05-16T18:38:36+00:00

In this document, http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#paths To make these device objects accessible by Windows applications, the

  • 0

In this document,
http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#paths

To make these device objects accessible by Windows applications, the device drivers create a symbolic link (symlink) in the Win32 namespace, “Global??”, to their respective device objects. For example, COM0 and COM1 under the “Global??” subdirectory are simply symlinks to Serial0 and Serial1, “C:” is a symlink to HarddiskVolume1, “Physicaldrive0” is a symlink to DR0, and so on. Without a symlink, a specified device “Xxx” will not be available to any Windows application using Win32 namespace conventions as described previously. However, a handle could be opened to that device using any APIs that support the NT namespace absolute path of the format “\Device\Xxx”.

What are the APIs? Let me know some such functions please.


For example, we can have a device sitting in the GLOBAL?? namespace:

GLOBAL??\
   COM227

This device we can successfully open using CreateFile:

//Note: we have to prefix it with \\.\ in order to tell CreateFile that
//we want to open something from the Global device namespace.
//Otherwise it will try to open a file
HANDLE hdev = CreateFile("\\.\COM227", GENERIC_READ, 0, null, OPEN_EXISTING, 0, 0);
if (hdev == INVALID_HANDLE_VALUE)
   raise new EWin32Exception(GetLastError);

This device (along with every other device in the Win32 Global?? namespace), actually a symbolic link to the “real” device:

GLOBAL??\
   COM227 (SymbolicLink) ==> \Device\VCP0
Device\
   VCP0  (Device)

So we try to open this real device:

HANDLE hdev = CreateFile("\\.\Device\VCP0", GENERIC_READ, 0, null, OPEN_EXISTING, 0, 0);
if (hdev == INVALID_HANDLE_VALUE)
   raise new EWin32Exception(GetLastError);

But it fails with error code 3 (The system cannot find the specified file).

Short:

  • Works: COM227 (which is an alias of \Device\VCP0)
  • Fails: \Device\VCP0

The problem is that

  • @paulsm4 says that CreateFile should work
  • @larryostermm agrees, and even gives the device path syntax (e.g. \Device\Xxx)
  • except that it doesn’t work

Which means that CreateFile is not one of the “APIs that support the NT namespace absolute path format of \Device\Xxx”.

However, a handle could be opened to that device using any APIs that support the NT namespace absolute path of the format “\Device\Xxx”.

What are the APIs?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T18:38:36+00:00Added an answer on May 16, 2026 at 6:38 pm

    Benjamin –

    1. The simple fact is that you CAN open a “special device file” in Windows, very much as you do in *nix. This is what I tried to say in my original reply. I stand by everything I said in my first post. And I believe the MSDN link I referred to there does a very good job of explaining this, too.

    2. The syntax for a *nix device file is “/dev/SOME_DEVICE”. Multiple devices are (by convention, not necessity) distinguished as “/dev/SOME_DEVICE0”, “/dev/SOME_DEVICE1”, etc. Device files can also be “aliased” using *nix “symbolic links”.

    3. The syntax for a Windows device file is a UNC name.
      I’m sure you’re familiar with UNC shares (for example, “\\myserver\c$”).
      In all the examples we’ve discussed above, the server happens to be the local host. Hence “\\.\SOME_RESOURCE_NAME”.

    It’s really as simple as that.

    And it DOES work.

    Please let me know if you have any further questions.

    Thank you in advance .. PSM

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.