ReactOS  0.4.15-dev-1197-g8081ba9
probe.h File Reference
#include <reactos/probe.h>
Include dependency graph for probe.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

static __inline NTSTATUS DefaultSetInfoBufferCheck (ULONG Class, const INFORMATION_CLASS_INFO *ClassList, ULONG ClassListEntries, PVOID Buffer, ULONG BufferLength, KPROCESSOR_MODE PreviousMode)
 
static __inline NTSTATUS DefaultQueryInfoBufferCheck (ULONG Class, const INFORMATION_CLASS_INFO *ClassList, ULONG ClassListEntries, PVOID Buffer, ULONG BufferLength, PULONG ReturnLength, PULONG_PTR ReturnLengthPtr, KPROCESSOR_MODE PreviousMode)
 

Function Documentation

◆ DefaultQueryInfoBufferCheck()

static __inline NTSTATUS DefaultQueryInfoBufferCheck ( ULONG  Class,
const INFORMATION_CLASS_INFO *  ClassList,
ULONG  ClassListEntries,
PVOID  Buffer,
ULONG  BufferLength,
PULONG  ReturnLength,
PULONG_PTR  ReturnLengthPtr,
KPROCESSOR_MODE  PreviousMode 
)
static

Definition at line 59 of file probe.h.

67 {
69 
70  if (Class < ClassListEntries)
71  {
72  if (!(ClassList[Class].Flags & ICIF_QUERY))
73  {
75  }
76  else if (ClassList[Class].RequiredSizeQUERY > 0 &&
77  BufferLength != ClassList[Class].RequiredSizeQUERY)
78  {
79  if (!(ClassList[Class].Flags & ICIF_QUERY_SIZE_VARIABLE))
80  {
82  }
83  }
84 
85  if (NT_SUCCESS(Status))
86  {
87  if (PreviousMode != KernelMode)
88  {
89  _SEH2_TRY
90  {
91  if (Buffer != NULL)
92  {
95  ClassList[Class].AlignmentQUERY);
96  }
97 
98  if (ReturnLength != NULL)
99  {
101  }
102  if (ReturnLengthPtr != NULL)
103  {
104  ProbeForWrite(ReturnLengthPtr, sizeof(ULONG_PTR), sizeof(ULONG_PTR));
105  }
106  }
108  {
110  }
111  _SEH2_END;
112  }
113  }
114  }
115  else
117 
118  return Status;
119 }
#define ProbeForWriteUlong(Ptr)
Definition: probe.h:36
IN CINT OUT PVOID IN ULONG OUT PULONG ReturnLength
Definition: dumpinfo.c:39
_In_ PSCSI_REQUEST_BLOCK _In_opt_ PVOID _In_ ULONG BufferLength
Definition: cdrom.h:989
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
LONG NTSTATUS
Definition: precomp.h:26
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:143
_SEH2_TRY
Definition: create.c:4226
uint32_t ULONG_PTR
Definition: typedefs.h:65
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
_In_ KPROCESSOR_MODE PreviousMode
Definition: sefuncs.h:103
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
Status
Definition: gdiplustypes.h:24
#define STATUS_INVALID_INFO_CLASS
Definition: ntstatus.h:240
_SEH2_END
Definition: create.c:4400
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
return STATUS_SUCCESS
Definition: btrfs.c:3014

Referenced by NtQueryEvent(), NtQueryInformationToken(), NtQueryIoCompletion(), NtQueryMutant(), NtQuerySemaphore(), and NtQueryTimer().

◆ DefaultSetInfoBufferCheck()

static __inline NTSTATUS DefaultSetInfoBufferCheck ( ULONG  Class,
const INFORMATION_CLASS_INFO *  ClassList,
ULONG  ClassListEntries,
PVOID  Buffer,
ULONG  BufferLength,
KPROCESSOR_MODE  PreviousMode 
)
static

Definition at line 8 of file probe.h.

14 {
16 
17  if (Class < ClassListEntries)
18  {
19  if (!(ClassList[Class].Flags & ICIF_SET))
20  {
22  }
23  else if (ClassList[Class].RequiredSizeSET > 0 &&
24  BufferLength != ClassList[Class].RequiredSizeSET)
25  {
26  if (!(ClassList[Class].Flags & ICIF_SET_SIZE_VARIABLE))
27  {
29  }
30  }
31 
32  if (NT_SUCCESS(Status))
33  {
34  if (PreviousMode != KernelMode)
35  {
36  _SEH2_TRY
37  {
40  ClassList[Class].AlignmentSET);
41  }
43  {
45  }
46  _SEH2_END;
47  }
48  }
49  }
50  else
52 
53  return Status;
54 }
_In_ PSCSI_REQUEST_BLOCK _In_opt_ PVOID _In_ ULONG BufferLength
Definition: cdrom.h:989
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
LONG NTSTATUS
Definition: precomp.h:26
_SEH2_TRY
Definition: create.c:4226
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
Definition: bufpool.h:45
_In_ KPROCESSOR_MODE PreviousMode
Definition: sefuncs.h:103
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
Status
Definition: gdiplustypes.h:24
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:102
#define STATUS_INVALID_INFO_CLASS
Definition: ntstatus.h:240
_SEH2_END
Definition: create.c:4400
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
return STATUS_SUCCESS
Definition: btrfs.c:3014

Referenced by NtSetInformationDebugObject(), NtSetInformationProcess(), NtSetInformationThread(), and NtSetInformationToken().