diff --git a/reactos/lib/ntdll/ntdll.xml b/reactos/lib/ntdll/ntdll.xml index 7a954ff3bcc..4244a5fa295 100644 --- a/reactos/lib/ntdll/ntdll.xml +++ b/reactos/lib/ntdll/ntdll.xml @@ -32,25 +32,11 @@ dllmain.c - apc.c - callback.c - crc32.c critical.c - dbgbuffer.c exception.c - handle.c libsupp.c - math.c - message.c - misc.c path.c - process.c - propvar.c - rangelist.c - resource.c - secobj.c - teb.c - timerqueue.c + version.c sprintf.c diff --git a/reactos/lib/ntdll/rtl/apc.c b/reactos/lib/ntdll/rtl/apc.c deleted file mode 100644 index 420fce79030..00000000000 --- a/reactos/lib/ntdll/rtl/apc.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - * ReactOS kernel - * Copyright (C) 2000 David Welch - * - * 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$ - * - * PROJECT: ReactOS kernel - * PURPOSE: User-mode APC support - * FILE: lib/ntdll/rtl/apc.c - * PROGRAMER: David Welch - */ - -/* INCLUDES *****************************************************************/ - -#include -#define NDEBUG -#include - -/* FUNCTIONS ***************************************************************/ - -VOID STDCALL -KiUserApcDispatcher(PIO_APC_ROUTINE ApcRoutine, - PVOID ApcContext, - PIO_STATUS_BLOCK Iosb, - ULONG Reserved, - PCONTEXT Context) -{ - /* - * Call the APC - */ - //DPRINT1("ITS ME\n"); - ApcRoutine(ApcContext, - Iosb, - Reserved); - /* - * Switch back to the interrupted context - */ - //DPRINT1("switch back\n"); - NtContinue(Context, 1); -} - diff --git a/reactos/lib/ntdll/rtl/libsupp.c b/reactos/lib/ntdll/rtl/libsupp.c index 805359c385c..eb67ddad1c6 100644 --- a/reactos/lib/ntdll/rtl/libsupp.c +++ b/reactos/lib/ntdll/rtl/libsupp.c @@ -1,14 +1,13 @@ -/* $Id$ - * +/* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel * FILE: lib/ntdll/rtl/libsup.c * PURPOSE: Rtl library support routines * PROGRAMMER: Gunnar Dalsnes - * UPDATE HISTORY: - * */ +/* INCLUDES *****************************************************************/ + #include #define NDEBUG #include @@ -16,13 +15,54 @@ /* FUNCTIONS ***************************************************************/ KPROCESSOR_MODE +STDCALL RtlpGetMode() { return UserMode; } +PPEB +STDCALL +RtlpCurrentPeb(VOID) +{ + return NtCurrentPeb(); +} + + +/* + * @implemented + */ +VOID STDCALL +RtlAcquirePebLock(VOID) +{ + PPEB Peb = NtCurrentPeb (); + Peb->FastPebLockRoutine (Peb->FastPebLock); +} + + +/* + * @implemented + */ +VOID STDCALL +RtlReleasePebLock(VOID) +{ + PPEB Peb = NtCurrentPeb (); + Peb->FastPebUnlockRoutine (Peb->FastPebLock); +} + +/* +* @implemented +*/ +ULONG +STDCALL +RtlGetNtGlobalFlags(VOID) +{ + PPEB pPeb = NtCurrentPeb(); + return pPeb->NtGlobalFlag; +} PVOID +STDCALL RtlpAllocateMemory(UINT Bytes, ULONG Tag) { @@ -35,6 +75,7 @@ RtlpAllocateMemory(UINT Bytes, VOID +STDCALL RtlpFreeMemory(PVOID Mem, ULONG Tag) { diff --git a/reactos/lib/ntdll/rtl/misc.c b/reactos/lib/ntdll/rtl/misc.c deleted file mode 100644 index 4dceb198927..00000000000 --- a/reactos/lib/ntdll/rtl/misc.c +++ /dev/null @@ -1,136 +0,0 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * PURPOSE: Various functions - * FILE: lib/ntdll/rtl/misc.c - * PROGRAMER: Eric Kohl - * REVISION HISTORY: - * 10/08/2000: Created - */ - -/* INCLUDES *****************************************************************/ - -#include -#define NDEBUG -#include - -/********************************************************************** - * NAME EXPORTED - * RtlGetNtProductType - * - * DESCRIPTION - * Retrieves the OS product type. - * - * ARGUMENTS - * ProductType Pointer to the product type variable. - * - * RETURN VALUE - * TRUE if successful, otherwise FALSE - * - * NOTE - * ProductType can be one of the following values: - * 1 Workstation (Winnt) - * 2 Server (Lanmannt) - * 3 Advanced Server (Servernt) - * - * REVISIONS - * 2000-08-10 ekohl - * - * @implemented - */ - -BOOLEAN STDCALL -RtlGetNtProductType(PNT_PRODUCT_TYPE ProductType) -{ - *ProductType = SharedUserData->NtProductType; - return(TRUE); -} - -/********************************************************************** - * NAME EXPORTED - * RtlGetNtVersionNumbers - * - * DESCRIPTION - * Get the version numbers of the run time library. - * - * ARGUMENTS - * major [OUT] Destination for the Major version - * minor [OUT] Destination for the Minor version - * build [OUT] Destination for the Build version - * - * RETURN VALUE - * Nothing. - * - * NOTE - * Introduced in Windows XP (NT5.1) - * - * @implemented - */ - -void STDCALL -RtlGetNtVersionNumbers(LPDWORD major, LPDWORD minor, LPDWORD build) -{ - PPEB pPeb = NtCurrentPeb(); - - if (major) - { - /* msvcrt.dll as released with XP Home fails in DLLMain() if the - * major version is not 5. So, we should never set a version < 5 ... - * This makes sense since this call didn't exist before XP anyway. - */ - *major = pPeb->OSMajorVersion < 5 ? 5 : pPeb->OSMajorVersion; - } - - if (minor) - { - if (pPeb->OSMinorVersion <= 5) - *minor = pPeb->OSMinorVersion < 1 ? 1 : pPeb->OSMinorVersion; - else - *minor = pPeb->OSMinorVersion; - } - - if (build) - { - /* FIXME: Does anybody know the real formula? */ - *build = (0xF0000000 | pPeb->OSBuildNumber); - } -} - -/* -* @implemented -*/ -ULONG -STDCALL -RtlGetNtGlobalFlags(VOID) -{ - PPEB pPeb = NtCurrentPeb(); - return pPeb->NtGlobalFlag; -} - - -/* - * @implemented - */ -PVOID -STDCALL -RtlEncodePointer(IN PVOID Pointer) -{ - ULONG Cookie; - NTSTATUS Status; - - Status = NtQueryInformationProcess(NtCurrentProcess(), - ProcessCookie, - &Cookie, - sizeof(Cookie), - NULL); - - if(!NT_SUCCESS(Status)) - { - DPRINT1("Failed to receive the process cookie! Status: 0x%x\n", Status); - return Pointer; - } - - return (PVOID)((ULONG_PTR)Pointer ^ Cookie); -} - diff --git a/reactos/lib/ntdll/rtl/rangelist.c b/reactos/lib/ntdll/rtl/rangelist.c deleted file mode 100644 index 7f7736ce583..00000000000 --- a/reactos/lib/ntdll/rtl/rangelist.c +++ /dev/null @@ -1,784 +0,0 @@ -/* - * 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$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS system libraries - * PURPOSE: Range list implementation - * FILE: lib/ntdll/rtl/rangelist.c - */ - -/* INCLUDES ****************************************************************/ - -#include -#define NDEBUG -#include - -typedef struct _RTL_RANGE_ENTRY -{ - LIST_ENTRY Entry; - RTL_RANGE Range; -} RTL_RANGE_ENTRY, *PRTL_RANGE_ENTRY; - - -/* FUNCTIONS ***************************************************************/ - -/********************************************************************** - * NAME EXPORTED - * RtlAddRange - * - * DESCRIPTION - * Adds a range to a range list. - * - * ARGUMENTS - * RangeList Range list. - * Start - * End - * Attributes - * Flags - * UserData - * Owner - * - * RETURN VALUE - * Status - * - * TODO: - * - Support shared ranges. - * - * @implemented - */ -NTSTATUS STDCALL -RtlAddRange (IN OUT PRTL_RANGE_LIST RangeList, - IN ULONGLONG Start, - IN ULONGLONG End, - IN UCHAR Attributes, - IN ULONG Flags, - IN PVOID UserData OPTIONAL, - IN PVOID Owner OPTIONAL) -{ - PRTL_RANGE_ENTRY RangeEntry; - PRTL_RANGE_ENTRY Previous; - PRTL_RANGE_ENTRY Current; - PLIST_ENTRY Entry; - - if (Start > End) - return STATUS_INVALID_PARAMETER; - - /* Create new range entry */ - RangeEntry = RtlAllocateHeap (RtlGetProcessHeap(), - 0, - sizeof(RTL_RANGE_ENTRY)); - if (RangeEntry == NULL) - return STATUS_INSUFFICIENT_RESOURCES; - - /* Initialize range entry */ - RangeEntry->Range.Start = Start; - RangeEntry->Range.End = End; - RangeEntry->Range.Attributes = Attributes; - RangeEntry->Range.UserData = UserData; - RangeEntry->Range.Owner = Owner; - - RangeEntry->Range.Flags = 0; - if (Flags & RTL_RANGE_LIST_ADD_SHARED) - RangeEntry->Range.Flags |= RTL_RANGE_SHARED; - - /* Insert range entry */ - if (RangeList->Count == 0) - { - InsertTailList (&RangeList->ListHead, - &RangeEntry->Entry); - RangeList->Count++; - RangeList->Stamp++; - return STATUS_SUCCESS; - } - else - { - Previous = NULL; - Entry = RangeList->ListHead.Flink; - while (Entry != &RangeList->ListHead) - { - Current = CONTAINING_RECORD (Entry, RTL_RANGE_ENTRY, Entry); - if (Current->Range.Start > RangeEntry->Range.End) - { - /* Insert before current */ - DPRINT ("Insert before current\n"); - InsertTailList (&Current->Entry, - &RangeEntry->Entry); - - RangeList->Count++; - RangeList->Stamp++; - return STATUS_SUCCESS; - } - - Previous = Current; - Entry = Entry->Flink; - } - - DPRINT ("Insert tail\n"); - InsertTailList (&RangeList->ListHead, - &RangeEntry->Entry); - RangeList->Count++; - RangeList->Stamp++; - return STATUS_SUCCESS; - } - - RtlFreeHeap (RtlGetProcessHeap(), - 0, - RangeEntry); - - return STATUS_UNSUCCESSFUL; -} - - -/********************************************************************** - * NAME EXPORTED - * RtlCopyRangeList - * - * DESCRIPTION - * Copy a range list. - * - * ARGUMENTS - * CopyRangeList Pointer to the destination range list. - * RangeList Pointer to the source range list. - * - * RETURN VALUE - * Status - * - * @implemented - */ -NTSTATUS STDCALL -RtlCopyRangeList (OUT PRTL_RANGE_LIST CopyRangeList, - IN PRTL_RANGE_LIST RangeList) -{ - PRTL_RANGE_ENTRY Current; - PRTL_RANGE_ENTRY NewEntry; - PLIST_ENTRY Entry; - - CopyRangeList->Flags = RangeList->Flags; - - Entry = RangeList->ListHead.Flink; - while (Entry != &RangeList->ListHead) - { - Current = CONTAINING_RECORD (Entry, RTL_RANGE_ENTRY, Entry); - - NewEntry = RtlAllocateHeap (RtlGetProcessHeap(), - 0, - sizeof(RTL_RANGE_ENTRY)); - if (NewEntry == NULL) - return STATUS_INSUFFICIENT_RESOURCES; - - RtlCopyMemory (&NewEntry->Range, - &Current->Range, - sizeof(RTL_RANGE_ENTRY)); - - InsertTailList (&CopyRangeList->ListHead, - &NewEntry->Entry); - - CopyRangeList->Count++; - - Entry = Entry->Flink; - } - - CopyRangeList->Stamp++; - - return STATUS_SUCCESS; -} - - -/********************************************************************** - * NAME EXPORTED - * RtlDeleteOwnersRanges - * - * DESCRIPTION - * Delete all ranges that belong to the given owner. - * - * ARGUMENTS - * RangeList Pointer to the range list. - * Owner User supplied value that identifies the owner - * of the ranges to be deleted. - * - * RETURN VALUE - * Status - * - * @implemented - */ -NTSTATUS STDCALL -RtlDeleteOwnersRanges (IN OUT PRTL_RANGE_LIST RangeList, - IN PVOID Owner) -{ - PRTL_RANGE_ENTRY Current; - PLIST_ENTRY Entry; - - Entry = RangeList->ListHead.Flink; - while (Entry != &RangeList->ListHead) - { - Current = CONTAINING_RECORD (Entry, RTL_RANGE_ENTRY, Entry); - if (Current->Range.Owner == Owner) - { - RemoveEntryList (Entry); - RtlFreeHeap (RtlGetProcessHeap(), - 0, - Current); - - RangeList->Count--; - RangeList->Stamp++; - } - - Entry = Entry->Flink; - } - - return STATUS_SUCCESS; -} - - -/********************************************************************** - * NAME EXPORTED - * RtlDeleteRange - * - * DESCRIPTION - * Deletes a given range. - * - * ARGUMENTS - * RangeList Pointer to the range list. - * Start Start of the range to be deleted. - * End End of the range to be deleted. - * Owner Owner of the ranges to be deleted. - * - * RETURN VALUE - * Status - * - * @implemented - */ -NTSTATUS STDCALL -RtlDeleteRange (IN OUT PRTL_RANGE_LIST RangeList, - IN ULONGLONG Start, - IN ULONGLONG End, - IN PVOID Owner) -{ - PRTL_RANGE_ENTRY Current; - PLIST_ENTRY Entry; - - Entry = RangeList->ListHead.Flink; - while (Entry != &RangeList->ListHead) - { - Current = CONTAINING_RECORD (Entry, RTL_RANGE_ENTRY, Entry); - if (Current->Range.Start == Start && - Current->Range.End == End && - Current->Range.Owner == Owner) - { - RemoveEntryList (Entry); - - RtlFreeHeap (RtlGetProcessHeap(), - 0, - Current); - - RangeList->Count--; - RangeList->Stamp++; - return STATUS_SUCCESS; - } - - Entry = Entry->Flink; - } - - return STATUS_RANGE_NOT_FOUND; -} - - -/********************************************************************** - * NAME EXPORTED - * RtlFindRange - * - * DESCRIPTION - * Searches for an unused range. - * - * ARGUMENTS - * RangeList Pointer to the range list. - * Minimum - * Maximum - * Length - * Alignment - * Flags - * AttributeAvailableMask - * Context - * Callback - * Start - * - * RETURN VALUE - * Status - * - * TODO - * Support shared ranges and callback. - * - * @implemented - */ -NTSTATUS STDCALL -RtlFindRange (IN PRTL_RANGE_LIST RangeList, - IN ULONGLONG Minimum, - IN ULONGLONG Maximum, - IN ULONG Length, - IN ULONG Alignment, - IN ULONG Flags, - IN UCHAR AttributeAvailableMask, - IN PVOID Context OPTIONAL, - IN PRTL_CONFLICT_RANGE_CALLBACK Callback OPTIONAL, - OUT PULONGLONG Start) -{ - PRTL_RANGE_ENTRY CurrentEntry; - PRTL_RANGE_ENTRY NextEntry; - PLIST_ENTRY Entry; - ULONGLONG RangeMin; - ULONGLONG RangeMax; - - if (Alignment == 0 || Length == 0) - { - return STATUS_INVALID_PARAMETER; - } - - if (IsListEmpty(&RangeList->ListHead)) - { - *Start = ROUND_DOWN (Maximum - (Length - 1), Alignment); - return STATUS_SUCCESS; - } - - NextEntry = NULL; - Entry = RangeList->ListHead.Blink; - while (Entry != &RangeList->ListHead) - { - CurrentEntry = CONTAINING_RECORD (Entry, RTL_RANGE_ENTRY, Entry); - - RangeMax = NextEntry ? (NextEntry->Range.Start - 1) : Maximum; - if (RangeMax + (Length - 1) < Minimum) - { - return STATUS_RANGE_NOT_FOUND; - } - - RangeMin = ROUND_DOWN (RangeMax - (Length - 1), Alignment); - if (RangeMin < Minimum || - (RangeMax - RangeMin) < (Length - 1)) - { - return STATUS_RANGE_NOT_FOUND; - } - - DPRINT("RangeMax: %I64x\n", RangeMax); - DPRINT("RangeMin: %I64x\n", RangeMin); - - if (RangeMin > CurrentEntry->Range.End) - { - *Start = RangeMin; - return STATUS_SUCCESS; - } - - NextEntry = CurrentEntry; - Entry = Entry->Blink; - } - - RangeMax = NextEntry ? (NextEntry->Range.Start - 1) : Maximum; - if (RangeMax + (Length - 1) < Minimum) - { - return STATUS_RANGE_NOT_FOUND; - } - - RangeMin = ROUND_DOWN (RangeMax - (Length - 1), Alignment); - if (RangeMin < Minimum || - (RangeMax - RangeMin) < (Length - 1)) - { - return STATUS_RANGE_NOT_FOUND; - } - - DPRINT("RangeMax: %I64x\n", RangeMax); - DPRINT("RangeMin: %I64x\n", RangeMin); - - *Start = RangeMin; - - return STATUS_SUCCESS; -} - - -/********************************************************************** - * NAME EXPORTED - * RtlFreeRangeList - * - * DESCRIPTION - * Deletes all ranges in a range list. - * - * ARGUMENTS - * RangeList Pointer to the range list. - * - * RETURN VALUE - * None - * - * @implemented - */ -VOID STDCALL -RtlFreeRangeList (IN PRTL_RANGE_LIST RangeList) -{ - PLIST_ENTRY Entry; - PRTL_RANGE_ENTRY Current; - - while (!IsListEmpty(&RangeList->ListHead)) - { - Entry = RemoveHeadList (&RangeList->ListHead); - Current = CONTAINING_RECORD (Entry, RTL_RANGE_ENTRY, Entry); - - DPRINT ("Range start: %I64u\n", Current->Range.Start); - DPRINT ("Range end: %I64u\n", Current->Range.End); - - RtlFreeHeap (RtlGetProcessHeap(), - 0, - Current); - } - - RangeList->Flags = 0; - RangeList->Count = 0; -} - - -/********************************************************************** - * NAME EXPORTED - * RtlGetFirstRange - * - * DESCRIPTION - * Retrieves the first range of a range list. - * - * ARGUMENTS - * RangeList Pointer to the range list. - * Iterator Pointer to a user supplied list state buffer. - * Range Pointer to the first range. - * - * RETURN VALUE - * Status - * - * @implemented - */ -NTSTATUS STDCALL -RtlGetFirstRange (IN PRTL_RANGE_LIST RangeList, - OUT PRTL_RANGE_LIST_ITERATOR Iterator, - OUT PRTL_RANGE *Range) -{ - Iterator->RangeListHead = &RangeList->ListHead; - Iterator->MergedHead = NULL; - Iterator->Stamp = RangeList->Stamp; - if (IsListEmpty(&RangeList->ListHead)) - { - Iterator->Current = NULL; - *Range = NULL; - return STATUS_NO_MORE_ENTRIES; - } - - Iterator->Current = RangeList->ListHead.Flink; - *Range = &((PRTL_RANGE_ENTRY)Iterator->Current)->Range; - - return STATUS_SUCCESS; -} - - -/********************************************************************** - * NAME EXPORTED - * RtlGetNextRange - * - * DESCRIPTION - * Retrieves the next (or previous) range of a range list. - * - * ARGUMENTS - * Iterator Pointer to a user supplied list state buffer. - * Range Pointer to the first range. - * MoveForwards TRUE, get next range - * FALSE, get previous range - * - * RETURN VALUE - * Status - * - * @implemented - */ -NTSTATUS STDCALL -RtlGetNextRange (IN OUT PRTL_RANGE_LIST_ITERATOR Iterator, - OUT PRTL_RANGE *Range, - IN BOOLEAN MoveForwards) -{ - PRTL_RANGE_LIST RangeList; - PLIST_ENTRY Next; - - RangeList = CONTAINING_RECORD(Iterator->RangeListHead, RTL_RANGE_LIST, ListHead); - if (Iterator->Stamp != RangeList->Stamp) - return STATUS_INVALID_PARAMETER; - - if (MoveForwards) - { - Next = ((PRTL_RANGE_ENTRY)Iterator->Current)->Entry.Flink; - } - else - { - Next = ((PRTL_RANGE_ENTRY)Iterator->Current)->Entry.Blink; - } - - if (Next == Iterator->RangeListHead) - return STATUS_NO_MORE_ENTRIES; - - Iterator->Current = Next; - *Range = &((PRTL_RANGE_ENTRY)Next)->Range; - - return STATUS_SUCCESS; -} - - -/********************************************************************** - * NAME EXPORTED - * RtlInitializeRangeList - * - * DESCRIPTION - * Initializes a range list. - * - * ARGUMENTS - * RangeList Pointer to a user supplied range list. - * - * RETURN VALUE - * None - * - * @implemented - */ -VOID STDCALL -RtlInitializeRangeList (IN OUT PRTL_RANGE_LIST RangeList) -{ - InitializeListHead (&RangeList->ListHead); - RangeList->Flags = 0; - RangeList->Count = 0; - RangeList->Stamp = 0; -} - - -/********************************************************************** - * NAME EXPORTED - * RtlInvertRangeList - * - * DESCRIPTION - * Inverts a range list. - * - * ARGUMENTS - * InvertedRangeList Inverted range list. - * RangeList Range list. - * - * RETURN VALUE - * Status - * - * @implemented - */ -NTSTATUS STDCALL -RtlInvertRangeList (OUT PRTL_RANGE_LIST InvertedRangeList, - IN PRTL_RANGE_LIST RangeList) -{ - PRTL_RANGE_ENTRY Previous; - PRTL_RANGE_ENTRY Current; - PLIST_ENTRY Entry; - NTSTATUS Status; - - /* Don't invert an empty range list */ - if (IsListEmpty(&RangeList->ListHead)) - { - return STATUS_SUCCESS; - } - - /* Add leading and intermediate ranges */ - Previous = NULL; - Entry = RangeList->ListHead.Flink; - while (Entry != &RangeList->ListHead) - { - Current = CONTAINING_RECORD (Entry, RTL_RANGE_ENTRY, Entry); - - if (Previous == NULL) - { - if (Current->Range.Start != (ULONGLONG)0) - { - Status = RtlAddRange (InvertedRangeList, - (ULONGLONG)0, - Current->Range.Start - 1, - 0, - 0, - NULL, - NULL); - if (!NT_SUCCESS(Status)) - return Status; - } - } - else - { - if (Previous->Range.End + 1 != Current->Range.Start) - { - Status = RtlAddRange (InvertedRangeList, - Previous->Range.End + 1, - Current->Range.Start - 1, - 0, - 0, - NULL, - NULL); - if (!NT_SUCCESS(Status)) - return Status; - } - } - - Previous = Current; - Entry = Entry->Flink; - } - - /* Add trailing range */ - if (Previous->Range.End + 1 != (ULONGLONG)-1) - { - Status = RtlAddRange (InvertedRangeList, - Previous->Range.End + 1, - (ULONGLONG)-1, - 0, - 0, - NULL, - NULL); - if (!NT_SUCCESS(Status)) - return Status; - } - - return STATUS_SUCCESS; -} - - -/********************************************************************** - * NAME EXPORTED - * RtlIsRangeAvailable - * - * DESCRIPTION - * Checks whether a range is available or not. - * - * ARGUMENTS - * RangeList Pointer to the range list. - * Start - * End - * Flags - * AttributeAvailableMask - * Context - * Callback - * Available - * - * RETURN VALUE - * Status - * - * TODO: - * - honor Flags and AttributeAvailableMask. - * - * @implemented - */ -NTSTATUS STDCALL -RtlIsRangeAvailable (IN PRTL_RANGE_LIST RangeList, - IN ULONGLONG Start, - IN ULONGLONG End, - IN ULONG Flags, - IN UCHAR AttributeAvailableMask, - IN PVOID Context OPTIONAL, - IN PRTL_CONFLICT_RANGE_CALLBACK Callback OPTIONAL, - OUT PBOOLEAN Available) -{ - PRTL_RANGE_ENTRY Current; - PLIST_ENTRY Entry; - - *Available = TRUE; - - Entry = RangeList->ListHead.Flink; - while (Entry != &RangeList->ListHead) - { - Current = CONTAINING_RECORD (Entry, RTL_RANGE_ENTRY, Entry); - if (!((Current->Range.Start > End && Current->Range.End > End) || - (Current->Range.Start < Start && Current->Range.End < Start))) - { - if (Callback != NULL) - { - *Available = Callback (Context, - &Current->Range); - } - else - { - *Available = FALSE; - } - } - - Entry = Entry->Flink; - } - - return STATUS_SUCCESS; -} - - -/********************************************************************** - * NAME EXPORTED - * RtlMergeRangeList - * - * DESCRIPTION - * Merges two range lists. - * - * ARGUMENTS - * MergedRangeList Resulting range list. - * RangeList1 First range list. - * RangeList2 Second range list - * Flags - * - * RETURN VALUE - * Status - * - * @implemented - */ -NTSTATUS STDCALL -RtlMergeRangeLists (OUT PRTL_RANGE_LIST MergedRangeList, - IN PRTL_RANGE_LIST RangeList1, - IN PRTL_RANGE_LIST RangeList2, - IN ULONG Flags) -{ - RTL_RANGE_LIST_ITERATOR Iterator; - PRTL_RANGE Range; - NTSTATUS Status; - - /* Copy range list 1 to the merged range list */ - Status = RtlCopyRangeList (MergedRangeList, - RangeList1); - if (!NT_SUCCESS(Status)) - return Status; - - /* Add range list 2 entries to the merged range list */ - Status = RtlGetFirstRange (RangeList2, - &Iterator, - &Range); - if (!NT_SUCCESS(Status)) - return (Status == STATUS_NO_MORE_ENTRIES) ? STATUS_SUCCESS : Status; - - while (TRUE) - { - Status = RtlAddRange (MergedRangeList, - Range->Start, - Range->End, - Range->Attributes, - Range->Flags | Flags, - Range->UserData, - Range->Owner); - if (!NT_SUCCESS(Status)) - break; - - Status = RtlGetNextRange (&Iterator, - &Range, - TRUE); - if (!NT_SUCCESS(Status)) - break; - } - - return (Status == STATUS_NO_MORE_ENTRIES) ? STATUS_SUCCESS : Status; -} - -/* EOF */ diff --git a/reactos/lib/ntdll/rtl/secobj.c b/reactos/lib/ntdll/rtl/secobj.c deleted file mode 100644 index 0caded262eb..00000000000 --- a/reactos/lib/ntdll/rtl/secobj.c +++ /dev/null @@ -1,97 +0,0 @@ -/* - * ReactOS kernel - * Copyright (C) 2005 Eric Kohl - * - * 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. - */ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS system libraries - * PURPOSE: Security object implementation - * FILE: lib/ntdll/rtl/secobj.c - */ - -/* INCLUDES ****************************************************************/ - -#include -#define NDEBUG -#include - -/* - * @implemented - */ -NTSTATUS -STDCALL -RtlDeleteSecurityObject(IN PSECURITY_DESCRIPTOR *ObjectDescriptor) -{ - DPRINT("RtlDeleteSecurityObject(%p)\n", ObjectDescriptor); - - RtlFreeHeap(RtlGetProcessHeap(), - 0, - *ObjectDescriptor); - - return STATUS_SUCCESS; -} - - -/* - * @unimplemented - */ -NTSTATUS -STDCALL -RtlNewSecurityObject(IN PSECURITY_DESCRIPTOR ParentDescriptor, - IN PSECURITY_DESCRIPTOR CreatorDescriptor, - OUT PSECURITY_DESCRIPTOR *NewDescriptor, - IN BOOLEAN IsDirectoryObject, - IN HANDLE Token, - IN PGENERIC_MAPPING GenericMapping) -{ - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; -} - - -/* - * @unimplemented - */ -NTSTATUS -STDCALL -RtlQuerySecurityObject(IN PSECURITY_DESCRIPTOR ObjectDescriptor, - IN SECURITY_INFORMATION SecurityInformation, - OUT PSECURITY_DESCRIPTOR ResultantDescriptor, - IN ULONG DescriptorLength, - OUT PULONG ReturnLength) -{ - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; -} - - -/* - * @unimplemented - */ -NTSTATUS -STDCALL -RtlSetSecurityObject(IN SECURITY_INFORMATION SecurityInformation, - IN PSECURITY_DESCRIPTOR ModificationDescriptor, - OUT PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor, - IN PGENERIC_MAPPING GenericMapping, - IN HANDLE Token) -{ - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; -} - -/* EOF */ diff --git a/reactos/lib/ntdll/rtl/teb.c b/reactos/lib/ntdll/rtl/teb.c deleted file mode 100644 index cdcd2552e71..00000000000 --- a/reactos/lib/ntdll/rtl/teb.c +++ /dev/null @@ -1,19 +0,0 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: lib/ntdll/csr/teb.c - * PURPOSE: - */ - -#include -#define NDEBUG -#include - - -PTEB STDCALL -_NtCurrentTeb() { return NtCurrentTeb(); } - - - -/* EOF */ diff --git a/reactos/lib/ntdll/rtl/trace.c b/reactos/lib/ntdll/rtl/trace.c deleted file mode 100644 index 2ca056a2e8c..00000000000 --- a/reactos/lib/ntdll/rtl/trace.c +++ /dev/null @@ -1,124 +0,0 @@ -/* - * ReactOS kernel - * Copyright (C) 2000 David Welch - * - * 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$ - * - * PROJECT: ReactOS kernel - * PURPOSE: Tracing library calls - * FILE: lib/ntdll/rtl/trace.c - * PROGRAMER: David Welch - */ - -/* INCLUDES *****************************************************************/ - -#include -#define NDEBUG -#include - -/* GLOBALS *******************************************************************/ - -static NTDLL_TRACE_TABLE TraceTable; -static BOOLEAN TraceTableValid = FALSE; - -/* FUNCTIONS *****************************************************************/ - -NTSTATUS -RtlpInitTrace(VOID) -{ - HANDLE SectionHandle; - UNICODE_STRING SectionName; - OBJECT_ATTRIBUTES ObjectAttributes; - CHAR Buffer[4096]; - NTSTATUS Status; - PROCESS_BASIC_INFORMATION Pbi; - ULONG ReturnedSize; - PVOID BaseAddress; - LARGE_INTEGER Offset; - ULONG ViewSize; - - Status = NtQueryInformationProcess(NtCurrentProcess(), - ProcessBasicInformation, - (PVOID)&Pbi, - sizeof(Pbi), - &ReturnedSize); - if (!NT_SUCCESS(Status)) - { - return(Status); - } - - sprintf(Buffer, "\\??\\TraceSection%d", Pbi.UniqueProcessId); - - InitializeObjectAttributes(&ObjectAttributes, - &SectionName, - 0, - NULL, - NULL); - Status = NtOpenSection(&SectionHandle, - SECTION_MAP_READ, - &ObjectAttributes); - if (!NT_SUCCESS(Status)) - { - return(Status); - } - - BaseAddress = 0; - Offset.QuadPart = 0; - ViewSize = 0; - Status = NtMapViewOfSection(SectionHandle, - NtCurrentProcess(), - &BaseAddress, - 0, - sizeof(NTDLL_TRACE_TABLE), - &Offset, - &ViewSize, - ViewUnmap, - 0, - PAGE_READONLY); - if (!NT_SUCCESS(Status)) - { - NtClose(SectionHandle); - return(Status); - } - NtClose(SectionHandle); - - memcpy(&TraceTable, BaseAddress, sizeof(TraceTable)); - TraceTableValid = TRUE; - - Status = NtUnmapViewOfSection(NtCurrentProcess(), BaseAddress); - - return(STATUS_SUCCESS); -} - -VOID -RtlPrintTrace(ULONG Flag, PCH Format, ...) -{ - va_list ap; - CHAR FString[4096]; - - if (!TraceTableValid) - { - return; - } - if (TraceTable.Flags[Flag / BITS_IN_CHAR] & (1 << (Flag % BITS_IN_CHAR))) - { - va_start(ap, Format); - vsprintf(FString, Format, ap); - DbgPrint(FString); - va_end(ap); - } -} diff --git a/reactos/lib/ntdll/rtl/process.c b/reactos/lib/ntdll/rtl/version.c similarity index 53% rename from reactos/lib/ntdll/rtl/process.c rename to reactos/lib/ntdll/rtl/version.c index f689f2bef32..70c11c44fa6 100644 --- a/reactos/lib/ntdll/rtl/process.c +++ b/reactos/lib/ntdll/rtl/version.c @@ -17,36 +17,87 @@ /* FUNCTIONS ****************************************************************/ - -PPEB -STDCALL -RtlpCurrentPeb(VOID) -{ - return NtCurrentPeb(); -} - - -/* +/********************************************************************** + * NAME EXPORTED + * RtlGetNtProductType + * + * DESCRIPTION + * Retrieves the OS product type. + * + * ARGUMENTS + * ProductType Pointer to the product type variable. + * + * RETURN VALUE + * TRUE if successful, otherwise FALSE + * + * NOTE + * ProductType can be one of the following values: + * 1 Workstation (Winnt) + * 2 Server (Lanmannt) + * 3 Advanced Server (Servernt) + * + * REVISIONS + * 2000-08-10 ekohl + * * @implemented */ -VOID STDCALL -RtlAcquirePebLock(VOID) + +BOOLEAN STDCALL +RtlGetNtProductType(PNT_PRODUCT_TYPE ProductType) { - PPEB Peb = NtCurrentPeb (); - Peb->FastPebLockRoutine (Peb->FastPebLock); + *ProductType = SharedUserData->NtProductType; + return(TRUE); } - -/* +/********************************************************************** + * NAME EXPORTED + * RtlGetNtVersionNumbers + * + * DESCRIPTION + * Get the version numbers of the run time library. + * + * ARGUMENTS + * major [OUT] Destination for the Major version + * minor [OUT] Destination for the Minor version + * build [OUT] Destination for the Build version + * + * RETURN VALUE + * Nothing. + * + * NOTE + * Introduced in Windows XP (NT5.1) + * * @implemented */ -VOID STDCALL -RtlReleasePebLock(VOID) -{ - PPEB Peb = NtCurrentPeb (); - Peb->FastPebUnlockRoutine (Peb->FastPebLock); -} +void STDCALL +RtlGetNtVersionNumbers(LPDWORD major, LPDWORD minor, LPDWORD build) +{ + PPEB pPeb = NtCurrentPeb(); + + if (major) + { + /* msvcrt.dll as released with XP Home fails in DLLMain() if the + * major version is not 5. So, we should never set a version < 5 ... + * This makes sense since this call didn't exist before XP anyway. + */ + *major = pPeb->OSMajorVersion < 5 ? 5 : pPeb->OSMajorVersion; + } + + if (minor) + { + if (pPeb->OSMinorVersion <= 5) + *minor = pPeb->OSMinorVersion < 1 ? 1 : pPeb->OSMinorVersion; + else + *minor = pPeb->OSMinorVersion; + } + + if (build) + { + /* FIXME: Does anybody know the real formula? */ + *build = (0xF0000000 | pPeb->OSBuildNumber); + } +} /* * @implemented @@ -90,19 +141,4 @@ RtlGetVersion(RTL_OSVERSIONINFOW *Info) return STATUS_INVALID_PARAMETER; } -/* - * @implemented - */ -VOID -STDCALL -RtlExitUserThread(NTSTATUS Status) -{ - /* Call the Loader and tell him to notify the DLLs */ - LdrShutdownThread(); - - /* Shut us down */ - NtCurrentTeb()->FreeStackOnTermination = TRUE; - NtTerminateThread(NtCurrentThread(), Status); -} - /* EOF */ diff --git a/reactos/lib/rtl/access.c b/reactos/lib/rtl/access.c index c7cfb3ebe0c..96a677c9939 100644 --- a/reactos/lib/rtl/access.c +++ b/reactos/lib/rtl/access.c @@ -1,9 +1,7 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel +/* COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries * FILE: lib/rtl/access.c * PURPOSE: Access rights handling functions - * * PROGRAMMERS: Eric Kohl */ diff --git a/reactos/lib/rtl/acl.c b/reactos/lib/rtl/acl.c index 180dda829bd..1f7e99bfab7 100644 --- a/reactos/lib/rtl/acl.c +++ b/reactos/lib/rtl/acl.c @@ -1,12 +1,8 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * PURPOSE: Security manager - * FILE: lib/rtl/acl.c - * PROGRAMER: David Welch - * REVISION HISTORY: - * 26/07/98: Added stubs for security functions +/* COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * PURPOSE: Security manager + * FILE: lib/rtl/acl.c + * PROGRAMER: David Welch */ /* INCLUDES *****************************************************************/ diff --git a/reactos/lib/rtl/apc.c b/reactos/lib/rtl/apc.c new file mode 100644 index 00000000000..a2ffb28ea0f --- /dev/null +++ b/reactos/lib/rtl/apc.c @@ -0,0 +1,37 @@ +/* COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * PURPOSE: User-mode APC support + * FILE: lib/rtl/apc.c + * PROGRAMER: David Welch + */ + +/* INCLUDES *****************************************************************/ + +#include + +#define NDEBUG +#include + +/* FUNCTIONS ****************************************************************/ + +VOID STDCALL +KiUserApcDispatcher(PIO_APC_ROUTINE ApcRoutine, + PVOID ApcContext, + PIO_STATUS_BLOCK Iosb, + ULONG Reserved, + PCONTEXT Context) +{ + /* + * Call the APC + */ + //DPRINT1("ITS ME\n"); + ApcRoutine(ApcContext, + Iosb, + Reserved); + /* + * Switch back to the interrupted context + */ + //DPRINT1("switch back\n"); + NtContinue(Context, 1); +} + diff --git a/reactos/lib/rtl/atom.c b/reactos/lib/rtl/atom.c index 0c777ca40ff..1720e64666e 100644 --- a/reactos/lib/rtl/atom.c +++ b/reactos/lib/rtl/atom.c @@ -1,12 +1,8 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel +/* COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries * FILE: lib/rtl/atom.c * PURPOSE: Atom managment - * PROGRAMMER: Nobody - * UPDATE HISTORY: - * Created 22/05/98 + * PROGRAMMER: Thomas Weidenmueller */ /* INCLUDES *****************************************************************/ diff --git a/reactos/lib/rtl/bit.c b/reactos/lib/rtl/bit.c index 9ce83aa0ee0..23519445cad 100644 --- a/reactos/lib/rtl/bit.c +++ b/reactos/lib/rtl/bit.c @@ -1,27 +1,7 @@ -/* - * 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$ - * - * PROJECT: ReactOS kernel - * PURPOSE: Runtime code - * FILE: lib/rtl/bit.c - * PROGRAMER: Eric Kohl +/* COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: lib/rtl/bit.c + * PROGRAMER: Eric Kohl */ /* INCLUDES *****************************************************************/ @@ -31,7 +11,6 @@ #define NDEBUG #include - /* FUNCTIONS ****************************************************************/ /* diff --git a/reactos/lib/rtl/bitmap.c b/reactos/lib/rtl/bitmap.c index c2b1adc4f66..cb41c7de5c2 100644 --- a/reactos/lib/rtl/bitmap.c +++ b/reactos/lib/rtl/bitmap.c @@ -1,29 +1,8 @@ -/* - * ReactOS kernel - * Copyright (C) 1999-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$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel +/* COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries * FILE: lib/rtl/bitmap.c * PURPOSE: Bitmap functions - * UPDATE HISTORY: - * 20/08/99 Created by Eric Kohl + * PROGRAMMER: Eric Kohl */ /* INCLUDES *****************************************************************/ diff --git a/reactos/lib/rtl/bootdata.c b/reactos/lib/rtl/bootdata.c index d4c511157be..1c5a339fb40 100644 --- a/reactos/lib/rtl/bootdata.c +++ b/reactos/lib/rtl/bootdata.c @@ -1,29 +1,12 @@ -/* - * ReactOS kernel - * Copyright (C) 2003 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$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS system libraries - * PURPOSE: Boot Data implementation - * FILE: lib/rtl/bootdata.c +/* COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * PURPOSE: Boot Data implementation + * FILE: lib/rtl/bootdata.c + * PROGRAMMERS: */ +/* INCLUDES *****************************************************************/ + #include #define NDEBUG diff --git a/reactos/lib/ntdll/rtl/callback.c b/reactos/lib/rtl/callback.c similarity index 68% rename from reactos/lib/ntdll/rtl/callback.c rename to reactos/lib/rtl/callback.c index c9806ef58ff..5bdeda91456 100644 --- a/reactos/lib/ntdll/rtl/callback.c +++ b/reactos/lib/rtl/callback.c @@ -1,18 +1,18 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * PURPOSE: User-mode callback support - * FILE: lib/ntdll/rtl/callback.c - * PROGRAMER: David Welch +/* COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * PURPOSE: User-mode callback support + * FILE: lib/rtl/callback.c + * PROGRAMER: David Welch */ /* INCLUDES *****************************************************************/ -#include +#include + #define NDEBUG #include -/* TYPES *********************************************************************/ + +/* FUNCTIONS *****************************************************************/ typedef NTSTATUS (STDCALL *KERNEL_CALLBACK_FUNCTION)(PVOID Argument, ULONG ArgumentLength); diff --git a/reactos/lib/rtl/compress.c b/reactos/lib/rtl/compress.c index 61adaacaf18..fbee7827eb1 100644 --- a/reactos/lib/rtl/compress.c +++ b/reactos/lib/rtl/compress.c @@ -1,28 +1,8 @@ -/* - * ReactOS kernel - * Copyright (C) 2002 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$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * PURPOSE: Compression and decompression functions - * FILE: lib/rtl/compress.c - * PROGRAMER: Eric Kohl (ekohl@rz-online.de) +/* COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * PURPOSE: Compression and decompression functions + * FILE: lib/rtl/compress.c + * PROGRAMER: Eric Kohl (ekohl@rz-online.de) */ /* INCLUDES *****************************************************************/ diff --git a/reactos/lib/ntdll/rtl/crc32.c b/reactos/lib/rtl/crc32.c similarity index 93% rename from reactos/lib/ntdll/rtl/crc32.c rename to reactos/lib/rtl/crc32.c index c23f21e0869..4babe50db56 100644 --- a/reactos/lib/ntdll/rtl/crc32.c +++ b/reactos/lib/rtl/crc32.c @@ -1,11 +1,8 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * PURPOSE: crc32 functions - * FILE: lib/ntdll/rtl/crc32.c - * PROGRAMER: Steven Edwards - * REVISION HISTORY: - * 11/15/2000: Created +/* COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * PURPOSE: crc32 functions + * FILE: lib/rtl/crc32.c + * PROGRAMER: Steven Edwards */ /* This work is based off of rtl.c in Wine. @@ -17,10 +14,12 @@ /* INCLUDES *****************************************************************/ -#include +#include + #define NDEBUG #include -/* FUNCTIONS ****************************************************************/ + +/* FUNCTIONS *****************************************************************/ /* CRC polynomial 0xedb88320 */ static const ULONG CrcTable[256] = diff --git a/reactos/lib/ntdll/rtl/dbgbuffer.c b/reactos/lib/rtl/dbgbuffer.c similarity index 89% rename from reactos/lib/ntdll/rtl/dbgbuffer.c rename to reactos/lib/rtl/dbgbuffer.c index a1bb4aa2f45..a88fc849ce5 100644 --- a/reactos/lib/ntdll/rtl/dbgbuffer.c +++ b/reactos/lib/rtl/dbgbuffer.c @@ -1,41 +1,17 @@ -/* - * 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. - */ -/* - * - * PROJECT: ReactOS kernel - * PURPOSE: User-mode Debug Buffer support - * FILE: lib/ntdll/rtl/dbgbuffer.c - * PROGRAMER: James Tabor - * Fixme: Add Process and Thread event pair support. - * Start Locks and Heap support. - * Test: Create remote thread to help query remote - * processes and use view mapping to read them. - * +/* COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: lib/rtl/dbgbuffer.c + * PROGRAMER: James Tabor */ /* INCLUDES *****************************************************************/ -#include +#include + #define NDEBUG #include -/* FUNCTIONS ***************************************************************/ +/* FUNCTIONS *****************************************************************/ /* * @unimplemented diff --git a/reactos/lib/rtl/dos8dot3.c b/reactos/lib/rtl/dos8dot3.c index 9ee616fdf3a..358d88d7be4 100644 --- a/reactos/lib/rtl/dos8dot3.c +++ b/reactos/lib/rtl/dos8dot3.c @@ -1,25 +1,5 @@ -/* - * ReactOS kernel - * Copyright (C) 2002 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$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel +/* COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries * FILE: lib/rtl/dos8dot3.c * PURPOSE: Short name (8.3 name) functions * PROGRAMMER: Eric Kohl diff --git a/reactos/lib/rtl/encode.c b/reactos/lib/rtl/encode.c index 2165f3a2ac8..f6be26cd87a 100644 --- a/reactos/lib/rtl/encode.c +++ b/reactos/lib/rtl/encode.c @@ -1,13 +1,9 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * PURPOSE: Security descriptor functions - * FILE: lib/rtl/encode.c - * PROGRAMMER: KJK::Hyperion - * REVISION HISTORY: - * 02/04/2003: created (code contributed by crazylord - * ) +/* COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * PURPOSE: Security descriptor functions + * FILE: lib/rtl/encode.c + * PROGRAMMER: KJK::Hyperion + * (code contributed by crazylord ) */ /* INCLUDES *****************************************************************/ diff --git a/reactos/lib/rtl/env.c b/reactos/lib/rtl/env.c index 193c7d3760a..8a3a60a1349 100644 --- a/reactos/lib/rtl/env.c +++ b/reactos/lib/rtl/env.c @@ -1,12 +1,8 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory +/* COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries * FILE: lib/rtl/env.c * PURPOSE: Environment functions * PROGRAMMER: Eric Kohl - * UPDATE HISTORY: - * Created 30/09/98 */ /* INCLUDES ******************************************************************/ diff --git a/reactos/lib/rtl/error.c b/reactos/lib/rtl/error.c index bb676feefcc..00b87a9b35d 100644 --- a/reactos/lib/rtl/error.c +++ b/reactos/lib/rtl/error.c @@ -1,14 +1,8 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * PURPOSE: Rtl error functions - * FILE: lib/rtl/error.c - * PROGRAMER: Eric Kohl - * REVISION HISTORY: - * 22/07/99: Added RtlNtStatusToDosError. - * 1999-11-30: Added RtlNtStatusToPsxErrno. - * 1999-12-18: STDCALL RtlNtStatusToDosError +/* COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * PURPOSE: Rtl error functions + * FILE: lib/rtl/error.c + * PROGRAMER: Eric Kohl */ /* diff --git a/reactos/lib/rtl/exception.c b/reactos/lib/rtl/exception.c index 5a822b9fecb..49a1ccf6b44 100644 --- a/reactos/lib/rtl/exception.c +++ b/reactos/lib/rtl/exception.c @@ -1,16 +1,10 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * PURPOSE: User-mode exception support - * FILE: lib/ntdll/rtl/exception.c - * PROGRAMERS: David Welch - * Skywing - * KJK::Hyperion - * UPDATES: Skywing, 09/11/2003: Implemented RtlRaiseException and - * KiUserRaiseExceptionDispatcher. - * KJK::Hyperion, 22/06/2004: Moved the common parts here, - * left the user-mode code in ntdll +/* COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * PURPOSE: User-mode exception support + * FILE: lib/rtl/exception.c + * PROGRAMERS: David Welch + * Skywing + * KJK::Hyperion */ /* INCLUDES *****************************************************************/ diff --git a/reactos/lib/rtl/generictable.c b/reactos/lib/rtl/generictable.c index 342169ee775..c0e17cfa201 100644 --- a/reactos/lib/rtl/generictable.c +++ b/reactos/lib/rtl/generictable.c @@ -1,29 +1,12 @@ -/* - * ReactOS kernel - * Copyright (C) 2003 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$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS system libraries - * PURPOSE: Generic Table Implementation - * FILE: lib/rtl/genertictbl.c +/* COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * PURPOSE: Generic Table Implementation + * FILE: lib/rtl/genertictbl.c + * PROGRAMMERS: */ +/* INCLUDES *****************************************************************/ + #include #define NDEBUG diff --git a/reactos/lib/ntdll/rtl/handle.c b/reactos/lib/rtl/handle.c similarity index 92% rename from reactos/lib/ntdll/rtl/handle.c rename to reactos/lib/rtl/handle.c index 3c6ba273e04..9d77efc4ba9 100644 --- a/reactos/lib/ntdll/rtl/handle.c +++ b/reactos/lib/rtl/handle.c @@ -1,19 +1,18 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * PURPOSE: Handle table - * FILE: lib/ntdll/rtl/handle.c - * PROGRAMER: Eric Kohl +/* COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * PURPOSE: Handle table + * FILE: lib/rtl/handle.c + * PROGRAMER: Eric Kohl */ -/* INCLUDES ******************************************************************/ +/* INCLUDES *****************************************************************/ + +#include -#include #define NDEBUG #include -/* FUNCTIONS *****************************************************************/ +/* GLOBALS ******************************************************************/ VOID STDCALL RtlInitializeHandleTable(ULONG TableSize, diff --git a/reactos/lib/rtl/heap.c b/reactos/lib/rtl/heap.c index 428ddee88a4..d14e843052a 100644 --- a/reactos/lib/rtl/heap.c +++ b/reactos/lib/rtl/heap.c @@ -1,22 +1,26 @@ -/* - * Win32 heap functions - * - * Copyright 1996 Alexandre Julliard - * Copyright 1998 Ulrich Weigand +/* COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: lib/rtl/image.c + * PURPOSE: Image handling functions + * PROGRAMMERS: Copyright 1996 Alexandre Julliard + * Copyright 1998 Ulrich Weigand */ - /* Note: the heap data structures are based on what Pietrek describes in his * book 'Windows 95 System Programming Secrets'. The layout is not exactly * the same, but could be easily adapted if it turns out some programs * require it. */ +/* INCLUDES *****************************************************************/ + #include #define NDEBUG #include +/* FUNCTIONS *****************************************************************/ + #define WARN_ON(x) (1) #ifdef NDEBUG diff --git a/reactos/lib/rtl/image.c b/reactos/lib/rtl/image.c index 3c7ea4a6426..9d14b4947ba 100644 --- a/reactos/lib/rtl/image.c +++ b/reactos/lib/rtl/image.c @@ -1,20 +1,18 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: lib/ntdll/rtl/image.c +/* COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: lib/rtl/image.c * PURPOSE: Image handling functions * PROGRAMMER: Eric Kohl - * UPDATE HISTORY: - * 17/03/2000 Created */ +/* INCLUDES *****************************************************************/ + #include #define NDEBUG #include -/* FUNCTIONS ****************************************************************/ +/* FUNCTIONS *****************************************************************/ /* * @implemented diff --git a/reactos/lib/rtl/largeint.c b/reactos/lib/rtl/largeint.c index f8c38e8f801..2c7bdbbb49b 100644 --- a/reactos/lib/rtl/largeint.c +++ b/reactos/lib/rtl/largeint.c @@ -1,12 +1,8 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel +/* COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries * FILE: lib/rtl/largeint.c * PURPOSE: Large integer operations - * UPDATE HISTORY: - * Created 22/05/98 - * 08/30/98 RJJ Implemented several functions + * PROGRAMMERS: */ /* INCLUDES *****************************************************************/ @@ -17,7 +13,6 @@ #define NDEBUG #include - /* FUNCTIONS *****************************************************************/ /* diff --git a/reactos/lib/rtl/luid.c b/reactos/lib/rtl/luid.c index 5353a95cb5f..612231462ea 100644 --- a/reactos/lib/rtl/luid.c +++ b/reactos/lib/rtl/luid.c @@ -1,12 +1,8 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * PURPOSE: Locally unique identifier (LUID) helper functions - * FILE: lib/rtl/luid.c - * PROGRAMER: Eric Kohl - * REVISION HISTORY: - * 15/04/2000: Created +/* COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * PURPOSE: Locally unique identifier (LUID) helper functions + * FILE: lib/rtl/luid.c + * PROGRAMER: Eric Kohl */ /* INCLUDES *****************************************************************/ diff --git a/reactos/lib/ntdll/rtl/math.c b/reactos/lib/rtl/math.c similarity index 78% rename from reactos/lib/ntdll/rtl/math.c rename to reactos/lib/rtl/math.c index 364111f2770..86c789f6963 100644 --- a/reactos/lib/ntdll/rtl/math.c +++ b/reactos/lib/rtl/math.c @@ -1,26 +1,20 @@ -/* Math functions for i387. - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by John C. Bowman , 1995. +/* COPYRIGHT: See COPYING in the top level directory + * Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + * PROJECT: ReactOS system libraries + * FILE: lib/rtl/math.c + * PURPOSE: Math functions for i387. + * PROGRAMMER: John C. Bowman + */ - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. +/* INCLUDES *****************************************************************/ - The GNU C 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 - Library General Public License for more details. +#include - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ -#include #define NDEBUG #include +/* FUNCTIONS *****************************************************************/ + double atan (double __x); double ceil (double __x); double cos (double __x); diff --git a/reactos/lib/rtl/mem.c b/reactos/lib/rtl/mem.c index f64fd49699a..746253adac4 100644 --- a/reactos/lib/rtl/mem.c +++ b/reactos/lib/rtl/mem.c @@ -1,13 +1,8 @@ - -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel +/* COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries * FILE: lib/rtl/mem.c * PURPOSE: Memory functions * PROGRAMMER: David Welch (welch@mcmail.com) - * UPDATE HISTORY: - * Created 22/05/98 */ /* INCLUDES *****************************************************************/ @@ -17,9 +12,6 @@ #define NDEBUG #include - - - /* FUNCTIONS *****************************************************************/ /****************************************************************************** diff --git a/reactos/lib/ntdll/rtl/message.c b/reactos/lib/rtl/message.c similarity index 92% rename from reactos/lib/ntdll/rtl/message.c rename to reactos/lib/rtl/message.c index 2467e353c93..e6a74662a36 100644 --- a/reactos/lib/ntdll/rtl/message.c +++ b/reactos/lib/rtl/message.c @@ -1,17 +1,14 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * PURPOSE: Message table functions - * FILE: lib/ntdll/rtl/message.c - * PROGRAMER: Eric Kohl - * REVISION HISTORY: - * 29/05/2001: Created +/* COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: lib/rtl/message.c + * PURPOSE: Message table functions + * PROGRAMMERS: Eric Kohl */ /* INCLUDES *****************************************************************/ -#include +#include + #define NDEBUG #include diff --git a/reactos/lib/rtl/network.c b/reactos/lib/rtl/network.c index 376ac34e189..d799280cb0e 100644 --- a/reactos/lib/rtl/network.c +++ b/reactos/lib/rtl/network.c @@ -1,34 +1,18 @@ /* - * ReactOS kernel - * Copyright (C) 2003 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$ - * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries * PURPOSE: Network Address Translation implementation - * FILE: lib/rtl/network.c + * PROGRAMMER: */ +/* INCLUDES *****************************************************************/ + #include #define NDEBUG #include -/* FUNCTIONS *****************************************************************/ + +/* FUNCTIONS ***************************************************************/ /* Borrow this from some headers... */ typedef struct diff --git a/reactos/lib/rtl/nls.c b/reactos/lib/rtl/nls.c index 322a9453850..0a1fb134278 100644 --- a/reactos/lib/rtl/nls.c +++ b/reactos/lib/rtl/nls.c @@ -1,17 +1,12 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: lib/rtl/nls.c - * PURPOSE: National Language Support (NLS) functions - * UPDATE HISTORY: - * 20/08/99 Created by Emanuele Aliberti - * 10/11/99 Added translation functions. - * - * TODO: - * 1) Add multi-byte translation code. +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: lib/rtl/nls.c + * PURPOSE: National Language Support (NLS) functions + * PROGRAMMERS: Emanuele Aliberti */ +/* INCLUDES *****************************************************************/ #include @@ -38,18 +33,10 @@ PCHAR NlsUnicodeToOemTable =NULL; PWCHAR NlsDbcsUnicodeToOemTable = NULL; PUSHORT NlsOemLeadByteInfo = NULL; /* exported */ - - - #define INIT_FUNCTION /* FUNCTIONS *****************************************************************/ - - - - - /* * @unimplemented */ diff --git a/reactos/lib/rtl/ppb.c b/reactos/lib/rtl/ppb.c index ca4497a3cbb..6c7993093eb 100644 --- a/reactos/lib/rtl/ppb.c +++ b/reactos/lib/rtl/ppb.c @@ -1,12 +1,9 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS system libraries - * FILE: lib/ntdll/rtl/ppb.c - * PURPOSE: Process parameters functions - * PROGRAMMER: Ariadne ( ariadne@xs4all.nl) - * UPDATE HISTORY: - * Created 01/11/98 +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: lib/rtl/ppb.c + * PURPOSE: Process parameters functions + * PROGRAMMER: Ariadne ( ariadne@xs4all.nl) */ /* INCLUDES ****************************************************************/ diff --git a/reactos/lib/rtl/process.c b/reactos/lib/rtl/process.c index 60ab038a2b0..1f41aa5fdd4 100644 --- a/reactos/lib/rtl/process.c +++ b/reactos/lib/rtl/process.c @@ -1,12 +1,10 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS system libraries - * FILE: lib/ntdll/rtl/process.c - * PURPOSE: Process functions - * PROGRAMMER: Ariadne ( ariadne@xs4all.nl) - * UPDATE HISTORY: - * Created 01/11/98 +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: lib/rtl/process.c + * PURPOSE: Process functions + * PROGRAMMER: Alex Ionescu (alex@relsoft.net) + * Ariadne (ariadne@xs4all.nl) */ /* INCLUDES ****************************************************************/ @@ -317,4 +315,29 @@ RtlCreateUserProcess(IN PUNICODE_STRING ImageFileName, return STATUS_SUCCESS; } +/* + * @implemented + */ +PVOID +STDCALL +RtlEncodePointer(IN PVOID Pointer) +{ + ULONG Cookie; + NTSTATUS Status; + + Status = NtQueryInformationProcess(NtCurrentProcess(), + ProcessCookie, + &Cookie, + sizeof(Cookie), + NULL); + + if(!NT_SUCCESS(Status)) + { + DPRINT1("Failed to receive the process cookie! Status: 0x%x\n", Status); + return Pointer; + } + + return (PVOID)((ULONG_PTR)Pointer ^ Cookie); +} + /* EOF */ diff --git a/reactos/lib/ntdll/rtl/propvar.c b/reactos/lib/rtl/propvar.c similarity index 64% rename from reactos/lib/ntdll/rtl/propvar.c rename to reactos/lib/rtl/propvar.c index 38b7d595eb3..38091678e50 100644 --- a/reactos/lib/ntdll/rtl/propvar.c +++ b/reactos/lib/rtl/propvar.c @@ -1,14 +1,20 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: lib/ntdll/csr/propvar.c - * PURPOSE: CSRSS properties and variants API +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: lib/rtl/propvar.c + * PURPOSE: Native properties and variants API + * PROGRAMMER: */ -#include + +/* INCLUDES *****************************************************************/ + +#include + #define NDEBUG #include +/* FUNCTIONS ***************************************************************/ + /* * @unimplemented */ diff --git a/reactos/lib/rtl/qsort.c b/reactos/lib/rtl/qsort.c index 77549202abf..d91a4f6c5e3 100644 --- a/reactos/lib/rtl/qsort.c +++ b/reactos/lib/rtl/qsort.c @@ -1,52 +1,6 @@ -/* $Id: qsort.c 12852 2005-01-06 13:58:04Z mf $ - * - * FILE: ntoskrnl/rtl/qsort.c - * NOTE: Adapted from CygWin newlib 2000-03-12. - */ /* -FUNCTION -<>---sort an array - -INDEX - qsort - -ANSI_SYNOPSIS - #include - void qsort(void *<[base]>, size_t <[nmemb]>, size_t <[size]>, - int (*<[compar]>)(const void *, const void *) ); - -TRAD_SYNOPSIS - #include - qsort(<[base]>, <[nmemb]>, <[size]>, <[compar]> ) - char *<[base]>; - size_t <[nmemb]>; - size_t <[size]>; - int (*<[compar]>)(); - -DESCRIPTION -<> sorts an array (beginning at <[base]>) of <[nmemb]> objects. -<[size]> describes the size of each element of the array. - -You must supply a pointer to a comparison function, using the argument -shown as <[compar]>. (This permits sorting objects of unknown -properties.) Define the comparison function to accept two arguments, -each a pointer to an element of the array starting at <[base]>. The -result of <<(*<[compar]>)>> must be negative if the first argument is -less than the second, zero if the two arguments match, and positive if -the first argument is greater than the second (where ``less than'' and -``greater than'' refer to whatever arbitrary ordering is appropriate). - -The array is sorted in place; that is, when <> returns, the -array elements beginning at <[base]> have been reordered. - -RETURNS -<> does not return a result. - -PORTABILITY -<> is required by ANSI (without specifying the sorting algorithm). -*/ - -/*- + * COPYRIGHT: + *- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * @@ -77,6 +31,11 @@ PORTABILITY * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * PROJECT: ReactOS system libraries + * PURPOSE: Unicode Conversion Routines + * FILE: lib/rtl/qsort.c + * PROGRAMMER: Adapted from CygWin newlib 2000-03-12. */ #ifndef __GNUC__ diff --git a/reactos/lib/rtl/random.c b/reactos/lib/rtl/random.c index 449cc0a251b..3bfe4f46fea 100644 --- a/reactos/lib/rtl/random.c +++ b/reactos/lib/rtl/random.c @@ -1,27 +1,9 @@ /* - * ReactOS kernel - * Copyright (C) 2003 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$ - * * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel + * PROJECT: ReactOS system libraries * PURPOSE: Random number generator functions * FILE: lib/rtl/random.c + * PROGRAMMER: */ /* INCLUDES *****************************************************************/ diff --git a/reactos/ntoskrnl/rtl/rangelist.c b/reactos/lib/rtl/rangelist.c similarity index 95% rename from reactos/ntoskrnl/rtl/rangelist.c rename to reactos/lib/rtl/rangelist.c index 95965486531..6956786bdfc 100644 --- a/reactos/ntoskrnl/rtl/rangelist.c +++ b/reactos/lib/rtl/rangelist.c @@ -1,23 +1,24 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/rtl/rangelist.c - * PURPOSE: Range list implementation - * - * PROGRAMMERS: No programmer listed. +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: lib/rtl/rangelist.c + * PURPOSE: Range list implementation + * PROGRAMMERS: No programmer listed. */ -/* INCLUDES ****************************************************************/ +/* INCLUDES *****************************************************************/ + +#include -#include #define NDEBUG -#include +#include + +/* TYPES ********************************************************************/ typedef struct _RTL_RANGE_ENTRY { - LIST_ENTRY Entry; - RTL_RANGE Range; + LIST_ENTRY Entry; + RTL_RANGE Range; } RTL_RANGE_ENTRY, *PRTL_RANGE_ENTRY; /* FUNCTIONS ***************************************************************/ @@ -64,8 +65,7 @@ RtlAddRange (IN OUT PRTL_RANGE_LIST RangeList, return STATUS_INVALID_PARAMETER; /* Create new range entry */ - RangeEntry = ExAllocatePool (PagedPool, - sizeof(RTL_RANGE_ENTRY)); + RangeEntry = RtlpAllocateMemory(sizeof(RTL_RANGE_ENTRY), 0); if (RangeEntry == NULL) return STATUS_INSUFFICIENT_RESOURCES; @@ -120,7 +120,7 @@ RtlAddRange (IN OUT PRTL_RANGE_LIST RangeList, return STATUS_SUCCESS; } - ExFreePool (RangeEntry); + RtlpFreeMemory(RangeEntry, 0); return STATUS_UNSUCCESSFUL; } @@ -157,8 +157,7 @@ RtlCopyRangeList (OUT PRTL_RANGE_LIST CopyRangeList, { Current = CONTAINING_RECORD (Entry, RTL_RANGE_ENTRY, Entry); - NewEntry = ExAllocatePool (PagedPool, - sizeof(RTL_RANGE_ENTRY)); + NewEntry = RtlpAllocateMemory(sizeof(RTL_RANGE_ENTRY), 0); if (NewEntry == NULL) return STATUS_INSUFFICIENT_RESOURCES; @@ -211,7 +210,7 @@ RtlDeleteOwnersRanges (IN OUT PRTL_RANGE_LIST RangeList, if (Current->Range.Owner == Owner) { RemoveEntryList (Entry); - ExFreePool (Current); + RtlpFreeMemory(Current, 0); RangeList->Count--; RangeList->Stamp++; @@ -261,7 +260,7 @@ RtlDeleteRange (IN OUT PRTL_RANGE_LIST RangeList, { RemoveEntryList (Entry); - ExFreePool (Current); + RtlpFreeMemory(Current, 0); RangeList->Count--; RangeList->Stamp++; @@ -414,7 +413,7 @@ RtlFreeRangeList (IN PRTL_RANGE_LIST RangeList) DPRINT ("Range start: %I64u\n", Current->Range.Start); DPRINT ("Range end: %I64u\n", Current->Range.End); - ExFreePool (Current); + RtlpFreeMemory(Current, 0); } RangeList->Flags = 0; diff --git a/reactos/lib/rtl/registry.c b/reactos/lib/rtl/registry.c index 34b922a218c..e4a23423744 100644 --- a/reactos/lib/rtl/registry.c +++ b/reactos/lib/rtl/registry.c @@ -1,12 +1,9 @@ -/* $Id$ - * +/* * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel + * PROJECT: ReactOS system libraries * PURPOSE: Rtl registry functions * FILE: lib/rtl/registry.c * PROGRAMER: Eric Kohl - * REVISION HISTORY: - * 2000/08/11: Created */ /* @@ -15,9 +12,8 @@ * - support RTL_QUERY_REGISTRY_DELETE */ -/* INCLUDES ****************************************************************/ +/* INCLUDES *****************************************************************/ -#define __NTDRIVER__ #include #define NDEBUG @@ -25,7 +21,6 @@ #define TAG_RTLREGISTRY TAG('R', 't', 'l', 'R') - /* FUNCTIONS ***************************************************************/ static NTSTATUS diff --git a/reactos/lib/ntdll/rtl/resource.c b/reactos/lib/rtl/resource.c similarity index 91% rename from reactos/lib/ntdll/rtl/resource.c rename to reactos/lib/rtl/resource.c index f3efaaf12f0..a170db8a1d4 100644 --- a/reactos/lib/ntdll/rtl/resource.c +++ b/reactos/lib/rtl/resource.c @@ -1,29 +1,21 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS system libraries - * FILE: lib/ntdll/rtl/resource.c - * PURPOSE: Resource (multiple-reader-single-writer lock) functions - * PROGRAMMER: - * UPDATE HISTORY: - * Created 24/05/2001 - * - * NOTES: Partially take from Wine: - * Copyright 1996-1998 Marcus Meissner - * 1999 Alex Korobka - */ - /* - * xxxResource() functions implement multiple-reader-single-writer lock. - * The code is based on information published in WDJ January 1999 issue. + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: lib/rtl/resource.c + * PURPOSE: Resource (multiple-reader-single-writer lock) functions + * PROGRAMMER: Partially takem from Wine: + * Copyright 1996-1998 Marcus Meissner + * 1999 Alex Korobka */ -#include +/* INCLUDES *****************************************************************/ + +#include + #define NDEBUG #include - -/* FUNCTIONS ****************************************************************/ +/* FUNCTIONS ***************************************************************/ /* * @implemented diff --git a/reactos/lib/rtl/rtl.h b/reactos/lib/rtl/rtl.h index 6412c3d39be..f81062233a3 100644 --- a/reactos/lib/rtl/rtl.h +++ b/reactos/lib/rtl/rtl.h @@ -31,9 +31,9 @@ extern VOID FASTCALL CHECK_PAGED_CODE_RTL(char *file, int line); #define PAGED_CODE_RTL() #endif -extern PVOID RtlpAllocateMemory(UINT Bytes, ULONG Tag); -extern VOID RtlpFreeMemory(PVOID Mem, ULONG Tag); -extern KPROCESSOR_MODE RtlpGetMode(); +PVOID STDCALL RtlpAllocateMemory(UINT Bytes, ULONG Tag); +VOID STDCALL RtlpFreeMemory(PVOID Mem, ULONG Tag); +KPROCESSOR_MODE STDCALL RtlpGetMode(); #define RtlpAllocateStringMemory RtlpAllocateMemory #define RtlpFreeStringMemory RtlpFreeMemory diff --git a/reactos/lib/rtl/rtl.xml b/reactos/lib/rtl/rtl.xml index 801ca5d79b4..5bbb068346d 100644 --- a/reactos/lib/rtl/rtl.xml +++ b/reactos/lib/rtl/rtl.xml @@ -15,29 +15,39 @@ access.c acl.c + apc.c atom.c bit.c bitmap.c bootdata.c + callback.c compress.c + crc32.c + dbgbuffer.c dos8dot3.c encode.c env.c error.c exception.c generictable.c + handle.c heap.c image.c + math.c mem.c + message.c largeint.c luid.c network.c nls.c ppb.c process.c + propvar.c qsort.c random.c + rangelist.c registry.c + resource.c sd.c security.c sid.c @@ -45,6 +55,7 @@ thread.c time.c timezone.c + timerqueue.c unicode.c unicodeprefix.c version.c diff --git a/reactos/lib/rtl/sd.c b/reactos/lib/rtl/sd.c index 0fe82d73497..8bd2ef1d163 100644 --- a/reactos/lib/rtl/sd.c +++ b/reactos/lib/rtl/sd.c @@ -1,12 +1,9 @@ -/* $Id$ - * +/* * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel + * PROJECT: ReactOS system libraries * PURPOSE: Security descriptor functions * FILE: lib/rtl/sd.c * PROGRAMER: David Welch - * REVISION HISTORY: - * 26/07/98: Added stubs for security functions */ /* INCLUDES *****************************************************************/ diff --git a/reactos/lib/rtl/security.c b/reactos/lib/rtl/security.c index b1e22fc17aa..289d445ab88 100644 --- a/reactos/lib/rtl/security.c +++ b/reactos/lib/rtl/security.c @@ -1,21 +1,19 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: lib/rtl/security.c - * PURPOSE: Miscellaneous securitiy related functions - * PROGRAMMER: Eric Kohl - * UPDATE HISTORY: - * 21/11/2001 Created +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: lib/rtl/security.c + * PURPOSE: Security related functions and Security Objects + * PROGRAMMER: Eric Kohl */ +/* INCLUDES *****************************************************************/ + #include #define NDEBUG #include - -/* FUNCTIONS ****************************************************************/ +/* FUNCTIONS ***************************************************************/ /* * @implemented @@ -162,4 +160,68 @@ RtlAdjustPrivilege(IN ULONG Privilege, return STATUS_SUCCESS; } +/* + * @implemented + */ +NTSTATUS +STDCALL +RtlDeleteSecurityObject(IN PSECURITY_DESCRIPTOR *ObjectDescriptor) +{ + DPRINT("RtlDeleteSecurityObject(%p)\n", ObjectDescriptor); + + RtlFreeHeap(RtlGetProcessHeap(), + 0, + *ObjectDescriptor); + + return STATUS_SUCCESS; +} + + +/* + * @unimplemented + */ +NTSTATUS +STDCALL +RtlNewSecurityObject(IN PSECURITY_DESCRIPTOR ParentDescriptor, + IN PSECURITY_DESCRIPTOR CreatorDescriptor, + OUT PSECURITY_DESCRIPTOR *NewDescriptor, + IN BOOLEAN IsDirectoryObject, + IN HANDLE Token, + IN PGENERIC_MAPPING GenericMapping) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + + +/* + * @unimplemented + */ +NTSTATUS +STDCALL +RtlQuerySecurityObject(IN PSECURITY_DESCRIPTOR ObjectDescriptor, + IN SECURITY_INFORMATION SecurityInformation, + OUT PSECURITY_DESCRIPTOR ResultantDescriptor, + IN ULONG DescriptorLength, + OUT PULONG ReturnLength) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + + +/* + * @unimplemented + */ +NTSTATUS +STDCALL +RtlSetSecurityObject(IN SECURITY_INFORMATION SecurityInformation, + IN PSECURITY_DESCRIPTOR ModificationDescriptor, + OUT PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor, + IN PGENERIC_MAPPING GenericMapping, + IN HANDLE Token) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} /* EOF */ diff --git a/reactos/lib/rtl/sid.c b/reactos/lib/rtl/sid.c index 01c6f62d173..3a1f40bf552 100644 --- a/reactos/lib/rtl/sid.c +++ b/reactos/lib/rtl/sid.c @@ -1,16 +1,13 @@ -/* $Id$ - * +/* * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel + * PROJECT: ReactOS system libraries * PURPOSE: Security manager * FILE: lib/rtl/sid.c * PROGRAMER: David Welch - * REVISION HISTORY: - * 26/07/98: Added stubs for security functions */ /* INCLUDES *****************************************************************/ -#define __NTDRIVER__ + #include #define NDEBUG diff --git a/reactos/lib/rtl/splaytree.c b/reactos/lib/rtl/splaytree.c index 02d3fb1fc26..97373105b2d 100644 --- a/reactos/lib/rtl/splaytree.c +++ b/reactos/lib/rtl/splaytree.c @@ -1,36 +1,19 @@ /* - * ReactOS kernel - * Copyright (C) 2003 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$ - * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries * PURPOSE: Splay-Tree implementation * FILE: lib/rtl/splaytree.c + * PROGRAMMER: */ +/* INCLUDES *****************************************************************/ + #include #define NDEBUG #include - -/* FUNCTIONS *****************************************************************/ +/* FUNCTIONS ***************************************************************/ /* * @unimplemented diff --git a/reactos/lib/rtl/thread.c b/reactos/lib/rtl/thread.c index 73892914697..3ecdf6c9f7d 100644 --- a/reactos/lib/rtl/thread.c +++ b/reactos/lib/rtl/thread.c @@ -1,8 +1,8 @@ /* * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel + * PROJECT: ReactOS system libraries * PURPOSE: Rtl user thread functions - * FILE: lib/ntdll/rtl/thread.c + * FILE: lib/rtl/thread.c * PROGRAMERS: * Alex Ionescu (alex@relsoft.net) * Eric Kohl @@ -308,6 +308,21 @@ RtlInitializeContext(IN HANDLE ProcessHandle, ThreadContext->Esp -= sizeof(PVOID); } +/* + * @implemented + */ +VOID +STDCALL +RtlExitUserThread(NTSTATUS Status) +{ + /* Call the Loader and tell him to notify the DLLs */ + LdrShutdownThread(); + + /* Shut us down */ + NtCurrentTeb()->FreeStackOnTermination = TRUE; + NtTerminateThread(NtCurrentThread(), Status); +} + /* @implemented */ @@ -350,4 +365,12 @@ RtlFreeUserThreadStack(HANDLE ProcessHandle, NtFreeVirtualMemory(ProcessHandle, &StackLocation, &Size, MEM_RELEASE); } +PTEB +STDCALL +_NtCurrentTeb(VOID) +{ + /* Return the TEB */ + return NtCurrentTeb(); +} + /* EOF */ diff --git a/reactos/lib/rtl/time.c b/reactos/lib/rtl/time.c index 19ebbc3cad0..e4b78f4963d 100644 --- a/reactos/lib/rtl/time.c +++ b/reactos/lib/rtl/time.c @@ -1,13 +1,9 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: lib/rtl/time.c - * PURPOSE: Conversion between Time and TimeFields - * PROGRAMMER: Rex Jolliff (rex@lvcablemodem.com) - * UPDATE HISTORY: - * Created 22/05/98 - * 08/03/98 RJJ Implemented these functions +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: lib/rtl/time.c + * PURPOSE: Conversion between Time and TimeFields + * PROGRAMMER: Rex Jolliff (rex@lvcablemodem.com) */ /* INCLUDES *****************************************************************/ diff --git a/reactos/lib/ntdll/rtl/timerqueue.c b/reactos/lib/rtl/timerqueue.c similarity index 66% rename from reactos/lib/ntdll/rtl/timerqueue.c rename to reactos/lib/rtl/timerqueue.c index 3e55342403b..269c9b2d3a1 100644 --- a/reactos/lib/ntdll/rtl/timerqueue.c +++ b/reactos/lib/rtl/timerqueue.c @@ -1,35 +1,20 @@ /* - * 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$ - * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries * PURPOSE: Timer Queue implementation - * FILE: lib/ntdll/rtl/timerqueue.c + * FILE: lib/rtl/timerqueue.c + * PROGRAMMER: */ -/* INCLUDES ****************************************************************/ +/* INCLUDES *****************************************************************/ + +#include -#include #define NDEBUG #include +/* FUNCTIONS ***************************************************************/ + typedef VOID (CALLBACK *WAITORTIMERCALLBACKFUNC) (PVOID, BOOLEAN ); /* diff --git a/reactos/lib/rtl/timezone.c b/reactos/lib/rtl/timezone.c index 9d0df618107..82821a2a16f 100644 --- a/reactos/lib/rtl/timezone.c +++ b/reactos/lib/rtl/timezone.c @@ -1,12 +1,9 @@ -/* $Id$ - * +/* * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel + * PROJECT: ReactOS system libraries * PURPOSE: Timezone functions * FILE: lib/rtl/timezone.c * PROGRAMER: Eric Kohl - * REVISION HISTORY: - * 29/05/2001: Created */ /* INCLUDES *****************************************************************/ @@ -16,7 +13,7 @@ #define NDEBUG #include -/* FUNCTIONS *****************************************************************/ +/* FUNCTIONS ***************************************************************/ /* * @implemented diff --git a/reactos/lib/rtl/unicode.c b/reactos/lib/rtl/unicode.c index 0acf7bc690a..b362e773176 100644 --- a/reactos/lib/rtl/unicode.c +++ b/reactos/lib/rtl/unicode.c @@ -1,25 +1,13 @@ /* - * Rtl string functions - * - * Copyright (C) 1996-1998 Marcus Meissner - * Copyright (C) 2000 Alexandre Julliard - * Copyright (C) 2003 Thomas Mertes - * - * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * PURPOSE: Unicode Conversion Routines + * FILE: lib/rtl/unicode.c + * PROGRAMMER: */ -#define __NTDRIVER__ + +/* INCLUDES *****************************************************************/ + #include #define NDEBUG diff --git a/reactos/lib/rtl/unicodeprefix.c b/reactos/lib/rtl/unicodeprefix.c index 9bc44c37a32..1ee569fa7c3 100644 --- a/reactos/lib/rtl/unicodeprefix.c +++ b/reactos/lib/rtl/unicodeprefix.c @@ -1,35 +1,19 @@ /* - * ReactOS kernel - * Copyright (C) 2003 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$ - * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries * PURPOSE: Unicode Prefix implementation * FILE: lib/rtl/unicodeprfx.c + * PROGRAMMER: */ +/* INCLUDES *****************************************************************/ + #include #define NDEBUG #include -/* FUNCTIONS *****************************************************************/ +/* FUNCTIONS ***************************************************************/ /* * @unimplemented diff --git a/reactos/lib/rtl/version.c b/reactos/lib/rtl/version.c index 136030151a2..ee890709217 100644 --- a/reactos/lib/rtl/version.c +++ b/reactos/lib/rtl/version.c @@ -1,31 +1,8 @@ -/* - * ReactOS kernel - * Copyright (C) 2004 ReactOS Team - * Copyright 1997 Marcus Meissner - * Copyright 1998 Patrik Stridvall - * Copyright 1998, 2003 Andreas Mohr - * Copyright 1997, 2003 Alexandre Julliard - * - * 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$ - * - * PROJECT: ReactOS kernel - * PURPOSE: Runtime code - * FILE: lib/rtl/version.c - * PROGRAMER: Filip Navara +/* COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * PURPOSE: Runtime code + * FILE: lib/rtl/version.c + * PROGRAMER: Filip Navara */ /* INCLUDES *****************************************************************/ @@ -235,14 +212,6 @@ RtlVerifyVersionInfo( return STATUS_SUCCESS; } - -/* - Header hell made me do it, don't blame me. Please move these somewhere more - sensible -*/ -#define VER_CONDITION_MASK 7 -#define VER_NUM_BITS_PER_CONDITION_MASK 3 - /* * @implemented */ diff --git a/reactos/ntoskrnl/ntoskrnl.xml b/reactos/ntoskrnl/ntoskrnl.xml index 4b347b884c6..99d4a50e1a2 100644 --- a/reactos/ntoskrnl/ntoskrnl.xml +++ b/reactos/ntoskrnl/ntoskrnl.xml @@ -317,11 +317,9 @@ ctype.c debug.c libsupp.c - message.c misc.c nls.c purecall.c - rangelist.c regio.c sprintf.c stdlib.c diff --git a/reactos/ntoskrnl/rtl/libsupp.c b/reactos/ntoskrnl/rtl/libsupp.c index 24c94dcd3a9..d3857a7718b 100644 --- a/reactos/ntoskrnl/rtl/libsupp.c +++ b/reactos/ntoskrnl/rtl/libsupp.c @@ -18,12 +18,14 @@ KPROCESSOR_MODE +STDCALL RtlpGetMode() { return KernelMode; } PVOID +STDCALL RtlpAllocateMemory(UINT Bytes, ULONG Tag) { @@ -34,6 +36,7 @@ RtlpAllocateMemory(UINT Bytes, VOID +STDCALL RtlpFreeMemory(PVOID Mem, ULONG Tag) { @@ -59,6 +62,13 @@ RtlReleasePebLock(VOID) } +NTSTATUS +STDCALL +LdrShutdownThread(VOID) +{ + return STATUS_SUCCESS; +} + PPEB STDCALL diff --git a/reactos/ntoskrnl/rtl/message.c b/reactos/ntoskrnl/rtl/message.c deleted file mode 100644 index 630b281ac72..00000000000 --- a/reactos/ntoskrnl/rtl/message.c +++ /dev/null @@ -1,124 +0,0 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/rtl/message.c - * PURPOSE: Message table functions - * - * PROGRAMMERS: Eric Kohl - */ - -/* INCLUDES *****************************************************************/ - -#include -#define NDEBUG -#include - - -/* FUNCTIONS *****************************************************************/ - -/* - * @implemented - */ -NTSTATUS STDCALL -RtlFindMessage(PVOID BaseAddress, - ULONG Type, - ULONG Language, - ULONG MessageId, - PRTL_MESSAGE_RESOURCE_ENTRY *MessageResourceEntry) -{ - LDR_RESOURCE_INFO ResourceInfo; - PIMAGE_RESOURCE_DATA_ENTRY ResourceDataEntry; - PRTL_MESSAGE_RESOURCE_DATA MessageTable; - NTSTATUS Status; - ULONG EntryOffset = 0, IdOffset = 0; - PRTL_MESSAGE_RESOURCE_ENTRY MessageEntry; - - ULONG i; - - DPRINT("RtlFindMessage()\n"); - - ResourceInfo.Type = Type; - ResourceInfo.Name = 1; - ResourceInfo.Language = Language; - - Status = LdrFindResource_U(BaseAddress, - &ResourceInfo, - RESOURCE_DATA_LEVEL, - &ResourceDataEntry); - if (!NT_SUCCESS(Status)) - { - return(Status); - } - - DPRINT("ResourceDataEntry: %p\n", ResourceDataEntry); - - Status = LdrAccessResource(BaseAddress, - ResourceDataEntry, - (PVOID*)&MessageTable, - NULL); - if (!NT_SUCCESS(Status)) - { - return(Status); - } - - DPRINT("MessageTable: %p\n", MessageTable); - - DPRINT("NumberOfBlocks %lu\n", MessageTable->NumberOfBlocks); - for (i = 0; i < MessageTable->NumberOfBlocks; i++) - { - DPRINT("LoId 0x%08lx HiId 0x%08lx Offset 0x%08lx\n", - MessageTable->Blocks[i].LowId, - MessageTable->Blocks[i].HighId, - MessageTable->Blocks[i].OffsetToEntries); - } - - for (i = 0; i < MessageTable->NumberOfBlocks; i++) - { - if ((MessageId >= MessageTable->Blocks[i].LowId) && - (MessageId <= MessageTable->Blocks[i].HighId)) - { - EntryOffset = MessageTable->Blocks[i].OffsetToEntries; - IdOffset = MessageId - MessageTable->Blocks[i].LowId; - break; - } - - if (MessageId < MessageTable->Blocks[i].LowId) - { - return STATUS_MESSAGE_NOT_FOUND; - } - } - - MessageEntry = (PRTL_MESSAGE_RESOURCE_ENTRY)((PUCHAR)MessageTable + MessageTable->Blocks[i].OffsetToEntries); - - DPRINT("EntryOffset 0x%08lx\n", EntryOffset); - DPRINT("IdOffset 0x%08lx\n", IdOffset); - - DPRINT("MessageEntry: %p\n", MessageEntry); - for (i = 0; i < IdOffset; i++) - { - DPRINT("MessageEntry %d: %p\n", i, MessageEntry); - MessageEntry = (PRTL_MESSAGE_RESOURCE_ENTRY)((PUCHAR)MessageEntry + (ULONG)MessageEntry->Length); - } - DPRINT("MessageEntry: %p\n", MessageEntry); - DPRINT("Flags: %hx\n", MessageEntry->Flags); - DPRINT("Length: %hu\n", MessageEntry->Length); - - if (MessageEntry->Flags == 0) - { - DPRINT("AnsiText: %s\n", MessageEntry->Text); - } - else - { - DPRINT("UnicodeText: %S\n", (PWSTR)MessageEntry->Text); - } - - if (MessageResourceEntry != NULL); - { - *MessageResourceEntry = MessageEntry; - } - - return(STATUS_SUCCESS); -} - -/* EOF */