Commit 09f588ee authored by Alexandre Julliard's avatar Alexandre Julliard

kernel32: Move some process functions to kernelbase.

parent f2e7e165
...@@ -252,14 +252,6 @@ BOOL WINAPI HeapUnlock( ...@@ -252,14 +252,6 @@ BOOL WINAPI HeapUnlock(
} }
/***********************************************************************
* GetProcessHeaps (KERNEL32.@)
*/
DWORD WINAPI GetProcessHeaps( DWORD count, HANDLE *heaps )
{
return RtlGetProcessHeaps( count, heaps );
}
/* These are needed so that we can call the functions from inside kernel itself */ /* These are needed so that we can call the functions from inside kernel itself */
......
...@@ -517,7 +517,7 @@ ...@@ -517,7 +517,7 @@
@ stdcall -import FlsSetValue(long ptr) @ stdcall -import FlsSetValue(long ptr)
@ stdcall FlushConsoleInputBuffer(long) @ stdcall FlushConsoleInputBuffer(long)
@ stdcall FlushFileBuffers(long) @ stdcall FlushFileBuffers(long)
@ stdcall FlushInstructionCache(long long long) @ stdcall -import FlushInstructionCache(long long long)
@ stdcall FlushProcessWriteBuffers() @ stdcall FlushProcessWriteBuffers()
@ stdcall FlushViewOfFile(ptr long) @ stdcall FlushViewOfFile(ptr long)
@ stdcall FoldStringA(long str long ptr long) @ stdcall FoldStringA(long str long ptr long)
...@@ -664,7 +664,7 @@ ...@@ -664,7 +664,7 @@
@ stdcall GetEnvironmentVariableA(str ptr long) @ stdcall GetEnvironmentVariableA(str ptr long)
@ stdcall GetEnvironmentVariableW(wstr ptr long) @ stdcall GetEnvironmentVariableW(wstr ptr long)
# @ stub GetEraNameCountedString # @ stub GetEraNameCountedString
@ stdcall GetErrorMode() @ stdcall -import GetErrorMode()
@ stdcall GetExitCodeProcess(long ptr) @ stdcall GetExitCodeProcess(long ptr)
@ stdcall -import GetExitCodeThread(long ptr) @ stdcall -import GetExitCodeThread(long ptr)
@ stdcall GetExpandedNameA(str ptr) @ stdcall GetExpandedNameA(str ptr)
...@@ -763,7 +763,7 @@ ...@@ -763,7 +763,7 @@
@ stdcall GetUserPreferredUILanguages(long ptr ptr ptr) @ stdcall GetUserPreferredUILanguages(long ptr ptr ptr)
@ stdcall GetPackageFullName(long ptr ptr) @ stdcall GetPackageFullName(long ptr ptr)
@ stdcall GetPhysicallyInstalledSystemMemory(ptr) @ stdcall GetPhysicallyInstalledSystemMemory(ptr)
@ stdcall GetPriorityClass(long) @ stdcall -import GetPriorityClass(long)
@ stdcall GetPrivateProfileIntA(str str long str) @ stdcall GetPrivateProfileIntA(str str long str)
@ stdcall GetPrivateProfileIntW(wstr wstr long wstr) @ stdcall GetPrivateProfileIntW(wstr wstr long wstr)
@ stdcall GetPrivateProfileSectionA(str ptr long str) @ stdcall GetPrivateProfileSectionA(str ptr long str)
...@@ -779,22 +779,22 @@ ...@@ -779,22 +779,22 @@
@ stdcall GetProcessDEPPolicy(long ptr ptr) @ stdcall GetProcessDEPPolicy(long ptr ptr)
@ stdcall GetProcessFlags(long) @ stdcall GetProcessFlags(long)
# @ stub GetProcessGroupAffinity # @ stub GetProcessGroupAffinity
@ stdcall GetProcessHandleCount(long ptr) @ stdcall -import GetProcessHandleCount(long ptr)
@ stdcall -norelay GetProcessHeap() KERNEL32_GetProcessHeap @ stdcall -import GetProcessHeap()
@ stdcall GetProcessHeaps(long ptr) @ stdcall -import GetProcessHeaps(long ptr) RtlGetProcessHeaps
@ stdcall GetProcessId(long) @ stdcall -import GetProcessId(long)
@ stdcall -import GetProcessIdOfThread(long) @ stdcall -import GetProcessIdOfThread(long)
@ stdcall GetProcessIoCounters(long ptr) @ stdcall GetProcessIoCounters(long ptr)
@ stdcall GetProcessMitigationPolicy(long long ptr long) @ stdcall -import GetProcessMitigationPolicy(long long ptr long)
@ stdcall GetProcessPreferredUILanguages(long ptr ptr ptr) @ stdcall GetProcessPreferredUILanguages(long ptr ptr ptr)
@ stdcall GetProcessPriorityBoost(long ptr) @ stdcall -import GetProcessPriorityBoost(long ptr)
@ stdcall GetProcessShutdownParameters(ptr ptr) @ stdcall -import GetProcessShutdownParameters(ptr ptr)
# @ stub GetProcessorSystemCycleTime # @ stub GetProcessorSystemCycleTime
@ stdcall GetProcessTimes(long ptr ptr ptr ptr) @ stdcall GetProcessTimes(long ptr ptr ptr ptr)
# @ stub GetProcessUserModeExceptionPolicy # @ stub GetProcessUserModeExceptionPolicy
@ stdcall GetProcessVersion(long) @ stdcall GetProcessVersion(long)
@ stdcall GetProcessWorkingSetSize(long ptr ptr) @ stdcall GetProcessWorkingSetSize(long ptr ptr)
@ stdcall GetProcessWorkingSetSizeEx(long ptr ptr ptr) @ stdcall -import GetProcessWorkingSetSizeEx(long ptr ptr ptr)
@ stdcall GetProductInfo(long long long long ptr) @ stdcall GetProductInfo(long long long long ptr)
@ stub GetProductName @ stub GetProductName
@ stdcall GetProfileIntA(str str long) @ stdcall GetProfileIntA(str str long)
...@@ -994,7 +994,7 @@ ...@@ -994,7 +994,7 @@
@ stdcall IsValidLocale(long long) @ stdcall IsValidLocale(long long)
@ stdcall IsValidLocaleName(wstr) @ stdcall IsValidLocaleName(wstr)
# @ stub IsValidUILanguage # @ stub IsValidUILanguage
@ stdcall IsWow64Process(ptr ptr) @ stdcall -import IsWow64Process(ptr ptr)
@ stdcall K32EmptyWorkingSet(long) @ stdcall K32EmptyWorkingSet(long)
@ stdcall K32EnumDeviceDrivers(ptr long ptr) @ stdcall K32EnumDeviceDrivers(ptr long ptr)
@ stdcall K32EnumPageFilesA(ptr ptr) @ stdcall K32EnumPageFilesA(ptr ptr)
...@@ -1124,7 +1124,7 @@ ...@@ -1124,7 +1124,7 @@
@ stdcall -import OpenMutexW(long long wstr) @ stdcall -import OpenMutexW(long long wstr)
# @ stub OpenPrivateNamespaceA # @ stub OpenPrivateNamespaceA
# @ stub OpenPrivateNamespaceW # @ stub OpenPrivateNamespaceW
@ stdcall OpenProcess(long long long) @ stdcall -import OpenProcess(long long long)
# @ stub OpenProcessToken # @ stub OpenProcessToken
@ stdcall OpenProfileUserMapping() @ stdcall OpenProfileUserMapping()
@ stdcall OpenSemaphoreA(long long str) @ stdcall OpenSemaphoreA(long long str)
...@@ -1388,7 +1388,7 @@ ...@@ -1388,7 +1388,7 @@
# @ stub SetEnvironmentStringsW # @ stub SetEnvironmentStringsW
@ stdcall SetEnvironmentVariableA(str str) @ stdcall SetEnvironmentVariableA(str str)
@ stdcall SetEnvironmentVariableW(wstr wstr) @ stdcall SetEnvironmentVariableW(wstr wstr)
@ stdcall SetErrorMode(long) @ stdcall -import SetErrorMode(long)
@ stdcall -import SetEvent(long) @ stdcall -import SetEvent(long)
@ stdcall SetEventWhenCallbackReturns(ptr long) ntdll.TpCallbackSetEventOnCompletion @ stdcall SetEventWhenCallbackReturns(ptr long) ntdll.TpCallbackSetEventOnCompletion
@ stdcall SetFileApisToANSI() @ stdcall SetFileApisToANSI()
...@@ -1424,17 +1424,17 @@ ...@@ -1424,17 +1424,17 @@
@ stub SetMessageWaitingIndicator @ stub SetMessageWaitingIndicator
# @ stub SetNamedPipeAttribute # @ stub SetNamedPipeAttribute
@ stdcall -import SetNamedPipeHandleState(long ptr ptr ptr) @ stdcall -import SetNamedPipeHandleState(long ptr ptr ptr)
@ stdcall SetPriorityClass(long long) @ stdcall -import SetPriorityClass(long long)
@ stdcall SetProcessAffinityMask(long long) @ stdcall SetProcessAffinityMask(long long)
@ stdcall SetProcessAffinityUpdateMode(long long) @ stdcall -import SetProcessAffinityUpdateMode(long long)
@ stdcall SetProcessDEPPolicy(long) @ stdcall SetProcessDEPPolicy(long)
@ stdcall SetProcessMitigationPolicy(long ptr long) @ stdcall -import SetProcessMitigationPolicy(long ptr long)
@ stdcall SetProcessPreferredUILanguages(long ptr ptr) @ stdcall SetProcessPreferredUILanguages(long ptr ptr)
@ stdcall SetProcessPriorityBoost(long long) @ stdcall -import SetProcessPriorityBoost(long long)
@ stdcall SetProcessShutdownParameters(long long) @ stdcall -import SetProcessShutdownParameters(long long)
# @ stub SetProcessUserModeExceptionPolicy # @ stub SetProcessUserModeExceptionPolicy
@ stdcall SetProcessWorkingSetSize(long long long) @ stdcall SetProcessWorkingSetSize(long long long)
@ stdcall SetProcessWorkingSetSizeEx(long long long long) @ stdcall -import SetProcessWorkingSetSizeEx(long long long long)
@ stdcall SetSearchPathMode(long) @ stdcall SetSearchPathMode(long)
@ stdcall SetStdHandle(long long) @ stdcall SetStdHandle(long long)
# @ stub SetStdHandleEx # @ stub SetStdHandleEx
...@@ -1496,7 +1496,7 @@ ...@@ -1496,7 +1496,7 @@
@ stdcall SystemTimeToTzSpecificLocalTime (ptr ptr ptr) @ stdcall SystemTimeToTzSpecificLocalTime (ptr ptr ptr)
# @ stub SystemTimeToTzSpecificLocalTimeEx # @ stub SystemTimeToTzSpecificLocalTimeEx
@ stdcall TerminateJobObject(long long) @ stdcall TerminateJobObject(long long)
@ stdcall TerminateProcess(long long) @ stdcall -import TerminateProcess(long long)
@ stdcall -import TerminateThread(long long) @ stdcall -import TerminateThread(long long)
@ stdcall TermsrvAppInstallMode() @ stdcall TermsrvAppInstallMode()
@ stdcall Thread32First(long ptr) @ stdcall Thread32First(long ptr)
......
...@@ -84,8 +84,6 @@ typedef struct ...@@ -84,8 +84,6 @@ typedef struct
DWORD dwReserved; DWORD dwReserved;
} LOADPARMS32; } LOADPARMS32;
static DWORD shutdown_flags = 0;
static DWORD shutdown_priority = 0x280;
static BOOL is_wow64; static BOOL is_wow64;
static const BOOL is_win64 = (sizeof(void *) > sizeof(int)); static const BOOL is_win64 = (sizeof(void *) > sizeof(int));
...@@ -118,8 +116,6 @@ static const char * const cpu_names[] = { "x86", "x86_64", "PowerPC", "ARM", "AR ...@@ -118,8 +116,6 @@ static const char * const cpu_names[] = { "x86", "x86_64", "PowerPC", "ARM", "AR
static void exec_process( LPCWSTR name ); static void exec_process( LPCWSTR name );
extern void SHELL_LoadRegistry(void);
/* return values for get_binary_info */ /* return values for get_binary_info */
enum binary_type enum binary_type
{ {
...@@ -3115,34 +3111,6 @@ DWORD WINAPI LoadModule( LPCSTR name, LPVOID paramBlock ) ...@@ -3115,34 +3111,6 @@ DWORD WINAPI LoadModule( LPCSTR name, LPVOID paramBlock )
} }
/******************************************************************************
* TerminateProcess (KERNEL32.@)
*
* Terminates a process.
*
* PARAMS
* handle [I] Process to terminate.
* exit_code [I] Exit code.
*
* RETURNS
* Success: TRUE.
* Failure: FALSE, check GetLastError().
*/
BOOL WINAPI TerminateProcess( HANDLE handle, DWORD exit_code )
{
NTSTATUS status;
if (!handle)
{
SetLastError( ERROR_INVALID_HANDLE );
return FALSE;
}
status = NtTerminateProcess( handle, exit_code );
if (status) SetLastError( RtlNtStatusToDosError(status) );
return !status;
}
/*********************************************************************** /***********************************************************************
* ExitProcess (KERNEL32.@) * ExitProcess (KERNEL32.@)
* *
...@@ -3204,32 +3172,6 @@ BOOL WINAPI GetExitCodeProcess( HANDLE hProcess, LPDWORD lpExitCode ) ...@@ -3204,32 +3172,6 @@ BOOL WINAPI GetExitCodeProcess( HANDLE hProcess, LPDWORD lpExitCode )
/*********************************************************************** /***********************************************************************
* SetErrorMode (KERNEL32.@)
*/
UINT WINAPI SetErrorMode( UINT mode )
{
UINT old;
NtQueryInformationProcess( GetCurrentProcess(), ProcessDefaultHardErrorMode,
&old, sizeof(old), NULL );
NtSetInformationProcess( GetCurrentProcess(), ProcessDefaultHardErrorMode,
&mode, sizeof(mode) );
return old;
}
/***********************************************************************
* GetErrorMode (KERNEL32.@)
*/
UINT WINAPI GetErrorMode( void )
{
UINT mode;
NtQueryInformationProcess( GetCurrentProcess(), ProcessDefaultHardErrorMode,
&mode, sizeof(mode), NULL );
return mode;
}
/***********************************************************************
* GetProcessFlags (KERNEL32.@) * GetProcessFlags (KERNEL32.@)
*/ */
DWORD WINAPI GetProcessFlags( DWORD processid ) DWORD WINAPI GetProcessFlags( DWORD processid )
...@@ -3251,79 +3193,6 @@ DWORD WINAPI GetProcessFlags( DWORD processid ) ...@@ -3251,79 +3193,6 @@ DWORD WINAPI GetProcessFlags( DWORD processid )
/********************************************************************* /*********************************************************************
* OpenProcess (KERNEL32.@)
*
* Opens a handle to a process.
*
* PARAMS
* access [I] Desired access rights assigned to the returned handle.
* inherit [I] Determines whether or not child processes will inherit the handle.
* id [I] Process identifier of the process to get a handle to.
*
* RETURNS
* Success: Valid handle to the specified process.
* Failure: NULL, check GetLastError().
*/
HANDLE WINAPI OpenProcess( DWORD access, BOOL inherit, DWORD id )
{
NTSTATUS status;
HANDLE handle;
OBJECT_ATTRIBUTES attr;
CLIENT_ID cid;
cid.UniqueProcess = ULongToHandle(id);
cid.UniqueThread = 0; /* FIXME ? */
attr.Length = sizeof(OBJECT_ATTRIBUTES);
attr.RootDirectory = NULL;
attr.Attributes = inherit ? OBJ_INHERIT : 0;
attr.SecurityDescriptor = NULL;
attr.SecurityQualityOfService = NULL;
attr.ObjectName = NULL;
if (GetVersion() & 0x80000000) access = PROCESS_ALL_ACCESS;
status = NtOpenProcess(&handle, access, &attr, &cid);
if (status != STATUS_SUCCESS)
{
SetLastError( RtlNtStatusToDosError(status) );
return NULL;
}
return handle;
}
/*********************************************************************
* GetProcessId (KERNEL32.@)
*
* Gets the a unique identifier of a process.
*
* PARAMS
* hProcess [I] Handle to the process.
*
* RETURNS
* Success: TRUE.
* Failure: FALSE, check GetLastError().
*
* NOTES
*
* The identifier is unique only on the machine and only until the process
* exits (including system shutdown).
*/
DWORD WINAPI GetProcessId( HANDLE hProcess )
{
NTSTATUS status;
PROCESS_BASIC_INFORMATION pbi;
status = NtQueryInformationProcess(hProcess, ProcessBasicInformation, &pbi,
sizeof(pbi), NULL);
if (status == STATUS_SUCCESS) return pbi.UniqueProcessId;
SetLastError( RtlNtStatusToDosError(status) );
return 0;
}
/*********************************************************************
* CloseHandle (KERNEL32.@) * CloseHandle (KERNEL32.@)
* *
* Closes a handle. * Closes a handle.
...@@ -3481,75 +3350,6 @@ HANDLE WINAPI CreateSocketHandle(void) ...@@ -3481,75 +3350,6 @@ HANDLE WINAPI CreateSocketHandle(void)
/*********************************************************************** /***********************************************************************
* SetPriorityClass (KERNEL32.@)
*/
BOOL WINAPI SetPriorityClass( HANDLE hprocess, DWORD priorityclass )
{
NTSTATUS status;
PROCESS_PRIORITY_CLASS ppc;
ppc.Foreground = FALSE;
switch (priorityclass)
{
case IDLE_PRIORITY_CLASS:
ppc.PriorityClass = PROCESS_PRIOCLASS_IDLE; break;
case BELOW_NORMAL_PRIORITY_CLASS:
ppc.PriorityClass = PROCESS_PRIOCLASS_BELOW_NORMAL; break;
case NORMAL_PRIORITY_CLASS:
ppc.PriorityClass = PROCESS_PRIOCLASS_NORMAL; break;
case ABOVE_NORMAL_PRIORITY_CLASS:
ppc.PriorityClass = PROCESS_PRIOCLASS_ABOVE_NORMAL; break;
case HIGH_PRIORITY_CLASS:
ppc.PriorityClass = PROCESS_PRIOCLASS_HIGH; break;
case REALTIME_PRIORITY_CLASS:
ppc.PriorityClass = PROCESS_PRIOCLASS_REALTIME; break;
default:
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
status = NtSetInformationProcess(hprocess, ProcessPriorityClass,
&ppc, sizeof(ppc));
if (status != STATUS_SUCCESS)
{
SetLastError( RtlNtStatusToDosError(status) );
return FALSE;
}
return TRUE;
}
/***********************************************************************
* GetPriorityClass (KERNEL32.@)
*/
DWORD WINAPI GetPriorityClass(HANDLE hProcess)
{
NTSTATUS status;
PROCESS_BASIC_INFORMATION pbi;
status = NtQueryInformationProcess(hProcess, ProcessBasicInformation, &pbi,
sizeof(pbi), NULL);
if (status != STATUS_SUCCESS)
{
SetLastError( RtlNtStatusToDosError(status) );
return 0;
}
switch (pbi.BasePriority)
{
case PROCESS_PRIOCLASS_IDLE: return IDLE_PRIORITY_CLASS;
case PROCESS_PRIOCLASS_BELOW_NORMAL: return BELOW_NORMAL_PRIORITY_CLASS;
case PROCESS_PRIOCLASS_NORMAL: return NORMAL_PRIORITY_CLASS;
case PROCESS_PRIOCLASS_ABOVE_NORMAL: return ABOVE_NORMAL_PRIORITY_CLASS;
case PROCESS_PRIOCLASS_HIGH: return HIGH_PRIORITY_CLASS;
case PROCESS_PRIOCLASS_REALTIME: return REALTIME_PRIORITY_CLASS;
}
SetLastError( ERROR_INVALID_PARAMETER );
return 0;
}
/***********************************************************************
* SetProcessAffinityMask (KERNEL32.@) * SetProcessAffinityMask (KERNEL32.@)
*/ */
BOOL WINAPI SetProcessAffinityMask( HANDLE hProcess, DWORD_PTR affmask ) BOOL WINAPI SetProcessAffinityMask( HANDLE hProcess, DWORD_PTR affmask )
...@@ -3594,17 +3394,6 @@ BOOL WINAPI GetProcessAffinityMask( HANDLE hProcess, PDWORD_PTR process_mask, PD ...@@ -3594,17 +3394,6 @@ BOOL WINAPI GetProcessAffinityMask( HANDLE hProcess, PDWORD_PTR process_mask, PD
/*********************************************************************** /***********************************************************************
* SetProcessAffinityUpdateMode (KERNEL32.@)
*/
BOOL WINAPI SetProcessAffinityUpdateMode( HANDLE process, DWORD flags )
{
FIXME("(%p,0x%08x): stub\n", process, flags);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
/***********************************************************************
* GetProcessVersion (KERNEL32.@) * GetProcessVersion (KERNEL32.@)
*/ */
DWORD WINAPI GetProcessVersion( DWORD pid ) DWORD WINAPI GetProcessVersion( DWORD pid )
...@@ -3660,30 +3449,6 @@ err: ...@@ -3660,30 +3449,6 @@ err:
/*********************************************************************** /***********************************************************************
* SetProcessWorkingSetSizeEx [KERNEL32.@]
* Sets the min/max working set sizes for a specified process.
*
* PARAMS
* process [I] Handle to the process of interest
* minset [I] Specifies minimum working set size
* maxset [I] Specifies maximum working set size
* flags [I] Flags to enforce working set sizes
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*/
BOOL WINAPI SetProcessWorkingSetSizeEx(HANDLE process, SIZE_T minset, SIZE_T maxset, DWORD flags)
{
WARN("(%p,%ld,%ld,%x): stub - harmless\n", process, minset, maxset, flags);
if(( minset == (SIZE_T)-1) && (maxset == (SIZE_T)-1)) {
/* Trim the working set to zero */
/* Swap the process out of physical RAM */
}
return TRUE;
}
/***********************************************************************
* SetProcessWorkingSetSize [KERNEL32.@] * SetProcessWorkingSetSize [KERNEL32.@]
* Sets the min/max working set sizes for a specified process. * Sets the min/max working set sizes for a specified process.
* *
...@@ -3711,22 +3476,6 @@ BOOL WINAPI K32EmptyWorkingSet(HANDLE hProcess) ...@@ -3711,22 +3476,6 @@ BOOL WINAPI K32EmptyWorkingSet(HANDLE hProcess)
/*********************************************************************** /***********************************************************************
* GetProcessWorkingSetSizeEx (KERNEL32.@)
*/
BOOL WINAPI GetProcessWorkingSetSizeEx(HANDLE process, SIZE_T *minset,
SIZE_T *maxset, DWORD *flags)
{
FIXME("(%p,%p,%p,%p): stub\n", process, minset, maxset, flags);
/* 32 MB working set size */
if (minset) *minset = 32*1024*1024;
if (maxset) *maxset = 32*1024*1024;
if (flags) *flags = QUOTA_LIMITS_HARDWS_MIN_DISABLE |
QUOTA_LIMITS_HARDWS_MAX_DISABLE;
return TRUE;
}
/***********************************************************************
* GetProcessWorkingSetSize (KERNEL32.@) * GetProcessWorkingSetSize (KERNEL32.@)
*/ */
BOOL WINAPI GetProcessWorkingSetSize(HANDLE process, SIZE_T *minset, SIZE_T *maxset) BOOL WINAPI GetProcessWorkingSetSize(HANDLE process, SIZE_T *minset, SIZE_T *maxset)
...@@ -3736,54 +3485,6 @@ BOOL WINAPI GetProcessWorkingSetSize(HANDLE process, SIZE_T *minset, SIZE_T *max ...@@ -3736,54 +3485,6 @@ BOOL WINAPI GetProcessWorkingSetSize(HANDLE process, SIZE_T *minset, SIZE_T *max
/*********************************************************************** /***********************************************************************
* SetProcessShutdownParameters (KERNEL32.@)
*/
BOOL WINAPI SetProcessShutdownParameters(DWORD level, DWORD flags)
{
FIXME("(%08x, %08x): partial stub.\n", level, flags);
shutdown_flags = flags;
shutdown_priority = level;
return TRUE;
}
/***********************************************************************
* GetProcessShutdownParameters (KERNEL32.@)
*
*/
BOOL WINAPI GetProcessShutdownParameters( LPDWORD lpdwLevel, LPDWORD lpdwFlags )
{
*lpdwLevel = shutdown_priority;
*lpdwFlags = shutdown_flags;
return TRUE;
}
/***********************************************************************
* GetProcessPriorityBoost (KERNEL32.@)
*/
BOOL WINAPI GetProcessPriorityBoost(HANDLE hprocess,PBOOL pDisablePriorityBoost)
{
FIXME("(%p,%p): semi-stub\n", hprocess, pDisablePriorityBoost);
/* Report that no boost is present.. */
*pDisablePriorityBoost = FALSE;
return TRUE;
}
/***********************************************************************
* SetProcessPriorityBoost (KERNEL32.@)
*/
BOOL WINAPI SetProcessPriorityBoost(HANDLE hprocess,BOOL disableboost)
{
FIXME("(%p,%d): stub\n",hprocess,disableboost);
/* Say we can do it. I doubt the program will notice that we don't. */
return TRUE;
}
/***********************************************************************
* ReadProcessMemory (KERNEL32.@) * ReadProcessMemory (KERNEL32.@)
*/ */
BOOL WINAPI ReadProcessMemory( HANDLE process, LPCVOID addr, LPVOID buffer, SIZE_T size, BOOL WINAPI ReadProcessMemory( HANDLE process, LPCVOID addr, LPVOID buffer, SIZE_T size,
...@@ -3807,18 +3508,6 @@ BOOL WINAPI WriteProcessMemory( HANDLE process, LPVOID addr, LPCVOID buffer, SIZ ...@@ -3807,18 +3508,6 @@ BOOL WINAPI WriteProcessMemory( HANDLE process, LPVOID addr, LPCVOID buffer, SIZ
} }
/****************************************************************************
* FlushInstructionCache (KERNEL32.@)
*/
BOOL WINAPI FlushInstructionCache(HANDLE hProcess, LPCVOID lpBaseAddress, SIZE_T dwSize)
{
NTSTATUS status;
status = NtFlushInstructionCache( hProcess, lpBaseAddress, dwSize );
if (status) SetLastError( RtlNtStatusToDosError(status) );
return !status;
}
/****************************************************************** /******************************************************************
* GetProcessIoCounters (KERNEL32.@) * GetProcessIoCounters (KERNEL32.@)
*/ */
...@@ -3833,19 +3522,6 @@ BOOL WINAPI GetProcessIoCounters(HANDLE hProcess, PIO_COUNTERS ioc) ...@@ -3833,19 +3522,6 @@ BOOL WINAPI GetProcessIoCounters(HANDLE hProcess, PIO_COUNTERS ioc)
} }
/****************************************************************** /******************************************************************
* GetProcessHandleCount (KERNEL32.@)
*/
BOOL WINAPI GetProcessHandleCount(HANDLE hProcess, DWORD *cnt)
{
NTSTATUS status;
status = NtQueryInformationProcess(hProcess, ProcessHandleCount,
cnt, sizeof(*cnt), NULL);
if (status) SetLastError( RtlNtStatusToDosError(status) );
return !status;
}
/******************************************************************
* QueryFullProcessImageNameA (KERNEL32.@) * QueryFullProcessImageNameA (KERNEL32.@)
*/ */
BOOL WINAPI QueryFullProcessImageNameA(HANDLE hProcess, DWORD dwFlags, LPSTR lpExeName, PDWORD pdwSize) BOOL WINAPI QueryFullProcessImageNameA(HANDLE hProcess, DWORD dwFlags, LPSTR lpExeName, PDWORD pdwSize)
...@@ -4114,26 +3790,6 @@ DWORD WINAPI RegisterServiceProcess(DWORD dwProcessId, DWORD dwType) ...@@ -4114,26 +3790,6 @@ DWORD WINAPI RegisterServiceProcess(DWORD dwProcessId, DWORD dwType)
} }
/**********************************************************************
* IsWow64Process (KERNEL32.@)
*/
BOOL WINAPI IsWow64Process(HANDLE hProcess, PBOOL Wow64Process)
{
ULONG_PTR pbi;
NTSTATUS status;
status = NtQueryInformationProcess( hProcess, ProcessWow64Information, &pbi, sizeof(pbi), NULL );
if (status != STATUS_SUCCESS)
{
SetLastError( RtlNtStatusToDosError( status ) );
return FALSE;
}
*Wow64Process = (pbi != 0);
return TRUE;
}
/*********************************************************************** /***********************************************************************
* GetCurrentProcess (KERNEL32.@) * GetCurrentProcess (KERNEL32.@)
* *
...@@ -4735,23 +4391,3 @@ BOOL WINAPI BaseFlushAppcompatCache(void) ...@@ -4735,23 +4391,3 @@ BOOL WINAPI BaseFlushAppcompatCache(void)
SetLastError(ERROR_CALL_NOT_IMPLEMENTED); SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE; return FALSE;
} }
/**********************************************************************
* SetProcessMitigationPolicy (KERNEL32.@)
*/
BOOL WINAPI SetProcessMitigationPolicy(PROCESS_MITIGATION_POLICY policy, void *buffer, SIZE_T length)
{
FIXME("(%d, %p, %lu): stub\n", policy, buffer, length);
return TRUE;
}
/**********************************************************************
* GetProcessMitigationPolicy (KERNEL32.@)
*/
BOOL WINAPI GetProcessMitigationPolicy(HANDLE hProcess, PROCESS_MITIGATION_POLICY policy, void *buffer, SIZE_T length)
{
FIXME("(%p, %u, %p, %lu): stub\n", hProcess, policy, buffer, length);
return TRUE;
}
...@@ -160,11 +160,3 @@ DWORD WINAPI KERNEL32_GetCurrentThreadId(void) ...@@ -160,11 +160,3 @@ DWORD WINAPI KERNEL32_GetCurrentThreadId(void)
{ {
return HandleToULong(NtCurrentTeb()->ClientId.UniqueThread); return HandleToULong(NtCurrentTeb()->ClientId.UniqueThread);
} }
/***********************************************************************
* GetProcessHeap (KERNEL32.@)
*/
HANDLE WINAPI KERNEL32_GetProcessHeap(void)
{
return NtCurrentTeb()->Peb->ProcessHeap;
}
...@@ -7,6 +7,7 @@ C_SRCS = \ ...@@ -7,6 +7,7 @@ C_SRCS = \
loader.c \ loader.c \
main.c \ main.c \
path.c \ path.c \
process.c \
registry.c \ registry.c \
security.c \ security.c \
string.c \ string.c \
......
...@@ -381,7 +381,7 @@ ...@@ -381,7 +381,7 @@
@ stdcall FlsSetValue(long ptr) @ stdcall FlsSetValue(long ptr)
@ stdcall FlushConsoleInputBuffer(long) kernel32.FlushConsoleInputBuffer @ stdcall FlushConsoleInputBuffer(long) kernel32.FlushConsoleInputBuffer
@ stdcall FlushFileBuffers(long) kernel32.FlushFileBuffers @ stdcall FlushFileBuffers(long) kernel32.FlushFileBuffers
@ stdcall FlushInstructionCache(long long long) kernel32.FlushInstructionCache @ stdcall FlushInstructionCache(long long long)
@ stdcall FlushProcessWriteBuffers() kernel32.FlushProcessWriteBuffers @ stdcall FlushProcessWriteBuffers() kernel32.FlushProcessWriteBuffers
@ stdcall FlushViewOfFile(ptr long) kernel32.FlushViewOfFile @ stdcall FlushViewOfFile(ptr long) kernel32.FlushViewOfFile
@ stdcall FoldStringW(long wstr long ptr long) kernel32.FoldStringW @ stdcall FoldStringW(long wstr long ptr long) kernel32.FoldStringW
...@@ -464,8 +464,8 @@ ...@@ -464,8 +464,8 @@
# @ stub GetCurrentPackagePath # @ stub GetCurrentPackagePath
# @ stub GetCurrentPackageResourcesContext # @ stub GetCurrentPackageResourcesContext
# @ stub GetCurrentPackageSecurityContext # @ stub GetCurrentPackageSecurityContext
@ stdcall -norelay GetCurrentProcess() kernel32.GetCurrentProcess @ stdcall -norelay GetCurrentProcess() kernelbase_GetCurrentProcess
@ stdcall -norelay GetCurrentProcessId() kernel32.GetCurrentProcessId @ stdcall -norelay GetCurrentProcessId() kernelbase_GetCurrentProcessId
@ stdcall GetCurrentProcessorNumber() ntdll.NtGetCurrentProcessorNumber @ stdcall GetCurrentProcessorNumber() ntdll.NtGetCurrentProcessorNumber
@ stdcall GetCurrentProcessorNumberEx(ptr) ntdll.RtlGetCurrentProcessorNumberEx @ stdcall GetCurrentProcessorNumberEx(ptr) ntdll.RtlGetCurrentProcessorNumberEx
# @ stub GetCurrentTargetPlatformContext # @ stub GetCurrentTargetPlatformContext
...@@ -498,8 +498,8 @@ ...@@ -498,8 +498,8 @@
@ stdcall GetEnvironmentVariableA(str ptr long) kernel32.GetEnvironmentVariableA @ stdcall GetEnvironmentVariableA(str ptr long) kernel32.GetEnvironmentVariableA
@ stdcall GetEnvironmentVariableW(wstr ptr long) kernel32.GetEnvironmentVariableW @ stdcall GetEnvironmentVariableW(wstr ptr long) kernel32.GetEnvironmentVariableW
@ stub GetEraNameCountedString @ stub GetEraNameCountedString
@ stdcall GetErrorMode() kernel32.GetErrorMode @ stdcall GetErrorMode()
@ stdcall GetExitCodeProcess(long ptr) kernel32.GetExitCodeProcess @ stdcall GetExitCodeProcess(long ptr)
@ stdcall GetExitCodeThread(long ptr) @ stdcall GetExitCodeThread(long ptr)
@ stub GetFallbackDisplayName @ stub GetFallbackDisplayName
@ stdcall GetFileAttributesA(str) kernel32.GetFileAttributesA @ stdcall GetFileAttributesA(str) kernel32.GetFileAttributesA
...@@ -617,28 +617,28 @@ ...@@ -617,28 +617,28 @@
# @ stub GetPerformanceInfo # @ stub GetPerformanceInfo
@ stdcall GetPhysicallyInstalledSystemMemory(ptr) kernel32.GetPhysicallyInstalledSystemMemory @ stdcall GetPhysicallyInstalledSystemMemory(ptr) kernel32.GetPhysicallyInstalledSystemMemory
# @ stub GetPreviousFgPolicyRefreshInfoInternal # @ stub GetPreviousFgPolicyRefreshInfoInternal
@ stdcall GetPriorityClass(long) kernel32.GetPriorityClass @ stdcall GetPriorityClass(long)
@ stdcall GetPrivateObjectSecurity(ptr long ptr long ptr) @ stdcall GetPrivateObjectSecurity(ptr long ptr long ptr)
@ stdcall GetProcAddress(long str) kernel32.GetProcAddress @ stdcall GetProcAddress(long str) kernel32.GetProcAddress
# @ stub GetProcAddressForCaller # @ stub GetProcAddressForCaller
# @ stub GetProcessDefaultCpuSets # @ stub GetProcessDefaultCpuSets
# @ stub GetProcessGroupAffinity # @ stub GetProcessGroupAffinity
@ stdcall GetProcessHandleCount(long ptr) kernel32.GetProcessHandleCount @ stdcall GetProcessHandleCount(long ptr)
@ stdcall -norelay GetProcessHeap() kernel32.GetProcessHeap @ stdcall -norelay GetProcessHeap() kernelbase_GetProcessHeap
@ stdcall GetProcessHeaps(long ptr) kernel32.GetProcessHeaps @ stdcall -import GetProcessHeaps(long ptr) RtlGetProcessHeaps
@ stdcall GetProcessId(long) kernel32.GetProcessId @ stdcall GetProcessId(long)
@ stdcall GetProcessIdOfThread(long) @ stdcall GetProcessIdOfThread(long)
# @ stub GetProcessImageFileNameA # @ stub GetProcessImageFileNameA
# @ stub GetProcessImageFileNameW # @ stub GetProcessImageFileNameW
# @ stub GetProcessInformation # @ stub GetProcessInformation
# @ stub GetProcessMemoryInfo # @ stub GetProcessMemoryInfo
@ stdcall GetProcessMitigationPolicy(long long ptr long) kernel32.GetProcessMitigationPolicy @ stdcall GetProcessMitigationPolicy(long long ptr long)
@ stdcall GetProcessPreferredUILanguages(long ptr ptr ptr) kernel32.GetProcessPreferredUILanguages @ stdcall GetProcessPreferredUILanguages(long ptr ptr ptr) kernel32.GetProcessPreferredUILanguages
@ stdcall GetProcessPriorityBoost(long ptr) kernel32.GetProcessPriorityBoost @ stdcall GetProcessPriorityBoost(long ptr)
@ stdcall GetProcessShutdownParameters(ptr ptr) kernel32.GetProcessShutdownParameters @ stdcall GetProcessShutdownParameters(ptr ptr)
@ stdcall GetProcessTimes(long ptr ptr ptr ptr) kernel32.GetProcessTimes @ stdcall GetProcessTimes(long ptr ptr ptr ptr) kernel32.GetProcessTimes
@ stdcall GetProcessVersion(long) kernel32.GetProcessVersion @ stdcall GetProcessVersion(long) kernel32.GetProcessVersion
@ stdcall GetProcessWorkingSetSizeEx(long ptr ptr ptr) kernel32.GetProcessWorkingSetSizeEx @ stdcall GetProcessWorkingSetSizeEx(long ptr ptr ptr)
# @ stub GetProcessorSystemCycleTime # @ stub GetProcessorSystemCycleTime
@ stdcall GetProductInfo(long long long long ptr) kernel32.GetProductInfo @ stdcall GetProductInfo(long long long long ptr) kernel32.GetProductInfo
@ stub GetPtrCalData @ stub GetPtrCalData
...@@ -884,7 +884,7 @@ ...@@ -884,7 +884,7 @@
@ stdcall IsValidSecurityDescriptor(ptr) @ stdcall IsValidSecurityDescriptor(ptr)
@ stdcall IsValidSid(ptr) @ stdcall IsValidSid(ptr)
@ stdcall IsWellKnownSid(ptr long) @ stdcall IsWellKnownSid(ptr long)
@ stdcall IsWow64Process(ptr ptr) kernel32.IsWow64Process @ stdcall IsWow64Process(ptr ptr)
# @ stub IsWow64Process2 # @ stub IsWow64Process2
@ stdcall K32EmptyWorkingSet(long) kernel32.K32EmptyWorkingSet @ stdcall K32EmptyWorkingSet(long) kernel32.K32EmptyWorkingSet
@ stdcall K32EnumDeviceDrivers(ptr long ptr) kernel32.K32EnumDeviceDrivers @ stdcall K32EnumDeviceDrivers(ptr long ptr) kernel32.K32EnumDeviceDrivers
...@@ -991,7 +991,7 @@ ...@@ -991,7 +991,7 @@
# @ stub OpenPackageInfoByFullName # @ stub OpenPackageInfoByFullName
# @ stub OpenPackageInfoByFullNameForUser # @ stub OpenPackageInfoByFullNameForUser
# @ stub OpenPrivateNamespaceW # @ stub OpenPrivateNamespaceW
@ stdcall OpenProcess(long long long) kernel32.OpenProcess @ stdcall OpenProcess(long long long)
@ stdcall OpenProcessToken(long long ptr) @ stdcall OpenProcessToken(long long ptr)
@ stub OpenRegKey @ stub OpenRegKey
@ stdcall OpenSemaphoreW(long long wstr) @ stdcall OpenSemaphoreW(long long wstr)
...@@ -1426,7 +1426,7 @@ ...@@ -1426,7 +1426,7 @@
@ stub SetEnvironmentStringsW @ stub SetEnvironmentStringsW
@ stdcall SetEnvironmentVariableA(str str) kernel32.SetEnvironmentVariableA @ stdcall SetEnvironmentVariableA(str str) kernel32.SetEnvironmentVariableA
@ stdcall SetEnvironmentVariableW(wstr wstr) kernel32.SetEnvironmentVariableW @ stdcall SetEnvironmentVariableW(wstr wstr) kernel32.SetEnvironmentVariableW
@ stdcall SetErrorMode(long) kernel32.SetErrorMode @ stdcall SetErrorMode(long)
@ stdcall SetEvent(long) @ stdcall SetEvent(long)
@ stdcall SetEventWhenCallbackReturns(ptr long) ntdll.TpCallbackSetEventOnCompletion @ stdcall SetEventWhenCallbackReturns(ptr long) ntdll.TpCallbackSetEventOnCompletion
@ stdcall SetFileApisToANSI() kernel32.SetFileApisToANSI @ stdcall SetFileApisToANSI() kernel32.SetFileApisToANSI
...@@ -1450,19 +1450,19 @@ ...@@ -1450,19 +1450,19 @@
@ stdcall SetLocalTime(ptr) kernel32.SetLocalTime @ stdcall SetLocalTime(ptr) kernel32.SetLocalTime
@ stdcall SetLocaleInfoW(long long wstr) kernel32.SetLocaleInfoW @ stdcall SetLocaleInfoW(long long wstr) kernel32.SetLocaleInfoW
@ stdcall SetNamedPipeHandleState(long ptr ptr ptr) @ stdcall SetNamedPipeHandleState(long ptr ptr ptr)
@ stdcall SetPriorityClass(long long) kernel32.SetPriorityClass @ stdcall SetPriorityClass(long long)
@ stdcall SetPrivateObjectSecurity(long ptr ptr ptr long) @ stdcall SetPrivateObjectSecurity(long ptr ptr ptr long)
@ stub SetPrivateObjectSecurityEx @ stub SetPrivateObjectSecurityEx
@ stdcall SetProcessAffinityUpdateMode(long long) kernel32.SetProcessAffinityUpdateMode @ stdcall SetProcessAffinityUpdateMode(long long)
# @ stub SetProcessDefaultCpuSets # @ stub SetProcessDefaultCpuSets
# @ stub SetProcessGroupAffinity # @ stub SetProcessGroupAffinity
# @ stub SetProcessInformation # @ stub SetProcessInformation
@ stdcall SetProcessMitigationPolicy(long ptr long) kernel32.SetProcessMitigationPolicy @ stdcall SetProcessMitigationPolicy(long ptr long)
@ stdcall SetProcessPreferredUILanguages(long ptr ptr) kernel32.SetProcessPreferredUILanguages @ stdcall SetProcessPreferredUILanguages(long ptr ptr) kernel32.SetProcessPreferredUILanguages
@ stdcall SetProcessPriorityBoost(long long) kernel32.SetProcessPriorityBoost @ stdcall SetProcessPriorityBoost(long long)
@ stdcall SetProcessShutdownParameters(long long) kernel32.SetProcessShutdownParameters @ stdcall SetProcessShutdownParameters(long long)
# @ stub SetProcessValidCallTargets # @ stub SetProcessValidCallTargets
@ stdcall SetProcessWorkingSetSizeEx(long long long long) kernel32.SetProcessWorkingSetSizeEx @ stdcall SetProcessWorkingSetSizeEx(long long long long)
# @ stub SetProtectedPolicy # @ stub SetProtectedPolicy
# @ stub SetRoamingLastObservedChangeTime # @ stub SetRoamingLastObservedChangeTime
@ stub SetSecurityAccessMask @ stub SetSecurityAccessMask
...@@ -1594,7 +1594,7 @@ ...@@ -1594,7 +1594,7 @@
@ stdcall SystemTimeToFileTime(ptr ptr) kernel32.SystemTimeToFileTime @ stdcall SystemTimeToFileTime(ptr ptr) kernel32.SystemTimeToFileTime
@ stdcall SystemTimeToTzSpecificLocalTime(ptr ptr ptr) kernel32.SystemTimeToTzSpecificLocalTime @ stdcall SystemTimeToTzSpecificLocalTime(ptr ptr ptr) kernel32.SystemTimeToTzSpecificLocalTime
@ stub SystemTimeToTzSpecificLocalTimeEx @ stub SystemTimeToTzSpecificLocalTimeEx
@ stdcall TerminateProcess(long long) kernel32.TerminateProcess @ stdcall TerminateProcess(long long)
# @ stub TerminateProcessOnMemoryExhaustion # @ stub TerminateProcessOnMemoryExhaustion
@ stdcall TerminateThread(long long) @ stdcall TerminateThread(long long)
@ stdcall TlsAlloc() @ stdcall TlsAlloc()
......
/*
* Win32 processes
*
* Copyright 1996, 1998 Alexandre Julliard
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#include <string.h>
#include "ntstatus.h"
#define WIN32_NO_STATUS
#define NONAMELESSUNION
#include "windef.h"
#include "winbase.h"
#include "winternl.h"
#include "kernelbase.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(process);
static DWORD shutdown_flags = 0;
static DWORD shutdown_priority = 0x280;
/***********************************************************************
* Processes
***********************************************************************/
/****************************************************************************
* FlushInstructionCache (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH FlushInstructionCache( HANDLE process, LPCVOID addr, SIZE_T size )
{
return set_ntstatus( NtFlushInstructionCache( process, addr, size ));
}
/***********************************************************************
* GetCurrentProcess (kernelbase.@)
*/
HANDLE WINAPI kernelbase_GetCurrentProcess(void)
{
return (HANDLE)~(ULONG_PTR)0;
}
/***********************************************************************
* GetCurrentProcessId (kernelbase.@)
*/
DWORD WINAPI kernelbase_GetCurrentProcessId(void)
{
return HandleToULong( NtCurrentTeb()->ClientId.UniqueProcess );
}
/***********************************************************************
* GetErrorMode (kernelbase.@)
*/
UINT WINAPI DECLSPEC_HOTPATCH GetErrorMode(void)
{
UINT mode;
NtQueryInformationProcess( GetCurrentProcess(), ProcessDefaultHardErrorMode,
&mode, sizeof(mode), NULL );
return mode;
}
/***********************************************************************
* GetExitCodeProcess (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH GetExitCodeProcess( HANDLE process, LPDWORD exit_code )
{
NTSTATUS status;
PROCESS_BASIC_INFORMATION pbi;
status = NtQueryInformationProcess( process, ProcessBasicInformation, &pbi, sizeof(pbi), NULL );
if (status && exit_code) *exit_code = pbi.ExitStatus;
return set_ntstatus( status );
}
/***********************************************************************
* GetPriorityClass (kernelbase.@)
*/
DWORD WINAPI DECLSPEC_HOTPATCH GetPriorityClass( HANDLE process )
{
PROCESS_BASIC_INFORMATION pbi;
if (!set_ntstatus( NtQueryInformationProcess( process, ProcessBasicInformation,
&pbi, sizeof(pbi), NULL )))
return 0;
switch (pbi.BasePriority)
{
case PROCESS_PRIOCLASS_IDLE: return IDLE_PRIORITY_CLASS;
case PROCESS_PRIOCLASS_BELOW_NORMAL: return BELOW_NORMAL_PRIORITY_CLASS;
case PROCESS_PRIOCLASS_NORMAL: return NORMAL_PRIORITY_CLASS;
case PROCESS_PRIOCLASS_ABOVE_NORMAL: return ABOVE_NORMAL_PRIORITY_CLASS;
case PROCESS_PRIOCLASS_HIGH: return HIGH_PRIORITY_CLASS;
case PROCESS_PRIOCLASS_REALTIME: return REALTIME_PRIORITY_CLASS;
default: return 0;
}
}
/******************************************************************
* GetProcessHandleCount (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH GetProcessHandleCount( HANDLE process, DWORD *count )
{
return set_ntstatus( NtQueryInformationProcess( process, ProcessHandleCount,
count, sizeof(*count), NULL ));
}
/***********************************************************************
* GetProcessHeap (kernelbase.@)
*/
HANDLE WINAPI kernelbase_GetProcessHeap(void)
{
return NtCurrentTeb()->Peb->ProcessHeap;
}
/*********************************************************************
* GetProcessId (kernelbase.@)
*/
DWORD WINAPI DECLSPEC_HOTPATCH GetProcessId( HANDLE process )
{
PROCESS_BASIC_INFORMATION pbi;
if (!set_ntstatus( NtQueryInformationProcess( process, ProcessBasicInformation,
&pbi, sizeof(pbi), NULL )))
return 0;
return pbi.UniqueProcessId;
}
/**********************************************************************
* GetProcessMitigationPolicy (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH GetProcessMitigationPolicy( HANDLE process, PROCESS_MITIGATION_POLICY policy,
void *buffer, SIZE_T length )
{
FIXME( "(%p, %u, %p, %lu): stub\n", process, policy, buffer, length );
return TRUE;
}
/***********************************************************************
* GetProcessPriorityBoost (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH GetProcessPriorityBoost( HANDLE process, PBOOL disable )
{
FIXME( "(%p,%p): semi-stub\n", process, disable );
*disable = FALSE; /* report that no boost is present */
return TRUE;
}
/***********************************************************************
* GetProcessShutdownParameters (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH GetProcessShutdownParameters( LPDWORD level, LPDWORD flags )
{
*level = shutdown_priority;
*flags = shutdown_flags;
return TRUE;
}
/***********************************************************************
* GetProcessWorkingSetSizeEx (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH GetProcessWorkingSetSizeEx( HANDLE process, SIZE_T *minset,
SIZE_T *maxset, DWORD *flags)
{
FIXME( "(%p,%p,%p,%p): stub\n", process, minset, maxset, flags );
/* 32 MB working set size */
if (minset) *minset = 32*1024*1024;
if (maxset) *maxset = 32*1024*1024;
if (flags) *flags = QUOTA_LIMITS_HARDWS_MIN_DISABLE | QUOTA_LIMITS_HARDWS_MAX_DISABLE;
return TRUE;
}
/**********************************************************************
* IsWow64Process (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH IsWow64Process( HANDLE process, PBOOL wow64 )
{
ULONG_PTR pbi;
NTSTATUS status;
status = NtQueryInformationProcess( process, ProcessWow64Information, &pbi, sizeof(pbi), NULL );
if (!status) *wow64 = !!pbi;
return set_ntstatus( status );
}
/*********************************************************************
* OpenProcess (kernelbase.@)
*/
HANDLE WINAPI DECLSPEC_HOTPATCH OpenProcess( DWORD access, BOOL inherit, DWORD id )
{
HANDLE handle;
OBJECT_ATTRIBUTES attr;
CLIENT_ID cid;
if (GetVersion() & 0x80000000) access = PROCESS_ALL_ACCESS;
attr.Length = sizeof(OBJECT_ATTRIBUTES);
attr.RootDirectory = 0;
attr.Attributes = inherit ? OBJ_INHERIT : 0;
attr.ObjectName = NULL;
attr.SecurityDescriptor = NULL;
attr.SecurityQualityOfService = NULL;
cid.UniqueProcess = ULongToHandle(id);
cid.UniqueThread = 0;
if (!set_ntstatus( NtOpenProcess( &handle, access, &attr, &cid ))) return NULL;
return handle;
}
/***********************************************************************
* SetErrorMode (kernelbase.@)
*/
UINT WINAPI DECLSPEC_HOTPATCH SetErrorMode( UINT mode )
{
UINT old = GetErrorMode();
NtSetInformationProcess( GetCurrentProcess(), ProcessDefaultHardErrorMode,
&mode, sizeof(mode) );
return old;
}
/***********************************************************************
* SetPriorityClass (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH SetPriorityClass( HANDLE process, DWORD class )
{
PROCESS_PRIORITY_CLASS ppc;
ppc.Foreground = FALSE;
switch (class)
{
case IDLE_PRIORITY_CLASS: ppc.PriorityClass = PROCESS_PRIOCLASS_IDLE; break;
case BELOW_NORMAL_PRIORITY_CLASS: ppc.PriorityClass = PROCESS_PRIOCLASS_BELOW_NORMAL; break;
case NORMAL_PRIORITY_CLASS: ppc.PriorityClass = PROCESS_PRIOCLASS_NORMAL; break;
case ABOVE_NORMAL_PRIORITY_CLASS: ppc.PriorityClass = PROCESS_PRIOCLASS_ABOVE_NORMAL; break;
case HIGH_PRIORITY_CLASS: ppc.PriorityClass = PROCESS_PRIOCLASS_HIGH; break;
case REALTIME_PRIORITY_CLASS: ppc.PriorityClass = PROCESS_PRIOCLASS_REALTIME; break;
default:
SetLastError( ERROR_INVALID_PARAMETER );
return FALSE;
}
return set_ntstatus( NtSetInformationProcess( process, ProcessPriorityClass, &ppc, sizeof(ppc) ));
}
/***********************************************************************
* SetProcessAffinityUpdateMode (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH SetProcessAffinityUpdateMode( HANDLE process, DWORD flags )
{
FIXME( "(%p,0x%08x): stub\n", process, flags );
SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
return FALSE;
}
/**********************************************************************
* SetProcessMitigationPolicy (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH SetProcessMitigationPolicy( PROCESS_MITIGATION_POLICY policy,
void *buffer, SIZE_T length )
{
FIXME( "(%d, %p, %lu): stub\n", policy, buffer, length );
return TRUE;
}
/***********************************************************************
* SetProcessPriorityBoost (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH SetProcessPriorityBoost( HANDLE process, BOOL disable )
{
FIXME( "(%p,%d): stub\n", process, disable );
return TRUE;
}
/***********************************************************************
* SetProcessShutdownParameters (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH SetProcessShutdownParameters( DWORD level, DWORD flags )
{
FIXME( "(%08x, %08x): partial stub.\n", level, flags );
shutdown_flags = flags;
shutdown_priority = level;
return TRUE;
}
/***********************************************************************
* SetProcessWorkingSetSizeEx (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH SetProcessWorkingSetSizeEx( HANDLE process, SIZE_T minset,
SIZE_T maxset, DWORD flags )
{
WARN( "(%p,%ld,%ld,%x): stub - harmless\n", process, minset, maxset, flags );
return TRUE;
}
/******************************************************************************
* TerminateProcess (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH TerminateProcess( HANDLE handle, DWORD exit_code )
{
if (!handle)
{
SetLastError( ERROR_INVALID_HANDLE );
return FALSE;
}
return set_ntstatus( NtTerminateProcess( handle, exit_code ));
}
...@@ -2236,6 +2236,7 @@ WINBASEAPI BOOL WINAPI GetProcessShutdownParameters(LPDWORD,LPDWORD); ...@@ -2236,6 +2236,7 @@ WINBASEAPI BOOL WINAPI GetProcessShutdownParameters(LPDWORD,LPDWORD);
WINBASEAPI BOOL WINAPI GetProcessTimes(HANDLE,LPFILETIME,LPFILETIME,LPFILETIME,LPFILETIME); WINBASEAPI BOOL WINAPI GetProcessTimes(HANDLE,LPFILETIME,LPFILETIME,LPFILETIME,LPFILETIME);
WINBASEAPI DWORD WINAPI GetProcessVersion(DWORD); WINBASEAPI DWORD WINAPI GetProcessVersion(DWORD);
WINBASEAPI BOOL WINAPI GetProcessWorkingSetSize(HANDLE,PSIZE_T,PSIZE_T); WINBASEAPI BOOL WINAPI GetProcessWorkingSetSize(HANDLE,PSIZE_T,PSIZE_T);
WINBASEAPI BOOL WINAPI GetProcessWorkingSetSizeEx(HANDLE,SIZE_T*,SIZE_T*,DWORD*);
WINBASEAPI BOOL WINAPI GetProductInfo(DWORD,DWORD,DWORD,DWORD,PDWORD); WINBASEAPI BOOL WINAPI GetProductInfo(DWORD,DWORD,DWORD,DWORD,PDWORD);
WINBASEAPI UINT WINAPI GetProfileIntA(LPCSTR,LPCSTR,INT); WINBASEAPI UINT WINAPI GetProfileIntA(LPCSTR,LPCSTR,INT);
WINBASEAPI UINT WINAPI GetProfileIntW(LPCWSTR,LPCWSTR,INT); WINBASEAPI UINT WINAPI GetProfileIntW(LPCWSTR,LPCWSTR,INT);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment