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
July 2008
----- 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
25 participants
761 discussions
Start a n
N
ew thread
[jimtabor] 34988: - Preliminary implementation of SetWinEventHook and UnhookWinEvent. - Only wine cross test uses this and testing is not stable. - Patches are welcome but all code is subject to change. - All Hook code should be ready by Aug 4th.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Thu Jul 31 18:48:35 2008 New Revision: 34988 URL:
http://svn.reactos.org/svn/reactos?rev=34988&view=rev
Log: - Preliminary implementation of SetWinEventHook and UnhookWinEvent. - Only wine cross test uses this and testing is not stable. - Patches are welcome but all code is subject to change. - All Hook code should be ready by Aug 4th. Modified: trunk/reactos/subsystems/win32/win32k/include/hook.h trunk/reactos/subsystems/win32/win32k/include/msgqueue.h trunk/reactos/subsystems/win32/win32k/ntuser/event.c trunk/reactos/subsystems/win32/win32k/ntuser/hook.c trunk/reactos/subsystems/win32/win32k/ntuser/message.c trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c Modified: trunk/reactos/subsystems/win32/win32k/include/hook.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/hook.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/hook.h [iso-8859-1] Thu Jul 31 18:48:35 2008 @@ -33,6 +33,8 @@ PETHREAD Thread; /* Thread owning the event */ UINT eventMin; UINT eventMax; + DWORD idProcess; + DWORD idThread; WINEVENTPROC Proc; /* Event function */ BOOLEAN Ansi; /* Is it an Ansi event? */ ULONG Flags; /* Some internal flags */ Modified: trunk/reactos/subsystems/win32/win32k/include/msgqueue.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/msgqueue.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/msgqueue.h [iso-8859-1] Thu Jul 31 18:48:35 2008 @@ -4,6 +4,9 @@ #include "hook.h" #define MSQ_HUNG 5000 +#define MSQ_NORMAL 0 +#define MSQ_ISHOOK 1 +#define MSQ_ISEVENT 2 typedef struct _USER_MESSAGE { @@ -25,7 +28,7 @@ ULONG_PTR CompletionCallbackContext; /* entry in the dispatching list of the sender's message queue */ LIST_ENTRY DispatchingListEntry; - BOOL HookMessage; + INT HookMessage; } USER_SENT_MESSAGE, *PUSER_SENT_MESSAGE; typedef struct _USER_SENT_MESSAGE_NOTIFY @@ -121,7 +124,7 @@ NTSTATUS FASTCALL co_MsqSendMessage(PUSER_MESSAGE_QUEUE MessageQueue, HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam, - UINT uTimeout, BOOL Block, BOOL HookMessage, + UINT uTimeout, BOOL Block, INT HookMessage, ULONG_PTR *uResult); PUSER_MESSAGE FASTCALL MsqCreateMessage(LPMSG Msg, BOOLEAN FreeLParam); Modified: trunk/reactos/subsystems/win32/win32k/ntuser/event.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/event.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/event.c [iso-8859-1] Thu Jul 31 18:48:35 2008 @@ -4,8 +4,9 @@ #define NDEBUG #include <debug.h> -//static PEVENTTABLE GlobalEvents; - +static PEVENTTABLE GlobalEvents = NULL; +static ULONG EventSys[EVENT_SYSTEM_MINIMIZEEND+1] = {0}; +static ULONG EventObj[( EVENT_OBJECT_ACCELERATORCHANGE - EVENT_OBJECT_CREATE) +1] = {0}; /* PRIVATE FUNCTIONS *********************************************************/ @@ -43,6 +44,88 @@ return Ret; } +static +VOID +FASTCALL +IntEventUpCount(ULONG eventMin, ULONG eventMax) +{ + INT i, Min, Max; + + if ( eventMin >= EVENT_SYSTEM_SOUND && eventMax <= EVENT_SYSTEM_MINIMIZEEND) + { + for (i = eventMin; i < eventMax; i++) + { + gpsi->SrvEventActivity |= GetMaskFromEvent(i); + EventSys[i]++; + } + } + if ( eventMin >= EVENT_OBJECT_CREATE && eventMax <= EVENT_OBJECT_ACCELERATORCHANGE) + { + for (i = eventMin; i < eventMax; i++) + { + gpsi->SrvEventActivity |= GetMaskFromEvent(i); + EventObj[i - EVENT_OBJECT_CREATE]++; + } + } + if ( eventMin >= EVENT_SYSTEM_SOUND && eventMax <= EVENT_OBJECT_ACCELERATORCHANGE) + { + Max = EVENT_SYSTEM_MINIMIZEEND; + for (i = eventMin; i < Max; i++) + { + gpsi->SrvEventActivity |= GetMaskFromEvent(i); + EventSys[i]++; + } + Min = EVENT_OBJECT_CREATE; + for (i = Min; i < eventMax; i++) + { + gpsi->SrvEventActivity |= GetMaskFromEvent(i); + EventObj[i - EVENT_OBJECT_CREATE]++; + } + } +} + +static +VOID +FASTCALL +IntEventDownCount(ULONG eventMin, ULONG eventMax) +{ + INT i, Min, Max; + + if ( eventMin >= EVENT_SYSTEM_SOUND && eventMax <= EVENT_SYSTEM_MINIMIZEEND) + { + for (i = eventMin; i < eventMax; i++) + { + EventSys[i]--; + if (!EventSys[i]) gpsi->SrvEventActivity &= ~GetMaskFromEvent(i); + } + } + if ( eventMin >= EVENT_OBJECT_CREATE && eventMax <= EVENT_OBJECT_ACCELERATORCHANGE) + { + for (i = eventMin; i < eventMax; i++) + { + EventObj[i - EVENT_OBJECT_CREATE]--; + if (!EventObj[i - EVENT_OBJECT_CREATE]) + gpsi->SrvEventActivity &= ~GetMaskFromEvent(i); + } + } + if ( eventMin >= EVENT_SYSTEM_SOUND && eventMax <= EVENT_OBJECT_ACCELERATORCHANGE) + { + Max = EVENT_SYSTEM_MINIMIZEEND; + for (i = eventMin; i < Max; i++) + { + EventSys[i]--; + if (!EventSys[i]) gpsi->SrvEventActivity &= ~GetMaskFromEvent(i); + } + Min = EVENT_OBJECT_CREATE; + for (i = Min; i < eventMax; i++) + { + EventObj[i - EVENT_OBJECT_CREATE]--; + if (!EventObj[i - EVENT_OBJECT_CREATE]) + gpsi->SrvEventActivity &= ~GetMaskFromEvent(i); + } + } +} + static DWORD @@ -50,6 +133,48 @@ TimeStamp(VOID) { return (DWORD)((ULONGLONG)SharedUserData->TickCountLowDeprecated * SharedUserData->TickCountMultiplier / 16777216); +} + +static +LRESULT +FASTCALL +IntCallLowLevelEvent( PEVENTHOOK pEH, + DWORD event, + HWND hwnd, + LONG idObject, + LONG idChild) +{ + NTSTATUS Status; + ULONG_PTR uResult; + + /* FIXME should get timeout from + * HKEY_CURRENT_USER\Control Panel\Desktop\LowLevelHooksTimeout */ + Status = co_MsqSendMessage(((PW32THREAD)pEH->Thread->Tcb.Win32Thread)->MessageQueue, + hwnd, + event, + idObject, + idChild, + 5000, + TRUE, + MSQ_ISEVENT, + &uResult); + + return NT_SUCCESS(Status) ? uResult : 0; +} + +static +BOOL +FASTCALL +IntRemoveEvent(PEVENTHOOK pEH) +{ + if (pEH) + { + RemoveEntryList(&pEH->Chain); + GlobalEvents->Counts--; + UserDeleteObject(pEH->Self, otEvent); + return TRUE; + } + return FALSE; } /* FUNCTIONS *****************************************************************/ @@ -62,18 +187,26 @@ LONG idChild) { - PEVENTHOOK peh = UserHeapAlloc(sizeof(EVENTHOOK)); + PEVENTHOOK pEH = UserHeapAlloc(sizeof(EVENTHOOK)); if ((gpsi->SrvEventActivity & GetMaskFromEvent(event))) return 0; // No events to run. - LRESULT Result = co_IntCallEventProc(peh->Self, + + if ((pEH->Thread != PsGetCurrentThread()) && (pEH->Thread != NULL)) + { + // Post it in message queue. + return IntCallLowLevelEvent(pEH, event, hwnd, idObject, idChild); + } + + + LRESULT Result = co_IntCallEventProc(pEH->Self, event, hwnd, idObject, idChild, (DWORD)(NtCurrentTeb()->Cid).UniqueThread, TimeStamp(), - peh->Proc); + pEH->Proc); return Result; } @@ -86,7 +219,9 @@ LONG idObject, LONG idChild) { + UserEnterExclusive(); UNIMPLEMENTED + UserLeave(); } HWINEVENTHOOK @@ -101,12 +236,98 @@ DWORD idThread, UINT dwflags) { - gpsi->SrvEventActivity |= GetMaskFromEvent(eventMin); - gpsi->SrvEventActivity &= ~GetMaskFromEvent(eventMin); - - UNIMPLEMENTED - - return 0; + PEVENTHOOK pEH; + HWINEVENTHOOK Ret = NULL; + UNICODE_STRING ModuleName; + NTSTATUS Status; + HANDLE Handle; + + UserEnterExclusive(); + + DPRINT1("WARNING! Use at your own risk! Function is UNIMPLEMENTED!\n"); + + if ( !GlobalEvents ) + { + GlobalEvents = ExAllocatePoolWithTag(PagedPool, sizeof(EVENTTABLE), TAG_HOOK); + GlobalEvents->Counts = 0; + InitializeListHead(&GlobalEvents->Events); + } + + pEH = UserCreateObject(gHandleTable, &Handle, otEvent, sizeof(EVENTHOOK)); + if (pEH) + { + InsertTailList(&GlobalEvents->Events, &pEH->Chain); + GlobalEvents->Counts++; + + pEH->Self = Handle; + pEH->Thread = PsGetCurrentThread(); + pEH->eventMin = eventMin; + pEH->eventMax = eventMax; + pEH->idProcess = idProcess; + pEH->idThread = idThread; + pEH->Ansi = FALSE; + pEH->Flags = dwflags; + + if ((dwflags & WINEVENT_INCONTEXT) && !hmodWinEventProc) + { + SetLastWin32Error(ERROR_HOOK_NEEDS_HMOD); + goto SetEventExit; + } + + if (eventMin > eventMax) + { + SetLastWin32Error(ERROR_INVALID_HOOK_FILTER); + goto SetEventExit; + } + + if (NULL != hmodWinEventProc) + { + Status = MmCopyFromCaller(&ModuleName, puString, sizeof(UNICODE_STRING)); + if (! NT_SUCCESS(Status)) + { + UserDereferenceObject(pEH); + IntRemoveEvent(pEH); + SetLastNtError(Status); + goto SetEventExit; + } + pEH->ModuleName.Buffer = ExAllocatePoolWithTag(PagedPool, + ModuleName.MaximumLength, + TAG_HOOK); + if (NULL == pEH->ModuleName.Buffer) + { + UserDereferenceObject(pEH); + IntRemoveEvent(pEH); + SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY); + goto SetEventExit; + } + pEH->ModuleName.MaximumLength = ModuleName.MaximumLength; + Status = MmCopyFromCaller(pEH->ModuleName.Buffer, + ModuleName.Buffer, + ModuleName.MaximumLength); + if (! NT_SUCCESS(Status)) + { + ExFreePool(pEH->ModuleName.Buffer); + UserDereferenceObject(pEH); + IntRemoveEvent(pEH); + SetLastNtError(Status); + goto SetEventExit; + } + pEH->ModuleName.Length = ModuleName.Length; + pEH->Proc = (void *)((char *)lpfnWinEventProc - (char *)hmodWinEventProc); + } + else + pEH->Proc = lpfnWinEventProc; + + Ret = Handle; + /* + Now we are good, set the Events and counts. + */ + IntEventUpCount(eventMin, eventMax); + } + +SetEventExit: + UserLeave(); + return Ret; } @@ -115,9 +336,22 @@ NtUserUnhookWinEvent( HWINEVENTHOOK hWinEventHook) { - UNIMPLEMENTED - - return FALSE; + PEVENTHOOK pEH; + BOOL Ret = FALSE; + + UserEnterExclusive(); + + DPRINT1("WARNING! Use at your own risk! Function is UNIMPLEMENTED!\n"); + + pEH = (PEVENTHOOK)UserGetObject(gHandleTable, hWinEventHook, otEvent); + if (pEH) + { + IntEventDownCount(pEH->eventMin, pEH->eventMax); + Ret = IntRemoveEvent(pEH); + } + + UserLeave(); + return Ret; } /* EOF */ Modified: trunk/reactos/subsystems/win32/win32k/ntuser/hook.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/hook.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/hook.c [iso-8859-1] Thu Jul 31 18:48:35 2008 @@ -281,7 +281,7 @@ lParam, 5000, TRUE, - TRUE, + MSQ_ISHOOK, &uResult); return NT_SUCCESS(Status) ? uResult : 0; Modified: trunk/reactos/subsystems/win32/win32k/ntuser/message.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/message.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/message.c [iso-8859-1] Thu Jul 31 18:48:35 2008 @@ -1555,7 +1555,7 @@ lParam, uTimeout, (uFlags & SMTO_BLOCK), - FALSE, + MSQ_NORMAL, uResult); } while ((STATUS_TIMEOUT == Status) && Modified: trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c [iso-8859-1] Thu Jul 31 18:48:35 2008 @@ -929,12 +929,19 @@ InsertTailList(&MessageQueue->LocalDispatchingMessagesHead, &Message->ListEntry); - if (Message->HookMessage) + if (Message->HookMessage == MSQ_ISHOOK) { Result = co_HOOK_CallHooks(Message->Msg.message, (INT)(INT_PTR)Message->Msg.hwnd, Message->Msg.wParam, Message->Msg.lParam); + } + else if (Message->HookMessage == MSQ_ISEVENT) + { + Result = co_EVENT_CallEvents( Message->Msg.message, + Message->Msg.hwnd, + (LONG) Message->Msg.wParam, + (LONG) Message->Msg.lParam); } else { @@ -1090,7 +1097,7 @@ NTSTATUS FASTCALL co_MsqSendMessage(PUSER_MESSAGE_QUEUE MessageQueue, HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam, - UINT uTimeout, BOOL Block, BOOL HookMessage, + UINT uTimeout, BOOL Block, INT HookMessage, ULONG_PTR *uResult) { PUSER_SENT_MESSAGE Message;
16 years, 4 months
1
0
0
0
[tkreuzer] 34987: - fix SECURITY_DESCRIPTOR_RELATIVE and KDPC_DATA
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Jul 31 18:04:35 2008 New Revision: 34987 URL:
http://svn.reactos.org/svn/reactos?rev=34987&view=rev
Log: - fix SECURITY_DESCRIPTOR_RELATIVE and KDPC_DATA Modified: branches/ros-amd64-bringup/reactos/include/ddk/ntifs.h branches/ros-amd64-bringup/reactos/include/ndk/ketypes.h Modified: branches/ros-amd64-bringup/reactos/include/ddk/ntifs.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/inclu…
============================================================================== --- branches/ros-amd64-bringup/reactos/include/ddk/ntifs.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/include/ddk/ntifs.h [iso-8859-1] Thu Jul 31 18:04:35 2008 @@ -787,10 +787,10 @@ BYTE Revision; BYTE Sbz1; SECURITY_DESCRIPTOR_CONTROL Control; - DWORD Owner; - DWORD Group; - DWORD Sacl; - DWORD Dacl; + DWORD_PTR Owner; + DWORD_PTR Group; + DWORD_PTR Sacl; + DWORD_PTR Dacl; } SECURITY_DESCRIPTOR_RELATIVE, *PISECURITY_DESCRIPTOR_RELATIVE; typedef enum _TOKEN_INFORMATION_CLASS { TokenUser=1,TokenGroups,TokenPrivileges,TokenOwner, Modified: branches/ros-amd64-bringup/reactos/include/ndk/ketypes.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/inclu…
============================================================================== --- branches/ros-amd64-bringup/reactos/include/ndk/ketypes.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/include/ndk/ketypes.h [iso-8859-1] Thu Jul 31 18:04:35 2008 @@ -558,7 +558,7 @@ typedef struct _KDPC_DATA { LIST_ENTRY DpcListHead; - ULONG DpcLock; + ULONG_PTR DpcLock; volatile ULONG DpcQueueDepth; ULONG DpcCount; } KDPC_DATA, *PKDPC_DATA;
16 years, 4 months
1
0
0
0
[tkreuzer] 34986: - fix usage of InterlockedExchangePointer - some ULONG / SIZE_T fixes - pushlocks have a union with a PVOID and an ULONG, use them instead of typecasting - use InterlockedAndPointer for a pushlock
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Jul 31 18:01:51 2008 New Revision: 34986 URL:
http://svn.reactos.org/svn/reactos?rev=34986&view=rev
Log: - fix usage of InterlockedExchangePointer - some ULONG / SIZE_T fixes - pushlocks have a union with a PVOID and an ULONG, use them instead of typecasting - use InterlockedAndPointer for a pushlock Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/config/cmkcbncb.c branches/ros-amd64-bringup/reactos/ntoskrnl/ex/handle.c branches/ros-amd64-bringup/reactos/ntoskrnl/ex/init.c branches/ros-amd64-bringup/reactos/ntoskrnl/ex/pushlock.c branches/ros-amd64-bringup/reactos/ntoskrnl/kdbg/kdb.c branches/ros-amd64-bringup/reactos/ntoskrnl/se/audit.c branches/ros-amd64-bringup/reactos/ntoskrnl/se/lsa.c Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/config/cmkcbncb.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/config/cmkcbncb.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/config/cmkcbncb.c [iso-8859-1] Thu Jul 31 18:01:51 2008 @@ -903,7 +903,7 @@ for (i = 0; i < 4; i++) { /* Add it into the list */ - if (!InterlockedCompareExchangePointer(&KeyBody->KeyControlBlock-> + if (!InterlockedCompareExchangePointer((PVOID*)&KeyBody->KeyControlBlock-> KeyBodyArray[i], KeyBody, NULL)) @@ -959,7 +959,7 @@ for (i = 0; i < 4; i++) { /* Add it into the list */ - if (InterlockedCompareExchangePointer(&KeyBody->KeyControlBlock-> + if (InterlockedCompareExchangePointer((VOID*)&KeyBody->KeyControlBlock-> KeyBodyArray[i], NULL, KeyBody) == KeyBody) Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ex/handle.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/ex/handle.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/ex/handle.c [iso-8859-1] Thu Jul 31 18:01:51 2008 @@ -516,7 +516,7 @@ /* Write the new level and attempt to change the table code */ TableBase = ((ULONG_PTR)Mid) | 1; - Value = InterlockedExchangePointer(&HandleTable->TableCode, TableBase); + Value = InterlockedExchangePointer((PVOID*)&HandleTable->TableCode, (PVOID)TableBase); } else if (TableLevel == 1) { @@ -533,7 +533,7 @@ if (!Low) return FALSE; /* Update the table */ - Value = InterlockedExchangePointer(&SecondLevel[i], Low); + Value = InterlockedExchangePointer((PVOID*)&SecondLevel[i], Low); ASSERT(Value == NULL); } else @@ -560,7 +560,7 @@ /* Write the new table and change the table code */ TableBase = ((ULONG_PTR)High) | 2; - Value = InterlockedExchangePointer(&HandleTable->TableCode, + Value = InterlockedExchangePointer((PVOID*)&HandleTable->TableCode, (PVOID)TableBase); } } @@ -581,7 +581,7 @@ if (!Mid) return FALSE; /* Update the table pointer */ - Value = InterlockedExchangePointer(&ThirdLevel[i], Mid); + Value = InterlockedExchangePointer((PVOID*)&ThirdLevel[i], Mid); ASSERT(Value == NULL); } else @@ -596,7 +596,7 @@ if (!Low) return FALSE; /* Update the table pointer */ - Value = InterlockedExchangePointer(&ThirdLevel[i][j], Low); + Value = InterlockedExchangePointer((PVOID*)&ThirdLevel[i][j], Low); ASSERT(Value == NULL); } } @@ -886,8 +886,8 @@ /* It's not locked, remove the lock bit to lock it */ NewValue = OldValue & ~EXHANDLE_TABLE_ENTRY_LOCK_BIT; if (InterlockedCompareExchangePointer(&HandleTableEntry->Object, - NewValue, - OldValue) == (PVOID)OldValue) + (PVOID)NewValue, + (PVOID)OldValue) == (PVOID)OldValue) { /* We locked it, get out */ return TRUE; @@ -1010,7 +1010,7 @@ } /* Clear the handle */ - Object = InterlockedExchangePointer(&HandleTableEntry->Object, NULL); + Object = InterlockedExchangePointer((PVOID*)&HandleTableEntry->Object, NULL); /* Sanity checks */ ASSERT(Object != NULL); Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ex/init.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/ex/init.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/ex/init.c [iso-8859-1] Thu Jul 31 18:01:51 2008 @@ -68,7 +68,7 @@ ULONG ExpAnsiCodePageDataOffset, ExpOemCodePageDataOffset; ULONG ExpUnicodeCaseTableDataOffset; NLSTABLEINFO ExpNlsTableInfo; -ULONG ExpNlsTableSize; +SIZE_T ExpNlsTableSize; PVOID ExpNlsSectionPointer; /* CMOS Timer Sanity */ @@ -196,7 +196,7 @@ NTSTATUS Status; HANDLE NlsSection; PVOID SectionBase = NULL; - ULONG ViewSize = 0; + SIZE_T ViewSize = 0; LARGE_INTEGER SectionOffset = {{0}}; PLIST_ENTRY ListHead, NextEntry; PMEMORY_ALLOCATION_DESCRIPTOR MdBlock; @@ -369,7 +369,7 @@ OUT PCHAR *ProcessEnvironment) { NTSTATUS Status; - ULONG Size; + SIZE_T Size; PWSTR p; UNICODE_STRING NullString = RTL_CONSTANT_STRING(L""); UNICODE_STRING SmssName, Environment, SystemDriveString, DebugString; @@ -829,7 +829,7 @@ PLDR_DATA_TABLE_ENTRY NtosEntry; PRTL_MESSAGE_RESOURCE_ENTRY MsgEntry; ANSI_STRING CsdString; - ULONG Remaining = 0; + SIZE_T Remaining = 0; PCHAR RcEnd = NULL; CHAR VersionBuffer [65]; @@ -1258,7 +1258,8 @@ PCHAR StringBuffer, EndBuffer, BeginBuffer, MpString = ""; PINIT_BUFFER InitBuffer; ANSI_STRING TempString; - ULONG LastTzBias, Size, Length, YearHack = 0, Disposition, MessageCode = 0; + ULONG LastTzBias, Size, YearHack = 0, Disposition, MessageCode = 0; + SIZE_T Length; PRTL_USER_PROCESS_INFORMATION ProcessInfo; KEY_VALUE_PARTIAL_INFORMATION KeyPartialInfo; UNICODE_STRING KeyName, DebugString; @@ -1738,7 +1739,7 @@ KeyValuePartialInformation, &KeyPartialInfo, sizeof(KeyPartialInfo), - &Length); + &Size); if (!NT_SUCCESS(Status)) AlternateShell = FALSE; } @@ -1890,17 +1891,17 @@ ZwClose(ProcessInfo->ProcessHandle); /* Free the initial process environment */ - Size = 0; + Length = 0; ZwFreeVirtualMemory(NtCurrentProcess(), (PVOID*)&Environment, - &Size, + &Length, MEM_RELEASE); /* Free the initial process parameters */ - Size = 0; + Length = 0; ZwFreeVirtualMemory(NtCurrentProcess(), (PVOID*)&ProcessParameters, - &Size, + &Length, MEM_RELEASE); /* Increase init phase */ Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ex/pushlock.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/ex/pushlock.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/ex/pushlock.c [iso-8859-1] Thu Jul 31 18:01:51 2008 @@ -19,6 +19,12 @@ #undef PEX_PUSH_LOCK /* PRIVATE FUNCTIONS *********************************************************/ + +#ifdef _WIN64 +#define InterlockedAndPointer(ptr,val) InterlockedAnd64((PLONGLONG)ptr,(LONGLONG)val) +#else +#define InterlockedAndPointer(ptr,val) InterlockedAnd((PLONG)ptr,(LONG)val) +#endif /*++ * @name ExpInitializePushLocks @@ -87,7 +93,7 @@ ASSERT(NewValue.Waiting); /* Write the New Value */ - NewValue.Ptr = InterlockedCompareExchangePointer(PushLock, + NewValue.Ptr = InterlockedCompareExchangePointer(&PushLock->Ptr, NewValue.Ptr, OldValue.Ptr); if (NewValue.Value == OldValue.Value) return; @@ -97,7 +103,7 @@ } /* Save the First Block */ - FirstWaitBlock = (PEX_PUSH_LOCK_WAIT_BLOCK)((ULONG_PTR)OldValue.Ptr & + FirstWaitBlock = (PEX_PUSH_LOCK_WAIT_BLOCK)(OldValue.Value & ~EX_PUSH_LOCK_PTR_BITS); WaitBlock = FirstWaitBlock; @@ -135,7 +141,7 @@ ASSERT(!NewValue.Waking); /* Write the New Value */ - NewValue.Ptr = InterlockedCompareExchangePointer(PushLock, + NewValue.Ptr = InterlockedCompareExchangePointer(&PushLock->Ptr, NewValue.Ptr, OldValue.Ptr); if (NewValue.Value == OldValue.Value) break; @@ -154,7 +160,7 @@ ASSERT(PushLock->Waiting); /* Remove waking bit from pushlock */ - InterlockedAnd((PLONG)PushLock, ~EX_PUSH_LOCK_WAKING); + InterlockedAndPointer(&PushLock->Value, ~EX_PUSH_LOCK_WAKING); /* Leave the loop */ break; @@ -236,7 +242,7 @@ } /* Get the wait block */ - WaitBlock = (PEX_PUSH_LOCK_WAIT_BLOCK)((ULONG_PTR)OldValue.Ptr & + WaitBlock = (PEX_PUSH_LOCK_WAIT_BLOCK)(OldValue.Value & ~EX_PUSH_LOCK_PTR_BITS); /* Loop the blocks */ @@ -270,7 +276,7 @@ ASSERT(!NewValue.Waking); /* Update the value */ - NewValue.Ptr = InterlockedCompareExchangePointer(PushLock, + NewValue.Ptr = InterlockedCompareExchangePointer(&PushLock->Ptr, NewValue.Ptr, OldValue.Ptr); @@ -477,7 +483,7 @@ ASSERT(NewValue.Locked); /* Set the new value */ - if (InterlockedCompareExchangePointer(PushLock, + if (InterlockedCompareExchangePointer(&PushLock->Ptr, NewValue.Ptr, OldValue.Ptr) != OldValue.Ptr) { @@ -507,8 +513,8 @@ WaitBlock->ShareCount = 0; /* Set the current Wait Block pointer */ - WaitBlock->Next = (PEX_PUSH_LOCK_WAIT_BLOCK)((ULONG_PTR) - OldValue.Ptr &~ EX_PUSH_LOCK_PTR_BITS); + WaitBlock->Next = (PEX_PUSH_LOCK_WAIT_BLOCK)( + OldValue.Value &~ EX_PUSH_LOCK_PTR_BITS); /* Point to ours */ NewValue.Value = (OldValue.Value & EX_PUSH_LOCK_MULTIPLE_SHARED) | @@ -563,7 +569,7 @@ /* Write the new value */ TempValue = NewValue; - NewValue.Ptr = InterlockedCompareExchangePointer(PushLock, + NewValue.Ptr = InterlockedCompareExchangePointer(&PushLock->Ptr, NewValue.Ptr, OldValue.Ptr); if (NewValue.Value != OldValue.Value) @@ -655,7 +661,7 @@ ASSERT(NewValue.Locked); /* Set the new value */ - NewValue.Ptr = InterlockedCompareExchangePointer(PushLock, + NewValue.Ptr = InterlockedCompareExchangePointer(&PushLock->Ptr, NewValue.Ptr, OldValue.Ptr); if (NewValue.Value != OldValue.Value) @@ -680,8 +686,8 @@ if (OldValue.Waiting) { /* Set the current Wait Block pointer */ - WaitBlock->Next = (PEX_PUSH_LOCK_WAIT_BLOCK)((ULONG_PTR) - OldValue.Ptr &~ EX_PUSH_LOCK_PTR_BITS); + WaitBlock->Next = (PEX_PUSH_LOCK_WAIT_BLOCK)( + OldValue.Value &~ EX_PUSH_LOCK_PTR_BITS); /* Nobody is the last waiter yet */ WaitBlock->Last = NULL; @@ -719,7 +725,7 @@ #endif /* Write the new value */ - NewValue.Ptr = InterlockedCompareExchangePointer(PushLock, + NewValue.Ptr = InterlockedCompareExchangePointer(&PushLock->Ptr, NewValue.Ptr, OldValue.Ptr); if (NewValue.Ptr != OldValue.Ptr) @@ -810,7 +816,7 @@ } /* Write the New Value */ - NewValue.Ptr = InterlockedCompareExchangePointer(PushLock, + NewValue.Ptr = InterlockedCompareExchangePointer(&PushLock->Ptr, NewValue.Ptr, OldValue.Ptr); if (NewValue.Value == OldValue.Value) return; @@ -824,7 +830,7 @@ if (OldValue.MultipleShared) { /* Get the wait block */ - WaitBlock = (PEX_PUSH_LOCK_WAIT_BLOCK)((ULONG_PTR)OldValue.Ptr & + WaitBlock = (PEX_PUSH_LOCK_WAIT_BLOCK)(OldValue.Value & ~EX_PUSH_LOCK_PTR_BITS); /* Loop until we find the last wait block */ @@ -877,7 +883,7 @@ ASSERT(NewValue.Waking && !NewValue.Locked && !NewValue.MultipleShared); /* Write the new value */ - NewValue.Ptr = InterlockedCompareExchangePointer(PushLock, + NewValue.Ptr = InterlockedCompareExchangePointer(&PushLock->Ptr, NewValue.Ptr, OldValue.Ptr); if (NewValue.Value == OldValue.Value) return; @@ -897,7 +903,7 @@ /* Write the new value */ WakeValue = NewValue; - NewValue.Ptr = InterlockedCompareExchangePointer(PushLock, + NewValue.Ptr = InterlockedCompareExchangePointer(&PushLock->Ptr, NewValue.Ptr, OldValue.Ptr); if (NewValue.Value != OldValue.Value) continue; @@ -950,7 +956,7 @@ } /* Write the New Value */ - NewValue.Ptr = InterlockedCompareExchangePointer(PushLock, + NewValue.Ptr = InterlockedCompareExchangePointer(&PushLock->Ptr, NewValue.Ptr, OldValue.Ptr); if (NewValue.Value == OldValue.Value) return; @@ -963,7 +969,7 @@ if (OldValue.MultipleShared) { /* Get the wait block */ - WaitBlock = (PEX_PUSH_LOCK_WAIT_BLOCK)((ULONG_PTR)OldValue.Ptr & + WaitBlock = (PEX_PUSH_LOCK_WAIT_BLOCK)(OldValue.Value & ~EX_PUSH_LOCK_PTR_BITS); /* Loop until we find the last wait block */ @@ -1013,7 +1019,7 @@ ASSERT(NewValue.Waking && !NewValue.Locked && !NewValue.MultipleShared); /* Write the new value */ - NewValue.Ptr = InterlockedCompareExchangePointer(PushLock, + NewValue.Ptr = InterlockedCompareExchangePointer(&PushLock->Ptr, NewValue.Ptr, OldValue.Ptr); if (NewValue.Value == OldValue.Value) return; @@ -1033,7 +1039,7 @@ /* Write the new value */ WakeValue = NewValue; - NewValue.Ptr = InterlockedCompareExchangePointer(PushLock, + NewValue.Ptr = InterlockedCompareExchangePointer(&PushLock->Ptr, NewValue.Ptr, OldValue.Ptr); if (NewValue.Value != OldValue.Value) continue; @@ -1087,7 +1093,7 @@ /* Write the New Value. Save our original value for waking */ WakeValue = NewValue; - NewValue.Ptr = InterlockedCompareExchangePointer(PushLock, + NewValue.Ptr = InterlockedCompareExchangePointer(&PushLock->Ptr, NewValue.Ptr, OldValue.Ptr); @@ -1108,7 +1114,7 @@ ASSERT(NewValue.Waking && !NewValue.Waiting); /* Write the New Value */ - NewValue.Ptr = InterlockedCompareExchangePointer(PushLock, + NewValue.Ptr = InterlockedCompareExchangePointer(&PushLock->Ptr, NewValue.Ptr, OldValue.Ptr); @@ -1152,7 +1158,7 @@ NewValue.Waking = TRUE; /* Write the New Value */ - if (InterlockedCompareExchangePointer(PushLock, + if (InterlockedCompareExchangePointer(&PushLock->Ptr, NewValue.Ptr, OldValue.Ptr) == OldValue.Ptr) { Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/kdbg/kdb.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/kdbg/kdb.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/kdbg/kdb.c [iso-8859-1] Thu Jul 31 18:01:51 2008 @@ -201,6 +201,7 @@ RtlZeroMemory(KdbTrapFrame, sizeof(KDB_KTRAP_FRAME)); StackPtr = (ULONG_PTR *) KernelStack; +#if _M_X86_ KdbTrapFrame->Tf.Ebp = StackPtr[3]; KdbTrapFrame->Tf.Edi = StackPtr[4]; KdbTrapFrame->Tf.Esi = StackPtr[5]; @@ -212,6 +213,7 @@ KdbTrapFrame->Tf.SegDs = KGDT_R0_DATA; KdbTrapFrame->Tf.SegEs = KGDT_R0_DATA; KdbTrapFrame->Tf.SegGs = KGDT_R0_DATA; +#endif /* FIXME: what about the other registers??? */ } @@ -405,7 +407,7 @@ } /* Get the interrupt descriptor */ - if (!NT_SUCCESS(KdbpSafeReadMemory(IntDesc, (PVOID)(Idtr.Base + (IntVect * 8)), sizeof (IntDesc)))) + if (!NT_SUCCESS(KdbpSafeReadMemory(IntDesc, (PVOID)(ULONG_PTR)(Idtr.Base + (IntVect * 8)), sizeof (IntDesc)))) { /*KdbpPrint("Couldn't access memory at 0x%p\n", (ULONG_PTR)Idtr.Base + (IntVect * 8));*/ return FALSE; @@ -1073,7 +1075,7 @@ /* Get a pointer to the thread */ if (!NT_SUCCESS(PsLookupThreadByThreadId(ThreadId, &Thread))) { - KdbpPrint("Invalid thread id: 0x%08x\n", (ULONG)ThreadId); + KdbpPrint("Invalid thread id: 0x%08x\n", (ULONG_PTR)ThreadId); return FALSE; } Process = Thread->ThreadsProcess; @@ -1152,14 +1154,14 @@ /* Get a pointer to the process */ if (!NT_SUCCESS(PsLookupProcessByProcessId(ProcessId, &Process))) { - KdbpPrint("Invalid process id: 0x%08x\n", (ULONG)ProcessId); + KdbpPrint("Invalid process id: 0x%08x\n", (ULONG_PTR)ProcessId); return FALSE; } Entry = Process->ThreadListHead.Flink; if (Entry == &KdbCurrentProcess->ThreadListHead) { - KdbpPrint("No threads in process 0x%08x, cannot attach to process!\n", (ULONG)ProcessId); + KdbpPrint("No threads in process 0x%p, cannot attach to process!\n", ProcessId); return FALSE; } @@ -1200,7 +1202,7 @@ SavedStackLimit = Thread->Tcb.StackLimit; SavedKernelStack = Thread->Tcb.KernelStack; Thread->Tcb.InitialStack = Thread->Tcb.StackBase = (char*)KdbStack + KDB_STACK_SIZE; - Thread->Tcb.StackLimit = (ULONG)KdbStack; + Thread->Tcb.StackLimit = (ULONG_PTR)KdbStack; Thread->Tcb.KernelStack = (char*)KdbStack + KDB_STACK_SIZE; /*KdbpPrint("Switching to KDB stack 0x%08x-0x%08x\n", Thread->Tcb.StackLimit, Thread->Tcb.StackBase);*/ @@ -1613,7 +1615,7 @@ TrapFrame->Dr6 &= ~0x0000e00f; /* Skip the current instruction */ - Context->Eip++; +// Context->Eip++; } return ContinueType; Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/se/audit.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/se/audit.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/se/audit.c [iso-8859-1] Thu Jul 31 18:01:51 2008 @@ -137,7 +137,7 @@ if (NT_SUCCESS(Status)) { /* Set it */ - if (InterlockedCompareExchangePointer(&Process-> + if (InterlockedCompareExchangePointer((PVOID*)&Process-> SeAuditProcessCreationInfo, AuditName, NULL)) Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/se/lsa.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/se/lsa.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/se/lsa.c [iso-8859-1] Thu Jul 31 18:01:51 2008 @@ -49,7 +49,7 @@ NTAPI LsaFreeReturnBuffer(PVOID Buffer) { - ULONG Size = 0; + SIZE_T Size = 0; return ZwFreeVirtualMemory(NtCurrentProcess(), &Buffer, &Size,
16 years, 4 months
1
0
0
0
[jimtabor] 34985: - Support relative callback proc with module base.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Thu Jul 31 17:48:59 2008 New Revision: 34985 URL:
http://svn.reactos.org/svn/reactos?rev=34985&view=rev
Log: - Support relative callback proc with module base. Modified: trunk/reactos/subsystems/win32/win32k/ntuser/hook.c Modified: trunk/reactos/subsystems/win32/win32k/ntuser/hook.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/hook.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/hook.c [iso-8859-1] Thu Jul 31 17:48:59 2008 @@ -1142,7 +1142,11 @@ Hook->ModuleName.Length = ModuleName.Length; } - Hook->Proc = HookProc; + if (Mod) /* make proc relative to the module base */ + Hook->Proc = (void *)((char *)HookProc - (char *)Mod); + else + Hook->Proc = HookProc; + Hook->Ansi = Ansi; Handle = Hook->Self;
16 years, 4 months
1
0
0
0
[jmorlan] 34984: Fix handle leaks in RtlCreateUserThread and SmExecPgm.
by jmorlan@svn.reactos.org
Author: jmorlan Date: Thu Jul 31 16:33:17 2008 New Revision: 34984 URL:
http://svn.reactos.org/svn/reactos?rev=34984&view=rev
Log: Fix handle leaks in RtlCreateUserThread and SmExecPgm. Modified: trunk/reactos/base/system/smss/smapiexec.c trunk/reactos/lib/rtl/thread.c Modified: trunk/reactos/base/system/smss/smapiexec.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/smss/smapiexec…
============================================================================== --- trunk/reactos/base/system/smss/smapiexec.c [iso-8859-1] (original) +++ trunk/reactos/base/system/smss/smapiexec.c [iso-8859-1] Thu Jul 31 16:33:17 2008 @@ -265,6 +265,8 @@ DPRINT1("SM: %s: SmCreateClient failed (Status=0x%08lx)\n", __FUNCTION__, Status); } + NtClose(ProcessInfo.ThreadHandle); + NtClose(ProcessInfo.ProcessHandle); } } else Modified: trunk/reactos/lib/rtl/thread.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/thread.c?rev=34984…
============================================================================== --- trunk/reactos/lib/rtl/thread.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/thread.c [iso-8859-1] Thu Jul 31 16:33:17 2008 @@ -209,7 +209,10 @@ else { /* Return thread data */ - if (ThreadHandle) *ThreadHandle = Handle; + if (ThreadHandle) + *ThreadHandle = Handle; + else + NtClose(Handle); if (ClientId) *ClientId = ThreadCid; }
16 years, 4 months
1
0
0
0
[mkupfer] 34983: Mario Kacmar <kario AT szm DOT sk> - Key remapping for qwertz applied.
by mkupfer@svn.reactos.org
Author: mkupfer Date: Thu Jul 31 14:53:49 2008 New Revision: 34983 URL:
http://svn.reactos.org/svn/reactos?rev=34983&view=rev
Log: Mario Kacmar <kario AT szm DOT sk> - Key remapping for qwertz applied. Modified: trunk/reactos/dll/keyboard/kbdsk/kbdsk.c Modified: trunk/reactos/dll/keyboard/kbdsk/kbdsk.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/keyboard/kbdsk/kbdsk.c…
============================================================================== --- trunk/reactos/dll/keyboard/kbdsk/kbdsk.c [iso-8859-1] (original) +++ trunk/reactos/dll/keyboard/kbdsk/kbdsk.c [iso-8859-1] Thu Jul 31 14:53:49 2008 @@ -41,9 +41,9 @@ '7', '8', '9', '0', VK_OEM_MINUS, VK_OEM_PLUS, VK_BACK, /* - 0f - */ - /* First Letters Row */ + /* First Letters Row - qwertZ */ VK_TAB, 'Q', 'W', 'E', - 'R', 'T', 'Y', 'U', + 'R', 'T', 'Z', 'U', 'I', 'O', 'P', VK_OEM_4, VK_OEM_6, VK_RETURN, /* - 1d - */ @@ -55,7 +55,7 @@ VK_LSHIFT, VK_OEM_7, /* - 2c - */ /* Third letters row */ - 'Z', 'X', 'C', 'V', + 'Y', 'X', 'C', 'V', 'B', 'N', 'M', VK_OEM_COMMA, VK_OEM_PERIOD,VK_OEM_2, VK_RSHIFT|KEXT, /* - 37 - */ @@ -253,8 +253,8 @@ { 'V', CAPS, {'v', 'V', 0x16, '@'} }, { 'W', CAPS, {'w', 'W', 0x17, '|'} }, { 'X', CAPS, {'x', 'X', 0x18, '#'} }, - { 'Y', CAPS, {'z', 'Z', 0x1a, WCH_NONE} }, // qwertZ - { 'Z', CAPS, {'y', 'Y', 0x19, '>'} }, + { 'Y', CAPS, {'y', 'Y', 0x19, WCH_NONE} }, + { 'Z', CAPS, {'z', 'Z', 0x1a, '>'} }, { 0, 0 } };
16 years, 4 months
1
0
0
0
[pschweitzer] 34982: - Implemented FsRtlNotifyFullChangeDirectory, FsRtlNotifyFullReportChange, FsRtlNotifyReportChange - Fixed implementation for FsRtlNotifyChangeDirectory - Updated comments
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Thu Jul 31 13:42:50 2008 New Revision: 34982 URL:
http://svn.reactos.org/svn/reactos?rev=34982&view=rev
Log: - Implemented FsRtlNotifyFullChangeDirectory, FsRtlNotifyFullReportChange, FsRtlNotifyReportChange - Fixed implementation for FsRtlNotifyChangeDirectory - Updated comments Modified: branches/pierre-fsd/ntoskrnl/fsrtl/notify.c Modified: branches/pierre-fsd/ntoskrnl/fsrtl/notify.c URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/ntoskrnl/fsrtl/notif…
============================================================================== --- branches/pierre-fsd/ntoskrnl/fsrtl/notify.c [iso-8859-1] (original) +++ branches/pierre-fsd/ntoskrnl/fsrtl/notify.c [iso-8859-1] Thu Jul 31 13:42:50 2008 @@ -44,8 +44,7 @@ * * @return None * - * @remarks This function only redirects to FsRtlNotifyFullChangeDirectory. - * So, it's better to call the entire function. + * @remarks This function only redirects to FsRtlNotifyFilterChangeDirectory. * *--*/ VOID @@ -58,16 +57,17 @@ IN ULONG CompletionFilter, IN PIRP NotifyIrp) { - FsRtlNotifyFullChangeDirectory(NotifySync, - NotifyList, - FsContext, - FullDirectoryName, - WatchTree, - TRUE, - CompletionFilter, - NotifyIrp, - NULL, - NULL); + FsRtlNotifyFilterChangeDirectory(NotifySync, + NotifyList, + FsContext, + FullDirectoryName, + WatchTree, + TRUE, + CompletionFilter, + NotifyIrp, + NULL, + NULL, + NULL); } /*++ @@ -219,43 +219,46 @@ /*++ * @name FsRtlNotifyFullChangeDirectory - * @unimplemented - * - * FILLME - * - * @param NotifySync - * FILLME - * - * @param NotifyList - * FILLME + * @implemented + * + * Lets FSD know if changes occures in the specified directory. + * + * @param NotifySync + * Synchronization object pointer + * + * @param NotifyList + * Notify list pointer (to head) * * @param FsContext - * FILLME + * Used to identify the notify structure * * @param FullDirectoryName - * FILLME + * String (A or W) containing the full directory name * * @param WatchTree - * FILLME + * True to notify changes in subdirectories too * * @param IgnoreBuffer - * FILLME + * True to reenumerate directory. It's ignored it NotifyIrp is null * * @param CompletionFilter - * FILLME - * - * @param Irp - * FILLME + * Used to define types of changes to notify + * + * @param NotifyIrp + * IRP pointer to complete notify operation. It can be null * * @param TraverseCallback - * FILLME + * Pointer to a callback function. It's called each time a change is + * done in a subdirectory of the main directory. It's ignored it NotifyIrp + * is null * * @param SubjectContext - * FILLME - * - * @return None - * - * @remarks None + * Pointer to pass to SubjectContext member of TraverseCallback. + * It's freed after use. It's ignored it NotifyIrp is null + * + * @return None + * + * @remarks This function only redirects to FsRtlNotifyFilterChangeDirectory. * *--*/ VOID @@ -267,49 +270,60 @@ IN BOOLEAN WatchTree, IN BOOLEAN IgnoreBuffer, IN ULONG CompletionFilter, - IN PIRP Irp, + IN PIRP NotifyIrp, IN PCHECK_FOR_TRAVERSE_ACCESS TraverseCallback OPTIONAL, IN PSECURITY_SUBJECT_CONTEXT SubjectContext OPTIONAL) { - KEBUGCHECK(0); + FsRtlNotifyFilterChangeDirectory(NotifySync, + NotifyList, + FsContext, + FullDirectoryName, + WatchTree, + IgnoreBuffer, + CompletionFilter, + NotifyIrp, + TraverseCallback, + SubjectContext, + NULL); } /*++ * @name FsRtlNotifyFullReportChange - * @unimplemented - * - * FILLME - * - * @param NotifySync - * FILLME - * - * @param NotifyList - * FILLME + * @implemented + * + * Complets the pending notify IRPs. + * + * @param NotifySync + * Synchronization object pointer + * + * @param NotifyList + * Notify list pointer (to head) * * @param FullTargetName - * FILLME + * String (A or W) containing the full directory name that changed * * @param TargetNameOffset - * FILLME + * Offset, in FullTargetName, of the final component that is in the changed directory * * @param StreamName - * FILLME + * String (A or W) containing a stream name * * @param NormalizedParentName - * FILLME + * String (A or W) containing the full directory name that changed with long names * * @param FilterMatch - * FILLME + * Flags that will be compared to the completion filter * * @param Action - * FILLME + * Action code to store in user's buffer * * @param TargetContext - * FILLME - * - * @return None - * - * @remarks None + * Pointer to a callback function. It's called each time a change is + * done in a subdirectory of the main directory. + * + * @return None + * + * @remarks This function only redirects to FsRtlNotifyFilterReportChange. * *--*/ VOID @@ -324,7 +338,16 @@ IN ULONG Action, IN PVOID TargetContext) { - KEBUGCHECK(0); + FsRtlNotifyFilterReportChange(NotifySync, + NotifyList, + FullTargetName, + TargetNameOffset, + StreamName, + NormalizedParentName, + FilterMatch, + Action, + TargetContext, + NULL); } /*++ @@ -350,28 +373,28 @@ /*++ * @name FsRtlNotifyReportChange - * @unimplemented - * - * FILLME - * - * @param NotifySync - * FILLME - * - * @param NotifyList - * FILLME + * @implemented + * + * Complets the pending notify IRPs. + * + * @param NotifySync + * Synchronization object pointer + * + * @param NotifyList + * Notify list pointer (to head) * * @param FullTargetName - * FILLME + * String (A or W) containing the full directory name that changed * * @param FileNamePartLength - * FILLME + * Length of the final component that is in the changed directory * * @param FilterMatch - * FILLME - * - * @return None - * - * @remarks None + * Flags that will be compared to the completion filter + * + * @return None + * + * @remarks This function only redirects to FsRtlNotifyFilterReportChange. * *--*/ VOID @@ -382,11 +405,20 @@ IN PUSHORT FileNamePartLength, IN ULONG FilterMatch) { - KEBUGCHECK(0); -} - -/*++ - * @name FsRtlCurrentBatchOplock + FsRtlNotifyFilterReportChange(NotifySync, + NotifyList, + FullTargetName, + FullTargetName->Length - *FileNamePartLength, + NULL, + NULL, + FilterMatch, + 0, + NULL, + NULL); +} + +/*++ + * @name FsRtlNotifyUninitializeSync * @implemented * * Uninitialize a NOTIFY_SYNC object
16 years, 4 months
1
0
0
0
[pschweitzer] 34981: Added two missing functions to ntifs.h
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Thu Jul 31 13:17:25 2008 New Revision: 34981 URL:
http://svn.reactos.org/svn/reactos?rev=34981&view=rev
Log: Added two missing functions to ntifs.h Modified: branches/pierre-fsd/include/ddk/ntifs.h Modified: branches/pierre-fsd/include/ddk/ntifs.h URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/include/ddk/ntifs.h?…
============================================================================== --- branches/pierre-fsd/include/ddk/ntifs.h [iso-8859-1] (original) +++ branches/pierre-fsd/include/ddk/ntifs.h [iso-8859-1] Thu Jul 31 13:17:25 2008 @@ -3195,6 +3195,37 @@ NTKERNELAPI VOID NTAPI +FsRtlNotifyFilterChangeDirectory ( + IN PNOTIFY_SYNC NotifySync, + IN PLIST_ENTRY NotifyList, + IN PVOID FsContext, + IN PSTRING FullDirectoryName, + IN BOOLEAN WatchTree, + IN BOOLEAN IgnoreBuffer, + IN ULONG CompletionFilter, + IN PIRP NotifyIrp, + IN PCHECK_FOR_TRAVERSE_ACCESS TraverseCallback OPTIONAL, + IN PSECURITY_SUBJECT_CONTEXT SubjectContext OPTIONAL, + IN PFILTER_REPORT_CHANGE FilterCallback OPTIONAL); + +NTKERNELAPI +VOID +NTAPI +FsRtlNotifyFilterReportChange ( + IN PNOTIFY_SYNC NotifySync, + IN PLIST_ENTRY NotifyList, + IN PSTRING FullTargetName, + IN USHORT TargetNameOffset, + IN PSTRING StreamName OPTIONAL, + IN PSTRING NormalizedParentName OPTIONAL, + IN ULONG FilterMatch, + IN ULONG Action, + IN PVOID TargetContext, + IN PVOID FilterContext); + +NTKERNELAPI +VOID +NTAPI FsRtlNotifyFullChangeDirectory ( IN PNOTIFY_SYNC NotifySync, IN PLIST_ENTRY NotifyList,
16 years, 4 months
1
0
0
0
[jmorlan] 34980: In exit and _cexit, call atexit routines. (Bug 3432_)
by jmorlan@svn.reactos.org
Author: jmorlan Date: Thu Jul 31 12:46:50 2008 New Revision: 34980 URL:
http://svn.reactos.org/svn/reactos?rev=34980&view=rev
Log: In exit and _cexit, call atexit routines. (Bug 3432_) Modified: trunk/reactos/lib/sdk/crt/stdlib/_exit.c Modified: trunk/reactos/lib/sdk/crt/stdlib/_exit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/stdlib/_exit.c…
============================================================================== --- trunk/reactos/lib/sdk/crt/stdlib/_exit.c [iso-8859-1] (original) +++ trunk/reactos/lib/sdk/crt/stdlib/_exit.c [iso-8859-1] Thu Jul 31 12:46:50 2008 @@ -1,5 +1,7 @@ #include <precomp.h> #include <internal/atexit.h> + +extern void _atexit_cleanup(void); struct __atexit *__atexit_ptr = 0; @@ -18,6 +20,7 @@ */ /* in case the program set it this way */ _setmode(0, O_TEXT); + _atexit_cleanup(); _exit(status); for(;;); } @@ -28,6 +31,7 @@ */ void _exit(int _status) { + // FIXME: _exit and _c_exit should prevent atexit routines from being called during DLL unload ExitProcess(_status); for(;;); } @@ -37,6 +41,7 @@ */ void _cexit( void ) { + _atexit_cleanup(); // flush } @@ -45,5 +50,6 @@ */ void _c_exit( void ) { + // FIXME: _exit and _c_exit should prevent atexit routines from being called during DLL unload // reset interup vectors }
16 years, 4 months
1
0
0
0
[sginsberg] 34979: - Change an infinite loop to an assert to simplify debugging
by sginsberg@svn.reactos.org
Author: sginsberg Date: Thu Jul 31 09:25:35 2008 New Revision: 34979 URL:
http://svn.reactos.org/svn/reactos?rev=34979&view=rev
Log: - Change an infinite loop to an assert to simplify debugging Modified: trunk/reactos/ntoskrnl/ke/i386/irqobj.c Modified: trunk/reactos/ntoskrnl/ke/i386/irqobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/irqobj.c?…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/irqobj.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/i386/irqobj.c [iso-8859-1] Thu Jul 31 09:25:35 2008 @@ -281,7 +281,7 @@ (Dispatch.Interrupt->Mode == Interrupt->Mode)) { /* The vector is shared and the interrupts are compatible */ - while (TRUE); // FIXME: NOT YET SUPPORTED/TESTED + ASSERT(FALSE); // FIXME: NOT YET SUPPORTED/TESTED Interrupt->Connected = Connected = TRUE; ASSERT(Irql <= SYNCH_LEVEL);
16 years, 4 months
1
0
0
0
← Newer
1
2
3
4
...
77
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
72
73
74
75
76
77
Results per page:
10
25
50
100
200