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.

140 lines
2.5 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. # elif defined LIB_IMPLEMENTATION
  30. # define IRTL_DLLEXP
  31. # define IRTL_EXPIMP extern
  32. # else
  33. # define IRTL_DLLEXP __declspec(dllimport)
  34. # define IRTL_EXPIMP extern
  35. # endif // !DLL_IMPLEMENTATION
  36. #endif // !IRTL_DLLEXP
  37. //--------------------------------------------------------------------
  38. // Miscellaneous functions
  39. #ifdef __cplusplus
  40. extern "C" {
  41. #endif // __cplusplus
  42. // Heap routines
  43. // Private IIS heap
  44. HANDLE
  45. WINAPI
  46. IisHeap();
  47. // Allocate dwBytes
  48. LPVOID
  49. WINAPI
  50. IisMalloc(
  51. IN SIZE_T dwBytes);
  52. // Allocate dwBytes. Memory is zeroed
  53. LPVOID
  54. WINAPI
  55. IisCalloc(
  56. IN SIZE_T dwBytes);
  57. // Reallocate lpMem to dwBytes
  58. LPVOID
  59. WINAPI
  60. IisReAlloc(
  61. IN LPVOID lpMem,
  62. IN SIZE_T dwBytes);
  63. // Free lpMem
  64. BOOL
  65. WINAPI
  66. IisFree(
  67. IN LPVOID lpMem);
  68. // additional IISRTL initialization
  69. BOOL
  70. WINAPI
  71. InitializeIISRTL();
  72. // call before unloading IISRTL
  73. void
  74. WINAPI
  75. TerminateIISRTL();
  76. // case-insensitive strstr
  77. IRTL_DLLEXP const char* stristr(const char* pszString, const char* pszSubString);
  78. // how many CPUs on this machine?
  79. inline int NumProcessors()
  80. {
  81. static int s_nCPUs = 0;
  82. if (s_nCPUs == 0)
  83. {
  84. SYSTEM_INFO si;
  85. GetSystemInfo(&si);
  86. s_nCPUs = si.dwNumberOfProcessors;
  87. }
  88. return s_nCPUs;
  89. }
  90. // how many CPUs on this machine?
  91. inline int ProcessorType()
  92. {
  93. static int s_nProcessorType = 0;
  94. if (s_nProcessorType == 0)
  95. {
  96. SYSTEM_INFO si;
  97. GetSystemInfo(&si);
  98. s_nProcessorType = si.dwProcessorType;
  99. }
  100. return s_nProcessorType;
  101. }
  102. #ifdef __cplusplus
  103. }
  104. #endif // __cplusplus
  105. #endif // __IRTLMISC_H__