Fixed some warnings.

Added missing stubs.
Implemented GetThreadPriotityBoost() and SetThreadPriorityBoost().

svn path=/trunk/; revision=4052
This commit is contained in:
Eric Kohl 2003-01-22 02:24:36 +00:00
parent 1eac255e7c
commit 834dbc5fd5
4 changed files with 223 additions and 166 deletions

View file

@ -1,4 +1,4 @@
/* $Id: stubs.c,v 1.43 2003/01/21 20:50:51 robd Exp $ /* $Id: stubs.c,v 1.44 2003/01/22 02:23:48 ekohl Exp $
* *
* KERNEL32.DLL stubs (unimplemented functions) * KERNEL32.DLL stubs (unimplemented functions)
* Remove from this file, if you implement them. * Remove from this file, if you implement them.
@ -25,6 +25,14 @@ BaseAttachCompleteThunk (VOID)
} }
BOOL STDCALL
CancelIo(HANDLE hFile)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
BOOL BOOL
STDCALL STDCALL
CmdBatNotification ( CmdBatNotification (
@ -593,32 +601,6 @@ GetThreadLocale (VOID)
#endif #endif
WINBOOL
STDCALL
GetThreadPriorityBoost (
HANDLE hThread,
DWORD dwSelector,
LPLDT_ENTRY lpSelectorEntry
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
GetThreadSelectorEntry (
HANDLE hThread,
DWORD dwSelector,
LPLDT_ENTRY lpSelectorEntry
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
int int
STDCALL STDCALL
GetTimeFormatW ( GetTimeFormatW (
@ -870,6 +852,47 @@ SetComputerNameW (
} }
#ifndef _OLE2NLS_IN_BUILD_
WINBOOL
STDCALL
SetLocaleInfoA (
LCID Locale,
LCTYPE LCType,
LPCSTR lpLCData
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
SetLocaleInfoW (
LCID Locale,
LCTYPE LCType,
LPCWSTR lpLCData
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
SetThreadLocale (
LCID Locale
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
#endif
WINBOOL WINBOOL
STDCALL STDCALL
SetSystemPowerState ( SetSystemPowerState (
@ -884,16 +907,8 @@ SetSystemPowerState (
WINBOOL WINBOOL
STDCALL STDCALL
SetThreadIdealProcessor(VOID) SetThreadIdealProcessor(HANDLE hThread,
{ DWORD dwIdealProcessor)
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
WINBOOL
STDCALL
SetThreadPriorityBoost(VOID)
{ {
SetLastError(ERROR_CALL_NOT_IMPLEMENTED); SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0; return 0;
@ -945,45 +960,9 @@ VDMOperationStarted (
return 0; return 0;
} }
#ifndef _OLE2NLS_IN_BUILD_ #ifndef _OLE2NLS_IN_BUILD_
WINBOOL
STDCALL
SetLocaleInfoA (
LCID Locale,
LCTYPE LCType,
LPCSTR lpLCData
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
SetLocaleInfoW (
LCID Locale,
LCTYPE LCType,
LPCWSTR lpLCData
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
SetThreadLocale (
LCID Locale
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
DWORD DWORD
STDCALL STDCALL
VerLanguageNameA ( VerLanguageNameA (
@ -1023,6 +1002,7 @@ VirtualBufferExceptionHandler (
return 0; return 0;
} }
BOOL BOOL
STDCALL STDCALL
GetFileAttributesExA( GetFileAttributesExA(
@ -1035,6 +1015,7 @@ GetFileAttributesExA(
return 0; return 0;
} }
BOOL BOOL
STDCALL STDCALL
GetFileAttributesExW( GetFileAttributesExW(
@ -1047,5 +1028,4 @@ GetFileAttributesExW(
return 0; return 0;
} }
/* EOF */ /* EOF */

View file

