Skip to content

Commit e69ff22

Browse files
authored
Remove dead code related to Windows 7 support (#1390)
1 parent 91f485f commit e69ff22

File tree

2 files changed

+0
-152
lines changed

2 files changed

+0
-152
lines changed

strings/base_agile_ref.h

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -71,61 +71,6 @@ namespace winrt::impl
7171

7272
using update_module_lock = module_lock_updater<true>;
7373

74-
struct agile_ref_fallback final : IAgileReference, update_module_lock
75-
{
76-
agile_ref_fallback(com_ptr<IGlobalInterfaceTable>&& git, uint32_t cookie) noexcept :
77-
m_git(std::move(git)),
78-
m_cookie(cookie)
79-
{
80-
}
81-
82-
~agile_ref_fallback() noexcept
83-
{
84-
m_git->RevokeInterfaceFromGlobal(m_cookie);
85-
}
86-
87-
int32_t __stdcall QueryInterface(guid const& id, void** object) noexcept final
88-
{
89-
if (is_guid_of<IAgileReference>(id) || is_guid_of<Windows::Foundation::IUnknown>(id) || is_guid_of<IAgileObject>(id))
90-
{
91-
*object = static_cast<IAgileReference*>(this);
92-
AddRef();
93-
return 0;
94-
}
95-
96-
*object = nullptr;
97-
return error_no_interface;
98-
}
99-
100-
uint32_t __stdcall AddRef() noexcept final
101-
{
102-
return ++m_references;
103-
}
104-
105-
uint32_t __stdcall Release() noexcept final
106-
{
107-
auto const remaining = --m_references;
108-
109-
if (remaining == 0)
110-
{
111-
delete this;
112-
}
113-
114-
return remaining;
115-
}
116-
117-
int32_t __stdcall Resolve(guid const& id, void** object) noexcept final
118-
{
119-
return m_git->GetInterfaceFromGlobal(m_cookie, id, object);
120-
}
121-
122-
private:
123-
124-
com_ptr<IGlobalInterfaceTable> m_git;
125-
uint32_t m_cookie{};
126-
atomic_ref_count m_references{ 1 };
127-
};
128-
12974
inline void* load_library(wchar_t const* library) noexcept
13075
{
13176
return WINRT_IMPL_LoadLibraryExW(library, nullptr, 0x00001000 /* LOAD_LIBRARY_SEARCH_DEFAULT_DIRS */);

strings/base_error.h

Lines changed: 0 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -78,103 +78,6 @@ namespace winrt::impl
7878
{
7979
return ((int32_t)((x) | 0x10000000));
8080
}
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-
};
17881
}
17982

18083
WINRT_EXPORT namespace winrt

0 commit comments

Comments
 (0)