Skip to content

Commit

Permalink
Sync with the OS (#319)
Browse files Browse the repository at this point in the history
* Sync with OS commit b58d62a22e8b065355e83f17d32f446bac7d5e75

* Fix build issues

* Fix test

* Merge with OS commit 2f20a1d7f273c9242cff4bb642ac0536833c0e75

* Preprocessor fix for Tracelogging.h

* EBO to make UBSan happy

* Some existing consumers can't consume win32_helpers

* Build issue; apparently [[nodiscard]] causes issues with coroutines
  • Loading branch information
dunhor committed Apr 11, 2023
1 parent 70155eb commit 9db6276
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 94 deletions.
209 changes: 121 additions & 88 deletions include/wil/Tracelogging.h

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion include/wil/cppwinrt_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ namespace wil
m_priority(priority)
{
}
WI_NODISCARD bool await_ready() const noexcept { return false; }
bool await_ready() const noexcept { return false; }

void await_suspend(details::coroutine_handle<> handle)
{
Expand Down
1 change: 1 addition & 0 deletions include/wil/token_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ namespace wil
#endif // WIL_ENABLE_EXCEPTIONS

#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)

// Returns tokenHandle or the effective thread token if tokenHandle is null.
// Note, this returns an token handle who's lifetime is managed independently
// and it may be a pseudo token, don't free it!
Expand Down
6 changes: 3 additions & 3 deletions tests/ComTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ IAlways : public IUnknown
STDMETHOD_(void, Always)() = 0;
};

class __declspec(uuid("ececcc6a-5193-4d14-b38e-ed1460c20b00")) // non-implemented to allow QI for the class to be attempted (and fail)
class __declspec(empty_bases) __declspec(uuid("ececcc6a-5193-4d14-b38e-ed1460c20b00")) // non-implemented to allow QI for the class to be attempted (and fail)
ComObject : witest::AllocatedObject,
public Microsoft::WRL::RuntimeClass<Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::RuntimeClassType::ClassicCom>,
Microsoft::WRL::ChainInterfaces<IDerivedTest, ITest>,
Expand All @@ -648,7 +648,7 @@ ComObject : witest::AllocatedObject,
COM_DECLSPEC_NOTHROW IFACEMETHODIMP_(void) Always() {}
};

class __declspec(uuid("ececcc6a-5193-4d14-b38e-ed1460c20b01")) // non-implemented to allow QI for the class to be attempted (and fail)
class __declspec(empty_bases) __declspec(uuid("ececcc6a-5193-4d14-b38e-ed1460c20b01")) // non-implemented to allow QI for the class to be attempted (and fail)
WinRtObject : witest::AllocatedObject,
public Microsoft::WRL::RuntimeClass<Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::RuntimeClassType::WinRtClassicComMix>,
ITest, IDerivedTest, ITestInspectable, IDerivedTestInspectable, IAlways, Microsoft::WRL::FtmBase>
Expand All @@ -661,7 +661,7 @@ WinRtObject : witest::AllocatedObject,
COM_DECLSPEC_NOTHROW IFACEMETHODIMP_(void) Always() {}
};

class NoCom : witest::AllocatedObject
class __declspec(empty_bases) NoCom : witest::AllocatedObject
{
public:
ULONG __stdcall AddRef()
Expand Down
2 changes: 1 addition & 1 deletion tests/ResourceTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ ITest : public IUnknown
STDMETHOD_(void, Test)() = 0;
};

class PointerTestObject : witest::AllocatedObject,
class __declspec(empty_bases) PointerTestObject : witest::AllocatedObject,
public Microsoft::WRL::RuntimeClass<Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::RuntimeClassType::ClassicCom>, ITest>
{
public:
Expand Down
2 changes: 1 addition & 1 deletion tests/wiTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2870,7 +2870,7 @@ interface __declspec(uuid("EDCA4ADC-DF46-442A-A69D-FDFD8BC37B31")) IFakeObject :
STDMETHOD_(void, DoStuff)() = 0;
};

class ArrayTestObject : witest::AllocatedObject,
class __declspec(empty_bases) ArrayTestObject : witest::AllocatedObject,
public Microsoft::WRL::RuntimeClass<Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::RuntimeClassType::ClassicCom>, IFakeObject>
{
public:
Expand Down

0 comments on commit 9db6276

Please sign in to comment.