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
2025
January
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
August 2005
----- 2025 -----
January 2025
----- 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
23 participants
669 discussions
Start a n
N
ew thread
[weiden] 17198: enter a critical region before looking up a CID handle
by weiden@svn.reactos.com
enter a critical region before looking up a CID handle Modified: trunk/reactos/ntoskrnl/ps/process.c Modified: trunk/reactos/ntoskrnl/ps/thread.c Modified: trunk/reactos/ntoskrnl/rtl/libsupp.c _____ Modified: trunk/reactos/ntoskrnl/ps/process.c --- trunk/reactos/ntoskrnl/ps/process.c 2005-08-08 10:41:34 UTC (rev 17197) +++ trunk/reactos/ntoskrnl/ps/process.c 2005-08-08 10:54:32 UTC (rev 17198) @@ -477,6 +477,8 @@ PEPROCESS FoundProcess; NTSTATUS Status = STATUS_INVALID_PARAMETER; PAGED_CODE(); + + KeEnterCriticalRegion(); /* Get the CID Handle Entry */ if ((CidEntry = ExMapHandleToPointer(PspCidTable, @@ -497,6 +499,8 @@ /* Unlock the Entry */ ExUnlockHandleTableEntry(PspCidTable, CidEntry); } + + KeLeaveCriticalRegion(); /* Return to caller */ return Status; @@ -515,6 +519,8 @@ PETHREAD FoundThread; NTSTATUS Status = STATUS_INVALID_CID; PAGED_CODE(); + + KeEnterCriticalRegion(); /* Get the CID Handle Entry */ if ((CidEntry = ExMapHandleToPointer(PspCidTable, @@ -544,6 +550,8 @@ /* Unlock the Entry */ ExUnlockHandleTableEntry(PspCidTable, CidEntry); } + + KeLeaveCriticalRegion(); /* Return to caller */ return Status; _____ Modified: trunk/reactos/ntoskrnl/ps/thread.c --- trunk/reactos/ntoskrnl/ps/thread.c 2005-08-08 10:41:34 UTC (rev 17197) +++ trunk/reactos/ntoskrnl/ps/thread.c 2005-08-08 10:54:32 UTC (rev 17198) @@ -374,6 +374,8 @@ PETHREAD FoundThread; NTSTATUS Status = STATUS_INVALID_PARAMETER; PAGED_CODE(); + + KeEnterCriticalRegion(); /* Get the CID Handle Entry */ if ((CidEntry = ExMapHandleToPointer(PspCidTable, @@ -394,6 +396,8 @@ /* Unlock the Entry */ ExUnlockHandleTableEntry(PspCidTable, CidEntry); } + + KeLeaveCriticalRegion(); /* Return to caller */ return Status; _____ Modified: trunk/reactos/ntoskrnl/rtl/libsupp.c --- trunk/reactos/ntoskrnl/rtl/libsupp.c 2005-08-08 10:41:34 UTC (rev 17197) +++ trunk/reactos/ntoskrnl/rtl/libsupp.c 2005-08-08 10:54:32 UTC (rev 17198) @@ -261,11 +261,11 @@ Handle = ExCreateHandle(AtomTable->ExHandleTable, &ExEntry); - HandleIndex = (USHORT)((ULONG_PTR)Handle >> 2); if (Handle != NULL) { + HandleIndex = (USHORT)((ULONG_PTR)Handle >> 2); /* FIXME - Handle Indexes >= 0xC000 ?! */ - if (HandleIndex < 0xC000) + if ((ULONG_PTR)HandleIndex >> 2 < 0xC000) { Entry->HandleIndex = HandleIndex; Entry->Atom = 0xC000 + HandleIndex; @@ -284,21 +284,23 @@ RtlpGetAtomEntry(PRTL_ATOM_TABLE AtomTable, ULONG Index) { PHANDLE_TABLE_ENTRY ExEntry; + PRTL_ATOM_TABLE_ENTRY Entry = NULL; + /* NOTE: There's no need to explicitly enter a critical region because it's + guaranteed that we're in a critical region right now (as we hold + the atom table lock) */ + ExEntry = ExMapHandleToPointer(AtomTable->ExHandleTable, (HANDLE)((ULONG_PTR)Index << 2)); if (ExEntry != NULL) { - PRTL_ATOM_TABLE_ENTRY Entry; - Entry = ExEntry->u1.Object; ExUnlockHandleTableEntry(AtomTable->ExHandleTable, ExEntry); - return Entry; } - return NULL; + return Entry; } /* FIXME - RtlpCreateUnicodeString is obsolete and should be removed ASAP! */
19 years, 4 months
1
0
0
0
[weiden] 17197: delete no longer used file
by weiden@svn.reactos.com
delete no longer used file Deleted: trunk/reactos/ntoskrnl/ps/cid.c _____ Deleted: trunk/reactos/ntoskrnl/ps/cid.c --- trunk/reactos/ntoskrnl/ps/cid.c 2005-08-08 10:08:34 UTC (rev 17196) +++ trunk/reactos/ntoskrnl/ps/cid.c 2005-08-08 10:41:34 UTC (rev 17197) @@ -1,106 +0,0 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/ps/cid.c - * PURPOSE: Client ID (CID) management - * - * PROGRAMMERS: Thomas Weidenmueller <w3seek(a)reactos.com> - */ - -/* INCLUDES ******************************************************************/ - -#include <ntoskrnl.h> -#define NDEBUG -#include <internal/debug.h> - -/* GLOBALS ******************************************************************/ - -PHANDLE_TABLE PspCidTable = NULL; - -/* FUNCTIONS *****************************************************************/ - -VOID -INIT_FUNCTION -PsInitClientIDManagment(VOID) -{ - PspCidTable = ExCreateHandleTable(NULL); - ASSERT(PspCidTable); -} - -/* - * @implemented - */ -NTSTATUS STDCALL -PsLookupProcessThreadByCid(IN PCLIENT_ID Cid, - OUT PEPROCESS *Process OPTIONAL, - OUT PETHREAD *Thread) -{ - PHANDLE_TABLE_ENTRY CidEntry; - PETHREAD FoundThread; - NTSTATUS Status = STATUS_INVALID_CID; - - PAGED_CODE(); - - ASSERT(Thread); - ASSERT(Cid); - - CidEntry = PsLookupCidHandle(Cid->UniqueThread, PsThreadType, (PVOID*)&FoundThread); - if(CidEntry != NULL) - { - ObReferenceObject(FoundThread); - - PsUnlockCidHandle(CidEntry); - - if(Process != NULL) - { - *Process = FoundThread->ThreadsProcess; - } - *Thread = FoundThread; - Status = STATUS_SUCCESS; - } - - return Status; -} - - -/* - * @implemented - */ -NTSTATUS STDCALL -PsLookupThreadByThreadId(IN HANDLE ThreadId, - OUT PETHREAD *Thread) -{ - PHANDLE_TABLE_ENTRY CidEntry; - PETHREAD FoundThread; - NTSTATUS Status = STATUS_INVALID_CID; - - PAGED_CODE(); - - ASSERT(Thread); - - CidEntry = PsLookupCidHandle(ThreadId, PsThreadType, (PVOID*)&FoundThread); - if(CidEntry != NULL) - { - ObReferenceObject(FoundThread); - - PsUnlockCidHandle(CidEntry); - - *Thread = FoundThread; - Status = STATUS_SUCCESS; - } - - return Status; -} - -VOID -PsUnlockCidHandle(PHANDLE_TABLE_ENTRY CidEntry) -{ - PAGED_CODE(); - - ExUnlockHandleTableEntry(PspCidTable, - CidEntry); - KeLeaveCriticalRegion(); -} - -/* EOF */
19 years, 4 months
1
0
0
0
[weiden] 17196: unlock the CID in PsLookupProcessByProcessId, PsLookupProcessThreadByCid and PsLookupThreadByThreadId when the lookup succeeded, not failed
by weiden@svn.reactos.com
unlock the CID in PsLookupProcessByProcessId, PsLookupProcessThreadByCid and PsLookupThreadByThreadId when the lookup succeeded, not failed Modified: trunk/reactos/ntoskrnl/ps/process.c Modified: trunk/reactos/ntoskrnl/ps/thread.c _____ Modified: trunk/reactos/ntoskrnl/ps/process.c --- trunk/reactos/ntoskrnl/ps/process.c 2005-08-08 09:24:20 UTC (rev 17195) +++ trunk/reactos/ntoskrnl/ps/process.c 2005-08-08 10:08:34 UTC (rev 17196) @@ -366,7 +366,7 @@ DPRINT("Initialzing Process CID Handle\n"); CidEntry.u1.Object = Process; CidEntry.u2.GrantedAccess = 0; - Process->UniqueProcessId = (ExCreateHandle(PspCidTable, &CidEntry)); + Process->UniqueProcessId = ExCreateHandle(PspCidTable, &CidEntry); DPRINT("Created CID: %d\n", Process->UniqueProcessId); if(!Process->UniqueProcessId) { @@ -479,8 +479,8 @@ PAGED_CODE(); /* Get the CID Handle Entry */ - if (!(CidEntry = ExMapHandleToPointer(PspCidTable, - ProcessId))) + if ((CidEntry = ExMapHandleToPointer(PspCidTable, + ProcessId))) { /* Get the Process */ FoundProcess = CidEntry->u1.Object; @@ -517,7 +517,7 @@ PAGED_CODE(); /* Get the CID Handle Entry */ - if (!(CidEntry = ExMapHandleToPointer(PspCidTable, + if ((CidEntry = ExMapHandleToPointer(PspCidTable, Cid->UniqueThread))) { /* Get the Process */ _____ Modified: trunk/reactos/ntoskrnl/ps/thread.c --- trunk/reactos/ntoskrnl/ps/thread.c 2005-08-08 09:24:20 UTC (rev 17195) +++ trunk/reactos/ntoskrnl/ps/thread.c 2005-08-08 10:08:34 UTC (rev 17196) @@ -376,8 +376,8 @@ PAGED_CODE(); /* Get the CID Handle Entry */ - if (!(CidEntry = ExMapHandleToPointer(PspCidTable, - ThreadId))) + if ((CidEntry = ExMapHandleToPointer(PspCidTable, + ThreadId))) { /* Get the Process */ FoundThread = CidEntry->u1.Object;
19 years, 4 months
1
0
0
0
[navaraf] 17195: Revert part of #17156 and #17157 changes.
by navaraf@svn.reactos.com
Revert part of #17156 and #17157 changes. Modified: trunk/reactos/drivers/fs/np/rw.c _____ Modified: trunk/reactos/drivers/fs/np/rw.c --- trunk/reactos/drivers/fs/np/rw.c 2005-08-08 04:26:23 UTC (rev 17194) +++ trunk/reactos/drivers/fs/np/rw.c 2005-08-08 09:24:20 UTC (rev 17195) @@ -398,25 +398,23 @@ { if (Fcb->ReadDataAvailable == 0) { + if (Fcb->PipeState == FILE_PIPE_CONNECTED_STATE) + { + ASSERT(Fcb->OtherSide != NULL); + KeSetEvent(&Fcb->OtherSide->WriteEvent, IO_NO_INCREMENT, FALSE); + } + if (Information > 0 && + (Fcb->Pipe->ReadMode != FILE_PIPE_BYTE_STREAM_MODE || + Fcb->PipeState != FILE_PIPE_CONNECTED_STATE)) + { + break; + } if (Fcb->PipeState != FILE_PIPE_CONNECTED_STATE) { DPRINT("PipeState: %x\n", Fcb->PipeState); - if (Fcb->PipeState == FILE_PIPE_LISTENING_STATE) - Status = STATUS_PIPE_LISTENING; - else - Status = STATUS_PIPE_DISCONNECTED; + Status = STATUS_PIPE_BROKEN; break; } - - ASSERT(Fcb->OtherSide != NULL); - KeSetEvent(&Fcb->OtherSide->WriteEvent, IO_NO_INCREMENT, FALSE); - - if (Information > 0 && - Fcb->Pipe->ReadMode != FILE_PIPE_BYTE_STREAM_MODE) - { - break; - } - ExReleaseFastMutex(&Fcb->DataListLock); if (IoIsOperationSynchronous(Irp)) {
19 years, 4 months
1
0
0
0
[arty] 17194: Fixes for various 64-bit hosting problems.
by arty@svn.reactos.com
Fixes for various 64-bit hosting problems. Modified: trunk/reactos/tools/pefixup.c Modified: trunk/reactos/tools/rsym.c Modified: trunk/reactos/tools/rsym.h Modified: trunk/reactos/tools/winebuild/main.c Modified: trunk/reactos/tools/wrc/genres.c Modified: trunk/reactos/w32api/include/winnt.h _____ Modified: trunk/reactos/tools/pefixup.c --- trunk/reactos/tools/pefixup.c 2005-08-08 01:47:52 UTC (rev 17193) +++ trunk/reactos/tools/pefixup.c 2005-08-08 04:26:23 UTC (rev 17194) @@ -44,7 +44,7 @@ #define IMAGE_SCN_MEM_DISCARDABLE 0x2000000 #define IMAGE_SCN_MEM_NOT_PAGED 0x8000000 #define FIELD_OFFSET(t,f) ((LONG)&(((t*)0)->f)) -#define IMAGE_FIRST_SECTION(h) ((PIMAGE_SECTION_HEADER) ((DWORD)h+FIELD_OFFSET(IMAGE_NT_HEADERS,OptionalHeader)+((PIMAGE_NT_HEAD ERS)(h))->FileHeader.SizeOfOptionalHeader)) +#define IMAGE_FIRST_SECTION(h) ((PIMAGE_SECTION_HEADER) ((unsigned long)h+FIELD_OFFSET(IMAGE_NT_HEADERS,OptionalHeader)+((PIMAGE_NT_HEADERS )(h))->FileHeader.SizeOfOptionalHeader)) #define IMAGE_DIRECTORY_ENTRY_EXPORT 0 #pragma pack(push,2) _____ Modified: trunk/reactos/tools/rsym.c --- trunk/reactos/tools/rsym.c 2005-08-08 01:47:52 UTC (rev 17193) +++ trunk/reactos/tools/rsym.c 2005-08-08 04:26:23 UTC (rev 17194) @@ -23,6 +23,7 @@ #include <stdio.h> #include <string.h> #include <stdlib.h> +#include <assert.h> #include "rsym.h" @@ -809,6 +810,7 @@ PEFileHeader = (PIMAGE_FILE_HEADER)((char *) FileData + PEDosHeader->e_lfanew + sizeof(ULONG)); /* Locate optional header */ + assert(sizeof(ULONG) == 4); PEOptHeader = (PIMAGE_OPTIONAL_HEADER)(PEFileHeader + 1); ImageBase = PEOptHeader->ImageBase; _____ Modified: trunk/reactos/tools/rsym.h --- trunk/reactos/tools/rsym.h 2005-08-08 01:47:52 UTC (rev 17193) +++ trunk/reactos/tools/rsym.h 2005-08-08 04:26:23 UTC (rev 17194) @@ -11,15 +11,27 @@ #define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16 typedef unsigned char BYTE; +typedef unsigned char UCHAR; typedef unsigned short WORD; -typedef unsigned long DWORD; +typedef unsigned short USHORT; +#if defined(__x86_64__) && defined(linux) +typedef signed int LONG; +typedef unsigned int ULONG; +typedef unsigned int DWORD; +#else typedef signed long LONG; typedef unsigned long ULONG; +typedef unsigned long DWORD; +#endif #if defined(_WIN64) typedef unsigned __int64 ULONG_PTR; #else +#if defined(__x86_64__) && defined(linux) +typedef unsigned int ULONG_PTR; +#else typedef unsigned long ULONG_PTR; #endif +#endif #pragma pack(push,2) typedef struct _IMAGE_DOS_HEADER { @@ -129,42 +141,42 @@ typedef struct { - unsigned short f_magic; /* magic number */ - unsigned short f_nscns; /* number of sections */ - unsigned long f_timdat; /* time & date stamp */ - unsigned long f_symptr; /* file pointer to symtab */ - unsigned long f_nsyms; /* number of symtab entries */ - unsigned short f_opthdr; /* sizeof(optional hdr) */ - unsigned short f_flags; /* flags */ + USHORT f_magic; /* magic number */ + USHORT f_nscns; /* number of sections */ + ULONG f_timdat; /* time & date stamp */ + ULONG f_symptr; /* file pointer to symtab */ + ULONG f_nsyms; /* number of symtab entries */ + USHORT f_opthdr; /* sizeof(optional hdr) */ + USHORT f_flags; /* flags */ } FILHDR; typedef struct { char s_name[8]; /* section name */ - unsigned long s_paddr; /* physical address, aliased s_nlib */ - unsigned long s_vaddr; /* virtual address */ - unsigned long s_size; /* section size */ - unsigned long s_scnptr; /* file ptr to raw data for section */ - unsigned long s_relptr; /* file ptr to relocation */ - unsigned long s_lnnoptr; /* file ptr to line numbers */ - unsigned short s_nreloc; /* number of relocation entries */ - unsigned short s_nlnno; /* number of line number entries */ - unsigned long s_flags; /* flags */ + ULONG s_paddr; /* physical address, aliased s_nlib */ + ULONG s_vaddr; /* virtual address */ + ULONG s_size; /* section size */ + ULONG s_scnptr; /* file ptr to raw data for section */ + ULONG s_relptr; /* file ptr to relocation */ + ULONG s_lnnoptr; /* file ptr to line numbers */ + USHORT s_nreloc; /* number of relocation entries */ + USHORT s_nlnno; /* number of line number entries */ + ULONG s_flags; /* flags */ } SCNHDR; #pragma pack(pop) typedef struct _SYMBOLFILE_HEADER { - unsigned long SymbolsOffset; - unsigned long SymbolsLength; - unsigned long StringsOffset; - unsigned long StringsLength; + ULONG SymbolsOffset; + ULONG SymbolsLength; + ULONG StringsOffset; + ULONG StringsLength; } SYMBOLFILE_HEADER, *PSYMBOLFILE_HEADER; typedef struct _STAB_ENTRY { - unsigned long n_strx; /* index into string table of name */ - unsigned char n_type; /* type of symbol */ - unsigned char n_other; /* misc info (usually empty) */ - unsigned short n_desc; /* description field */ - unsigned long n_value; /* value of symbol */ + ULONG n_strx; /* index into string table of name */ + UCHAR n_type; /* type of symbol */ + UCHAR n_other; /* misc info (usually empty) */ + USHORT n_desc; /* description field */ + ULONG n_value; /* value of symbol */ } STAB_ENTRY, *PSTAB_ENTRY; #define N_FUN 0x24 @@ -234,17 +246,17 @@ char e_name[E_SYMNMLEN]; struct { - unsigned long e_zeroes; - unsigned long e_offset; + ULONG e_zeroes; + ULONG e_offset; } e; } e; - unsigned long e_value; + ULONG e_value; short e_scnum; - unsigned short e_type; - unsigned char e_sclass; - unsigned char e_numaux; + USHORT e_type; + UCHAR e_sclass; + UCHAR e_numaux; } COFF_SYMENT, *PCOFF_SYMENT; #pragma pack(pop) _____ Modified: trunk/reactos/tools/winebuild/main.c --- trunk/reactos/tools/winebuild/main.c 2005-08-08 01:47:52 UTC (rev 17193) +++ trunk/reactos/tools/winebuild/main.c 2005-08-08 04:26:23 UTC (rev 17194) @@ -46,7 +46,7 @@ int kill_at = 0; int debugging = 0; -#ifdef __i386__ +#if defined(__i386__) || defined(__x86_64__) enum target_cpu target_cpu = CPU_x86; #elif defined(__sparc__) enum target_cpu target_cpu = CPU_SPARC; _____ Modified: trunk/reactos/tools/wrc/genres.c --- trunk/reactos/tools/wrc/genres.c 2005-08-08 01:47:52 UTC (rev 17193) +++ trunk/reactos/tools/wrc/genres.c 2005-08-08 04:26:23 UTC (rev 17194) @@ -43,6 +43,13 @@ #include "winuser.h" #include "wine/unicode.h" +/* Fix 64-bit host, re: put_dword */ +#if defined(linux) && defined(__x86_64__) +typedef unsigned int HOST_DWORD; +#else +typedef unsigned long HOST_DWORD; +#endif + #define SetResSize(res, tag) set_dword((res), (tag), (res)->size - get_dword((res), (tag))) res_t *new_res(void) @@ -114,7 +121,9 @@ void put_dword(res_t *res, unsigned d) { - if(res->allocsize - res->size < sizeof(DWORD)) + assert(sizeof(HOST_DWORD) == 4); + + if(res->allocsize - res->size < sizeof(HOST_DWORD)) grow_res(res, RES_BLOCKSIZE); switch(byteorder) { @@ -138,7 +147,7 @@ res->data[res->size+0] = LOBYTE(LOWORD(d)); break; } - res->size += sizeof(DWORD); + res->size += sizeof(HOST_DWORD); } static void put_pad(res_t *res) @@ -223,7 +232,7 @@ * Remarks : ************************************************************************ ***** */ -static DWORD get_dword(res_t *res, int ofs) +static HOST_DWORD get_dword(res_t *res, int ofs) { switch(byteorder) { @@ -434,7 +443,7 @@ ************************************************************************ ***** */ static int put_res_header(res_t *res, int type, name_id_t *ntype, name_id_t *name, - DWORD memopt, lvc_t *lvc) + HOST_DWORD memopt, lvc_t *lvc) { if(win32) { @@ -452,8 +461,8 @@ put_dword(res, 0); /* DataVersion */ put_word(res, memopt); /* Memory options */ put_lvc(res, lvc); /* Language, version and characts */ - set_dword(res, 0*sizeof(DWORD), res->size); /* Set preliminary resource */ - set_dword(res, 1*sizeof(DWORD), res->size); /* Set HeaderSize */ + set_dword(res, 0*sizeof(HOST_DWORD), res->size); /* Set preliminary resource */ + set_dword(res, 1*sizeof(HOST_DWORD), res->size); /* Set HeaderSize */ res->dataidx = res->size; return 0; } @@ -1415,7 +1424,7 @@ name_id_t name; int i; int restag; - DWORD lastsize = 0; + HOST_DWORD lastsize = 0; assert(stt != NULL); res = new_res(); _____ Modified: trunk/reactos/w32api/include/winnt.h --- trunk/reactos/w32api/include/winnt.h 2005-08-08 01:47:52 UTC (rev 17193) +++ trunk/reactos/w32api/include/winnt.h 2005-08-08 04:26:23 UTC (rev 17194) @@ -1533,7 +1533,7 @@ } ACL_SIZE_INFORMATION; /* FIXME: add more machines */ -#ifdef _X86_ +#if defined(_X86_) || defined(linux) #define SIZE_OF_80387_REGISTERS 80 #define CONTEXT_i386 0x10000 #define CONTEXT_i486 0x10000
19 years, 4 months
1
0
0
0
[hbirr] 17193: Fixed the load count in LdrpDetachProcess. That made it again possible to call the dll entry with DLL_PROCESS_DETACH.
by hbirr@svn.reactos.com
Fixed the load count in LdrpDetachProcess. That made it again possible to call the dll entry with DLL_PROCESS_DETACH. Modified: trunk/reactos/lib/ntdll/ldr/utils.c _____ Modified: trunk/reactos/lib/ntdll/ldr/utils.c --- trunk/reactos/lib/ntdll/ldr/utils.c 2005-08-08 00:45:04 UTC (rev 17192) +++ trunk/reactos/lib/ntdll/ldr/utils.c 2005-08-08 01:47:52 UTC (rev 17193) @@ -104,7 +104,7 @@ RtlEnterCriticalSection (NtCurrentPeb()->LoaderLock); } LoadCount = Module->LoadCount; - if (Module->LoadCount > 0) + if (Module->LoadCount > 0 && Module->LoadCount != 0xFFFF) { Module->LoadCount--; } @@ -2397,7 +2397,7 @@ while (Entry != ModuleListHead) { Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InInitializationOrderModuleList); - if (((UnloadAll && Module->LoadCount <= 0) || Module->LoadCount == 0) && + if (((UnloadAll && Module->LoadCount == 0xFFFF) || Module->LoadCount == 0) && Module->Flags & LDRP_ENTRY_PROCESSED && !(Module->Flags & LDRP_UNLOAD_IN_PROGRESS)) {
19 years, 4 months
1
0
0
0
[weiden] 17192: use loops instead of gotos
by weiden@svn.reactos.com
use loops instead of gotos Modified: trunk/reactos/lib/kernel32/synch/wait.c _____ Modified: trunk/reactos/lib/kernel32/synch/wait.c --- trunk/reactos/lib/kernel32/synch/wait.c 2005-08-07 23:43:58 UTC (rev 17191) +++ trunk/reactos/lib/kernel32/synch/wait.c 2005-08-08 00:45:04 UTC (rev 17192) @@ -90,18 +90,21 @@ Time.QuadPart = -10000 * (LONGLONG)dwMilliseconds; TimePtr = &Time; } -WaitAgain: - Status = NtWaitForSingleObject(hHandle, - (BOOLEAN) bAlertable, - TimePtr); - if (HIWORD(Status)) + do { - SetLastErrorByStatus (Status); - return WAIT_FAILED; - } - if (Status == STATUS_ALERTED && bAlertable) goto WaitAgain; + Status = NtWaitForSingleObject(hHandle, + (BOOLEAN) bAlertable, + TimePtr); + if (HIWORD(Status)) + { + SetLastErrorByStatus (Status); + return WAIT_FAILED; + } + + } while (Status == STATUS_ALERTED && bAlertable); + return Status; } @@ -211,19 +214,21 @@ TimePtr = &Time; } -WaitAgain: - Status = NtWaitForMultipleObjects (nCount, - HandleBuffer, - bWaitAll ? WaitAll : WaitAny, - (BOOLEAN)bAlertable, - TimePtr); - if (HIWORD(Status)) + do { - SetLastErrorByStatus (Status); - Status = WAIT_FAILED; - } - if (Status == STATUS_ALERTED && bAlertable) goto WaitAgain; + Status = NtWaitForMultipleObjects (nCount, + HandleBuffer, + bWaitAll ? WaitAll : WaitAny, + (BOOLEAN)bAlertable, + TimePtr); + if (HIWORD(Status)) + { + SetLastErrorByStatus (Status); + Status = WAIT_FAILED; + } + } while (Status == STATUS_ALERTED && bAlertable); + if (HandleBuffer != Handle) { RtlFreeHeap(RtlGetProcessHeap(), 0, HandleBuffer); @@ -283,18 +288,20 @@ TimePtr = &Time; } -WaitAgain: - Status = NtSignalAndWaitForSingleObject (hObjectToSignal, - hObjectToWaitOn, - (BOOLEAN)bAlertable, - TimePtr); - if (!NT_SUCCESS(Status)) + do { - SetLastErrorByStatus (Status); - return WAIT_FAILED; - } - if (Status == STATUS_ALERTED && bAlertable) goto WaitAgain; + Status = NtSignalAndWaitForSingleObject (hObjectToSignal, + hObjectToWaitOn, + (BOOLEAN)bAlertable, + TimePtr); + if (!NT_SUCCESS(Status)) + { + SetLastErrorByStatus (Status); + return WAIT_FAILED; + } + } while (Status == STATUS_ALERTED && bAlertable); + /* STATUS_SUCCESS maps to WAIT_OBJECT_0 */ return Status; }
19 years, 4 months
1
0
0
0
[weiden] 17191: directly translate handles to indexes in ex/handle.c
by weiden@svn.reactos.com
directly translate handles to indexes in ex/handle.c Modified: trunk/reactos/ntoskrnl/ex/handle.c Modified: trunk/reactos/ntoskrnl/include/internal/ex.h Modified: trunk/reactos/ntoskrnl/include/internal/ob.h Modified: trunk/reactos/ntoskrnl/ob/handle.c Modified: trunk/reactos/ntoskrnl/ob/wait.c Modified: trunk/reactos/ntoskrnl/ps/process.c Modified: trunk/reactos/ntoskrnl/ps/thread.c Modified: trunk/reactos/ntoskrnl/rtl/libsupp.c _____ Modified: trunk/reactos/ntoskrnl/ex/handle.c --- trunk/reactos/ntoskrnl/ex/handle.c 2005-08-07 23:37:59 UTC (rev 17190) +++ trunk/reactos/ntoskrnl/ex/handle.c 2005-08-07 23:43:58 UTC (rev 17191) @@ -77,6 +77,11 @@ #define IS_VALID_EX_HANDLE(index) \ (((index) & ~VALID_HANDLE_MASK) == 0) +#define HANDLE_TO_EX_HANDLE(handle) \ + (LONG)(((LONG)(handle) >> 2) - 1) +#define EX_HANDLE_TO_HANDLE(exhandle) \ + (HANDLE)(((exhandle) + 1) << 2) + static BOOLEAN ExpInitialized = FALSE; /*********************************************************************** *******/ @@ -491,7 +496,7 @@ static PHANDLE_TABLE_ENTRY ExpAllocateHandleTableEntry(IN PHANDLE_TABLE HandleTable, - OUT PLONG Handle) + OUT PHANDLE Handle) { PHANDLE_TABLE_ENTRY Entry = NULL; @@ -520,7 +525,7 @@ Entry = &HandleTable->Table[tli][mli][eli]; - *Handle = HandleTable->FirstFreeTableEntry; + *Handle = EX_HANDLE_TO_HANDLE(HandleTable->FirstFreeTableEntry); /* save the index to the next free handle (if available) */ HandleTable->FirstFreeTableEntry = Entry->u2.NextFreeTableEntry; @@ -629,7 +634,7 @@ Entry->u1.ObAttributes = EX_HANDLE_ENTRY_LOCKED; Entry->u2.NextFreeTableEntry = 0; - *Handle = HandleTable->NextIndexNeedingPool; + *Handle = EX_HANDLE_TO_HANDLE(HandleTable->NextIndexNeedingPool); HandleTable->HandleCount++; @@ -803,12 +808,12 @@ FALSE); } -LONG +HANDLE ExCreateHandle(IN PHANDLE_TABLE HandleTable, IN PHANDLE_TABLE_ENTRY Entry) { PHANDLE_TABLE_ENTRY NewHandleTableEntry; - LONG Handle = EX_INVALID_HANDLE; + HANDLE Handle = NULL; PAGED_CODE(); @@ -841,20 +846,23 @@ BOOLEAN ExDestroyHandle(IN PHANDLE_TABLE HandleTable, - IN LONG Handle) + IN HANDLE Handle) { PHANDLE_TABLE_ENTRY HandleTableEntry; + LONG ExHandle; BOOLEAN Ret = FALSE; PAGED_CODE(); ASSERT(HandleTable); + + ExHandle = HANDLE_TO_EX_HANDLE(Handle); KeEnterCriticalRegion(); ExAcquireHandleTableLockExclusive(HandleTable); HandleTableEntry = ExpLookupHandleTableEntry(HandleTable, - Handle); + ExHandle); if(HandleTableEntry != NULL && ExLockHandleTableEntry(HandleTable, HandleTableEntry)) { @@ -862,7 +870,7 @@ the contention event since other locks on this entry will fail */ ExpFreeHandleTableEntry(HandleTable, HandleTableEntry, - Handle); + ExHandle); Ret = TRUE; } @@ -875,7 +883,7 @@ VOID ExDestroyHandleByEntry(IN PHANDLE_TABLE HandleTable, IN PHANDLE_TABLE_ENTRY Entry, - IN LONG Handle) + IN HANDLE Handle) { PAGED_CODE(); @@ -894,7 +902,7 @@ the contention event since other locks on this entry will fail */ ExpFreeHandleTableEntry(HandleTable, Entry, - Handle); + HANDLE_TO_EX_HANDLE(Handle)); ExReleaseHandleTableLock(HandleTable); KeLeaveCriticalRegion(); @@ -902,7 +910,7 @@ PHANDLE_TABLE_ENTRY ExMapHandleToPointer(IN PHANDLE_TABLE HandleTable, - IN LONG Handle) + IN HANDLE Handle) { PHANDLE_TABLE_ENTRY HandleTableEntry; @@ -911,7 +919,7 @@ ASSERT(HandleTable); HandleTableEntry = ExpLookupHandleTableEntry(HandleTable, - Handle); + HANDLE_TO_EX_HANDLE(Handle)); if (HandleTableEntry != NULL && ExLockHandleTableEntry(HandleTable, HandleTableEntry)) { DPRINT("ExMapHandleToPointer HT:0x%p Entry:0x%p locked\n", HandleTable, HandleTableEntry); @@ -923,7 +931,7 @@ BOOLEAN ExChangeHandle(IN PHANDLE_TABLE HandleTable, - IN LONG Handle, + IN HANDLE Handle, IN PEX_CHANGE_HANDLE_CALLBACK ChangeHandleCallback, IN PVOID Context) { @@ -938,7 +946,7 @@ KeEnterCriticalRegion(); HandleTableEntry = ExpLookupHandleTableEntry(HandleTable, - Handle); + HANDLE_TO_EX_HANDLE(Handle)); if(HandleTableEntry != NULL && ExLockHandleTableEntry(HandleTable, HandleTableEntry)) { _____ Modified: trunk/reactos/ntoskrnl/include/internal/ex.h --- trunk/reactos/ntoskrnl/include/internal/ex.h 2005-08-07 23:37:59 UTC (rev 17190) +++ trunk/reactos/ntoskrnl/include/internal/ex.h 2005-08-07 23:43:58 UTC (rev 17191) @@ -86,8 +86,6 @@ #define EX_HANDLE_TABLE_CLOSING 0x1 -#define EX_INVALID_HANDLE (~0) - #define EX_HANDLE_ENTRY_FLAGSMASK (EX_HANDLE_ENTRY_LOCKED | \ EX_HANDLE_ENTRY_PROTECTFROMCLOSE | \ EX_HANDLE_ENTRY_INHERITABLE | \ @@ -145,7 +143,7 @@ IN PHANDLE_TABLE_ENTRY Entry ); -LONG +HANDLE ExCreateHandle( IN PHANDLE_TABLE HandleTable, IN PHANDLE_TABLE_ENTRY Entry @@ -154,26 +152,26 @@ BOOLEAN ExDestroyHandle( IN PHANDLE_TABLE HandleTable, - IN LONG Handle + IN HANDLE Handle ); VOID ExDestroyHandleByEntry( IN PHANDLE_TABLE HandleTable, IN PHANDLE_TABLE_ENTRY Entry, - IN LONG Handle + IN HANDLE Handle ); PHANDLE_TABLE_ENTRY ExMapHandleToPointer( IN PHANDLE_TABLE HandleTable, - IN LONG Handle + IN HANDLE Handle ); BOOLEAN ExChangeHandle( IN PHANDLE_TABLE HandleTable, - IN LONG Handle, + IN HANDLE Handle, IN PEX_CHANGE_HANDLE_CALLBACK ChangeHandleCallback, IN PVOID Context ); _____ Modified: trunk/reactos/ntoskrnl/include/internal/ob.h --- trunk/reactos/ntoskrnl/include/internal/ob.h 2005-08-07 23:37:59 UTC (rev 17190) +++ trunk/reactos/ntoskrnl/include/internal/ob.h 2005-08-07 23:43:58 UTC (rev 17191) @@ -62,11 +62,6 @@ #define OBJECT_ALLOC_SIZE(ObjectSize) ((ObjectSize)+sizeof(OBJECT_HEADER)) -#define HANDLE_TO_EX_HANDLE(handle) \ - (LONG)(((LONG)(handle) >> 2) - 1) -#define EX_HANDLE_TO_HANDLE(exhandle) \ - (HANDLE)(((exhandle) + 1) << 2) - extern PDIRECTORY_OBJECT NameSpaceRoot; extern POBJECT_TYPE ObSymbolicLinkType; extern PHANDLE_TABLE ObpKernelHandleTable; _____ Modified: trunk/reactos/ntoskrnl/ob/handle.c --- trunk/reactos/ntoskrnl/ob/handle.c 2005-08-07 23:37:59 UTC (rev 17190) +++ trunk/reactos/ntoskrnl/ob/handle.c 2005-08-07 23:43:58 UTC (rev 17191) @@ -90,7 +90,6 @@ { PHANDLE_TABLE HandleTable; PHANDLE_TABLE_ENTRY HandleTableEntry; - LONG ExHandle; PAGED_CODE(); @@ -99,18 +98,17 @@ if(ObIsKernelHandle(Handle, ExGetPreviousMode())) { HandleTable = ObpKernelHandleTable; - ExHandle = HANDLE_TO_EX_HANDLE(ObKernelHandleToHandle(Handle)); + Handle = ObKernelHandleToHandle(Handle); } else { HandleTable = PsGetCurrentProcess()->ObjectTable; - ExHandle = HANDLE_TO_EX_HANDLE(Handle); } KeEnterCriticalRegion(); HandleTableEntry = ExMapHandleToPointer(HandleTable, - ExHandle); + Handle); if (HandleTableEntry == NULL) { KeLeaveCriticalRegion(); @@ -135,7 +133,6 @@ { PHANDLE_TABLE HandleTable; PHANDLE_TABLE_ENTRY HandleTableEntry; - LONG ExHandle; PAGED_CODE(); @@ -144,18 +141,17 @@ if(ObIsKernelHandle(Handle, ExGetPreviousMode())) { HandleTable = ObpKernelHandleTable; - ExHandle = HANDLE_TO_EX_HANDLE(ObKernelHandleToHandle(Handle)); + Handle = ObKernelHandleToHandle(Handle); } else { HandleTable = PsGetCurrentProcess()->ObjectTable; - ExHandle = HANDLE_TO_EX_HANDLE(Handle); } KeEnterCriticalRegion(); HandleTableEntry = ExMapHandleToPointer(HandleTable, - ExHandle); + Handle); if (HandleTableEntry == NULL) { KeLeaveCriticalRegion(); @@ -190,7 +186,6 @@ PHANDLE_TABLE_ENTRY HandleEntry; PVOID Body; POBJECT_HEADER ObjectHeader; - LONG ExHandle = HANDLE_TO_EX_HANDLE(Handle); PAGED_CODE(); @@ -199,7 +194,7 @@ KeEnterCriticalRegion(); HandleEntry = ExMapHandleToPointer(HandleTable, - ExHandle); + Handle); if(HandleEntry != NULL) { if(HandleEntry->u1.ObAttributes & EX_HANDLE_ENTRY_PROTECTFROMCLOSE) @@ -220,7 +215,7 @@ /* destroy and unlock the handle entry */ ExDestroyHandleByEntry(HandleTable, HandleEntry, - ExHandle); + Handle); KeLeaveCriticalRegion(); @@ -245,9 +240,8 @@ HANDLE_TABLE_ENTRY NewHandleEntry; PVOID ObjectBody; POBJECT_HEADER ObjectHeader; - LONG ExTargetHandle; - LONG ExSourceHandle; ULONG NewHandleCount; + HANDLE NewTargetHandle; PAGED_CODE(); @@ -261,12 +255,10 @@ SourceHandleTable = SourceProcess->ObjectTable; } - ExSourceHandle = HANDLE_TO_EX_HANDLE(SourceHandle); - KeEnterCriticalRegion(); SourceHandleEntry = ExMapHandleToPointer(SourceHandleTable, - ExSourceHandle); + SourceHandle); if (SourceHandleEntry == NULL) { KeLeaveCriticalRegion(); @@ -316,9 +308,9 @@ KeLeaveCriticalRegion(); /* attempt to create the new handle */ - ExTargetHandle = ExCreateHandle(TargetProcess->ObjectTable, - &NewHandleEntry); - if (ExTargetHandle != EX_INVALID_HANDLE) + NewTargetHandle = ExCreateHandle(TargetProcess->ObjectTable, + &NewHandleEntry); + if (NewTargetHandle != NULL) { if (Options & DUPLICATE_CLOSE_SOURCE) { @@ -328,7 +320,7 @@ ObDereferenceObject(ObjectBody); - *TargetHandle = EX_HANDLE_TO_HANDLE(ExTargetHandle); + *TargetHandle = NewTargetHandle; return STATUS_SUCCESS; } @@ -607,7 +599,7 @@ { HANDLE_TABLE_ENTRY NewEntry; POBJECT_HEADER ObjectHeader; - LONG ExHandle; + HANDLE Handle; PAGED_CODE(); @@ -639,10 +631,10 @@ NewEntry.u1.ObAttributes &= ~EX_HANDLE_ENTRY_INHERITABLE; NewEntry.u2.GrantedAccess = GrantedAccess; - ExHandle = ExCreateHandle(Process->ObjectTable, - &NewEntry); - DPRINT("ObCreateHandle(0x%x)==0x%x [HT:0x%x]\n", ObjectHeader, *HandleReturn, Process->ObjectTable); - if(ExHandle != EX_INVALID_HANDLE) + Handle = ExCreateHandle(Process->ObjectTable, + &NewEntry); + DPRINT("ObCreateHandle(0x%x)==0x%x [HT:0x%x]\n", ObjectHeader, Handle, Process->ObjectTable); + if(Handle != NULL) { if(InterlockedIncrement(&ObjectHeader->HandleCount) == 1) { @@ -652,7 +644,7 @@ UserMode); } - *HandleReturn = EX_HANDLE_TO_HANDLE(ExHandle); + *HandleReturn = Handle; return STATUS_SUCCESS; } @@ -670,7 +662,6 @@ { PHANDLE_TABLE_ENTRY HandleEntry; PEPROCESS Process; - LONG ExHandle = HANDLE_TO_EX_HANDLE(Handle); PAGED_CODE(); @@ -681,7 +672,7 @@ KeEnterCriticalRegion(); HandleEntry = ExMapHandleToPointer(Process->ObjectTable, - ExHandle); + Handle); if(HandleEntry != NULL) { *GenerateOnClose = (HandleEntry->u1.ObAttributes & EX_HANDLE_ENTRY_AUDITONCLOSE) != 0; @@ -729,7 +720,6 @@ PVOID ObjectBody; ACCESS_MASK GrantedAccess; ULONG Attributes; - LONG ExHandle; PAGED_CODE(); @@ -800,18 +790,17 @@ if(ObIsKernelHandle(Handle, AccessMode)) { HandleTable = ObpKernelHandleTable; - ExHandle = HANDLE_TO_EX_HANDLE(ObKernelHandleToHandle(Handle)); + Handle = ObKernelHandleToHandle(Handle); } else { HandleTable = PsGetCurrentProcess()->ObjectTable; - ExHandle = HANDLE_TO_EX_HANDLE(Handle); } KeEnterCriticalRegion(); HandleEntry = ExMapHandleToPointer(HandleTable, - ExHandle); + Handle); if (HandleEntry == NULL) { KeLeaveCriticalRegion(); _____ Modified: trunk/reactos/ntoskrnl/ob/wait.c --- trunk/reactos/ntoskrnl/ob/wait.c 2005-08-07 23:37:59 UTC (rev 17190) +++ trunk/reactos/ntoskrnl/ob/wait.c 2005-08-07 23:43:58 UTC (rev 17191) @@ -38,7 +38,6 @@ POBJECT_HEADER ObjectHeader; PHANDLE_TABLE HandleTable; ACCESS_MASK GrantedAccess; - LONG ExHandle; PVOID DefaultObject; NTSTATUS Status = STATUS_SUCCESS; @@ -120,17 +119,16 @@ { /* Use the System Handle Table and decode */ HandleTable = ObpKernelHandleTable; - ExHandle = HANDLE_TO_EX_HANDLE(ObKernelHandleToHandle(Handles[i])); + Handles[i] = ObKernelHandleToHandle(Handles[i]); } else { /* Use the Process' Handle table and get the Ex Handle */ HandleTable = PsGetCurrentProcess()->ObjectTable; - ExHandle = HANDLE_TO_EX_HANDLE(Handles[i]); } /* Get a pointer to it */ - if (!(HandleEntry = ExMapHandleToPointer(HandleTable, ExHandle))) + if (!(HandleEntry = ExMapHandleToPointer(HandleTable, Handles[i]))) { DPRINT1("Invalid handle\n"); Status = STATUS_INVALID_HANDLE; _____ Modified: trunk/reactos/ntoskrnl/ps/process.c --- trunk/reactos/ntoskrnl/ps/process.c 2005-08-07 23:37:59 UTC (rev 17190) +++ trunk/reactos/ntoskrnl/ps/process.c 2005-08-07 23:43:58 UTC (rev 17191) @@ -480,7 +480,7 @@ /* Get the CID Handle Entry */ if (!(CidEntry = ExMapHandleToPointer(PspCidTable, - HANDLE_TO_EX_HANDLE(ProcessId)))) + ProcessId))) { /* Get the Process */ FoundProcess = CidEntry->u1.Object; @@ -518,7 +518,7 @@ /* Get the CID Handle Entry */ if (!(CidEntry = ExMapHandleToPointer(PspCidTable, - HANDLE_TO_EX_HANDLE(Cid->UniqueThread)))) + Cid->UniqueThread))) { /* Get the Process */ FoundThread = CidEntry->u1.Object; _____ Modified: trunk/reactos/ntoskrnl/ps/thread.c --- trunk/reactos/ntoskrnl/ps/thread.c 2005-08-07 23:37:59 UTC (rev 17190) +++ trunk/reactos/ntoskrnl/ps/thread.c 2005-08-07 23:43:58 UTC (rev 17191) @@ -377,7 +377,7 @@ /* Get the CID Handle Entry */ if (!(CidEntry = ExMapHandleToPointer(PspCidTable, - HANDLE_TO_EX_HANDLE(ThreadId)))) + ThreadId))) { /* Get the Process */ FoundThread = CidEntry->u1.Object; @@ -717,7 +717,6 @@ if (ClientId->UniqueProcess) { /* Get the Process */ - if (ClientId->UniqueProcess == (HANDLE)-1) KEBUGCHECK(0); DPRINT("Opening by Process ID: %x\n", ClientId->UniqueProcess); Status = PsLookupProcessThreadByCid(ClientId, NULL, _____ Modified: trunk/reactos/ntoskrnl/rtl/libsupp.c --- trunk/reactos/ntoskrnl/rtl/libsupp.c 2005-08-07 23:37:59 UTC (rev 17190) +++ trunk/reactos/ntoskrnl/rtl/libsupp.c 2005-08-07 23:43:58 UTC (rev 17191) @@ -246,33 +246,35 @@ RtlpFreeAtomHandle(PRTL_ATOM_TABLE AtomTable, PRTL_ATOM_TABLE_ENTRY Entry) { ExDestroyHandle(AtomTable->ExHandleTable, - (LONG)Entry->HandleIndex); + (HANDLE)((ULONG_PTR)Entry->HandleIndex << 2)); } BOOLEAN RtlpCreateAtomHandle(PRTL_ATOM_TABLE AtomTable, PRTL_ATOM_TABLE_ENTRY Entry) { HANDLE_TABLE_ENTRY ExEntry; - LONG HandleIndex; + HANDLE Handle; + USHORT HandleIndex; ExEntry.u1.Object = Entry; ExEntry.u2.GrantedAccess = 0x1; /* FIXME - valid handle */ - HandleIndex = ExCreateHandle(AtomTable->ExHandleTable, + Handle = ExCreateHandle(AtomTable->ExHandleTable, &ExEntry); - if (HandleIndex != EX_INVALID_HANDLE) + HandleIndex = (USHORT)((ULONG_PTR)Handle >> 2); + if (Handle != NULL) { /* FIXME - Handle Indexes >= 0xC000 ?! */ if (HandleIndex < 0xC000) { - Entry->HandleIndex = (USHORT)HandleIndex; - Entry->Atom = 0xC000 + (USHORT)HandleIndex; + Entry->HandleIndex = HandleIndex; + Entry->Atom = 0xC000 + HandleIndex; return TRUE; } else ExDestroyHandle(AtomTable->ExHandleTable, - HandleIndex); + Handle); } return FALSE; @@ -284,7 +286,7 @@ PHANDLE_TABLE_ENTRY ExEntry; ExEntry = ExMapHandleToPointer(AtomTable->ExHandleTable, - (LONG)Index); + (HANDLE)((ULONG_PTR)Index << 2)); if (ExEntry != NULL) { PRTL_ATOM_TABLE_ENTRY Entry;
19 years, 4 months
1
0
0
0
[weiden] 17190: use the correct pointer to free the string. Thx to Hartmut for spotting this bug
by weiden@svn.reactos.com
use the correct pointer to free the string. Thx to Hartmut for spotting this bug Modified: trunk/reactos/subsys/csrss/win32csr/conio.c _____ Modified: trunk/reactos/subsys/csrss/win32csr/conio.c --- trunk/reactos/subsys/csrss/win32csr/conio.c 2005-08-07 23:22:18 UTC (rev 17189) +++ trunk/reactos/subsys/csrss/win32csr/conio.c 2005-08-07 23:37:59 UTC (rev 17190) @@ -1545,7 +1545,7 @@ CSR_API(CsrWriteConsoleOutputChar) { NTSTATUS Status; - PCHAR String; + PCHAR String, tmpString = NULL; PBYTE Buffer; PCSRSS_CONSOLE Console; PCSRSS_SCREEN_BUFFER Buff; @@ -1577,7 +1577,7 @@ (PWCHAR)Request->Data.WriteConsoleOutputCharRequest.String, Request->Data.WriteConsoleOutputCharRequest.Length, NULL, 0, NULL, NULL); - String = RtlAllocateHeap(GetProcessHeap(), 0, Length); + tmpString = String = RtlAllocateHeap(GetProcessHeap(), 0, Length); if (String) { WideCharToMultiByte(Console->CodePage, 0, @@ -1635,7 +1635,7 @@ } if (Request->Data.WriteConsoleRequest.Unicode) { - RtlFreeHeap(GetProcessHeap(), 0, String); + RtlFreeHeap(GetProcessHeap(), 0, tmpString); } } if (NULL != Console)
19 years, 4 months
1
0
0
0
[ion] 17189: Retry waiting if STATUS_ALERTED is returned
by ion@svn.reactos.com
Retry waiting if STATUS_ALERTED is returned Modified: trunk/reactos/lib/kernel32/synch/wait.c _____ Modified: trunk/reactos/lib/kernel32/synch/wait.c --- trunk/reactos/lib/kernel32/synch/wait.c 2005-08-07 23:19:15 UTC (rev 17188) +++ trunk/reactos/lib/kernel32/synch/wait.c 2005-08-07 23:22:18 UTC (rev 17189) @@ -90,7 +90,7 @@ Time.QuadPart = -10000 * (LONGLONG)dwMilliseconds; TimePtr = &Time; } - +WaitAgain: Status = NtWaitForSingleObject(hHandle, (BOOLEAN) bAlertable, TimePtr); @@ -100,6 +100,7 @@ SetLastErrorByStatus (Status); return WAIT_FAILED; } + if (Status == STATUS_ALERTED && bAlertable) goto WaitAgain; return Status; } @@ -210,22 +211,24 @@ TimePtr = &Time; } +WaitAgain: Status = NtWaitForMultipleObjects (nCount, HandleBuffer, bWaitAll ? WaitAll : WaitAny, (BOOLEAN)bAlertable, TimePtr); - if (HandleBuffer != Handle) - { - RtlFreeHeap(RtlGetProcessHeap(), 0, HandleBuffer); - } - if (HIWORD(Status)) { SetLastErrorByStatus (Status); - return WAIT_FAILED; + Status = WAIT_FAILED; } + if (Status == STATUS_ALERTED && bAlertable) goto WaitAgain; + if (HandleBuffer != Handle) + { + RtlFreeHeap(RtlGetProcessHeap(), 0, HandleBuffer); + } + return Status; }
19 years, 4 months
1
0
0
0
← Newer
1
...
38
39
40
41
42
43
44
...
67
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
Results per page:
10
25
50
100
200