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.

102 lines
2.8 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation
  3. Module Name:
  4. Global.h
  5. Abstract:
  6. Contains function prototypes , structures and macros.
  7. Author:
  8. V Vijaya Bhaskar
  9. Revision History:
  10. 14-Jun-2001 : Created by V Vijaya Bhaskar ( Wipro Technologies ).
  11. --*/
  12. #ifndef __GLOBAL__H
  13. #define __GLOBAL__H
  14. #pragma once
  15. // Include .h files .
  16. #include "pch.h"
  17. #include "resource.h"
  18. #define EXTRA_MEM 10
  19. #define TAG_ERROR_DISPLAY GetResString( IDS_TAG_ERROR_DISPLAY )
  20. #define TAG_DISPLAY_WARNING GetResString( IDS_TAG_DISPLAY_WARNING )
  21. #define ERROR_DISPLAY_HELP GetResString( IDS_ERROR_DISPLAY_HELP )
  22. #define DOUBLE_QUOTES_TO_DISPLAY GetResString( IDS_DOUBLE_QUOTES )
  23. #define DISPLAY_GET_REASON() ShowMessageEx( stderr, 2, FALSE, L"%1 %2", \
  24. TAG_ERROR_DISPLAY, GetReason() )
  25. #define DISPLAY_MEMORY_ALLOC_FAIL() SetLastError( (DWORD) E_OUTOFMEMORY ); \
  26. SaveLastError(); \
  27. DISPLAY_GET_REASON(); \
  28. 1
  29. #define DISPLAY_INVALID_DATE() ShowMessageEx( stderr, 3, FALSE, L"%1 %2%3", \
  30. TAG_ERROR_DISPLAY, ERROR_INVALID_DATE, \
  31. ERROR_DISPLAY_HELP )
  32. // Free Memory Allocated Earlier , Afetr Freeing Assign Null To The Pointer .
  33. #define FREE_MEMORY( VARIABLE ) \
  34. FreeMemory( &( VARIABLE ) ) ; \
  35. 1
  36. #define ASSIGN_MEMORY( VARIABLE , TYPE , VALUE ) \
  37. if( NULL == ( VARIABLE ) ) \
  38. { \
  39. ( VARIABLE ) = ( TYPE * ) AllocateMemory( ( VALUE ) * sizeof( TYPE ) ) ; \
  40. } \
  41. else \
  42. { \
  43. FREE_MEMORY( VARIABLE ); \
  44. } \
  45. 1
  46. extern LPWSTR lpwszTempDummyPtr;
  47. #define REALLOC_MEMORY( VARIABLE , TYPE , VALUE ) \
  48. if( NULL == ( VARIABLE ) ) \
  49. { \
  50. ASSIGN_MEMORY( VARIABLE, TYPE, VALUE ); \
  51. } \
  52. else \
  53. { \
  54. if( FALSE == ReallocateMemory( &( VARIABLE ), ( VALUE ) * sizeof( TYPE ) ) ) \
  55. { \
  56. FREE_MEMORY( ( VARIABLE ) ); \
  57. } \
  58. } \
  59. 1
  60. typedef struct __STORE_PATH_NAME
  61. {
  62. LPTSTR pszDirName ;
  63. struct __STORE_PATH_NAME *NextNode ;
  64. } Store_Path_Name , *PStore_Path_Name ;
  65. LPWSTR
  66. FindAChar(
  67. IN LPWSTR szString,
  68. IN WCHAR wCharToFind
  69. );
  70. LPWSTR
  71. FindSubString(
  72. IN LPWSTR szString,
  73. IN LPWSTR szSubString
  74. );
  75. #endif //__GLOBAL__H