ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
January 2005
----- 2024 -----
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
28 participants
703 discussions
Start a n
N
ew thread
[gdalsnes] 12814: i'm pretty sure a non-inheritable handle _can_ be duplicated! This fixes compiling ros-on-ros w/w2k msvcrt.dll for me.
by gdalsnes@svn.reactos.com
i'm pretty sure a non-inheritable handle _can_ be duplicated! This fixes compiling ros-on-ros w/w2k msvcrt.dll for me. Modified: trunk/reactos/ntoskrnl/ob/handle.c _____ Modified: trunk/reactos/ntoskrnl/ob/handle.c --- trunk/reactos/ntoskrnl/ob/handle.c 2005-01-05 02:21:05 UTC (rev 12813) +++ trunk/reactos/ntoskrnl/ob/handle.c 2005-01-05 02:50:50 UTC (rev 12814) @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: handle.c,v 1.63 2004/10/22 20:57:39 ekohl Exp $ +/* $Id$ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -353,13 +353,7 @@ } KeReleaseSpinLock(&SourceProcess->HandleTable.ListLock, oldIrql); - if (!((ULONG_PTR)SourceHandleEntry->ObjectBody & OB_HANDLE_FLAG_INHERIT)) - { - ObDereferenceObject(TargetProcess); - ObDereferenceObject(SourceProcess); - ObDereferenceObject(ObjectBody); - return STATUS_INVALID_HANDLE; - } + ObCreateHandle(TargetProcess, ObjectBody, DesiredAccess,
19 years, 10 months
1
0
0
0
[narnaoud] 12813: Remove definitions now present in /reactos/include/ntos/security.h
by narnaoud@svn.reactos.com
Remove definitions now present in /reactos/include/ntos/security.h Modified: trunk/rosapps/sysutils/regexpl/SecurityDescriptor.cpp _____ Modified: trunk/rosapps/sysutils/regexpl/SecurityDescriptor.cpp --- trunk/rosapps/sysutils/regexpl/SecurityDescriptor.cpp 2005-01-05 02:05:59 UTC (rev 12812) +++ trunk/rosapps/sysutils/regexpl/SecurityDescriptor.cpp 2005-01-05 02:21:05 UTC (rev 12813) @@ -27,42 +27,6 @@ #include "ph.h" #include "SecurityDescriptor.h" -// *** THIS SHOULD GO IN A MINGW/ROS HEADER - Begin -#if 1 - -//#define SID_REVISION (1) // Current revision level - -//typedef struct _ACE_HEADER { -// BYTE AceType; -// BYTE AceFlags; -// WORD AceSize; -//} ACE_HEADER; -typedef ACE_HEADER * PACE_HEADER; - -//#define ACCESS_ALLOWED_ACE_TYPE (0x0) -//#define ACCESS_DENIED_ACE_TYPE (0x1) -//#define SYSTEM_AUDIT_ACE_TYPE (0x2) -//#define SYSTEM_ALARM_ACE_TYPE (0x3) - -//#define OBJECT_INHERIT_ACE (0x1) -//#define CONTAINER_INHERIT_ACE (0x2) -//#define NO_PROPAGATE_INHERIT_ACE (0x4) -//#define INHERIT_ONLY_ACE (0x8) -//#define VALID_INHERIT_FLAGS (0xF) - -//#define SUCCESSFUL_ACCESS_ACE_FLAG (0x40) -//#define FAILED_ACCESS_ACE_FLAG (0x80) - -//typedef struct _SYSTEM_AUDIT_ACE { -// ACE_HEADER Header; -// ACCESS_MASK Mask; -// DWORD SidStart; -//} SYSTEM_AUDIT_ACE; - -#endif -// *** THIS SHOULD GO IN A MINGW/ROS HEADER - End - - BOOL GetTextualSid( PSID pSid, // binary Sid LPTSTR TextualSid, // buffer for Textual representation of Sid
19 years, 10 months
1
0
0
0
[narnaoud] 12812: Remove definitions now present in /reactos/include/ntos/security.h
by narnaoud@svn.reactos.com
Remove definitions now present in /reactos/include/ntos/security.h Modified: trunk/rosapps/tests/tokentest/tokentest.c _____ Modified: trunk/rosapps/tests/tokentest/tokentest.c --- trunk/rosapps/tests/tokentest/tokentest.c 2005-01-05 01:42:23 UTC (rev 12811) +++ trunk/rosapps/tests/tokentest/tokentest.c 2005-01-05 02:05:59 UTC (rev 12812) @@ -11,16 +11,6 @@ #define ROS_ACE_HEADER ACE_HEADER #define ROS_ACE ACE -// -// Allocate the System Luid. The first 1000 LUIDs are reserved. -// Use #999 here (0x3E7 = 999) -// - -#define SYSTEM_LUID { 0x3E7, 0x0 } -#define ANONYMOUS_LOGON_LUID { 0x3e6, 0x0 } -#define LOCALSERVICE_LUID { 0x3e5, 0x0 } -#define NETWORKSERVICE_LUID { 0x3e4, 0x0 } - #else typedef LONG NTSTATUS, *PNTSTATUS;
19 years, 10 months
1
0
0
0
[ion] 12811: Remove ROS-specific File Object Flags
by ion@svn.reactos.com
Remove ROS-specific File Object Flags Modified: trunk/reactos/drivers/fs/cdfs/fcb.c Modified: trunk/reactos/drivers/fs/cdfs/fsctl.c Modified: trunk/reactos/drivers/fs/vfat/create.c Modified: trunk/reactos/drivers/fs/vfat/fcb.c Modified: trunk/reactos/drivers/fs/vfat/fsctl.c Modified: trunk/reactos/include/ddk/iotypes.h Modified: trunk/reactos/ntoskrnl/io/rawfs.c _____ Modified: trunk/reactos/drivers/fs/cdfs/fcb.c --- trunk/reactos/drivers/fs/cdfs/fcb.c 2005-01-05 01:09:30 UTC (rev 12810) +++ trunk/reactos/drivers/fs/cdfs/fcb.c 2005-01-05 01:42:23 UTC (rev 12811) @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: fcb.c,v 1.20 2004/11/06 13:41:58 ekohl Exp $ +/* $Id$ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -234,8 +234,6 @@ RtlZeroMemory(newCCB, sizeof(CCB)); - FileObject->Flags = FileObject->Flags | FO_FCB_IS_VALID | - FO_DIRECT_CACHE_PAGING_READ; FileObject->SectionObjectPointer = &Fcb->SectionObjectPointers; FileObject->FsContext = Fcb; FileObject->FsContext2 = newCCB; @@ -423,8 +421,6 @@ } memset(newCCB, 0, sizeof(CCB)); - FileObject->Flags = FileObject->Flags | FO_FCB_IS_VALID | - FO_DIRECT_CACHE_PAGING_READ; FileObject->SectionObjectPointer = &Fcb->SectionObjectPointers; FileObject->FsContext = Fcb; FileObject->FsContext2 = newCCB; _____ Modified: trunk/reactos/drivers/fs/cdfs/fsctl.c --- trunk/reactos/drivers/fs/cdfs/fsctl.c 2005-01-05 01:09:30 UTC (rev 12810) +++ trunk/reactos/drivers/fs/cdfs/fsctl.c 2005-01-05 01:42:23 UTC (rev 12811) @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: fsctl.c,v 1.20 2004/12/25 11:18:38 navaraf Exp $ +/* $Id$ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -385,7 +385,6 @@ RtlZeroMemory(Ccb, sizeof(CCB)); - DeviceExt->StreamFileObject->Flags = DeviceExt->StreamFileObject->Flags | FO_FCB_IS_VALID | FO_DIRECT_CACHE_PAGING_READ; DeviceExt->StreamFileObject->FsContext = Fcb; DeviceExt->StreamFileObject->FsContext2 = Ccb; DeviceExt->StreamFileObject->SectionObjectPointer = &Fcb->SectionObjectPointers; _____ Modified: trunk/reactos/drivers/fs/vfat/create.c --- trunk/reactos/drivers/fs/vfat/create.c 2005-01-05 01:09:30 UTC (rev 12810) +++ trunk/reactos/drivers/fs/vfat/create.c 2005-01-05 01:42:23 UTC (rev 12811) @@ -516,7 +516,6 @@ return (STATUS_INSUFFICIENT_RESOURCES); } RtlZeroMemory(pCcb, sizeof(VFATCCB)); - FileObject->Flags |= FO_FCB_IS_VALID; FileObject->SectionObjectPointer = &pFcb->SectionObjectPointers; FileObject->FsContext = pFcb; FileObject->FsContext2 = pCcb; _____ Modified: trunk/reactos/drivers/fs/vfat/fcb.c --- trunk/reactos/drivers/fs/vfat/fcb.c 2005-01-05 01:09:30 UTC (rev 12810) +++ trunk/reactos/drivers/fs/vfat/fcb.c 2005-01-05 01:42:23 UTC (rev 12811) @@ -330,7 +330,6 @@ } RtlZeroMemory(newCCB, sizeof (VFATCCB)); - fileObject->Flags |= FO_FCB_IS_VALID | FO_DIRECT_CACHE_PAGING_READ; fileObject->SectionObjectPointer = &fcb->SectionObjectPointers; fileObject->FsContext = fcb; fileObject->FsContext2 = newCCB; @@ -535,8 +534,6 @@ } RtlZeroMemory (newCCB, sizeof (VFATCCB)); - fileObject->Flags = fileObject->Flags | FO_FCB_IS_VALID | - FO_DIRECT_CACHE_PAGING_READ; fileObject->SectionObjectPointer = &fcb->SectionObjectPointers; fileObject->FsContext = fcb; fileObject->FsContext2 = newCCB; _____ Modified: trunk/reactos/drivers/fs/vfat/fsctl.c --- trunk/reactos/drivers/fs/vfat/fsctl.c 2005-01-05 01:09:30 UTC (rev 12810) +++ trunk/reactos/drivers/fs/vfat/fsctl.c 2005-01-05 01:42:23 UTC (rev 12811) @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: fsctl.c,v 1.37 2004/12/05 16:31:51 gvg Exp $ +/* $Id$ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -511,7 +511,6 @@ } RtlZeroMemory(Ccb, sizeof (VFATCCB)); - DeviceExt->FATFileObject->Flags = DeviceExt->FATFileObject->Flags | FO_FCB_IS_VALID | FO_DIRECT_CACHE_PAGING_READ; DeviceExt->FATFileObject->FsContext = Fcb; DeviceExt->FATFileObject->FsContext2 = Ccb; DeviceExt->FATFileObject->SectionObjectPointer = &Fcb->SectionObjectPointers; _____ Modified: trunk/reactos/include/ddk/iotypes.h --- trunk/reactos/include/ddk/iotypes.h 2005-01-05 01:09:30 UTC (rev 12810) +++ trunk/reactos/include/ddk/iotypes.h 2005-01-05 01:42:23 UTC (rev 12811) @@ -642,15 +642,6 @@ #define FO_HANDLE_CREATED 0x00040000 #define FO_FILE_FAST_IO_READ 0x00080000 -/* - * ReactOS specific flags - */ -#define FO_DIRECT_CACHE_READ 0x72000001 -#define FO_DIRECT_CACHE_WRITE 0x72000002 -#define FO_DIRECT_CACHE_PAGING_READ 0x72000004 -#define FO_DIRECT_CACHE_PAGING_WRITE 0x72000008 -#define FO_FCB_IS_VALID 0x72000010 - typedef struct _FILE_OBJECT { CSHORT Type; _____ Modified: trunk/reactos/ntoskrnl/io/rawfs.c --- trunk/reactos/ntoskrnl/io/rawfs.c 2005-01-05 01:09:30 UTC (rev 12810) +++ trunk/reactos/ntoskrnl/io/rawfs.c 2005-01-05 01:42:23 UTC (rev 12811) @@ -1,4 +1,4 @@ -/* $Id: rawfs.c,v 1.13 2004/10/22 20:25:54 ekohl Exp $ +/* $Id$ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -454,7 +454,6 @@ return (STATUS_INSUFFICIENT_RESOURCES); } - FileObject->Flags |= FO_FCB_IS_VALID; FileObject->SectionObjectPointer = &pFcb->SectionObjectPointers; FileObject->FsContext = pFcb; FileObject->FsContext2 = pCcb;
19 years, 10 months
1
0
0
0
[ion] 12810: Significantly improved performance of Critical Section code by using a static buffer. Increased debug info dramatically and, if enabled, leaks can be found with ease. Future revision will include Spincount support.
by ion@svn.reactos.com
Significantly improved performance of Critical Section code by using a static buffer. Increased debug info dramatically and, if enabled, leaks can be found with ease. Future revision will include Spincount support. Modified: trunk/reactos/lib/ntdll/ldr/startup.c Modified: trunk/reactos/lib/ntdll/rtl/critical.c Modified: trunk/reactos/lib/shell32/changenotify.c Modified: trunk/reactos/lib/shell32/iconcache.c _____ Modified: trunk/reactos/lib/ntdll/ldr/startup.c --- trunk/reactos/lib/ntdll/ldr/startup.c 2005-01-05 00:08:45 UTC (rev 12809) +++ trunk/reactos/lib/ntdll/ldr/startup.c 2005-01-05 01:09:30 UTC (rev 12810) @@ -278,8 +278,11 @@ RtlResetRtlTranslations (&NlsTable); NTHeaders = (PIMAGE_NT_HEADERS)(ImageBase + PEDosHeader->e_lfanew); - + /* Initialize Critical Section Data */ + RtlpInitDeferedCriticalSection(); + + /* Get number of processors */ Status = ZwQuerySystemInformation(SystemBasicInformation, &SystemInformation, @@ -304,10 +307,7 @@ DPRINT1("Failed to create process heap\n"); ZwTerminateProcess(NtCurrentProcess(),STATUS_UNSUCCESSFUL); } - - /* Initialize Critical Section Data */ - RtlpInitDeferedCriticalSection(); - + /* initalize peb lock support */ RtlInitializeCriticalSection (&PebLock); Peb->FastPebLock = &PebLock; _____ Modified: trunk/reactos/lib/ntdll/rtl/critical.c --- trunk/reactos/lib/ntdll/rtl/critical.c 2005-01-05 00:08:45 UTC (rev 12809) +++ trunk/reactos/lib/ntdll/rtl/critical.c 2005-01-05 01:09:30 UTC (rev 12810) @@ -21,11 +21,13 @@ /* FUNCTIONS *****************************************************************/ +#define MAX_STATIC_CS_DEBUG_OBJECTS 64 + static RTL_CRITICAL_SECTION RtlCriticalSectionLock; static LIST_ENTRY RtlCriticalSectionList; static BOOLEAN RtlpCritSectInitialized = FALSE; -//static RTL_CRITICAL_SECTION_DEBUG RtlpStaticDebugInfo[64]; -//static PRTL_CRITICAL_SECTION_DEBUG RtlpDebugInfoFreeList; +static RTL_CRITICAL_SECTION_DEBUG RtlpStaticDebugInfo[MAX_STATIC_CS_DEBUG_OBJECTS]; +static BOOLEAN RtlpDebugInfoFreeList[MAX_STATIC_CS_DEBUG_OBJECTS]; /*++ * RtlDeleteCriticalSection @@ -50,26 +52,26 @@ { NTSTATUS Status = STATUS_SUCCESS; + DPRINT("Deleting Critical Section: %x\n", CriticalSection); /* Close the Event Object Handle if it exists */ if (CriticalSection->LockSemaphore) { + + /* In case NtClose fails, return the status */ Status = NtClose(CriticalSection->LockSemaphore); + } /* Protect List */ RtlEnterCriticalSection(&RtlCriticalSectionLock); - - /* Delete the Debug Data, if it exists */ - if (CriticalSection->DebugInfo) { + + /* Remove it from the list */ + RemoveEntryList(&CriticalSection->DebugInfo->ProcessLocksList); - /* Remove it from the list */ - RemoveEntryList(&CriticalSection->DebugInfo->ProcessLocksList); - - /* Free it */ - RtlFreeHeap(RtlGetProcessHeap(), 0, CriticalSection->DebugInfo); - } - /* Unprotect */ RtlLeaveCriticalSection(&RtlCriticalSectionLock); + + /* Free it */ + RtlpFreeDebugInfo(CriticalSection->DebugInfo); /* Wipe it out */ RtlZeroMemory(CriticalSection, sizeof(RTL_CRITICAL_SECTION)); @@ -148,7 +150,6 @@ } /* We don't own it, so we must wait for it */ - DPRINT ("Waiting\n"); RtlpWaitForCriticalSection(CriticalSection); } @@ -208,7 +209,6 @@ DWORD SpinCount) { PRTL_CRITICAL_SECTION_DEBUG CritcalSectionDebugData; - PVOID Heap; /* First things first, set up the Object */ DPRINT("Initializing Critical Section: %x\n", CriticalSection); @@ -217,56 +217,56 @@ CriticalSection->OwningThread = 0; CriticalSection->SpinCount = (NtCurrentPeb()->NumberOfProcessors > 1) ? SpinCount : 0; + /* Allocate the Debug Data */ + CritcalSectionDebugData = RtlpAllocateDebugInfo(); + DPRINT("Allocated Debug Data: %x inside Process: %x\n", + CritcalSectionDebugData, + NtCurrentTeb()->Cid.UniqueProcess); + + if (!CritcalSectionDebugData) { + + /* This is bad! */ + DPRINT1("Couldn't allocate Debug Data for: %x\n", CriticalSection); + return STATUS_NO_MEMORY; + } + + /* Set it up */ + CritcalSectionDebugData->Type = RTL_CRITSECT_TYPE; + CritcalSectionDebugData->ContentionCount = 0; + CritcalSectionDebugData->EntryCount = 0; + CritcalSectionDebugData->CriticalSection = CriticalSection; + CriticalSection->DebugInfo = CritcalSectionDebugData; + /* - * Now set up the Debug Data - * Think of a better way to allocate it, because the Heap Manager won't - * have any debug data since the Heap isn't initalized! - */ - if ((Heap = RtlGetProcessHeap())) { + * Add it to the List of Critical Sections owned by the process. + * If we've initialized the Lock, then use it. If not, then probably + * this is the lock initialization itself, so insert it directly. + */ + if ((CriticalSection != &RtlCriticalSectionLock) && (RtlpCritSectInitialized)) { + + DPRINT("Securely Inserting into ProcessLocks: %x, %x, %x\n", + &CritcalSectionDebugData->ProcessLocksList, + CriticalSection, + &RtlCriticalSectionList); + + /* Protect List */ + RtlEnterCriticalSection(&RtlCriticalSectionLock); - CritcalSectionDebugData = RtlAllocateHeap(Heap, 0, sizeof(RTL_CRITICAL_SECTION_DEBUG)); - DPRINT("Allocated Critical Section Debug Data: %x\n", CritcalSectionDebugData); - CritcalSectionDebugData->Type = RTL_CRITSECT_TYPE; - CritcalSectionDebugData->ContentionCount = 0; - CritcalSectionDebugData->EntryCount = 0; - CritcalSectionDebugData->CriticalSection = CriticalSection; - CriticalSection->DebugInfo = CritcalSectionDebugData; + /* Add this one */ + InsertTailList(&RtlCriticalSectionList, &CritcalSectionDebugData->ProcessLocksList); - /* - * Add it to the List of Critical Sections owned by the process. - * If we've initialized the Lock, then use it. If not, then probably - * this is the lock initialization itself, so insert it directly. - */ - if ((CriticalSection != &RtlCriticalSectionLock) && (RtlpCritSectInitialized)) { - - DPRINT("Securely Inserting into ProcessLocks: %x, %x\n", - &CritcalSectionDebugData->ProcessLocksList, - CriticalSection); - - /* Protect List */ - RtlEnterCriticalSection(&RtlCriticalSectionLock); + /* Unprotect */ + RtlLeaveCriticalSection(&RtlCriticalSectionLock); + + } else { - /* Add this one */ - InsertTailList(&RtlCriticalSectionList, &CritcalSectionDebugData->ProcessLocksList); - - /* Unprotect */ - RtlLeaveCriticalSection(&RtlCriticalSectionLock); + DPRINT("Inserting into ProcessLocks: %x, %x, %x\n", + &CritcalSectionDebugData->ProcessLocksList, + CriticalSection, + &RtlCriticalSectionList); - } else { - - DPRINT("Inserting into ProcessLocks: %x, %x\n", - &CritcalSectionDebugData->ProcessLocksList, - CriticalSection); - - /* Add it directly */ - InsertTailList(&RtlCriticalSectionList, &CritcalSectionDebugData->ProcessLocksList); - } - - } else { - - DPRINT1("No Debug Data was allocated for: %x\n", CriticalSection); - /* This shouldn't happen... */ - CritcalSectionDebugData = NULL; + /* Add it directly */ + InsertTailList(&RtlCriticalSectionList, &CritcalSectionDebugData->ProcessLocksList); } return STATUS_SUCCESS; @@ -397,16 +397,17 @@ } /* Increase the Debug Entry count */ - DPRINT("Waiting on Critical Section: %x\n", CriticalSection); - if (CriticalSection->DebugInfo) CriticalSection->DebugInfo->EntryCount++; + DPRINT("Waiting on Critical Section Event: %x %x\n", + CriticalSection, + CriticalSection->LockSemaphore); + CriticalSection->DebugInfo->EntryCount++; for (;;) { /* Increase the number of times we've had contention */ - if (CriticalSection->DebugInfo) CriticalSection->DebugInfo->ContentionCount++; + CriticalSection->DebugInfo->ContentionCount++; /* Wait on the Event */ - DPRINT("Waiting on Event: %x\n", CriticalSection->LockSemaphore); Status = NtWaitForSingleObject(CriticalSection->LockSemaphore, FALSE, &Timeout); @@ -470,13 +471,17 @@ } /* Signal the Event */ - DPRINT("Signaling CS Event\n"); + DPRINT("Signaling Critical Section Event: %x, %x\n", + CriticalSection, + CriticalSection->LockSemaphore); Status = NtSetEvent(CriticalSection->LockSemaphore, NULL); if (!NT_SUCCESS(Status)) { /* We've failed */ - DPRINT1("Signaling Failed\n"); + DPRINT1("Signaling Failed for: %x, %x\n", + CriticalSection, + CriticalSection->LockSemaphore); RtlRaiseStatus(Status); } } @@ -508,7 +513,6 @@ /* Chevk if we have an event */ if (!hEvent) { - DPRINT("Creating Event\n"); /* No, so create it */ if (!NT_SUCCESS(Status = NtCreateEvent(&hNewEvent, EVENT_ALL_ACCESS, @@ -522,23 +526,16 @@ RtlRaiseStatus(Status); return; } + DPRINT("Created Event: %x \n", hNewEvent); - if (!(hEvent = InterlockedCompareExchangePointer((PVOID*)&CriticalSection->LockSemaphor e, + if ((hEvent = InterlockedCompareExchangePointer((PVOID*)&CriticalSection->LockSemaphor e, (PVOID)hNewEvent, 0))) { - /* We created a new event succesffuly */ - hEvent = hNewEvent; - } else { - /* Some just created an event */ - DPRINT("Closing already created event!\n"); + DPRINT("Closing already created event: %x\n", hNewEvent); NtClose(hNewEvent); } - - /* Set either the new or the old */ - CriticalSection->LockSemaphore = hEvent; - DPRINT("Event set!\n"); } return; @@ -567,7 +564,7 @@ /* Initialize the Process Critical Section List */ InitializeListHead(&RtlCriticalSectionList); - + /* Initialize the CS Protecting the List */ RtlInitializeCriticalSection(&RtlCriticalSectionLock); @@ -575,4 +572,98 @@ RtlpCritSectInitialized = TRUE; } +/*++ + * RtlpAllocateDebugInfo + * + * Finds or allocates memory for a Critical Section Debug Object + * + * Params: + * None + * + * Returns: + * A pointer to an empty Critical Section Debug Object. + * + * Remarks: + * For optimization purposes, the first 64 entries can be cached. From + * then on, future Critical Sections will allocate memory from the heap. + * + *--*/ +PRTL_CRITICAL_SECTION_DEBUG +STDCALL +RtlpAllocateDebugInfo( + VOID) +{ + ULONG i; + + /* Try to allocate from our buffer first */ + for (i = 0; i < MAX_STATIC_CS_DEBUG_OBJECTS; i++) { + + /* Check if Entry is free */ + if (!RtlpDebugInfoFreeList[i]) { + + /* Mark entry in use */ + DPRINT("Using entry: %d. Buffer: %x\n", i, &RtlpStaticDebugInfo[i]); + RtlpDebugInfoFreeList[i] = TRUE; + + /* Use free entry found */ + return &RtlpStaticDebugInfo[i]; + } + + } + + /* We are out of static buffer, allocate dynamic */ + return RtlAllocateHeap(NtCurrentPeb()->ProcessHeap, + 0, + sizeof(RTL_CRITICAL_SECTION_DEBUG)); +} + +/*++ + * RtlpFreeDebugInfo + * + * Frees the memory for a Critical Section Debug Object + * + * Params: + * DebugInfo - Pointer to Critical Section Debug Object to free. + * + * Returns: + * None. + * + * Remarks: + * If the pointer is part of the static buffer, then the entry is made + * free again. If not, the object is de-allocated from the heap. + * + *--*/ +VOID +STDCALL +RtlpFreeDebugInfo( + PRTL_CRITICAL_SECTION_DEBUG DebugInfo) +{ + ULONG EntryId; + + /* Is it part of our cached entries? */ + if ((DebugInfo >= RtlpStaticDebugInfo) && + (DebugInfo <= &RtlpStaticDebugInfo[MAX_STATIC_CS_DEBUG_OBJECTS-1])) { + + /* Yes. zero it out */ + RtlZeroMemory(DebugInfo, sizeof(RTL_CRITICAL_SECTION_DEBUG)); + + /* Mark as free */ + EntryId = (DebugInfo - RtlpStaticDebugInfo); + DPRINT("Freeing from Buffer: %x. Entry: %d inside Process: %x\n", + DebugInfo, + EntryId, + NtCurrentTeb()->Cid.UniqueProcess); + RtlpDebugInfoFreeList[EntryId] = FALSE; + + } else { + + /* It's a dynamic one, so free from the heap */ + DPRINT("Freeing from Heap: %x inside Process: %x\n", + DebugInfo, + NtCurrentTeb()->Cid.UniqueProcess); + RtlFreeHeap(NtCurrentPeb()->ProcessHeap, 0, DebugInfo); + + } +} + /* EOF */ _____ Modified: trunk/reactos/lib/shell32/changenotify.c --- trunk/reactos/lib/shell32/changenotify.c 2005-01-05 00:08:45 UTC (rev 12809) +++ trunk/reactos/lib/shell32/changenotify.c 2005-01-05 01:09:30 UTC (rev 12810) @@ -180,8 +180,6 @@ DeleteNode( head ); LeaveCriticalSection(&SHELL32_ChangenotifyCS); - - DeleteCriticalSection(&SHELL32_ChangenotifyCS); } /*********************************************************************** ** _____ Modified: trunk/reactos/lib/shell32/iconcache.c --- trunk/reactos/lib/shell32/iconcache.c 2005-01-05 00:08:45 UTC (rev 12809) +++ trunk/reactos/lib/shell32/iconcache.c 2005-01-05 01:09:30 UTC (rev 12810) @@ -292,7 +292,6 @@ ShellBigIconList = 0; LeaveCriticalSection(&SHELL32_SicCS); - DeleteCriticalSection(&SHELL32_SicCS); } /*********************************************************************** **
19 years, 10 months
1
0
0
0
[sedwards] 12809: add ftp to the bootcd as well
by sedwards@svn.reactos.com
add ftp to the bootcd as well Modified: trunk/reactos/bootdata/packages/reactos.dff _____ Modified: trunk/reactos/bootdata/packages/reactos.dff --- trunk/reactos/bootdata/packages/reactos.dff 2005-01-05 00:03:42 UTC (rev 12808) +++ trunk/reactos/bootdata/packages/reactos.dff 2005-01-05 00:08:45 UTC (rev 12809) @@ -163,6 +163,7 @@ apps\utils\net\arp\arp.exe 1 apps\utils\net\route\route.exe 1 apps\utils\net\finger\finger.exe 1 +apps\utils\net\ftp\ftp.exe 1 apps\utils\net\ipconfig\ipconfig.exe 1 apps\utils\net\netstat\netstat.exe 1 apps\utils\net\ping\ping.exe 1
19 years, 10 months
1
0
0
0
[sedwards] 12808: add ftp to the build
by sedwards@svn.reactos.com
add ftp to the build Modified: trunk/reactos/apps/utils/Makefile _____ Modified: trunk/reactos/apps/utils/Makefile --- trunk/reactos/apps/utils/Makefile 2005-01-04 23:36:14 UTC (rev 12807) +++ trunk/reactos/apps/utils/Makefile 2005-01-05 00:03:42 UTC (rev 12808) @@ -11,7 +11,7 @@ # cabman cat net objdir partinfo pice ps sc stats UTIL_APPS = cat objdir partinfo pnpdump sc shutdown stats tickcount consw rundll32 ps -UTIL_NET_APPS = arp finger ipconfig netstat ping route telnet whois +UTIL_NET_APPS = arp finger ftp ipconfig netstat ping route telnet whois all: $(UTIL_APPS) $(UTIL_NET_APPS)
19 years, 10 months
1
0
0
0
[narnaoud] 12807: Use build helpers from /reactos/tools/
by narnaoud@svn.reactos.com
Use build helpers from /reactos/tools/ Modified: trunk/rosapps/sysutils/regexpl/Makefile Modified: trunk/rosapps/sysutils/regexpl/SecurityDescriptor.cpp Modified: trunk/rosapps/sysutils/regexpl/ph.h _____ Modified: trunk/rosapps/sysutils/regexpl/Makefile --- trunk/rosapps/sysutils/regexpl/Makefile 2005-01-04 22:44:50 UTC (rev 12806) +++ trunk/rosapps/sysutils/regexpl/Makefile 2005-01-04 23:36:14 UTC (rev 12807) @@ -5,22 +5,13 @@ PATH_TO_TOP := ../../../reactos -include $(PATH_TO_TOP)/rules.mak +TARGET_TYPE = program -TARGET_NAME=regexpl +TARGET_APPTYPE = console -all: $(TARGET_NAME).exe +TARGET_NAME = regexpl -ROS_DIR=../../../reactos -ROS_INC=$(ROS_DIR)/include -ROS_LIB=$(ROS_DIR)/dk/w32/lib -IMPORT_NTDLL=$(ROS_LIB)/libntdll.a -IMPORT_FMIFS=$(ROS_LIB)/libfmifs.a -IMPORT_KERNEL32=$(ROS_LIB)/libkernel32.a -IMPORT_ADVAPI32=$(ROS_LIB)/libadvapi32.a -IMPORT_USER32=$(ROS_LIB)/libuser32.a - -OBJECTS = \ +TARGET_OBJECTS = \ ArgumentParser.o \ Console.o \ RegistryExplorer.o \ @@ -43,48 +34,25 @@ ShellCommandValue.o \ ShellCommandVersion.o \ ShellCommandsLinkedList.o \ - CrtSupplement.c \ + CrtSupplement.o \ TextHistory.o \ Completion.o \ Pattern.o \ Settings.o \ Prompt.o -CLEAN_FILES = \ - *.o \ - $(TARGET_NAME).exe \ - $(TARGET_NAME).sym +TARGET_CFLAGS = -Wall -Werror -D__USE_W32API -DUNICODE -D_UNICODE -I./ -$(TARGET_NAME).exe: $(OBJECTS) - $(CXX) -Wl,--subsystem,console -o $(TARGET_NAME).exe $(OBJECTS)$(IMPORT_KERNEL32) $(IMPORT_USER32) - $(NM) --numeric-sort $(TARGET_NAME).exe > $(TARGET_NAME).sym +include $(PATH_TO_TOP)/rules.mak -clean: $(CLEAN_FILES:%=%_clean) +include $(TOOLS_PATH)/helper.mk -$(CLEAN_FILES:%=%_clean): %_clean: - - $(RM) $* +# C++ code should be linked with c++ aware linker (g++) +LD_CC = $(CXX) -.phony: clean $(CLEAN_FILES:%=%_clean) +# Automatic dependency tracking +DEP_OBJECTS := $(TARGET_OBJECTS) +include $(PATH_TO_TOP)/tools/depend.mk -floppy: $(TARGET:%=$(FLOPPY_DIR)/apps/%) - -$(TARGET:%=$(FLOPPY_DIR)/apps/%): $(FLOPPY_DIR)/apps/%: % -ifeq ($(DOSCLI),yes) - $(CP) $* $(FLOPPY_DIR)\apps\$* -else - $(CP) $* $(FLOPPY_DIR)/apps/$* -endif - - -dist: $(TARGET:%=../$(DIST_DIR)/apps/%) - -$(TARGET:%=../$(DIST_DIR)/apps/%): ../$(DIST_DIR)/apps/%: % -ifeq ($(DOSCLI),yes) - $(CP) $* ..\$(DIST_DIR)\apps\$* -else - $(CP) $* ../$(DIST_DIR)/apps\$* -endif - - # EOF _____ Modified: trunk/rosapps/sysutils/regexpl/SecurityDescriptor.cpp --- trunk/rosapps/sysutils/regexpl/SecurityDescriptor.cpp 2005-01-04 22:44:50 UTC (rev 12806) +++ trunk/rosapps/sysutils/regexpl/SecurityDescriptor.cpp 2005-01-04 23:36:14 UTC (rev 12807) @@ -24,13 +24,9 @@ // ////////////////////////////////////////////////////////////////////// -#include <windows.h> -#include <assert.h> -#include <tchar.h> +#include "ph.h" #include "SecurityDescriptor.h" -#define ASSERT assert - // *** THIS SHOULD GO IN A MINGW/ROS HEADER - Begin #if 1 _____ Modified: trunk/rosapps/sysutils/regexpl/ph.h --- trunk/rosapps/sysutils/regexpl/ph.h 2005-01-04 22:44:50 UTC (rev 12806) +++ trunk/rosapps/sysutils/regexpl/ph.h 2005-01-04 23:36:14 UTC (rev 12807) @@ -1,4 +1,4 @@ -/* $Id: ph.h,v 1.5 2004/10/11 01:24:22 sedwards Exp $ */ +/* $Id$ */ // ph.h : include file for standard system include files, // or project specific include files that are used frequently, but @@ -18,24 +18,29 @@ #define _DEBUG #endif -#include <tchar.h> +#include <stdarg.h> -#include <stdio.h> -#include <stdlib.h> -#include <wchar.h> +#include <windef.h> +#include <wincon.h> +#include <winbase.h> +#include <wingdi.h> +#include <winuser.h> +#include <winreg.h> + #include <assert.h> -#include <ctype.h> -#include <tchar.h> #define ASSERT assert #ifdef _DEBUG #define VERIFY ASSERT #else #define VERIFY(e) (e) #endif -#include <windows.h> -#include <wincon.h> + #include <conio.h> #include <limits.h> +#include <tchar.h> +#include <stdio.h> +#include <stdlib.h> +#include <ctype.h> // INHERITED_ACE is from windows 2000 #ifndef INHERITED_ACE
19 years, 10 months
1
0
0
0
[ion] 12806: Use proper PISID pointer to SID structure, fix wrong LUID definition, and remove duplicate code in Security Manager
by ion@svn.reactos.com
Use proper PISID pointer to SID structure, fix wrong LUID definition, and remove duplicate code in Security Manager Modified: trunk/reactos/include/ntdll/rtl.h Modified: trunk/reactos/include/ntos/obtypes.h Modified: trunk/reactos/include/ntos/security.h Modified: trunk/reactos/lib/rtl/sid.c Modified: trunk/reactos/ntoskrnl/se/luid.c Modified: trunk/reactos/ntoskrnl/se/sd.c Modified: trunk/reactos/ntoskrnl/se/sid.c Modified: trunk/reactos/ntoskrnl/se/token.c _____ Modified: trunk/reactos/include/ntdll/rtl.h --- trunk/reactos/include/ntdll/rtl.h 2005-01-04 22:40:08 UTC (rev 12805) +++ trunk/reactos/include/ntdll/rtl.h 2005-01-04 22:44:50 UTC (rev 12806) @@ -193,6 +193,18 @@ VOID ); +VOID +STDCALL +RtlpFreeDebugInfo( + PRTL_CRITICAL_SECTION_DEBUG DebugInfo +); + +PRTL_CRITICAL_SECTION_DEBUG +STDCALL +RtlpAllocateDebugInfo( + VOID +); + NTSTATUS STDCALL RtlAddAccessAllowedAceEx (IN OUT PACL Acl, IN ULONG Revision, _____ Modified: trunk/reactos/include/ntos/obtypes.h --- trunk/reactos/include/ntos/obtypes.h 2005-01-04 22:40:08 UTC (rev 12805) +++ trunk/reactos/include/ntos/obtypes.h 2005-01-04 22:44:50 UTC (rev 12806) @@ -83,8 +83,8 @@ HANDLE RootDirectory; PUNICODE_STRING ObjectName; ULONG Attributes; - SECURITY_DESCRIPTOR *SecurityDescriptor; - SECURITY_QUALITY_OF_SERVICE *SecurityQualityOfService; + PVOID SecurityDescriptor; + PVOID SecurityQualityOfService; } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES; #endif /* __USE_W32API */ _____ Modified: trunk/reactos/include/ntos/security.h --- trunk/reactos/include/ntos/security.h 2005-01-04 22:40:08 UTC (rev 12805) +++ trunk/reactos/include/ntos/security.h 2005-01-04 22:44:50 UTC (rev 12806) @@ -74,6 +74,18 @@ #ifndef __USE_W32API +#ifndef _MSC_VER +#define SYSTEM_LUID {{ 0x3E7, 0x0 }} +#define ANONYMOUS_LOGON_LUID {{ 0x3e6, 0x0 }} +#define LOCALSERVICE_LUID {{ 0x3e5, 0x0 }} +#define NETWORKSERVICE_LUID {{ 0x3e4, 0x0 }} +#else +#define SYSTEM_LUID { 0x3E7, 0x0 } +#define ANONYMOUS_LOGON_LUID { 0x3e6, 0x0 } +#define LOCALSERVICE_LUID { 0x3e5, 0x0 } +#define NETWORKSERVICE_LUID { 0x3e4, 0x0 } +#endif + /* SID Auhority */ #define SECURITY_NULL_SID_AUTHORITY {0,0,0,0,0,0} #define SECURITY_WORLD_SID_AUTHORITY {0,0,0,0,0,1} @@ -227,8 +239,10 @@ UCHAR SubAuthorityCount; SID_IDENTIFIER_AUTHORITY IdentifierAuthority; ULONG SubAuthority[1]; -} SID, *PSID; +} SID, *PISID; +typedef PVOID PSID; + typedef struct _ACL { UCHAR AclRevision; _____ Modified: trunk/reactos/lib/rtl/sid.c --- trunk/reactos/lib/rtl/sid.c 2005-01-04 22:40:08 UTC (rev 12805) +++ trunk/reactos/lib/rtl/sid.c 2005-01-04 22:44:50 UTC (rev 12806) @@ -1,4 +1,4 @@ -/* $Id: sid.c,v 1.4 2004/07/12 19:39:29 ekohl Exp $ +/* $Id$ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -22,8 +22,10 @@ /* FUNCTIONS ***************************************************************/ BOOLEAN STDCALL -RtlValidSid(IN PSID Sid) +RtlValidSid(IN PSID Sid_) { + PISID Sid = Sid_; + if ((Sid->Revision != SID_REVISION) || (Sid->SubAuthorityCount > SID_MAX_SUB_AUTHORITIES)) { @@ -48,10 +50,12 @@ * @implemented */ NTSTATUS STDCALL -RtlInitializeSid(IN PSID Sid, +RtlInitializeSid(IN PSID Sid_, IN PSID_IDENTIFIER_AUTHORITY IdentifierAuthority, IN UCHAR SubAuthorityCount) { + PISID Sid = Sid_; + Sid->Revision = SID_REVISION; Sid->SubAuthorityCount = SubAuthorityCount; memcpy(&Sid->IdentifierAuthority, @@ -66,9 +70,11 @@ * @implemented */ PULONG STDCALL -RtlSubAuthoritySid(IN PSID Sid, +RtlSubAuthoritySid(IN PSID Sid_, IN ULONG SubAuthority) { + PISID Sid = Sid_; + return &Sid->SubAuthority[SubAuthority]; } @@ -77,8 +83,10 @@ * @implemented */ PUCHAR STDCALL -RtlSubAuthorityCountSid(IN PSID Sid) +RtlSubAuthorityCountSid(IN PSID Sid_) { + PISID Sid = Sid_; + return &Sid->SubAuthorityCount; } @@ -87,9 +95,12 @@ * @implemented */ BOOLEAN STDCALL -RtlEqualSid(IN PSID Sid1, - IN PSID Sid2) +RtlEqualSid(IN PSID Sid1_, + IN PSID Sid2_) { + PISID Sid1 = Sid1_; + PISID Sid2 = Sid2_; + if (Sid1->Revision != Sid2->Revision) { return(FALSE); @@ -110,8 +121,10 @@ * @implemented */ ULONG STDCALL -RtlLengthSid(IN PSID Sid) +RtlLengthSid(IN PSID Sid_) { + PISID Sid = Sid_; + return (sizeof(SID) + (Sid->SubAuthorityCount-1) * sizeof(ULONG)); } @@ -180,8 +193,10 @@ * @implemented */ PSID_IDENTIFIER_AUTHORITY STDCALL -RtlIdentifierAuthoritySid(IN PSID Sid) +RtlIdentifierAuthoritySid(IN PSID Sid_) { + PISID Sid = Sid_; + return &Sid->IdentifierAuthority; } @@ -202,7 +217,7 @@ ULONG SubAuthority7, PSID *Sid) { - PSID pSid; + PISID pSid; if (SubAuthorityCount > 8) return STATUS_INVALID_SID; @@ -267,9 +282,12 @@ * @implemented */ BOOLEAN STDCALL -RtlEqualPrefixSid(IN PSID Sid1, - IN PSID Sid2) +RtlEqualPrefixSid(IN PSID Sid1_, + IN PSID Sid2_) { + PISID Sid1 = Sid1_; + PISID Sid2 = Sid2_; + return(Sid1->SubAuthorityCount == Sid2->SubAuthorityCount && !RtlCompareMemory(Sid1, Sid2, (Sid1->SubAuthorityCount - 1) * sizeof(DWORD) + 8)); @@ -281,13 +299,14 @@ */ NTSTATUS STDCALL RtlConvertSidToUnicodeString(PUNICODE_STRING String, - PSID Sid, + PSID Sid_, BOOLEAN AllocateBuffer) { WCHAR Buffer[256]; PWSTR wcs; ULONG Length; ULONG i; + PISID Sid = Sid_; if (RtlValidSid (Sid) == FALSE) return STATUS_INVALID_SID; _____ Modified: trunk/reactos/ntoskrnl/se/luid.c --- trunk/reactos/ntoskrnl/se/luid.c 2005-01-04 22:40:08 UTC (rev 12805) +++ trunk/reactos/ntoskrnl/se/luid.c 2005-01-04 22:44:50 UTC (rev 12806) @@ -1,4 +1,4 @@ -/* $Id: luid.c,v 1.10 2004/08/15 16:39:11 chorns Exp $ +/* $Id$ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -20,15 +20,15 @@ static LARGE_INTEGER LuidIncrement; static LARGE_INTEGER LuidValue; -#define SYSTEM_LUID 0x3E7; - /* FUNCTIONS *****************************************************************/ VOID INIT_FUNCTION SepInitLuid(VOID) { + LARGE_INTEGER DummyLuidValue = SYSTEM_LUID; + KeInitializeSpinLock(&LuidLock); - LuidValue.QuadPart = SYSTEM_LUID; + LuidValue = DummyLuidValue; LuidIncrement.QuadPart = 1; } _____ Modified: trunk/reactos/ntoskrnl/se/sd.c --- trunk/reactos/ntoskrnl/se/sd.c 2005-01-04 22:40:08 UTC (rev 12805) +++ trunk/reactos/ntoskrnl/se/sd.c 2005-01-04 22:44:50 UTC (rev 12806) @@ -1,4 +1,4 @@ -/* $Id: sd.c,v 1.20 2004/08/15 16:39:12 chorns Exp $ +/* $Id$ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -319,7 +319,7 @@ IN PSECURITY_DESCRIPTOR SecurityDescriptor) { ULONG SdLength; - PSID Sid; + PISID Sid; PACL Acl; if (Length < SECURITY_DESCRIPTOR_MIN_LENGTH) @@ -355,7 +355,7 @@ return FALSE; } - Sid = (PSID)((ULONG_PTR)SecurityDescriptor + (ULONG_PTR)SecurityDescriptor->Owner); + Sid = (PISID)((ULONG_PTR)SecurityDescriptor + (ULONG_PTR)SecurityDescriptor->Owner); if (Sid->Revision != SID_REVISION) { DPRINT1("Invalid Owner SID revision\n"); _____ Modified: trunk/reactos/ntoskrnl/se/sid.c --- trunk/reactos/ntoskrnl/se/sid.c 2005-01-04 22:40:08 UTC (rev 12805) +++ trunk/reactos/ntoskrnl/se/sid.c 2005-01-04 22:44:50 UTC (rev 12806) @@ -1,4 +1,4 @@ -/* $Id: sid.c,v 1.16 2003/12/30 18:52:06 fireball Exp $ +/* $Id$ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,9 +11,9 @@ /* INCLUDES *****************************************************************/ -#include <ddk/ntddk.h> -#include <internal/se.h> +#include <ntoskrnl.h> +#define NDEBUG #include <internal/debug.h> #define TAG_SID TAG('S', 'I', 'D', 'T') @@ -467,230 +467,4 @@ return(TRUE); } - -/* - * @implemented - */ -BOOLEAN STDCALL -RtlValidSid(PSID Sid) -{ - if ((Sid->Revision & 0xf) != 1) - { - return(FALSE); - } - if (Sid->SubAuthorityCount > 15) - { - return(FALSE); - } - return(TRUE); -} - - -/* - * @implemented - */ -ULONG STDCALL -RtlLengthRequiredSid(UCHAR SubAuthorityCount) -{ - return(sizeof(SID) + (SubAuthorityCount - 1) * sizeof(ULONG)); -} - - -/* - * @implemented - */ -NTSTATUS STDCALL -RtlInitializeSid(PSID Sid, - PSID_IDENTIFIER_AUTHORITY IdentifierAuthority, - UCHAR SubAuthorityCount) -{ - Sid->Revision = 1; - Sid->SubAuthorityCount = SubAuthorityCount; - RtlCopyMemory(&Sid->IdentifierAuthority, - IdentifierAuthority, - sizeof(SID_IDENTIFIER_AUTHORITY)); - return(STATUS_SUCCESS); -} - - -/* - * @implemented - */ -PULONG STDCALL -RtlSubAuthoritySid(PSID Sid, - ULONG SubAuthority) -{ - return(&Sid->SubAuthority[SubAuthority]); -} - - -/* - * @implemented - */ -PUCHAR STDCALL -RtlSubAuthorityCountSid(PSID Sid) -{ - return(&Sid->SubAuthorityCount); -} - - -/* - * @implemented - */ -BOOLEAN STDCALL -RtlEqualSid(PSID Sid1, - PSID Sid2) -{ - if (Sid1->Revision != Sid2->Revision) - { - return(FALSE); - } - if ((*RtlSubAuthorityCountSid(Sid1)) != - (*RtlSubAuthorityCountSid(Sid2))) - { - return(FALSE); - } - if (memcmp(Sid1, Sid2, RtlLengthSid(Sid1)) != 0) - { - return(FALSE); - } - return(TRUE); -} - - -/* - * @implemented - */ -ULONG STDCALL -RtlLengthSid(PSID Sid) -{ - return(sizeof(SID) + (Sid->SubAuthorityCount-1)*4); -} - - -/* - * @implemented - */ -NTSTATUS STDCALL -RtlCopySid(ULONG BufferLength, - PSID Dest, - PSID Src) -{ - if (BufferLength < RtlLengthSid(Src)) - { - return(STATUS_UNSUCCESSFUL); - } - memmove(Dest, Src, RtlLengthSid(Src)); - return(STATUS_SUCCESS); -} - - -NTSTATUS STDCALL -RtlCopySidAndAttributesArray(ULONG Count, - PSID_AND_ATTRIBUTES Src, - ULONG SidAreaSize, - PSID_AND_ATTRIBUTES Dest, - PVOID SidArea, - PVOID* RemainingSidArea, - PULONG RemainingSidAreaSize) -{ - ULONG Length; - ULONG i; - - Length = SidAreaSize; - - for (i=0; i<Count; i++) - { - if (RtlLengthSid(Src[i].Sid) > Length) - { - return(STATUS_BUFFER_TOO_SMALL); - } - Length = Length - RtlLengthSid(Src[i].Sid); - Dest[i].Sid = SidArea; - Dest[i].Attributes = Src[i].Attributes; - RtlCopySid(RtlLengthSid(Src[i].Sid), SidArea, Src[i].Sid); - SidArea = (char*)SidArea + RtlLengthSid(Src[i].Sid); - } - *RemainingSidArea = SidArea; - *RemainingSidAreaSize = Length; - return(STATUS_SUCCESS); -} - - -/* - * @implemented - */ -NTSTATUS STDCALL -RtlConvertSidToUnicodeString(PUNICODE_STRING String, - PSID Sid, - BOOLEAN AllocateString) -{ - WCHAR Buffer[256]; - PWSTR Ptr; - ULONG Length; - ULONG i; - - if (!RtlValidSid(Sid)) - return STATUS_INVALID_SID; - - Ptr = Buffer; - Ptr += swprintf (Ptr, - L"S-%u-", - Sid->Revision); - - if(!Sid->IdentifierAuthority.Value[0] && - !Sid->IdentifierAuthority.Value[1]) - { - Ptr += swprintf(Ptr, - L"%u", - (ULONG)Sid->IdentifierAuthority.Value[2] << 24 | - (ULONG)Sid->IdentifierAuthority.Value[3] << 16 | - (ULONG)Sid->IdentifierAuthority.Value[4] << 8 | - (ULONG)Sid->IdentifierAuthority.Value[5]); - } - else - { - Ptr += swprintf(Ptr, - L"0x%02hx%02hx%02hx%02hx%02hx%02hx", - Sid->IdentifierAuthority.Value[0], - Sid->IdentifierAuthority.Value[1], - Sid->IdentifierAuthority.Value[2], - Sid->IdentifierAuthority.Value[3], - Sid->IdentifierAuthority.Value[4], - Sid->IdentifierAuthority.Value[5]); - } - - for (i = 0; i < Sid->SubAuthorityCount; i++) - { - Ptr += swprintf(Ptr, - L"-%u", - Sid->SubAuthority[i]); - } - - Length = (Ptr - Buffer) * sizeof(WCHAR); - - if (AllocateString) - { - String->Buffer = ExAllocatePool(NonPagedPool, - Length + sizeof(WCHAR)); - if (String->Buffer == NULL) - return STATUS_NO_MEMORY; - - String->MaximumLength = Length + sizeof(WCHAR); - } - else - { - if (Length > String->MaximumLength) - return STATUS_BUFFER_TOO_SMALL; - } - String->Length = Length; - memmove(String->Buffer, - Buffer, - Length); - if (Length < String->MaximumLength) - String->Buffer[Length/sizeof(WCHAR)] = 0; - - return STATUS_SUCCESS; -} - /* EOF */ _____ Modified: trunk/reactos/ntoskrnl/se/token.c --- trunk/reactos/ntoskrnl/se/token.c 2005-01-04 22:40:08 UTC (rev 12805) +++ trunk/reactos/ntoskrnl/se/token.c 2005-01-04 22:44:50 UTC (rev 12806) @@ -11,13 +11,7 @@ /* INCLUDES *****************************************************************/ -#include <limits.h> -#define NTOS_MODE_KERNEL -#include <ntos.h> -#include <internal/ob.h> -#include <internal/ps.h> -#include <internal/se.h> -#include <internal/safe.h> +#include <ntoskrnl.h> #define NDEBUG #include <internal/debug.h> @@ -31,8 +25,6 @@ TOKEN_EXECUTE, TOKEN_ALL_ACCESS}; -//#define SYSTEM_LUID 0x3E7; - /* FUNCTIONS *****************************************************************/ VOID SepFreeProxyData(PVOID ProxyData) @@ -1028,6 +1020,7 @@ * NOTE: Some sources claim 4th param is ImpersonationLevel, but on W2K * this is certainly NOT true, thou i can't say for sure that EffectiveOnly * is correct either. -Gunnar + * This is true. EffectiveOnly overrides SQOS.EffectiveOnly. - IAI */ NTSTATUS STDCALL NtDuplicateToken(IN HANDLE ExistingTokenHandle, @@ -1060,7 +1053,7 @@ EffectiveOnly, TokenType, ObjectAttributes->SecurityQualityOfService ? - ObjectAttributes->SecurityQualityOfService->ImpersonationLevel : + ((PSECURITY_QUALITY_OF_SERVICE)(ObjectAttributes->SecurityQualityOfServi ce))->ImpersonationLevel : 0 /*SecurityAnonymous*/, PreviousMode, &NewToken); @@ -1645,7 +1638,8 @@ AccessToken->Privileges = 0; AccessToken->TokenType = TokenType; - AccessToken->ImpersonationLevel = ObjectAttributes->SecurityQualityOfService->ImpersonationLevel; + AccessToken->ImpersonationLevel = ((PSECURITY_QUALITY_OF_SERVICE) + (ObjectAttributes->SecurityQualityOfService))->ImpersonationLevel; /* * Normally we would just point these members into the variable information
19 years, 10 months
1
0
0
0
[chorns] 12805: MinGW backend.
by chorns@svn.reactos.com
MinGW backend. Added: branches/xmlbuildsystem/reactos/tools/rbuild/backend/ Added: branches/xmlbuildsystem/reactos/tools/rbuild/backend/backend.cpp Added: branches/xmlbuildsystem/reactos/tools/rbuild/backend/backend.h Added: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/ Added: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp Added: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.h Modified: branches/xmlbuildsystem/reactos/tools/rbuild/makefile Modified: branches/xmlbuildsystem/reactos/tools/rbuild/project.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h _____ Added: branches/xmlbuildsystem/reactos/tools/rbuild/backend/backend.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/backend.cpp 2005-01-04 22:11:50 UTC (rev 12804) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/backend.cpp 2005-01-04 22:40:08 UTC (rev 12805) @@ -0,0 +1,9 @@ +#ifdef _MSC_VER +#pragma warning ( disable : 4786 ) // identifier was truncated to '255' characters in the debug information +#endif//_MSC_VER + +#include "backend.h" + +Backend::Backend() +{ +} _____ Added: branches/xmlbuildsystem/reactos/tools/rbuild/backend/backend.h --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/backend.h 2005-01-04 22:11:50 UTC (rev 12804) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/backend.h 2005-01-04 22:40:08 UTC (rev 12805) @@ -0,0 +1,14 @@ +#ifndef __BACKEND_H +#define __BACKEND_H + +#include "../rbuild.h" + +class Backend +{ +public: + Backend(); +protected: + Project ProjectNode; +}; + +#endif /* __BACKEND_H */ _____ Added: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp 2005-01-04 22:11:50 UTC (rev 12804) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp 2005-01-04 22:40:08 UTC (rev 12805) @@ -0,0 +1,11 @@ +#ifdef _MSC_VER +#pragma warning ( disable : 4786 ) // identifier was truncated to '255' characters in the debug information +#endif//_MSC_VER +#if 0 +#include "mingw.h" + +MingwBackend::MingwBackend(Project project) + : ProjectNode(project) +{ +} +#endif _____ Added: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.h --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.h 2005-01-04 22:11:50 UTC (rev 12804) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.h 2005-01-04 22:40:08 UTC (rev 12805) @@ -0,0 +1,12 @@ +#ifndef __MINGW_H +#define __MINGW_H +#if 0 +#include "backend.h" + +class MingwBackend : public Backend +{ +public: + MingwBackend(); +}; +#endif +#endif /* __MINGW_H */ _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/makefile --- branches/xmlbuildsystem/reactos/tools/rbuild/makefile 2005-01-04 22:11:50 UTC (rev 12804) +++ branches/xmlbuildsystem/reactos/tools/rbuild/makefile 2005-01-04 22:40:08 UTC (rev 12805) @@ -4,7 +4,15 @@ all: $(TARGET) +BACKEND_MINGW_BASE_OBJECTS = \ + backend/mingw/mingw.cpp + +BACKEND_BASE_OBJECTS = \ + $(BACKEND_MINGW_BASE_OBJECTS) \ + backend/backend.cpp + BASE_OBJECTS = \ + $(BACKEND_BASE_OBJECTS) \ exception.o \ module.o \ project.o \ @@ -19,7 +27,7 @@ TEST_OBJECTS = $(BASE_OBJECTS) $(TESTS) tests/alltests.o -HOST_CFLAGS = -g -I. -Werror -Wall +HOST_CXXFLAGS = -g -I. -Werror -Wall HOST_LFLAGS = -g @@ -45,7 +53,7 @@ %.o: %.cpp $(HALFVERBOSEECHO) [CXX] $< - $(HOST_CXX) $(HOST_CFLAGS) -c $< -o $@ + $(HOST_CXX) $(HOST_CXXFLAGS) -c $< -o $@ test: rbuild_tests$(EXE_POSTFIX) $(EXE_PREFIX)rbuild_tests$(EXE_POSTFIX) _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/project.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/project.cpp 2005-01-04 22:11:50 UTC (rev 12804) +++ branches/xmlbuildsystem/reactos/tools/rbuild/project.cpp 2005-01-04 22:40:08 UTC (rev 12805) @@ -7,6 +7,10 @@ using std::string; using std::vector; +Project::Project() +{ +} + Project::Project(string filename) { if ( !xmlfile.open ( filename ) ) _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h --- branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h 2005-01-04 22:11:50 UTC (rev 12804) +++ branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h 2005-01-04 22:40:08 UTC (rev 12805) @@ -17,6 +17,7 @@ std::string name; std::vector<Module*> modules; + Project (); Project ( string filename ); ~Project (); void ProcessXML ( const XMLElement& e, const std::string& path );
19 years, 10 months
1
0
0
0
← Newer
1
...
54
55
56
57
58
59
60
...
71
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Results per page:
10
25
50
100
200