阅读:2630回复:0
如何取得当前的:Session ID。
各位,如何取得当前的Session ID。谢谢!
ZwOpenThreadToken() or ZwOpenProcessToken() then ZwQueryInformationToken() and ZwClose() NtQueryInformationProcess(NtCurrentProcess(),ProcessSessionInformation, & sessioninfo,infolen,&retlen); Session ID 是设么? NtQueryInformationProcess(NtCurrentProcess(),ProcessSessionInformation, & sessioninfo,infolen,&retlen); NtCurrentProcess() = -1; 无法取得sessioninfo。 QUOTE: 引用第4楼zh002008于2006-09-18 11:13发表的“”: NtQueryInformationProcess(NtCurrentProcess(),ProcessSessionInformation, & sessioninfo,infolen,&retlen); NtCurrentProcess() = -1; 无法取得sessioninfo。 passive_level用这个应该是没有问题的 驱网网上商城-开发板,开发资料光盘 [5 楼] Posted:2006-09-19 15:24| 如果你想在dispatch例程中获取SessionId的话,可以试一下这个函数: NTSTATUS IoGetRequestorSessionId( IN PIRP Irp, OUT PULONG pSessionId ); pSessionId返回IRP发起者所在进程所属的SessionId。 记得使用前声明一下它的原型。 |
|
|