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.

161 lines
4.3 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1999
  6. //
  7. // File: pch.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #ifndef _PCH_H_
  11. #define _PCH_H_
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. #include <nt.h>
  16. #include <ntrtl.h>
  17. #include <nturtl.h>
  18. #ifdef __cplusplus
  19. } // end of extern "C"
  20. #endif
  21. #include <windows.h>
  22. #include <windowsx.h>
  23. #include <shellapi.h>
  24. #include <shlobj.h>
  25. #include <shlobjp.h> // SHFree
  26. #include <shlwapi.h>
  27. #include <shlwapip.h> // QITAB, QISearch
  28. #include <systrayp.h> // STWM_ENABLESERVICE, etc.
  29. #include <ccstock.h>
  30. #include <commctrl.h>
  31. #include <comctrlp.h>
  32. #include <cscapi.h>
  33. #include <mobsync.h> // OneStop/SyncMgr interfaces
  34. #include <emptyvc.h> // Memphis disk cleanup interface
  35. #include <resource.h> // resource IDs
  36. #include <cscuiext.h>
  37. #include <ras.h>
  38. #include <rasdlg.h>
  39. #include <raserror.h>
  40. #include <strsafe.h>
  41. #ifndef FLAG_CSC_SHARE_STATUS_PINNED_OFFLINE
  42. //
  43. // NTRAID#NTBUG9-350509-2001/04/11-brianau
  44. //
  45. // JHarper defined this new flag in shdcom.h but I don't think he's
  46. // yet added it to cscapi.h.
  47. //
  48. # define FLAG_CSC_SHARE_STATUS_PINNED_OFFLINE 0x2000
  49. #endif
  50. #ifndef FLAG_CSC_HINT_PIN_ADMIN
  51. // This should be defined in cscapi.h, but since
  52. // Remote Boot has been cancelled, use the system hint flag.
  53. #define FLAG_CSC_HINT_PIN_ADMIN FLAG_CSC_HINT_PIN_SYSTEM
  54. #endif
  55. #ifndef ARRAYSIZE
  56. #define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
  57. #endif
  58. //
  59. // Convert a value to a "bool".
  60. // Lower-case "boolify" is intentional to enforce relationship
  61. // to type "bool".
  62. //
  63. template <class T>
  64. inline bool boolify(const T& x)
  65. {
  66. return !!x;
  67. }
  68. //
  69. // Global function prototypes
  70. //
  71. STDAPI_(void) DllAddRef(void);
  72. STDAPI_(void) DllRelease(void);
  73. #include "debug.h"
  74. #include "cscentry.h"
  75. #include "uuid.h" // GUIDs
  76. #include "util.h"
  77. #include "filelist.h" // CscFileNameList, PCSC_NAMELIST_HDR
  78. #include "shellex.h"
  79. #include "update.h"
  80. #include "volclean.h"
  81. #include "config.h"
  82. //
  83. // Global variables
  84. //
  85. extern LONG g_cRefCount;
  86. extern HINSTANCE g_hInstance;
  87. extern CLIPFORMAT g_cfShellIDList;
  88. extern HANDLE g_heventTerminate;
  89. extern HANDLE g_hmutexAdminPin;
  90. //
  91. // Magic debug flags
  92. //
  93. #define TRACE_UTIL 0x00000001
  94. #define TRACE_SHELLEX 0x00000002
  95. #define TRACE_UPDATE 0x00000004
  96. #define TRACE_VOLFREE 0x00000008
  97. #define TRACE_CSCST 0x00000080
  98. #define TRACE_CSCENTRY 0x00000100
  99. #define TRACE_ADMINPIN 0x00000200
  100. #define TRACE_COMMON_ASSERT 0x40000000
  101. /*-----------------------------------------------------------------------------
  102. / Exit macros
  103. / - these assume that a label "exit_gracefully:" prefixes the epilog
  104. / to your function
  105. /----------------------------------------------------------------------------*/
  106. #define ExitGracefully(hr, result, text) \
  107. { TraceMsg(text); hr = result; goto exit_gracefully; }
  108. #define FailGracefully(hr, text) \
  109. { if ( FAILED(hr) ) { TraceMsg(text); goto exit_gracefully; } }
  110. /*-----------------------------------------------------------------------------
  111. / Interface helper macros
  112. /----------------------------------------------------------------------------*/
  113. #define DoRelease(pInterface) \
  114. { if ( pInterface ) { pInterface->Release(); pInterface = NULL; } }
  115. /*-----------------------------------------------------------------------------
  116. / String helper macros
  117. /----------------------------------------------------------------------------*/
  118. #define StringByteSize(sz) \
  119. ((lstrlen(sz)+1)*sizeof(TCHAR))
  120. /*-----------------------------------------------------------------------------
  121. / Other helpful macros
  122. /----------------------------------------------------------------------------*/
  123. #define ByteOffset(base, offset) \
  124. (((LPBYTE)base)+offset)
  125. //
  126. // This is from shell32. From the comments in browseui
  127. // this value will not change.
  128. //
  129. #define FCIDM_REFRESH 0xA220
  130. #define MAX_PATH_BYTES (MAX_PATH * sizeof(TCHAR))
  131. #endif // _PCH_H_