5 added + 13 modified, total 18 files
reactos/include
diff -u -r1.38 -r1.38.8.1
--- base.h 12 Apr 2004 09:50:01 -0000 1.38
+++ base.h 8 Jul 2004 22:58:10 -0000 1.38.8.1
@@ -733,8 +733,8 @@
HighMemoryResourceNotification
} MEMORY_RESOURCE_NOTIFICATION_TYPE;
-typedef VOID (CALLBACK *WAITORTIMERCALLBACKFUNC) (PVOID, BOOLEAN );
-typedef WAITORTIMERCALLBACKFUNC WAITORTIMERCALLBACK;
+typedef VOID (CALLBACK *WAITORTIMERCALLBACK) (PVOID, BOOLEAN );
+
/* End of stuff from ddeml.h in old Cygnus headers */
/* ----------------------------------------------- */
reactos/include
diff -u -r1.55 -r1.55.8.1
--- funcs.h 1 May 2004 16:43:13 -0000 1.55
+++ funcs.h 8 Jul 2004 22:58:10 -0000 1.55.8.1
@@ -1073,29 +1073,6 @@
RtlQueryDepthSList (
PSLIST_HEADER ListHead
);
-NTSTATUS
-STDCALL
-RtlCreateTimer(HANDLE TimerQueue,PHANDLE phNewTimer, WAITORTIMERCALLBACK Callback,PVOID Parameter,DWORD DueTime,DWORD Period,ULONG Flags);
-
-NTSTATUS
-STDCALL
-RtlCreateTimerQueue(PHANDLE TimerQueue);
-
-NTSTATUS
-STDCALL
-RtlDeleteTimer(HANDLE TimerQueue,HANDLE Timer,HANDLE CompletionEvent);
-
-NTSTATUS
-STDCALL
-RtlUpdateTimer(HANDLE TimerQueue,HANDLE Timer,ULONG DueTime,ULONG Period);
-
-NTSTATUS
-STDCALL
-RtlDeleteTimerQueueEx(HANDLE TimerQueue,HANDLE CompletionEvent);
-
-NTSTATUS
-STDCALL
-RtlDeleteTimerQueue(HANDLE TimerQueue);
NTSTATUS
STDCALL
@@ -4627,8 +4604,8 @@
BOOL
STDCALL
RegisterLogonProcess(
- HANDLE hprocess,
- BOOL x
+ DWORD dwPprocessId,
+ BOOL bRegister
);
WINBOOL
reactos/include/ntdll
diff -u -r1.43 -r1.43.12.1
--- rtl.h 3 Feb 2004 14:19:56 -0000 1.43
+++ rtl.h 8 Jul 2004 22:58:10 -0000 1.43.12.1
@@ -1,4 +1,4 @@
-/* $Id: rtl.h,v 1.43 2004/02/03 14:19:56 ekohl Exp $
+/* $Id: rtl.h,v 1.43.12.1 2004/07/08 22:58:10 weiden Exp $
*
*/
@@ -616,6 +616,39 @@
RtlRunEncodeUnicodeString (IN OUT PUCHAR Hash,
IN OUT PUNICODE_STRING String);
+/* Timer Queue functions */
+
+#ifdef __USE_W32API
+#include <winnt.h>
+#else /* __USE_W32API */
+typedef VOID (CALLBACK *WAITORTIMERCALLBACKFUNC) (PVOID, BOOLEAN );
+#endif /* __USE_W32API */
+
+NTSTATUS
+STDCALL
+RtlCreateTimer(HANDLE TimerQueue,PHANDLE phNewTimer, WAITORTIMERCALLBACKFUNC Callback,PVOID Parameter,DWORD DueTime,DWORD Period,ULONG Flags);
+
+NTSTATUS
+STDCALL
+RtlCreateTimerQueue(PHANDLE TimerQueue);
+
+NTSTATUS
+STDCALL
+RtlDeleteTimer(HANDLE TimerQueue,HANDLE Timer,HANDLE CompletionEvent);
+
+NTSTATUS
+STDCALL
+RtlUpdateTimer(HANDLE TimerQueue,HANDLE Timer,ULONG DueTime,ULONG Period);
+
+NTSTATUS
+STDCALL
+RtlDeleteTimerQueueEx(HANDLE TimerQueue,HANDLE CompletionEvent);
+
+NTSTATUS
+STDCALL
+RtlDeleteTimerQueue(HANDLE TimerQueue);
+
+
#ifndef __NTDRIVER__
#ifndef __INTERLOCKED_DECLARED
reactos/lib/kernel32
diff -u -r1.81 -r1.81.2.1
--- makefile 26 Jun 2004 20:11:18 -0000 1.81
+++ makefile 8 Jul 2004 22:58:11 -0000 1.81.2.1
@@ -1,4 +1,4 @@
-# $Id: makefile,v 1.81 2004/06/26 20:11:18 gdalsnes Exp $
+# $Id: makefile,v 1.81.2.1 2004/07/08 22:58:11 weiden Exp $
PATH_TO_TOP = ../..
@@ -30,7 +30,7 @@
MISC_OBJECTS = misc/error.o misc/atom.o misc/handle.o misc/env.o \
misc/dllmain.o misc/comm.o misc/errormsg.o \
- misc/console.o misc/time.o misc/toolhelp.o \
+ misc/console.o misc/time.o misc/timerqueue.o misc/toolhelp.o \
misc/stubs.o misc/lang.o misc/ldr.o misc/res.o \
misc/sysinfo.o misc/profile.o \
misc/mbchars.o misc/muldiv.o misc/computername.o \
reactos/lib/kernel32/misc
diff -N timerqueue.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ timerqueue.c 8 Jul 2004 22:58:11 -0000 1.1.2.1
@@ -0,0 +1,377 @@
+/*
+ * ReactOS kernel
+ * Copyright (C) 2004 ReactOS Team
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+/* $Id: timerqueue.c,v 1.1.2.1 2004/07/08 22:58:11 weiden Exp $
+ *
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS system libraries
+ * PURPOSE: Timer Queue functions
+ * FILE: lib/kernel32/misc/timerqueue.c
+ * PROGRAMER: Thomas Weidenmueller <w3seek@reactos.com>
+ */
+
+/* INCLUDES ******************************************************************/
+
+#include <k32.h>
+
+#define NDEBUG
+#include "../include/debug.h"
+
+
+/* FUNCTIONS *****************************************************************/
+
+HANDLE DefaultTimerQueue = NULL;
+
+/*
+ * Create the default timer queue for the current process. This function is only
+ * called if CreateTimerQueueTimer() or SetTimerQueueTimer() is called.
+ * However, ChangeTimerQueueTimer() fails with ERROR_INVALID_PARAMETER if the
+ * default timer queue has not been created, because it assumes there has to be
+ * a timer queue with a timer if it want's to be changed.
+ */
+static BOOL
+IntCreateDefaultTimerQueue(VOID)
+{
+ NTSTATUS Status;
+
+ /* FIXME - make this thread safe */
+
+ /* create the timer queue */
+ Status = RtlCreateTimerQueue(&DefaultTimerQueue);
+ if(!NT_SUCCESS(Status))
+ {
+ SetLastErrorByStatus(Status);
+ DPRINT1("Unable to create the default timer queue!\n");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/*
+ * @implemented
+ */
+BOOL
+STDCALL
+CancelTimerQueueTimer(HANDLE TimerQueue,
+ HANDLE Timer)
+{
+ /* Since this function is not documented in PSDK and apparently does nothing
+ but delete the timer, we just do the same as DeleteTimerQueueTimer(), without
+ passing a completion event. */
+ NTSTATUS Status;
+
+ if(TimerQueue == NULL)
+ {
+ /* let's use the process' default timer queue. We assume the default timer
+ queue has been created with a previous call to CreateTimerQueueTimer() or
+ SetTimerQueueTimer(), otherwise this call wouldn't make much sense. */
+ if(!(TimerQueue = DefaultTimerQueue))
+ {
+ SetLastError(ERROR_INVALID_HANDLE);
+ return FALSE;
+ }
+ }
+
+ if(Timer == NULL)
+ {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return FALSE;
+ }
+
+ /* delete the timer */
+ Status = RtlDeleteTimer(TimerQueue, Timer, NULL);
+
+ if(!NT_SUCCESS(Status))
+ {
+ SetLastErrorByStatus(Status);
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/*
+ * @implemented
+ */
+BOOL
+STDCALL
+ChangeTimerQueueTimer(HANDLE TimerQueue,
+ HANDLE Timer,
+ ULONG DueTime,
+ ULONG Period)
+{
+ NTSTATUS Status;
+
+ if(TimerQueue == NULL)
+ {
+ /* let's use the process' default timer queue. We assume the default timer
+ queue has been created with a previous call to CreateTimerQueueTimer() or
+ SetTimerQueueTimer(), otherwise this call wouldn't make much sense. */
+ if(!(TimerQueue = DefaultTimerQueue))
+ {
+ SetLastError(ERROR_INVALID_HANDLE);
+ return FALSE;
+ }
+ }
+
+ if(Timer == NULL)
+ {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return FALSE;
+ }
+
+ /* update the timer */
+ Status = RtlUpdateTimer(TimerQueue, Timer, DueTime, Period);
+ if(!NT_SUCCESS(Status))
+ {
+ SetLastErrorByStatus(Status);
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/*
+ * @implemented
+ */
+HANDLE
+STDCALL
+CreateTimerQueue(VOID)
+{
+ HANDLE Handle;
+ NTSTATUS Status;
+
+ /* create the timer queue */
+ Status = RtlCreateTimerQueue(&Handle);
+ if(!NT_SUCCESS(Status))
+ {
+ SetLastErrorByStatus(Status);
+ return NULL;
+ }
+
+ return Handle;
+}
+
+/*
+ * @implemented
+ */
+BOOL
+STDCALL
+CreateTimerQueueTimer(PHANDLE phNewTimer,
+ HANDLE TimerQueue,
+ WAITORTIMERCALLBACK Callback,
+ PVOID Parameter,
+ DWORD DueTime,
+ DWORD Period,
+ ULONG Flags)
+{
+ NTSTATUS Status;
+
+ /* windows seems not to test this parameter at all, so we'll try to clear it here
+ so we don't crash somewhere inside ntdll */
+ *phNewTimer = NULL;
+
+ if(TimerQueue == NULL)
+ {
+ /* the default timer queue is requested, try to create it if it hasn't been already */
+ if(!(TimerQueue = DefaultTimerQueue))
+ {
+ if(!IntCreateDefaultTimerQueue())
+ {
+ /* IntCreateDefaultTimerQueue() set the last error code already, just fail */
+ return FALSE;
+ }
+ TimerQueue = DefaultTimerQueue;
+ }
+ }
+
+ /* !!! Win doesn't even check if Callback == NULL, so we don't, too! That'll
+ raise a nice exception later... */
+
+ /* create the timer */
+ Status = RtlCreateTimer(TimerQueue, phNewTimer, Callback, Parameter, DueTime,
+ Period, Flags);
+ if(!NT_SUCCESS(Status))
+ {
+ SetLastErrorByStatus(Status);
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/*
+ * @implemented
+ */
+BOOL
+STDCALL
+DeleteTimerQueue(HANDLE TimerQueue)
+{
+ NTSTATUS Status;
+
+ /* We don't allow the user to delete the default timer queue */
+ if(TimerQueue == NULL)
+ {
+ SetLastError(ERROR_INVALID_HANDLE);
+ return FALSE;
+ }
+
+ /* delete the timer queue */
+ Status = RtlDeleteTimerQueue(TimerQueue);
+ return NT_SUCCESS(Status);
+}
+
+/*
+ * @implemented
+ */
+BOOL
+STDCALL
+DeleteTimerQueueEx(HANDLE TimerQueue,
+ HANDLE CompletionEvent)
+{
+ NTSTATUS Status;
+
+ /* We don't allow the user to delete the default timer queue */
+ if(TimerQueue == NULL)
+ {
+ SetLastError(ERROR_INVALID_HANDLE);
+ return FALSE;
+ }
+
+ /* delete the queue */
+ Status = RtlDeleteTimerQueueEx(TimerQueue, CompletionEvent);
+
+ if((CompletionEvent != INVALID_HANDLE_VALUE && Status == STATUS_PENDING) ||
+ !NT_SUCCESS(Status))
+ {
+ /* In case CompletionEvent == NULL, RtlDeleteTimerQueueEx() returns before
+ all callback routines returned. We set the last error code to STATUS_PENDING
+ and return FALSE. In case CompletionEvent == INVALID_HANDLE_VALUE we only
+ can get here if another error occured. In case CompletionEvent is something
+ else, we get here and fail, even though it isn't really an error (if Status == STATUS_PENDING).
+ We also handle all other failures the same way. */
+
+ SetLastErrorByStatus(Status);
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/*
+ * @implemented
+ */
+BOOL
+STDCALL
+DeleteTimerQueueTimer(HANDLE TimerQueue,
+ HANDLE Timer,
+ HANDLE CompletionEvent)
+{
+ NTSTATUS Status;
+
+ if(TimerQueue == NULL)
+ {
+ /* let's use the process' default timer queue. We assume the default timer
+ queue has been created with a previous call to CreateTimerQueueTimer() or
+ SetTimerQueueTimer(), otherwise this call wouldn't make much sense. */
+ if(!(TimerQueue = DefaultTimerQueue))
+ {
+ SetLastError(ERROR_INVALID_HANDLE);
+ return FALSE;
+ }
+ }
+
+ if(Timer == NULL)
+ {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return FALSE;
+ }
+
+ /* delete the timer */
+ Status = RtlDeleteTimer(TimerQueue, Timer, CompletionEvent);
+
+ if((CompletionEvent != INVALID_HANDLE_VALUE && Status == STATUS_PENDING) ||
+ !NT_SUCCESS(Status))
+ {
+ /* In case CompletionEvent == NULL, RtlDeleteTimer() returns before
+ the callback routine returned. We set the last error code to STATUS_PENDING
+ and return FALSE. In case CompletionEvent == INVALID_HANDLE_VALUE we only
+ can get here if another error occured. In case CompletionEvent is something
+ else, we get here and fail, even though it isn't really an error (if Status == STATUS_PENDING).
+ We also handle all other failures the same way. */
+
+ SetLastErrorByStatus(Status);
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/*
+ * @implemented
+ */
+HANDLE
+STDCALL
+SetTimerQueueTimer(HANDLE TimerQueue,
+ WAITORTIMERCALLBACK Callback,
+ PVOID Parameter,
+ DWORD DueTime,
+ DWORD Period,
+ BOOL PreferIo)
+{
+ /* Since this function is not documented in PSDK and apparently does nothing
+ but create a timer, we just do the same as CreateTimerQueueTimer(). Unfortunately
+ I don't really know what PreferIo is supposed to be, it propably just affects the
+ Flags parameter of CreateTimerQueueTimer(). Looking at the PSDK documentation of
+ CreateTimerQueueTimer() there's only one flag (WT_EXECUTEINIOTHREAD) that causes
+ the callback function queued to an I/O worker thread. I guess it uses this flag
+ if PreferIo == TRUE, otherwise let's just use WT_EXECUTEDEFAULT. We should
+ test this though, this is only guess work and I'm too lazy to do further
+ investigation. */
+
+ HANDLE Timer;
+ NTSTATUS Status;
+
+ if(TimerQueue == NULL)
+ {
+ /* the default timer queue is requested, try to create it if it hasn't been already */
+ if(!(TimerQueue = DefaultTimerQueue))
+ {
+ if(!IntCreateDefaultTimerQueue())
+ {
+ /* IntCreateDefaultTimerQueue() set the last error code already, just fail */
+ return FALSE;
+ }
+ TimerQueue = DefaultTimerQueue;
+ }
+ }
+
+ /* create the timer */
+ Status = RtlCreateTimer(TimerQueue, &Timer, Callback, Parameter, DueTime,
+ Period, (PreferIo ? WT_EXECUTEINIOTHREAD : WT_EXECUTEDEFAULT));
+ if(!NT_SUCCESS(Status))
+ {
+ SetLastErrorByStatus(Status);
+ return NULL;
+ }
+
+ return Timer;
+}
+
+/* EOF */
reactos/lib/kernel32/misc
diff -u -r1.79 -r1.79.2.1
--- stubs.c 26 Jun 2004 12:56:11 -0000 1.79
+++ stubs.c 8 Jul 2004 22:58:11 -0000 1.79.2.1
@@ -1,4 +1,4 @@
-/* $Id: stubs.c,v 1.79 2004/06/26 12:56:11 navaraf Exp $
+/* $Id: stubs.c,v 1.79.2.1 2004/07/08 22:58:11 weiden Exp $
*
* KERNEL32.DLL stubs (unimplemented functions)
* Remove from this file, if you implement them.
@@ -653,35 +653,6 @@
return 0;
}
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-CancelTimerQueueTimer(
- HANDLE TimerQueue,
- HANDLE Timer
- )
-{
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return 0;
-}
-/*
- * @unimplemented
- */
-
-BOOL
-STDCALL
-ChangeTimerQueueTimer(
- HANDLE TimerQueue,
- HANDLE Timer,
- ULONG DueTime,
- ULONG Period
- )
-{
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return 0;
-}
/*
* @unimplemented
@@ -739,38 +710,6 @@
/*
* @unimplemented
*/
-HANDLE
-STDCALL
-CreateTimerQueue(
- VOID
- )
-{
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return 0;
-}
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-CreateTimerQueueTimer(
- PHANDLE phNewTimer,
- HANDLE TimerQueue,
- WAITORTIMERCALLBACK Callback,
- PVOID Parameter,
- DWORD DueTime,
- DWORD Period,
- ULONG Flags
- )
-{
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return 0;
-}
-
-/*
- * @unimplemented
- */
BOOL
STDCALL
DeactivateActCtx(
@@ -788,48 +727,6 @@
*/
BOOL
STDCALL
-DeleteTimerQueue(
- HANDLE TimerQueue
- )
-{
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return 0;
-}
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-DeleteTimerQueueEx(
- HANDLE TimerQueue,
- HANDLE CompletionEvent
- )
-{
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return 0;
-}
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-DeleteTimerQueueTimer(
- HANDLE TimerQueue,
- HANDLE Timer,
- HANDLE CompletionEvent
- )
-{
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return 0;
-}
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
FindActCtxSectionGuid(
DWORD dwFlags,
const GUID *lpExtensionGuid,
@@ -1461,24 +1358,6 @@
/*
* @unimplemented
*/
-HANDLE
-STDCALL
-SetTimerQueueTimer(
- HANDLE TimerQueue,
- WAITORTIMERCALLBACK Callback,
- PVOID Parameter,
- DWORD DueTime,
- DWORD Period,
- BOOL PreferIo
- )
-{
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return 0;
-}
-
-/*
- * @unimplemented
- */
BOOL
STDCALL
TerminateJobObject(
reactos/lib/ntdll/def
diff -u -r1.123 -r1.123.2.1
--- ntdll.def 3 Jul 2004 17:13:09 -0000 1.123
+++ ntdll.def 8 Jul 2004 22:58:11 -0000 1.123.2.1
@@ -1,4 +1,4 @@
-; $Id: ntdll.def,v 1.123 2004/07/03 17:13:09 hbirr Exp $
+; $Id: ntdll.def,v 1.123.2.1 2004/07/08 22:58:11 weiden Exp $
;
; ReactOS Operating System
;
@@ -354,6 +354,8 @@
RtlCreateRegistryKey@8
RtlCreateSecurityDescriptor@8
;RtlCreateTagHeap
+RtlCreateTimer@28
+RtlCreateTimerQueue@4
RtlCreateUnicodeString@8
RtlCreateUnicodeStringFromAsciiz@8
RtlCreateUserProcess@40
@@ -377,6 +379,9 @@
RtlDeleteRegistryValue@12
RtlDeleteResource@4
;RtlDeleteSecurityObject
+RtlDeleteTimer@12
+RtlDeleteTimerQueue@4
+RtlDeleteTimerQueueEx@8
RtlDestroyAtomTable@4
RtlDestroyEnvironment@4
RtlDestroyHandleTable@4
@@ -623,6 +628,7 @@
RtlUpcaseUnicodeToCustomCPN@24
RtlUpcaseUnicodeToMultiByteN@20
RtlUpcaseUnicodeToOemN@20
+RtlUpdateTimer@16
RtlUpperChar@4
RtlUpperString@8
;RtlUsageHeap
reactos/lib/ntdll/def
diff -u -r1.113 -r1.113.2.1
--- ntdll.edf 3 Jul 2004 17:13:09 -0000 1.113
+++ ntdll.edf 8 Jul 2004 22:58:11 -0000 1.113.2.1
@@ -1,4 +1,4 @@
-; $Id: ntdll.edf,v 1.113 2004/07/03 17:13:09 hbirr Exp $
+; $Id: ntdll.edf,v 1.113.2.1 2004/07/08 22:58:11 weiden Exp $
;
; ReactOS Operating System
;
@@ -354,6 +354,8 @@
RtlCreateRegistryKey=RtlCreateRegistryKey@8
RtlCreateSecurityDescriptor=RtlCreateSecurityDescriptor@8
;RtlCreateTagHeap
+RtlCreateTimer=RtlCreateTimer@28
+RtlCreateTimerQueue=RtlCreateTimerQueue@4
RtlCreateUnicodeString=RtlCreateUnicodeString@8
RtlCreateUnicodeStringFromAsciiz=RtlCreateUnicodeStringFromAsciiz@8
RtlCreateUserProcess=RtlCreateUserProcess@40
@@ -377,6 +379,9 @@
RtlDeleteRegistryValue=RtlDeleteRegistryValue@12
RtlDeleteResource=RtlDeleteResource@4
;RtlDeleteSecurityObject
+RtlDeleteTimer=RtlDeleteTimer@12
+RtlDeleteTimerQueue=RtlDeleteTimerQueue@4
+RtlDeleteTimerQueueEx=RtlDeleteTimerQueueEx@8
RtlDestroyAtomTable=RtlDestroyAtomTable@4
RtlDestroyEnvironment=RtlDestroyEnvironment@4
RtlDestroyHandleTable=RtlDestroyHandleTable@4
@@ -625,6 +630,7 @@
RtlUpcaseUnicodeToCustomCPN=RtlUpcaseUnicodeToCustomCPN@24
RtlUpcaseUnicodeToMultiByteN=RtlUpcaseUnicodeToMultiByteN@20
RtlUpcaseUnicodeToOemN=RtlUpcaseUnicodeToOemN@20
+RtlUpdateTimer=RtlUpdateTimer@16
RtlUpperChar=RtlUpperChar@4
RtlUpperString=RtlUpperString@8
;RtlUsageHeap
reactos/lib/ntdll
diff -u -r1.105 -r1.105.2.1
--- makefile 3 Jul 2004 17:40:23 -0000 1.105
+++ makefile 8 Jul 2004 22:58:11 -0000 1.105.2.1
@@ -1,4 +1,4 @@
-# $Id: makefile,v 1.105 2004/07/03 17:40:23 navaraf Exp $
+# $Id: makefile,v 1.105.2.1 2004/07/08 22:58:11 weiden Exp $
PATH_TO_TOP = ../..
@@ -83,6 +83,7 @@
rtl/resource.o \
rtl/teb.o \
rtl/thread.o \
+ rtl/timerqueue.o \
rtl/libsupp.o
STDIO_OBJECTS = \
reactos/lib/user32/misc
diff -u -r1.5 -r1.5.8.1
--- misc.c 28 May 2004 21:33:41 -0000 1.5
+++ misc.c 8 Jul 2004 22:58:11 -0000 1.5.8.1
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: misc.c,v 1.5 2004/05/28 21:33:41 gvg Exp $
+/* $Id: misc.c,v 1.5.8.1 2004/07/08 22:58:11 weiden Exp $
*
* PROJECT: ReactOS user32.dll
* FILE: lib/user32/misc/misc.c
@@ -59,17 +59,20 @@
VOID
STDCALL
-PrivateCsrssInitialized()
+PrivateCsrssInitialized(VOID)
{
NtUserCallNoParam(NOPARAM_ROUTINE_CSRSS_INITIALIZED);
}
+
/*
* @implemented
*/
BOOL
STDCALL
-RegisterLogonProcess ( HANDLE hprocess, BOOL x )
+RegisterLogonProcess(DWORD dwProcessId, BOOL bRegister)
{
- return NtUserRegisterLogonProcess(hprocess, x);
+ return NtUserCallTwoParam(dwProcessId,
+ (DWORD)bRegister,
+ TWOPARAM_ROUTINE_REGISTERLOGONPROC);
}
reactos/subsys/system/winlogon
diff -u -r1.31 -r1.31.2.1
--- winlogon.c 3 Jul 2004 17:40:24 -0000 1.31
+++ winlogon.c 8 Jul 2004 22:58:11 -0000 1.31.2.1
@@ -1,4 +1,4 @@
-/* $Id: winlogon.c,v 1.31 2004/07/03 17:40:24 navaraf Exp $
+/* $Id: winlogon.c,v 1.31.2.1 2004/07/08 22:58:11 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -565,7 +565,7 @@
}
WLSession->LogonStatus = LOGON_INITIALIZING;
-#if START_LSASS
+
if(!RegisterLogonProcess(GetCurrentProcessId(), TRUE))
{
DbgPrint("WL: Could not register logon process\n");
@@ -573,7 +573,6 @@
ExitProcess(0);
return 0;
}
-#endif
if(!WlxCreateWindowStationAndDesktops(WLSession))
{
reactos/subsys/win32k/include
diff -u -r1.1.2.1 -r1.1.2.2
--- internal.h 7 Jul 2004 18:14:43 -0000 1.1.2.1
+++ internal.h 8 Jul 2004 22:58:12 -0000 1.1.2.2
@@ -1000,6 +1000,7 @@
INT FASTCALL IntGetSystemMetrics(INT nIndex);
BOOL FASTCALL IntSystemParametersInfo(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni);
+BOOL FASTCALL IntRegisterLogonProcess(DWORD dwProcessId, BOOL bRegister);
void W32kRegisterPrimitiveMessageQueue();
#endif /* _NTUSER_H */
reactos/subsys/win32k/ntuser
diff -u -r1.81.2.1 -r1.81.2.2
--- misc.c 7 Jul 2004 18:03:01 -0000 1.81.2.1
+++ misc.c 8 Jul 2004 22:58:12 -0000 1.81.2.2
@@ -1,4 +1,4 @@
-/* $Id: misc.c,v 1.81.2.1 2004/07/07 18:03:01 weiden Exp $
+/* $Id: misc.c,v 1.81.2.2 2004/07/08 22:58:12 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -38,39 +38,44 @@
}
BOOL FASTCALL
-IntRegisterLogonProcess(HANDLE hProcess, BOOL x)
+IntRegisterLogonProcess(DWORD dwProcessId, BOOL bRegister)
{
PEPROCESS Process;
NTSTATUS Status;
-
- if(LogonProcess != NULL && LogonProcess != PsGetWin32Process())
+
+ Status = PsLookupProcessByProcessId((PVOID)dwProcessId,
+ &Process);
+ if (!NT_SUCCESS(Status))
{
- SetLastWin32Error(ERROR_ACCESS_DENIED);
+ SetLastWin32Error(RtlNtStatusToDosError(Status));
return FALSE;
}
-
- if(hProcess)
+
+ if (bRegister)
{
- Status = ObReferenceObjectByHandle(hProcess,
- PROCESS_QUERY_INFORMATION,
- PsProcessType,
- ExGetPreviousMode(),
- (PVOID*)&Process,
- NULL);
- if(!NT_SUCCESS(Status))
+ /* Register the logon process */
+ if (LogonProcess != NULL)
{
- SetLastNtError(Status);
- return 0;
+ ObDereferenceObject(Process);
+ return FALSE;
}
-
+
LogonProcess = Process->Win32Process;
- ObDereferenceObject(Process);
}
else
{
- /* deregister the logon process */
+ /* Deregister the logon process */
+ if (LogonProcess != Process->Win32Process)
+ {
+ ObDereferenceObject(Process);
+ return FALSE;
+ }
+
LogonProcess = NULL;
}
+
+ ObDereferenceObject(Process);
+
return TRUE;
}
reactos/w32api/include
diff -u -r1.7 -r1.7.2.1
--- winuser.h 24 Jun 2004 09:44:06 -0000 1.7
+++ winuser.h 8 Jul 2004 22:58:12 -0000 1.7.2.1
@@ -3704,6 +3704,7 @@
HDEVNOTIFY WINAPI RegisterDeviceNotificationW(HANDLE,LPVOID,DWORD);
#endif
BOOL WINAPI RegisterHotKey(HWND,int,UINT,UINT);
+BOOL WINAPI RegisterLogonProcess(DWORD,BOOL);
#if (_WIN32_WINNT >= 0x0501)
BOOL WINAPI RegisterRawInputDevices(PCRAWINPUTDEVICE,UINT,UINT);
#endif
reactos/apps/tests/thrdheap
diff -N .cvsignore
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ .cvsignore 8 Jul 2004 22:58:12 -0000 1.1.2.1
@@ -0,0 +1,6 @@
+*.o
+*.d
+*.exe
+*.coff
+*.sym
+*.map
reactos/apps/tests/thrdheap
diff -N makefile
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ makefile 8 Jul 2004 22:58:12 -0000 1.1.2.1
@@ -0,0 +1,21 @@
+# $Id: makefile,v 1.1.2.1 2004/07/08 22:58:12 weiden Exp $
+
+PATH_TO_TOP = ../../..
+
+TARGET_NORC = yes
+
+TARGET_TYPE = program
+
+TARGET_APPTYPE = console
+
+TARGET_NAME = thrdheap
+
+TARGET_OBJECTS = $(TARGET_NAME).o
+
+TARGET_CFLAGS = -Wall -Werror
+
+include $(PATH_TO_TOP)/rules.mak
+
+include $(TOOLS_PATH)/helper.mk
+
+# EOF
reactos/apps/tests/thrdheap
diff -N thrdheap.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ thrdheap.c 8 Jul 2004 22:58:12 -0000 1.1.2.1
@@ -0,0 +1,115 @@
+#include <windows.h>
+#include <stdio.h>
+
+#define MAX_THREADS 10
+#define STAT_PRINT_INTERVAL 250
+
+typedef struct _THREADDATA
+{
+ DWORD id;
+ HANDLE hThread;
+ struct _THREADDATA **entry;
+} THREADDATA, *PTHREADDATA;
+
+static CRITICAL_SECTION LockThreadList;
+static PTHREADDATA ThreadList[MAX_THREADS];
+static LONG ThreadsCount = 0;
+static ULONG ThreadsCreatedCount = 0;
+
+DWORD WINAPI
+TestThread(PTHREADDATA ThreadData)
+{
+ EnterCriticalSection(&LockThreadList);
+ *(ThreadData->entry) = NULL;
+ LeaveCriticalSection(&LockThreadList);
+
+ InterlockedDecrement(&ThreadsCount);
+ CloseHandle(ThreadData->hThread);
+ HeapFree(GetProcessHeap(), 0, ThreadData);
+ return 0;
+}
+
+BOOL CreateThreads(VOID)
+{
+ int x;
+ PTHREADDATA td;
+
+ if(ThreadsCount >= MAX_THREADS)
+ {
+ return FALSE;
+ }
+
+ for(x = 0; x < MAX_THREADS; x++)
+ {
+ if(ThreadList[x] == 0)
+ {
+ if(!(td = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(THREADDATA))))
+ {
+ printf("Unable to allocate memory for a THREADDATA structure!\n");
+ return FALSE;
+ }
+
+ td->entry = &ThreadList[x];
+
+ if(!(td->hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)TestThread,
+ td, 0, &td->id)))
+ {
+ printf("Failed to create a thread\n");
+
+ /* free the memory, we couldn't find a free slot for the thread */
+ HeapFree(GetProcessHeap(), 0, td);
+ return FALSE;
+ }
+ InterlockedIncrement(&ThreadsCount);
+
+ ThreadList[x] = td;
+
+ /* close the handles later */
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+int main(int argc, char* argv[])
+{
+ HANDLE Handles[MAX_THREADS];
+ int x, n;
+ BOOL PrintInfo;
+
+ InitializeCriticalSection(&LockThreadList);
+ ZeroMemory(ThreadList, MAX_THREADS * sizeof(PTHREADDATA));
+
+ printf("ReactOS Heap/Thread Stress-Test\nType Ctrl+C to stop the infinite test\n\n");
+
+ for(;;)
+ {
+ PrintInfo = FALSE;
+
+ EnterCriticalSection(&LockThreadList);
+ while(CreateThreads())
+ {
+ if(++ThreadsCreatedCount % STAT_PRINT_INTERVAL == 0)
+ {
+ PrintInfo = TRUE;
+ }
+ }
+
+ /* build a list of handles */
+ n = 0;
+ for(x = 0; x < MAX_THREADS; x++)
+ {
+ if(ThreadList[x] != NULL)
+ Handles[n++] = ThreadList[x]->hThread;
+ }
+
+ LeaveCriticalSection(&LockThreadList);
+ WaitForMultipleObjects(MAX_THREADS, Handles, FALSE, INFINITE);
+ if(PrintInfo)
+ {
+ printf("Created %d threads\r", (int)ThreadsCreatedCount);
+ }
+ }
+}
+
reactos/lib/ntdll/rtl
diff -N timerqueue.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ timerqueue.c 8 Jul 2004 22:58:12 -0000 1.2.2.1
@@ -0,0 +1,119 @@
+/*
+ * ReactOS kernel
+ * Copyright (C) 2004 ReactOS Team
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+/* $Id: timerqueue.c,v 1.2.2.1 2004/07/08 22:58:12 weiden Exp $
+ *
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS system libraries
+ * PURPOSE: Timer Queue implementation
+ * FILE: lib/ntdll/rtl/timerqueue.c
+ */
+
+/* INCLUDES ****************************************************************/
+
+#include <ddk/ntddk.h>
+
+#define NDEBUG
+#include <ntdll/ntdll.h>
+
+typedef VOID (CALLBACK *WAITORTIMERCALLBACKFUNC) (PVOID, BOOLEAN );
+
+/*
+ * @unimplemented
+ */
+NTSTATUS
+STDCALL
+RtlCreateTimer(HANDLE TimerQueue,
+ PHANDLE phNewTimer,
+ WAITORTIMERCALLBACKFUNC Callback,
+ PVOID Parameter,
+ DWORD DueTime,
+ DWORD Period,
+ ULONG Flags)
+{
+ DPRINT1("RtlCreateTimer: stub\n");
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+
+/*
+ * @unimplemented
+ */
+NTSTATUS
+STDCALL
+RtlCreateTimerQueue(PHANDLE TimerQueue)
+{
+ DPRINT1("RtlCreateTimerQueue: stub\n");
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+
+/*
+ * @unimplemented
+ */
+NTSTATUS
+STDCALL
+RtlDeleteTimer(HANDLE TimerQueue,
+ HANDLE Timer,
+ HANDLE CompletionEvent)
+{
+ DPRINT1("RtlDeleteTimer: stub\n");
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+
+/*
+ * @unimplemented
+ */
+NTSTATUS
+STDCALL
+RtlDeleteTimerQueue(HANDLE TimerQueue)
+{
+ DPRINT1("RtlDeleteTimerQueue: stub\n");
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+
+/*
+ * @unimplemented
+ */
+NTSTATUS
+STDCALL
+RtlDeleteTimerQueueEx(HANDLE TimerQueue,
+ HANDLE CompletionEvent)
+{
+ DPRINT1("RtlDeleteTimerQueueEx: stub\n");
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+
+/*
+ * @unimplemented
+ */
+NTSTATUS
+STDCALL
+RtlUpdateTimer(HANDLE TimerQueue,
+ HANDLE Timer,
+ ULONG DueTime,
+ ULONG Period)
+{
+ DPRINT1("RtlUpdateTimer: stub\n");
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+/* EOF */
CVSspam 0.2.8