Leaked source code of windows server 2003
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.

90 lines
2.0 KiB

  1. #ifndef _NPXSTRES_H_
  2. #define _NPXSTRES_H_
  3. //
  4. // Default number of threads to create
  5. //
  6. #define DEF_NUM_THREADS 10
  7. //
  8. // This flag is set when it is known the thread has never done FP. In all cases
  9. // the control word should be set properly (0x27F). If the thread is clean the
  10. // status word should be zero.
  11. //
  12. #define PREINIT_FLAG_CLEANTHREAD 0x00000001
  13. #define EXCEPTIONTEST_FLAG_SLEEP 0x00000001
  14. #define EXCEPTIONTEST_FLAG_CALL_KERNEL_FP 0x00000002
  15. #define EXCEPTIONTEST_FLAG_SPIN 0x00000004
  16. typedef struct {
  17. CRITICAL_SECTION Crit;
  18. ULONG FailureFlags;
  19. } TEST_INFO, *PTEST_INFO;
  20. #define FAILURECASE_DIRTY_PREINIT 0x00000001
  21. #define FAILURECASE_CLEAN_PREINIT 0x00000002
  22. #define FAILURECASE_CONTROL_CORRUPTION 0x00000004
  23. #define FAILURECASE_STATUS_CORRUPTION 0x00000008
  24. #define FAILURECASE_STX_CORRUPTION 0x00000010
  25. #define FAILURECASE_SPIN_PEND 0x00000020
  26. #define FAILURECASE_SLEEP_PEND 0x00000040
  27. #define FAILURECASE_API_PEND 0x00000080
  28. VOID
  29. DoFpPreinitTest(
  30. IN OUT PTEST_INFO TestInfo,
  31. IN ULONG PreInitTestFlags
  32. );
  33. VOID
  34. DoFpControlCorruptionTest(
  35. IN OUT PTEST_INFO TestInfo
  36. );
  37. VOID
  38. DoFpStatusCorruptionTest(
  39. IN OUT PTEST_INFO TestInfo
  40. );
  41. VOID
  42. DoPendingExceptionTest(
  43. IN PTEST_INFO TestInfo,
  44. IN ULONG ExceptionTestFlags,
  45. IN ULONG FailureCode
  46. );
  47. VOID
  48. DoFpSt0CorruptionTest(
  49. IN OUT PTEST_INFO TestInfo
  50. );
  51. DWORD
  52. WINAPI
  53. FpThread(
  54. LPVOID Parameter
  55. );
  56. VOID
  57. PrintResult(
  58. IN FILE *Handle,
  59. IN LPTSTR TestText,
  60. IN PTEST_INFO TestInfo,
  61. IN ULONG FailureFlags
  62. );
  63. VOID
  64. SetFailureFlag(
  65. IN OUT PTEST_INFO TestInfo,
  66. IN ULONG FailureFlags
  67. );
  68. VOID
  69. FPxTestCallback(
  70. IN PVOID Context
  71. );
  72. #endif // _NPXSTRESS_H_