@ -1,4 +1,4 @@
/* $Id: create.c,v 1.60 2003/01/19 01:13:04 gvg Exp $ /* $Id: create.c,v 1.61 2003/01/22 02:24:10 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries * PROJECT: ReactOS system libraries
@ -823,7 +823,7 @@ CreateProcessW(LPCWSTR lpApplicationName,
DPRINT("Launching VDM...\n"); DPRINT("Launching VDM...\n");
return CreateProcessW(L"ntvdm.exe", return CreateProcessW(L"ntvdm.exe",
lpApplicationName, (LPWSTR)lpApplicationName,
lpProcessAttributes, lpProcessAttributes,
lpThreadAttributes, lpThreadAttributes,
bInheritHandles, bInheritHandles,

View file

@ -1,4 +1,4 @@
/* $Id: proc.c,v 1.50 2003/01/15 21:24:35 chorns Exp $ /* $Id: proc.c,v 1.51 2003/01/22 02:24:10 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries * PROJECT: ReactOS system libraries
@ -27,12 +27,12 @@ LPSTARTUPINFO lpLocalStartupInfo = NULL;
VOID STDCALL VOID STDCALL
RegisterWaitForInputIdle(WaitForInputIdleType lpfnRegisterWaitForInputIdle); RegisterWaitForInputIdle(WaitForInputIdleType lpfnRegisterWaitForInputIdle);
/* FUNCTIONS ****************************************************************/
WINBOOL STDCALL WINBOOL STDCALL
GetProcessId (HANDLE hProcess, LPDWORD lpProcessId); GetProcessId (HANDLE hProcess, LPDWORD lpProcessId);
/* FUNCTIONS ****************************************************************/
WINBOOL STDCALL WINBOOL STDCALL
GetProcessAffinityMask(HANDLE hProcess, GetProcessAffinityMask(HANDLE hProcess,
LPDWORD lpProcessAffinityMask, LPDWORD lpProcessAffinityMask,
@ -54,6 +54,14 @@ GetProcessAffinityMask(HANDLE hProcess,
} }
BOOL STDCALL
SetProcessAffinityMask(HANDLE hProcess,
DWORD dwProcessAffinityMask)
{
return(FALSE);
}
WINBOOL STDCALL WINBOOL STDCALL
GetProcessShutdownParameters(LPDWORD lpdwLevel, GetProcessShutdownParameters(LPDWORD lpdwLevel,
LPDWORD lpdwFlags) LPDWORD lpdwFlags)
@ -111,10 +119,26 @@ GetProcessWorkingSetSize(HANDLE hProcess,
LPDWORD lpMinimumWorkingSetSize, LPDWORD lpMinimumWorkingSetSize,
LPDWORD lpMaximumWorkingSetSize) LPDWORD lpMaximumWorkingSetSize)
{ {
SetLastError(ERROR_CALL_NOT_IMPLEMENTED); QUOTA_LIMITS QuotaLimits;
NTSTATUS Status;
Status = NtQueryInformationProcess(hProcess,
ProcessQuotaLimits,
&QuotaLimits,
sizeof(QUOTA_LIMITS),
NULL);
if (!NT_SUCCESS(Status))
{
SetLastErrorByStatus(Status);
return(FALSE); return(FALSE);
} }
*lpMinimumWorkingSetSize = (DWORD)QuotaLimits.MinimumWorkingSetSize;
*lpMaximumWorkingSetSize = (DWORD)QuotaLimits.MaximumWorkingSetSize;
return(TRUE);
}
WINBOOL STDCALL WINBOOL STDCALL
SetProcessWorkingSetSize(HANDLE hProcess, SetProcessWorkingSetSize(HANDLE hProcess,
@ -213,22 +237,24 @@ WINBOOL STDCALL
GetProcessId(HANDLE hProcess, GetProcessId(HANDLE hProcess,
LPDWORD lpProcessId) LPDWORD lpProcessId)
{ {
NTSTATUS errCode;
PROCESS_BASIC_INFORMATION ProcessBasic; PROCESS_BASIC_INFORMATION ProcessBasic;
ULONG BytesWritten; ULONG BytesWritten;
NTSTATUS Status;
errCode = NtQueryInformationProcess(hProcess, Status = NtQueryInformationProcess(hProcess,
ProcessBasicInformation, ProcessBasicInformation,
&ProcessBasic, &ProcessBasic,
sizeof(PROCESS_BASIC_INFORMATION), sizeof(PROCESS_BASIC_INFORMATION),
&BytesWritten); &BytesWritten);
if (!NT_SUCCESS(errCode)) if (!NT_SUCCESS(Status))
{ {
SetLastErrorByStatus (errCode); SetLastErrorByStatus(Status);
return FALSE; return(FALSE);
} }
memcpy(lpProcessId, &ProcessBasic.UniqueProcessId, sizeof(DWORD)); memcpy(lpProcessId, &ProcessBasic.UniqueProcessId, sizeof(DWORD));
return TRUE;
return(TRUE);
} }
@ -690,12 +716,4 @@ GetProcessVersion (DWORD ProcessId)
return (Version); return (Version);
} }
BOOL STDCALL
SetProcessAffinityMask(HANDLE hProcess, DWORD dwProcessAffinityMask)
{
return FALSE;
}
/* EOF */ /* EOF */

View file

