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.

144 lines
3.9 KiB

  1. //-------------------------------------------------------------------------
  2. //
  3. // File: Headers.hxx
  4. //
  5. // Contents: This has all the macros that are necessary for the Klass code
  6. // including the DEBUG macros etc. Some declarations for SmartPs.
  7. //
  8. // History: 05-10-1993 SudK Created.
  9. // 11-29-1993 SudK Cleanup for CR changes.
  10. //
  11. //-------------------------------------------------------------------------
  12. #ifndef _DFS_HEADER_HXX_DEFINED
  13. #define _DFS_HEADER_HXX_DEFINED
  14. extern "C" {
  15. #include <ntos.h>
  16. }
  17. #include <ntrtl.h>
  18. #include <nturtl.h>
  19. #include <tdi.h>
  20. #include <windows.h>
  21. #include <ole2.h>
  22. #include "lm.h"
  23. #include "lmdfs.h"
  24. #include "lmerrext.h"
  25. #include "netdfs.h"
  26. #include "dfspriv.h"
  27. #include "dfserr.h"
  28. #include "dfsmerr.h"
  29. #include "dfsstr.h"
  30. #include "nodetype.h"
  31. #include "dfsmrshl.h"
  32. #include "upkt.h"
  33. #include "dfsm.hxx"
  34. #include "cref.hxx"
  35. #include "cstorage.hxx"
  36. #include "cregstor.hxx"
  37. #include "cldpstor.hxx"
  38. #include "message.hxx"
  39. #include "csites.hxx"
  40. extern "C" {
  41. #include "recover.hxx"
  42. }
  43. //
  44. // Handy macro for printing out errors to the debugger
  45. //
  46. #if DBG
  47. #define CHECK_RESULT(dwErr) \
  48. if (dwErr != ERROR_SUCCESS) \
  49. IDfsVolInlineDebOut( \
  50. (DEB_ERROR, \
  51. "ERROR RETURN <%s @line %d> -> %08lx\n", \
  52. __FILE__, __LINE__, dwErr));
  53. #else
  54. #define CHECK_RESULT(dwErr)
  55. #endif
  56. //
  57. // Some global data. These will be initialized at service startup time, and
  58. // then left unmodified.
  59. //
  60. #define VOL_OBJ_VERSION_NUMBER 0x03
  61. extern CRITICAL_SECTION globalCritSec;
  62. extern ULONG GTimeout;
  63. #define ENTER_DFSM_OPERATION \
  64. EnterCriticalSection(&globalCritSec);
  65. #define EXIT_DFSM_OPERATION \
  66. LeaveCriticalSection(&globalCritSec);
  67. extern ULONG ulDfsManagerType;
  68. extern LPWSTR pwszDomainName;
  69. extern LPWSTR pwszComputerName;
  70. extern LPWSTR pwszDfsRootName;
  71. extern ULONG cbOpenIfJPEa;
  72. extern LPWSTR pwszLocalDomainDS;
  73. extern PFILE_FULL_EA_INFORMATION pOpenIfJPEa;
  74. extern CStorageDirectory *pDfsmStorageDirectory;
  75. extern CSites *pDfsmSites;
  76. extern LPWSTR pwszDSMachineName;
  77. extern WCHAR wszDSMachineName[];
  78. extern LPWSTR gConfigurationDN;
  79. extern WCHAR DfsConfigContainer[];
  80. extern "C" {
  81. extern ULONG DfsSvcVerbose;
  82. extern ULONG DfsSvcLdap;
  83. extern ULONG DfsEventLog;
  84. extern ULONG DfsDnsConfig;
  85. }
  86. //
  87. // Following are the recovery states that can be associated with the
  88. // volumes. These are only the operations that can be in progress i.e. the
  89. // first part of the recovery state. The exact stage of operations are
  90. // denoted by the states below this.
  91. //
  92. #define DFS_RECOVERY_STATE_NONE (0x0000)
  93. #define DFS_RECOVERY_STATE_CREATING (0x0001)
  94. #define DFS_RECOVERY_STATE_ADD_SERVICE (0x0002)
  95. #define DFS_RECOVERY_STATE_REMOVE_SERVICE (0x0003)
  96. #define DFS_RECOVERY_STATE_DELETE (0x0004)
  97. #define DFS_RECOVERY_STATE_MOVE (0x0005)
  98. typedef enum _DFS_RECOVERY_STATE {
  99. DFS_OPER_STAGE_START=1,
  100. DFS_OPER_STAGE_SVCLIST_UPDATED=2,
  101. DFS_OPER_STAGE_INFORMED_SERVICE=3,
  102. DFS_OPER_STAGE_INFORMED_PARENT=4
  103. } DFS_RECOVERY_STATE;
  104. //
  105. // Some MACROS to help in manipulating state and stage of VOL_RECOVERY_STATE.
  106. //
  107. #define DFS_COMPOSE_RECOVERY_STATE(op, s) ((op<<16)|(s))
  108. #define DFS_SET_RECOVERY_STATE(State, s) ((State&0xffff)|(s<<16))
  109. #define DFS_SET_OPER_STAGE(State, s) ((State&0xffff0000)|s)
  110. #define DFS_GET_RECOVERY_STATE(s) ((s & 0xffff0000) >> 16)
  111. #define DFS_GET_OPER_STAGE(s) (s & 0xffff)
  112. #define LPWSTR_TO_OFFSET(f,b) \
  113. (f) = (WCHAR *)((PCHAR)(f) - (ULONG_PTR)(b))
  114. #endif // _DFS_HEADER_HXX_DEFINED