Dan Mitchell
2007-01-13 01:33:58 UTC
My app needs to read cookies in IE7 on Vista, so I need to spawn a
separate low integrity process to read protected mode cookies. I'm doing
this as it says here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/ietechcol/dnwebgen/protectedmode.asp
and it's working fine.
The problem is getting the result back to my main process. I tried
using named pipes, but I get E_ACCESSDENIED when I call CreateFile in
the slave process. I know I can't pass NULL as the last argument to
CreateNamedPipe, I'm creating a NULL DACL and passing that in, so in
theory absolutely everything should have access, but still no joy.
(and I know it's permissions, not CreateFile confusion in the slave,
because if I just do "echo foo > \\.\pipe\mypipe" from a cmd window, it
works and I get 'foo' showing up on my pipe -- just trying system() from
my slave process, no joy)
Currently, I'm using SHGetKnownFolderPath(FOLDERID_LocalAppDataLow...)
and writing to a temp file in the slave which I can then read in the
parent process -- that works, but is not a very clean solution. (I could
also use IEGetWriteableHKCU to get a safe bit of the registry, but
that's no better, really).
Is there a better approach? Is there something I'm missing about
security and named pipes? (or alternatively, is it the case that low
integrity processes on Vista are locked down more than I'm expecting?
CreateFile is in kernel32.dll, which is listed as a possibly problematic
DLL at the bottom of the docs page, but what does it mean by "securable
object", then?)
thanks,
-- dan
separate low integrity process to read protected mode cookies. I'm doing
this as it says here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/ietechcol/dnwebgen/protectedmode.asp
and it's working fine.
The problem is getting the result back to my main process. I tried
using named pipes, but I get E_ACCESSDENIED when I call CreateFile in
the slave process. I know I can't pass NULL as the last argument to
CreateNamedPipe, I'm creating a NULL DACL and passing that in, so in
theory absolutely everything should have access, but still no joy.
(and I know it's permissions, not CreateFile confusion in the slave,
because if I just do "echo foo > \\.\pipe\mypipe" from a cmd window, it
works and I get 'foo' showing up on my pipe -- just trying system() from
my slave process, no joy)
Currently, I'm using SHGetKnownFolderPath(FOLDERID_LocalAppDataLow...)
and writing to a temp file in the slave which I can then read in the
parent process -- that works, but is not a very clean solution. (I could
also use IEGetWriteableHKCU to get a safe bit of the registry, but
that's no better, really).
Is there a better approach? Is there something I'm missing about
security and named pipes? (or alternatively, is it the case that low
integrity processes on Vista are locked down more than I'm expecting?
CreateFile is in kernel32.dll, which is listed as a possibly problematic
DLL at the bottom of the docs page, but what does it mean by "securable
object", then?)
thanks,
-- dan