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.

111 lines
3.8 KiB

  1. /*************************************************************************
  2. *
  3. * compatfl.h
  4. *
  5. * Function declarations for Citrix application compatibility flags
  6. *
  7. * copyright notice: Microsoft 1998
  8. *
  9. *
  10. *************************************************************************/
  11. #ifndef _COMPATFLH_
  12. #define _COMPATFLH_
  13. #include <winsta.h>
  14. #include <syslib.h>
  15. #include <regapi.h>
  16. //
  17. // Default limit for physical memory returned by GLobalMemoryStatus
  18. // when physical memory limit is set in the compatibility flags.
  19. //
  20. #define TERMSRV_COMPAT_DEFAULT_PHYSMEMLIM (32*1024*1024)
  21. // Private Compatibility flags to indicate if flags in TEB are valid
  22. // Other flags values are in syslib.h
  23. #define TERMSRV_COMPAT_BADAPPVALID \
  24. 0x40000000 // Bad app flags in Teb are valid
  25. #define TERMSRV_COMPAT_TEBVALID \
  26. 0x80000000 // Compat flags in Teb are valid
  27. #define TERMSRV_COMPAT NTAPI_COMPAT_REG_NAME
  28. #define TERMSRV_COMPAT_APP NTAPI_COMPAT_APPS_REG_PREFIX
  29. #define TERMSRV_COMPAT_DLLS NTAPI_COMPAT_DLLS_REG_PREFIX
  30. #define TERMSRV_COMPAT_INIFILE NTAPI_COMPAT_INI_REG_NAME
  31. #define TERMSRV_COMPAT_REGENTRY NTAPI_COMPAT_REGENTRY_REG_NAME
  32. #define TERMSRV_INIFILE_TIMES NTAPI_INIFILE_TIMES_REG_NAME
  33. #define USER_SOFTWARE_TERMSRV REG_SOFTWARE_TSERVER
  34. #define TERMSRV_REG_CONTROL_NAME REG_NTAPI_CONTROL_TSERVER
  35. #define TERMSRV_CROSS_WINSTATION_DEBUG REG_CITRIX_CROSSWINSTATIONDEBUG
  36. #define TERMSRV_USER_SYNCTIME COMPAT_USER_LASTUSERINISYNCTIME
  37. #define TERMSRV_PHYSMEMLIM COMPAT_PHYSICALMEMORYLIMIT
  38. #define TERMSRV_INIFILE_TIMES_SHORT L"\\" REG_INSTALL L"\\" REG_INIFILETIMES
  39. #define TERMSRV_INSTALL_SOFTWARE_SHORT L"\\" REG_INSTALL L"\\Software"
  40. // Define the file information class values
  41. //
  42. // WARNING: The order of the following values are assumed by the I/O system.
  43. // Any changes made here should be reflected there as well.
  44. //
  45. typedef struct _BADAPP {
  46. ULONG BadAppFlags;
  47. ULONG BadAppFirstCount;
  48. ULONG BadAppNthCount;
  49. LARGE_INTEGER BadAppTimeDelay;
  50. } BADAPP, *PBADAPP;
  51. typedef struct _BADCLPBRDAPP {
  52. ULONG BadClpbrdAppFlags;
  53. ULONG BadClpbrdAppEmptyRetries;
  54. ULONG BadClpbrdAppEmptyDelay;
  55. } BADCLPBRDAPP, *PBADCLPBRDAPP;
  56. ULONG GetTermsrCompatFlags(LPWSTR, LPDWORD, TERMSRV_COMPATIBILITY_CLASS);
  57. ULONG GetTermsrCompatFlagsEx(LPWSTR, LPDWORD, TERMSRV_COMPATIBILITY_CLASS);
  58. ULONG GetCtxAppCompatFlags(LPDWORD, LPDWORD);
  59. ULONG GetCtxPhysMemoryLimits(LPDWORD, LPDWORD);
  60. BOOL CtxGetBadAppFlags(LPWSTR, PBADAPP);
  61. BOOL CtxGetBadClpbrdAppFlags(PBADCLPBRDAPP);
  62. BOOL CtxGetModuleBadClpbrdAppFlags(LPWSTR, PBADCLPBRDAPP);
  63. BOOL GetAppTypeAndModName(LPDWORD, PWCHAR, ULONG);
  64. // Defines for compatibility flag caching in kernel32.dll
  65. extern ULONG CompatFlags;
  66. extern BOOL CompatGotFlags;
  67. extern DWORD CompatAppType;
  68. extern void CtxLogObjectCreate(PUNICODE_STRING, PCHAR, PVOID);
  69. #define CacheCompatFlags \
  70. { \
  71. if (!CompatGotFlags ) { \
  72. GetCtxAppCompatFlags(&CompatFlags, &CompatAppType); \
  73. CompatGotFlags = TRUE; \
  74. } \
  75. }
  76. #define LogObjectCreation(ObjName,ObjType,RetAddr) \
  77. { \
  78. CacheCompatFlags \
  79. if (CompatFlags & TERMSRV_COMPAT_LOGOBJCREATE) { \
  80. CtxLogObjectCreate(ObjName,ObjType,RetAddr); \
  81. } \
  82. }
  83. // Environment variable for object creation log file
  84. #define OBJ_LOG_PATH_VAR L"TERMSRV_COMPAT_LOGPATH"
  85. #define DEBUG_IAT 0x80000000 // use the registry to set value of "IAT" to 0x8000000 for debug output.
  86. // value of the optional debug IAT flag read from the registry.
  87. // Currently, only 0x1 and 0x8000000 have meaning, the first disables
  88. // calls to LoabLib, and the 2nd enables debug output.
  89. #endif