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.

196 lines
5.3 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name :
  4. tables.h
  5. Abstract:
  6. mapping tables to convert various info between text and binary
  7. Environment:
  8. Win32 User Mode
  9. Author:
  10. jaroslad (jan 1997)
  11. --*/
  12. #if !defined (__JD_TABLES_H)
  13. #define __JD_TABLES_H
  14. #include <afx.h>
  15. #ifdef UNICODE
  16. #include <iadmw.h>
  17. #else
  18. #include "ansimeta.h"
  19. #endif
  20. //constanst to be returned by functions that map name to code
  21. //
  22. #define NAME_NOT_FOUND 0xFFFFFFFE
  23. BOOL IsNumber(const CString& name);
  24. BOOL IsServiceName(const CString& name);
  25. //**********************************************************************
  26. // PROPERTY NAME TABLE DEFINITION
  27. //**********************************************************************
  28. struct tPropertyNameTable;
  29. tPropertyNameTable gPropertyNameTable[];
  30. struct tPropertyNameTable
  31. {
  32. DWORD dwCode;
  33. LPCTSTR lpszName;
  34. DWORD dwDefAttributes; //default attributes (metadata compatible)
  35. DWORD dwDefUserType; //default user type (metadata compatible)
  36. DWORD dwDefDataType; //default data type (metadata compatible)
  37. DWORD dwFlags; //internal flags (nothing to do with metadata)
  38. static tPropertyNameTable * FindRecord(DWORD dwCode, tPropertyNameTable * PropertyNameTable=::gPropertyNameTable);
  39. static tPropertyNameTable * FindRecord(const CString strName, tPropertyNameTable * PropertyNameTable=::gPropertyNameTable);
  40. static DWORD MapNameToCode(const CString& strName, tPropertyNameTable * PropertyNameTable=::gPropertyNameTable);
  41. static CString MapCodeToName(DWORD dwCode, tPropertyNameTable * PropertyNameTable=::gPropertyNameTable);
  42. };
  43. DWORD MapPropertyNameToCode(const CString & strName);
  44. //**********************************************************************
  45. // VALUE TABLE DEFINITION
  46. //**********************************************************************
  47. struct tValueTable ;
  48. tValueTable gValueTable[];
  49. struct tValueTable
  50. {
  51. enum {TYPE_EXCLUSIVE=1};
  52. DWORD dwCode;
  53. LPCTSTR lpszName;
  54. DWORD dwRelatedPropertyCode; // code of the Property this value can be used for
  55. DWORD dwFlags; //internal flags (nothing to do with metadata)
  56. static DWORD MapNameToCode(const CString& strName, DWORD dwRelatedPropertyCode, tValueTable * ValueTable=::gValueTable);
  57. static CString MapValueContentToString(DWORD dwValueContent, DWORD dwRelatedPropertyCode, tValueTable * ValueTable=::gValueTable);
  58. };
  59. DWORD MapValueNameToCode(const CString & strName, DWORD dwRelatedPropertyCode);
  60. //**********************************************************************
  61. // COMMAND NAME TABLE DEFINITION
  62. //**********************************************************************
  63. struct tCommandNameTable ;
  64. tCommandNameTable gCommandNameTable[];
  65. struct tCommandNameTable
  66. {
  67. DWORD dwCode;
  68. LPCTSTR lpszName;
  69. DWORD dwFlags; //internal flags (nothing to do with metadata)
  70. static DWORD MapNameToCode(const CString& strName, tCommandNameTable * CommandNameTable=::gCommandNameTable);
  71. };
  72. DWORD MapCommandNameToCode(const CString & strName);
  73. enum
  74. { CMD_SET=1,
  75. CMD_GET,
  76. CMD_COPY,
  77. CMD_DELETE,
  78. CMD_ENUM,
  79. CMD_ENUM_ALL,
  80. CMD_CREATE,
  81. CMD_RENAME,
  82. CMD_SCRIPT,
  83. CMD_SAVE,
  84. CMD_APPCREATEINPROC,
  85. CMD_APPCREATEOUTPOOL,
  86. CMD_APPCREATEOUTPROC,
  87. CMD_APPDELETE,
  88. CMD_APPRENAME,
  89. CMD_APPUNLOAD,
  90. CMD_APPGETSTATUS,
  91. };
  92. //**********************************************************************
  93. // PROPERTY ATTRIB NAME TABLE DEFINITION
  94. //**********************************************************************
  95. struct tAttribNameTable ;
  96. tAttribNameTable gAttribNameTable[];
  97. struct tAttribNameTable
  98. {
  99. DWORD dwCode;
  100. LPCTSTR lpszName;
  101. DWORD dwFlags; //internal flags (nothing to do with metadata)
  102. static DWORD MapNameToCode(const CString& strName, tAttribNameTable * AttribNameTable=::gAttribNameTable);
  103. };
  104. DWORD MapAttribNameToCode(const CString & strName);
  105. //**********************************************************************
  106. // PROPERTY DATA TYPE NAME TABLE DEFINITION
  107. //**********************************************************************
  108. struct tDataTypeNameTable ;
  109. tDataTypeNameTable gDataTypeNameTable[];
  110. struct tDataTypeNameTable
  111. {
  112. DWORD dwCode;
  113. LPCTSTR lpszName;
  114. DWORD dwFlags; //internal flags (nothing to do with metadata)
  115. static DWORD MapNameToCode(const CString& strName, tDataTypeNameTable * DataTypeNameTable=::gDataTypeNameTable);
  116. static CString MapCodeToName(DWORD a_dwCode, tDataTypeNameTable * DataTypeNameTable=::gDataTypeNameTable);
  117. };
  118. DWORD MapDataTypeNameToCode(const CString & strName);
  119. //**********************************************************************
  120. // PROPERTY USER TYPE NAME TABLE DEFINITION AND IMPLEMENTATION
  121. //**********************************************************************
  122. struct tUserTypeNameTable ;
  123. tUserTypeNameTable gUserTypeNameTable[];
  124. struct tUserTypeNameTable
  125. {
  126. DWORD dwCode;
  127. LPCTSTR lpszName;
  128. DWORD dwFlags; //internal flags (nothing to do with metadata)
  129. static DWORD MapNameToCode(const CString& strName, tUserTypeNameTable * UserTypeNameTable=::gUserTypeNameTable);
  130. };
  131. DWORD MapUserTypeNameToCode(const CString & strName);
  132. void PrintTablesInfo(void);
  133. #endif