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.

89 lines
2.5 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1993.
  5. //
  6. // File: memtest.hxx
  7. //
  8. // Contents: Memory allocation API unit test declarations
  9. //
  10. // Functions:
  11. //
  12. // History: 13-Aug-93 CarlH Created
  13. //
  14. //--------------------------------------------------------------------------
  15. #include <windows.h>
  16. #include <ole2.h>
  17. #include "signal.hxx"
  18. #define GLOBAL_RUN 0x00010000
  19. #define GLOBAL_CLEANUP 0x00020000
  20. #define GLOBAL_STATUS 0x00040000
  21. #define GLOBAL_VERBOSE 0x00080000
  22. #define MIDL_DEBUG 0x00000001
  23. #define MIDL_AUTOGO 0x00000002
  24. #define MIDL_AUTOEND 0x00000004
  25. BOOL TestPreInit(DWORD grfOptions);
  26. BOOL TestMemory(DWORD grfOptions);
  27. BOOL TestExceptions(DWORD grfOptions);
  28. BOOL TestMIDLClient(WCHAR *pwszServer, DWORD grfOptions);
  29. BOOL TestMIDLServer(DWORD grfOptions);
  30. #ifdef LINKED_COMPATIBLE
  31. BOOL TestCompatibility(DWORD grfOptions);
  32. #endif
  33. void PrintHeader(char const *pszComponent);
  34. void PrintResult(char const *pszComponent, BOOL fPassed);
  35. void PrintTrace(char const *pszComponent, char const *pszFormat, ...);
  36. void PrintError(char const *pszComponent, char const *pszFormat, ...);
  37. //+-------------------------------------------------------------------------
  38. //
  39. // Enum: MemOp (memop)
  40. //
  41. // Purpose: Describes a particualr memory operation
  42. //
  43. // History: 17-Aug-93 CarlH Created
  44. //
  45. //--------------------------------------------------------------------------
  46. enum MemOp
  47. {
  48. #ifdef LINKED_COMPATIBLE
  49. memopOldAlloc, // Allocate with MemAlloc
  50. memopOldAllocLinked,// Allocate with MemAllocLinked
  51. memopOldFree, // Free with MemFree
  52. #endif
  53. memopAlloc, // Allocate regular block of memory
  54. memopFree, // Free regular block of memory
  55. memopMIDLAlloc, // Allocate with MIDL_user_alloc
  56. memopMIDLFree // Free with MIDL_user_free
  57. };
  58. //+-------------------------------------------------------------------------
  59. //
  60. // Struct: SMemTask (memtsk)
  61. //
  62. // Purpose: Holds a description of a memory allocation task
  63. //
  64. // History: 17-Aug-93 CarlH Created
  65. //
  66. //--------------------------------------------------------------------------
  67. struct SMemTask
  68. {
  69. MemOp memop; // Memory operation to execute
  70. ULONG cb; // Size of operation (for alloc)
  71. ULONG imemtsk; // Related memory task (for free and linking)
  72. HRESULT hr; // Expected result code
  73. };
  74. BOOL RunMemoryTasks(char *pszComponent, SMemTask *pmemtsk, ULONG cmemtsk);