Author: ion Date: Fri Mar 2 22:52:29 2007 New Revision: 25956
URL: http://svn.reactos.org/svn/reactos?rev=25956&view=rev Log: - Fix various ntoskrnl/wdk compilation issues in rossym, cmlib, kdcom, rtl. - Rename one more duplicated file in the kernel which wasn't caught previously. - pseh, rossym, cmlib, kdcom, bootvid, rtl compile & link, and ntoskrnl is now down to only 23 linker errors.
Added: trunk/reactos/ntoskrnl/ps/psnotify.c - copied unchanged from r25926, trunk/reactos/ntoskrnl/ps/notify.c Removed: trunk/reactos/ntoskrnl/ps/notify.c Modified: trunk/reactos/drivers/base/kdcom/kdbg.c trunk/reactos/lib/cmlib/cmlib.h trunk/reactos/lib/rossym/fromfile.c trunk/reactos/lib/rossym/frommem.c trunk/reactos/lib/rtl/austin/avl.c trunk/reactos/lib/rtl/austin/tree.c trunk/reactos/lib/rtl/qsort.c trunk/reactos/lib/rtl/rtl.h trunk/reactos/lib/rtl/sprintf.c trunk/reactos/lib/rtl/srw.c trunk/reactos/ntoskrnl/include/internal/ke.h trunk/reactos/ntoskrnl/ntoskrnl.rbuild
Modified: trunk/reactos/drivers/base/kdcom/kdbg.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/kdcom/kdbg.c?r... ============================================================================== --- trunk/reactos/drivers/base/kdcom/kdbg.c (original) +++ trunk/reactos/drivers/base/kdcom/kdbg.c Fri Mar 2 22:52:29 2007 @@ -12,6 +12,7 @@
/* INCLUDES *****************************************************************/
+#define NOEXTAPI #include <ntddk.h> #define NDEBUG #include <halfuncs.h>
Modified: trunk/reactos/lib/cmlib/cmlib.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/cmlib.h?rev=25956... ============================================================================== --- trunk/reactos/lib/cmlib/cmlib.h (original) +++ trunk/reactos/lib/cmlib/cmlib.h Fri Mar 2 22:52:29 2007 @@ -8,7 +8,7 @@ #ifndef CMLIB_H #define CMLIB_H
-#define WIN32_NO_STATUS +//#define WIN32_NO_STATUS #include <ntddk.h> #include "hivedata.h" #include "cmdata.h"
Modified: trunk/reactos/lib/rossym/fromfile.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rossym/fromfile.c?rev=2... ============================================================================== --- trunk/reactos/lib/rossym/fromfile.c (original) +++ trunk/reactos/lib/rossym/fromfile.c Fri Mar 2 22:52:29 2007 @@ -11,6 +11,9 @@ #include <ntddk.h> #include <reactos/rossym.h> #include "rossympriv.h" +#ifdef _MSC_VER +#include "ntimage.h" +#endif
#define NDEBUG #include <debug.h>
Modified: trunk/reactos/lib/rossym/frommem.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rossym/frommem.c?rev=25... ============================================================================== --- trunk/reactos/lib/rossym/frommem.c (original) +++ trunk/reactos/lib/rossym/frommem.c Fri Mar 2 22:52:29 2007 @@ -11,6 +11,9 @@ #include <ntddk.h> #include <reactos/rossym.h> #include "rossympriv.h" +#ifdef _MSC_VER +#include "ntimage.h" +#endif
#define NDEBUG #include <debug.h>
Modified: trunk/reactos/lib/rtl/austin/avl.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/austin/avl.c?rev=25... ============================================================================== --- trunk/reactos/lib/rtl/austin/avl.c (original) +++ trunk/reactos/lib/rtl/austin/avl.c Fri Mar 2 22:52:29 2007 @@ -21,7 +21,7 @@ /* * Modified for use in ReactOS by arty */ - +#include "rtl.h" #include "udict.h" #include "tree.h" #include "macros.h"
Modified: trunk/reactos/lib/rtl/austin/tree.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/austin/tree.c?rev=2... ============================================================================== --- trunk/reactos/lib/rtl/austin/tree.c (original) +++ trunk/reactos/lib/rtl/austin/tree.c Fri Mar 2 22:52:29 2007 @@ -20,7 +20,7 @@ /* * Modified for use in ReactOS by arty */ - +#include "rtl.h" #include "udict.h" #include "tree.h" #include "macros.h"
Modified: trunk/reactos/lib/rtl/qsort.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/qsort.c?rev=25956&a... ============================================================================== --- trunk/reactos/lib/rtl/qsort.c (original) +++ trunk/reactos/lib/rtl/qsort.c Fri Mar 2 22:52:29 2007 @@ -41,7 +41,7 @@
/* FIXME: these types should be from the default includes */
-typedef int (* _pfunccmp_t) (const void *, const void *); +typedef int (__cdecl* _pfunccmp_t) (const void *, const void *);
/* * Qsort routine from Bentley & McIlroy's "Engineering a Sort Function". @@ -100,6 +100,7 @@
/* EXPORTED */ void +__cdecl qsort ( void * a, size_t n,
Modified: trunk/reactos/lib/rtl/rtl.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/rtl.h?rev=25956&... ============================================================================== --- trunk/reactos/lib/rtl/rtl.h (original) +++ trunk/reactos/lib/rtl/rtl.h Fri Mar 2 22:52:29 2007 @@ -16,6 +16,7 @@ #define _INC_SWPRINTF_INL_
/* C Headers */ +#include <stdlib.h> #include <stdio.h>
/* PSDK/NDK Headers */
Modified: trunk/reactos/lib/rtl/sprintf.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/sprintf.c?rev=25956... ============================================================================== --- trunk/reactos/lib/rtl/sprintf.c (original) +++ trunk/reactos/lib/rtl/sprintf.c Fri Mar 2 22:52:29 2007 @@ -383,7 +383,7 @@ /* * @implemented */ -int _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args) +int __cdecl _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args) { int len; unsigned long long num; @@ -742,7 +742,7 @@ /* * @implemented */ -int vsprintf(char *buf, const char *fmt, va_list args) +int __cdecl vsprintf(char *buf, const char *fmt, va_list args) { return _vsnprintf(buf,MAXLONG,fmt,args); }
Modified: trunk/reactos/lib/rtl/srw.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/srw.c?rev=25956&... ============================================================================== --- trunk/reactos/lib/rtl/srw.c (original) +++ trunk/reactos/lib/rtl/srw.c Fri Mar 2 22:52:29 2007 @@ -173,8 +173,7 @@ } }
- (void)_InterlockedExchangePointer(&SRWLock->Ptr, - (PVOID)NewValue); + (void)_InterlockedExchange((PLONG)&SRWLock->Ptr, NewValue);
if (FirstWaitBlock->Exclusive) { @@ -229,8 +228,7 @@ NewValue = RTL_SRWLOCK_OWNED; }
- (void)_InterlockedExchangePointer(&SRWLock->Ptr, - (PVOID)NewValue); + (void)_InterlockedExchange((PLONG)&SRWLock->Ptr, NewValue);
(void)InterlockedOr(&FirstWaitBlock->Wake, TRUE); @@ -464,9 +462,9 @@ NewValue = (CurrentValue >> RTL_SRWLOCK_BITS) + 1; NewValue = (NewValue << RTL_SRWLOCK_BITS) | (CurrentValue & RTL_SRWLOCK_MASK);
- if (_InterlockedCompareExchangePointer(&SRWLock->Ptr, - (PVOID)NewValue, - (PVOID)CurrentValue) == (PVOID)CurrentValue) + if (_InterlockedCompareExchange((PLONG)&SRWLock->Ptr, + NewValue, + CurrentValue) == CurrentValue) { /* Successfully incremented the shared count, we acquired the lock */ break; @@ -543,9 +541,9 @@ ASSERT_SRW_WAITBLOCK(&StackWaitBlock);
NewValue = (ULONG_PTR)&StackWaitBlock | RTL_SRWLOCK_OWNED | RTL_SRWLOCK_CONTENDED; - if (_InterlockedCompareExchangePointer(&SRWLock->Ptr, - (PVOID)NewValue, - (PVOID)CurrentValue) == (PVOID)CurrentValue) + if (_InterlockedCompareExchange((PLONG)&SRWLock->Ptr, + NewValue, + CurrentValue) == CurrentValue) { RtlpAcquireSRWLockSharedWait(SRWLock, &StackWaitBlock, @@ -565,9 +563,9 @@ RTL_SRWLOCK_SHARED nor the RTL_SRWLOCK_OWNED bit is set */ ASSERT(!(CurrentValue & RTL_SRWLOCK_CONTENDED));
- if (_InterlockedCompareExchangePointer(&SRWLock->Ptr, - (PVOID)NewValue, - (PVOID)CurrentValue) == (PVOID)CurrentValue) + if (_InterlockedCompareExchange((PLONG)&SRWLock->Ptr, + NewValue, + CurrentValue) == CurrentValue) { /* Successfully set the shared count, we acquired the lock */ break; @@ -624,9 +622,9 @@ NewValue = (NewValue << RTL_SRWLOCK_BITS) | RTL_SRWLOCK_SHARED | RTL_SRWLOCK_OWNED; }
- if (_InterlockedCompareExchangePointer(&SRWLock->Ptr, - (PVOID)NewValue, - (PVOID)CurrentValue) == (PVOID)CurrentValue) + if (_InterlockedCompareExchange((PLONG)&SRWLock->Ptr, + NewValue, + CurrentValue) == CurrentValue) { /* Successfully released the lock */ break; @@ -683,9 +681,9 @@
NewValue = (ULONG_PTR)&StackWaitBlock | RTL_SRWLOCK_SHARED | RTL_SRWLOCK_CONTENDED | RTL_SRWLOCK_OWNED;
- if (_InterlockedCompareExchangePointer(&SRWLock->Ptr, - (PVOID)NewValue, - (PVOID)CurrentValue) == (PVOID)CurrentValue) + if (_InterlockedCompareExchange((PLONG)&SRWLock->Ptr, + NewValue, + CurrentValue) == CurrentValue) { RtlpAcquireSRWLockExclusiveWait(SRWLock, &StackWaitBlock); @@ -741,9 +739,9 @@ ASSERT_SRW_WAITBLOCK(&StackWaitBlock);
NewValue = (ULONG_PTR)&StackWaitBlock | RTL_SRWLOCK_OWNED | RTL_SRWLOCK_CONTENDED; - if (_InterlockedCompareExchangePointer(&SRWLock->Ptr, - (PVOID)NewValue, - (PVOID)CurrentValue) == (PVOID)CurrentValue) + if (_InterlockedCompareExchange((PLONG)&SRWLock->Ptr, + NewValue, + CurrentValue) == CurrentValue) { RtlpAcquireSRWLockExclusiveWait(SRWLock, &StackWaitBlock); @@ -811,9 +809,9 @@ ASSERT(!(CurrentValue & ~RTL_SRWLOCK_OWNED));
NewValue = 0; - if (_InterlockedCompareExchangePointer(&SRWLock->Ptr, - (PVOID)NewValue, - (PVOID)CurrentValue) == (PVOID)CurrentValue) + if (_InterlockedCompareExchange((PLONG)&SRWLock->Ptr, + NewValue, + CurrentValue) == CurrentValue) { /* We released the lock */ break;
Modified: trunk/reactos/ntoskrnl/include/internal/ke.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/k... ============================================================================== --- trunk/reactos/ntoskrnl/include/internal/ke.h (original) +++ trunk/reactos/ntoskrnl/include/internal/ke.h Fri Mar 2 22:52:29 2007 @@ -140,9 +140,9 @@ extern PKPRCB KiProcessorBlock[]; extern ULONG KiMask32Array[MAXIMUM_PRIORITY]; extern ULONG KiIdleSummary; -extern VOID KiTrap8(VOID); -extern VOID KiTrap2(VOID); -extern VOID KiFastCallEntry(VOID); +extern VOID __cdecl KiTrap8(VOID); +extern VOID __cdecl KiTrap2(VOID); +extern VOID __cdecl KiFastCallEntry(VOID); extern PVOID KeUserApcDispatcher; extern PVOID KeUserCallbackDispatcher; extern PVOID KeUserExceptionDispatcher;
Modified: trunk/reactos/ntoskrnl/ntoskrnl.rbuild URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ntoskrnl.rbuild?re... ============================================================================== --- trunk/reactos/ntoskrnl/ntoskrnl.rbuild (original) +++ trunk/reactos/ntoskrnl/ntoskrnl.rbuild Fri Mar 2 22:52:29 2007 @@ -299,7 +299,7 @@ <file>debug.c</file> <file>job.c</file> <file>kill.c</file> - <file>notify.c</file> + <file>psnotify.c</file> <file>process.c</file> <file>psmgr.c</file> <file>query.c</file>
Removed: trunk/reactos/ntoskrnl/ps/notify.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/notify.c?rev=25... ============================================================================== --- trunk/reactos/ntoskrnl/ps/notify.c (original) +++ trunk/reactos/ntoskrnl/ps/notify.c (removed) @@ -1,292 +1,0 @@ -/* - * PROJECT: ReactOS Kernel - * LICENSE: GPL - See COPYING in the top level directory - * FILE: ntoskrnl/ps/notify.c - * PURPOSE: Process Manager: Callbacks to Registered Clients (Drivers) - * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) - * Thomas Weidenmueller (w3seek@reactos.org) - */ - -/* INCLUDES ******************************************************************/ - -#include <ntoskrnl.h> -#define NDEBUG -#include <debug.h> - -/* GLOBALS *******************************************************************/ - -BOOLEAN PsImageNotifyEnabled = FALSE; -ULONG PspThreadNotifyRoutineCount, PspProcessNotifyRoutineCount; -ULONG PspLoadImageNotifyRoutineCount; -EX_CALLBACK PspThreadNotifyRoutine[PSP_MAX_CREATE_THREAD_NOTIFY]; -EX_CALLBACK PspProcessNotifyRoutine[PSP_MAX_CREATE_PROCESS_NOTIFY]; -EX_CALLBACK PspLoadImageNotifyRoutine[PSP_MAX_LOAD_IMAGE_NOTIFY]; -PLEGO_NOTIFY_ROUTINE PspLegoNotifyRoutine; - -/* PUBLIC FUNCTIONS **********************************************************/ - -/* - * @implemented - */ -NTSTATUS -NTAPI -PsSetCreateProcessNotifyRoutine(IN PCREATE_PROCESS_NOTIFY_ROUTINE NotifyRoutine, - IN BOOLEAN Remove) -{ - ULONG i; - PEX_CALLBACK_ROUTINE_BLOCK CallBack; - PAGED_CODE(); - - /* Check if we're removing */ - if (Remove) - { - /* Loop all the routines */ - for (i = 0; i < PSP_MAX_CREATE_PROCESS_NOTIFY; i++) - { - /* Reference the callback block */ - CallBack = ExReferenceCallBackBlock(&PspProcessNotifyRoutine[i]); - if (!CallBack) continue; - - /* Check it this is a matching block */ - if (ExGetCallBackBlockRoutine(CallBack) != (PVOID)NotifyRoutine) - { - /* It's not, try the next one */ - continue; - } - - /* It is, clear the current routine */ - if (ExCompareExchangeCallBack(&PspProcessNotifyRoutine[i], - NULL, - CallBack)) - { - /* Decrement the number of routines */ - InterlockedDecrement((PLONG)&PspProcessNotifyRoutineCount); - - /* Dereference the block */ - ExDereferenceCallBackBlock(&PspProcessNotifyRoutine[i], - CallBack); - - /* Wait for actice callbacks */ - ExWaitForCallBacks(CallBack); - - /* Free the callback and exit */ - ExFreeCallBack (CallBack); - return STATUS_SUCCESS; - } - - /* Dereference the block */ - ExDereferenceCallBackBlock(&PspProcessNotifyRoutine[i], - CallBack); - } - - /* We didn't find any matching block */ - return STATUS_PROCEDURE_NOT_FOUND; - } - else - { - /* Allocate a callback */ - CallBack = ExAllocateCallBack((PVOID)NotifyRoutine, NULL); - if (!CallBack) return STATUS_INSUFFICIENT_RESOURCES; - - /* Loop all callbacks */ - for (i = 0; i < PSP_MAX_CREATE_PROCESS_NOTIFY; i++) - { - /* Add this routine if it's an empty slot */ - if (ExCompareExchangeCallBack(&PspProcessNotifyRoutine[i], - CallBack, - NULL)) - { - /* Found and inserted into an empty slot, return */ - InterlockedIncrement((PLONG)&PspProcessNotifyRoutineCount); - return STATUS_SUCCESS; - } - } - - /* We didn't find a free slot, free the callback and fail */ - ExFreeCallBack(CallBack); - return STATUS_INVALID_PARAMETER; - } -} - -/* - * @implemented - */ -ULONG -NTAPI -PsSetLegoNotifyRoutine(PVOID LegoNotifyRoutine) -{ - /* Set the System-Wide Lego Routine */ - PspLegoNotifyRoutine = LegoNotifyRoutine; - - /* Return the location to the Lego Data */ - return FIELD_OFFSET(KTHREAD, LegoData); -} - -/* - * @implemented - */ -NTSTATUS -NTAPI -PsRemoveLoadImageNotifyRoutine(IN PLOAD_IMAGE_NOTIFY_ROUTINE NotifyRoutine) -{ - ULONG i; - PEX_CALLBACK_ROUTINE_BLOCK CallBack; - PAGED_CODE(); - - /* Loop all callbacks */ - for (i = 0; i < PSP_MAX_LOAD_IMAGE_NOTIFY; i++) - { - /* Reference this slot */ - CallBack = ExReferenceCallBackBlock(&PspLoadImageNotifyRoutine[i]); - if (CallBack) - { - /* Check for a match */ - if (ExGetCallBackBlockRoutine(CallBack) == (PVOID)NotifyRoutine) - { - /* Try removing it if it matches */ - if (ExCompareExchangeCallBack(&PspLoadImageNotifyRoutine[i], - NULL, - CallBack)) - { - /* We removed it, now dereference the block */ - InterlockedDecrement((PLONG)&PspLoadImageNotifyRoutineCount); - ExDereferenceCallBackBlock(&PspLoadImageNotifyRoutine[i], - CallBack); - - /* Wait for active callbacks */ - ExWaitForCallBacks(CallBack); - - /* Free the callback and return */ - ExFreeCallBack(CallBack); - return STATUS_SUCCESS; - } - } - - /* Dereference the callback */ - ExDereferenceCallBackBlock(&PspLoadImageNotifyRoutine[i], CallBack); - } - } - - /* Nothing found to remove */ - return STATUS_PROCEDURE_NOT_FOUND; -} - -/* - * @implemented - */ -NTSTATUS -NTAPI -PsSetLoadImageNotifyRoutine(IN PLOAD_IMAGE_NOTIFY_ROUTINE NotifyRoutine) -{ - ULONG i; - PEX_CALLBACK_ROUTINE_BLOCK CallBack; - PAGED_CODE(); - - /* Allocate a callback */ - CallBack = ExAllocateCallBack((PVOID)NotifyRoutine, NULL); - if (!CallBack) return STATUS_INSUFFICIENT_RESOURCES; - - /* Loop callbacks */ - for (i = 0; i < PSP_MAX_LOAD_IMAGE_NOTIFY; i++) - { - /* Add this entry if the slot is empty */ - if (ExCompareExchangeCallBack(&PspLoadImageNotifyRoutine[i], - CallBack, - NULL)) - { - /* Return success */ - InterlockedIncrement((PLONG)&PspLoadImageNotifyRoutineCount); - PsImageNotifyEnabled = TRUE; - return STATUS_SUCCESS; - } - } - - /* No free space found, fail */ - ExFreeCallBack(CallBack); - return STATUS_INSUFFICIENT_RESOURCES; -} - -/* - * @implemented - */ -NTSTATUS -NTAPI -PsRemoveCreateThreadNotifyRoutine(IN PCREATE_THREAD_NOTIFY_ROUTINE NotifyRoutine) -{ - ULONG i; - PEX_CALLBACK_ROUTINE_BLOCK CallBack; - PAGED_CODE(); - - /* Loop all callbacks */ - for (i = 0; i < PSP_MAX_CREATE_THREAD_NOTIFY; i++) - { - /* Reference this slot */ - CallBack = ExReferenceCallBackBlock(&PspThreadNotifyRoutine[i]); - if (CallBack) - { - /* Check for a match */ - if (ExGetCallBackBlockRoutine(CallBack) == (PVOID)NotifyRoutine) - { - /* Try removing it if it matches */ - if (ExCompareExchangeCallBack(&PspThreadNotifyRoutine[i], - NULL, - CallBack)) - { - /* We removed it, now dereference the block */ - InterlockedDecrement((PLONG)&PspThreadNotifyRoutineCount); - ExDereferenceCallBackBlock(&PspThreadNotifyRoutine[i], - CallBack); - - /* Wait for active callbacks */ - ExWaitForCallBacks(CallBack); - - /* Free the callback and return */ - ExFreeCallBack(CallBack); - return STATUS_SUCCESS; - } - } - - /* Dereference the callback */ - ExDereferenceCallBackBlock(&PspThreadNotifyRoutine[i], CallBack); - } - } - - /* Nothing found to remove */ - return STATUS_PROCEDURE_NOT_FOUND; -} - -/* - * @implemented - */ -NTSTATUS -NTAPI -PsSetCreateThreadNotifyRoutine(IN PCREATE_THREAD_NOTIFY_ROUTINE NotifyRoutine) -{ - ULONG i; - PEX_CALLBACK_ROUTINE_BLOCK CallBack; - PAGED_CODE(); - - /* Allocate a callback */ - CallBack = ExAllocateCallBack((PVOID)NotifyRoutine, NULL); - if (!CallBack) return STATUS_INSUFFICIENT_RESOURCES; - - /* Loop callbacks */ - for (i = 0; i < PSP_MAX_CREATE_THREAD_NOTIFY; i++) - { - /* Add this entry if the slot is empty */ - if (ExCompareExchangeCallBack(&PspThreadNotifyRoutine[i], - CallBack, - NULL)) - { - /* Return success */ - InterlockedIncrement((PLONG)&PspThreadNotifyRoutineCount); - return STATUS_SUCCESS; - } - } - - /* No free space found, fail */ - ExFreeCallBack(CallBack); - return STATUS_INSUFFICIENT_RESOURCES; -} - -/* EOF */