windows-nt/Source/XPSP1/NT/drivers/published/ddk/inc/fltsafe.w

27 lines
521 B
OpenEdge ABL
Raw Normal View History

2020-09-26 03:20:57 -05:00
// fltsafe.h
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// FLOATSAFE
//
// Saves floating point state on construction and restores on destruction.
//
struct FLOATSAFE
{
KFLOATING_SAVE FloatSave;
NTSTATUS ntStatus;
FLOATSAFE::FLOATSAFE(void)
{
ntStatus = KeSaveFloatingPointState(&FloatSave);
}
FLOATSAFE::~FLOATSAFE(void)
{
if (NT_SUCCESS(ntStatus))
{
KeRestoreFloatingPointState(&FloatSave);
}
}
};