FreeRDP
process.c File Reference
#include <winpr/handle.h>
#include "../handle/nonehandle.h"
#include <winpr/thread.h>
#include <winpr/crt.h>
#include <winpr/path.h>
#include <winpr/environment.h>
#include <grp.h>
#include <signal.h>
#include "thread.h"
#include "../security/security.h"

Macros

#define NSIG   64
 

Functions

static char * FindApplicationPath (char *application)
 
static HANDLE CreateProcessHandle (pid_t pid)
 
static BOOL ProcessHandleCloseHandle (HANDLE handle)
 
BOOL _CreateProcessExA (HANDLE hToken, DWORD dwLogonFlags, LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
 
BOOL CreateProcessA (LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
 
BOOL CreateProcessW (LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
 
BOOL CreateProcessAsUserA (HANDLE hToken, LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
 
BOOL CreateProcessAsUserW (HANDLE hToken, LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
 
BOOL CreateProcessWithLogonA (LPCSTR lpUsername, LPCSTR lpDomain, LPCSTR lpPassword, DWORD dwLogonFlags, LPCSTR lpApplicationName, LPSTR lpCommandLine, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
 
BOOL CreateProcessWithLogonW (LPCWSTR lpUsername, LPCWSTR lpDomain, LPCWSTR lpPassword, DWORD dwLogonFlags, LPCWSTR lpApplicationName, LPWSTR lpCommandLine, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
 
BOOL CreateProcessWithTokenA (HANDLE hToken, DWORD dwLogonFlags, LPCSTR lpApplicationName, LPSTR lpCommandLine, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
 
BOOL CreateProcessWithTokenW (HANDLE hToken, DWORD dwLogonFlags, LPCWSTR lpApplicationName, LPWSTR lpCommandLine, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
 
VOID ExitProcess (UINT uExitCode)
 
BOOL GetExitCodeProcess (HANDLE hProcess, LPDWORD lpExitCode)
 
HANDLE _GetCurrentProcess (VOID)
 
DWORD GetCurrentProcessId (VOID)
 
DWORD GetProcessId (HANDLE Process)
 
BOOL TerminateProcess (HANDLE hProcess, UINT uExitCode)
 
static BOOL ProcessHandleIsHandle (HANDLE handle)
 
static int ProcessGetFd (HANDLE handle)
 

Variables

static HANDLE_OPS ops
 

Macro Definition Documentation

#define NSIG   64

WinPR: Windows Portable Runtime Process Thread Functions

Copyright 2012 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..nosp@m.com Copyright 2014 DI (FH) Martin Haimberger marti.nosp@m.n.ha.nosp@m.imber.nosp@m.ger@.nosp@m.thinc.nosp@m.ast..nosp@m.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. CreateProcessA CreateProcessW CreateProcessAsUserA CreateProcessAsUserW ExitProcess GetCurrentProcess GetCurrentProcessId GetExitCodeProcess GetProcessHandleCount GetProcessId GetProcessIdOfThread GetProcessMitigationPolicy GetProcessTimes GetProcessVersion OpenProcess OpenProcessToken ProcessIdToSessionId SetProcessAffinityUpdateMode SetProcessMitigationPolicy SetProcessShutdownParameters TerminateProcess

Function Documentation

BOOL _CreateProcessExA ( HANDLE  hToken,
DWORD  dwLogonFlags,
LPCSTR  lpApplicationName,
LPSTR  lpCommandLine,
LPSECURITY_ATTRIBUTES  lpProcessAttributes,
LPSECURITY_ATTRIBUTES  lpThreadAttributes,
BOOL  bInheritHandles,
DWORD  dwCreationFlags,
LPVOID  lpEnvironment,
LPCSTR  lpCurrentDirectory,
LPSTARTUPINFOA  lpStartupInfo,
LPPROCESS_INFORMATION  lpProcessInformation 
)

Here is the call graph for this function:

Here is the caller graph for this function:

HANDLE _GetCurrentProcess ( VOID  )
BOOL CreateProcessA ( LPCSTR  lpApplicationName,
LPSTR  lpCommandLine,
LPSECURITY_ATTRIBUTES  lpProcessAttributes,
LPSECURITY_ATTRIBUTES  lpThreadAttributes,
BOOL  bInheritHandles,
DWORD  dwCreationFlags,
LPVOID  lpEnvironment,
LPCSTR  lpCurrentDirectory,
LPSTARTUPINFOA  lpStartupInfo,
LPPROCESS_INFORMATION  lpProcessInformation 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL CreateProcessAsUserA ( HANDLE  hToken,
LPCSTR  lpApplicationName,
LPSTR  lpCommandLine,
LPSECURITY_ATTRIBUTES  lpProcessAttributes,
LPSECURITY_ATTRIBUTES  lpThreadAttributes,
BOOL  bInheritHandles,
DWORD  dwCreationFlags,
LPVOID  lpEnvironment,
LPCSTR  lpCurrentDirectory,
LPSTARTUPINFOA  lpStartupInfo,
LPPROCESS_INFORMATION  lpProcessInformation 
)

Here is the call graph for this function:

BOOL CreateProcessAsUserW ( HANDLE  hToken,
LPCWSTR  lpApplicationName,
LPWSTR  lpCommandLine,
LPSECURITY_ATTRIBUTES  lpProcessAttributes,
LPSECURITY_ATTRIBUTES  lpThreadAttributes,
BOOL  bInheritHandles,
DWORD  dwCreationFlags,
LPVOID  lpEnvironment,
LPCWSTR  lpCurrentDirectory,
LPSTARTUPINFOW  lpStartupInfo,
LPPROCESS_INFORMATION  lpProcessInformation 
)
HANDLE CreateProcessHandle ( pid_t  pid)
static

Here is the caller graph for this function:

BOOL CreateProcessW ( LPCWSTR  lpApplicationName,
LPWSTR  lpCommandLine,
LPSECURITY_ATTRIBUTES  lpProcessAttributes,
LPSECURITY_ATTRIBUTES  lpThreadAttributes,
BOOL  bInheritHandles,
DWORD  dwCreationFlags,
LPVOID  lpEnvironment,
LPCWSTR  lpCurrentDirectory,
LPSTARTUPINFOW  lpStartupInfo,
LPPROCESS_INFORMATION  lpProcessInformation 
)
BOOL CreateProcessWithLogonA ( LPCSTR  lpUsername,
LPCSTR  lpDomain,
LPCSTR  lpPassword,
DWORD  dwLogonFlags,
LPCSTR  lpApplicationName,
LPSTR  lpCommandLine,
DWORD  dwCreationFlags,
LPVOID  lpEnvironment,
LPCSTR  lpCurrentDirectory,
LPSTARTUPINFOA  lpStartupInfo,
LPPROCESS_INFORMATION  lpProcessInformation 
)
BOOL CreateProcessWithLogonW ( LPCWSTR  lpUsername,
LPCWSTR  lpDomain,
LPCWSTR  lpPassword,
DWORD  dwLogonFlags,
LPCWSTR  lpApplicationName,
LPWSTR  lpCommandLine,
DWORD  dwCreationFlags,
LPVOID  lpEnvironment,
LPCWSTR  lpCurrentDirectory,
LPSTARTUPINFOW  lpStartupInfo,
LPPROCESS_INFORMATION  lpProcessInformation 
)
BOOL CreateProcessWithTokenA ( HANDLE  hToken,
DWORD  dwLogonFlags,
LPCSTR  lpApplicationName,
LPSTR  lpCommandLine,
DWORD  dwCreationFlags,
LPVOID  lpEnvironment,
LPCSTR  lpCurrentDirectory,
LPSTARTUPINFOA  lpStartupInfo,
LPPROCESS_INFORMATION  lpProcessInformation 
)

Here is the call graph for this function:

BOOL CreateProcessWithTokenW ( HANDLE  hToken,
DWORD  dwLogonFlags,
LPCWSTR  lpApplicationName,
LPWSTR  lpCommandLine,
DWORD  dwCreationFlags,
LPVOID  lpEnvironment,
LPCWSTR  lpCurrentDirectory,
LPSTARTUPINFOW  lpStartupInfo,
LPPROCESS_INFORMATION  lpProcessInformation 
)
VOID ExitProcess ( UINT  uExitCode)
static char* FindApplicationPath ( char *  application)
static

If the file name does not contain a directory path, the system searches for the executable file in the following sequence:

1) The directory from which the application loaded. 2) The current directory for the parent process. 3) The 32-bit Windows system directory. Use the GetSystemDirectory function to get the path of this directory. 4) The 16-bit Windows system directory. There is no function that obtains the path of this directory, but it is searched. The name of this directory is System. 5) The Windows directory. Use the GetWindowsDirectory function to get the path of this directory. 6) The directories that are listed in the PATH environment variable. Note that this function does not search the per-application path specified by the App Paths registry key. To include this per-application path in the search sequence, use the ShellExecute function.

Here is the call graph for this function:

Here is the caller graph for this function:

DWORD GetCurrentProcessId ( VOID  )
BOOL GetExitCodeProcess ( HANDLE  hProcess,
LPDWORD  lpExitCode 
)

Here is the caller graph for this function:

DWORD GetProcessId ( HANDLE  Process)
static int ProcessGetFd ( HANDLE  handle)
static

Here is the call graph for this function:

static BOOL ProcessHandleCloseHandle ( HANDLE  handle)
static

Here is the caller graph for this function:

static BOOL ProcessHandleIsHandle ( HANDLE  handle)
static

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL TerminateProcess ( HANDLE  hProcess,
UINT  uExitCode 
)

Here is the caller graph for this function:

Variable Documentation

HANDLE_OPS ops
static
Initial value:
=
{
NULL,
NULL
}
static BOOL ProcessHandleCloseHandle(HANDLE handle)
Definition: process.c:484
static int ProcessGetFd(HANDLE handle)
Definition: process.c:504
if availableBytes return NULL
Definition: TPCircularBuffer.h:104
static BOOL ProcessHandleIsHandle(HANDLE handle)
Definition: process.c:491