mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
the callback management doesn't have to be serialized as it's only accessed by the thread itself
svn path=/trunk/; revision=13512
This commit is contained in:
parent
a780838c2e
commit
709af1f28a
4 changed files with 159 additions and 202 deletions
|
@ -8,7 +8,6 @@ typedef struct _W32THREAD
|
||||||
PVOID MessageQueue;
|
PVOID MessageQueue;
|
||||||
FAST_MUTEX WindowListLock;
|
FAST_MUTEX WindowListLock;
|
||||||
LIST_ENTRY WindowListHead;
|
LIST_ENTRY WindowListHead;
|
||||||
FAST_MUTEX W32CallbackListLock;
|
|
||||||
LIST_ENTRY W32CallbackListHead;
|
LIST_ENTRY W32CallbackListHead;
|
||||||
struct _KBDTABLES* KeyboardLayout;
|
struct _KBDTABLES* KeyboardLayout;
|
||||||
struct _DESKTOP_OBJECT* Desktop;
|
struct _DESKTOP_OBJECT* Desktop;
|
||||||
|
|
|
@ -51,7 +51,7 @@ static const INFORMATION_CLASS_INFO PsProcessInfoClass[] =
|
||||||
ICI_SQ_SAME( sizeof(PROCESS_WS_WATCH_INFORMATION), sizeof(ULONG), ICIF_QUERY | ICIF_SET ), /* ProcessWorkingSetWatch */
|
ICI_SQ_SAME( sizeof(PROCESS_WS_WATCH_INFORMATION), sizeof(ULONG), ICIF_QUERY | ICIF_SET ), /* ProcessWorkingSetWatch */
|
||||||
ICI_SQ_SAME( 0 /* FIXME */, sizeof(ULONG), ICIF_SET ), /* ProcessUserModeIOPL */
|
ICI_SQ_SAME( 0 /* FIXME */, sizeof(ULONG), ICIF_SET ), /* ProcessUserModeIOPL */
|
||||||
ICI_SQ_SAME( sizeof(BOOLEAN), sizeof(ULONG), ICIF_SET ), /* ProcessEnableAlignmentFaultFixup */
|
ICI_SQ_SAME( sizeof(BOOLEAN), sizeof(ULONG), ICIF_SET ), /* ProcessEnableAlignmentFaultFixup */
|
||||||
ICI_SQ_SAME( sizeof(PROCESS_PRIORITY_CLASS), sizeof(USHORT), ICIF_SET ), /* ProcessPriorityClass */
|
ICI_SQ_SAME( sizeof(PROCESS_PRIORITY_CLASS), sizeof(USHORT), ICIF_QUERY | ICIF_SET ), /* ProcessPriorityClass */
|
||||||
ICI_SQ_SAME( sizeof(ULONG), sizeof(ULONG), ICIF_QUERY ), /* ProcessWx86Information */
|
ICI_SQ_SAME( sizeof(ULONG), sizeof(ULONG), ICIF_QUERY ), /* ProcessWx86Information */
|
||||||
ICI_SQ_SAME( sizeof(ULONG), sizeof(ULONG), ICIF_QUERY ), /* ProcessHandleCount */
|
ICI_SQ_SAME( sizeof(ULONG), sizeof(ULONG), ICIF_QUERY ), /* ProcessHandleCount */
|
||||||
ICI_SQ_SAME( sizeof(KAFFINITY), sizeof(ULONG), ICIF_SET ), /* ProcessAffinityMask */
|
ICI_SQ_SAME( sizeof(KAFFINITY), sizeof(ULONG), ICIF_SET ), /* ProcessAffinityMask */
|
||||||
|
@ -1845,12 +1845,6 @@ NtSetInformationProcess(IN HANDLE ProcessHandle,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ProcessDebugPort:
|
case ProcessDebugPort:
|
||||||
{
|
|
||||||
if(ProcessInformationLength != sizeof(HANDLE))
|
|
||||||
{
|
|
||||||
Status = STATUS_INFO_LENGTH_MISMATCH;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
HANDLE PortHandle = NULL;
|
HANDLE PortHandle = NULL;
|
||||||
|
|
||||||
|
@ -1928,17 +1922,10 @@ NtSetInformationProcess(IN HANDLE ProcessHandle,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case ProcessExceptionPort:
|
case ProcessExceptionPort:
|
||||||
{
|
|
||||||
if(ProcessInformationLength != sizeof(HANDLE))
|
|
||||||
{
|
|
||||||
Status = STATUS_INFO_LENGTH_MISMATCH;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
HANDLE PortHandle = NULL;
|
HANDLE PortHandle = NULL;
|
||||||
|
|
||||||
|
@ -1997,17 +1984,10 @@ NtSetInformationProcess(IN HANDLE ProcessHandle,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case ProcessAccessToken:
|
case ProcessAccessToken:
|
||||||
{
|
|
||||||
if(ProcessInformationLength != sizeof(PROCESS_ACCESS_TOKEN))
|
|
||||||
{
|
|
||||||
Status = STATUS_INFO_LENGTH_MISMATCH;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
HANDLE TokenHandle = NULL;
|
HANDLE TokenHandle = NULL;
|
||||||
|
|
||||||
|
@ -2028,17 +2008,10 @@ NtSetInformationProcess(IN HANDLE ProcessHandle,
|
||||||
/* in case we had success reading from the buffer, perform the actual task */
|
/* in case we had success reading from the buffer, perform the actual task */
|
||||||
Status = PspAssignPrimaryToken(Process, TokenHandle);
|
Status = PspAssignPrimaryToken(Process, TokenHandle);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case ProcessDefaultHardErrorMode:
|
case ProcessDefaultHardErrorMode:
|
||||||
{
|
|
||||||
if(ProcessInformationLength != sizeof(UINT))
|
|
||||||
{
|
|
||||||
Status = STATUS_INFO_LENGTH_MISMATCH;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
_SEH_TRY
|
_SEH_TRY
|
||||||
{
|
{
|
||||||
|
@ -2051,17 +2024,10 @@ NtSetInformationProcess(IN HANDLE ProcessHandle,
|
||||||
Status = _SEH_GetExceptionCode();
|
Status = _SEH_GetExceptionCode();
|
||||||
}
|
}
|
||||||
_SEH_END;
|
_SEH_END;
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case ProcessSessionInformation:
|
case ProcessSessionInformation:
|
||||||
{
|
|
||||||
if(ProcessInformationLength != sizeof(UINT))
|
|
||||||
{
|
|
||||||
Status = STATUS_INFO_LENGTH_MISMATCH;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
PROCESS_SESSION_INFORMATION SessionInfo;
|
PROCESS_SESSION_INFORMATION SessionInfo;
|
||||||
Status = STATUS_SUCCESS;
|
Status = STATUS_SUCCESS;
|
||||||
|
@ -2125,7 +2091,6 @@ NtSetInformationProcess(IN HANDLE ProcessHandle,
|
||||||
PsUnlockProcess(Process);
|
PsUnlockProcess(Process);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -178,7 +178,6 @@ Win32kThreadCallback (struct _ETHREAD *Thread,
|
||||||
InitializeListHead(&Win32Thread->WindowListHead);
|
InitializeListHead(&Win32Thread->WindowListHead);
|
||||||
ExInitializeFastMutex(&Win32Thread->WindowListLock);
|
ExInitializeFastMutex(&Win32Thread->WindowListLock);
|
||||||
InitializeListHead(&Win32Thread->W32CallbackListHead);
|
InitializeListHead(&Win32Thread->W32CallbackListHead);
|
||||||
ExInitializeFastMutex(&Win32Thread->W32CallbackListLock);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -63,9 +63,7 @@ IntCbAllocateMemory(ULONG Size)
|
||||||
|
|
||||||
/* insert the callback memory into the thread's callback list */
|
/* insert the callback memory into the thread's callback list */
|
||||||
|
|
||||||
ExAcquireFastMutex(&W32Thread->W32CallbackListLock);
|
|
||||||
InsertTailList(&W32Thread->W32CallbackListHead, &Mem->ListEntry);
|
InsertTailList(&W32Thread->W32CallbackListHead, &Mem->ListEntry);
|
||||||
ExReleaseFastMutex(&W32Thread->W32CallbackListLock);
|
|
||||||
|
|
||||||
return (Mem + 1);
|
return (Mem + 1);
|
||||||
}
|
}
|
||||||
|
@ -84,9 +82,7 @@ IntCbFreeMemory(PVOID Data)
|
||||||
ASSERT(W32Thread);
|
ASSERT(W32Thread);
|
||||||
|
|
||||||
/* remove the memory block from the thread's callback list */
|
/* remove the memory block from the thread's callback list */
|
||||||
ExAcquireFastMutex(&W32Thread->W32CallbackListLock);
|
|
||||||
RemoveEntryList(&Mem->ListEntry);
|
RemoveEntryList(&Mem->ListEntry);
|
||||||
ExReleaseFastMutex(&W32Thread->W32CallbackListLock);
|
|
||||||
|
|
||||||
/* free memory */
|
/* free memory */
|
||||||
ExFreePool(Mem);
|
ExFreePool(Mem);
|
||||||
|
@ -98,7 +94,6 @@ IntCleanupThreadCallbacks(PW32THREAD W32Thread)
|
||||||
PLIST_ENTRY CurrentEntry;
|
PLIST_ENTRY CurrentEntry;
|
||||||
PINT_CALLBACK_HEADER Mem;
|
PINT_CALLBACK_HEADER Mem;
|
||||||
|
|
||||||
ExAcquireFastMutex(&W32Thread->W32CallbackListLock);
|
|
||||||
while (!IsListEmpty(&W32Thread->W32CallbackListHead))
|
while (!IsListEmpty(&W32Thread->W32CallbackListHead))
|
||||||
{
|
{
|
||||||
CurrentEntry = RemoveHeadList(&W32Thread->W32CallbackListHead);
|
CurrentEntry = RemoveHeadList(&W32Thread->W32CallbackListHead);
|
||||||
|
@ -108,7 +103,6 @@ IntCleanupThreadCallbacks(PW32THREAD W32Thread)
|
||||||
/* free memory */
|
/* free memory */
|
||||||
ExFreePool(Mem);
|
ExFreePool(Mem);
|
||||||
}
|
}
|
||||||
ExReleaseFastMutex(&W32Thread->W32CallbackListLock);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
Loading…
Reference in a new issue