/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 | | #include <winpr/wlog.h> |
24 | | |
25 | | #ifndef _WIN32 |
26 | | |
27 | | #include <stdio.h> |
28 | | |
29 | | #include <winpr/nt.h> |
30 | | |
31 | | UINT GetErrorMode(void) |
32 | 0 | { |
33 | 0 | WLog_ERR("TODO", "TOdO: implement"); |
34 | 0 | return 0; |
35 | 0 | } |
36 | | |
37 | | UINT SetErrorMode(WINPR_ATTR_UNUSED UINT uMode) |
38 | 0 | { |
39 | 0 | WLog_ERR("TODO", "TOdO: implement"); |
40 | 0 | return 0; |
41 | 0 | } |
42 | | |
43 | | DWORD GetLastError(VOID) |
44 | 0 | { |
45 | 0 | PTEB pt = NtCurrentTeb(); |
46 | 0 | if (pt) |
47 | 0 | { |
48 | 0 | return pt->LastErrorValue; |
49 | 0 | } |
50 | 0 | return ERROR_OUTOFMEMORY; |
51 | 0 | } |
52 | | |
53 | | VOID SetLastError(DWORD dwErrCode) |
54 | 4 | { |
55 | 4 | PTEB pt = NtCurrentTeb(); |
56 | 4 | if (pt) |
57 | 4 | { |
58 | 4 | pt->LastErrorValue = dwErrCode; |
59 | 4 | } |
60 | 4 | } |
61 | | |
62 | | VOID RestoreLastError(WINPR_ATTR_UNUSED DWORD dwErrCode) |
63 | 0 | { |
64 | 0 | WLog_ERR("TODO", "TOdO: implement"); |
65 | 0 | } |
66 | | |
67 | | VOID RaiseException(WINPR_ATTR_UNUSED DWORD dwExceptionCode, |
68 | | WINPR_ATTR_UNUSED DWORD dwExceptionFlags, |
69 | | WINPR_ATTR_UNUSED DWORD nNumberOfArguments, |
70 | | WINPR_ATTR_UNUSED CONST ULONG_PTR* lpArguments) |
71 | 0 | { |
72 | 0 | WLog_ERR("TODO", "TOdO: implement"); |
73 | 0 | } |
74 | | |
75 | | LONG UnhandledExceptionFilter(WINPR_ATTR_UNUSED PEXCEPTION_POINTERS ExceptionInfo) |
76 | 0 | { |
77 | 0 | WLog_ERR("TODO", "TOdO: implement"); |
78 | 0 | return 0; |
79 | 0 | } |
80 | | |
81 | | LPTOP_LEVEL_EXCEPTION_FILTER |
82 | | SetUnhandledExceptionFilter( |
83 | | WINPR_ATTR_UNUSED LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter) |
84 | 0 | { |
85 | 0 | WLog_ERR("TODO", "TOdO: implement"); |
86 | 0 | return NULL; |
87 | 0 | } |
88 | | |
89 | | PVOID AddVectoredExceptionHandler(WINPR_ATTR_UNUSED ULONG First, |
90 | | WINPR_ATTR_UNUSED PVECTORED_EXCEPTION_HANDLER Handler) |
91 | 0 | { |
92 | 0 | WLog_ERR("TODO", "TOdO: implement"); |
93 | 0 | return NULL; |
94 | 0 | } |
95 | | |
96 | | ULONG RemoveVectoredExceptionHandler(WINPR_ATTR_UNUSED PVOID Handle) |
97 | 0 | { |
98 | 0 | WLog_ERR("TODO", "TOdO: implement"); |
99 | 0 | return 0; |
100 | 0 | } |
101 | | |
102 | | PVOID AddVectoredContinueHandler(WINPR_ATTR_UNUSED ULONG First, |
103 | | WINPR_ATTR_UNUSED PVECTORED_EXCEPTION_HANDLER Handler) |
104 | 0 | { |
105 | 0 | WLog_ERR("TODO", "TOdO: implement"); |
106 | 0 | return NULL; |
107 | 0 | } |
108 | | |
109 | | ULONG RemoveVectoredContinueHandler(WINPR_ATTR_UNUSED PVOID Handle) |
110 | 0 | { |
111 | 0 | WLog_ERR("TODO", "TOdO: implement"); |
112 | 0 | return 0; |
113 | 0 | } |
114 | | |
115 | | #endif |