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.

112 lines
2.2 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation
  3. Module Name:
  4. GENERAL.H
  5. Abstract:
  6. Contains General functions prototypes.
  7. Author:
  8. Vasundhara .G
  9. Revision History:
  10. Vasundhara .G 9-oct-2k : Created It.
  11. --*/
  12. #ifndef __GENERAL_H
  13. #define __GENERAL_H
  14. // constants
  15. #define LOG_FILE_PATH _T( "\\system32\\wbem\\logs\\" )
  16. #define NEW_LINE _T( "\n" )
  17. #define LOG_FILE _T( "CmdTriggerConsumer.log" )
  18. #define JOB _T( ".job" )
  19. #define CHAR_SPACE _T( ' ' )
  20. #define STRING_SPACE _T( " " )
  21. #define SINGLE_QUOTE_CHAR _T( '\"' )
  22. #define SINGLE_QUOTE_STRING _T( "\"" )
  23. #define NULL_CHAR _T( '\0' )
  24. #define DATE_FORMAT L"ddd',' MMM dd yyyy"
  25. #define TIME_FORMAT L"hh':'mm':'ss tt"
  26. #define TRIM_SPACES TEXT(" \0")
  27. #define MAX_RES_STRING1 500
  28. // macros
  29. #define SAFERELEASE( pIObj ) \
  30. if ( pIObj != NULL ) \
  31. { \
  32. pIObj->Release(); \
  33. pIObj = NULL; \
  34. }
  35. #define FREESTRING( pStr ) \
  36. if ( pStr ) \
  37. { \
  38. FreeMemory( ( LPVOID * ) &( pStr ) ); \
  39. }
  40. #define ONFAILTHROWERROR(hResult) \
  41. if (FAILED(hResult)) \
  42. { \
  43. _com_issue_error(hResult); \
  44. }
  45. #define SAFEBSTRFREE(bstrVal) \
  46. if (bstrVal != NULL) \
  47. { \
  48. SysFreeString(bstrVal); \
  49. }
  50. // public function prototypes
  51. LPCTSTR
  52. ErrorString(
  53. HRESULT hRes
  54. );
  55. HRESULT
  56. PropertyGet(
  57. IWbemClassObject* pWmiObject,
  58. LPCTSTR szProperty,
  59. DWORD dwType,
  60. LPVOID pValue,
  61. DWORD dwSize
  62. );
  63. HRESULT
  64. PropertyPut(
  65. IWbemClassObject* pWmiObject,
  66. LPCTSTR szProperty,
  67. LPCTSTR szValue
  68. );
  69. HRESULT
  70. PropertyPut(
  71. IWbemClassObject* pWmiObject,
  72. LPCTSTR szProperty,
  73. DWORD dwValue
  74. );
  75. VOID
  76. ErrorLog(
  77. LPCTSTR lpErrString,
  78. LPWSTR lpTrigName,
  79. DWORD dwID
  80. );
  81. BOOL
  82. GetFormattedTime(
  83. LPTSTR lpDate
  84. );
  85. ITaskScheduler*
  86. GetTaskScheduler(
  87. );
  88. BOOL
  89. ProcessFilePath(
  90. LPTSTR szInput,
  91. LPTSTR szFirstString,
  92. LPTSTR szSecondString );
  93. #endif // __GENERAL_H