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.

186 lines
4.4 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. ntcsc.h
  5. Abstract:
  6. The global include file including the csc record manager
  7. Author:
  8. Revision History:
  9. --*/
  10. #ifndef __NTCSC_H__
  11. #define __NTCSC_H__
  12. //#include "ntifs.h"
  13. #include "rx.h"
  14. //if this is included from smbmini, we'll need this
  15. #include "rxpooltg.h" // RX pool tag macros
  16. #define WIN32_NO_STATUS
  17. #define _WINNT_
  18. #include "windef.h"
  19. #include "winerror.h"
  20. //both ntifs.h and ifs.h want to define these....sigh.......
  21. #undef STATUS_PENDING
  22. #undef FILE_ATTRIBUTE_READONLY
  23. #undef FILE_ATTRIBUTE_HIDDEN
  24. #undef FILE_ATTRIBUTE_SYSTEM
  25. #undef FILE_ATTRIBUTE_DIRECTORY
  26. #undef FILE_ATTRIBUTE_ARCHIVE
  27. #include "ifs.h"
  28. #define VxD
  29. #define CSC_RECORDMANAGER_WINNT
  30. #define CSC_ON_NT
  31. // get rid of far references
  32. #define far
  33. //handle types
  34. typedef ULONG DWORD;
  35. // the VxD code likes to declare long pointers.....
  36. typedef PVOID LPVOID;
  37. typedef BYTE *LPBYTE;
  38. //semaphore stuff....should be in a separate .h file
  39. typedef PFAST_MUTEX VMM_SEMAPHORE;
  40. INLINE
  41. PFAST_MUTEX
  42. Create_Semaphore (
  43. ULONG count
  44. )
  45. {
  46. PFAST_MUTEX fmutex;
  47. ASSERT(count==1);
  48. fmutex = (PFAST_MUTEX)RxAllocatePoolWithTag(
  49. NonPagedPool,
  50. sizeof(FAST_MUTEX),
  51. RX_MISC_POOLTAG);
  52. if (fmutex){
  53. ExInitializeFastMutex(fmutex);
  54. }
  55. //DbgPrint("fmtux=%08lx\n",fmutex);
  56. //ASSERT(!"here in init semaphore");
  57. return fmutex;
  58. }
  59. #define Destroy_Semaphore(__sem) { RxFreePool(__sem);}
  60. //Bug 498169 - changing to unsafe version of acquire and release mutex - navjotv
  61. #define Wait_Semaphore(__sem, DUMMY___) {\
  62. KeEnterCriticalRegion();\
  63. ExAcquireFastMutexUnsafe(__sem);}
  64. #define Signal_Semaphore(__sem) {\
  65. ExReleaseFastMutexUnsafe(__sem);\
  66. KeLeaveCriticalRegion();}
  67. //#define Wait_Semaphore(__sem, DUMMY___) { ExAcquireFastMutex(__sem);}
  68. //#define Signal_Semaphore(__sem) { ExReleaseFastMutex(__sem);}
  69. //registry stuff.........again, will be a separate .h file
  70. typedef DWORD VMMHKEY;
  71. typedef VMMHKEY *PVMMHKEY;
  72. typedef DWORD VMMREGRET; // return type for the REG Functions
  73. #define MAX_VMM_REG_KEY_LEN 256 // includes the \0 terminator
  74. #ifndef REG_SZ // define only if not there already
  75. #define REG_SZ 0x0001
  76. #endif
  77. #ifndef REG_BINARY // define only if not there already
  78. #define REG_BINARY 0x0003
  79. #endif
  80. #ifndef REG_DWORD // define only if not there already
  81. #define REG_DWORD 0x0004
  82. #endif
  83. #ifndef HKEY_LOCAL_MACHINE // define only if not there already
  84. #define HKEY_CLASSES_ROOT 0x80000000
  85. #define HKEY_CURRENT_USER 0x80000001
  86. #define HKEY_LOCAL_MACHINE 0x80000002
  87. #define HKEY_USERS 0x80000003
  88. #define HKEY_PERFORMANCE_DATA 0x80000004
  89. #define HKEY_CURRENT_CONFIG 0x80000005
  90. #define HKEY_DYN_DATA 0x80000006
  91. #endif
  92. //initially, we won't go to the registry!
  93. #define _RegOpenKey(a,b,c) (ERROR_SUCCESS+1)
  94. #define _RegQueryValueEx(a,b,c,d,e,f) (ERROR_SUCCESS+1)
  95. #define _RegCloseKey(a) {NOTHING; }
  96. // fix up the fact that stuff is conditioned on DEBUG and various...
  97. #if DBG
  98. #define DEBLEVEL 2
  99. #define DEBUG
  100. #else
  101. #define DEBLEVEL 2
  102. #endif
  103. #define VERBOSE 3
  104. // now the real includes
  105. #define WIN32_APIS
  106. #define UNICODE 2
  107. #include "shdcom.h"
  108. #include "oslayer.h"
  109. #include "record.h"
  110. #include "cshadow.h"
  111. #include "utils.h"
  112. #include "hookcmmn.h"
  113. #include "cscsec.h"
  114. #include "log.h"
  115. #include "ntcsclow.h"
  116. //we have to redefine status_pending since the win95 stuff redefines it.......
  117. #undef STATUS_PENDING
  118. #define STATUS_PENDING ((NTSTATUS)0x00000103L) // winnt
  119. ULONG
  120. IFSMgr_Get_NetTime();
  121. #ifndef MRXSMB_BUILD_FOR_CSC_DCON
  122. //define these to passivate so that i can share some code......
  123. #undef mIsDisconnected
  124. #define mIsDisconnected(pResource) (FALSE)
  125. //#define mShadowOutofSync(uShadowStatus) (mQueryBits(uShadowStatus, SHADOW_MODFLAGS|SHADOW_ORPHAN))
  126. #undef mShadowOutofSync
  127. #define mShadowOutofSync(uShadowStatus) (FALSE)
  128. #else
  129. //dont allow mIsDisconnected anymore in common code
  130. #undef mIsDisconnected
  131. #define mIsDisconnected(pResource) (LALA)
  132. #define mShadowOutofSync(uShadowStatus) (mQueryBits(uShadowStatus, SHADOW_MODFLAGS|SHADOW_ORPHAN))
  133. #endif
  134. #endif //ifdef __NTCSC_H__