mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 21:53:06 +00:00
convert DefaultSetInfoBufferCheck and DefaultQueryInfoBufferCheck to inlined functions
svn path=/trunk/; revision=18394
This commit is contained in:
parent
e0191cfd2a
commit
eb03a7e427
10 changed files with 200 additions and 229 deletions
|
@ -311,13 +311,13 @@ NtQueryEvent(IN HANDLE EventHandle,
|
||||||
DPRINT("NtQueryEvent(0x%p, 0x%x)\n", EventHandle, EventInformationClass);
|
DPRINT("NtQueryEvent(0x%p, 0x%x)\n", EventHandle, EventInformationClass);
|
||||||
|
|
||||||
/* Check buffers and class validity */
|
/* Check buffers and class validity */
|
||||||
DefaultQueryInfoBufferCheck(EventInformationClass,
|
Status = DefaultQueryInfoBufferCheck(EventInformationClass,
|
||||||
ExEventInfoClass,
|
ExEventInfoClass,
|
||||||
EventInformation,
|
sizeof(ExEventInfoClass) / sizeof(ExEventInfoClass[0]),
|
||||||
EventInformationLength,
|
EventInformation,
|
||||||
ReturnLength,
|
EventInformationLength,
|
||||||
PreviousMode,
|
ReturnLength,
|
||||||
&Status);
|
PreviousMode);
|
||||||
if(!NT_SUCCESS(Status)) {
|
if(!NT_SUCCESS(Status)) {
|
||||||
|
|
||||||
/* Invalid buffers */
|
/* Invalid buffers */
|
||||||
|
|
|
@ -227,13 +227,13 @@ NtQueryMutant(IN HANDLE MutantHandle,
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
/* Check buffers and parameters */
|
/* Check buffers and parameters */
|
||||||
DefaultQueryInfoBufferCheck(MutantInformationClass,
|
Status = DefaultQueryInfoBufferCheck(MutantInformationClass,
|
||||||
ExMutantInfoClass,
|
ExMutantInfoClass,
|
||||||
MutantInformation,
|
sizeof(ExMutantInfoClass) / sizeof(ExMutantInfoClass[0]),
|
||||||
MutantInformationLength,
|
MutantInformation,
|
||||||
ResultLength,
|
MutantInformationLength,
|
||||||
PreviousMode,
|
ResultLength,
|
||||||
&Status);
|
PreviousMode);
|
||||||
if(!NT_SUCCESS(Status)) {
|
if(!NT_SUCCESS(Status)) {
|
||||||
|
|
||||||
DPRINT("NtQueryMutant() failed, Status: 0x%x\n", Status);
|
DPRINT("NtQueryMutant() failed, Status: 0x%x\n", Status);
|
||||||
|
|
|
@ -215,13 +215,13 @@ NtQuerySemaphore(IN HANDLE SemaphoreHandle,
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
/* Check buffers and class validity */
|
/* Check buffers and class validity */
|
||||||
DefaultQueryInfoBufferCheck(SemaphoreInformationClass,
|
Status = DefaultQueryInfoBufferCheck(SemaphoreInformationClass,
|
||||||
ExSemaphoreInfoClass,
|
ExSemaphoreInfoClass,
|
||||||
SemaphoreInformation,
|
sizeof(ExSemaphoreInfoClass) / sizeof(ExSemaphoreInfoClass[0]),
|
||||||
SemaphoreInformationLength,
|
SemaphoreInformation,
|
||||||
ReturnLength,
|
SemaphoreInformationLength,
|
||||||
PreviousMode,
|
ReturnLength,
|
||||||
&Status);
|
PreviousMode);
|
||||||
if(!NT_SUCCESS(Status))
|
if(!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
/* Invalid buffers */
|
/* Invalid buffers */
|
||||||
|
|
|
@ -545,13 +545,13 @@ NtQueryTimer(IN HANDLE TimerHandle,
|
||||||
DPRINT("NtQueryTimer(TimerHandle: 0x%p, Class: %d)\n", TimerHandle, TimerInformationClass);
|
DPRINT("NtQueryTimer(TimerHandle: 0x%p, Class: %d)\n", TimerHandle, TimerInformationClass);
|
||||||
|
|
||||||
/* Check Validity */
|
/* Check Validity */
|
||||||
DefaultQueryInfoBufferCheck(TimerInformationClass,
|
Status = DefaultQueryInfoBufferCheck(TimerInformationClass,
|
||||||
ExTimerInfoClass,
|
ExTimerInfoClass,
|
||||||
TimerInformation,
|
sizeof(ExTimerInfoClass) / sizeof(ExTimerInfoClass[0]),
|
||||||
TimerInformationLength,
|
TimerInformation,
|
||||||
ReturnLength,
|
TimerInformationLength,
|
||||||
PreviousMode,
|
ReturnLength,
|
||||||
&Status);
|
PreviousMode);
|
||||||
if(!NT_SUCCESS(Status))
|
if(!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("NtQueryTimer() failed, Status: 0x%x\n", Status);
|
DPRINT1("NtQueryTimer() failed, Status: 0x%x\n", Status);
|
||||||
|
|
|
@ -207,6 +207,138 @@ ReleaseCapturedUnicodeString(IN PUNICODE_STRING CapturedString,
|
||||||
#define ProbeForReadLargeInteger(Ptr) ((LARGE_INTEGER)ProbeForReadGenericType(&(Ptr)->QuadPart, LONGLONG, 0))
|
#define ProbeForReadLargeInteger(Ptr) ((LARGE_INTEGER)ProbeForReadGenericType(&(Ptr)->QuadPart, LONGLONG, 0))
|
||||||
#define ProbeForReadUlargeInteger(Ptr) ((ULARGE_INTEGER)ProbeForReadGenericType(&(Ptr)->QuadPart, ULONGLONG, 0))
|
#define ProbeForReadUlargeInteger(Ptr) ((ULARGE_INTEGER)ProbeForReadGenericType(&(Ptr)->QuadPart, ULONGLONG, 0))
|
||||||
|
|
||||||
|
/*
|
||||||
|
* generic information class probing code
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define ICIF_QUERY 0x1
|
||||||
|
#define ICIF_SET 0x2
|
||||||
|
#define ICIF_QUERY_SIZE_VARIABLE 0x4
|
||||||
|
#define ICIF_SET_SIZE_VARIABLE 0x8
|
||||||
|
#define ICIF_SIZE_VARIABLE (ICIF_QUERY_SIZE_VARIABLE | ICIF_SET_SIZE_VARIABLE)
|
||||||
|
|
||||||
|
typedef struct _INFORMATION_CLASS_INFO
|
||||||
|
{
|
||||||
|
ULONG RequiredSizeQUERY;
|
||||||
|
ULONG RequiredSizeSET;
|
||||||
|
ULONG AlignmentSET;
|
||||||
|
ULONG AlignmentQUERY;
|
||||||
|
ULONG Flags;
|
||||||
|
} INFORMATION_CLASS_INFO, *PINFORMATION_CLASS_INFO;
|
||||||
|
|
||||||
|
#define ICI_SQ_SAME(Size, Alignment, Flags) \
|
||||||
|
{ Size, Size, Alignment, Alignment, Flags }
|
||||||
|
|
||||||
|
#define ICI_SQ(SizeQuery, SizeSet, AlignmentQuery, AlignmentSet, Flags) \
|
||||||
|
{ SizeQuery, SizeSet, AlignmentQuery, AlignmentSet, Flags }
|
||||||
|
|
||||||
|
static inline NTSTATUS
|
||||||
|
DefaultSetInfoBufferCheck(UINT Class,
|
||||||
|
const INFORMATION_CLASS_INFO *ClassList,
|
||||||
|
UINT ClassListEntries,
|
||||||
|
PVOID Buffer,
|
||||||
|
ULONG BufferLength,
|
||||||
|
KPROCESSOR_MODE PreviousMode)
|
||||||
|
{
|
||||||
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
|
|
||||||
|
if (Class >= 0 && Class < ClassListEntries)
|
||||||
|
{
|
||||||
|
if (!(ClassList[Class].Flags & ICIF_SET))
|
||||||
|
{
|
||||||
|
Status = STATUS_INVALID_INFO_CLASS;
|
||||||
|
}
|
||||||
|
else if (ClassList[Class].RequiredSizeSET > 0 &&
|
||||||
|
BufferLength != ClassList[Class].RequiredSizeSET)
|
||||||
|
{
|
||||||
|
if (!(ClassList[Class].Flags & ICIF_SET_SIZE_VARIABLE))
|
||||||
|
{
|
||||||
|
Status = STATUS_INFO_LENGTH_MISMATCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
if (PreviousMode != KernelMode)
|
||||||
|
{
|
||||||
|
_SEH_TRY
|
||||||
|
{
|
||||||
|
ProbeForRead(Buffer,
|
||||||
|
BufferLength,
|
||||||
|
ClassList[Class].AlignmentSET);
|
||||||
|
}
|
||||||
|
_SEH_HANDLE
|
||||||
|
{
|
||||||
|
Status = _SEH_GetExceptionCode();
|
||||||
|
}
|
||||||
|
_SEH_END;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Status = STATUS_INVALID_INFO_CLASS;
|
||||||
|
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline NTSTATUS
|
||||||
|
DefaultQueryInfoBufferCheck(UINT Class,
|
||||||
|
const INFORMATION_CLASS_INFO *ClassList,
|
||||||
|
UINT ClassListEntries,
|
||||||
|
PVOID Buffer,
|
||||||
|
ULONG BufferLength,
|
||||||
|
PULONG ReturnLength,
|
||||||
|
KPROCESSOR_MODE PreviousMode)
|
||||||
|
{
|
||||||
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
|
|
||||||
|
if (Class >= 0 && Class < ClassListEntries)
|
||||||
|
{
|
||||||
|
if (!(ClassList[Class].Flags & ICIF_QUERY))
|
||||||
|
{
|
||||||
|
Status = STATUS_INVALID_INFO_CLASS;
|
||||||
|
}
|
||||||
|
else if (ClassList[Class].RequiredSizeQUERY > 0 &&
|
||||||
|
BufferLength != ClassList[Class].RequiredSizeQUERY)
|
||||||
|
{
|
||||||
|
if (!(ClassList[Class].Flags & ICIF_QUERY_SIZE_VARIABLE))
|
||||||
|
{
|
||||||
|
Status = STATUS_INFO_LENGTH_MISMATCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
if (PreviousMode != KernelMode)
|
||||||
|
{
|
||||||
|
_SEH_TRY
|
||||||
|
{
|
||||||
|
if (Buffer != NULL)
|
||||||
|
{
|
||||||
|
ProbeForWrite(Buffer,
|
||||||
|
BufferLength,
|
||||||
|
ClassList[Class].AlignmentQUERY);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ReturnLength != NULL)
|
||||||
|
{
|
||||||
|
ProbeForWriteUlong(ReturnLength);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_SEH_HANDLE
|
||||||
|
{
|
||||||
|
Status = _SEH_GetExceptionCode();
|
||||||
|
}
|
||||||
|
_SEH_END;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Status = STATUS_INVALID_INFO_CLASS;
|
||||||
|
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Use IsPointerOffset to test whether a pointer should be interpreted as an offset
|
* Use IsPointerOffset to test whether a pointer should be interpreted as an offset
|
||||||
* or as a pointer
|
* or as a pointer
|
||||||
|
|
|
@ -11,12 +11,6 @@
|
||||||
|
|
||||||
struct _EPROCESS;
|
struct _EPROCESS;
|
||||||
|
|
||||||
#define ICIF_QUERY 0x1
|
|
||||||
#define ICIF_SET 0x2
|
|
||||||
#define ICIF_QUERY_SIZE_VARIABLE 0x4
|
|
||||||
#define ICIF_SET_SIZE_VARIABLE 0x8
|
|
||||||
#define ICIF_SIZE_VARIABLE (ICIF_QUERY_SIZE_VARIABLE | ICIF_SET_SIZE_VARIABLE)
|
|
||||||
|
|
||||||
typedef struct _DIRECTORY_OBJECT
|
typedef struct _DIRECTORY_OBJECT
|
||||||
{
|
{
|
||||||
CSHORT Type;
|
CSHORT Type;
|
||||||
|
@ -37,15 +31,6 @@ typedef struct _SYMLINK_OBJECT
|
||||||
LARGE_INTEGER CreateTime;
|
LARGE_INTEGER CreateTime;
|
||||||
} SYMLINK_OBJECT, *PSYMLINK_OBJECT;
|
} SYMLINK_OBJECT, *PSYMLINK_OBJECT;
|
||||||
|
|
||||||
typedef struct _INFORMATION_CLASS_INFO
|
|
||||||
{
|
|
||||||
ULONG RequiredSizeQUERY;
|
|
||||||
ULONG RequiredSizeSET;
|
|
||||||
ULONG AlignmentSET;
|
|
||||||
ULONG AlignmentQUERY;
|
|
||||||
ULONG Flags;
|
|
||||||
} INFORMATION_CLASS_INFO, *PINFORMATION_CLASS_INFO;
|
|
||||||
|
|
||||||
#define BODY_TO_HEADER(objbdy) \
|
#define BODY_TO_HEADER(objbdy) \
|
||||||
CONTAINING_RECORD((objbdy), OBJECT_HEADER, Body)
|
CONTAINING_RECORD((objbdy), OBJECT_HEADER, Body)
|
||||||
|
|
||||||
|
@ -251,152 +236,6 @@ ObpReleaseCapturedAttributes(IN POBJECT_CREATE_INFORMATION ObjectCreateInfo);
|
||||||
|
|
||||||
/* object information classes */
|
/* object information classes */
|
||||||
|
|
||||||
#define ICI_SQ_SAME(Size, Alignment, Flags) \
|
|
||||||
{ Size, Size, Alignment, Alignment, Flags }
|
|
||||||
|
|
||||||
#define ICI_SQ(SizeQuery, SizeSet, AlignmentQuery, AlignmentSet, Flags) \
|
|
||||||
{ SizeQuery, SizeSet, AlignmentQuery, AlignmentSet, Flags }
|
|
||||||
|
|
||||||
#define CheckInfoClass(Class, BufferLen, ClassList, StatusVar, Mode) \
|
|
||||||
do { \
|
|
||||||
if((Class) >= 0 && (Class) < sizeof(ClassList) / sizeof(ClassList[0])) \
|
|
||||||
{ \
|
|
||||||
if(!(ClassList[Class].Flags & ICIF_##Mode)) \
|
|
||||||
{ \
|
|
||||||
*(StatusVar) = STATUS_INVALID_INFO_CLASS; \
|
|
||||||
} \
|
|
||||||
else if(ClassList[Class].RequiredSize##Mode > 0 && \
|
|
||||||
(BufferLen) != ClassList[Class].RequiredSize##Mode) \
|
|
||||||
{ \
|
|
||||||
if(!(ClassList[Class].Flags & ICIF_##Mode##_SIZE_VARIABLE) && \
|
|
||||||
(BufferLen) != ClassList[Class].RequiredSize##Mode) \
|
|
||||||
{ \
|
|
||||||
*(StatusVar) = STATUS_INFO_LENGTH_MISMATCH; \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
else \
|
|
||||||
{ \
|
|
||||||
*(StatusVar) = STATUS_INVALID_INFO_CLASS; \
|
|
||||||
} \
|
|
||||||
} while(0)
|
|
||||||
|
|
||||||
|
|
||||||
#define GetInfoClassAlignment(Class, ClassList, AlignmentVar, Mode) \
|
|
||||||
do { \
|
|
||||||
if((Class) >= 0 && (Class) < sizeof(ClassList) / sizeof(ClassList[0])) \
|
|
||||||
{ \
|
|
||||||
*(AlignmentVar) = ClassList[Class].Alignment##Mode; \
|
|
||||||
} \
|
|
||||||
else \
|
|
||||||
{ \
|
|
||||||
*(AlignmentVar) = sizeof(ULONG); \
|
|
||||||
} \
|
|
||||||
} while(0)
|
|
||||||
|
|
||||||
#define ProbeQueryInfoBuffer(Buffer, BufferLen, Alignment, RetLen, PrevMode, StatusVar) \
|
|
||||||
do { \
|
|
||||||
if(PrevMode != KernelMode) \
|
|
||||||
{ \
|
|
||||||
_SEH_TRY \
|
|
||||||
{ \
|
|
||||||
ProbeForWrite(Buffer, \
|
|
||||||
BufferLen, \
|
|
||||||
Alignment); \
|
|
||||||
if(RetLen != NULL) \
|
|
||||||
{ \
|
|
||||||
ProbeForWrite(RetLen, \
|
|
||||||
sizeof(ULONG), \
|
|
||||||
1); \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
_SEH_HANDLE \
|
|
||||||
{ \
|
|
||||||
*(StatusVar) = _SEH_GetExceptionCode(); \
|
|
||||||
} \
|
|
||||||
_SEH_END; \
|
|
||||||
\
|
|
||||||
if(!NT_SUCCESS(*(StatusVar))) \
|
|
||||||
{ \
|
|
||||||
DPRINT1("ProbeQueryInfoBuffer failed: 0x%x\n", *(StatusVar)); \
|
|
||||||
return *(StatusVar); \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
} while(0)
|
|
||||||
|
|
||||||
#define ProbeSetInfoBuffer(Buffer, BufferLen, Alignment, PrevMode, StatusVar) \
|
|
||||||
do { \
|
|
||||||
if(PrevMode != KernelMode) \
|
|
||||||
{ \
|
|
||||||
_SEH_TRY \
|
|
||||||
{ \
|
|
||||||
ProbeForRead(Buffer, \
|
|
||||||
BufferLen, \
|
|
||||||
Alignment); \
|
|
||||||
} \
|
|
||||||
_SEH_HANDLE \
|
|
||||||
{ \
|
|
||||||
*(StatusVar) = _SEH_GetExceptionCode(); \
|
|
||||||
} \
|
|
||||||
_SEH_END; \
|
|
||||||
\
|
|
||||||
if(!NT_SUCCESS(*(StatusVar))) \
|
|
||||||
{ \
|
|
||||||
DPRINT1("ProbeAllInfoBuffer failed: 0x%x\n", *(StatusVar)); \
|
|
||||||
return *(StatusVar); \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
} while(0)
|
|
||||||
|
|
||||||
#define DefaultSetInfoBufferCheck(Class, ClassList, Buffer, BufferLen, PrevMode, StatusVar) \
|
|
||||||
do { \
|
|
||||||
ULONG _Alignment; \
|
|
||||||
/* get the preferred alignment for the information class or return */ \
|
|
||||||
/* default alignment in case the class doesn't exist */ \
|
|
||||||
GetInfoClassAlignment(Class, \
|
|
||||||
ClassList, \
|
|
||||||
&_Alignment, \
|
|
||||||
SET); \
|
|
||||||
\
|
|
||||||
/* probe the ENTIRE buffers and return on failure */ \
|
|
||||||
ProbeSetInfoBuffer(Buffer, \
|
|
||||||
BufferLen, \
|
|
||||||
_Alignment, \
|
|
||||||
PrevMode, \
|
|
||||||
StatusVar); \
|
|
||||||
\
|
|
||||||
/* validate information class index and check buffer size */ \
|
|
||||||
CheckInfoClass(Class, \
|
|
||||||
BufferLen, \
|
|
||||||
ClassList, \
|
|
||||||
StatusVar, \
|
|
||||||
SET); \
|
|
||||||
} while(0)
|
|
||||||
|
|
||||||
#define DefaultQueryInfoBufferCheck(Class, ClassList, Buffer, BufferLen, RetLen, PrevMode, StatusVar) \
|
|
||||||
do { \
|
|
||||||
ULONG _Alignment; \
|
|
||||||
/* get the preferred alignment for the information class or return */ \
|
|
||||||
/* alignment in case the class doesn't exist */ \
|
|
||||||
GetInfoClassAlignment(Class, \
|
|
||||||
ClassList, \
|
|
||||||
&_Alignment, \
|
|
||||||
QUERY); \
|
|
||||||
\
|
|
||||||
/* probe the ENTIRE buffers and return on failure */ \
|
|
||||||
ProbeQueryInfoBuffer(Buffer, \
|
|
||||||
BufferLen, \
|
|
||||||
_Alignment, \
|
|
||||||
RetLen, \
|
|
||||||
PrevMode, \
|
|
||||||
StatusVar); \
|
|
||||||
\
|
|
||||||
/* validate information class index and check buffer size */ \
|
|
||||||
CheckInfoClass(Class, \
|
|
||||||
BufferLen, \
|
|
||||||
ClassList, \
|
|
||||||
StatusVar, \
|
|
||||||
QUERY); \
|
|
||||||
} while(0)
|
|
||||||
|
|
||||||
#endif /* __INCLUDE_INTERNAL_OBJMGR_H */
|
#endif /* __INCLUDE_INTERNAL_OBJMGR_H */
|
||||||
|
|
|
@ -359,13 +359,13 @@ NtQueryIoCompletion(IN HANDLE IoCompletionHandle,
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
/* Check buffers and parameters */
|
/* Check buffers and parameters */
|
||||||
DefaultQueryInfoBufferCheck(IoCompletionInformationClass,
|
Status = DefaultQueryInfoBufferCheck(IoCompletionInformationClass,
|
||||||
IoCompletionInfoClass,
|
IoCompletionInfoClass,
|
||||||
IoCompletionInformation,
|
sizeof(IoCompletionInfoClass) / sizeof(IoCompletionInfoClass[0]),
|
||||||
IoCompletionInformationLength,
|
IoCompletionInformation,
|
||||||
ResultLength,
|
IoCompletionInformationLength,
|
||||||
PreviousMode,
|
ResultLength,
|
||||||
&Status);
|
PreviousMode);
|
||||||
if(!NT_SUCCESS(Status)) {
|
if(!NT_SUCCESS(Status)) {
|
||||||
|
|
||||||
DPRINT1("NtQueryMutant() failed, Status: 0x%x\n", Status);
|
DPRINT1("NtQueryMutant() failed, Status: 0x%x\n", Status);
|
||||||
|
|
|
@ -4012,13 +4012,13 @@ NtQuerySection(IN HANDLE SectionHandle,
|
||||||
|
|
||||||
PreviousMode = ExGetPreviousMode();
|
PreviousMode = ExGetPreviousMode();
|
||||||
|
|
||||||
DefaultQueryInfoBufferCheck(SectionInformationClass,
|
Status = DefaultQueryInfoBufferCheck(SectionInformationClass,
|
||||||
ExSectionInfoClass,
|
ExSectionInfoClass,
|
||||||
SectionInformation,
|
sizeof(ExSectionInfoClass) / sizeof(ExSectionInfoClass[0]),
|
||||||
SectionInformationLength,
|
SectionInformation,
|
||||||
ResultLength,
|
SectionInformationLength,
|
||||||
PreviousMode,
|
ResultLength,
|
||||||
&Status);
|
PreviousMode);
|
||||||
|
|
||||||
if(!NT_SUCCESS(Status))
|
if(!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
|
|
@ -143,13 +143,13 @@ NtQueryInformationProcess(IN HANDLE ProcessHandle,
|
||||||
|
|
||||||
PreviousMode = ExGetPreviousMode();
|
PreviousMode = ExGetPreviousMode();
|
||||||
|
|
||||||
DefaultQueryInfoBufferCheck(ProcessInformationClass,
|
Status = DefaultQueryInfoBufferCheck(ProcessInformationClass,
|
||||||
PsProcessInfoClass,
|
PsProcessInfoClass,
|
||||||
ProcessInformation,
|
sizeof(PsProcessInfoClass) / sizeof(PsProcessInfoClass[0]),
|
||||||
ProcessInformationLength,
|
ProcessInformation,
|
||||||
ReturnLength,
|
ProcessInformationLength,
|
||||||
PreviousMode,
|
ReturnLength,
|
||||||
&Status);
|
PreviousMode);
|
||||||
if(!NT_SUCCESS(Status))
|
if(!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("NtQueryInformationProcess() failed, Status: 0x%x\n", Status);
|
DPRINT1("NtQueryInformationProcess() failed, Status: 0x%x\n", Status);
|
||||||
|
@ -654,12 +654,12 @@ NtSetInformationProcess(IN HANDLE ProcessHandle,
|
||||||
|
|
||||||
PreviousMode = ExGetPreviousMode();
|
PreviousMode = ExGetPreviousMode();
|
||||||
|
|
||||||
DefaultSetInfoBufferCheck(ProcessInformationClass,
|
Status = DefaultSetInfoBufferCheck(ProcessInformationClass,
|
||||||
PsProcessInfoClass,
|
PsProcessInfoClass,
|
||||||
ProcessInformation,
|
sizeof(PsProcessInfoClass) / sizeof(PsProcessInfoClass[0]),
|
||||||
ProcessInformationLength,
|
ProcessInformation,
|
||||||
PreviousMode,
|
ProcessInformationLength,
|
||||||
&Status);
|
PreviousMode);
|
||||||
if(!NT_SUCCESS(Status))
|
if(!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("NtSetInformationProcess() %d %x %x called\n", ProcessInformationClass, ProcessInformation, ProcessInformationLength);
|
DPRINT1("NtSetInformationProcess() %d %x %x called\n", ProcessInformationClass, ProcessInformation, ProcessInformationLength);
|
||||||
|
|
|
@ -615,13 +615,13 @@ NtQueryInformationToken(IN HANDLE TokenHandle,
|
||||||
PreviousMode = ExGetPreviousMode();
|
PreviousMode = ExGetPreviousMode();
|
||||||
|
|
||||||
/* Check buffers and class validity */
|
/* Check buffers and class validity */
|
||||||
DefaultQueryInfoBufferCheck(TokenInformationClass,
|
Status = DefaultQueryInfoBufferCheck(TokenInformationClass,
|
||||||
SeTokenInformationClass,
|
SeTokenInformationClass,
|
||||||
TokenInformation,
|
sizeof(SeTokenInformationClass) / sizeof(SeTokenInformationClass[0]),
|
||||||
TokenInformationLength,
|
TokenInformation,
|
||||||
ReturnLength,
|
TokenInformationLength,
|
||||||
PreviousMode,
|
ReturnLength,
|
||||||
&Status);
|
PreviousMode);
|
||||||
|
|
||||||
if(!NT_SUCCESS(Status))
|
if(!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
@ -1198,12 +1198,12 @@ NtSetInformationToken(IN HANDLE TokenHandle,
|
||||||
|
|
||||||
PreviousMode = ExGetPreviousMode();
|
PreviousMode = ExGetPreviousMode();
|
||||||
|
|
||||||
DefaultSetInfoBufferCheck(TokenInformationClass,
|
Status = DefaultSetInfoBufferCheck(TokenInformationClass,
|
||||||
SeTokenInformationClass,
|
SeTokenInformationClass,
|
||||||
TokenInformation,
|
sizeof(SeTokenInformationClass) / sizeof(SeTokenInformationClass[0]),
|
||||||
TokenInformationLength,
|
TokenInformation,
|
||||||
PreviousMode,
|
TokenInformationLength,
|
||||||
&Status);
|
PreviousMode);
|
||||||
|
|
||||||
if(!NT_SUCCESS(Status))
|
if(!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue