Process Hacker
appsup.c File Reference
#include <phapp.h>
#include <settings.h>
#include <symprv.h>
#include <cpysave.h>
#include <phappres.h>
#include <emenu.h>
#include <phsvccl.h>
#include "mxml/mxml.h"
#include <winsta.h>
#include <dbghelp.h>
#include <appmodel.h>

Go to the source code of this file.

Typedefs

typedef LONG(WINAPI * _GetPackageFullName )(_In_ HANDLE hProcess, _Inout_ UINT32 *packageFullNameLength, _Out_opt_ PWSTR packageFullName)
 
typedef LONG(WINAPI * _GetPackagePath )(_In_ PACKAGE_ID *packageId, _Reserved_ UINT32 reserved, _Inout_ UINT32 *pathLength, _Out_opt_ PWSTR path)
 
typedef LONG(WINAPI * _PackageIdFromFullName )(_In_ PCWSTR packageFullName, _In_ UINT32 flags, _Inout_ UINT32 *bufferLength, _Out_opt_ BYTE *buffer)
 
typedef struct
_GET_PROCESS_MAIN_WINDOW_CONTEXT 
GET_PROCESS_MAIN_WINDOW_CONTEXT
 
typedef struct
_GET_PROCESS_MAIN_WINDOW_CONTEXT * 
PGET_PROCESS_MAIN_WINDOW_CONTEXT
 

Functions

BOOLEAN PhGetProcessIsSuspended (_In_ PSYSTEM_PROCESS_INFORMATION Process)
 Determines whether a process is suspended.
 
NTSTATUS PhGetProcessSwitchContext (_In_ HANDLE ProcessHandle, _Out_ PGUID Guid)
 Determines the OS compatibility context of a process.
 
PPH_STRING PhGetProcessPackageFullName (_In_ HANDLE ProcessHandle)
 
PACKAGE_IDPhPackageIdFromFullName (_In_ PWSTR PackageFullName)
 
PPH_STRING PhGetPackagePath (_In_ PACKAGE_ID *PackageId)
 
NTSTATUS PhGetProcessKnownType (_In_ HANDLE ProcessHandle, _Out_ PH_KNOWN_PROCESS_TYPE *KnownProcessType)
 Determines the type of a process based on its image file name.
 
BOOLEAN PhaGetProcessKnownCommandLine (_In_ PPH_STRING CommandLine, _In_ PH_KNOWN_PROCESS_TYPE KnownProcessType, _Out_ PPH_KNOWN_PROCESS_COMMAND_LINE KnownCommandLine)
 
VOID PhEnumChildWindows (_In_opt_ HWND hWnd, _In_ ULONG Limit, _In_ WNDENUMPROC Callback, _In_ LPARAM lParam)
 
BOOL CALLBACK PhpGetProcessMainWindowEnumWindowsProc (_In_ HWND hwnd, _In_ LPARAM lParam)
 
HWND PhGetProcessMainWindow (_In_ HANDLE ProcessId, _In_opt_ HANDLE ProcessHandle)
 
PPH_STRING PhGetServiceRelevantFileName (_In_ PPH_STRINGREF ServiceName, _In_ SC_HANDLE ServiceHandle)
 
PPH_STRING PhEscapeStringForDelimiter (_In_ PPH_STRING String, _In_ WCHAR Delimiter)
 
PPH_STRING PhUnescapeStringForDelimiter (_In_ PPH_STRING String, _In_ WCHAR Delimiter)
 
PPH_STRING PhGetOpaqueXmlNodeText (_In_ mxml_node_t *node)
 
VOID PhSearchOnlineString (_In_ HWND hWnd, _In_ PWSTR String)
 
VOID PhShellExecuteUserString (_In_ HWND hWnd, _In_ PWSTR Setting, _In_ PWSTR String, _In_ BOOLEAN UseShellExecute, _In_opt_ PWSTR ErrorMessage)
 
VOID PhLoadSymbolProviderOptions (_Inout_ PPH_SYMBOL_PROVIDER SymbolProvider)
 
PWSTR PhMakeContextAtom (VOID)
 
