Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync with OS commit 6e3099ac18718043334c9e8277b772aa1c46cedd #486

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions include/wil/Tracelogging.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
#define _wiltlg_STRINGIZE_imp(x) #x
#define _wiltlg_LSTRINGIZE(x) _wiltlg_LSTRINGIZE_imp1(x)
#define _wiltlg_LSTRINGIZE_imp1(x) _wiltlg_LSTRINGIZE_imp2(#x)
#define _wiltlg_LSTRINGIZE_imp2(s) L##s
#define _wiltlg_LSTRINGIZE_imp2(s) L"" #s

/*
Macro __TRACELOGGING_DEFINE_PROVIDER_STORAGE_LINK(name1, name2):
Expand Down Expand Up @@ -6444,7 +6444,13 @@ namespace details

if (*lastNamespaceNode)
{
root.swap((*lastNamespaceNode)->next);
// Delete everything from the current root to the lastNamespaceNode
// (inclusive), considering the possibility that they are the same. Continue
// processing from the node following lastNamespaceNode, if any. root will
// be made to point to that.
auto newRoot = wistd::move((*lastNamespaceNode)->next);
const auto toDelete = wistd::move(root);
root = wistd::move(newRoot);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion include/wil/com.h
Original file line number Diff line number Diff line change
Expand Up @@ -3331,7 +3331,7 @@ namespace details
{
inline void CoDisableCallCancellationNull()
{
::CoDisableCallCancellation(nullptr);
(void)::CoDisableCallCancellation(nullptr);
}
} // namespace details

Expand Down
2 changes: 1 addition & 1 deletion include/wil/result.h
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ namespace details_abi
private:
struct Node
{
DWORD threadId = 0xffffffff; // MAXDWORD
DWORD threadId = 0xffffffffu;
Node* pNext = nullptr;
T value{};
};
Expand Down
4 changes: 2 additions & 2 deletions include/wil/result_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -3432,15 +3432,15 @@ class ResultException : public std::exception
}

//! Returns the failed HRESULT that this exception represents.
_Always_(_Post_satisfies_(return < 0)) WI_NODISCARD HRESULT GetErrorCode() const WI_NOEXCEPT
WI_NODISCARD _Always_(_Post_satisfies_(return < 0)) HRESULT GetErrorCode() const WI_NOEXCEPT
{
HRESULT const hr = m_failure.GetFailureInfo().hr;
__analysis_assume(hr < 0);
return hr;
}

//! Returns the failed NTSTATUS that this exception represents.
_Always_(_Post_satisfies_(return < 0)) WI_NODISCARD NTSTATUS GetStatusCode() const WI_NOEXCEPT
WI_NODISCARD _Always_(_Post_satisfies_(return < 0)) NTSTATUS GetStatusCode() const WI_NOEXCEPT
{
NTSTATUS const status = m_failure.GetFailureInfo().status;
__analysis_assume(status < 0);
Expand Down
5 changes: 4 additions & 1 deletion include/wil/win32_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
#include "wistd_functional.h"
#include "wistd_type_traits.h"

EXTERN_C IMAGE_DOS_HEADER __ImageBase;

/// @cond
namespace wistd
{
Expand Down Expand Up @@ -680,6 +682,7 @@ inline DWORD GetCurrentProcessExecutionOption(PCWSTR valueName, DWORD defaultVal
return defaultValue;
}

#ifndef DebugBreak // Some code defines 'DebugBreak' to garbage to force build breaks in release builds
// Waits for a debugger to attach to the current process based on registry configuration.
//
// Example:
Expand Down Expand Up @@ -711,14 +714,14 @@ inline void WaitForDebuggerPresent(bool checkRegistryConfig = true)
Sleep(500);
}
}
#endif
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)

#endif

/** Retrieve the HINSTANCE for the current DLL or EXE using this symbol that
the linker provides for every module. This avoids the need for a global HINSTANCE variable
and provides access to this value for static libraries. */
EXTERN_C IMAGE_DOS_HEADER __ImageBase;
inline HINSTANCE GetModuleInstanceHandle() WI_NOEXCEPT
{
return reinterpret_cast<HINSTANCE>(&__ImageBase);
Expand Down
3 changes: 3 additions & 0 deletions scripts/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ jobs:
echo NOTE: As an additional note, given that different versions of 'clang-format' may have different behaviors, this
echo may be a false positive. If you believe that to be the case ^(e.g. none of the above resulted in modifications
echo to the code you have changed^), please note this in your PR.
echo ----------------------------------------------
echo See below for the file^(s^) that have changed:
git diff
exit /b 1
)
displayName: 'Check Formatting of Changes'
Expand Down