mirror of
https://github.com/reactos/reactos.git
synced 2025-06-25 22:09:45 +00:00
[UCRT] Import Microsoft.Windows.SDK.CRTSource version 10.0.22621.3
Imported from https://www.nuget.org/packages/Microsoft.Windows.SDK.CRTSource/10.0.22621.3 License: MIT
This commit is contained in:
parent
f1b60c66f0
commit
04e0dc4a7a
568 changed files with 115483 additions and 0 deletions
31
sdk/lib/ucrt/heap/new_mode.cpp
Normal file
31
sdk/lib/ucrt/heap/new_mode.cpp
Normal file
|
@ -0,0 +1,31 @@
|
|||
//
|
||||
// new_mode.cpp
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// Definition of _set_new_mode and _query_new_mode, which provide access to the
|
||||
// _newmode global flag.
|
||||
//
|
||||
#include <corecrt_internal.h>
|
||||
#include <new.h>
|
||||
|
||||
|
||||
|
||||
static __crt_state_management::dual_state_global<long> __acrt_global_new_mode;
|
||||
|
||||
|
||||
|
||||
// Sets the _newmode flag to the new value 'mode' and return the old mode.
|
||||
extern "C" int __cdecl _set_new_mode(int const mode)
|
||||
{
|
||||
// The only valid values of _newmode are 0 and 1:
|
||||
_VALIDATE_RETURN(mode == 0 || mode == 1, EINVAL, -1);
|
||||
|
||||
return static_cast<int>(_InterlockedExchange(&__acrt_global_new_mode.value(), mode));
|
||||
}
|
||||
|
||||
// Gets the current value of the _newmode flag.
|
||||
extern "C" int __cdecl _query_new_mode()
|
||||
{
|
||||
return static_cast<int>(__crt_interlocked_read(&__acrt_global_new_mode.value()));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue