最近是要仿一个任务管理器,在做到获取进程用户名的时候碰到问题了.
貌似不管怎么提权,都没有办法获得LOCAL SERVICES 和NETWORK SERVICE的用户名,花了不少时间在网上找资料,基本上没解决,就是提供了线索WTS API,但是找不到具体代码(有一个但是是VB的),难道VC就没有人写过这个代码么...
貌似不管怎么提权,都没有办法获得LOCAL SERVICES 和NETWORK SERVICE的用户名,花了不少时间在网上找资料,基本上没解决,就是提供了线索WTS API,但是找不到具体代码(有一个但是是VB的),难道VC就没有人写过这个代码么...
解决方案 »
- 求助高手,关于对话框内显示图像的问题。
- 急需要将这段C代码改写为VB代码
- 如何显式调用mfc扩展dll导出的整个类?
- 光标怎么一直都闪烁呢,急问!!
- 谁能解释一下 AdjustTokenPrivileges 函数的用法??
- VC中怎么得到文件的图标呢?
- 那位有关于bc(dos)开发的读图(640*480 256色)并显示的程序,小弟急用!!!!!
- 编译器问题搞定,问三角形面积计算:)
- socket发送压缩包解压发生错误
- sleep()函数的问题sdk
- _Font 是什么类型,需要添加什么头文件!
- 自定义的一个控件,如何设置其背景为透明,让其在另一个控件的上方,使下面的控件可以看的到,而不至于被遮挡。
BOOL WTSEnumerateProcesses(
__in HANDLE hServer,
DWORD Reserved,
__in DWORD Version,
__out PWTS_PROCESS_INFO* ppProcessInfo,
__out DWORD* pCount
);Parameters
hServer
Handle to a terminal server. Specify a handle opened by the WTSOpenServer function, or specify WTS_CURRENT_SERVER_HANDLE to indicate the terminal server on which your application is running.Reserved
Reserved; must be zero.Version
Specifies the version of the enumeration request. Must be 1.ppProcessInfo
Pointer to a variable that receives a pointer to an array of WTS_PROCESS_INFO structures. Each structure in the array contains information about an active process on the specified terminal server. To free the returned buffer, call the WTSFreeMemory function.pCount
Pointer to a variable that receives the number of WTS_PROCESS_INFO structures returned in the ppProcessInfo buffer.Return Value
If the function succeeds, the return value is a nonzero value.If the function fails, the return value is zero. To get extended error information, call GetLastError.Res
The caller must be a member of the Administrators group to enumerate processes that are running under a different user's context.Requirements
Client
Requires Windows Vista, Windows XP, or Windows 2000 Professional.
Server
Requires Windows Server 2008, Windows Server 2003, or Windows 2000 Server.
Header
Declared in WtsApi32.h.
Library
Use WtsApi32.lib.
DLL
Requires Wtsapi32.dll.
Unicode
Implemented as WTSEnumerateProcessesW (Unicode) and WTSEnumerateProcessesA (ANSI).