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.

137 lines
2.3 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name :
  4. irtlmisc.h
  5. Abstract:
  6. Declares miscellaneous functions and classes in IisRtl.DLL
  7. Author:
  8. George V. Reilly (GeorgeRe) 06-Jan-1998
  9. Environment:
  10. Win32 - User Mode
  11. Project:
  12. Internet Information Server RunTime Library
  13. Revision History:
  14. --*/
  15. #ifndef __IRTLMISC_H__
  16. #define __IRTLMISC_H__
  17. #include <windows.h>
  18. //--------------------------------------------------------------------
  19. // These declarations are needed to export the template classes from
  20. // IisRtl.DLL and import them into other modules.
  21. #ifndef IRTL_DLLEXP
  22. # ifdef DLL_IMPLEMENTATION
  23. # define IRTL_DLLEXP __declspec(dllexport)
  24. # ifdef IMPLEMENTATION_EXPORT
  25. # define IRTL_EXPIMP
  26. # else
  27. # undef IRTL_EXPIMP
  28. # endif
  29. # else // !DLL_IMPLEMENTATION
  30. # define IRTL_DLLEXP __declspec(dllimport)
  31. # define IRTL_EXPIMP extern
  32. # endif // !DLL_IMPLEMENTATION
  33. #endif // !IRTL_DLLEXP
  34. //--------------------------------------------------------------------
  35. // Miscellaneous functions
  36. #ifdef __cplusplus
  37. extern "C" {
  38. #endif // __cplusplus
  39. // Heap routines
  40. // Private IIS heap
  41. HANDLE
  42. WINAPI
  43. IisHeap();
  44. // Allocate dwBytes
  45. LPVOID
  46. WINAPI
  47. IisMalloc(
  48. IN SIZE_T dwBytes);
  49. // Allocate dwBytes. Memory is zeroed
  50. LPVOID
  51. WINAPI
  52. IisCalloc(
  53. IN SIZE_T dwBytes);
  54. // Reallocate lpMem to dwBytes
  55. LPVOID
  56. WINAPI
  57. IisReAlloc(
  58. IN LPVOID lpMem,
  59. IN SIZE_T dwBytes);
  60. // Free lpMem
  61. BOOL
  62. WINAPI
  63. IisFree(
  64. IN LPVOID lpMem);
  65. // additional IISRTL initialization
  66. BOOL
  67. WINAPI
  68. InitializeIISRTL();
  69. // call before unloading IISRTL
  70. void
  71. WINAPI
  72. TerminateIISRTL();
  73. // case-insensitive strstr
  74. IRTL_DLLEXP const char* stristr(const char* pszString, const char* pszSubString);
  75. // how many CPUs on this machine?
  76. inline int NumProcessors()
  77. {
  78. static int s_nCPUs = 0;
  79. if (s_nCPUs == 0)
  80. {
  81. SYSTEM_INFO si;
  82. GetSystemInfo(&si);
  83. s_nCPUs = si.dwNumberOfProcessors;
  84. }
  85. return s_nCPUs;
  86. }
  87. // how many CPUs on this machine?
  88. inline int ProcessorType()
  89. {
  90. static int s_nProcessorType = 0;
  91. if (s_nProcessorType == 0)
  92. {
  93. SYSTEM_INFO si;
  94. GetSystemInfo(&si);
  95. s_nProcessorType = si.dwProcessorType;
  96. }
  97. return s_nProcessorType;
  98. }
  99. #ifdef __cplusplus
  100. }
  101. #endif // __cplusplus
  102. #endif // __IRTLMISC_H__