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.

194 lines
5.4 KiB

  1. //--------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1999 - 2000.
  5. //
  6. //
  7. // Microsoft state migration helper tool
  8. //
  9. // File: scansys.hxx
  10. //
  11. //--------------------------------------------------------------
  12. #ifndef SCANSYS_HXX
  13. #define SCANSYS_HXX
  14. #include <lmshare.h>
  15. #include <lmapibuf.h>
  16. #include <ras.h>
  17. //---------------------------------------------------------------
  18. // Constants.
  19. /* These flags are relevant for share-level security on VSERVER
  20. * When operating with user-level security, use SHI50F_FULL - the actual
  21. * access rights are determined by the NetAccess APIs.
  22. */
  23. #define SHI50F_RDONLY 0x0001
  24. #define SHI50F_FULL 0x0002
  25. #define SHI50F_ACCESSMASK (SHI50F_RDONLY|SHI50F_FULL)
  26. /* The share is restored on system startup */
  27. #define SHI50F_PERSIST 0x0100
  28. /* The share is not normally visible */
  29. #define SHI50F_SYSTEM 0x0200
  30. //
  31. // Win9x migration net share flag, used to distinguish user-level security and
  32. // password-level security. When it is specified, user-level
  33. // security is enabled, and NetShares\<share>\ACL\<list> exists.
  34. //
  35. #define SHI50F_ACLS 0x1000
  36. //
  37. // Flags that help determine when custom access is enabled
  38. //
  39. #define READ_ACCESS_FLAGS 0x0081
  40. #define READ_ACCESS_MASK 0x7fff
  41. #define FULL_ACCESS_FLAGS 0x00b7
  42. #define FULL_ACCESS_MASK 0x7fff
  43. //---------------------------------------------------------------
  44. // Types not defined by public headers
  45. //
  46. typedef NET_API_STATUS (* ScanNetShareEnumNT) (
  47. LMSTR servername,
  48. DWORD level,
  49. LPBYTE *bufptr,
  50. DWORD prefmaxlen,
  51. LPDWORD entriesread,
  52. LPDWORD totalentries,
  53. LPDWORD resume_handle );
  54. typedef NET_API_STATUS (* ScanNetShareEnum9x) (
  55. const char * servername,
  56. short level,
  57. char * bufptr,
  58. unsigned short prefmaxlen,
  59. unsigned short * entriesread,
  60. unsigned short * totalentries);
  61. typedef NET_API_STATUS (* ScanNetApiBufferFreeNT) ( void *);
  62. typedef NET_API_STATUS (* ScanNetAccessEnum9x) (
  63. const char * pszServer,
  64. char * pszBasePath,
  65. short fsRecursive,
  66. short sLevel,
  67. char * pbBuffer,
  68. unsigned short cbBuffer,
  69. unsigned short * pcEntriesRead,
  70. unsigned short * pcTotalAvail );
  71. #pragma pack(push)
  72. #pragma pack(1) /* Assume byte packing throughout */
  73. struct _share_info_50 {
  74. char shi50_netname[LM20_NNLEN+1];
  75. unsigned char shi50_type;
  76. unsigned short shi50_flags;
  77. char * shi50_remark;
  78. char * shi50_path;
  79. char shi50_rw_password[SHPWLEN+1];
  80. char shi50_ro_password[SHPWLEN+1];
  81. };
  82. struct access_list_2
  83. {
  84. char * acl2_ugname;
  85. unsigned short acl2_access;
  86. }; /* access_list_2 */
  87. struct access_info_2
  88. {
  89. char * acc2_resource_name;
  90. short acc2_attr;
  91. short acc2_count;
  92. }; /* access_info_2 */
  93. #pragma pack(pop)
  94. //---------------------------------------------------------------
  95. // Routines implemented
  96. //
  97. DWORD ScanCheckVersion ();
  98. DWORD ScanEnumerateShares (HANDLE h);
  99. DWORD ScanEnumeratePrinters (HANDLE h);
  100. DWORD ScanEnumerateNetResources (HANDLE h, DWORD dwScope, NETRESOURCEA *lpnr);
  101. // RAS Data structures
  102. //
  103. // AddrEntry serves as a header for the entire block of data in the <entry>
  104. // blob. entries in it are offsets to the strings which follow it..in many cases
  105. // (i.e. all of the *Off* members...)
  106. //
  107. typedef struct _AddrEntry {
  108. DWORD dwVersion;
  109. DWORD dwCountryCode;
  110. UINT uOffArea;
  111. UINT uOffPhone;
  112. DWORD dwCountryID;
  113. UINT uOffSMMCfg;
  114. UINT uOffSMM;
  115. UINT uOffDI;
  116. } ADDRENTRY, *PADDRENTRY;
  117. typedef struct _SubConnEntry {
  118. DWORD dwSize;
  119. DWORD dwFlags;
  120. char szDeviceType[RAS_MaxDeviceType+1];
  121. char szDeviceName[RAS_MaxDeviceName+1];
  122. char szLocal[RAS_MaxPhoneNumber+1];
  123. } SUBCONNENTRY, *PSUBCONNENTRY;
  124. typedef struct _IPData {
  125. DWORD dwSize;
  126. DWORD fdwTCPIP;
  127. DWORD dwIPAddr;
  128. DWORD dwDNSAddr;
  129. DWORD dwDNSAddrAlt;
  130. DWORD dwWINSAddr;
  131. DWORD dwWINSAddrAlt;
  132. } IPDATA, *PIPDATA;
  133. typedef struct _DEVICEINFO {
  134. DWORD dwVersion;
  135. UINT uSize;
  136. char szDeviceName[RAS_MaxDeviceName+1];
  137. char szDeviceType[RAS_MaxDeviceType+1];
  138. } DEVICEINFO, *PDEVICEINFO;
  139. typedef struct _SMMCFG {
  140. DWORD dwSize;
  141. DWORD fdwOptions;
  142. DWORD fdwProtocols;
  143. } SMMCFG, *PSMMCFG;
  144. #define PAESMMCFG(pAE) ((PSMMCFG)(((PBYTE)pAE)+(pAE->uOffSMMCfg)))
  145. #define PAESMM(pAE) ((PSTR)(((PBYTE)pAE)+(pAE->uOffSMM)))
  146. #define PAEDI(pAE) ((PDEVICEINFO)(((PBYTE)pAE)+(pAE->uOffDI )))
  147. #define PAEAREA(pAE) ((PSTR)(((PBYTE)pAE)+(pAE->uOffArea)))
  148. #define PAEPHONE(pAE) ((PSTR)(((PBYTE)pAE)+(pAE->uOffPhone)))
  149. #define BASICS_ON 0x00000001
  150. #define BASICS_AVAILABLE 0x00000002
  151. #define BASICS_HOTKEYACTIVE 0x00000004
  152. #define BASICS_CONFIRMHOTKEY 0x00000008
  153. #define BASICS_HOTKEYSOUND 0x00000010
  154. #define BASICS_INDICATOR 0x00000020
  155. #define SPECIAL_INVERT_OPTION 0x80000000
  156. typedef struct {
  157. LPCTSTR ValueName;
  158. DWORD FlagVal;
  159. } ACCESS_OPTION, *PACCESS_OPTION;
  160. #endif //SCANSYS_HXX