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.

637 lines
14 KiB

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