> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GetRunningProcesses

> IXtfConsoleControlClient::GetRunningProcesses

Causes all running processes to be enumerated, invoking a callback for each running process.

## Syntax

```cpp theme={null}
HRESULT GetRunningProcesses(
         IXtfRunningProcessCallback *pCallback
)  
```

### Parameters

*pCallback*\
Type: IXtfRunningProcessCallback\*

A pointer to the [IXtfRunningProcessCallback](https://docs.xbox.com/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfRunningProcessCallback/ixtfrunningprocesscallback.md) interface, invoked when a running process is discovered.

### Return value

Type: HRESULT

Returns `S_OK` if successful; otherwise, returns an HRESULT error code.

## Remarks

This function causes the XBOX Tools Framework (XTF) API to enumerate all of the running processes on the current development console. When a running process is found, the XTF API invokes the [OnFoundProcess](https://docs.xbox.com/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfRunningProcessCallback/methods/ixtfrunningprocesscallback_onfoundprocess.md) callback function of the [IXtfRunningProcessCallback](https://docs.xbox.com/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfRunningProcessCallback/ixtfrunningprocesscallback.md) interface implemented in your app and specified in `pCallback`. The XTF API passes a pointer to an [XTFPROCESSINFO](https://docs.xbox.com/reference/tools/xtf/xtfconsolecontrol/structs/xtfprocessinfo.md) structure, describing the running process, when it invokes your implemented `OnFoundProcess` function.

> [!NOTE]
>
> Memory for the [XTFPROCESSINFO](https://docs.xbox.com/reference/tools/xtf/xtfconsolecontrol/structs/xtfprocessinfo.md) structure is owned by the XBOX Tools Framework (XTF) API and is invalidated after each invocation of your [IXtfRunningProcessCallback::OnFoundProcess](https://docs.xbox.com/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfRunningProcessCallback/methods/ixtfrunningprocesscallback_onfoundprocess.md) callback function. You must copy the information in the structure if you need it for later use.

> [!NOTE]
>
> To get the list of processes running in the title partition you need to append `/title` to the address given in [XtfCreateConsoleClient](https://docs.xbox.com/reference/tools/xtf/xtfconsolecontrol/functions/xtfcreateconsolecontrolclient-xtfconsolecontrol-xbox-microsoft-m.md) when creating the [IXtfConsoleControlClient](https://docs.xbox.com/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfConsoleControlClient/ixtfconsolecontrolclient.md) instance, otherwise this function will return the list of processes running in the system partition.

For more information about listing running processes using XBOX Tools Framework (XTF), see [Process list (xbtlist.exe) (NDA topic)](https://docs.xbox.com/tools/tools-console/commandlinetools/xbtlist.md).

## Requirements

**Header:** xtfconsolecontrol.h

**Library:** xtfconsolecontrol.lib

**Supported platforms:** Windows (for XBOX console tools)

## See also

[IXtfConsoleControlClient](https://docs.xbox.com/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfConsoleControlClient/ixtfconsolecontrolclient.md)\
[XtfConsoleControl](https://docs.xbox.com/reference/tools/xtf/xtfconsolecontrol/xtfconsolecontrol_members.md)


## Related topics

- [IXtfRunningProcessCallback (Interface contents)](https://docs.xbox.com/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfRunningProcessCallback/ixtfrunningprocesscallback.md)
- [OnFoundProcess](https://docs.xbox.com/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfRunningProcessCallback/methods/ixtfrunningprocesscallback_onfoundprocess.md)
- [XTFPROCESSINFO](https://docs.xbox.com/reference/tools/xtf/xtfconsolecontrol/structs/xtfprocessinfo.md)
- [XtfConsoleControl (API contents)](https://docs.xbox.com/reference/tools/xtf/xtfconsolecontrol/xtfconsolecontrol_members.md)
- [IXtfConsoleControlClient (Interface contents)](https://docs.xbox.com/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfConsoleControlClient/ixtfconsolecontrolclient.md)
