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.

82 lines
2.0 KiB

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