ReactOS  0.4.14-dev-606-g14ebc0b
harderr.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Kernel
3  * LICENSE: GPL - See COPYING in the top level directory
4  * FILE: ntoskrnl/ex/harderr.c
5  * PURPOSE: Error Functions and Status/Exception Dispatching/Raising
6  * PROGRAMMERS: Alex Ionescu (alex@relsoft.net)
7  */
8 
9 /* INCLUDES *****************************************************************/
10 
11 #include <ntoskrnl.h>
12 #define NDEBUG
13 #include <debug.h>
14 
15 #define TAG_ERR ' rrE'
16 
17 /* GLOBALS ******************************************************************/
18 
22 
23 /* FUNCTIONS ****************************************************************/
24 
25 /*++
26 * @name ExpSystemErrorHandler
27 *
28 * For now it's a stub
29 *
30 * @param ErrorStatus
31 * FILLME
32 *
33 * @param NumberOfParameters
34 * FILLME
35 *
36 * @param UnicodeStringParameterMask
37 * FILLME
38 *
39 * @param Parameters
40 * FILLME
41 *
42 * @param ValidResponseOptions
43 * FILLME
44 *
45 * @param Response
46 * FILLME
47 *
48 * @return None
49 *
50 * @remarks None
51 *
52 *--*/
54 NTAPI
56  IN ULONG NumberOfParameters,
57  IN ULONG UnicodeStringParameterMask,
60 {
61  ULONG_PTR BugCheckParameters[MAXIMUM_HARDERROR_PARAMETERS] = {0, 0, 0, 0};
62  ULONG i;
63 
64  /* Sanity check */
65  ASSERT(NumberOfParameters <= MAXIMUM_HARDERROR_PARAMETERS);
66 
67  /*
68  * KeBugCheck expects MAXIMUM_HARDERROR_PARAMETERS parameters,
69  * but we might get called with less, so use a local buffer here.
70  */
71  for (i = 0; i < NumberOfParameters; i++)
72  {
73  /* Copy them over */
74  BugCheckParameters[i] = Parameters[i];
75  }
76 
77  /* FIXME: STUB */
78  KeBugCheckEx(FATAL_UNHANDLED_HARD_ERROR,
79  ErrorStatus,
80  (ULONG_PTR)BugCheckParameters,
81  0,
82  0);
83  return STATUS_SUCCESS;
84 }
85 
86 /*++
87  * @name ExpRaiseHardError
88  * @implemented
89  *
90  * See ExRaiseHardError and NtRaiseHardError, same parameters.
91  *
92  * This function performs the central work for both ExRaiseHardError
93  * and NtRaiseHardError. ExRaiseHardError is the service for kernel-mode
94  * that copies the parameters to user-mode, and NtRaiseHardError is the
95  * service for both kernel-mode and user-mode that performs parameters
96  * validation and capture if necessary.
97  *
98  *--*/
100 NTAPI
102  IN ULONG NumberOfParameters,
103  IN ULONG UnicodeStringParameterMask,
105  IN ULONG ValidResponseOptions,
107 {
113  HANDLE PortHandle;
115 
116  PAGED_CODE();
117 
118  /* Check if this error will shutdown the system */
119  if (ValidResponseOptions == OptionShutdownSystem)
120  {
121  /*
122  * Check if we have the privileges.
123  *
124  * NOTE: In addition to the Shutdown privilege we also check whether
125  * the caller has the Tcb privilege. The purpose is to allow only
126  * SYSTEM processes to "shutdown" the system on hard errors (BSOD)
127  * while forbidding regular processes to do so. This behaviour differs
128  * from Windows, where any user-mode process, as soon as it has the
129  * Shutdown privilege, can trigger a hard-error BSOD.
130  */
133  {
134  /* No rights */
137  }
138 
139  /* Don't handle any new hard errors */
141  }
142 
143  /* Check if hard errors are not disabled */
145  {
146  /* Check if we can't do errors anymore, and this is serious */
147  if (!ExReadyForErrors && NT_ERROR(ErrorStatus))
148  {
149  /* Use the system handler */
150  ExpSystemErrorHandler(ErrorStatus,
151  NumberOfParameters,
152  UnicodeStringParameterMask,
153  Parameters,
154  (PreviousMode != KernelMode) ? TRUE : FALSE);
155  }
156  }
157 
158  /*
159  * Enable hard error processing if it is enabled for the process
160  * or if the exception status forces it.
161  */
162  if ((Process->DefaultHardErrorProcessing & SEM_FAILCRITICALERRORS) ||
163  (ErrorStatus & HARDERROR_OVERRIDE_ERRORMODE))
164  {
165  /* Check if we have an exception port */
166  if (Process->ExceptionPort)
167  {
168  /* Use the port */
169  PortHandle = Process->ExceptionPort;
170  }
171  else
172  {
173  /* Use our default system port */
174  PortHandle = ExpDefaultErrorPort;
175  }
176  }
177  else
178  {
179  /* Don't process the error */
180  PortHandle = NULL;
181  }
182 
183  /* If hard errors are disabled, do nothing */
184  if (Thread->HardErrorsAreDisabled) PortHandle = NULL;
185 
186  /*
187  * If this is not the system thread, check whether hard errors are
188  * disabled for this thread on user-mode side, and if so, do nothing.
189  */
190  if (!Thread->SystemThread && (PortHandle != NULL))
191  {
192  /* Check if we have a TEB */
193  PTEB Teb = PsGetCurrentThread()->Tcb.Teb;
194  if (Teb)
195  {
196  _SEH2_TRY
197  {
198  if (Teb->HardErrorMode & RTL_SEM_FAILCRITICALERRORS)
199  {
200  PortHandle = NULL;
201  }
202  }
204  {
205  NOTHING;
206  }
207  _SEH2_END;
208  }
209  }
210 
211  /* Now check if we have a port */
212  if (PortHandle == NULL)
213  {
214  /* Just return to caller */
216  return STATUS_SUCCESS;
217  }
218 
219  /* Check if this is the default process */
221  {
222  /* We can't handle the error, check if this is critical */
223  if (NT_ERROR(ErrorStatus))
224  {
225  /* It is, invoke the system handler */
226  ExpSystemErrorHandler(ErrorStatus,
227  NumberOfParameters,
228  UnicodeStringParameterMask,
229  Parameters,
230  (PreviousMode != KernelMode) ? TRUE : FALSE);
231 
232  /* If we survived, return to caller */
234  return STATUS_SUCCESS;
235  }
236  }
237 
238  /* Setup the LPC Message */
239  Message->h.u1.Length = (sizeof(HARDERROR_MSG) << 16) |
240  (sizeof(HARDERROR_MSG) - sizeof(PORT_MESSAGE));
241  Message->h.u2.ZeroInit = 0;
242  Message->h.u2.s2.Type = LPC_ERROR_EVENT;
243  Message->Status = ErrorStatus & ~HARDERROR_OVERRIDE_ERRORMODE;
244  Message->ValidResponseOptions = ValidResponseOptions;
245  Message->UnicodeStringParameterMask = UnicodeStringParameterMask;
246  Message->NumberOfParameters = NumberOfParameters;
247  KeQuerySystemTime(&Message->ErrorTime);
248 
249  /* Copy the parameters */
250  if (Parameters)
251  {
252  RtlMoveMemory(&Message->Parameters,
253  Parameters,
254  sizeof(ULONG_PTR) * NumberOfParameters);
255  }
256 
257  /* Send the LPC Message */
258  Status = LpcRequestWaitReplyPort(PortHandle,
261  if (NT_SUCCESS(Status))
262  {
263  /* Check what kind of response we got */
264  if ((Message->Response != ResponseReturnToCaller) &&
265  (Message->Response != ResponseNotHandled) &&
266  (Message->Response != ResponseAbort) &&
267  (Message->Response != ResponseCancel) &&
268  (Message->Response != ResponseIgnore) &&
269  (Message->Response != ResponseNo) &&
270  (Message->Response != ResponseOk) &&
271  (Message->Response != ResponseRetry) &&
272  (Message->Response != ResponseYes) &&
273  (Message->Response != ResponseTryAgain) &&
274  (Message->Response != ResponseContinue))
275  {
276  /* Reset to a default one */
277  Message->Response = ResponseReturnToCaller;
278  }
279 
280  /* Set the response */
281  *Response = Message->Response;
282  }
283  else
284  {
285  /* Set the response */
287  }
288 
289  /* Return status */
290  return Status;
291 }
292 
293 /*++
294  * @name ExRaiseAccessViolation
295  * @implemented
296  *
297  * The ExRaiseAccessViolation routine can be used with structured exception
298  * handling to throw a driver-determined exception for a memory access
299  * violation that occurs when a driver processes I/O requests.
300  * See: http://msdn.microsoft.com/library/en-us/Kernel_r/hh/Kernel_r/k102_71b4c053-599c-4a6d-8a59-08aae6bdc534.xml.asp?frame=true
301  * http://www.osronline.com/ddkx/kmarch/k102_814i.htm
302  *
303  * @return None
304  *
305  * @remarks None
306  *
307  *--*/
308 VOID
309 NTAPI
311 {
312  /* Raise the Right Status */
314 }
315 
316 /*++
317  * @name ExRaiseDatatypeMisalignment
318  * @implemented
319  *
320  * ExRaiseDatatypeMisalignment raises an exception with the exception
321  * code set to STATUS_DATATYPE_MISALIGNMENT
322  * See: MSDN / DDK
323  * http://www.osronline.com/ddkx/kmarch/k102_814i.htm
324  *
325  * @return None
326  *
327  * @remarks None
328  *
329  *--*/
330 VOID
331 NTAPI
333 {
334  /* Raise the Right Status */
336 }
337 
338 /*++
339  * @name ExSystemExceptionFilter
340  * @implemented
341  *
342  * TODO: Add description
343  *
344  * @return FILLME
345  *
346  * @remarks None
347  *
348  *--*/
349 LONG
350 NTAPI
352 {
353  return KeGetPreviousMode() != KernelMode ?
355 }
356 
357 /*++
358  * @name ExRaiseHardError
359  * @implemented
360  *
361  * See NtRaiseHardError and ExpRaiseHardError.
362  *
363  * @param ErrorStatus
364  * Error Code
365  *
366  * @param NumberOfParameters
367  * Number of optional parameters in Parameters array
368  *
369  * @param UnicodeStringParameterMask
370  * Optional string parameter (can be only one per error code)
371  *
372  * @param Parameters
373  * Array of ULONG parameters for use in error message string
374  *
375  * @param ValidResponseOptions
376  * See HARDERROR_RESPONSE_OPTION for possible values description
377  *
378  * @param Response
379  * Pointer to HARDERROR_RESPONSE enumeration
380  *
381  * @return Status
382  *
383  *--*/
384 NTSTATUS
385 NTAPI
387  IN ULONG NumberOfParameters,
388  IN ULONG UnicodeStringParameterMask,
390  IN ULONG ValidResponseOptions,
392 {
394  SIZE_T Size;
396  ULONG i;
397  PVOID UserData = NULL;
398  PHARDERROR_USER_PARAMETERS UserParams;
399  PWSTR BufferBase;
400  ULONG SafeResponse = ResponseNotHandled;
401 
402  PAGED_CODE();
403 
404  /* Check if we have parameters */
405  if (Parameters)
406  {
407  /* Check if we have strings */
408  if (UnicodeStringParameterMask)
409  {
410  /* Calculate the required size */
412 
413  /* Loop each parameter */
414  for (i = 0; i < NumberOfParameters; i++)
415  {
416  /* Check if it's part of the mask */
417  if (UnicodeStringParameterMask & (1 << i))
418  {
419  /* Copy it */
420  RtlMoveMemory(&CapturedParams[i],
421  (PVOID)Parameters[i],
422  sizeof(UNICODE_STRING));
423 
424  /* Increase the size */
425  Size += CapturedParams[i].MaximumLength;
426  }
427  }
428 
429  /* Allocate the user data region */
430  Status = ZwAllocateVirtualMemory(NtCurrentProcess(),
431  &UserData,
432  0,
433  &Size,
434  MEM_COMMIT,
436  if (!NT_SUCCESS(Status))
437  {
438  /* Return failure */
440  return Status;
441  }
442 
443  /* Set the pointers to our data */
444  UserParams = UserData;
445  BufferBase = UserParams->Buffer;
446 
447  /* Enter SEH block as we are writing to user-mode space */
448  _SEH2_TRY
449  {
450  /* Loop parameters again */
451  for (i = 0; i < NumberOfParameters; i++)
452  {
453  /* Check if we are in the mask */
454  if (UnicodeStringParameterMask & (1 << i))
455  {
456  /* Update the base */
457  UserParams->Parameters[i] = (ULONG_PTR)&UserParams->Strings[i];
458 
459  /* Copy the string buffer */
460  RtlMoveMemory(BufferBase,
461  CapturedParams[i].Buffer,
462  CapturedParams[i].MaximumLength);
463 
464  /* Set buffer */
465  CapturedParams[i].Buffer = BufferBase;
466 
467  /* Copy the string structure */
468  UserParams->Strings[i] = CapturedParams[i];
469 
470  /* Update the pointer */
471  BufferBase += CapturedParams[i].MaximumLength;
472  }
473  else
474  {
475  /* No need to copy any strings */
476  UserParams->Parameters[i] = Parameters[i];
477  }
478  }
479  }
481  {
482  /* Return the exception code */
484  DPRINT1("ExRaiseHardError - Exception when writing data to user-mode, Status 0x%08lx\n", Status);
485  }
486  _SEH2_END;
487  }
488  else
489  {
490  /* Just keep the data as is */
492  }
493  }
494 
495  /* Now call the worker function */
496  Status = ExpRaiseHardError(ErrorStatus,
497  NumberOfParameters,
498  UnicodeStringParameterMask,
499  UserData,
500  ValidResponseOptions,
501  &SafeResponse);
502 
503  /* Check if we had done user-mode allocation */
504  if ((UserData) && (UserData != Parameters))
505  {
506  /* We did! Delete it */
507  Size = 0;
508  ZwFreeVirtualMemory(NtCurrentProcess(),
509  &UserData,
510  &Size,
511  MEM_RELEASE);
512  }
513 
514  /* Return status and the response */
515  *Response = SafeResponse;
516  return Status;
517 }
518 
519 /*++
520  * @name NtRaiseHardError
521  * @implemented
522  *
523  * This function sends HARDERROR_MSG LPC message to a hard-error listener,
524  * typically CSRSS.EXE. See NtSetDefaultHardErrorPort for more information.
525  * See also: http://undocumented.ntinternals.net/UserMode/Undocumented%20Functions/Error/NtRaiseHardError.html
526  *
527  * @param ErrorStatus
528  * Error Code
529  *
530  * @param NumberOfParameters
531  * Number of optional parameters in Parameters array
532  *
533  * @param UnicodeStringParameterMask
534  * Optional string parameter (can be only one per error code)
535  *
536  * @param Parameters
537  * Array of ULONG_PTR parameters for use in error message string
538  *
539  * @param ValidResponseOptions
540  * See HARDERROR_RESPONSE_OPTION for possible values description
541  *
542  * @param Response
543  * Pointer to HARDERROR_RESPONSE enumeration
544  *
545  * @return Status
546  *
547  * @remarks NtRaiseHardError constitutes an easy way to display messages
548  * in GUI without loading any Win32 API libraries.
549  *
550  *--*/
551 NTSTATUS
552 NTAPI
554  IN ULONG NumberOfParameters,
555  IN ULONG UnicodeStringParameterMask,
557  IN ULONG ValidResponseOptions,
559 {
561  PULONG_PTR SafeParams = NULL;
562  ULONG SafeResponse = ResponseNotHandled;
563  UNICODE_STRING SafeString;
564  ULONG i;
565  ULONG ParamSize = 0;
567 
568  PAGED_CODE();
569 
570  /* Validate parameter count */
571  if (NumberOfParameters > MAXIMUM_HARDERROR_PARAMETERS)
572  {
573  /* Fail */
575  }
576 
577  /* Make sure we have some at least */
578  if ((Parameters != NULL) && (NumberOfParameters == 0))
579  {
580  /* Fail */
582  }
583 
584  /* Check if we were called from user-mode */
585  if (PreviousMode != KernelMode)
586  {
587  /* First validate the responses */
588  switch (ValidResponseOptions)
589  {
590  /* Check all valid cases */
592  case OptionOk:
593  case OptionOkCancel:
594  case OptionRetryCancel:
595  case OptionYesNo:
596  case OptionYesNoCancel:
598  case OptionOkNoWait:
600  break;
601 
602  /* Anything else is invalid */
603  default:
605  }
606 
607  /* Check if we have parameters */
608  if (Parameters)
609  {
610  /* Calculate size of the parameters */
611  ParamSize = sizeof(ULONG_PTR) * NumberOfParameters;
612 
613  /* Allocate a safe buffer */
614  SafeParams = ExAllocatePoolWithTag(PagedPool, ParamSize, TAG_ERR);
615  if (!SafeParams)
616  {
618  }
619  }
620 
621  /* Enter SEH Block */
622  _SEH2_TRY
623  {
624  /* Validate the response pointer */
626 
627  /* Check if we have parameters */
628  if (Parameters)
629  {
630  /* Validate the parameter pointers */
631  ProbeForRead(Parameters, ParamSize, sizeof(ULONG_PTR));
632 
633  /* Copy them */
634  RtlCopyMemory(SafeParams, Parameters, ParamSize);
635 
636  /* Now check if there's strings in it */
637  if (UnicodeStringParameterMask)
638  {
639  /* Loop every string */
640  for (i = 0; i < NumberOfParameters; i++)
641  {
642  /* Check if this parameter is a string */
643  if (UnicodeStringParameterMask & (1 << i))
644  {
645  /* Probe the structure */
646  ProbeForRead((PVOID)SafeParams[i],
647  sizeof(UNICODE_STRING),
648  sizeof(ULONG_PTR));
649 
650  /* Capture it */
651  RtlCopyMemory(&SafeString,
652  (PVOID)SafeParams[i],
653  sizeof(UNICODE_STRING));
654 
655  /* Probe the buffer */
656  ProbeForRead(SafeString.Buffer,
657  SafeString.MaximumLength,
658  sizeof(UCHAR));
659  }
660  }
661  }
662  }
663  }
665  {
666  /* Free captured buffer */
667  if (SafeParams) ExFreePoolWithTag(SafeParams, TAG_ERR);
668 
669  /* Return the exception code */
671  }
672  _SEH2_END;
673 
674  /* Call the system function directly, because we probed */
675  Status = ExpRaiseHardError(ErrorStatus,
676  NumberOfParameters,
677  UnicodeStringParameterMask,
678  SafeParams,
679  ValidResponseOptions,
680  &SafeResponse);
681 
682  /* Free captured buffer */
683  if (SafeParams) ExFreePoolWithTag(SafeParams, TAG_ERR);
684 
685  /* Enter SEH Block to return the response */
686  _SEH2_TRY
687  {
688  /* Return the response */
689  *Response = SafeResponse;
690  }
692  {
693  /* Get the exception code */
695  }
696  _SEH2_END;
697  }
698  else
699  {
700  /* Reuse variable */
701  SafeParams = Parameters;
702 
703  /*
704  * Call the Executive Function. It will probe
705  * and copy pointers to user-mode.
706  */
707  Status = ExRaiseHardError(ErrorStatus,
708  NumberOfParameters,
709  UnicodeStringParameterMask,
710  SafeParams,
711  ValidResponseOptions,
712  &SafeResponse);
713 
714  /* Return the response */
715  *Response = SafeResponse;
716  }
717 
718  /* Return status */
719  return Status;
720 }
721 
722 /*++
723  * @name NtSetDefaultHardErrorPort
724  * @implemented
725  *
726  * NtSetDefaultHardErrorPort is typically called only once. After the call,
727  * the kernel sets a BOOLEAN flag named ExReadyForErrors to TRUE, and all other
728  * attempts to change the default port fail with STATUS_UNSUCCESSFUL error code.
729  * See: http://undocumented.ntinternals.net/UserMode/Undocumented%20Functions/Error/NtSetDefaultHardErrorPort.html
730  * https://web.archive.org/web/20070716133753/http://www.windowsitlibrary.com/Content/356/08/2.html
731  *
732  * @param PortHandle
733  * Handle to named port object
734  *
735  * @return Status
736  *
737  * @remarks Privileges: SE_TCB_PRIVILEGE
738  *
739  *--*/
740 NTSTATUS
741 NTAPI
743 {
746 
747  PAGED_CODE();
748 
749  /* Check if we have the privileges */
751  {
752  DPRINT1("NtSetDefaultHardErrorPort: Caller requires "
753  "the SeTcbPrivilege privilege!\n");
755  }
756 
757  /* Only called once during bootup, make sure we weren't called yet */
758  if (!ExReadyForErrors)
759  {
760  /* Reference the hard-error port */
761  Status = ObReferenceObjectByHandle(PortHandle,
762  0,
764  PreviousMode,
766  NULL);
767  if (NT_SUCCESS(Status))
768  {
769  /* Keep also a reference to the process handling the hard errors */
774  }
775  }
776 
777  /* Return status to caller */
778  return Status;
779 }
780 
781 VOID
782 __cdecl
784 {
785  /* Not supported in Kernel Mode */
787 }
788 
789 /* EOF */
#define ProbeForWriteUlong(Ptr)
Definition: probe.h:36
#define KeQuerySystemTime(t)
Definition: env_spec_w32.h:570
#define IN
Definition: typedefs.h:38
DECLSPEC_NORETURN NTSYSAPI VOID NTAPI RtlRaiseStatus(_In_ NTSTATUS Status)
#define STATUS_PRIVILEGE_NOT_HELD
Definition: DriverTester.h:9
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define SEM_FAILCRITICALERRORS
Definition: rtltypes.h:69
#define __cdecl
Definition: accygwin.h:79
#define PsGetCurrentThread()
Definition: env_spec_w32.h:81
NTSTATUS NTAPI NtRaiseHardError(IN NTSTATUS ErrorStatus, IN ULONG NumberOfParameters, IN ULONG UnicodeStringParameterMask, IN PULONG_PTR Parameters, IN ULONG ValidResponseOptions, OUT PULONG Response)
Definition: harderr.c:553
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
USHORT MaximumLength
Definition: env_spec_w32.h:370
uint16_t * PWSTR
Definition: typedefs.h:54
PEPROCESS ExpDefaultErrorPortProcess
Definition: harderr.c:21
#define KeGetPreviousMode()
Definition: ketypes.h:1107
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS NTAPI ExRaiseHardError(IN NTSTATUS ErrorStatus, IN ULONG NumberOfParameters, IN ULONG UnicodeStringParameterMask, IN PULONG_PTR Parameters, IN ULONG ValidResponseOptions, OUT PULONG Response)
Definition: harderr.c:386
VOID __cdecl _purecall(VOID)
Definition: harderr.c:783
BOOLEAN NTAPI SeSinglePrivilegeCheck(IN LUID PrivilegeValue, IN KPROCESSOR_MODE PreviousMode)
Definition: priv.c:524
KPROCESSOR_MODE NTAPI ExGetPreviousMode(VOID)
Definition: sysinfo.c:3066
NTSTATUS NTAPI NtSetDefaultHardErrorPort(IN HANDLE PortHandle)
Definition: harderr.c:742
#define MEM_COMMIT
Definition: nt_native.h:1313
UNICODE_STRING Strings[MAXIMUM_HARDERROR_PARAMETERS]
Definition: ex.h:124
NTSTATUS NTAPI LpcRequestWaitReplyPort(IN PVOID PortObject, IN PPORT_MESSAGE LpcRequest, OUT PPORT_MESSAGE LpcReply)
Definition: send.c:178
#define PAGED_CODE()
Definition: video.h:57
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:263
_SEH2_TRY
Definition: create.c:4250
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define HARDERROR_OVERRIDE_ERRORMODE
Definition: extypes.h:146
#define EXCEPTION_CONTINUE_SEARCH
Definition: excpt.h:86
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
NTSTATUS NTAPI ObReferenceObjectByHandle(IN HANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PVOID *Object, OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL)
Definition: obref.c:496
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
long LONG
Definition: pedump.c:60
BOOLEAN ExReadyForErrors
Definition: harderr.c:19
#define PsGetCurrentProcess
Definition: psfuncs.h:17
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
#define STATUS_INVALID_PARAMETER_2
Definition: ntstatus.h:462
Definition: bufpool.h:45
#define NtCurrentProcess()
Definition: nt_native.h:1657
struct _HARDERROR_MSG HARDERROR_MSG
POBJECT_TYPE LpcPortObjectType
Definition: port.c:17
_In_ KPROCESSOR_MODE PreviousMode
Definition: sefuncs.h:103
#define _SEH2_YIELD(STMT_)
Definition: pseh2_64.h:8
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
struct tagUserData UserData
ULONG_PTR Parameters[MAXIMUM_HARDERROR_PARAMETERS]
Definition: ex.h:123
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
#define NT_ERROR(Status)
Definition: umtypes.h:106
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
#define RTL_SEM_FAILCRITICALERRORS
Definition: rtltypes.h:74
Definition: ncftp.h:89
VOID NTAPI ExRaiseAccessViolation(VOID)
Definition: harderr.c:310
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
CHAR Message[80]
Definition: alive.c:5
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
unsigned char UCHAR
Definition: xmlstorage.h:181
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:102
VOID NTAPI ExRaiseDatatypeMisalignment(VOID)
Definition: harderr.c:332
_In_ PPCI_DEVICE_PRESENCE_PARAMETERS Parameters
Definition: iotypes.h:872
#define NOTHING
Definition: env_spec_w32.h:461
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
ULONG SystemThread
Definition: pstypes.h:1113
Status
Definition: gdiplustypes.h:24
const LUID SeTcbPrivilege
Definition: priv.c:28
UnicodeString MaximumLength
Definition: rtlfuncs.h:2982
ULONG_PTR SIZE_T
Definition: typedefs.h:78
Definition: compat.h:492
const LUID SeShutdownPrivilege
Definition: priv.c:40
_SEH2_END
Definition: create.c:4424
LONG NTAPI ExSystemExceptionFilter(VOID)
Definition: harderr.c:351
struct _HARDERROR_MSG * PHARDERROR_MSG
#define STATUS_ACCESS_VIOLATION
Definition: ntstatus.h:228
#define PORT_MAXIMUM_MESSAGE_LENGTH
Definition: iotypes.h:1986
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
unsigned int * PULONG
Definition: retypes.h:1
WCHAR Buffer[ANYSIZE_ARRAY]
Definition: ex.h:125
#define DPRINT1
Definition: precomp.h:8
NTSTATUS NTAPI ExpSystemErrorHandler(IN NTSTATUS ErrorStatus, IN ULONG NumberOfParameters, IN ULONG UnicodeStringParameterMask, IN PULONG_PTR Parameters, IN BOOLEAN Shutdown)
Definition: harderr.c:55
#define MEM_RELEASE
Definition: nt_native.h:1316
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
NTSTATUS NTAPI ExpRaiseHardError(IN NTSTATUS ErrorStatus, IN ULONG NumberOfParameters, IN ULONG UnicodeStringParameterMask, IN PULONG_PTR Parameters, IN ULONG ValidResponseOptions, OUT PULONG Response)
Definition: harderr.c:101
#define OUT
Definition: typedefs.h:39
#define ObReferenceObject
Definition: obfuncs.h:204
#define STATUS_DATATYPE_MISALIGNMENT
Definition: ntstatus.h:171
PVOID ExpDefaultErrorPort
Definition: harderr.c:20
#define TAG_ERR
Definition: harderr.c:15
unsigned int ULONG
Definition: retypes.h:1
#define ULONG_PTR
Definition: config.h:101
uint32_t * PULONG_PTR
Definition: typedefs.h:63
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define MAXIMUM_HARDERROR_PARAMETERS
Definition: extypes.h:145
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
#define STATUS_INVALID_PARAMETER_4
Definition: ntstatus.h:464
ULONG HardErrorsAreDisabled
Definition: pstypes.h:1114
return STATUS_SUCCESS
Definition: btrfs.c:2938
VOID NTAPI KeBugCheckEx(_In_ ULONG BugCheckCode, _In_ ULONG_PTR BugCheckParameter1, _In_ ULONG_PTR BugCheckParameter2, _In_ ULONG_PTR BugCheckParameter3, _In_ ULONG_PTR BugCheckParameter4)
Definition: rtlcompat.c:107
#define PAGE_READWRITE
Definition: nt_native.h:1304