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.

92 lines
1.7 KiB

  1. /*++
  2. Copyright (c) 1998-2000 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. // how many CPUs on this machine?
  40. inline int NumProcessors()
  41. {
  42. static int s_nCPUs = 0;
  43. if (s_nCPUs == 0)
  44. {
  45. SYSTEM_INFO si;
  46. GetSystemInfo(&si);
  47. s_nCPUs = si.dwNumberOfProcessors;
  48. }
  49. return s_nCPUs;
  50. }
  51. // Type of processor, 386, 486, etc
  52. inline int ProcessorType()
  53. {
  54. static int s_nProcessorType = 0;
  55. if (s_nProcessorType == 0)
  56. {
  57. SYSTEM_INFO si;
  58. GetSystemInfo(&si);
  59. s_nProcessorType = si.dwProcessorType;
  60. }
  61. return s_nProcessorType;
  62. }
  63. #ifdef __cplusplus
  64. }
  65. #endif // __cplusplus
  66. #endif // __IRTLMISC_H__