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.

195 lines
5.0 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_APPCREATEOUTPROC,
  86. CMD_APPDELETE,
  87. CMD_APPRENAME,
  88. CMD_APPUNLOAD,
  89. CMD_APPGETSTATUS,
  90. };
  91. //**********************************************************************
  92. // PROPERTY ATTRIB NAME TABLE DEFINITION
  93. //**********************************************************************
  94. struct tAttribNameTable ;
  95. tAttribNameTable gAttribNameTable[];
  96. struct tAttribNameTable
  97. {
  98. DWORD dwCode;
  99. LPCTSTR lpszName;
  100. DWORD dwFlags; //internal flags (nothing to do with metadata)
  101. static DWORD MapNameToCode(const CString& strName, tAttribNameTable * AttribNameTable=::gAttribNameTable);
  102. };
  103. DWORD MapAttribNameToCode(const CString & strName);
  104. //**********************************************************************
  105. // PROPERTY DATA TYPE NAME TABLE DEFINITION
  106. //**********************************************************************
  107. struct tDataTypeNameTable ;
  108. tDataTypeNameTable gDataTypeNameTable[];
  109. struct tDataTypeNameTable
  110. {
  111. DWORD dwCode;
  112. LPCTSTR lpszName;
  113. DWORD dwFlags; //internal flags (nothing to do with metadata)
  114. static DWORD MapNameToCode(const CString& strName, tDataTypeNameTable * DataTypeNameTable=::gDataTypeNameTable);
  115. static CString MapCodeToName(DWORD a_dwCode, tDataTypeNameTable * DataTypeNameTable=::gDataTypeNameTable);
  116. };
  117. DWORD MapDataTypeNameToCode(const CString & strName);
  118. //**********************************************************************
  119. // PROPERTY USER TYPE NAME TABLE DEFINITION AND IMPLEMENTATION
  120. //**********************************************************************
  121. struct tUserTypeNameTable ;
  122. tUserTypeNameTable gUserTypeNameTable[];
  123. struct tUserTypeNameTable
  124. {
  125. DWORD dwCode;
  126. LPCTSTR lpszName;
  127. DWORD dwFlags; //internal flags (nothing to do with metadata)
  128. static DWORD MapNameToCode(const CString& strName, tUserTypeNameTable * UserTypeNameTable=::gUserTypeNameTable);
  129. };
  130. DWORD MapUserTypeNameToCode(const CString & strName);
  131. void PrintTablesInfo(void);
  132. #endif