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
December
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 -----
December 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
[ekohl] 12704: Connect client and server side upon client side creation only if both sides were created by the same thread.
by ekohl@svn.reactos.com
Connect client and server side upon client side creation only if both sides were created by the same thread. Modified: trunk/reactos/drivers/fs/np/create.c Modified: trunk/reactos/drivers/fs/np/fsctrl.c Modified: trunk/reactos/drivers/fs/np/npfs.h _____ Modified: trunk/reactos/drivers/fs/np/create.c --- trunk/reactos/drivers/fs/np/create.c 2005-01-01 14:35:46 UTC (rev 12703) +++ trunk/reactos/drivers/fs/np/create.c 2005-01-01 14:54:25 UTC (rev 12704) @@ -1,4 +1,4 @@ -/* $Id: create.c,v 1.28 2004/12/30 16:15:10 ekohl Exp $ +/* $Id$ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -157,6 +157,7 @@ return STATUS_NO_MEMORY; } + ClientFcb->Thread = (struct ETHREAD *)Irp->Tail.Overlay.Thread; ClientFcb->Pipe = Pipe; ClientFcb->PipeEnd = FILE_PIPE_CLIENT_END; ClientFcb->OtherSide = NULL; @@ -197,7 +198,8 @@ /* Add the client FCB to the pipe FCB list. */ InsertTailList(&Pipe->ClientFcbListHead, &ClientFcb->FcbListEntry); - if (ServerFcb) + /* Connect pipes if they were created by the same thread */ + if (ServerFcb && ServerFcb->Thread == ClientFcb->Thread) { ClientFcb->OtherSide = ServerFcb; ServerFcb->OtherSide = ClientFcb; @@ -254,6 +256,7 @@ return STATUS_NO_MEMORY; } + Fcb->Thread = (struct ETHREAD *)Irp->Tail.Overlay.Thread; KeLockMutex(&DeviceExt->PipeListLock); /* _____ Modified: trunk/reactos/drivers/fs/np/fsctrl.c --- trunk/reactos/drivers/fs/np/fsctrl.c 2005-01-01 14:35:46 UTC (rev 12703) +++ trunk/reactos/drivers/fs/np/fsctrl.c 2005-01-01 14:54:25 UTC (rev 12704) @@ -1,4 +1,4 @@ -/* $Id: fsctrl.c,v 1.18 2004/12/30 12:34:27 ekohl Exp $ +/* $Id$ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -59,7 +59,6 @@ break; } - #if 0 if (ClientFcb->PipeState == FILE_PIPE_LISTENING_STATE) { _____ Modified: trunk/reactos/drivers/fs/np/npfs.h --- trunk/reactos/drivers/fs/np/npfs.h 2005-01-01 14:35:46 UTC (rev 12703) +++ trunk/reactos/drivers/fs/np/npfs.h 2005-01-01 14:54:25 UTC (rev 12704) @@ -1,4 +1,4 @@ -/* $Id: npfs.h,v 1.17 2004/05/10 19:58:10 navaraf Exp $ */ +/* $Id$ */ #ifndef __SERVICES_FS_NP_NPFS_H #define __SERVICES_FS_NP_NPFS_H @@ -9,7 +9,7 @@ */ #define FIN_WORKAROUND_READCLOSE -typedef struct +typedef struct _NPFS_DEVICE_EXTENSION { LIST_ENTRY PipeListHead; KMUTEX PipeListLock; @@ -18,7 +18,7 @@ ULONG MaxQuota; } NPFS_DEVICE_EXTENSION, *PNPFS_DEVICE_EXTENSION; -typedef struct +typedef struct _NPFS_PIPE { UNICODE_STRING PipeName; LIST_ENTRY PipeListEntry; @@ -41,6 +41,7 @@ { LIST_ENTRY FcbListEntry; struct _NPFS_FCB* OtherSide; + struct ETHREAD *Thread; PNPFS_PIPE Pipe; KEVENT ConnectEvent; KEVENT Event;
19 years, 11 months
1
0
0
0
[hbirr] 12703: - Fixed a debug message in KeConnectInterrupt.
by hbirr@svn.reactos.com
- Fixed a debug message in KeConnectInterrupt. Modified: trunk/reactos/ntoskrnl/ke/i386/irq.c _____ Modified: trunk/reactos/ntoskrnl/ke/i386/irq.c --- trunk/reactos/ntoskrnl/ke/i386/irq.c 2005-01-01 14:06:39 UTC (rev 12702) +++ trunk/reactos/ntoskrnl/ke/i386/irq.c 2005-01-01 14:35:46 UTC (rev 12703) @@ -493,7 +493,7 @@ synch_oldlvl = KeAcquireInterruptSpinLock(InterruptObject); - DPRINT("%x %x\n",CurrentIsr->ListHead.Flink, CurrentIsr->ListHeads.Blink); + DPRINT("%x %x\n",CurrentIsr->ListHead.Flink, CurrentIsr->ListHead.Blink); Result = HalEnableSystemInterrupt(Vector + IRQ_BASE, InterruptObject->Irql, InterruptObject->InterruptMode); if (Result)
19 years, 11 months
1
0
0
0
[ekohl] 12702: CreatePipe(): Don't open client side in passive mode.
by ekohl@svn.reactos.com
CreatePipe(): Don't open client side in passive mode. Modified: trunk/reactos/lib/kernel32/file/pipe.c _____ Modified: trunk/reactos/lib/kernel32/file/pipe.c --- trunk/reactos/lib/kernel32/file/pipe.c 2005-01-01 13:35:12 UTC (rev 12701) +++ trunk/reactos/lib/kernel32/file/pipe.c 2005-01-01 14:06:39 UTC (rev 12702) @@ -1,4 +1,4 @@ -/* $Id: pipe.c,v 1.12 2004/10/08 23:12:29 weiden Exp $ +/* $Id$ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -37,7 +37,8 @@ NTSTATUS Status; HANDLE ReadPipeHandle; HANDLE WritePipeHandle; - ULONG PipeId, Attributes; + ULONG PipeId; + ULONG Attributes; PSECURITY_DESCRIPTOR SecurityDescriptor = NULL; DefaultTimeout.QuadPart = 300000000; /* 30 seconds */ @@ -54,8 +55,8 @@ if (lpPipeAttributes) { SecurityDescriptor = lpPipeAttributes->lpSecurityDescriptor; - if(lpPipeAttributes->bInheritHandle) - Attributes |= OBJ_INHERIT; + if (lpPipeAttributes->bInheritHandle) + Attributes |= OBJ_INHERIT; } InitializeObjectAttributes(&ObjectAttributes, @@ -88,7 +89,7 @@ FILE_GENERIC_WRITE, &ObjectAttributes, &StatusBlock, - FILE_SHARE_READ | FILE_SHARE_WRITE, + 0, FILE_SYNCHRONOUS_IO_NONALERT | FILE_NON_DIRECTORY_FILE); if (!NT_SUCCESS(Status)) {
19 years, 11 months
1
0
0
0
[gvg] 12701: Need freeldr for 0.2.5
by gvg@svn.reactos.com
Need freeldr for 0.2.5 Added: branches/ros-branch-0_2_5/freeldr/ _____ Copied: branches/ros-branch-0_2_5/freeldr (from rev 12671, trunk/freeldr)
19 years, 11 months
1
0
0
0
[chorns] 12700: Remove ELF_support branch.
by chorns@svn.reactos.com
Remove ELF_support branch. Deleted: branches/ELF_support/
19 years, 11 months
1
0
0
0
[ekohl] 12699: Don't flush the caches of CD/DVD drives.
by ekohl@svn.reactos.com
Don't flush the caches of CD/DVD drives. Modified: trunk/reactos/drivers/storage/atapi/atapi.c _____ Modified: trunk/reactos/drivers/storage/atapi/atapi.c --- trunk/reactos/drivers/storage/atapi/atapi.c 2005-01-01 11:57:53 UTC (rev 12698) +++ trunk/reactos/drivers/storage/atapi/atapi.c 2005-01-01 12:19:21 UTC (rev 12699) @@ -1,6 +1,6 @@ /* * ReactOS kernel - * Copyright (C) 2001, 2002, 2003, 2004 ReactOS Team + * Copyright (C) 2001, 2002, 2003, 2004, 2005 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 @@ -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: atapi.c,v 1.56 2004/11/18 08:32:32 gvg Exp $ +/* $Id$ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS ATAPI miniport driver @@ -114,7 +114,8 @@ #define DEVICE_DWORD_IO 0x00000008 #define DEVICE_48BIT_ADDRESS 0x00000010 #define DEVICE_MEDIA_STATUS 0x00000020 -#define DEVICE_DMA_CMD 0x00000040 +#define DEVICE_DMA_CMD 0x00000040 +#define DEVICE_NO_FLUSH 0x00000080 typedef struct _UNIT_EXTENSION @@ -125,7 +126,7 @@ PCI_SLOT_NUMBER LastSlotNumber; #ifdef ENABLE_NATIVE_PCI -typedef struct _PCI_NATIVE_CONTROLLER +typedef struct _PCI_NATIVE_CONTROLLER { USHORT VendorID; USHORT DeviceID; @@ -1895,6 +1896,12 @@ /* get it from the ATAPI configuration word */ InquiryData->DeviceType = (DeviceParams->ConfigBits >> 8) & 0x1F; DPRINT("Device class: %u\n", InquiryData->DeviceType); + + /* Don't flush CD/DVD drives */ + if (InquiryData->DeviceType == READ_ONLY_DIRECT_ACCESS_DEVICE) + { + DeviceExtension->DeviceFlags[Srb->TargetId] |= DEVICE_NO_FLUSH; + } } else { @@ -1931,7 +1938,7 @@ } InquiryData->AdditionalLength = 31; - + DPRINT("VendorId: '%.20s'\n", InquiryData->VendorId); Srb->SrbStatus = SRB_STATUS_SUCCESS; @@ -2224,6 +2231,18 @@ DPRINT("SCSIOP_SYNCRONIZE_CACHE: TargetId: %lu\n", Srb->TargetId); + if (!(DeviceExtension->DeviceFlags[Srb->TargetId] & DEVICE_NO_FLUSH)) + { + /* + * NOTE: Don't flush the cache for CD/DVD drives. Although + * the ATAPI-6 standard allows that, it has been experimentally + * proved that it can damage some broken LG drives. Afterall + * it doesn't make sense to flush cache on devices we don't + * write to. + */ + return STATUS_SUCCESS; + } + /* Wait for BUSY to clear */ for (Retries = 0; Retries < IDE_MAX_BUSY_RETRIES; Retries++) {
19 years, 11 months
1
0
0
0
[hbirr] 12698: - Check the caller pointers in all cases.
by hbirr@svn.reactos.com
- Check the caller pointers in all cases. - Simplified the thread info functions a little bit. Modified: trunk/reactos/ntoskrnl/ps/tinfo.c _____ Modified: trunk/reactos/ntoskrnl/ps/tinfo.c --- trunk/reactos/ntoskrnl/ps/tinfo.c 2005-01-01 11:53:38 UTC (rev 12697) +++ trunk/reactos/ntoskrnl/ps/tinfo.c 2005-01-01 11:57:53 UTC (rev 12698) @@ -1,4 +1,4 @@ -/* $Id: tinfo.c,v 1.31 2004/11/19 22:19:33 gdalsnes Exp $ +/* $Id$ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -16,6 +16,69 @@ #include <ntoskrnl.h> #include <internal/debug.h> +/* GLOBALS *****************************************************************/ + +/* + * FIXME: + * Remove the Implemented value if all functions are implemented. + */ + +static const struct +{ + BOOLEAN Implemented; + ULONG Size; +} QueryInformationData[MaxThreadInfoClass + 1] = +{ + {TRUE, sizeof(THREAD_BASIC_INFORMATION)}, // ThreadBasicInformation + {TRUE, sizeof(KERNEL_USER_TIMES)}, // ThreadTimes + {TRUE, 0}, // ThreadPriority + {TRUE, 0}, // ThreadBasePriority + {TRUE, 0}, // ThreadAffinityMask + {TRUE, 0}, // ThreadImpersonationToken + {FALSE, 0}, // ThreadDescriptorTableEntry + {TRUE, 0}, // ThreadEnableAlignmentFaultFixup + {TRUE, 0}, // ThreadEventPair + {TRUE, sizeof(PVOID)}, // ThreadQuerySetWin32StartAddress + {TRUE, 0}, // ThreadZeroTlsCell + {TRUE, sizeof(LARGE_INTEGER)}, // ThreadPerformanceCount + {TRUE, sizeof(BOOLEAN)}, // ThreadAmILastThread + {TRUE, 0}, // ThreadIdealProcessor + {FALSE, 0}, // ThreadPriorityBoost + {TRUE, 0}, // ThreadSetTlsArrayAddress + {FALSE, 0}, // ThreadIsIoPending + {TRUE, 0} // ThreadHideFromDebugger +}; + +static const struct +{ + BOOLEAN Implemented; + ULONG Size; +} SetInformationData[MaxThreadInfoClass + 1] = +{ + {TRUE, 0}, // ThreadBasicInformation + {TRUE, 0}, // ThreadTimes + {TRUE, sizeof(KPRIORITY)}, // ThreadPriority + {TRUE, sizeof(LONG)}, // ThreadBasePriority + {TRUE, sizeof(KAFFINITY)}, // ThreadAffinityMask + {TRUE, sizeof(HANDLE)}, // ThreadImpersonationToken + {TRUE, 0}, // ThreadDescriptorTableEntry + {FALSE, 0}, // ThreadEnableAlignmentFaultFixup +#ifdef _ENABLE_THRDEVTPAIR + {TRUE, sizeof(HANDLE)}, // ThreadEventPair +#else + {FALSE, 0}, // ThreadEventPair +#endif + {TRUE, sizeof(PVOID)}, // ThreadQuerySetWin32StartAddress + {FALSE, 0}, // ThreadZeroTlsCell + {TRUE, 0}, // ThreadPerformanceCount + {TRUE, 0}, // ThreadAmILastThread + {FALSE, 0}, // ThreadIdealProcessor + {FALSE, 0}, // ThreadPriorityBoost + {FALSE, 0}, // ThreadSetTlsArrayAddress + {TRUE, 0}, // ThreadIsIoPending + {FALSE, 0} // ThreadHideFromDebugger +}; + /* FUNCTIONS *****************************************************************/ /* @@ -29,7 +92,30 @@ { PETHREAD Thread; NTSTATUS Status; + union + { + KPRIORITY Priority; + LONG Increment; + KAFFINITY Affinity; + HANDLE Handle; + PVOID Address; + }u; + if (ThreadInformationClass <= MaxThreadInfoClass && + !SetInformationData[ThreadInformationClass].Implemented) + { + return STATUS_NOT_IMPLEMENTED; + } + if (ThreadInformationClass > MaxThreadInfoClass || + SetInformationData[ThreadInformationClass].Size == 0) + { + return STATUS_INVALID_INFO_CLASS; + } + if (ThreadInformationLength != SetInformationData[ThreadInformationClass].Size) + { + return STATUS_INFO_LENGTH_MISMATCH; + } + Status = ObReferenceObjectByHandle (ThreadHandle, THREAD_SET_INFORMATION, PsThreadType, @@ -41,174 +127,62 @@ return Status; } - switch (ThreadInformationClass) - { - case ThreadBasicInformation: - /* Can only be queried */ - Status = STATUS_INVALID_INFO_CLASS; - break; + Status = MmCopyFromCaller(&u.Priority, + ThreadInformation, + SetInformationData[ThreadInformationClass].Size); + if (NT_SUCCESS(Status)) + { + switch (ThreadInformationClass) + { + case ThreadPriority: + if (u.Priority < LOW_PRIORITY || u.Priority >= MAXIMUM_PRIORITY) + { + Status = STATUS_INVALID_PARAMETER; + break; + } + KeSetPriorityThread(&Thread->Tcb, u.Priority); + break; - case ThreadTimes: - /* Can only be queried */ - Status = STATUS_INVALID_INFO_CLASS; - break; + case ThreadBasePriority: + KeSetBasePriorityThread (&Thread->Tcb, u.Increment); + break; - case ThreadPriority: - { - KPRIORITY Priority; - - if (ThreadInformationLength != sizeof(KPRIORITY)) - { - Status = STATUS_INFO_LENGTH_MISMATCH; - break; - } - Priority = *(KPRIORITY*)ThreadInformation; - if (Priority < LOW_PRIORITY || Priority >= MAXIMUM_PRIORITY) - { - Status = STATUS_INVALID_PARAMETER; - break; - } - KeSetPriorityThread(&Thread->Tcb, Priority); - Status = STATUS_SUCCESS; - break; - } + case ThreadAffinityMask: + Status = KeSetAffinityThread(&Thread->Tcb, u.Affinity); + break; - case ThreadBasePriority: - { - LONG Increment; - - if (ThreadInformationLength != sizeof(LONG)) - { - Status = STATUS_INFO_LENGTH_MISMATCH; - break; - } - Status = MmCopyFromCaller(&Increment, - ThreadInformation, - sizeof(ULONG)); - if (NT_SUCCESS(Status)) - { - KeSetBasePriorityThread (&Thread->Tcb, Increment); - } - } - break; - - case ThreadAffinityMask: - Thread->Tcb.UserAffinity = *((PULONG)ThreadInformation); - break; - - case ThreadImpersonationToken: - { - HANDLE TokenHandle; - - if (ThreadInformationLength != sizeof(HANDLE)) - { - Status = STATUS_INFO_LENGTH_MISMATCH; - break; - } - TokenHandle = *((PHANDLE)ThreadInformation); - Status = PsAssignImpersonationToken (Thread, - TokenHandle); - break; - } - - case ThreadDescriptorTableEntry: - /* Can only be queried */ - Status = STATUS_INVALID_INFO_CLASS; - break; - + case ThreadImpersonationToken: + Status = PsAssignImpersonationToken (Thread, u.Handle); + break; + #ifdef _ENABLE_THRDEVTPAIR - case ThreadEventPair: - { - PKEVENT_PAIR EventPair; + case ThreadEventPair: + { + PKEVENT_PAIR EventPair; - if (ThreadInformationLength != sizeof(HANDLE)) - { - Status = STATUS_INFO_LENGTH_MISMATCH; - break; - } - - if (ExGetPreviousMode() == UserMode) /* FIXME: Validate this for all infoclasses and system services */ - { - DPRINT("NtSetInformationThread:ThreadEventPair: Checking user pointer %08x...\n", ThreadInformation); - ProbeForRead(ThreadInformation, sizeof(HANDLE), sizeof(HANDLE)); /* FIXME: This entire function should be - * wrapped in an SEH frame... return (NTSTATUS)GetExceptionCode() on exception */ - } - - Status = ObReferenceObjectByHandle(*(PHANDLE)ThreadInformation, - STANDARD_RIGHTS_ALL, - ExEventPairObjectType, - ExGetPreviousMode(), - (PVOID*)&EventPair, - NULL); - - if (!NT_SUCCESS(Status)) - { - break; - } - - ExpSwapThreadEventPair(Thread, EventPair); /* Note that the extra reference is kept intentionally */ - Status = STATUS_SUCCESS; - break; - } -#else /* !_ENABLE_THRDEVTPAIR */ - case ThreadEventPair: - { - Status = STATUS_NOT_IMPLEMENTED; - break; - } + Status = ObReferenceObjectByHandle(u.Handle, + STANDARD_RIGHTS_ALL, + ExEventPairObjectType, + ExGetPreviousMode(), + (PVOID*)&EventPair, + NULL); + if (NT_SUCCESS(Status)) + { + ExpSwapThreadEventPair(Thread, EventPair); /* Note that the extra reference is kept intentionally */ + } + break; + } #endif /* _ENABLE_THRDEVTPAIR */ - case ThreadQuerySetWin32StartAddress: - if (ThreadInformationLength != sizeof(ULONG)) - { - Status = STATUS_INFO_LENGTH_MISMATCH; - break; - } - Thread->Win32StartAddress = (PVOID)*((PULONG)ThreadInformation); - Status = STATUS_SUCCESS; - break; + case ThreadQuerySetWin32StartAddress: + Thread->Win32StartAddress = u.Address; + break; - case ThreadZeroTlsCell: - { - Status = STATUS_NOT_IMPLEMENTED; - break; - } - - case ThreadPerformanceCount: - /* Can only be queried */ - Status = STATUS_INVALID_INFO_CLASS; - break; - - case ThreadAmILastThread: - /* Can only be queried */ - Status = STATUS_INVALID_INFO_CLASS; - break; - - case ThreadIdealProcessor: - Status = STATUS_NOT_IMPLEMENTED; - break; - - case ThreadPriorityBoost: - Status = STATUS_NOT_IMPLEMENTED; - break; - - case ThreadSetTlsArrayAddress: - Status = STATUS_NOT_IMPLEMENTED; - break; - - case ThreadIsIoPending: - /* Can only be queried */ - Status = STATUS_INVALID_INFO_CLASS; - break; - - case ThreadHideFromDebugger: - Status = STATUS_NOT_IMPLEMENTED; - break; - - default: - Status = STATUS_UNSUCCESSFUL; - } - + default: + /* Shoult never occure if the data table is correct */ + KEBUGCHECK(0); + } + } ObDereferenceObject (Thread); return Status; @@ -226,7 +200,30 @@ { PETHREAD Thread; NTSTATUS Status; + union + { + THREAD_BASIC_INFORMATION TBI; + KERNEL_USER_TIMES TTI; + PVOID Address; + LARGE_INTEGER Count; + BOOLEAN Last; + }u; + if (ThreadInformationClass <= MaxThreadInfoClass && + !QueryInformationData[ThreadInformationClass].Implemented) + { + return STATUS_NOT_IMPLEMENTED; + } + if (ThreadInformationClass > MaxThreadInfoClass || + QueryInformationData[ThreadInformationClass].Size == 0) + { + return STATUS_INVALID_INFO_CLASS; + } + if (ThreadInformationLength != QueryInformationData[ThreadInformationClass].Size) + { + return STATUS_INFO_LENGTH_MISMATCH; + } + Status = ObReferenceObjectByHandle(ThreadHandle, THREAD_QUERY_INFORMATION, PsThreadType, @@ -240,161 +237,70 @@ switch (ThreadInformationClass) { - case ThreadBasicInformation: - { - PTHREAD_BASIC_INFORMATION TBI; - - TBI = (PTHREAD_BASIC_INFORMATION)ThreadInformation; - - if (ThreadInformationLength != sizeof(THREAD_BASIC_INFORMATION)) - { - Status = STATUS_INFO_LENGTH_MISMATCH; - break; - } - - /* A test on W2K agains ntdll shows NtQueryInformationThread return STATUS_PENDING - * as ExitStatus for current/running thread, while KETHREAD's ExitStatus is - * 0. So do the conversion here: - * -Gunnar */ - TBI->ExitStatus = (Thread->ExitStatus == 0) ? STATUS_PENDING : Thread->ExitStatus; - TBI->TebBaseAddress = Thread->Tcb.Teb; - TBI->ClientId = Thread->Cid; - TBI->AffinityMask = Thread->Tcb.Affinity; - TBI->Priority = Thread->Tcb.Priority; - TBI->BasePriority = Thread->Tcb.BasePriority; - Status = STATUS_SUCCESS; + case ThreadBasicInformation: + /* A test on W2K agains ntdll shows NtQueryInformationThread return STATUS_PENDING + * as ExitStatus for current/running thread, while KETHREAD's ExitStatus is + * 0. So do the conversion here: + * -Gunnar */ + u.TBI.ExitStatus = (Thread->ExitStatus == 0) ? STATUS_PENDING : Thread->ExitStatus; + u.TBI.TebBaseAddress = Thread->Tcb.Teb; + u.TBI.ClientId = Thread->Cid; + u.TBI.AffinityMask = Thread->Tcb.Affinity; + u.TBI.Priority = Thread->Tcb.Priority; + u.TBI.BasePriority = Thread->Tcb.BasePriority; break; - } - case ThreadTimes: - { - PKERNEL_USER_TIMES TTI; - - TTI = (PKERNEL_USER_TIMES)ThreadInformation; - - if (ThreadInformationLength != sizeof(KERNEL_USER_TIMES)) - { - Status = STATUS_INFO_LENGTH_MISMATCH; - break; - } + case ThreadTimes: + u.TTI.KernelTime.QuadPart = Thread->Tcb.KernelTime * 100000LL; + u.TTI.UserTime.QuadPart = Thread->Tcb.UserTime * 100000LL; + u.TTI.CreateTime = (TIME) Thread->CreateTime; + /*This works*/ + u.TTI.ExitTime = (TIME) Thread->ExitTime; + break; - TTI->KernelTime.QuadPart = Thread->Tcb.KernelTime * 100000LL; - TTI->UserTime.QuadPart = Thread->Tcb.UserTime * 100000LL; - TTI->CreateTime = (TIME) Thread->CreateTime; - /*This works*/ - TTI->ExitTime = (TIME) Thread->ExitTime; - - Status = STATUS_SUCCESS; - break; - } - - case ThreadPriority: - /* Can be set only */ - Status = STATUS_INVALID_INFO_CLASS; - break; - - case ThreadBasePriority: - /* Can be set only */ - Status = STATUS_INVALID_INFO_CLASS; - break; - - case ThreadAffinityMask: - /* Can be set only */ - Status = STATUS_INVALID_INFO_CLASS; - break; + case ThreadQuerySetWin32StartAddress: + u.Address = Thread->Win32StartAddress; + break; - case ThreadImpersonationToken: - /* Can be set only */ - Status = STATUS_INVALID_INFO_CLASS; - break; - - case ThreadDescriptorTableEntry: - /* Nebbett says nothing about this */ - Status = STATUS_NOT_IMPLEMENTED; - break; + case ThreadPerformanceCount: + /* Nebbett says this class is always zero */ + u.Count.QuadPart = 0; + break; - case ThreadEnableAlignmentFaultFixup: - /* Can be set only */ - Status = STATUS_INVALID_INFO_CLASS; - break; - - case ThreadEventPair: - /* Can be set only */ - Status = STATUS_INVALID_INFO_CLASS; - break; - - case ThreadQuerySetWin32StartAddress: - if (ThreadInformationLength != sizeof(PVOID)) - { - Status = STATUS_INFO_LENGTH_MISMATCH; - break; - } - *((PVOID*)ThreadInformation) = Thread->Win32StartAddress; - Status = STATUS_SUCCESS; - break; - - case ThreadZeroTlsCell: - /* Can only be set */ - Status = STATUS_INVALID_INFO_CLASS; - break; - - case ThreadPerformanceCount: - /* Nebbett says this class is always zero */ - if (ThreadInformationLength != sizeof(LARGE_INTEGER)) - { - Status = STATUS_INFO_LENGTH_MISMATCH; - break; - } - ((PLARGE_INTEGER)ThreadInformation)->QuadPart = 0; - Status = STATUS_SUCCESS; - break; - - case ThreadAmILastThread: - { - if (ThreadInformationLength != sizeof(BOOLEAN)) - { - Status = STATUS_INFO_LENGTH_MISMATCH; - break; - } - if (Thread->ThreadsProcess->ThreadListHead.Flink->Flink == + case ThreadAmILastThread: + if (Thread->ThreadsProcess->ThreadListHead.Flink->Flink == &Thread->ThreadsProcess->ThreadListHead) { - *((PBOOLEAN)ThreadInformation) = TRUE; + u.Last = TRUE; } - else + else { - *((PBOOLEAN)ThreadInformation) = FALSE; + u.Last = FALSE; } - Status = STATUS_SUCCESS; - break; - } - - case ThreadIdealProcessor: - /* Can only be set */ - Status = STATUS_INFO_LENGTH_MISMATCH; - break; - - case ThreadPriorityBoost: - Status = STATUS_NOT_IMPLEMENTED; - break; - - case ThreadSetTlsArrayAddress: - /* Can only be set */ - Status = STATUS_INVALID_INFO_CLASS; - break; - - case ThreadIsIoPending: - Status = STATUS_NOT_IMPLEMENTED; - break; - - case ThreadHideFromDebugger: - /* Can only be set */ - Status = STATUS_INVALID_INFO_CLASS; - break; - - default: - Status = STATUS_INVALID_INFO_CLASS; + break; + default: + /* Shoult never occure if the data table is correct */ + KEBUGCHECK(0); } + if (QueryInformationData[ThreadInformationClass].Size) + { + Status = MmCopyToCaller(ThreadInformation, + &u.TBI, + QueryInformationData[ThreadInformationClass].Size); + } + if (ReturnLength) + { + NTSTATUS Status2; + static ULONG Null = 0; + Status2 = MmCopyToCaller(ReturnLength, + NT_SUCCESS(Status) ? &QueryInformationData[ThreadInformationClass].Size : &Null, + sizeof(ULONG)); + if (NT_SUCCESS(Status)) + { + Status = Status2; + } + } + ObDereferenceObject(Thread); return(Status); }
19 years, 11 months
1
0
0
0
[hbirr] 12697: - Fixed a length calculation in IopInitializeDriverModule.
by hbirr@svn.reactos.com
- Fixed a length calculation in IopInitializeDriverModule. - Freed the memory from hal.dll. Modified: trunk/reactos/ntoskrnl/io/driver.c _____ Modified: trunk/reactos/ntoskrnl/io/driver.c --- trunk/reactos/ntoskrnl/io/driver.c 2005-01-01 11:51:16 UTC (rev 12696) +++ trunk/reactos/ntoskrnl/io/driver.c 2005-01-01 11:53:38 UTC (rev 12697) @@ -534,7 +534,7 @@ if (DeviceNode->ServiceName.Buffer) { RegistryKey.Length = DeviceNode->ServiceName.Length + - sizeof(ServicesKeyName); + sizeof(ServicesKeyName) - sizeof(UNICODE_NULL); RegistryKey.MaximumLength = RegistryKey.Length + sizeof(UNICODE_NULL); RegistryKey.Buffer = ExAllocatePool(PagedPool, RegistryKey.MaximumLength); wcscpy(RegistryKey.Buffer, ServicesKeyName); @@ -1234,10 +1234,10 @@ } /* - * Free memory for all boot files, except ntoskrnl.exe, hal.dll + * Free memory for all boot files, except ntoskrnl.exe * and symbol files, if the kernel debugger is active */ - if (_stricmp(Extension, ".exe") && _stricmp(Extension, ".dll") + if (i != 0 /* ntoskrnl.exe is always the first module */ #if defined(DBG) || defined(KDBG) && _stricmp(Extension, ".sym") #endif
19 years, 11 months
1
0
0
0
[hbirr] 12696: - Fixed the return values in some unimolemented functions.
by hbirr@svn.reactos.com
- Fixed the return values in some unimolemented functions. Modified: trunk/reactos/ntoskrnl/ex/synch.c _____ Modified: trunk/reactos/ntoskrnl/ex/synch.c --- trunk/reactos/ntoskrnl/ex/synch.c 2005-01-01 11:49:57 UTC (rev 12695) +++ trunk/reactos/ntoskrnl/ex/synch.c 2005-01-01 11:51:16 UTC (rev 12696) @@ -41,7 +41,7 @@ ) { UNIMPLEMENTED; - return FALSE; + return NULL; } /* @@ -54,7 +54,7 @@ ) { UNIMPLEMENTED; - return FALSE; + return NULL; } /* @@ -67,6 +67,7 @@ ) { UNIMPLEMENTED; + return NULL; } /* EOF */
19 years, 11 months
1
0
0
0
[hbirr] 12695: - Loaded symbols also for kernel mode dll's.
by hbirr@svn.reactos.com
- Loaded symbols also for kernel mode dll's. Modified: trunk/reactos/ntoskrnl/dbg/kdb_symbols.c _____ Modified: trunk/reactos/ntoskrnl/dbg/kdb_symbols.c --- trunk/reactos/ntoskrnl/dbg/kdb_symbols.c 2005-01-01 11:47:33 UTC (rev 12694) +++ trunk/reactos/ntoskrnl/dbg/kdb_symbols.c 2005-01-01 11:49:57 UTC (rev 12695) @@ -914,6 +914,8 @@ PIMAGE_SYMBOL_INFO SymbolInfo; ANSI_STRING AnsiString; PCHAR Extension; + ULONG i; + const char *KnownExtension[] = {".exe", ".sys", ".dll"}; DPRINT("Module %s is a symbol file\n", FileName); @@ -928,22 +930,21 @@ DPRINT("base: %s (Length %d)\n", TmpBaseName, Length); - strcpy(TmpFileName, TmpBaseName); - strcat(TmpFileName, ".sys"); - RtlInitAnsiString(&AnsiString, TmpFileName); - - RtlAnsiStringToUnicodeString(&ModuleName, &AnsiString, TRUE); - ModuleObject = LdrGetModuleObject(&ModuleName); - RtlFreeUnicodeString(&ModuleName); - if (ModuleObject == NULL) + for (i = 0; i < sizeof(KnownExtension) / sizeof(*KnownExtension); i++) { strcpy(TmpFileName, TmpBaseName); - strcat(TmpFileName, ".exe"); + strcat(TmpFileName, KnownExtension[i]); RtlInitAnsiString(&AnsiString, TmpFileName); + RtlAnsiStringToUnicodeString(&ModuleName, &AnsiString, TRUE); ModuleObject = LdrGetModuleObject(&ModuleName); RtlFreeUnicodeString(&ModuleName); + if (ModuleObject) + { + break; + } } + if (ModuleObject != NULL) { SymbolInfo = (PIMAGE_SYMBOL_INFO) &ModuleObject->TextSection->SymbolInfo;
19 years, 11 months
1
0
0
0
← Newer
1
...
65
66
67
68
69
70
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