- Part one of major RTL cleanup. Merge duplicated code and stick everything in lib\rtl that used to be in ntdll. Also cleanup the file headers, copyright information and includes.

svn path=/trunk/; revision=17731
This commit is contained in:
Alex Ionescu 2005-09-08 00:09:32 +00:00
parent 7c6de62098
commit c39ccd6592
60 changed files with 562 additions and 2073 deletions

View file

@ -32,25 +32,11 @@
<file>dllmain.c</file>
</directory>
<directory name="rtl">
<file>apc.c</file>
<file>callback.c</file>
<file>crc32.c</file>
<file>critical.c</file>
<file>dbgbuffer.c</file>
<file>exception.c</file>
<file>handle.c</file>
<file>libsupp.c</file>
<file>math.c</file>
<file>message.c</file>
<file>misc.c</file>
<file>path.c</file>
<file>process.c</file>
<file>propvar.c</file>
<file>rangelist.c</file>
<file>resource.c</file>
<file>secobj.c</file>
<file>teb.c</file>
<file>timerqueue.c</file>
<file>version.c</file>
</directory>
<directory name="stdio">
<file>sprintf.c</file>

View file

@ -1,55 +0,0 @@
/*
* ReactOS kernel
* Copyright (C) 2000 David Welch <welch@cwcom.net>
*
* 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 <welch@cwcom.net>
*/
/* INCLUDES *****************************************************************/
#include <ntdll.h>
#define NDEBUG
#include <debug.h>
/* 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);
}

View file

@ -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 <ntdll.h>
#define NDEBUG
#include <debug.h>
@ -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)
{

View file

@ -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 <ekohl@zr-online.de>
* REVISION HISTORY:
* 10/08/2000: Created
*/
/* INCLUDES *****************************************************************/
#include <ntdll.h>
#define NDEBUG
#include <debug.h>
/**********************************************************************
* 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);
}

View file

@ -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 <ntdll.h>
#define NDEBUG
#include <debug.h>
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 */

View file

@ -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 <ntdll.h>
#define NDEBUG
#include <debug.h>
/*
* @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 */

View file

@ -1,19 +0,0 @@
/* $Id$
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: lib/ntdll/csr/teb.c
* PURPOSE:
*/
#include <ntdll.h>
#define NDEBUG
#include <debug.h>
PTEB STDCALL
_NtCurrentTeb() { return NtCurrentTeb(); }
/* EOF */

View file

@ -1,124 +0,0 @@
/*
* ReactOS kernel
* Copyright (C) 2000 David Welch <welch@cwcom.net>
*
* 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 <welch@cwcom.net>
*/
/* INCLUDES *****************************************************************/
#include <ntdll.h>
#define NDEBUG
#include <debug.h>
/* 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);
}
}

View file

@ -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 */

View file

@ -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
*/

View file

@ -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 <welch@cwcom.net>
* 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 <welch@cwcom.net>
*/
/* INCLUDES *****************************************************************/

37
reactos/lib/rtl/apc.c Normal file
View file

@ -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 <welch@cwcom.net>
*/
/* INCLUDES *****************************************************************/
#include <rtl.h>
#define NDEBUG
#include <debug.h>
/* 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);
}

View file

@ -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 *****************************************************************/

View file

@ -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 <debug.h>
/* FUNCTIONS ****************************************************************/
/*

View file

@ -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 *****************************************************************/

View file

@ -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 <rtl.h>
#define NDEBUG

View file

@ -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 <welch@cwcom.net>
/* 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 <welch@cwcom.net>
*/
/* INCLUDES *****************************************************************/
#include <ntdll.h>
#include <rtl.h>
#define NDEBUG
#include <debug.h>
/* TYPES *********************************************************************/
/* FUNCTIONS *****************************************************************/
typedef NTSTATUS (STDCALL *KERNEL_CALLBACK_FUNCTION)(PVOID Argument,
ULONG ArgumentLength);

View file

@ -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 *****************************************************************/

View file

@ -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 <ntdll.h>
#include <rtl.h>
#define NDEBUG
#include <debug.h>
/* FUNCTIONS ****************************************************************/
/* FUNCTIONS *****************************************************************/
/* CRC polynomial 0xedb88320 */
static const ULONG CrcTable[256] =

View file