VOID PhCopyListViewInfoTip (_Inout_ LPNMLVGETINFOTIP GetInfoTip, _In_ PPH_STRINGREF Tip)
 Copies a string into a NMLVGETINFOTIP structure.
 
VOID PhCopyListView (_In_ HWND ListViewHandle)
 
VOID PhHandleListViewNotifyForCopy (_In_ LPARAM lParam, _In_ HWND ListViewHandle)
 
VOID PhHandleListViewNotifyBehaviors (_In_ LPARAM lParam, _In_ HWND ListViewHandle, _In_ ULONG Behaviors)
 
BOOLEAN PhGetListViewContextMenuPoint (_In_ HWND ListViewHandle, _Out_ PPOINT Point)
 
HFONT PhDuplicateFontWithNewWeight (_In_ HFONT Font, _In_ LONG NewWeight)
 
VOID PhSetWindowOpacity (_In_ HWND WindowHandle, _In_ ULONG OpacityPercent)
 
VOID PhLoadWindowPlacementFromSetting (_In_opt_ PWSTR PositionSettingName, _In_opt_ PWSTR SizeSettingName, _In_ HWND WindowHandle)
 
VOID PhSaveWindowPlacementToSetting (_In_opt_ PWSTR PositionSettingName, _In_opt_ PWSTR SizeSettingName, _In_ HWND WindowHandle)
 
VOID PhLoadListViewColumnsFromSetting (_In_ PWSTR Name, _In_ HWND ListViewHandle)
 
VOID PhSaveListViewColumnsToSetting (_In_ PWSTR Name, _In_ HWND ListViewHandle)
 
PPH_STRING PhGetPhVersion (VOID)
 
VOID PhGetPhVersionNumbers (_Out_opt_ PULONG MajorVersion, _Out_opt_ PULONG MinorVersion, _Reserved_ PULONG Reserved, _Out_opt_ PULONG RevisionNumber)
 
VOID PhWritePhTextHeader (_Inout_ PPH_FILE_STREAM FileStream)
 
BOOLEAN PhShellProcessHacker (_In_opt_ HWND hWnd, _In_opt_ PWSTR Parameters, _In_ ULONG ShowWindowType, _In_ ULONG Flags, _In_ ULONG AppFlags, _In_opt_ ULONG Timeout, _Out_opt_ PHANDLE ProcessHandle)
 
BOOLEAN PhShellProcessHackerEx (_In_opt_ HWND hWnd, _In_opt_ PWSTR FileName, _In_opt_ PWSTR Parameters, _In_ ULONG ShowWindowType, _In_ ULONG Flags, _In_ ULONG AppFlags, _In_opt_ ULONG Timeout, _Out_opt_ PHANDLE ProcessHandle)
 
BOOLEAN PhCreateProcessIgnoreIfeoDebugger (_In_ PWSTR FileName)
 
VOID PhInitializeTreeNewColumnMenu (_Inout_ PPH_TN_COLUMN_MENU_DATA Data)
 
VOID PhInitializeTreeNewColumnMenuEx (_Inout_ PPH_TN_COLUMN_MENU_DATA Data, _In_ ULONG Flags)
 
VOID PhpEnsureValidSortColumnTreeNew (_Inout_ HWND TreeNewHandle, _In_ ULONG DefaultSortColumn, _In_ PH_SORT_ORDER DefaultSortOrder)
 
BOOLEAN PhHandleTreeNewColumnMenu (_Inout_ PPH_TN_COLUMN_MENU_DATA Data)
 
VOID PhDeleteTreeNewColumnMenu (_In_ PPH_TN_COLUMN_MENU_DATA Data)
 
VOID PhInitializeTreeNewFilterSupport (_Out_ PPH_TN_FILTER_SUPPORT Support, _In_ HWND TreeNewHandle, _In_ PPH_LIST NodeList)
 
VOID PhDeleteTreeNewFilterSupport (_In_ PPH_TN_FILTER_SUPPORT Support)
 
PPH_TN_FILTER_ENTRY PhAddTreeNewFilter (_In_ PPH_TN_FILTER_SUPPORT Support, _In_ PPH_TN_FILTER_FUNCTION Filter, _In_opt_ PVOID Context)
 
