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.

355 lines
11 KiB

  1. /****************************************************************************
  2. * *
  3. * fpnwapi.h -- FPNW procedure declarations, constant definitions and macros *
  4. * *
  5. * Copyright (c) 1994-1995, Microsoft Corp. All rights reserved. *
  6. * *
  7. ****************************************************************************/
  8. #ifndef _FPNWAPI_H_
  9. #define _FPNWAPI_H_
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif /* __cplusplus */
  13. //
  14. // Definitions for LSA secrets
  15. //
  16. #define NCP_LSA_SECRET_KEY L"G$MNSEncryptionKey"
  17. #define NCP_LSA_SECRET_LENGTH USER_SESSION_KEY_LENGTH // in <crypt.h>
  18. #define NW_SERVER_SERVICE L"FPNW"
  19. //
  20. // Volume flags returned by VolumeGetInfo
  21. //
  22. #define FPNWVOL_TYPE_DISKTREE 0
  23. #define FPNWVOL_TYPE_CDROM 104
  24. #define FPNWVOL_TYPE_REMOVABLE 105
  25. //
  26. // Permissions flags returned in structure FPNWFILEINFO
  27. //
  28. #define FPNWFILE_PERM_NONE 0
  29. #define FPNWFILE_PERM_READ 0x01
  30. #define FPNWFILE_PERM_WRITE 0x02
  31. #define FPNWFILE_PERM_CREATE 0x04
  32. #define FPNWFILE_PERM_EXEC 0x08
  33. #define FPNWFILE_PERM_DELETE 0x10
  34. #define FPNWFILE_PERM_ATRIB 0x20
  35. #define FPNWFILE_PERM_PERM 0x40
  36. typedef BYTE FPNWSERVERADDR[12]; // Network address, first 4 bytes is
  37. // the network number, and bytes
  38. // 5-10 is the physical node
  39. // address. The last two bytes are
  40. // reserved.
  41. //
  42. // This is the level 1 structure for FpnwServerGetInfo & FpnwServerSetInfo.
  43. //
  44. typedef struct _FPNWServerInfo
  45. {
  46. LPWSTR lpServerName; // Name of the server
  47. DWORD dwNetwareMajorVersion; // Netware compatible major version num
  48. DWORD dwNetwareMinorVersion; // Netware compatible minor version num
  49. DWORD dwOSRevision; // OS revision number
  50. DWORD dwMaxConnections; // Maximum number of connections
  51. // supported
  52. DWORD dwVolumes; // The current number of volumes on the
  53. // server
  54. DWORD dwLoggedOnUsers; // Number of current users logged on
  55. DWORD dwConnectedWorkstations;// Number of workstations connected
  56. DWORD dwOpenFiles; // Number of open files
  57. DWORD dwFileLocks; // Number of file locks
  58. FPNWSERVERADDR NetworkAddress; // Address consisting of network
  59. // number (first 4 bytes) and the
  60. // physical node address(bytes 5-10)
  61. BOOL fEnableLogin; // TRUE if users are allowed to logged
  62. // on, FALSE otherwise.
  63. LPWSTR lpDescription; // Description of the server
  64. LPWSTR lpHomeDirectory; // Path of the home directory
  65. } FPNWSERVERINFO, *PFPNWSERVERINFO;
  66. //
  67. // This is the level 1 structure for FpnwVolumeAdd, FpnwVolumeDel, FpnwVolumeEnum,
  68. // FpnwVolumeGetInfo, & FpnwVolumeSetInfo.
  69. //
  70. typedef struct _FPNWVolumeInfo
  71. {
  72. LPWSTR lpVolumeName; // Name of the volume
  73. DWORD dwType; // Specifics of the volume. FPNWVOL_TYPE_???
  74. DWORD dwMaxUses; // Maximum number of connections that are
  75. // allowed to the volume
  76. DWORD dwCurrentUses; // Current number of connections to the volume
  77. LPWSTR lpPath; // Path of the volume
  78. } FPNWVOLUMEINFO, *PFPNWVOLUMEINFO;
  79. //
  80. // This is the level 2 structure for FpnwVolumeAdd, FpnwVolumeDel, FpnwVolumeEnum,
  81. // FpnwVolumeGetInfo, & FpnwVolumeSetInfo.
  82. // Note that this is not supported on the FPNW beta.
  83. //
  84. typedef struct _FPNWVolumeInfo_2
  85. {
  86. LPWSTR lpVolumeName; // Name of the volume
  87. DWORD dwType; // Specifics of the volume. FPNWVOL_TYPE_???
  88. DWORD dwMaxUses; // Maximum number of connections that are
  89. // allowed to the volume
  90. DWORD dwCurrentUses; // Current number of connections to the volume
  91. LPWSTR lpPath; // Path of the volume
  92. DWORD dwFileSecurityDescriptorLength; // reserved, this is calculated
  93. PSECURITY_DESCRIPTOR FileSecurityDescriptor;
  94. } FPNWVOLUMEINFO_2, *PFPNWVOLUMEINFO_2;
  95. //
  96. // This is the level 1 structure for FpnwConnectionEnum.
  97. //
  98. typedef struct _FPNWConnectionInfo
  99. {
  100. DWORD dwConnectionId; // Identification number for this connection
  101. FPNWSERVERADDR WkstaAddress; // The workstation address which established
  102. // the conn.
  103. DWORD dwAddressType; // Address type: IP, IPX ...
  104. LPWSTR lpUserName; // The name of the user which established
  105. // the conn.
  106. DWORD dwOpens; // Number of resources opened during this conn.
  107. DWORD dwLogonTime; // Time this connection has been active
  108. BOOL fLoggedOn; // TRUE if the user is logged on,FALSE otherwise
  109. DWORD dwForcedLogoffTime; // Time left before forcing logoff
  110. BOOL fAdministrator; // TRUE if the user is an administrator,
  111. // FALSE otherwise
  112. } FPNWCONNECTIONINFO, *PFPNWCONNECTIONINFO;
  113. //
  114. // This is the level 1 structure for FpnwVolumeConnEnum.
  115. //
  116. typedef struct _FPNWVolumeConnectionInfo
  117. {
  118. USHORT nDriveLetter; // Driver letter mapped to the volume by user
  119. DWORD dwConnectionId; // Identification number for this connection
  120. DWORD dwConnType; // The type of connection: FPNWVOL_TYPE_DISK,
  121. // FPNWVOL_TYPE_PRINTER
  122. DWORD dwOpens; // The number of open files on this connection.
  123. DWORD dwTime; // Time this connection is active (or connected)
  124. LPWSTR lpUserName; // The user who established the connection
  125. LPWSTR lpConnectName; // The workstation address OR volume name based
  126. // on the qualifier to FpnwConnectionEnum
  127. } FPNWVOLUMECONNINFO, *PFPNWVOLUMECONNINFO;
  128. //
  129. // This is the level 1 structure for FpnwFileEnum.
  130. //
  131. typedef struct _FPNWFileInfo
  132. {
  133. DWORD dwFileId; // File identification number
  134. LPWSTR lpPathName; // Full path name of this file
  135. LPWSTR lpVolumeName; // Volume name this file is on
  136. DWORD dwPermissions; // Permission mask: FPNWFILE_PERM_READ,
  137. // FPNWFILE_PERM_WRITE,
  138. // FPNWFILE_PERM_CREATE...
  139. DWORD dwLocks; // Number of locks on this file
  140. LPWSTR lpUserName; // The name of the user that established the
  141. // connection and opened the file
  142. FPNWSERVERADDR WkstaAddress; // The workstation address which opened the file
  143. DWORD dwAddressType; // Address type: IP, IPX
  144. } FPNWFILEINFO, *PFPNWFILEINFO;
  145. //
  146. // Below are the APIs available to manipulate FPNW servers, volumes, etc.
  147. //
  148. //
  149. // The FpnwApiBufferFree should be called for any buffer returned by the
  150. // other APIs.
  151. //
  152. DWORD
  153. FpnwApiBufferFree(
  154. IN LPVOID pBuffer
  155. );
  156. //
  157. // For Level 1, an FPNWSERVERINFO structure is returned in *ppServerInfo.
  158. //
  159. DWORD
  160. FpnwServerGetInfo(
  161. IN LPWSTR pServerName OPTIONAL,
  162. IN DWORD dwLevel,
  163. OUT LPBYTE *ppServerInfo
  164. );
  165. //
  166. // The following fields are modified by a call to FpnwServerSetInfo :
  167. //
  168. // LPWSTR lpDescription; // Description of the server
  169. // BOOL fEnableLogin; // TRUE if users are allowed to logged
  170. // LPWSTR lpHomeDirectory; // Path of the home directory
  171. //
  172. // All other fields in FPNWSERVERINFO structure are ignored. Also note
  173. // that lpHomeDirectory and lpDescription require a restart for the server
  174. // to pick up the changes.
  175. //
  176. //
  177. // For Level 1, an FPNWSERVERINFO structure should be passed as pServerInfo.
  178. //
  179. DWORD
  180. FpnwServerSetInfo(
  181. IN LPWSTR pServerName OPTIONAL,
  182. IN DWORD dwLevel,
  183. IN LPBYTE pServerInfo
  184. );
  185. //
  186. // For FpnwVolumeAdd, FpnwVolumeEnum, FpnwVolumeSetInfo, and
  187. // FpnwVolumeGetInfo, the following holds:
  188. // Level 1 -> an FPNWVOLUMEINFO structure should be passed as pVolumeInfo.
  189. // Level 2 -> an FPNWVOLUMEINFO_2 structure should be passed as pVolumeInfo.
  190. //
  191. DWORD
  192. FpnwVolumeAdd(
  193. IN LPWSTR pServerName OPTIONAL,
  194. IN DWORD dwLevel,
  195. IN LPBYTE pVolumeInfo
  196. );
  197. DWORD
  198. FpnwVolumeDel(
  199. IN LPWSTR pServerName OPTIONAL,
  200. IN LPWSTR pVolumeName
  201. );
  202. DWORD
  203. FpnwVolumeEnum(
  204. IN LPWSTR pServerName OPTIONAL,
  205. IN DWORD dwLevel,
  206. OUT LPBYTE *ppVolumeInfo,
  207. OUT PDWORD pEntriesRead,
  208. IN OUT PDWORD resumeHandle OPTIONAL
  209. );
  210. DWORD
  211. FpnwVolumeGetInfo(
  212. IN LPWSTR pServerName OPTIONAL,
  213. IN LPWSTR pVolumeName,
  214. IN DWORD dwLevel,
  215. OUT LPBYTE *ppVolumeInfo
  216. );
  217. //
  218. // The following fields are modified by a call to FpnwVolumeSetInfo :
  219. //
  220. // DWORD dwMaxUses; // Maximum number of connections that are
  221. // PSECURITY_DESCRIPTOR FileSecurityDescriptor;
  222. //
  223. // All other fields in FPNWVOLUMEINFO structure are ignored. You may send
  224. // in a pointer to an FPNWVOLUMEINFO_2 structure instead of FPNWVOLUMEINFO.
  225. //
  226. DWORD
  227. FpnwVolumeSetInfo(
  228. IN LPWSTR pServerName OPTIONAL,
  229. IN LPWSTR pVolumeName,
  230. IN DWORD dwLevel,
  231. IN LPBYTE pVolumeInfo
  232. );
  233. //
  234. // For Level 1, an FPNWCONNECTIONINFO structure is returned in *ppConnectionInfo.
  235. //
  236. DWORD
  237. FpnwConnectionEnum(
  238. IN LPWSTR pServerName OPTIONAL,
  239. IN DWORD dwLevel,
  240. OUT LPBYTE *ppConnectionInfo,
  241. OUT PDWORD pEntriesRead,
  242. IN OUT PDWORD resumeHandle OPTIONAL
  243. );
  244. DWORD FpnwConnectionDel(
  245. IN LPWSTR pServerName OPTIONAL,
  246. IN DWORD dwConnectionId
  247. );
  248. //
  249. // For Level 1, an PFPNWVOLUMECONNINFO structure is returned in *ppVolumeConnInfo.
  250. //
  251. DWORD
  252. FpnwVolumeConnEnum(
  253. IN LPWSTR pServerName OPTIONAL,
  254. IN DWORD dwLevel,
  255. IN LPWSTR pVolumeName,
  256. IN DWORD dwConnectionId,
  257. OUT LPBYTE *ppVolumeConnInfo,
  258. OUT PDWORD pEntriesRead,
  259. IN OUT PDWORD resumeHandle OPTIONAL
  260. );
  261. //
  262. // For Level 1, an PFPNWFILEINFO structure is returned in *ppFileInfo.
  263. //
  264. DWORD
  265. FpnwFileEnum(
  266. IN LPWSTR pServerName OPTIONAL,
  267. IN DWORD dwLevel,
  268. IN LPWSTR pPathName OPTIONAL,
  269. OUT LPBYTE *ppFileInfo,
  270. OUT PDWORD pEntriesRead,
  271. IN OUT PDWORD resumeHandle OPTIONAL
  272. );
  273. DWORD
  274. FpnwFileClose(
  275. IN LPWSTR pServerName OPTIONAL,
  276. IN DWORD nFileId
  277. );
  278. DWORD FpnwMessageBufferSend(
  279. IN LPWSTR pServerName OPTIONAL,
  280. IN DWORD dwConnectionId,
  281. IN DWORD fConsoleBroadcast,
  282. IN LPBYTE pbBuffer,
  283. IN DWORD cbBuffer
  284. );
  285. #ifdef __cplusplus
  286. }
  287. #endif /* __cplusplus */
  288. #endif