@ -1,4 +1,4 @@
/* $Id: thread.c,v 1.33 2003/01/15 21:24:36 chorns Exp $ /* $Id: thread.c,v 1.34 2003/01/22 02:24:36 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries * PROJECT: ReactOS system libraries
@ -18,7 +18,7 @@
#include <kernel32/kernel32.h> #include <kernel32/kernel32.h>
static VOID ThreadAttachDlls (VOID); //static VOID ThreadAttachDlls (VOID);
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
@ -258,7 +258,6 @@ GetCurrentThreadId(VOID)
VOID STDCALL VOID STDCALL
ExitThread(DWORD uExitCode) ExitThread(DWORD uExitCode)
{ {
NTSTATUS errCode;
BOOLEAN LastThread; BOOLEAN LastThread;
NTSTATUS Status; NTSTATUS Status;
@ -280,11 +279,11 @@ ExitThread(DWORD uExitCode)
LdrShutdownThread(); LdrShutdownThread();
errCode = NtTerminateThread(NtCurrentThread(), Status = NtTerminateThread(NtCurrentThread(),
uExitCode); uExitCode);
if (!NT_SUCCESS(errCode)) if (!NT_SUCCESS(Status))
{ {
SetLastErrorByStatus(errCode); SetLastErrorByStatus(Status);
} }
} }
@ -296,25 +295,27 @@ GetThreadTimes(HANDLE hThread,
LPFILETIME lpKernelTime, LPFILETIME lpKernelTime,
LPFILETIME lpUserTime) LPFILETIME lpUserTime)
{ {
NTSTATUS errCode;
KERNEL_USER_TIMES KernelUserTimes; KERNEL_USER_TIMES KernelUserTimes;
ULONG ReturnLength; ULONG ReturnLength;
NTSTATUS Status;
errCode = NtQueryInformationThread(hThread, Status = NtQueryInformationThread(hThread,
ThreadTimes, ThreadTimes,
&KernelUserTimes, &KernelUserTimes,
sizeof(KERNEL_USER_TIMES), sizeof(KERNEL_USER_TIMES),
&ReturnLength); &ReturnLength);
if (!NT_SUCCESS(errCode)) if (!NT_SUCCESS(Status))
{ {
SetLastErrorByStatus(errCode); SetLastErrorByStatus(Status);
return FALSE; return(FALSE);
} }
memcpy(lpCreationTime, &KernelUserTimes.CreateTime, sizeof(FILETIME)); memcpy(lpCreationTime, &KernelUserTimes.CreateTime, sizeof(FILETIME));
memcpy(lpExitTime, &KernelUserTimes.ExitTime, sizeof(FILETIME)); memcpy(lpExitTime, &KernelUserTimes.ExitTime, sizeof(FILETIME));
memcpy(lpKernelTime, &KernelUserTimes.KernelTime, sizeof(FILETIME)); memcpy(lpKernelTime, &KernelUserTimes.KernelTime, sizeof(FILETIME));
memcpy(lpUserTime, &KernelUserTimes.UserTime, sizeof(FILETIME)); memcpy(lpUserTime, &KernelUserTimes.UserTime, sizeof(FILETIME));
return TRUE;
return(TRUE);
} }
@ -528,4 +529,62 @@ GetThreadPriority(HANDLE hThread)
return(ThreadBasic.BasePriority); return(ThreadBasic.BasePriority);
} }
WINBOOL STDCALL
GetThreadPriorityBoost(IN HANDLE hThread,
OUT PBOOL pDisablePriorityBoost)
{
ULONG PriorityBoost;
ULONG DataWritten;
NTSTATUS Status;
Status = NtQueryInformationThread(hThread,
ThreadPriorityBoost,
&PriorityBoost,
sizeof(ULONG),
&DataWritten);
if (!NT_SUCCESS(Status))
{
SetLastErrorByStatus(Status);
return(FALSE);
}
*pDisablePriorityBoost = !((WINBOOL)PriorityBoost);
return(TRUE);
}
WINBOOL STDCALL
SetThreadPriorityBoost(IN HANDLE hThread,
IN WINBOOL bDisablePriorityBoost)
{
ULONG PriorityBoost;
NTSTATUS Status;
PriorityBoost = (ULONG)!bDisablePriorityBoost;
Status = NtSetInformationThread(hThread,
ThreadPriorityBoost,
&PriorityBoost,
sizeof(ULONG));
if (!NT_SUCCESS(Status))
{
SetLastErrorByStatus(Status);
return(FALSE);
}
return(TRUE);
}
WINBOOL STDCALL
GetThreadSelectorEntry(IN HANDLE hThread,
IN DWORD dwSelector,
OUT LPLDT_ENTRY lpSelectorEntry)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return(FALSE);
}
/* EOF */ /* EOF */