Export (0) Print
Expand All
Expand Minimize
1 out of 1 rated this helpful - Rate this topic

WTSEnumerateProcesses function

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

Syntax


BOOL WTSEnumerateProcesses(
  _In_   HANDLE hServer,
  _In_   DWORD Reserved,
  _In_   DWORD Version,
  _Out_  PWTS_PROCESS_INFO *ppProcessInfo,
  _Out_  DWORD *pCount
);

Parameters

hServer [in]

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

Reserved [in]

Reserved; must be zero.

Version [in]

Specifies the version of the enumeration request. Must be 1.

ppProcessInfo [out]

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 RD Session Host server. To free the returned buffer, call the WTSFreeMemory function.

pCount [out]

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.

Remarks

The caller must be a member of the Administrators group to enumerate processes that are running under a different user's context.

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows Server 2003

Header

Wtsapi32.h

Library

Wtsapi32.lib

DLL

Wtsapi32.dll

Unicode and ANSI names

WTSEnumerateProcessesW (Unicode) and WTSEnumerateProcessesA (ANSI)

See also

WTS_PROCESS_INFO

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.