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.

206 lines
6.9 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. MapData.c
  5. Abstract:
  6. Data structures for mapping wksta and server info structures.
  7. Author:
  8. Dan Hinsley (danhi) 06-Jun-1991
  9. Environment:
  10. User Mode - Win32
  11. Revision History:
  12. 24-Apr-1991 danhi
  13. Created
  14. 06-Jun-1991 Danhi
  15. Sweep to conform to NT coding style
  16. 18-Aug-1991 JohnRo
  17. Implement downlevel NetWksta APIs. (Moved DanHi's NetCmd/Map32/MWksta
  18. conversion stuff to NetLib.)
  19. --*/
  20. //
  21. // INCLUDES
  22. //
  23. // These must be included first:
  24. //#include <ntos2.h> // Only required to compile under NT.
  25. #include <windef.h> // IN, LPVOID, etc.
  26. //#include <lmcons.h> // NET_API_STATUS, CNLEN, etc.
  27. // These may be included in any order:
  28. //#include <debuglib.h> // IF_DEBUG(CONVSRV).
  29. #include <dlserver.h> // Old server info levels.
  30. #include <dlwksta.h> // Old wksta info levels.
  31. //#include <lmapibuf.h> // NetapipBufferAllocate().
  32. //#include <lmerr.h> // NERR_ and ERROR_ equates.
  33. #include <lmserver.h> // New server info level structures.
  34. #include <lmwksta.h> // New wksta info level structures.
  35. #include <mapsupp.h> // MOVESTRING, my prototypes.
  36. //#include <netdebug.h> // NetpKdPrint(()), FORMAT_ equates, etc.
  37. //#include <netlib.h> // NetpPointerPlusSomeBytes().
  38. //#include <tstring.h> // STRLEN().
  39. //#include <xsdef16.h> // xactsrv defaults for values not supported on NT
  40. //#include <ntos2.h>
  41. //#include <windef.h>
  42. //#include <string.h>
  43. //#include <malloc.h>
  44. //#include <stddef.h>
  45. //#include <lm.h>
  46. //#include "port1632.h"
  47. //#include "mapsupp.h"
  48. //
  49. // These structures are used by the NetpMoveStrings function, which copies
  50. // strings between and old and new lanman structure. The name describes
  51. // the source and destination structure. For example, Level2_101 tells
  52. // NetpMoveStrings how to move the strings from a Level 101 to a Level 2.
  53. //
  54. // Each structure has pairs of entries, the first is the offset of the
  55. // pointer source string in it's structure, the second is the offset of
  56. // the pointer to the destination string in it's structure.
  57. //
  58. // See NetpMoveStrings in mapsupp.c for more details.
  59. //
  60. MOVESTRING NetpServer2_102[] = {
  61. offsetof(SERVER_INFO_102, sv102_name),
  62. offsetof(SERVER_INFO_2, sv2_name),
  63. offsetof(SERVER_INFO_102, sv102_comment),
  64. offsetof(SERVER_INFO_2, sv2_comment),
  65. offsetof(SERVER_INFO_102, sv102_userpath),
  66. offsetof(SERVER_INFO_2, sv2_userpath),
  67. MOVESTRING_END_MARKER, MOVESTRING_END_MARKER } ;
  68. MOVESTRING NetpServer2_402[] = {
  69. offsetof(SERVER_INFO_402, sv402_guestacct),
  70. offsetof(SERVER_INFO_2, sv2_guestacct),
  71. offsetof(SERVER_INFO_402, sv402_alerts),
  72. offsetof(SERVER_INFO_2, sv2_alerts),
  73. offsetof(SERVER_INFO_402, sv402_srvheuristics),
  74. offsetof(SERVER_INFO_2, sv2_srvheuristics),
  75. MOVESTRING_END_MARKER, MOVESTRING_END_MARKER } ;
  76. MOVESTRING NetpServer3_403[] = {
  77. offsetof(SERVER_INFO_403, sv403_autopath),
  78. offsetof(SERVER_INFO_3, sv3_autopath),
  79. MOVESTRING_END_MARKER, MOVESTRING_END_MARKER } ;
  80. //
  81. // Enhancement: These are the same as NetpServer2_102, except the two fields are
  82. // reversed, ie source<->destination. Should I bother with
  83. // making NetpMoveStrings be able to work with a single structure
  84. // and a switch?
  85. //
  86. MOVESTRING NetpServer102_2[] = {
  87. offsetof(SERVER_INFO_2, sv2_name),
  88. offsetof(SERVER_INFO_102, sv102_name),
  89. offsetof(SERVER_INFO_2, sv2_comment),
  90. offsetof(SERVER_INFO_102, sv102_comment),
  91. offsetof(SERVER_INFO_2, sv2_userpath),
  92. offsetof(SERVER_INFO_102, sv102_userpath),
  93. MOVESTRING_END_MARKER, MOVESTRING_END_MARKER } ;
  94. MOVESTRING NetpServer402_2[] = {
  95. offsetof(SERVER_INFO_2, sv2_alerts),
  96. offsetof(SERVER_INFO_402, sv402_alerts),
  97. offsetof(SERVER_INFO_2, sv2_guestacct),
  98. offsetof(SERVER_INFO_402, sv402_guestacct),
  99. offsetof(SERVER_INFO_2, sv2_srvheuristics),
  100. offsetof(SERVER_INFO_402, sv402_srvheuristics),
  101. MOVESTRING_END_MARKER, MOVESTRING_END_MARKER } ;
  102. MOVESTRING NetpServer403_3[] = {
  103. offsetof(SERVER_INFO_3, sv3_autopath),
  104. offsetof(SERVER_INFO_403, sv403_autopath),
  105. MOVESTRING_END_MARKER, MOVESTRING_END_MARKER } ;
  106. // To build wksta_info_10
  107. MOVESTRING NetpWksta10_101[] = {
  108. offsetof(WKSTA_INFO_101, wki101_computername),
  109. offsetof(WKSTA_INFO_10, wki10_computername),
  110. offsetof(WKSTA_INFO_101, wki101_langroup),
  111. offsetof(WKSTA_INFO_10, wki10_langroup),
  112. MOVESTRING_END_MARKER, MOVESTRING_END_MARKER } ;
  113. MOVESTRING NetpWksta10_User_1[] = {
  114. offsetof(WKSTA_USER_INFO_1, wkui1_username),
  115. offsetof(WKSTA_INFO_10, wki10_username),
  116. offsetof(WKSTA_USER_INFO_1, wkui1_logon_domain),
  117. offsetof(WKSTA_INFO_10, wki10_logon_domain),
  118. offsetof(WKSTA_USER_INFO_1, wkui1_oth_domains),
  119. offsetof(WKSTA_INFO_10, wki10_oth_domains),
  120. MOVESTRING_END_MARKER, MOVESTRING_END_MARKER } ;
  121. // To build wksta_info_0
  122. MOVESTRING NetpWksta0_101[] = {
  123. offsetof(WKSTA_INFO_101, wki101_lanroot),
  124. offsetof(WKSTA_INFO_0, wki0_root),
  125. offsetof(WKSTA_INFO_101, wki101_computername),
  126. offsetof(WKSTA_INFO_0, wki0_computername),
  127. offsetof(WKSTA_INFO_101, wki101_langroup),
  128. offsetof(WKSTA_INFO_0, wki0_langroup),
  129. MOVESTRING_END_MARKER, MOVESTRING_END_MARKER } ;
  130. MOVESTRING NetpWksta0_User_1[] = {
  131. offsetof(WKSTA_USER_INFO_1, wkui1_username),
  132. offsetof(WKSTA_INFO_0, wki0_username),
  133. offsetof(WKSTA_USER_INFO_1, wkui1_logon_server),
  134. offsetof(WKSTA_INFO_0, wki0_logon_server),
  135. MOVESTRING_END_MARKER, MOVESTRING_END_MARKER } ;
  136. MOVESTRING NetpWksta0_402[] = {
  137. offsetof(WKSTA_INFO_402, wki402_wrk_heuristics),
  138. offsetof(WKSTA_INFO_0, wki0_wrkheuristics),
  139. MOVESTRING_END_MARKER, MOVESTRING_END_MARKER } ;
  140. // To build wksta_info_1 (incremental over wksta_info_0)
  141. MOVESTRING NetpWksta1_User_1[] = {
  142. offsetof(WKSTA_USER_INFO_1, wkui1_logon_domain),
  143. offsetof(WKSTA_INFO_1, wki1_logon_domain),
  144. offsetof(WKSTA_USER_INFO_1, wkui1_oth_domains),
  145. offsetof(WKSTA_INFO_1, wki1_oth_domains),
  146. MOVESTRING_END_MARKER, MOVESTRING_END_MARKER } ;
  147. // To build wksta_info_101/302/402 from wksta_info_0
  148. MOVESTRING NetpWksta101_0[] = {
  149. offsetof(WKSTA_INFO_0, wki0_root),
  150. offsetof(WKSTA_INFO_101, wki101_lanroot),
  151. offsetof(WKSTA_INFO_0, wki0_computername),
  152. offsetof(WKSTA_INFO_101, wki101_computername),
  153. offsetof(WKSTA_INFO_0, wki0_langroup),
  154. offsetof(WKSTA_INFO_101, wki101_langroup),
  155. MOVESTRING_END_MARKER, MOVESTRING_END_MARKER } ;
  156. MOVESTRING NetpWksta402_0[] = {
  157. offsetof(WKSTA_INFO_0, wki0_wrkheuristics),
  158. offsetof(WKSTA_INFO_402, wki402_wrk_heuristics),
  159. MOVESTRING_END_MARKER, MOVESTRING_END_MARKER } ;