Go to the source code of this file.
◆ CloseProcess()
@CloseProcess
Closes a process.
- Parameters
-
[in] | lpszProcessName | The name of the executable process. |
- Returns
- Returns TRUE if the process has been terminated successfully, FALSE otherwise.
Definition at line 192 of file process.c.
193{
196
197
199 if (dwProcessID == 0)
200 {
202 }
203
204
206 {
208 }
209
210
213 {
214 DPRINT(
"CloseProcess(): Failed to open the process for termination! (Error: %lu)\n",
GetLastError());
216 }
217
218
222}
DWORD GetProcessID(IN LPCWSTR lpszProcessName)
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
HANDLE WINAPI OpenProcess(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwProcessId)
#define PROCESS_TERMINATE
_In_ BOOL _In_ HANDLE hProcess
DWORD WINAPI GetLastError(void)
DWORD WINAPI GetCurrentProcessId(void)
Referenced by DlgProc().
◆ GetProcessID()
@GetProcessID
Returns the process executable ID based on the given executable name.
- Parameters
-
[in] | lpszProcessName | The name of the executable process. |
- Returns
- Returns the ID number of the process, otherwise 0.
Definition at line 26 of file process.c.
27{
29
30
32
34 return 0;
35
36
38
39
41 {
42 do
43 {
45 {
46
49 }
50 }
52 }
53
55 return 0;
56}
#define INVALID_HANDLE_VALUE
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define TH32CS_SNAPPROCESS
Referenced by CloseProcess(), and IsProcessRunning().
◆ IsProcessRunning()
@IsProcessRunning
Checks if a process is running.
- Parameters
-
[in] | lpszProcessName | The name of the executable process. |
- Returns
- Returns TRUE if the given process' name is running, FALSE otherwise.
Definition at line 71 of file process.c.
72{
73 DWORD dwReturn, dwProcessID;
75
76
78 if (dwProcessID == 0)
79 {
81 }
82
83
86 {
87 DPRINT(
"IsProcessRunning(): Failed to open the process! (Error: %lu)\n",
GetLastError());
89 }
90
91
94 {
95
98 }
99
102}
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Referenced by InitUtilsList(), and ListBoxRefreshContents().
◆ LaunchProcess()
@LaunchProcess
Executes a process.
- Parameters
-
[in] | lpProcessName | The name of the executable process. |
- Returns
- Returns TRUE if the process has been launched successfully, FALSE otherwise.
Definition at line 117 of file process.c.
118{
124
125
127
133
134
137 {
140 }
141
142
145 {
149 }
150
151
154 ExpandedCmdLine,
158 0,
161 &si,
163
165 {
170 }
171
177}
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessAsUserW(_In_opt_ HANDLE hToken, _In_opt_ LPCWSTR lpApplicationName, _Inout_opt_ LPWSTR lpCommandLine, _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes, _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes, _In_ BOOL bInheritHandles, _In_ DWORD dwCreationFlags, _In_opt_ LPVOID lpEnvironment, _In_opt_ LPCWSTR lpCurrentDirectory, _In_ LPSTARTUPINFOW lpStartupInfo, _Out_ LPPROCESS_INFORMATION lpProcessInformation)
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
BOOL WINAPI DuplicateTokenEx(IN HANDLE ExistingTokenHandle, IN DWORD dwDesiredAccess, IN LPSECURITY_ATTRIBUTES lpTokenAttributes OPTIONAL, IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel, IN TOKEN_TYPE TokenType, OUT PHANDLE DuplicateTokenHandle)
#define GetCurrentProcess()
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
#define STARTF_USESHOWWINDOW
Referenced by DlgProc().