ReactOS  0.4.15-dev-3295-gaa8fc87
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  BOOLEAN CompleteProbing)
68 {
70 
71  if (Class < ClassListEntries)
72  {
73  if (!(ClassList[Class].Flags & ICIF_QUERY))
74  {
76  }
77  else if (ClassList[Class].RequiredSizeQUERY > 0 &&
78  BufferLength != ClassList[Class].RequiredSizeQUERY)
79  {
80  if (!(ClassList[Class].Flags & ICIF_QUERY_SIZE_VARIABLE))
81  {
83  }
84  }
85 
86  if (NT_SUCCESS(Status))
87  {
88  if (PreviousMode != KernelMode)
89  {
90  _SEH2_TRY
91  {
92  if (Buffer != NULL)
93  {
94  if (!CompleteProbing)
95  {
98  ClassList[Class].AlignmentQUERY);
99  }
100  else
101  {
103  BufferLength,
104  ClassList[Class].AlignmentQUERY);
105  }
106  }
107 
108  if (ReturnLength != NULL)
109  {
111  }
112  if (ReturnLengthPtr != NULL)
113  {
114  ProbeForWrite(ReturnLengthPtr, sizeof(ULONG_PTR), sizeof(ULONG_PTR));
115  }
116  }
118  {
120  }
121  _SEH2_END;
122  }
123  }
124  }
125  else
127 
128  return Status;
129 }
#define ProbeForWriteUlong(Ptr)
Definition: probe.h:36
IN CINT OUT PVOID IN ULONG OUT PULONG ReturnLength
Definition: dumpinfo.c:39
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
Definition: wdfdevice.h:3767
#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
#define ICIF_SET_SIZE_VARIABLE
Definition: icif.h:22
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:143
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, BOOLEAN CompleteProbing)
Definition: probe.h:59
_SEH2_TRY
Definition: create.c:4226
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define ICIF_SET
Definition: icif.h:20
unsigned char BOOLEAN
Definition: bufpool.h:45
Status
Definition: gdiplustypes.h:24
_In_ KPROCESSOR_MODE PreviousMode
Definition: sefuncs.h:103
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
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:240
#define ICIF_QUERY_SIZE_VARIABLE
Definition: icif.h:21
_SEH2_END
Definition: create.c:4400
unsigned int * PULONG
Definition: retypes.h:1
#define NULL
Definition: types.h:112
#define ICIF_QUERY
Definition: icif.h:19
unsigned int ULONG
Definition: retypes.h:1
uint32_t * PULONG_PTR
Definition: typedefs.h:65
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:40
#define STATUS_SUCCESS
Definition: shellext.h:65
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:165