VOID PhRemoveTreeNewFilter (_In_ PPH_TN_FILTER_SUPPORT Support, _In_ PPH_TN_FILTER_ENTRY Entry)
 
BOOLEAN PhApplyTreeNewFiltersToNode (_In_ PPH_TN_FILTER_SUPPORT Support, _In_ PPH_TREENEW_NODE Node)
 
VOID PhApplyTreeNewFilters (_In_ PPH_TN_FILTER_SUPPORT Support)
 
VOID NTAPI PhpCopyCellEMenuItemDeleteFunction (_In_ struct _PH_EMENU_ITEM *Item)
 
BOOLEAN PhInsertCopyCellEMenuItem (_In_ struct _PH_EMENU_ITEM *Menu, _In_ ULONG InsertAfterId, _In_ HWND TreeNewHandle, _In_ PPH_TREENEW_COLUMN Column)
 
BOOLEAN PhHandleCopyCellEMenuItem (_In_ struct _PH_EMENU_ITEM *SelectedItem)
 
BOOLEAN PhpSelectFavoriteInRegedit (_In_ HWND RegeditWindow, _In_ PPH_STRINGREF FavoriteName, _In_ BOOLEAN UsePhSvc)
 
BOOLEAN PhShellOpenKey2 (_In_ HWND hWnd, _In_ PPH_STRING KeyName)
 Opens a key in the Registry Editor.
 

Variables

GUID XP_CONTEXT_GUID = { 0xbeb1b341, 0x6837, 0x4c83, { 0x83, 0x66, 0x2b, 0x45, 0x1e, 0x7c, 0xe6, 0x9b } }
 
GUID VISTA_CONTEXT_GUID = { 0xe2011457, 0x1546, 0x43c5, { 0xa5, 0xfe, 0x00, 0x8d, 0xee, 0xe3, 0xd3, 0xf0 } }
 
GUID WIN7_CONTEXT_GUID = { 0x35138b9a, 0x5d96, 0x4fbd, { 0x8e, 0x2d, 0xa2, 0x44, 0x02, 0x25, 0xf9, 0x3a } }
 
GUID WIN8_CONTEXT_GUID = { 0x4a2f28e3, 0x53b9, 0x4441, { 0xba, 0x9c, 0xd6, 0x9d, 0x4a, 0x4a, 0x6e, 0x38 } }
 
GUID WINBLUE_CONTEXT_GUID = { 0x1f676c76, 0x80e1, 0x4239, { 0x95, 0xbb, 0x83, 0xd0, 0xf6, 0xd0, 0xda, 0x78 } }
 

Typedef Documentation

typedef LONG(WINAPI * _GetPackageFullName)(_In_ HANDLE hProcess, _Inout_ UINT32 *packageFullNameLength, _Out_opt_ PWSTR packageFullName)

Definition at line 35 of file appsup.c.

typedef LONG(WINAPI * _GetPackagePath)(_In_ PACKAGE_ID *packageId, _Reserved_ UINT32 reserved, _Inout_ UINT32 *pathLength, _Out_opt_ PWSTR path)

Definition at line 41 of file appsup.c.

typedef LONG(WINAPI * _PackageIdFromFullName)(_In_ PCWSTR packageFullName, _In_ UINT32 flags, _Inout_ UINT32 *bufferLength, _Out_opt_ BYTE *buffer)

Definition at line 48 of file appsup.c.

typedef struct _GET_PROCESS_MAIN_WINDOW_CONTEXT GET_PROCESS_MAIN_WINDOW_CONTEXT
typedef struct _GET_PROCESS_MAIN_WINDOW_CONTEXT * PGET_PROCESS_MAIN_WINDOW_CONTEXT

Function Documentation

PPH_TN_FILTER_ENTRY PhAddTreeNewFilter ( _In_ PPH_TN_FILTER_SUPPORT  Support,
_In_ PPH_TN_FILTER_FUNCTION  Filter,
_In_opt_ PVOID  Context 
)

Definition at line 1762 of file appsup.c.

BOOLEAN PhaGetProcessKnownCommandLine ( _In_ PPH_STRING  CommandLine,
_In_ PH_KNOWN_PROCESS_TYPE  KnownProcessType,
_Out_ PPH_KNOWN_PROCESS_COMMAND_LINE  KnownCommandLine 
)

