Skip to content

Latest commit

 

History

History
118 lines (84 loc) · 5.21 KB

nf-wtsapi32-wtsenumerateprocessesexw.md

File metadata and controls

118 lines (84 loc) · 5.21 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name req.apiset
NF:wtsapi32.WTSEnumerateProcessesExW
WTSEnumerateProcessesExW function (wtsapi32.h)
Retrieves information about the active processes on the specified Remote Desktop Session Host (RD Session Host) server or Remote Desktop Virtualization Host (RD Virtualization Host) server. (Unicode)
WTSEnumerateProcessesEx
WTSEnumerateProcessesEx function [Remote Desktop Services]
WTSEnumerateProcessesExW
termserv.wtsenumerateprocessesex
wtsapi32/WTSEnumerateProcessesEx
wtsapi32/WTSEnumerateProcessesExW
termserv\wtsenumerateprocessesex.htm
TermServ
bc8a2550-cf89-4203-b96b-c750c0dff255
12/05/2018
WTSEnumerateProcessesEx, WTSEnumerateProcessesEx function [Remote Desktop Services], WTSEnumerateProcessesExA, WTSEnumerateProcessesExW, termserv.wtsenumerateprocessesex, wtsapi32/WTSEnumerateProcessesEx, wtsapi32/WTSEnumerateProcessesExA, wtsapi32/WTSEnumerateProcessesExW
wtsapi32.h
Windows
Windows 7
Windows Server 2008 R2
WTSEnumerateProcessesExW (Unicode) and WTSEnumerateProcessesExA (ANSI)
Wtsapi32.lib
Wtsapi32.dll
Windows
19H1
WTSEnumerateProcessesExW
wtsapi32/WTSEnumerateProcessesExW
c++
APIRef
kbSyntax
DllExport
Wtsapi32.dll
Ext-MS-Win-Session-WtsApi32-l1-1-0.dll
WTSEnumerateProcessesEx
WTSEnumerateProcessesExA
WTSEnumerateProcessesExW
ext-ms-win-session-wtsapi32-l1-1-0 (introduced in Windows 8)

WTSEnumerateProcessesExW function

-description

Retrieves information about the active processes on the specified Remote Desktop Session Host (RD Session Host) server or Remote Desktop Virtualization Host (RD Virtualization Host) server.

-parameters

-param hServer [in]

A handle to an RD Session Host server. Specify a handle opened by the WTSOpenServer function, or specify WTS_CURRENT_SERVER_HANDLE to indicate the server on which your application is running.

-param pLevel [in, out]

A pointer to a DWORD variable that, on input, specifies the type of information to return. To return an array of WTS_PROCESS_INFO structures, specify zero. To return an array of WTS_PROCESS_INFO_EX structures, specify one.

If you do not specify a valid value for this parameter, on output, WTSEnumerateProcessesEx sets this parameter to one and returns an error. Otherwise, on output, WTSEnumerateProcessesEx does not change the value of this parameter.

-param SessionId [in]

The session for which to enumerate processes. To enumerate processes for all sessions on the server, specify WTS_ANY_SESSION.

-param ppProcessInfo [out]

A pointer to a variable that receives a pointer to an array of WTS_PROCESS_INFO or WTS_PROCESS_INFO_EX structures. The type of structure is determined by the value passed to the pLevel parameter. Each structure in the array contains information about an active process. When you have finished using the array, free it by calling the WTSFreeMemoryEx function. You should also set the pointer to NULL.

-param pCount [out]

A pointer to a variable that receives the number of
structures returned in the buffer referenced by the ppProcessInfo parameter.

-returns

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 the GetLastError function.

-remarks

The caller must be a member of the Administrators group to enumerate processes that are running under another user session.

Note

The wtsapi32.h header defines WTSEnumerateProcessesEx as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

-see-also

WTSOpenServer

WTS_PROCESS_INFO

WTS_PROCESS_INFO_EX