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.

68 lines
2.2 KiB

  1. /*************************************************************************
  2. * objrules.h
  3. *
  4. * Defines and function declarations for Object Rule caching
  5. *
  6. * copyright notice: Copyright 1997, Citrix Systems Inc.
  7. * Copyright (C) 1997-1999 Microsoft Corp.
  8. *************************************************************************/
  9. #include <winsta.h>
  10. #include <syslib.h>
  11. #include <regapi.h>
  12. // Registry keys under application compatibility section
  13. // (CITRIX_COMPAT_APP)\\<appname>
  14. #define TERMSRV_COMPAT_OBJRULES REG_OBJRULES
  15. #define TERMSRV_COMPAT_DLLRULES REG_DLLRULES
  16. // Registry values under ObjectRules and DllRules
  17. #define USER_GLOBAL_SEMAPHORES COMPAT_RULES_USER_GLOBAL_SEMAPHORES
  18. #define USER_GLOBAL_EVENTS COMPAT_RULES_USER_GLOBAL_EVENTS
  19. #define USER_GLOBAL_MUTEXES COMPAT_RULES_USER_GLOBAL_MUTEXES
  20. #define USER_GLOBAL_SECTIONS COMPAT_RULES_USER_GLOBAL_SECTIONS
  21. #define SYSTEM_GLOBAL_SEMAPHORES COMPAT_RULES_SYSTEM_GLOBAL_SEMAPHORES
  22. #define SYSTEM_GLOBAL_EVENTS COMPAT_RULES_SYSTEM_GLOBAL_EVENTS
  23. #define SYSTEM_GLOBAL_MUTEXES COMPAT_RULES_SYSTEM_GLOBAL_MUTEXES
  24. #define SYSTEM_GLOBAL_SECTIONS COMPAT_RULES_SYSTEM_GLOBAL_SECTIONS
  25. // Object Rule Structure
  26. typedef struct ObjRule {
  27. struct ObjRule *Next;
  28. BOOL WildCard;
  29. ULONG MatchLen; // Wildcard match length
  30. BOOL SystemGlobal; // If TRUE, object is system global, otherwise USER_GLOBAL
  31. WCHAR ObjName[1];
  32. } OBJRULE, *POBJRULE;
  33. typedef struct ObjRuleList {
  34. POBJRULE First;
  35. POBJRULE Last;
  36. } OBJRULELIST, *POBJRULELIST;
  37. typedef struct RuleInitEntry {
  38. POBJRULELIST ObjRuleList;
  39. PWCHAR UserGlobalValue;
  40. PWCHAR SystemGlobalValue;
  41. } RULEINITENTRY, *PRULEINITENTRY;
  42. extern OBJRULELIST SemaRuleList;
  43. extern OBJRULELIST MutexRuleList;
  44. extern OBJRULELIST SectionRuleList;
  45. extern OBJRULELIST EventRuleList;
  46. extern void CtxLookupObjectRule(POBJRULELIST,LPCWSTR,LPWSTR);
  47. extern void CtxInitObjRuleCache(void);
  48. // Macro used by object creation APIs
  49. #define LookupObjRule(RuleList,ObjName,ObjNameExt) \
  50. { \
  51. if ((RuleList)->First) { \
  52. CtxLookupObjectRule(RuleList,ObjName,ObjNameExt); \
  53. } \
  54. }