Source code of Windows XP (NT5)
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.

26 lines
521 B

  1. // fltsafe.h
  2. //
  3. // Copyright (c) Microsoft Corporation. All rights reserved.
  4. //
  5. // FLOATSAFE
  6. //
  7. // Saves floating point state on construction and restores on destruction.
  8. //
  9. struct FLOATSAFE
  10. {
  11. KFLOATING_SAVE FloatSave;
  12. NTSTATUS ntStatus;
  13. FLOATSAFE::FLOATSAFE(void)
  14. {
  15. ntStatus = KeSaveFloatingPointState(&FloatSave);
  16. }
  17. FLOATSAFE::~FLOATSAFE(void)
  18. {
  19. if (NT_SUCCESS(ntStatus))
  20. {
  21. KeRestoreFloatingPointState(&FloatSave);
  22. }
  23. }
  24. };