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,13 +823,13 @@ 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,
dwCreationFlags, dwCreationFlags,
lpEnvironment, lpEnvironment,
lpCurrentDirectory, lpCurrentDirectory,
lpStartupInfo, lpStartupInfo,
lpProcessInformation); lpProcessInformation);
} }
@ -865,7 +865,7 @@ CreateProcessW(LPCWSTR lpApplicationName,
RuntimeInfo_U.Buffer = RtlAllocateHeap(GetProcessHeap(), 0, RuntimeInfo_U.Length); RuntimeInfo_U.Buffer = RtlAllocateHeap(GetProcessHeap(), 0, RuntimeInfo_U.Length);
memcpy(RuntimeInfo_U.Buffer, lpStartupInfo->lpReserved2, lpStartupInfo->cbReserved2); memcpy(RuntimeInfo_U.Buffer, lpStartupInfo->lpReserved2, lpStartupInfo->cbReserved2);
} }
} }
/* /*
* Create the PPB * Create the PPB
@ -883,14 +883,14 @@ CreateProcessW(LPCWSTR lpApplicationName,
if (lpStartupInfo && lpStartupInfo->lpReserved2) if (lpStartupInfo && lpStartupInfo->lpReserved2)
RtlFreeHeap(GetProcessHeap(), 0, RuntimeInfo_U.Buffer); RtlFreeHeap(GetProcessHeap(), 0, RuntimeInfo_U.Buffer);
/* /*
* Translate some handles for the new process * Translate some handles for the new process
*/ */
if (Ppb->CurrentDirectoryHandle) if (Ppb->CurrentDirectoryHandle)
{ {
Status = NtDuplicateObject (NtCurrentProcess(), Status = NtDuplicateObject (NtCurrentProcess(),
Ppb->CurrentDirectoryHandle, Ppb->CurrentDirectoryHandle,
hProcess, hProcess,
&Ppb->CurrentDirectoryHandle, &Ppb->CurrentDirectoryHandle,

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
@ -25,14 +25,14 @@ WaitForInputIdleType lpfnGlobalRegisterWaitForInputIdle;
LPSTARTUPINFO lpLocalStartupInfo = NULL; LPSTARTUPINFO lpLocalStartupInfo = NULL;
VOID STDCALL VOID STDCALL
RegisterWaitForInputIdle (WaitForInputIdleType lpfnRegisterWaitForInputIdle); RegisterWaitForInputIdle(WaitForInputIdleType lpfnRegisterWaitForInputIdle);
WINBOOL STDCALL
GetProcessId (HANDLE hProcess, LPDWORD lpProcessId);
/* FUNCTIONS ****************************************************************/ /* FUNCTIONS ****************************************************************/
WINBOOL STDCALL
GetProcessId (HANDLE hProcess, LPDWORD lpProcessId);
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,8 +119,24 @@ GetProcessWorkingSetSize(HANDLE hProcess,
LPDWORD lpMinimumWorkingSetSize, LPDWORD lpMinimumWorkingSetSize,
LPDWORD lpMaximumWorkingSetSize) LPDWORD lpMaximumWorkingSetSize)
{ {
SetLastError(ERROR_CALL_NOT_IMPLEMENTED); QUOTA_LIMITS QuotaLimits;
return(FALSE); NTSTATUS Status;
Status = NtQueryInformationProcess(hProcess,
ProcessQuotaLimits,
&QuotaLimits,
sizeof(QUOTA_LIMITS),
NULL);
if (!NT_SUCCESS(Status))
{
SetLastErrorByStatus(Status);
return(FALSE);
}
*lpMinimumWorkingSetSize = (DWORD)QuotaLimits.MinimumWorkingSetSize;
*lpMaximumWorkingSetSize = (DWORD)QuotaLimits.MaximumWorkingSetSize;
return(TRUE);
} }
@ -147,7 +171,7 @@ GetProcessTimes(HANDLE hProcess,
return(FALSE); return(FALSE);
} }
lpCreationTime->dwLowDateTime = Kut.CreateTime.u.LowPart; lpCreationTime->dwLowDateTime = Kut.CreateTime.u.LowPart;
lpCreationTime->dwHighDateTime = Kut.CreateTime.u.HighPart; lpCreationTime->dwHighDateTime = Kut.CreateTime.u.HighPart;
lpExitTime->dwLowDateTime = Kut.ExitTime.u.LowPart; lpExitTime->dwLowDateTime = Kut.ExitTime.u.LowPart;
@ -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));
return TRUE; memcpy(lpProcessId, &ProcessBasic.UniqueProcessId, sizeof(DWORD));
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 *****************************************************************/
@ -62,13 +62,13 @@ CreateThread(LPSECURITY_ATTRIBUTES lpThreadAttributes,
DWORD dwCreationFlags, DWORD dwCreationFlags,
LPDWORD lpThreadId) LPDWORD lpThreadId)
{ {
return(CreateRemoteThread(NtCurrentProcess(), return(CreateRemoteThread(NtCurrentProcess(),
lpThreadAttributes, lpThreadAttributes,
dwStackSize, dwStackSize,
lpStartAddress, lpStartAddress,
lpParameter, lpParameter,
dwCreationFlags, dwCreationFlags,
lpThreadId)); lpThreadId));
} }
@ -258,34 +258,33 @@ GetCurrentThreadId(VOID)
VOID STDCALL VOID STDCALL
ExitThread(DWORD uExitCode) ExitThread(DWORD uExitCode)
{ {
NTSTATUS errCode; BOOLEAN LastThread;
BOOLEAN LastThread; NTSTATUS Status;
NTSTATUS Status;
/* /*
* Terminate process if this is the last thread * Terminate process if this is the last thread
* of the current process * of the current process
*/ */
Status = NtQueryInformationThread(NtCurrentThread(), Status = NtQueryInformationThread(NtCurrentThread(),
ThreadAmILastThread, ThreadAmILastThread,
&LastThread, &LastThread,
sizeof(BOOLEAN), sizeof(BOOLEAN),
NULL); NULL);
if (NT_SUCCESS(Status) && LastThread == TRUE) if (NT_SUCCESS(Status) && LastThread == TRUE)
{ {
ExitProcess (uExitCode); ExitProcess(uExitCode);
} }
/* FIXME: notify csrss of thread termination */ /* FIXME: notify csrss of thread termination */
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(lpExitTime, &KernelUserTimes.ExitTime, sizeof(FILETIME)); memcpy(lpCreationTime, &KernelUserTimes.CreateTime, sizeof(FILETIME));
memcpy(lpKernelTime, &KernelUserTimes.KernelTime, sizeof(FILETIME)); memcpy(lpExitTime, &KernelUserTimes.ExitTime, sizeof(FILETIME));
memcpy(lpUserTime, &KernelUserTimes.UserTime, sizeof(FILETIME)); memcpy(lpKernelTime, &KernelUserTimes.KernelTime, sizeof(FILETIME));
return TRUE; memcpy(lpUserTime, &KernelUserTimes.UserTime, sizeof(FILETIME));
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 */