Definition at line 461 of file appsup.c.

VOID PhApplyTreeNewFilters ( _In_ PPH_TN_FILTER_SUPPORT  Support)

Definition at line 1830 of file appsup.c.

BOOLEAN PhApplyTreeNewFiltersToNode ( _In_ PPH_TN_FILTER_SUPPORT  Support,
_In_ PPH_TREENEW_NODE  Node 
)

Definition at line 1801 of file appsup.c.

VOID PhCopyListView ( _In_ HWND  ListViewHandle)

Definition at line 1030 of file appsup.c.

VOID PhCopyListViewInfoTip ( _Inout_ LPNMLVGETINFOTIP  GetInfoTip,
_In_ PPH_STRINGREF  Tip 
)

Copies a string into a NMLVGETINFOTIP structure.

Parameters
GetInfoTipThe NMLVGETINFOTIP structure.
TipThe string to copy.
Remarks
The text is truncated if it is too long.

Definition at line 996 of file appsup.c.

BOOLEAN PhCreateProcessIgnoreIfeoDebugger ( _In_ PWSTR  FileName)

Definition at line 1476 of file appsup.c.

VOID PhDeleteTreeNewColumnMenu ( _In_ PPH_TN_COLUMN_MENU_DATA  Data)

Definition at line 1733 of file appsup.c.

VOID PhDeleteTreeNewFilterSupport ( _In_ PPH_TN_FILTER_SUPPORT  Support)

Definition at line 1755 of file appsup.c.

HFONT PhDuplicateFontWithNewWeight ( _In_ HFONT  Font,
_In_ LONG  NewWeight 
)

Definition at line 1120 of file appsup.c.

VOID PhEnumChildWindows ( _In_opt_ HWND  hWnd,
_In_ ULONG  Limit,
_In_ WNDENUMPROC  Callback,
_In_ LPARAM  lParam 
)

Definition at line 667 of file appsup.c.

PPH_STRING PhEscapeStringForDelimiter ( _In_ PPH_STRING  String,
_In_ WCHAR  Delimiter 
)

Definition at line 803 of file appsup.c.

BOOLEAN PhGetListViewContextMenuPoint ( _In_ HWND  ListViewHandle,
_Out_ PPOINT  Point 
)

Definition at line 1079 of file appsup.c.

PPH_STRING PhGetOpaqueXmlNodeText ( _In_ mxml_node_t node)

Definition at line 870 of file appsup.c.

PPH_STRING PhGetPackagePath ( _In_ PACKAGE_ID PackageId)

Definition at line 287 of file appsup.c.

PPH_STRING PhGetPhVersion ( VOID  )

Definition at line 1277 of file appsup.c.

VOID PhGetPhVersionNumbers ( _Out_opt_ PULONG  MajorVersion,
_Out_opt_ PULONG  MinorVersion,
_Reserved_ PULONG  Reserved,
_Out_opt_ PULONG  RevisionNumber 
)

Definition at line 1290 of file appsup.c.

BOOLEAN PhGetProcessIsSuspended ( _In_ PSYSTEM_PROCESS_INFORMATION  Process)

Determines whether a process is suspended.

Parameters
ProcessThe SYSTEM_PROCESS_INFORMATION structure of the process.

Definition at line 67 of file appsup.c.

NTSTATUS PhGetProcessKnownType ( _In_ HANDLE  ProcessHandle,
_Out_ PH_KNOWN_PROCESS_TYPE KnownProcessType 
)

Determines the type of a process based on its image file name.

Parameters
ProcessHandleA handle to a process.
KnownProcessTypeA variable which receives the process type.

Definition at line 334 of file appsup.c.

HWND PhGetProcessMainWindow ( _In_ HANDLE  ProcessId,
_In_opt_ HANDLE  ProcessHandle 
)

Definition at line 734 of file appsup.c.

PPH_STRING PhGetProcessPackageFullName ( _In_ HANDLE  ProcessHandle)

Definition at line 208 of file appsup.c.

