You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
690 B
37 lines
690 B
/*++
|
|
|
|
Copyright (c) Microsoft Corporation
|
|
|
|
Module Name:
|
|
|
|
CSxsPreserveLastError.h
|
|
|
|
Abstract:
|
|
|
|
Author:
|
|
|
|
Jay Krell (a-JayK, JayKrell) October 2000
|
|
|
|
Revision History:
|
|
|
|
--*/
|
|
#pragma once
|
|
|
|
#include "fusionlastwin32error.h"
|
|
|
|
//
|
|
// The idea here is to avoid hitting breakpoints on ::SetLastError
|
|
// or data breakpoints on NtCurrentTeb()->LastErrorValue.
|
|
//
|
|
class CSxsPreserveLastError
|
|
{
|
|
public:
|
|
DWORD LastError() const { return m_dwLastError; }
|
|
|
|
inline CSxsPreserveLastError() { ::FusionpGetLastWin32Error(&m_dwLastError); }
|
|
inline void Restore() const { ::FusionpSetLastWin32Error(m_dwLastError); }
|
|
|
|
protected:
|
|
DWORD m_dwLastError;
|
|
|
|
};
|