Npapi.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  1. /*---------------------------------------------------------------
  2. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  3. ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
  4. TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  5. PARTICULAR PURPOSE.
  6. Copyright (C) 1991 - 2000. Microsoft Corporation. All rights reserved.
  7. npapi.h
  8. Abstract:
  9. Network Provider API prototypes and manifests. A network provider
  10. is a client of the Win32 Winnet driver. See the "NT/Win32 Network
  11. Provider API Specification" document for further details.
  12. Environment:
  13. User Mode -Win32
  14. Notes:
  15. This file currently contains the function typedefs that will be needed
  16. by the winnet driver to support multiple providers using LoadLibrary.
  17. ---------------------------------------------------------------*/
  18. #ifndef _NPAPI_INCLUDED
  19. #define _NPAPI_INCLUDED
  20. //
  21. // CONNECTIONS
  22. //
  23. DWORD APIENTRY
  24. NPAddConnection (
  25. LPNETRESOURCEW lpNetResource,
  26. LPWSTR lpPassword,
  27. LPWSTR lpUserName
  28. );
  29. typedef DWORD (*PF_NPAddConnection) (
  30. LPNETRESOURCEW lpNetResource,
  31. LPWSTR lpPassword,
  32. LPWSTR lpUserName
  33. );
  34. DWORD APIENTRY
  35. NPAddConnection3 (
  36. HWND hwndOwner,
  37. LPNETRESOURCEW lpNetResource,
  38. LPTSTR lpPassword,
  39. LPTSTR lpUserName,
  40. DWORD dwFlags
  41. );
  42. typedef DWORD (*PF_NPAddConnection3) (
  43. HWND hwndOwner,
  44. LPNETRESOURCEW lpNetResource,
  45. LPWSTR lpPassword,
  46. LPWSTR lpUserName,
  47. DWORD dwFlags
  48. );
  49. DWORD APIENTRY
  50. NPCancelConnection (
  51. LPWSTR lpName,
  52. BOOL fForce
  53. );
  54. typedef DWORD (*PF_NPCancelConnection) (
  55. LPWSTR lpName,
  56. BOOL fForce
  57. );
  58. DWORD APIENTRY
  59. NPGetConnection (
  60. LPWSTR lpLocalName,
  61. LPWSTR lpRemoteName,
  62. LPDWORD lpnBufferLen
  63. );
  64. typedef DWORD (*PF_NPGetConnection) (
  65. LPWSTR lpLocalName,
  66. LPWSTR lpRemoteName,
  67. LPDWORD lpnBufferLen
  68. );
  69. DWORD APIENTRY
  70. NPGetUniversalName (
  71. LPWSTR lpLocalPath,
  72. DWORD dwInfoLevel,
  73. LPVOID lpBuffer,
  74. LPDWORD lpBufferSize
  75. );
  76. typedef DWORD (*PF_NPGetUniversalName) (
  77. LPWSTR lpLocalPath,
  78. DWORD dwInfoLevel,
  79. LPVOID lpBuffer,
  80. LPDWORD lpnBufferSize
  81. );
  82. DWORD APIENTRY
  83. NPOpenEnum (
  84. DWORD dwScope,
  85. DWORD dwType,
  86. DWORD dwUsage,
  87. LPNETRESOURCEW lpNetResource,
  88. LPHANDLE lphEnum
  89. );
  90. typedef DWORD (*PF_NPOpenEnum) (
  91. DWORD dwScope,
  92. DWORD dwType,
  93. DWORD dwUsage,
  94. LPNETRESOURCEW lpNetResource,
  95. LPHANDLE lphEnum
  96. );
  97. DWORD APIENTRY
  98. NPEnumResource (
  99. HANDLE hEnum,
  100. LPDWORD lpcCount,
  101. LPVOID lpBuffer,
  102. LPDWORD lpBufferSize
  103. );
  104. typedef DWORD (*PF_NPEnumResource) (
  105. HANDLE hEnum,
  106. LPDWORD lpcCount,
  107. LPVOID lpBuffer,
  108. LPDWORD lpBufferSize
  109. );
  110. DWORD APIENTRY
  111. NPCloseEnum (
  112. HANDLE hEnum
  113. );
  114. typedef DWORD (*PF_NPCloseEnum) (
  115. HANDLE hEnum
  116. );
  117. //
  118. // CAPABILITIES
  119. //
  120. #define WNNC_SPEC_VERSION 0x00000001
  121. #define WNNC_SPEC_VERSION51 0x00050001
  122. #define WNNC_NET_TYPE 0x00000002
  123. #define WNNC_NET_NONE 0x00000000
  124. /*
  125. removed because of macro definition warnings
  126. #define WNNC_NET_MSNET 0x00000100
  127. #define WNNC_NET_LANMAN 0x00000200
  128. #define WNNC_NET_NETWARE 0x00000300
  129. #define WNNC_NET_VINES 0x00000400
  130. */
  131. #define WNNC_DRIVER_VERSION 0x00000003
  132. #define WNNC_USER 0x00000004
  133. #define WNNC_USR_GETUSER 0x00000001
  134. #define WNNC_CONNECTION 0x00000006
  135. #define WNNC_CON_ADDCONNECTION 0x00000001
  136. #define WNNC_CON_CANCELCONNECTION 0x00000002
  137. #define WNNC_CON_GETCONNECTIONS 0x00000004
  138. #define WNNC_CON_ADDCONNECTION3 0x00000008
  139. #define WNNC_DIALOG 0x00000008
  140. #define WNNC_DLG_DEVICEMODE 0x00000001
  141. #define WNNC_DLG_PROPERTYDIALOG 0x00000020
  142. #define WNNC_DLG_SEARCHDIALOG 0x00000040
  143. #define WNNC_DLG_FORMATNETWORKNAME 0x00000080
  144. #define WNNC_DLG_PERMISSIONEDITOR 0x00000100
  145. #define WNNC_ADMIN 0x00000009
  146. #define WNNC_ADM_GETDIRECTORYTYPE 0x00000001
  147. #define WNNC_ADM_DIRECTORYNOTIFY 0x00000002
  148. #define WNNC_ENUMERATION 0x0000000B
  149. #define WNNC_ENUM_GLOBAL 0x00000001
  150. #define WNNC_ENUM_LOCAL 0x00000002
  151. #define WNNC_START 0x0000000C
  152. #define WNNC_WAIT_FOR_START 0x00000001
  153. DWORD APIENTRY
  154. NPGetCaps (
  155. DWORD ndex
  156. );
  157. typedef DWORD (*PF_NPGetCaps) (
  158. DWORD ndex
  159. );
  160. //
  161. // OTHER
  162. //
  163. DWORD APIENTRY
  164. NPGetUser (
  165. LPWSTR lpName,
  166. LPWSTR lpUserName,
  167. LPDWORD lpnBufferLen
  168. );
  169. typedef DWORD (*PF_NPGetUser) (
  170. LPWSTR lpName,
  171. LPWSTR lpUserName,
  172. LPDWORD lpnBufferLen
  173. );
  174. #define WNTYPE_DRIVE 1
  175. #define WNTYPE_FILE 2
  176. #define WNTYPE_PRINTER 3
  177. #define WNTYPE_COMM 4
  178. #define WNPS_FILE 0
  179. #define WNPS_DIR 1
  180. #define WNPS_MULT 2
  181. DWORD APIENTRY
  182. NPDeviceMode(
  183. HWND hParent
  184. );
  185. typedef DWORD (*PF_NPDeviceMode) (
  186. HWND hParent
  187. );
  188. // flag for search dialog
  189. #define WNSRCH_REFRESH_FIRST_LEVEL 0x00000001
  190. DWORD APIENTRY
  191. NPSearchDialog(
  192. HWND hwndParent,
  193. LPNETRESOURCEW lpNetResource,
  194. LPVOID lpBuffer,
  195. DWORD cbBuffer,
  196. LPDWORD lpnFlags
  197. );
  198. typedef DWORD (*PF_NPSearchDialog) (
  199. HWND hwndParent,
  200. LPNETRESOURCEW lpNetResource,
  201. LPVOID lpBuffer,
  202. DWORD cbBuffer,
  203. LPDWORD lpnFlags
  204. );
  205. /*
  206. removed because of macro definition warnings
  207. // flags for format network name
  208. #define WNFMT_MULTILINE 0x00000001
  209. #define WNFMT_ABBREVIATED 0x00000002
  210. #define WNFMT_INENUM 0x00000010
  211. */
  212. DWORD APIENTRY
  213. NPFormatNetworkName(
  214. LPWSTR lpRemoteName,
  215. LPWSTR lpFormattedName,
  216. LPDWORD lpnLength,
  217. DWORD dwFlags,
  218. DWORD dwAveCharPerLine
  219. );
  220. typedef DWORD (*PF_NPFormatNetworkName) (
  221. LPWSTR lpRemoteName,
  222. LPWSTR lpFormattedName,
  223. LPDWORD lpnLength,
  224. DWORD dwFlags,
  225. DWORD dwAveCharPerLine
  226. );
  227. DWORD APIENTRY
  228. NPGetPropertyText(
  229. DWORD iButton,
  230. DWORD nPropSel,
  231. LPWSTR lpName,
  232. LPWSTR lpButtonName,
  233. DWORD nButtonNameLen,
  234. DWORD nType
  235. );
  236. typedef DWORD (*PF_NPGetPropertyText) (
  237. DWORD iButton,
  238. DWORD nPropSel,
  239. LPWSTR lpName,
  240. LPWSTR lpButtonName,
  241. DWORD nButtonNameLen,
  242. DWORD nType
  243. );
  244. DWORD APIENTRY
  245. NPPropertyDialog(
  246. HWND hwndParent,
  247. DWORD iButtonDlg,
  248. DWORD nPropSel,
  249. LPWSTR lpFileName,
  250. DWORD nType
  251. );
  252. typedef DWORD (*PF_NPPropertyDialog) (
  253. HWND hwndParent,
  254. DWORD iButtonDlg,
  255. DWORD nPropSel,
  256. LPWSTR lpFileName,
  257. DWORD nType
  258. );
  259. //
  260. // ADMIN
  261. //
  262. #define WNDT_NORMAL 0
  263. #define WNDT_NETWORK 1
  264. #define WNDN_MKDIR 1
  265. #define WNDN_RMDIR 2
  266. #define WNDN_MVDIR 3
  267. DWORD APIENTRY
  268. NPGetDirectoryType (
  269. LPWSTR lpName,
  270. LPINT lpType,
  271. BOOL bFlushCache
  272. );
  273. typedef DWORD (*PF_NPGetDirectoryType) (
  274. LPWSTR lpName,
  275. LPINT lpType,
  276. BOOL bFlushCache
  277. );
  278. DWORD APIENTRY
  279. NPDirectoryNotify (
  280. HWND hwnd,
  281. LPWSTR lpDir,
  282. DWORD dwOper
  283. );
  284. typedef DWORD (*PF_NPDirectoryNotify) (
  285. HWND hwnd,
  286. LPWSTR lpDir,
  287. DWORD dwOper
  288. );
  289. VOID
  290. WNetSetLastErrorA(
  291. DWORD err,
  292. LPSTR lpError,
  293. LPSTR lpProviders
  294. );
  295. VOID
  296. WNetSetLastErrorW(
  297. DWORD err,
  298. LPWSTR lpError,
  299. LPWSTR lpProviders
  300. );
  301. #ifdef UNICODE
  302. #define WNetSetLastError WNetSetLastErrorW
  303. #else
  304. #define WNetSetLastError WNetSetLastErrorA
  305. #endif // UNICODE
  306. //
  307. // CREDENTIAL MANAGEMENT and other classes of providers
  308. //
  309. // Define the Net/Authentication and othr Provider Classes
  310. #define WN_NETWORK_CLASS 0x00000001
  311. #define WN_CREDENTIAL_CLASS 0x00000002
  312. #define WN_PRIMARY_AUTHENT_CLASS 0x00000004
  313. #define WN_SERVICE_CLASS 0x00000008
  314. #define WN_VALID_LOGON_ACCOUNT 0x00000001
  315. #define WN_NT_PASSWORD_CHANGED 0x00000002
  316. DWORD APIENTRY
  317. NPLogonNotify (
  318. PLUID lpLogonId,
  319. LPCWSTR lpAuthentInfoType,
  320. LPVOID lpAuthentInfo,
  321. LPCWSTR lpPreviousAuthentInfoType,
  322. LPVOID lpPreviousAuthentInfo,
  323. LPWSTR lpStationName,
  324. LPVOID StationHandle,
  325. LPWSTR *lpLogonScript
  326. );
  327. typedef DWORD (*PF_NPLogonNotify) (
  328. PLUID lpLogonId,
  329. LPCWSTR lpAuthentInfoType,
  330. LPVOID lpAuthentInfo,
  331. LPCWSTR lpPreviousAuthentInfoType,
  332. LPVOID lpPreviousAuthentInfo,
  333. LPWSTR lpStationName,
  334. LPVOID StationHandle,
  335. LPWSTR *lpLogonScript
  336. );
  337. DWORD APIENTRY
  338. NPPasswordChangeNotify (
  339. LPCWSTR lpAuthentInfoType,
  340. LPVOID lpAuthentInfo,
  341. LPCWSTR lpPreviousAuthentInfoType,
  342. LPVOID lpPreviousAuthentInfo,
  343. LPWSTR lpStationName,
  344. LPVOID StationHandle,
  345. DWORD dwChangeInfo
  346. );
  347. typedef DWORD (*PF_NPPasswordChangeNotify) (
  348. LPCWSTR lpAuthentInfoType,
  349. LPVOID lpAuthentInfo,
  350. LPCWSTR lpPreviousAuthentInfoType,
  351. LPVOID lpPreviousAuthentInfo,
  352. LPWSTR lpStationName,
  353. LPVOID StationHandle,
  354. DWORD dwChangeInfo
  355. );
  356. //
  357. // CONNECTION NOTIFICATION
  358. //
  359. //
  360. // NotifyStatus
  361. //
  362. #define NOTIFY_PRE 0x00000001
  363. #define NOTIFY_POST 0x00000002
  364. typedef struct _NOTIFYINFO
  365. {
  366. DWORD dwNotifyStatus;
  367. DWORD dwOperationStatus;
  368. LPVOID lpContext;
  369. } NOTIFYINFO, *LPNOTIFYINFO;
  370. typedef struct _NOTIFYADD
  371. {
  372. HWND hwndOwner;
  373. NETRESOURCE NetResource;
  374. DWORD dwAddFlags;
  375. } NOTIFYADD, *LPNOTIFYADD;
  376. typedef struct _NOTIFYCANCEL
  377. {
  378. LPTSTR lpName;
  379. LPTSTR lpProvider;
  380. DWORD dwFlags;
  381. BOOL fForce;
  382. } NOTIFYCANCEL, *LPNOTIFYCANCEL;
  383. DWORD APIENTRY
  384. AddConnectNotify (
  385. LPNOTIFYINFO lpNotifyInfo,
  386. LPNOTIFYADD lpAddInfo
  387. );
  388. typedef DWORD (*PF_AddConnectNotify) (
  389. LPNOTIFYINFO lpNotifyInfo,
  390. LPNOTIFYADD lpAddInfo
  391. );
  392. DWORD APIENTRY
  393. CancelConnectNotify (
  394. LPNOTIFYINFO lpNotifyInfo,
  395. LPNOTIFYCANCEL lpCancelInfo
  396. );
  397. typedef DWORD (*PF_CancelConnectNotify) (
  398. LPNOTIFYINFO lpNotifyInfo,
  399. LPNOTIFYCANCEL lpCancelInfo
  400. );
  401. //
  402. // Permission editor dialogs
  403. //
  404. //
  405. // Capabilities bits of permission editor dialogs
  406. //
  407. #define WNPERMC_PERM 0x00000001
  408. #define WNPERMC_AUDIT 0x00000002
  409. #define WNPERMC_OWNER 0x00000004
  410. DWORD APIENTRY
  411. NPFMXGetPermCaps (
  412. LPWSTR lpDriveName
  413. );
  414. typedef DWORD (*PF_NPFMXGetPermCaps) (
  415. LPWSTR lpDriveName
  416. );
  417. //
  418. // Type of security dialog
  419. //
  420. #define WNPERM_DLG_PERM 0
  421. #define WNPERM_DLG_AUDIT 1
  422. #define WNPERM_DLG_OWNER 2
  423. DWORD APIENTRY
  424. NPFMXEditPerm (
  425. LPWSTR lpDriveName,
  426. HWND hwndFMX,
  427. DWORD nDialogType
  428. );
  429. typedef DWORD (*PF_NPFMXEditPerm) (
  430. LPWSTR lpDriveName,
  431. HWND hwndFMX,
  432. DWORD nDialogType
  433. );
  434. DWORD APIENTRY
  435. NPFMXGetPermHelp (
  436. LPWSTR lpDriveName,
  437. DWORD nDialogType,
  438. BOOL fDirectory,
  439. LPVOID lpFileNameBuffer,
  440. LPDWORD lpBufferSize,
  441. LPDWORD lpnHelpContext
  442. );
  443. typedef DWORD (*PF_NPFMXGetPermHelp) (
  444. LPWSTR lpDriveName,
  445. DWORD nDialogType,
  446. BOOL fDirectory,
  447. LPVOID lpFileNameBuffer,
  448. LPDWORD lpBufferSize,
  449. LPDWORD lpnHelpContext
  450. );
  451. #endif // _NPAPI_INCLUDED