NTSTATUS PhGetProcessSwitchContext ( _In_ HANDLE  ProcessHandle,
_Out_ PGUID  Guid 
)

Determines the OS compatibility context of a process.

Parameters
ProcessHandleA handle to a process.
GuidA variable which receives a GUID identifying an operating system version.

Definition at line 92 of file appsup.c.

PPH_STRING PhGetServiceRelevantFileName ( _In_ PPH_STRINGREF  ServiceName,
_In_ SC_HANDLE  ServiceHandle 
)

Definition at line 761 of file appsup.c.

BOOLEAN PhHandleCopyCellEMenuItem ( _In_ struct _PH_EMENU_ITEM SelectedItem)

Definition at line 1906 of file appsup.c.

VOID PhHandleListViewNotifyBehaviors ( _In_ LPARAM  lParam,
_In_ HWND  ListViewHandle,
_In_ ULONG  Behaviors 
)

Definition at line 1049 of file appsup.c.

VOID PhHandleListViewNotifyForCopy ( _In_ LPARAM  lParam,
_In_ HWND  ListViewHandle 
)

Definition at line 1041 of file appsup.c.

BOOLEAN PhHandleTreeNewColumnMenu ( _Inout_ PPH_TN_COLUMN_MENU_DATA  Data)

Definition at line 1667 of file appsup.c.

VOID PhInitializeTreeNewColumnMenu ( _Inout_ PPH_TN_COLUMN_MENU_DATA  Data)

Definition at line 1521 of file appsup.c.

VOID PhInitializeTreeNewColumnMenuEx ( _Inout_ PPH_TN_COLUMN_MENU_DATA  Data,
_In_ ULONG  Flags 
)

Definition at line 1528 of file appsup.c.

VOID PhInitializeTreeNewFilterSupport ( _Out_ PPH_TN_FILTER_SUPPORT  Support,
_In_ HWND  TreeNewHandle,
_In_ PPH_LIST  NodeList 
)

Definition at line 1744 of file appsup.c.

BOOLEAN PhInsertCopyCellEMenuItem ( _In_ struct _PH_EMENU_ITEM Menu,
_In_ ULONG  InsertAfterId,
_In_ HWND  TreeNewHandle,
_In_ PPH_TREENEW_COLUMN  Column 
)

Definition at line 1863 of file appsup.c.

VOID PhLoadListViewColumnsFromSetting ( _In_ PWSTR  Name,
_In_ HWND  ListViewHandle 
)

Definition at line 1253 of file appsup.c.

VOID PhLoadSymbolProviderOptions ( _Inout_ PPH_SYMBOL_PROVIDER  SymbolProvider)

Definition at line 962 of file appsup.c.

VOID PhLoadWindowPlacementFromSetting ( _In_opt_ PWSTR  PositionSettingName,
_In_opt_ PWSTR  SizeSettingName,
_In_ HWND  WindowHandle 
)

Definition at line 1165 of file appsup.c.

PWSTR PhMakeContextAtom ( VOID  )

Definition at line 981 of file appsup.c.

PACKAGE_ID* PhPackageIdFromFullName ( _In_ PWSTR  PackageFullName)

Definition at line 248 of file appsup.c.

VOID NTAPI PhpCopyCellEMenuItemDeleteFunction ( _In_ struct _PH_EMENU_ITEM Item)

Definition at line 1852 of file appsup.c.

VOID PhpEnsureValidSortColumnTreeNew ( _Inout_ HWND  TreeNewHandle,
_In_ ULONG  DefaultSortColumn,
_In_ PH_SORT_ORDER  DefaultSortOrder 
)

Definition at line 1602 of file appsup.c.

BOOL CALLBACK PhpGetProcessMainWindowEnumWindowsProc ( _In_ HWND  hwnd,
_In_ LPARAM  lParam 
)

Definition at line 694 of file appsup.c.

BOOLEAN PhpSelectFavoriteInRegedit ( _In_ HWND  RegeditWindow,
_In_ PPH_STRINGREF  FavoriteName,
_In_ BOOLEAN  UsePhSvc 
)

Definition at line 1957 of file appsup.c.

VOID PhRemoveTreeNewFilter ( _In_ PPH_TN_FILTER_SUPPORT  Support,
_In_ PPH_TN_FILTER_ENTRY  Entry 
)

