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.

142 lines
3.3 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. HookCmmn.h
  5. Abstract:
  6. This module defines the routines that are in common between the win9x and nt hooks.
  7. Author:
  8. JoeLinn [JoeLinn] 8-Apr-1997
  9. Revision History:
  10. --*/
  11. #ifndef __INCLUDED__CSC__HOOKCMMN__
  12. #define __INCLUDED__CSC__HOOKCMMN__
  13. extern ULONG hthreadReint; //BUGBUG why should a thread be a ULONG????
  14. extern ULONG hwndReint;
  15. extern PFILEINFO pFileInfoAgent;
  16. extern HSERVER hShareReint; // Share that is currently being reintegrated
  17. extern int fShadow, fLog, fNoShadow, /*fShadowFind,*/ fSpeadOpt;
  18. extern WIN32_FIND_DATA vsFind32;
  19. extern int cMacPro;
  20. extern NETPRO rgNetPro[];
  21. extern VMM_SEMAPHORE semHook;
  22. extern GLOBALSTATUS sGS;
  23. extern ULONG proidShadow;
  24. extern ULONG heventReint;
  25. #define FLAG_FDB_SERIALIZE 0x0001
  26. #define FLAG_FDB_INUSE_BY_AGENT 0x0002
  27. #define FLAG_FDB_SHADOW_MODIFIED 0x0008
  28. #define FLAG_FDB_DONT_SHADOW 0x0010
  29. #define FLAG_FDB_FINAL_CLOSE_DONE 0x0020
  30. int ReinitializeDatabase(
  31. LPSTR lpszLocation,
  32. LPSTR lpszUserName,
  33. DWORD nFileSizeHigh,
  34. DWORD nFileSizeLow,
  35. DWORD dwClusterSize
  36. );
  37. int
  38. InitDatabase(
  39. LPSTR lpszLocation,
  40. LPSTR lpszUserName,
  41. DWORD nFileSizeHigh,
  42. DWORD nFileSizeLow,
  43. DWORD dwClusterSize,
  44. BOOL fReformat,
  45. BOOL *lpfNew
  46. );
  47. BOOL IsShadowVisible(
  48. #ifndef MRXSMB_BUILD_FOR_CSC_DCON
  49. PVOID pResource, //PRESOURCE pResource,
  50. #else
  51. BOOLEAN Disconnected,
  52. #endif
  53. DWORD dwAttr,
  54. ULONG uShadowStatus
  55. );
  56. int MarkShareDirty(
  57. PUSHORT ShareStatus,
  58. ULONG hShare
  59. );
  60. ////////////////////////////////////////////////////////////////////////////////
  61. ///////// T U N N E L
  62. // Timeout in seconds for tunnelled entries
  63. // after this many seconds a tunnelled entry is thrown away
  64. #define STALE_TUNNEL_INFO 45
  65. typedef struct tagSH_TUNNEL {
  66. HSHADOW hDir;
  67. ULONG uTime;
  68. UCHAR ubHintFlags;
  69. UCHAR ubRefPri;
  70. UCHAR ubHintPri;
  71. UCHAR ubIHPri;
  72. USHORT cAlternateFileName[14];
  73. USHORT * lpcFileName;
  74. } SH_TUNNEL, *LPSH_TUNNEL;
  75. BOOL InsertTunnelInfo(
  76. HSHADOW hDir,
  77. USHORT *lpcFileName,
  78. USHORT *lpcAlternateFileName,
  79. LPOTHERINFO lpOI
  80. );
  81. #ifndef MRXSMB_BUILD_FOR_CSC_DCON
  82. BOOL RetrieveTunnelInfo(
  83. #else
  84. typedef enum _RETRIEVE_TUNNEL_INFO_RETURNS {
  85. TUNNEL_RET_NOTFOUND = 0,
  86. TUNNEL_RET_SHORTNAME_TUNNEL = 'S',
  87. TUNNEL_RET_LONGNAME_TUNNEL = 'L'
  88. } RETRIEVE_TUNNEL_INFO_RETURNS;
  89. RETRIEVE_TUNNEL_INFO_RETURNS RetrieveTunnelInfo(
  90. #endif
  91. HSHADOW hDir,
  92. USHORT *lpcFileName,
  93. WIN32_FIND_DATA *lpFind32,
  94. LPOTHERINFO lpOI
  95. );
  96. VOID FreeStaleEntries();
  97. void FreeEntry(LPSH_TUNNEL lpshTunnel);
  98. BOOL
  99. FailModificationsToShare(
  100. LPSHADOWINFO lpSI
  101. );
  102. void
  103. IncrementActivityCountForShare(
  104. HSERVER hShare
  105. );
  106. BOOL
  107. CSCFailUserOperation(
  108. HSERVER hShare
  109. );
  110. // Macro used to check whether shadowing operations should be done or not
  111. // in any given filesystem API call. The global swicth fShadow can be set/reset
  112. // by ring3 agent through an ioctl
  113. #define ShadowingON() ((fShadow != 0) && !IsSpecialApp())
  114. #endif //ifndef __INCLUDED__CSC__HOOKCMMN__