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

GetConsoleProcessList function

Retrieves a list of the processes attached to the current console.

Syntax


DWORD WINAPI GetConsoleProcessList(
  _Out_  LPDWORD lpdwProcessList,
  _In_   DWORD dwProcessCount
);

Parameters

lpdwProcessList [out]

A pointer to a buffer that receives an array of process identifiers upon success.

The storage for this buffer is allocated from a shared heap for the process that is 64 KB in size. The maximum size of the buffer will depend on heap usage.

dwProcessCount [in]

The maximum number of process identifiers that can be stored in the lpdwProcessList buffer.

Return value

If the function succeeds, the return value is less than or equal to dwProcessCount and represents the number of process identifiers stored in the lpdwProcessList buffer.

If the buffer is too small to hold all the valid process identifiers, the return value is the required number of array elements. The function will have stored no identifiers in the buffer. In this situation, use the return value to allocate a buffer that is large enough to store the entire list and call the function again.

If the return value is zero, the function has failed, because every console has at least one process associated with it. To get extended error information, call GetLastError.

Remarks

To compile an application that uses this function, define _WIN32_WINNT as 0x0501 or later. For more information, see Using the Windows Headers.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Wincon.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

See also

AttachConsole
Console Functions

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.