ReactOS  0.4.14-dev-52-g6116262
probe.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <reactos/probe.h>
4 
5 static
6 __inline
9  const INFORMATION_CLASS_INFO *ClassList,
10  ULONG ClassListEntries,
11  PVOID Buffer,
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 }
55 
56 static
57 __inline
60  const INFORMATION_CLASS_INFO *ClassList,
61  ULONG ClassListEntries,
62  PVOID Buffer,
65  PULONG_PTR ReturnLengthPtr,
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
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
LONG NTSTATUS
Definition: precomp.h:26
static __inline NTSTATUS DefaultSetInfoBufferCheck(ULONG Class, const INFORMATION_CLASS_INFO *ClassList, ULONG ClassListEntries, PVOID Buffer, ULONG BufferLength, KPROCESSOR_MODE PreviousMode)
Definition: probe.h:8
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:143
_SEH2_TRY
Definition: create.c:4250
uint32_t ULONG_PTR
Definition: typedefs.h:63
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
_In_ ULONG BufferLength
Definition: usbdlib.h:225
#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
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
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:226
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)
Definition: probe.h:59
Status
Definition: gdiplustypes.h:24
_SEH2_END
Definition: create.c:4424
unsigned int * PULONG
Definition: retypes.h:1
unsigned int ULONG
Definition: retypes.h:1
uint32_t * PULONG_PTR
Definition: typedefs.h:63
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
return STATUS_SUCCESS
Definition: btrfs.c:2966