@@ -78,103 +78,6 @@ namespace winrt::impl
78
78
{
79
79
return ((int32_t )((x) | 0x10000000 ));
80
80
}
81
-
82
- struct error_info_fallback final : IErrorInfo, IRestrictedErrorInfo, update_module_lock
83
- {
84
- error_info_fallback (int32_t code, void * message) noexcept :
85
- m_code (code),
86
- m_message (message ? *reinterpret_cast <winrt::hstring*>(&message) : message_from_hresult(code))
87
- {
88
- }
89
-
90
- int32_t __stdcall QueryInterface (guid const & id, void ** object) noexcept final
91
- {
92
- if (is_guid_of<IRestrictedErrorInfo>(id) || is_guid_of<Windows::Foundation::IUnknown>(id) || is_guid_of<IAgileObject>(id))
93
- {
94
- *object = static_cast <IRestrictedErrorInfo*>(this );
95
- AddRef ();
96
- return 0 ;
97
- }
98
-
99
- if (is_guid_of<IErrorInfo>(id))
100
- {
101
- *object = static_cast <IErrorInfo*>(this );
102
- AddRef ();
103
- return 0 ;
104
- }
105
-
106
- *object = nullptr ;
107
- return error_no_interface;
108
- }
109
-
110
- uint32_t __stdcall AddRef () noexcept final
111
- {
112
- return ++m_references;
113
- }
114
-
115
- uint32_t __stdcall Release () noexcept final
116
- {
117
- auto const remaining = --m_references;
118
-
119
- if (remaining == 0 )
120
- {
121
- delete this ;
122
- }
123
-
124
- return remaining;
125
- }
126
-
127
- int32_t __stdcall GetGUID (guid* value) noexcept final
128
- {
129
- *value = {};
130
- return 0 ;
131
- }
132
-
133
- int32_t __stdcall GetSource (bstr* value) noexcept final
134
- {
135
- *value = nullptr ;
136
- return 0 ;
137
- }
138
-
139
- int32_t __stdcall GetDescription (bstr* value) noexcept final
140
- {
141
- *value = WINRT_IMPL_SysAllocString (m_message.c_str ());
142
- return *value ? error_ok : error_bad_alloc;
143
- }
144
-
145
- int32_t __stdcall GetHelpFile (bstr* value) noexcept final
146
- {
147
- *value = nullptr ;
148
- return 0 ;
149
- }
150
-
151
- int32_t __stdcall GetHelpContext (uint32_t * value) noexcept final
152
- {
153
- *value = 0 ;
154
- return 0 ;
155
- }
156
-
157
- int32_t __stdcall GetErrorDetails (bstr* fallback, int32_t * error, bstr* message, bstr* capability) noexcept final
158
- {
159
- *fallback = nullptr ;
160
- *error = m_code;
161
- *capability = nullptr ;
162
- *message = WINRT_IMPL_SysAllocString (m_message.c_str ());
163
- return *message ? error_ok : error_bad_alloc;
164
- }
165
-
166
- int32_t __stdcall GetReference (bstr* value) noexcept final
167
- {
168
- *value = nullptr ;
169
- return 0 ;
170
- }
171
-
172
- private:
173
-
174
- hresult const m_code;
175
- hstring const m_message;
176
- atomic_ref_count m_references{ 1 };
177
- };
178
81
}
179
82
180
83
WINRT_EXPORT namespace winrt
0 commit comments