Re: Obtaining a Terminal Services SessionID in a functional driver
- From: "David G" <DavidG@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 14 Feb 2006 16:16:28 -0800
Awesome, thanks, I'll look into it.
-David G
"Skywing" wrote:
You might look into doing something like this:.
SeCaptureSubjectContext(&ctx)
SeLockSubjectContext(ctx)
token = SeQuerySubjectContextToken(ctx)
SeQueryInformationToken(token, TokenSessionId, &sessionid);
SeUnlockSubjectContext(ctx)
SeReleaseSubjectContext(ctx)
If you are operating in the context of IRP_MJ_CREATE, you may find
IoStackLocation->Parameters.Create.SecurityContext->AccessState->SecuritySubjectContext
useful as well.
(This comes from the IFS kit documentation, btw...)
"David G" <DavidG@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0DC8E251-0FC0-4AA1-8FC8-2CCF2B510FD4@xxxxxxxxxxxxxxxx
Hi All,
Anyone know of a way to obtain the SessionID of a Terminal Services user
communicating to a functional driver. I would like to obtain the
SessionID
inside the Functional driver which is currently on the user thread in
kernel
space.
For example, I have a functional driver that can send status to an
application via IOCTL calls. The application sends an IOCTl requesting
information and I return STATUS_PENDING. When data is available I return
it
in the IRP and when the application has printed the information it sends
down
another request.
This information is generated by other calls, Opens, Closes, Reads,
Writes,
etc. to my functional driver via CreateFiler(), etc. Since these calls
are
done from other processes I was hoping that I could obtain the SessionID
(if
the user called from a Terminal Services session) and coorelate it with
the
SessionID obtained from the call the application made for the information
request IOCTL.
In short, the status application send and information request IOCTL down
to
my driver. I grab the Terminal Services ID (If available) and store it
with
the request. This IRP is now PENDING. A user calls CreateFile on my
device
and a Create request is sent to my driver. I want to grab the SessionID
from
this request and sent a notice only to the IRP that is pending on the same
SessionID.
In this way users only obtain information on devices they have opened.
Is this possible?
-David G
- References:
- Prev by Date: Re: Obtaining a Terminal Services SessionID in a functional driver
- Next by Date: Re: randon-number generation in kernel
- Previous by thread: Re: Obtaining a Terminal Services SessionID in a functional driver
- Index(es):
Relevant Pages
|