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.

117 lines
3.5 KiB

  1. /****************************************************************************/
  2. // Jet-Based Session Directory and Integrity Service, header file
  3. //
  4. // Copyright (C) 2000, Microsoft Corporation
  5. /****************************************************************************/
  6. #include <windows.h>
  7. #include <stdio.h>
  8. #include <esent.h>
  9. #include <stdarg.h>
  10. #include <clusapi.h>
  11. #include <resapi.h>
  12. #include <winioctl.h>
  13. #include <basetsd.h>
  14. #define NUM_SESSDIRCOLUMNS 14
  15. #define NUM_SERVDIRCOLUMNS 7
  16. #define NUM_CLUSDIRCOLUMNS 3
  17. #define JETDISMAXSESSIONS 256
  18. #define TSSD_MaxDisconnectedSessions 10
  19. // NOTE: Change these both at the same time. Also, if you change these,
  20. // change the following two.
  21. #define JETDISDBDIRECTORY ".\\tssesdir\\"
  22. #define JETDISDBDIRECTORYW L".\\tssesdir\\"
  23. // NOTE: Change these both at the same time.
  24. #define JETDBFILENAME ".\\tssesdir\\tssesdir.edb"
  25. #define JETDBFILENAMEW L".\\tssesdir\\tssesdir.edb"
  26. // Auxiliary JET files for deletion when starting clean
  27. #define JETAUXFILENAME1W L".\\tssesdir\\edb.chk"
  28. #define JETAUXFILENAME2W L".\\tssesdir\\edb.log"
  29. #define JETAUXFILENAME3W L".\\tssesdir\\res1.log"
  30. #define JETAUXFILENAME4W L".\\tssesdir\\res2.log"
  31. #define JETAUXFILENAME5W L".\\tssesdir\\tmp.edb"
  32. #define JETAUXFILENAME6W L".\\tssesdir\\edbtmp.log"
  33. // "edbxxxxx.log" (with null terminator) is 13, but we also need the directory
  34. // name.
  35. #define MAX_LOGFILE_LENGTH 256
  36. #define MAX_DEBUG_STRING_LENGTH 256
  37. // "4294967295: " (no null required)
  38. #define MAX_THREADIDSTR_LENGTH 12
  39. #define MAX_DATE_TIME_STRING_LENGTH 64
  40. #define CALL(x) { \
  41. err = x; \
  42. if (err != JET_errSuccess) { \
  43. TSDISErrorOut(L"TSSDIS: Jet error %d, line %d, file %S\n", err, __LINE__, \
  44. __FILE__); \
  45. goto HandleError; \
  46. } \
  47. }
  48. typedef struct _DIRCOLUMNS {
  49. char *szColumnName;
  50. JET_COLTYP coltyp;
  51. int colMaxLen;
  52. } DIRCOLUMNS;
  53. extern const DIRCOLUMNS SessionDirectoryColumns[];
  54. extern const DIRCOLUMNS ServerDirectoryColumns[];
  55. extern const DIRCOLUMNS ClusterDirectoryColumns[];
  56. extern JET_COLUMNID sesdircolumnid[];
  57. extern JET_COLUMNID servdircolumnid[];
  58. extern JET_COLUMNID clusdircolumnid[];
  59. extern JET_INSTANCE g_instance;
  60. #define SESSDIR_USERNAME_INTERNAL_INDEX 0
  61. #define SESSDIR_DOMAIN_INTERNAL_INDEX 1
  62. #define SESSDIR_SERVERID_INTERNAL_INDEX 2
  63. #define SESSDIR_SESSIONID_INTERNAL_INDEX 3
  64. #define SESSDIR_TSPROTOCOL_INTERNAL_INDEX 4
  65. #define SESSDIR_CTLOW_INTERNAL_INDEX 5
  66. #define SESSDIR_CTHIGH_INTERNAL_INDEX 6
  67. #define SESSDIR_DTLOW_INTERNAL_INDEX 7
  68. #define SESSDIR_DTHIGH_INTERNAL_INDEX 8
  69. #define SESSDIR_APPTYPE_INTERNAL_INDEX 9
  70. #define SESSDIR_RESWIDTH_INTERNAL_INDEX 10
  71. #define SESSDIR_RESHEIGHT_INTERNAL_INDEX 11
  72. #define SESSDIR_COLORDEPTH_INTERNAL_INDEX 12
  73. #define SESSDIR_STATE_INTERNAL_INDEX 13
  74. #define SERVDIR_SERVID_INTERNAL_INDEX 0
  75. #define SERVDIR_SERVADDR_INTERNAL_INDEX 1
  76. #define SERVDIR_CLUSID_INTERNAL_INDEX 2
  77. #define SERVDIR_AITLOW_INTERNAL_INDEX 3
  78. #define SERVDIR_AITHIGH_INTERNAL_INDEX 4
  79. #define SERVDIR_NUMFAILPINGS_INTERNAL_INDEX 5
  80. #define SERVDIR_SINGLESESS_INTERNAL_INDEX 6
  81. #define CLUSDIR_CLUSID_INTERNAL_INDEX 0
  82. #define CLUSDIR_CLUSNAME_INTERNAL_INDEX 1
  83. #define CLUSDIR_SINGLESESS_INTERNAL_INDEX 2
  84. void TSDISErrorOut(wchar_t *format_string, ...);
  85. void TSDISErrorTimeOut(wchar_t *format_string, DWORD TimeLow, DWORD TimeHigh);
  86. DWORD TSSDPurgeServer(DWORD ServerID);
  87. BOOL TSSDVerifyServerIDValid(JET_SESID sesid, JET_TABLEID servdirtableid,
  88. DWORD ServerID);
  89. DWORD TSSDSetServerAITInternal(WCHAR *ServerAddress, DWORD bResetToZero, DWORD
  90. *FailureCount);