diff options
Diffstat (limited to 'chrome_frame/test/chrome_frame_test_utils.h')
-rw-r--r-- | chrome_frame/test/chrome_frame_test_utils.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/chrome_frame/test/chrome_frame_test_utils.h b/chrome_frame/test/chrome_frame_test_utils.h index 26da481..2947539 100644 --- a/chrome_frame/test/chrome_frame_test_utils.h +++ b/chrome_frame/test/chrome_frame_test_utils.h @@ -77,6 +77,19 @@ void SendInputToWindow(HWND window, const std::string& input_string); // window. void SetKeyboardFocusToWindow(HWND window, int x, int y); +// Temporarily impersonate the current thread to low integrity for the lifetime +// of the object. Destructor will automatically revert integrity level. +class LowIntegrityToken { + public: + LowIntegrityToken(); + ~LowIntegrityToken(); + BOOL Impersonate(); + BOOL RevertToSelf(); + protected: + static bool IsImpersonated(); + bool impersonated_; +}; + } // namespace chrome_frame_test -#endif // CHROME_FRAME_CHROMETAB_UNITTESTS_CF_TEST_UTILS_H_ +#endif // CHROME_FRAME_TEST_CHROME_FRAME_TEST_UTILS_H_ |