npapi.h 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. /*
  2. * Copyright (C) 2004 Juan Lang
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. */
  18. #ifndef __WINE_NPAPI_H__
  19. #define __WINE_NPAPI_H__
  20. /* capabilities */
  21. #define WNNC_SPEC_VERSION 0x00000001
  22. #define WNNC_SPEC_VERSION51 0x00050001
  23. #define WNNC_NET_TYPE 0x00000002
  24. #define WNNC_NET_NONE 0x00000000
  25. #define WNNC_DRIVER_VERSION 0x00000003
  26. #define WNNC_USER 0x00000004
  27. #define WNNC_USR_GETUSER 0x00000001
  28. #define WNNC_CONNECTION 0x00000006
  29. #define WNNC_CON_ADDCONNECTION 0x00000001
  30. #define WNNC_CON_CANCELCONNECTION 0x00000002
  31. #define WNNC_CON_GETCONNECTIONS 0x00000004
  32. #define WNNC_CON_ADDCONNECTION3 0x00000008
  33. #define WNNC_DIALOG 0x00000008
  34. #define WNNC_DLG_DEVICEMODE 0x00000001
  35. #define WNNC_DLG_PROPERTYDIALOG 0x00000020
  36. #define WNNC_DLG_SEARCHDIALOG 0x00000040
  37. #define WNNC_DLG_FORMATNETWORKNAME 0x00000080
  38. #define WNNC_ADMIN 0x00000009
  39. #define WNNC_ADM_GETDIRECTORYTYPE 0x00000001
  40. #define WNNC_ADM_DIRECTORYNOTIFY 0x00000002
  41. #define WNNC_ENUMERATION 0x0000000b
  42. #define WNNC_ENUM_GLOBAL 0x00000001
  43. #define WNNC_ENUM_LOCAL 0x00000002
  44. #define WNNC_START 0x0000000c
  45. #define WNNC_WAIT_FOR_START 0x00000001
  46. typedef DWORD APIENTRY (*PF_NPGetCaps)(DWORD ndex);
  47. /* get user */
  48. typedef DWORD APIENTRY (*PF_NPGetUser)(LPWSTR lpName, LPWSTR lpUserName,
  49. LPDWORD lpnBufferLen);
  50. /* enumeration-related */
  51. typedef DWORD APIENTRY (*PF_NPOpenEnum)(DWORD dwScope, DWORD dwType, DWORD dwUsage,
  52. LPNETRESOURCEW lpNetResource, LPHANDLE lphEnum);
  53. typedef DWORD APIENTRY (*PF_NPEnumResource)(HANDLE hEnum, LPDWORD lpcCount,
  54. LPVOID lpBuffer, LPDWORD lpBufferSize);
  55. typedef DWORD APIENTRY (*PF_NPCloseEnum)(HANDLE hEnum);
  56. /* connection-related */
  57. typedef DWORD APIENTRY (*PF_NPAddConnection)(LPNETRESOURCEW lpNetResource,
  58. LPWSTR lpPassword, LPWSTR lpUserName);
  59. typedef DWORD APIENTRY (*PF_NPAddConnection3)(HWND hwndOwner,
  60. LPNETRESOURCEW lpNetResource, LPWSTR lpPassword, LPWSTR lpUserName,
  61. DWORD dwFlags);
  62. typedef DWORD APIENTRY (*PF_NPCancelConnection)(LPWSTR lpName, BOOL fForce);
  63. typedef DWORD APIENTRY (*PF_NPGetConnection)(LPWSTR lpLocalName,
  64. LPWSTR lpRemoteName, LPDWORD lpnBufferLen);
  65. /* network name manipulation */
  66. typedef DWORD APIENTRY (*PF_NPGetUniversalName)(LPWSTR lpLocalPath,
  67. DWORD dwInfoLevel, LPVOID lpBuffer, LPDWORD lpnBufferSize);
  68. typedef DWORD APIENTRY (*PF_NPFormatNetworkName)(LPWSTR lpRemoteName,
  69. LPWSTR lpFormattedName, LPDWORD lpnLength, DWORD dwFlags,
  70. DWORD dwAveCharPerLine);
  71. /* dialogs */
  72. typedef DWORD APIENTRY (*PF_NPDeviceMode)(HWND hParent);
  73. /* search dialog */
  74. #define WNSRCH_REFRESH_FIRST_LEVEL 0x00000001
  75. typedef DWORD APIENTRY (*PF_NPSearchDialog)(HWND hwndParent,
  76. LPNETRESOURCEW lpNetResource, LPVOID lpBuffer, DWORD cbBuffer,
  77. LPDWORD lpnFlags);
  78. /* property dialog */
  79. #define WNTYPE_DRIVE 1
  80. #define WNTYPE_FILE 2
  81. #define WNTYPE_PRINTER 3
  82. #define WNTYPE_COMM 4
  83. #define WNPS_FILE 0
  84. #define WNPS_DIR 1
  85. #define WNPS_MULT 2
  86. typedef DWORD APIENTRY (*PF_NPGetPropertyText)(DWORD iButton, DWORD nPropSel,
  87. LPWSTR lpName, LPWSTR lpButtonName, DWORD nButtonNameLen, DWORD nType);
  88. typedef DWORD APIENTRY (*PF_NPPropertyDialog)(HWND hwndParent, DWORD iButtonDlg,
  89. DWORD nPropSel, LPWSTR lpFileName, DWORD nType);
  90. /* admin */
  91. #define WNDT_NORMAL 0
  92. #define WNDT_NETWORK 1
  93. #define WNDN_MKDIR 1
  94. #define WNDN_RMDIR 2
  95. #define WNDN_MVDIR 3
  96. typedef DWORD APIENTRY (*PF_NPGetDirectoryType)(LPWSTR lpName, LPINT lpType,
  97. BOOL bFlushCache);
  98. typedef DWORD APIENTRY (*PF_NPDirectoryNotify)(HWND hwnd, LPWSTR lpDir,
  99. DWORD dwOper);
  100. /* permission editor dialogs */
  101. #define WNPERMC_PERM 0x00000001
  102. #define WNPERMC_AUDIT 0x00000002
  103. #define WNPERMC_OWNER 0x00000004
  104. typedef DWORD APIENTRY (*PF_NPFMXGetPermCaps)(LPWSTR lpDriveName);
  105. #define WNPERM_DLG_PERM 0
  106. #define WNPERM_DLG_AUDIT 1
  107. #define WNPERM_DLG_OWNER 2
  108. typedef DWORD APIENTRY (*PF_NPFMXEditPerm)(LPWSTR lpDriveName, HWND hwndFMX,
  109. DWORD nDialogType);
  110. typedef DWORD APIENTRY (*PF_NPFMXGetPermHelp)(LPWSTR lpDriveName,
  111. DWORD nDialogType, BOOL fDirectory, LPVOID lpFileNameBuffer,
  112. LPDWORD lpBufferSize, LPDWORD lpnHelpContext);
  113. VOID WINAPI WNetSetLastErrorA(DWORD err, LPSTR lpError, LPSTR lpProviders);
  114. VOID WINAPI WNetSetLastErrorW(DWORD err, LPWSTR lpError, LPWSTR lpProviders);
  115. #define WNetSetLastError WINELIB_NAME_AW(WNetSetLastError)
  116. /* provider classes */
  117. #define WN_NETWORK_CLASS 0x00000001
  118. #define WN_CREDENTIAL_CLASS 0x00000002
  119. #define WN_PRIMARY_AUTHENT_CLASS 0x00000004
  120. #define WN_SERVICE_CLASS 0x00000008
  121. #define WN_VALID_LOGON_ACCOUNT 0x00000001
  122. #define WN_NT_PASSWORD_CHANGED 0x00000002
  123. /* notifications */
  124. typedef DWORD APIENTRY (*PF_NPLogonNotify)(PLUID lpLogonId,
  125. LPCWSTR lpAuthentInfoType, LPVOID lpAuthentInfo,
  126. LPCWSTR lpPreviousAuthentInfoType, LPVOID lpPreviousAuthentInfo,
  127. LPWSTR lpStationName, LPVOID StationHandle, LPWSTR *lpLogonScript);
  128. typedef DWORD APIENTRY (*PF_NPPasswordChangeNotify)(LPCWSTR lpAuthentInfoType,
  129. LPVOID lpAuthentInfo, LPCWSTR lpPreviousAuthentInfoType,
  130. LPVOID lpPreviousAuthentInfo, LPWSTR lpStationName, LPVOID StationHandle,
  131. DWORD dwChangeInfo);
  132. #define NOTIFY_PRE 0x00000001
  133. #define NOTIFY_POST 0x00000002
  134. typedef struct _NOTIFYINFO
  135. {
  136. DWORD dwNotifyStatus;
  137. DWORD dwOperationStatus;
  138. LPVOID lpContext;
  139. } NOTIFYINFO, *LPNOTIFYINFO;
  140. /* FIXME: NetResource is declared as a NETRESOURCE in psdk, not a NETRESOURCEW,
  141. * but how can the type change in a service provider? Defaulting to wide-char
  142. * for consistency with the rest of the api.
  143. */
  144. typedef struct _NOTIFYADD
  145. {
  146. HWND hwndOwner;
  147. NETRESOURCEW NetResource;
  148. DWORD dwAddFlags;
  149. } NOTIFYADD, *LPNOTIFYADD;
  150. /* FIXME: lpName and lpProvider are declared as LPTSTRs in psdk, but again
  151. * for consistency with rest of api defaulting to LPWSTRs.
  152. */
  153. typedef struct _NOTIFYCANCEL
  154. {
  155. LPWSTR lpName;
  156. LPWSTR lpProvider;
  157. DWORD dwFlags;
  158. BOOL fForce;
  159. } NOTIFYCANCEL, *LPNOTIFYCANCEL;
  160. typedef DWORD APIENTRY (*PF_AddConnectNotify)(LPNOTIFYINFO lpNotifyInfo,
  161. LPNOTIFYADD lpAddInfo);
  162. typedef DWORD APIENTRY (*PF_CancelConnectNotify)(LPNOTIFYINFO lpNotifyInfo,
  163. LPNOTIFYADD lpAddInfo);
  164. #endif /* ndef __WINE_NPAPI_H__ */