[NTOSKRNL] Don't emit hard errors for the calling thread if hard errors have been...
[reactos.git] / ntoskrnl / ex / harderr.c
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
19 BOOLEAN ExReadyForErrors = FALSE;
20 PVOID ExpDefaultErrorPort = NULL;
21 PEPROCESS ExpDefaultErrorPortProcess = NULL;
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 *--*/
53 NTSTATUS
54 NTAPI
55 ExpSystemErrorHandler(IN NTSTATUS ErrorStatus,
56 IN ULONG NumberOfParameters,
57 IN ULONG UnicodeStringParameterMask,
58 IN PULONG_PTR Parameters,
59 IN BOOLEAN Shutdown)
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 *--*/
99 NTSTATUS
100 NTAPI
101 ExpRaiseHardError(IN NTSTATUS ErrorStatus,
102 IN ULONG NumberOfParameters,
103 IN ULONG UnicodeStringParameterMask,
104 IN PULONG_PTR Parameters,
105 IN ULONG ValidResponseOptions,
106 OUT PULONG Response)
107 {
108 NTSTATUS Status;
109 PEPROCESS Process = PsGetCurrentProcess();
110 PETHREAD Thread = PsGetCurrentThread();
111 UCHAR Buffer[PORT_MAXIMUM_MESSAGE_LENGTH];
112 PHARDERROR_MSG Message = (PHARDERROR_MSG)Buffer;
113 HANDLE PortHandle;
114 KPROCESSOR_MODE PreviousMode = KeGetPreviousMode();
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 */
131 if (!SeSinglePrivilegeCheck(SeTcbPrivilege, PreviousMode) ||
132 !SeSinglePrivilegeCheck(SeShutdownPrivilege, PreviousMode))
133 {
134 /* No rights */
135 *Response = ResponseNotHandled;
136 return STATUS_PRIVILEGE_NOT_HELD;
137 }
138
139 /* Don't handle any new hard errors */
140 ExReadyForErrors = FALSE;
141 }
142
143 /* Check if hard errors are not disabled */
144 if (!Thread->HardErrorsAreDisabled)
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 }
203 _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
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 */
215 *Response = ResponseReturnToCaller;
216 return STATUS_SUCCESS;
217 }
218
219 /* Check if this is the default process */
220 if (Process == ExpDefaultErrorPortProcess)
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 */
233 *Response = ResponseReturnToCaller;
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) RtlMoveMemory(&Message->Parameters,
251 Parameters,
252 sizeof(ULONG_PTR) * NumberOfParameters);
253
254 /* Send the LPC Message */
255 Status = LpcRequestWaitReplyPort(PortHandle,
256 (PPORT_MESSAGE)Message,
257 (PPORT_MESSAGE)Message);
258 if (NT_SUCCESS(Status))
259 {
260 /* Check what kind of response we got */
261 if ((Message->Response != ResponseReturnToCaller) &&
262 (Message->Response != ResponseNotHandled) &&
263 (Message->Response != ResponseAbort) &&
264 (Message->Response != ResponseCancel) &&
265 (Message->Response != ResponseIgnore) &&
266 (Message->Response != ResponseNo) &&
267 (Message->Response != ResponseOk) &&
268 (Message->Response != ResponseRetry) &&
269 (Message->Response != ResponseYes) &&
270 (Message->Response != ResponseTryAgain) &&
271 (Message->Response != ResponseContinue))
272 {
273 /* Reset to a default one */
274 Message->Response = ResponseReturnToCaller;
275 }
276
277 /* Set the response */
278 *Response = Message->Response;
279 }
280 else
281 {
282 /* Set the response */
283 *Response = ResponseReturnToCaller;
284 }
285
286 /* Return status */
287 return Status;
288 }
289
290 /*++
291 * @name ExRaiseAccessViolation
292 * @implemented
293 *
294 * The ExRaiseAccessViolation routine can be used with structured exception
295 * handling to throw a driver-determined exception for a memory access
296 * violation that occurs when a driver processes I/O requests.
297 * See: http://msdn.microsoft.com/library/en-us/Kernel_r/hh/Kernel_r/k102_71b4c053-599c-4a6d-8a59-08aae6bdc534.xml.asp?frame=true
298 * http://www.osronline.com/ddkx/kmarch/k102_814i.htm
299 *
300 * @return None
301 *
302 * @remarks None
303 *
304 *--*/
305 VOID
306 NTAPI
307 ExRaiseAccessViolation(VOID)
308 {
309 /* Raise the Right Status */
310 RtlRaiseStatus(STATUS_ACCESS_VIOLATION);
311 }
312
313 /*++
314 * @name ExRaiseDatatypeMisalignment
315 * @implemented
316 *
317 * ExRaiseDatatypeMisalignment raises an exception with the exception
318 * code set to STATUS_DATATYPE_MISALIGNMENT
319 * See: MSDN / DDK
320 * http://www.osronline.com/ddkx/kmarch/k102_814i.htm
321 *
322 * @return None
323 *
324 * @remarks None
325 *
326 *--*/
327 VOID
328 NTAPI
329 ExRaiseDatatypeMisalignment(VOID)
330 {
331 /* Raise the Right Status */
332 RtlRaiseStatus(STATUS_DATATYPE_MISALIGNMENT);
333 }
334
335 /*++
336 * @name ExSystemExceptionFilter
337 * @implemented
338 *
339 * TODO: Add description
340 *
341 * @return FILLME
342 *
343 * @remarks None
344 *
345 *--*/
346 LONG
347 NTAPI
348 ExSystemExceptionFilter(VOID)
349 {
350 return KeGetPreviousMode() != KernelMode ?
351 EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH;
352 }
353
354 /*++
355 * @name ExRaiseHardError
356 * @implemented
357 *
358 * See NtRaiseHardError and ExpRaiseHardError.
359 *
360 * @param ErrorStatus
361 * Error Code
362 *
363 * @param NumberOfParameters
364 * Number of optional parameters in Parameters array
365 *
366 * @param UnicodeStringParameterMask
367 * Optional string parameter (can be only one per error code)
368 *
369 * @param Parameters
370 * Array of ULONG parameters for use in error message string
371 *
372 * @param ValidResponseOptions
373 * See HARDERROR_RESPONSE_OPTION for possible values description
374 *
375 * @param Response
376 * Pointer to HARDERROR_RESPONSE enumeration
377 *
378 * @return Status
379 *
380 *--*/
381 NTSTATUS
382 NTAPI
383 ExRaiseHardError(IN NTSTATUS ErrorStatus,
384 IN ULONG NumberOfParameters,
385 IN ULONG UnicodeStringParameterMask,
386 IN PULONG_PTR Parameters,
387 IN ULONG ValidResponseOptions,
388 OUT PULONG Response)
389 {
390 SIZE_T Size;
391 UNICODE_STRING CapturedParams[MAXIMUM_HARDERROR_PARAMETERS];
392 ULONG i;
393 PVOID UserData = NULL;
394 PHARDERROR_USER_PARAMETERS UserParams;
395 PWSTR BufferBase;
396 ULONG SafeResponse;
397 NTSTATUS Status;
398 PAGED_CODE();
399
400 /* Check if we have parameters */
401 if (Parameters)
402 {
403 /* Check if we have strings */
404 if (UnicodeStringParameterMask)
405 {
406 /* Calculate the required size */
407 Size = FIELD_OFFSET(HARDERROR_USER_PARAMETERS, Buffer[0]);
408
409 /* Loop each parameter */
410 for (i = 0; i < NumberOfParameters; i++)
411 {
412 /* Check if it's part of the mask */
413 if (UnicodeStringParameterMask & (1 << i))
414 {
415 /* Copy it */
416 RtlMoveMemory(&CapturedParams[i],
417 (PVOID)Parameters[i],
418 sizeof(UNICODE_STRING));
419
420 /* Increase the size */
421 Size += CapturedParams[i].MaximumLength;
422 }
423 }
424
425 /* Allocate the user data region */
426 Status = ZwAllocateVirtualMemory(NtCurrentProcess(),
427 &UserData,
428 0,
429 &Size,
430 MEM_COMMIT,
431 PAGE_READWRITE);
432 if (!NT_SUCCESS(Status)) return Status;
433
434 /* Set the pointers to our data */
435 UserParams = UserData;
436 BufferBase = UserParams->Buffer;
437
438 /* Loop parameters again */
439 for (i = 0; i < NumberOfParameters; i++)
440 {
441 /* Check if we're in the mask */
442 if (UnicodeStringParameterMask & (1 << i))
443 {
444 /* Update the base */
445 UserParams->Parameters[i] = (ULONG_PTR)&UserParams->Strings[i];
446
447 /* Copy the string buffer */
448 RtlMoveMemory(BufferBase,
449 CapturedParams[i].Buffer,
450 CapturedParams[i].MaximumLength);
451
452 /* Set buffer */
453 CapturedParams[i].Buffer = BufferBase;
454
455 /* Copy the string structure */
456 UserParams->Strings[i] = CapturedParams[i];
457
458 /* Update the pointer */
459 BufferBase += CapturedParams[i].MaximumLength;
460 }
461 else
462 {
463 /* No need to copy any strings */
464 UserParams->Parameters[i] = Parameters[i];
465 }
466 }
467 }
468 else
469 {
470 /* Just keep the data as is */
471 UserData = Parameters;
472 }
473 }
474
475 /* Now call the worker function */
476 Status = ExpRaiseHardError(ErrorStatus,
477 NumberOfParameters,
478 UnicodeStringParameterMask,
479 UserData,
480 ValidResponseOptions,
481 &SafeResponse);
482
483 /* Check if we had done user-mode allocation */
484 if ((UserData) && (UserData != Parameters))
485 {
486 /* We did! Delete it */
487 Size = 0;
488 ZwFreeVirtualMemory(NtCurrentProcess(),
489 &UserData,
490 &Size,
491 MEM_RELEASE);
492 }
493
494 /* Return status and the response */
495 *Response = SafeResponse;
496 return Status;
497 }
498
499 /*++
500 * @name NtRaiseHardError
501 * @implemented
502 *
503 * This function sends HARDERROR_MSG LPC message to a hard-error listener,
504 * typically CSRSS.EXE. See NtSetDefaultHardErrorPort for more information.
505 * See also: http://undocumented.ntinternals.net/UserMode/Undocumented%20Functions/Error/NtRaiseHardError.html
506 *
507 * @param ErrorStatus
508 * Error Code
509 *
510 * @param NumberOfParameters
511 * Number of optional parameters in Parameters array
512 *
513 * @param UnicodeStringParameterMask
514 * Optional string parameter (can be only one per error code)
515 *
516 * @param Parameters
517 * Array of ULONG_PTR parameters for use in error message string
518 *
519 * @param ValidResponseOptions
520 * See HARDERROR_RESPONSE_OPTION for possible values description
521 *
522 * @param Response
523 * Pointer to HARDERROR_RESPONSE enumeration
524 *
525 * @return Status
526 *
527 * @remarks NtRaiseHardError constitutes an easy way to display messages
528 * in GUI without loading any Win32 API libraries.
529 *
530 *--*/
531 NTSTATUS
532 NTAPI
533 NtRaiseHardError(IN NTSTATUS ErrorStatus,
534 IN ULONG NumberOfParameters,
535 IN ULONG UnicodeStringParameterMask,
536 IN PULONG_PTR Parameters,
537 IN ULONG ValidResponseOptions,
538 OUT PULONG Response)
539 {
540 NTSTATUS Status = STATUS_SUCCESS;
541 PULONG_PTR SafeParams = NULL;
542 ULONG SafeResponse;
543 UNICODE_STRING SafeString;
544 ULONG i;
545 ULONG ParamSize = 0;
546 KPROCESSOR_MODE PreviousMode = ExGetPreviousMode();
547
548 /* Validate parameter count */
549 if (NumberOfParameters > MAXIMUM_HARDERROR_PARAMETERS)
550 {
551 /* Fail */
552 return STATUS_INVALID_PARAMETER_2;
553 }
554
555 /* Make sure we have some at least */
556 if ((Parameters != NULL) && (NumberOfParameters == 0))
557 {
558 /* Fail */
559 return STATUS_INVALID_PARAMETER_2;
560 }
561
562 /* Check if we were called from user-mode */
563 if (PreviousMode != KernelMode)
564 {
565 /* First validate the responses */
566 switch (ValidResponseOptions)
567 {
568 /* Check all valid cases */
569 case OptionAbortRetryIgnore:
570 case OptionOk:
571 case OptionOkCancel:
572 case OptionRetryCancel:
573 case OptionYesNo:
574 case OptionYesNoCancel:
575 case OptionShutdownSystem:
576 case OptionOkNoWait:
577 case OptionCancelTryContinue:
578 break;
579
580 /* Anything else is invalid */
581 default:
582 return STATUS_INVALID_PARAMETER_4;
583 }
584
585 /* Check if we have parameters */
586 if (Parameters)
587 {
588 /* Calculate size of the parameters */
589 ParamSize = sizeof(ULONG_PTR) * NumberOfParameters;
590
591 /* Allocate a safe buffer */
592 SafeParams = ExAllocatePoolWithTag(PagedPool, ParamSize, TAG_ERR);
593 if (!SafeParams)
594 {
595 return STATUS_INSUFFICIENT_RESOURCES;
596 }
597 }
598
599 /* Enter SEH Block */
600 _SEH2_TRY
601 {
602 /* Validate the response pointer */
603 ProbeForWriteUlong(Response);
604
605 /* Check if we have parameters */
606 if (Parameters)
607 {
608 /* Validate the parameter pointers */
609 ProbeForRead(Parameters, ParamSize, sizeof(ULONG_PTR));
610
611 /* Copy them */
612 RtlCopyMemory(SafeParams, Parameters, ParamSize);
613
614 /* Now check if there's strings in it */
615 if (UnicodeStringParameterMask)
616 {
617 /* Loop every string */
618 for (i = 0; i < NumberOfParameters; i++)
619 {
620 /* Check if this parameter is a string */
621 if (UnicodeStringParameterMask & (1 << i))
622 {
623 /* Probe the structure */
624 ProbeForRead((PVOID)SafeParams[i],
625 sizeof(UNICODE_STRING),
626 sizeof(ULONG_PTR));
627
628 /* Capture it */
629 RtlCopyMemory(&SafeString,
630 (PVOID)SafeParams[i],
631 sizeof(UNICODE_STRING));
632
633 /* Probe the buffer */
634 ProbeForRead(SafeString.Buffer,
635 SafeString.MaximumLength,
636 sizeof(UCHAR));
637 }
638 }
639 }
640 }
641 }
642 _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
643 {
644 /* Free captured buffer */
645 if (SafeParams) ExFreePoolWithTag(SafeParams, TAG_ERR);
646
647 /* Return the exception code */
648 _SEH2_YIELD(return _SEH2_GetExceptionCode());
649 }
650 _SEH2_END;
651
652 /* Call the system function directly, because we probed */
653 ExpRaiseHardError(ErrorStatus,
654 NumberOfParameters,
655 UnicodeStringParameterMask,
656 SafeParams,
657 ValidResponseOptions,
658 &SafeResponse);
659 }
660 else
661 {
662 /* Reuse variable */
663 SafeParams = Parameters;
664
665 /*
666 * Call the Executive Function. It will probe and copy pointers to
667 * user-mode
668 */
669 ExRaiseHardError(ErrorStatus,
670 NumberOfParameters,
671 UnicodeStringParameterMask,
672 SafeParams,
673 ValidResponseOptions,
674 &SafeResponse);
675 }
676
677 /* Check if we were called in user-mode */
678 if (PreviousMode != KernelMode)
679 {
680 /* That means we have a buffer to free */
681 if (SafeParams) ExFreePoolWithTag(SafeParams, TAG_ERR);
682
683 /* Enter SEH Block for return */
684 _SEH2_TRY
685 {
686 /* Return the response */
687 *Response = SafeResponse;
688 }
689 _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
690 {
691 /* Get the exception code */
692 Status = _SEH2_GetExceptionCode();
693 }
694 _SEH2_END;
695 }
696 else
697 {
698 /* Return the response */
699 *Response = SafeResponse;
700 }
701
702 /* Return status */
703 return Status;
704 }
705
706 /*++
707 * @name NtSetDefaultHardErrorPort
708 * @implemented
709 *
710 * NtSetDefaultHardErrorPort is typically called only once. After the call,
711 * the kernel sets a BOOLEAN flag named ExReadyForErrors to TRUE, and all other
712 * attempts to change the default port fail with STATUS_UNSUCCESSFUL error code.
713 * See: http://undocumented.ntinternals.net/UserMode/Undocumented%20Functions/Error/NtSetDefaultHardErrorPort.html
714 * https://web.archive.org/web/20070716133753/http://www.windowsitlibrary.com/Content/356/08/2.html
715 *
716 * @param PortHandle
717 * Handle to named port object
718 *
719 * @return Status
720 *
721 * @remarks Privileges: SE_TCB_PRIVILEGE
722 *
723 *--*/
724 NTSTATUS
725 NTAPI
726 NtSetDefaultHardErrorPort(IN HANDLE PortHandle)
727 {
728 KPROCESSOR_MODE PreviousMode = ExGetPreviousMode();
729 NTSTATUS Status = STATUS_UNSUCCESSFUL;
730
731 /* Check if we have the privileges */
732 if (!SeSinglePrivilegeCheck(SeTcbPrivilege, PreviousMode))
733 {
734 DPRINT1("NtSetDefaultHardErrorPort: Caller requires "
735 "the SeTcbPrivilege privilege!\n");
736 return STATUS_PRIVILEGE_NOT_HELD;
737 }
738
739 /* Only called once during bootup, make sure we weren't called yet */
740 if (!ExReadyForErrors)
741 {
742 /* Reference the hard-error port */
743 Status = ObReferenceObjectByHandle(PortHandle,
744 0,
745 LpcPortObjectType,
746 PreviousMode,
747 (PVOID*)&ExpDefaultErrorPort,
748 NULL);
749 if (NT_SUCCESS(Status))
750 {
751 /* Keep also a reference to the process handling the hard errors */
752 ExpDefaultErrorPortProcess = PsGetCurrentProcess();
753 ObReferenceObject(ExpDefaultErrorPortProcess);
754 ExReadyForErrors = TRUE;
755 Status = STATUS_SUCCESS;
756 }
757 }
758
759 /* Return status to caller */
760 return Status;
761 }
762
763 VOID
764 __cdecl
765 _purecall(VOID)
766 {
767 /* Not supported in Kernel Mode */
768 RtlRaiseStatus(STATUS_NOT_IMPLEMENTED);
769 }
770
771 /* EOF */