File tree Expand file tree Collapse file tree 1 file changed +24
-23
lines changed
Expand file tree Collapse file tree 1 file changed +24
-23
lines changed Original file line number Diff line number Diff line change @@ -69,31 +69,32 @@ WINRT_EXPORT namespace winrt
6969 check_bool (WINRT_IMPL_SetThreadToken (nullptr , get ()));
7070 }
7171
72- /* TODO: figure out why compiler ICEs auto operator()() const
73- {
74- struct guard
75- {
76- guard(access_token&& previous) noexcept : m_previous(std::move(previous))
77- {
78- }
79-
80- ~guard()
81- {
82- m_previous.revert();
83- }
84-
85- guard(guard const&)
86- {
87- // A Visual C++ compiler bug (550631) requires the copy constructor even though it is never called.
88- WINRT_ASSERT(false);
89- }
72+ auto operator ()() const ;
73+ };
74+ }
9075
91- private:
76+ namespace winrt ::impl
77+ {
78+ struct access_token_guard
79+ {
80+ access_token_guard (access_token&& previous) noexcept : m_previous(std::move(previous))
81+ {
82+ }
9283
93- access_token const m_previous;
94- };
84+ ~access_token_guard ()
85+ {
86+ m_previous.revert ();
87+ }
9588
96- return guard(impersonate());
97- } */
89+ private:
90+ access_token const m_previous;
9891 };
9992}
93+
94+ WINRT_EXPORT namespace winrt
95+ {
96+ auto access_token::operator ()() const
97+ {
98+ return impl::access_token_guard (impersonate ());
99+ }
100+ }
You can’t perform that action at this time.
0 commit comments