Re: Problem of calling named NT device in user-mode

Tech-Archive recommends: Fix windows errors by optimizing your registry



"Fudan Boy" <asfa> wrote:

I am creating a trivial driver to experience the feature of user-mode
calling kernel mode driver:
...
However, I always failed with error 53. If I change the device name to
\\Device\\UserCallKernel, I will get error 3.

By using winobj, I can see my device name "UserCallKernel" under the
"Device" node.

Questions:
1. How to get this work without using symbolic link?

You can't. The \Device namespace can only be used from kernel-mode.
User-mode aliases exist in \DosDevices (also called \?? in kernel mode, or
\\. in user mode).

2. What is the difference between "\\\\" and "\\"

Maxim already summarized this. The name you would want in user mode is
\\.\YourDeviceName, but because backslashes have a special meaning in C,
you must write that as "\\\\.\\YourDeviceName".

You could also use "//./YourDeviceName", if you want.
--
Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc.
.



Relevant Pages

  • Re: STOP:c000021a {Fatal System Error} help
    ... This occurs when Windows switches into kernel mode and a user-mode ... subsystem, such as Winlogon or the Client Server Runtime Subsystem ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Kernel Mode vs. User Mode
    ... The overall goal of your task is doable till you are in user-mode, but, ... > I'm thinking of other ways to trace the execution of a program. ... A thread either executes in kernel mode or user mode. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: beginthread in DrvDocumentEvent crashes under NT4
    ... Really kernel mode. ... of the calling app. ... > CreateThread API (a user-mode function, not intended to be called from ... Calling it from a driver is not a good thing. ...
    (microsoft.public.development.device.drivers)
  • Re: How to improve application performance in CE6.0 user mode?
    ... that makes a lot of OS calls, you have to move it into a kernel mode driver. ... WinCE 5.0 can get more better result than WinCE ... Is it possible to mapping user mode API into kernel mode ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Problem of calling named NT device in user-mode
    ... my concern replies on device name for user-mode visible. ... I am creating a trivial driver to experience the feature of user-mode ... calling kernel mode driver: ... The name you would want in user mode is ...
    (microsoft.public.development.device.drivers)