@ -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 <ntdll.h>
#include <rtl.h>
#define NDEBUG
#include <debug.h>
/* FUNCTIONS ***************************************************************/
/* FUNCTIONS *****************************************************************/
/*
* @unimplemented

View file

@ -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

View file

@ -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 <noog@libero.it>
* REVISION HISTORY:
* 02/04/2003: created (code contributed by crazylord
* <crazyl0rd@minithins.net>)
/* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* PURPOSE: Security descriptor functions
* FILE: lib/rtl/encode.c
* PROGRAMMER: KJK::Hyperion <noog@libero.it>
* (code contributed by crazylord <crazyl0rd@minithins.net>)
*/
/* INCLUDES *****************************************************************/

View file

@ -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 ******************************************************************/

View file

@ -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
*/
/*

View file

@ -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 <welch@cwcom.net>
* Skywing <skywing@valhallalegends.com>
* KJK::Hyperion <noog@libero.it>
* 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 <welch@cwcom.net>
* Skywing <skywing@valhallalegends.com>
* KJK::Hyperion <noog@libero.it>
*/
/* INCLUDES *****************************************************************/

View file

@ -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 <rtl.h>
#define NDEBUG

View file

@ -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 <ekohl@rz-online.de>
/* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* PURPOSE: Handle table
* FILE: lib/rtl/handle.c
* PROGRAMER: Eric Kohl <ekohl@rz-online.de>
*/
/* INCLUDES ******************************************************************/
/* INCLUDES *****************************************************************/
#include <rtl.h>
#include <ntdll.h>
#define NDEBUG
#include <debug.h>
/* FUNCTIONS *****************************************************************/
/* GLOBALS ******************************************************************/
VOID STDCALL
RtlInitializeHandleTable(ULONG TableSize,

View file

@ -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 <rtl.h>
#define NDEBUG
#include <debug.h>
/* FUNCTIONS *****************************************************************/
#define WARN_ON(x) (1)
#ifdef NDEBUG

View file

@ -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 <rtl.h>
#define NDEBUG
#include <debug.h>
/* FUNCTIONS ****************************************************************/
/* FUNCTIONS *****************************************************************/
/*
* @implemented

View file

@ -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 <debug.h>
/* FUNCTIONS *****************************************************************/
/*

View file

@ -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 <ekohl@zr-online.de>
* 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 <ekohl@zr-online.de>
*/
/* INCLUDES *****************************************************************/

View file

@ -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 <bowman@ipp-garching.mpg.de>, 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 <bowman@ipp-garching.mpg.de>
*/
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 <rtl.h>
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 <ntdll.h>
#define NDEBUG
#include <debug.h>
/* FUNCTIONS *****************************************************************/
double atan (double __x);
double ceil (double __x);
double cos (double __x);

View file

@ -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 <debug.h>
/* FUNCTIONS *****************************************************************/
/******************************************************************************

View file

@ -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 <ekohl@zr-online.de>
*/
/* INCLUDES *****************************************************************/
#include <ntdll.h>
#include <rtl.h>
#define NDEBUG
#include <debug.h>

View file

@ -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 <rtl.h>
#define NDEBUG
#include <debug.h>
/* FUNCTIONS *****************************************************************/
/* FUNCTIONS ***************************************************************/
/* Borrow this from some headers... */
typedef struct

View file

@ -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 <rtl.h>
@ -38,18 +33,10 @@ PCHAR NlsUnicodeToOemTable =NULL;
PWCHAR NlsDbcsUnicodeToOemTable = NULL;
PUSHORT NlsOemLeadByteInfo = NULL; /* exported */
#define INIT_FUNCTION
/* FUNCTIONS *****************************************************************/
/*
* @unimplemented
*/

View file

@ -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 ****************************************************************/

View file

@ -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 */

View file

@ -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 <ntdll.h>
/* INCLUDES *****************************************************************/
#include <rtl.h>
#define NDEBUG
#include <debug.h>
/* FUNCTIONS ***************************************************************/
/*
* @unimplemented
*/

View file

@ -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
<<qsort>>---sort an array
INDEX
qsort
ANSI_SYNOPSIS
#include <stdlib.h>
void qsort(void *<[base]>, size_t <[nmemb]>, size_t <[size]>,
int (*<[compar]>)(const void *, const void *) );
TRAD_SYNOPSIS
#include <stdlib.h>
qsort(<[base]>, <[nmemb]>, <[size]>, <[compar]> )
char *<[base]>;
size_t <[nmemb]>;
size_t <[size]>;
int (*<[compar]>)();
DESCRIPTION
<<qsort>> 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 <<qsort>> returns, the
array elements beginning at <[base]> have been reordered.
RETURNS
<<qsort>> does not return a result.
PORTABILITY
<<qsort>> 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__

View file

@ -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 *****************************************************************/

View file

@ -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 <rtl.h>
#include <ntoskrnl.h>
#define NDEBUG
#include <internal/debug.h>
#include <debug.h>
/* 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;

View file

@ -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 <rtl.h>
#define NDEBUG
@ -25,7 +21,6 @@
#define TAG_RTLREGISTRY TAG('R', 't', 'l', 'R')
/* FUNCTIONS ***************************************************************/
static NTSTATUS

View file

@ -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 <ntdll.h>
/* INCLUDES *****************************************************************/
#include <rtl.h>
#define NDEBUG
#include <debug.h>
/* FUNCTIONS ****************************************************************/
/* FUNCTIONS ***************************************************************/
/*
* @implemented

View file

@ -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

View file

@ -15,29 +15,39 @@
</if>
<file>access.c</file>
<file>acl.c</file>
<file>apc.c</file>
<file>atom.c</file>
<file>bit.c</file>
<file>bitmap.c</file>
<file>bootdata.c</file>
<file>callback.c</file>
<file>compress.c</file>
<file>crc32.c</file>
<file>dbgbuffer.c</file>
<file>dos8dot3.c</file>
<file>encode.c</file>
<file>env.c</file>
<file>error.c</file>
<file>exception.c</file>
<file>generictable.c</file>
<file>handle.c</file>
<file>heap.c</file>
<file>image.c</file>
<file>math.c</file>
<file>mem.c</file>
<file>message.c</file>
<file>largeint.c</file>
<file>luid.c</file>
<file>network.c</file>
<file>nls.c</file>
<file>ppb.c</file>
<file>process.c</file>
<file>propvar.c</file>
<file>qsort.c</file>
<file>random.c</file>
<file>rangelist.c</file>
<file>registry.c</file>
<file>resource.c</file>
<file>sd.c</file>
<file>security.c</file>
<file>sid.c</file>
@ -45,6 +55,7 @@
<file>thread.c</file>
<file>time.c</file>
<file>timezone.c</file>
<file>timerqueue.c</file>
<file>unicode.c</file>
<file>unicodeprefix.c</file>
<file>version.c</file>

View file

@ -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 <welch@cwcom.net>
* REVISION HISTORY:
* 26/07/98: Added stubs for security functions
*/
/* INCLUDES *****************************************************************/

View file

@ -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 <rtl.h>
#define NDEBUG
#include <debug.h>
/* 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 */

View file

@ -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 <welch@cwcom.net>
* REVISION HISTORY:
* 26/07/98: Added stubs for security functions
*/
/* INCLUDES *****************************************************************/
#define __NTDRIVER__
#include <rtl.h>
#define NDEBUG

View file

@ -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 <rtl.h>
#define NDEBUG
#include <debug.h>
/* FUNCTIONS *****************************************************************/
/* FUNCTIONS ***************************************************************/
/*
* @unimplemented

View file

@ -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 */

View file

@ -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 *****************************************************************/

View file

@ -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 <rtl.h>
#include <ntdll.h>
#define NDEBUG
#include <debug.h>
/* FUNCTIONS ***************************************************************/
typedef VOID (CALLBACK *WAITORTIMERCALLBACKFUNC) (PVOID, BOOLEAN );
/*

View file

@ -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 <debug.h>
/* FUNCTIONS *****************************************************************/
/* FUNCTIONS ***************************************************************/
/*
* @implemented

View file

@ -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 <rtl.h>
#define NDEBUG

View file

@ -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 <rtl.h>
#define NDEBUG
#include <debug.h>
/* FUNCTIONS *****************************************************************/
/* FUNCTIONS ***************************************************************/
/*
* @unimplemented

View file

@ -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
*/

View file

@ -317,11 +317,9 @@
<file>ctype.c</file>
<file>debug.c</file>
<file>libsupp.c</file>
<file>message.c</file>
<file>misc.c</file>
<file>nls.c</file>
<file>purecall.c</file>
<file>rangelist.c</file>
<file>regio.c</file>
<file>sprintf.c</file>
<file>stdlib.c</file>

View file

@ -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

View file

@ -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 <ekohl@zr-online.de>
*/
/* INCLUDES *****************************************************************/
#include <ntoskrnl.h>
#define NDEBUG
#include <internal/debug.h>
/* 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 */