Coverage Report

Created: 2024-05-20 06:11

/src/FreeRDP/winpr/libwinpr/error/error.c
Line
Count
Source (jump to first uncovered line)
1
/**
2
 * WinPR: Windows Portable Runtime
3
 * Error Handling Functions
4
 *
5
 * Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
6
 *
7
 * Licensed under the Apache License, Version 2.0 (the "License");
8
 * you may not use this file except in compliance with the License.
9
 * You may obtain a copy of the License at
10
 *
11
 *     http://www.apache.org/licenses/LICENSE-2.0
12
 *
13
 * Unless required by applicable law or agreed to in writing, software
14
 * distributed under the License is distributed on an "AS IS" BASIS,
15
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
 * See the License for the specific language governing permissions and
17
 * limitations under the License.
18
 */
19
20
#include <winpr/config.h>
21
22
#include <winpr/error.h>
23
24
#ifndef _WIN32
25
26
#include <stdio.h>
27
28
#include <winpr/nt.h>
29
30
UINT GetErrorMode(void)
31
0
{
32
0
  return 0;
33
0
}
34
35
UINT SetErrorMode(UINT uMode)
36
0
{
37
0
  return 0;
38
0
}
39
40
DWORD GetLastError(VOID)
41
0
{
42
0
  PTEB pt = NtCurrentTeb();
43
0
  if (pt)
44
0
  {
45
0
    return pt->LastErrorValue;
46
0
  }
47
0
  return ERROR_OUTOFMEMORY;
48
0
}
49
50
VOID SetLastError(DWORD dwErrCode)
51
135k
{
52
135k
  PTEB pt = NtCurrentTeb();
53
135k
  if (pt)
54
135k
  {
55
135k
    pt->LastErrorValue = dwErrCode;
56
135k
  }
57
135k
}
58
59
VOID RestoreLastError(DWORD dwErrCode)
60
0
{
61
0
}
62
63
VOID RaiseException(DWORD dwExceptionCode, DWORD dwExceptionFlags, DWORD nNumberOfArguments,
64
                    CONST ULONG_PTR* lpArguments)
65
0
{
66
0
}
67
68
LONG UnhandledExceptionFilter(PEXCEPTION_POINTERS ExceptionInfo)
69
0
{
70
0
  return 0;
71
0
}
72
73
LPTOP_LEVEL_EXCEPTION_FILTER
74
SetUnhandledExceptionFilter(LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter)
75
0
{
76
0
  return NULL;
77
0
}
78
79
PVOID AddVectoredExceptionHandler(ULONG First, PVECTORED_EXCEPTION_HANDLER Handler)
80
0
{
81
0
  return NULL;
82
0
}
83
84
ULONG RemoveVectoredExceptionHandler(PVOID Handle)
85
0
{
86
0
  return 0;
87
0
}
88
89
PVOID AddVectoredContinueHandler(ULONG First, PVECTORED_EXCEPTION_HANDLER Handler)
90
0
{
91
0
  return NULL;
92
0
}
93
94
ULONG RemoveVectoredContinueHandler(PVOID Handle)
95
0
{
96
0
  return 0;
97
0
}
98
99
#endif