- user mode to kernel mode I/O via named pipes
- Posted by mirage2k2 on May 9th, 2008
I have always performed I/O between user mode and kernel mode via traditional
IOCTRL. I have seen examples where named pipes have been used. My
understanding is that using named pipes is possible but non-standard and
should be avoided. Any comments.
mirage
- Posted by Kerem Gümrükcü on May 9th, 2008
Hi Mirage,
afaik this is possible with calls that are (afaik officially) undocumented
and
part. documented kernel calls. You can open e.g a Userland Pipe with
ZwCreateFile
or even create pipes with ZwCreateNamedPipeFile/NtCreateNamedPipeFile
(both in ntdll.dll) but i higly recommend (as others will do so i hope) that
you should stay at IOCTRL's and other standard Read/Write Operations
that are well documented,...and standartized!
You will never know, what happens to undocumented calls after next
OS release, Service Packs, etc,...i wont use functions like these,...
Still stay on them. Try not to use any undocumented stuff,...
Regards
Kerem
--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."
"mirage2k2" <mirage2k2@discussions.microsoft.com> schrieb im Newsbeitrag
news:18A478BD-1DA6-478A-9B7B-A0C1029D207F@microsoft.com...
- Posted by Maxim S. Shatskih on May 9th, 2008
Actually, pipes in Windows are badly implemented and I should avoid them.
For instance, GetFileType on a pipe _hangs_ if there is a pending read
request, which, BTW, causes the DLL load to hang sometimes, since the C runtime
startup in the DLL calls GetFileType on all known handles while setting up the
file descriptor table for open/fopen.
The complexity of ZwCreateFile for named pipe, together with lots of
different flags which influence the pipe's behaviour, makes the good old IOCTL
way by far more simple.
Performance also should be better with IOCTLs, since the pipe way is just
more code between user and kernel components (the whole NPFS).
--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com
"mirage2k2" <mirage2k2@discussions.microsoft.com> wrote in message
news:18A478BD-1DA6-478A-9B7B-A0C1029D207F@microsoft.com...
- Posted by Tim Roberts on May 10th, 2008
mirage2k2 <mirage2k2@discussions.microsoft.com> wrote:
I agree with Maxim. I actually implemented a user/kernel pair that used
named pipes, and in the end I tore it out and implemented an ioctl scheme.
Too many special cases to handle.
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
- Posted by Kerem Gümrükcü on May 10th, 2008
Hi Tim,
Can you tell some special cases that must be taken care of, please,...
I did not use any kernel pipe stuff for inter driver communication yet.
So what do we have to take care of or what special cases can someone
expect,...?
Regards
Kerem
--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."
"Tim Roberts" <timr@probo.com> schrieb im Newsbeitrag
news:2t6a24lpvicge63ripcjerbu9pjr3igssp@4ax.com...
- Posted by Don Burn on May 10th, 2008
Kerem,
I cannot spell them out, but having tried the samples that have showed
up on this, they all crash the system, either immediately or with a system
stress test. Then if you go look at the undocumented calls, you start
finding that they are not accurately documented. Finally, even the ones
that do work (until stress) are very slow, so why bother?
--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
"Kerem Gümrükcü" <kareem114@hotmail.com> wrote in message
news:uQEM2alsIHA.4848@TK2MSFTNGP05.phx.gbl...
- Posted by Pavel A. on May 10th, 2008
Then, how these pipes manage to work between usermode processes?
Is the problem only in (erroneous) use of undocumented calls?
Regards,
--PA
"Don Burn" <burn@stopspam.windrvr.com> wrote in message
news:#LUfVxosIHA.524@TK2MSFTNGP05.phx.gbl...
- Posted by Don Burn on May 10th, 2008
I'm suspect it is the undocumented calls, once I saw the performance I took
the approach of when I see them in a driver, rip it out, why bother with
something that provides no benefit.
--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
"Pavel A." <pavel_a@NOwritemeNO.com> wrote in message
news:Oxvt9RpsIHA.4476@TK2MSFTNGP06.phx.gbl...
- Posted by Pavel A. on May 10th, 2008
IMHO it would be nice to have "uniform" way to talk to services, whether
they are kernel drivers or normal usermode services.
Ioctls are only for kernel drivers.
I'd like to be able to eventually move my stuff out of kernel (by same
reasons as for moving drivers to UMDF),
but keep same interface.
If pipes are out, what else is left - maybe lpc?
--PA
"Don Burn" <burn@stopspam.windrvr.com> wrote in message
news:e$XInUpsIHA.2064@TK2MSFTNGP05.phx.gbl...
- Posted by Kerem Gümrükcü on May 10th, 2008
Hi Don,
No reason to,...i just was interessted in the things that wont
work. I dont want to use anything from the undocumented
pipe calls. The OCTRL's are good and sufficient at all,...
Regards
Kerem
--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."
"Don Burn" <burn@stopspam.windrvr.com> schrieb im Newsbeitrag
news:e$XInUpsIHA.2064@TK2MSFTNGP05.phx.gbl...
- Posted by Ben Voigt [C++ MVP] on May 12th, 2008
Pavel A. wrote:
A user-mode wrapper interface that hides the communication details perhaps.
- Posted by Ben Voigt [C++ MVP] on May 12th, 2008
Don Burn wrote:
What's the IOCTL equivalent (from userspace) to OVERLAPPED pipe I/O?
Undocumented NtDeviceIoControl or is there an approved mechanism?
- Posted by Don Burn on May 12th, 2008
Well DeviceIoControl allows OVERLAPPED, and of course completion ports can
make this pretty fast.
--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
"Ben Voigt [C++ MVP]" <rbv@nospam.nospam> wrote in message
news:OhUrAXDtIHA.1872@TK2MSFTNGP04.phx.gbl...
- Posted by Alexander Grigoriev on May 12th, 2008
Ultimately, DevIoCtl and pipe IO go through similar paths. Pipe I/O might
then go through additional pains of framing the message, etc. IOCTL doesn't
need all that overhead.
"Ben Voigt [C++ MVP]" <rbv@nospam.nospam> wrote in message
news:OhUrAXDtIHA.1872@TK2MSFTNGP04.phx.gbl...
- Posted by Maxim S. Shatskih on May 12th, 2008
DeviceIoControl supports both OVERLAPPED and IOCPs, it only does not support
the APC completion notification (there is no DeviceIoControlEx).
--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com
- Posted by Ben Voigt [C++ MVP] on May 12th, 2008
Maxim S. Shatskih wrote:
Sorry, APC completion is what I was intending to ask about. Thanks for
reading my mind.
- Posted by Pavel A. on May 13th, 2008
"Ben Voigt [C++ MVP]" <rbv@nospam.nospam> wrote in message
news:u#V7VWDtIHA.5832@TK2MSFTNGP02.phx.gbl...
Been there, done that - but would like to avoid in next projects.
.... is this because of the whole season spent among penguins? 8~\
--PA
- Posted by Kerem Gümrükcü on May 13th, 2008
Hi Pavel,
I dont understand this,...:-)
What you mean by "penguins",...?
Regards
Kerem
--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."
"Pavel A." <pavel_a@NOwritemeNO.com> schrieb im Newsbeitrag
news:%23$5jPhKtIHA.2064@TK2MSFTNGP05.phx.gbl...
- Posted by Doron Holan [MSFT] on May 13th, 2008
it was an offhand linux (mascot) reference
d
--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.
"Kerem Gümrükcü" <kareem114@hotmail.com> wrote in message
news:%2367j9CLtIHA.548@TK2MSFTNGP06.phx.gbl...
- Posted by Kerem Gümrükcü on May 13th, 2008
Ah,...ok,...the famous Tux,....:-)
Regards
Kerem
--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."
"Doron Holan [MSFT]" <doronh@online.microsoft.com> schrieb im Newsbeitrag
news:eyF336LtIHA.4876@TK2MSFTNGP02.phx.gbl...