PS. Thanks to Remy Lebeau for answering my previous question about
FormatMessage
Why not look at this:
http://technet.microsoft.com/en-us/sysinternals/bb896655.aspx
Let me know if this isn't sufficient, there may be some undocumented calls
NtXXX that can be used.
H
this is a binary, I need to get this info inside my source code
> Let me know if this isn't sufficient, there may be some undocumented calls
> NtXXX that can be used.
yes, please!
> this is a binary, I need to get this info inside my source code
Read the article again more carefully. It points you to information about
how the Handle app gets its information from the OS.
--
Remy Lebeau (TeamB)
You need to enumerate all processes in the machine
(NtQuerySystemInformation), and pass in SystemHandleInformation as the
argiument (this is a constant with value 16 decimal).
See here for more:
http://forum.sysinternals.com/forum_posts.asp?TID=18892
Maybe NtQueryInformationFile with FileAccessInformation, FileNameInformation
is what you need.
--pa
Indeed, this looks like what I need.
(http://msdn.microsoft.com/en-us/library/ms804359.aspx)
Alas, it does not quite work.
Specifically,
NtQueryInformationFile(1736,&iosb,(void*)&fai,sizeof
(fai),FileAccessInformation)
returns STATUS_SUCCESS(0), but
fai.AccessFlags(0x120196) & STANDARD_RIGHTS_READ(0x020000) is 1
so the system claims that I can read from the handle(1736, which is my
stdin).
However, when I actually try to read from it, I get error 5
(ERROR_ACCESS_DENIED).
I.e., NtQueryInformationFile fails to detect that the handle is not
valid for input.
"sds" <sam.st...@gmail.com> wrote in message
news:07f91cce-7575-4324...@l9g2000yqi.googlegroups.com...