Definition at line 1782 of file appsup.c.

VOID PhSaveListViewColumnsToSetting ( _In_ PWSTR  Name,
_In_ HWND  ListViewHandle 
)

Definition at line 1265 of file appsup.c.

VOID PhSaveWindowPlacementToSetting ( _In_opt_ PWSTR  PositionSettingName,
_In_opt_ PWSTR  SizeSettingName,
_In_ HWND  WindowHandle 
)

Definition at line 1227 of file appsup.c.

VOID PhSearchOnlineString ( _In_ HWND  hWnd,
_In_ PWSTR  String 
)

Definition at line 884 of file appsup.c.

VOID PhSetWindowOpacity ( _In_ HWND  WindowHandle,
_In_ ULONG  OpacityPercent 
)

Definition at line 1138 of file appsup.c.

VOID PhShellExecuteUserString ( _In_ HWND  hWnd,
_In_ PWSTR  Setting,
_In_ PWSTR  String,
_In_ BOOLEAN  UseShellExecute,
_In_opt_ PWSTR  ErrorMessage 
)

Definition at line 892 of file appsup.c.

BOOLEAN PhShellOpenKey2 ( _In_ HWND  hWnd,
_In_ PPH_STRING  KeyName 
)

Opens a key in the Registry Editor.

If the Registry Editor is already open, the specified key is selected in the Registry Editor.

Parameters
hWndA handle to the parent window.
KeyNameThe key name to open.

Definition at line 2051 of file appsup.c.

BOOLEAN PhShellProcessHacker ( _In_opt_ HWND  hWnd,
_In_opt_ PWSTR  Parameters,
_In_ ULONG  ShowWindowType,
_In_ ULONG  Flags,
_In_ ULONG  AppFlags,
_In_opt_ ULONG  Timeout,
_Out_opt_ PHANDLE  ProcessHandle 
)

Definition at line 1344 of file appsup.c.

BOOLEAN PhShellProcessHackerEx ( _In_opt_ HWND  hWnd,
_In_opt_ PWSTR  FileName,
_In_opt_ PWSTR  Parameters,
_In_ ULONG  ShowWindowType,
_In_ ULONG  Flags,
_In_ ULONG  AppFlags,
_In_opt_ ULONG  Timeout,
_Out_opt_ PHANDLE  ProcessHandle 
)

Definition at line 1366 of file appsup.c.

PPH_STRING PhUnescapeStringForDelimiter ( _In_ PPH_STRING  String,
_In_ WCHAR  Delimiter 
)

Definition at line 834 of file appsup.c.

VOID PhWritePhTextHeader ( _Inout_ PPH_FILE_STREAM  FileStream)

Definition at line 1305 of file appsup.c.

Variable Documentation

GUID VISTA_CONTEXT_GUID = { 0xe2011457, 0x1546, 0x43c5, { 0xa5, 0xfe, 0x00, 0x8d, 0xee, 0xe3, 0xd3, 0xf0 } }

Definition at line 56 of file appsup.c.

GUID WIN7_CONTEXT_GUID = { 0x35138b9a, 0x5d96, 0x4fbd, { 0x8e, 0x2d, 0xa2, 0x44, 0x02, 0x25, 0xf9, 0x3a } }

Definition at line 57 of file appsup.c.

GUID WIN8_CONTEXT_GUID = { 0x4a2f28e3, 0x53b9, 0x4441, { 0xba, 0x9c, 0xd6, 0x9d, 0x4a, 0x4a, 0x6e, 0x38 } }

Definition at line 58 of file appsup.c.

GUID WINBLUE_CONTEXT_GUID = { 0x1f676c76, 0x80e1, 0x4239, { 0x95, 0xbb, 0x83, 0xd0, 0xf6, 0xd0, 0xda, 0x78 } }

Definition at line 59 of file appsup.c.

GUID XP_CONTEXT_GUID = { 0xbeb1b341, 0x6837, 0x4c83, { 0x83, 0x66, 0x2b, 0x45, 0x1e, 0x7c, 0xe6, 0x9b } }

Definition at line 55 of file appsup.c.