Re: create named pipe in kernel driver?
- From: Paul Yaroshenko <samepaul@xxxxxxxxxxxx>
- Date: Sat, 21 May 2005 13:59:45 +0300
Though I can give you example how to open pipes within kernel mode, but it won't help you with remoting. In kernel pipe name has different naming convention that prevents from using "remote pipes".
RtlInitUnicodeString( &pipe_name, L"\\??\\pipe\\YourPipeName" );
InitializeObjectAttributes( &attr, &pipe_name, OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, NULL, NULL);
ret = ZwCreateFile( &pipe_handle, SYNCHRONIZE | FILE_WRITE_DATA , // or FILE_READ_DATA &attr, &iostat, NULL, FILE_ATTRIBUTE_NORMAL, FILE_SHARE_READ | FILE_SHARE_WRITE, FILE_OPEN, FILE_NON_DIRECTORY_FILE, NULL, 0);
Thus whereas in user-mode formar of pipe is "\\server\pipe\pipename" in kernel it is "\??\pipe\pipename".
In addition, in kerenel default security context is LocalSystem which is not allowed to access network.
varname wrote:
ok ..
somehow I think that with a less explicit post I would've gotten the main idea of your.
second: it is my understanding that by using a pipe I can use the output of my driver (actually really a filter driver) on a remote machine aswell, without any extra code for sending it over the network. In my case, that would be a nice feature.
One of the consequences of using a ps2 mouse is (as I understand it) that windows has exclusive control over the port, i.e. I can't just CreateFile on it. So then I would have to create a second deviceobject to interact with and use IOCTLs?
"Don Burn" <burn@xxxxxxxxxxxxxxxx> wrote in message news:pcrje.231$NL1.31@xxxxxxxxxxx
Why in the werld do you want to create a named pipe? This is totally outside of the normal approaches to communicate from a driver to user
space.
Yes people do it, with a lot of undocumented calls that can change tommorrow. People also drive down one way streets the wrong way, ignoring convention in either case is at least stupid, if not worse.
There are a heck of a lot of normal ways to get this data out, don't do things in an unconventional and stupid way.
-- Don Burn (MVP, Windows DDK) Windows 2k/XP/2k3 Filesystem and Driver Consulting Remove StopSpam from the email to reply
"varname" <v@xxx> wrote in message news:d6lerj$rlf$1@xxxxxxxxxxxxxxxxxx
hello all,
In relation to a previous question I asked about two weeks ago (cos /
sin
in kernel driver)', I'm now at a point where I want to create a named pipe
to
'stream' the data coming from my hardware device (modified ps/2 mouse).
Creating named pipes from userland applications is straightforward
enough,
but in kerneldrivers I'm getting a bit confused. Reading several
websites
I've seen people saying to use 'IoCreateFile' directly (as that is what NtCreateNamedPipeFile uses), using ZwCreateNamedPipeFile (which isn't exported it seems) and a sort of wrapper (http://www.ntkernel.com/w&p.php?id=17 last part of page).
Could someone please shed some light on this? What is the (accepted) way to create a named pipe from a kernel driver (in DriverEntry for instance)?
again, thanks for any assistance you can give.
.
- Follow-Ups:
- Re: create named pipe in kernel driver?
- From: Slava M. Usov
- Re: create named pipe in kernel driver?
- From: varname
- Re: create named pipe in kernel driver?
- References:
- create named pipe in kernel driver?
- From: varname
- Re: create named pipe in kernel driver?
- From: Don Burn
- Re: create named pipe in kernel driver?
- From: varname
- create named pipe in kernel driver?
- Prev by Date: How application opens handle to the driver
- Next by Date: Re: create named pipe in kernel driver?
- Previous by thread: Re: create named pipe in kernel driver?
- Next by thread: Re: create named pipe in kernel driver?
- Index(es):
Relevant Pages
|