Juan Lang | 2feebb4 | 2004-04-05 23:14:26 +0000 | [diff] [blame] | 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 | |
| 21 | /* capabilities */ |
| 22 | #define WNNC_SPEC_VERSION 0x00000001 |
| 23 | #define WNNC_SPEC_VERSION51 0x00050001 |
| 24 | #define WNNC_NET_TYPE 0x00000002 |
| 25 | #define WNNC_NET_NONE 0x00000000 |
| 26 | |
| 27 | #define WNNC_DRIVER_VERSION 0x00000003 |
| 28 | |
| 29 | #define WNNC_USER 0x00000004 |
| 30 | #define WNNC_USR_GETUSER 0x00000001 |
| 31 | |
| 32 | #define WNNC_CONNECTION 0x00000006 |
| 33 | #define WNNC_CON_ADDCONNECTION 0x00000001 |
| 34 | #define WNNC_CON_CANCELCONNECTION 0x00000002 |
| 35 | #define WNNC_CON_GETCONNECTIONS 0x00000004 |
| 36 | #define WNNC_CON_ADDCONNECTION3 0x00000008 |
| 37 | |
| 38 | #define WNNC_DIALOG 0x00000008 |
| 39 | #define WNNC_DLG_DEVICEMODE 0x00000001 |
| 40 | #define WNNC_DLG_PROPERTYDIALOG 0x00000020 |
| 41 | #define WNNC_DLG_SEARCHDIALOG 0x00000040 |
| 42 | #define WNNC_DLG_FORMATNETWORKNAME 0x00000080 |
| 43 | |
| 44 | #define WNNC_ADMIN 0x00000009 |
| 45 | #define WNNC_ADM_GETDIRECTORYTYPE 0x00000001 |
| 46 | #define WNNC_ADM_DIRECTORYNOTIFY 0x00000002 |
| 47 | |
| 48 | #define WNNC_ENUMERATION 0x0000000b |
| 49 | #define WNNC_ENUM_GLOBAL 0x00000001 |
| 50 | #define WNNC_ENUM_LOCAL 0x00000002 |
| 51 | |
| 52 | #define WNNC_START 0x0000000c |
| 53 | #define WNNC_WAIT_FOR_START 0x00000001 |
| 54 | |
Martin Fuchs | 2bbc794 | 2005-03-14 10:07:40 +0000 | [diff] [blame] | 55 | typedef DWORD (APIENTRY *PF_NPGetCaps)(DWORD ndex); |
Juan Lang | 2feebb4 | 2004-04-05 23:14:26 +0000 | [diff] [blame] | 56 | |
| 57 | /* get user */ |
Martin Fuchs | 2bbc794 | 2005-03-14 10:07:40 +0000 | [diff] [blame] | 58 | typedef DWORD (APIENTRY *PF_NPGetUser)(LPWSTR lpName, LPWSTR lpUserName, |
Juan Lang | 2feebb4 | 2004-04-05 23:14:26 +0000 | [diff] [blame] | 59 | LPDWORD lpnBufferLen); |
| 60 | |
| 61 | /* enumeration-related */ |
Martin Fuchs | 2bbc794 | 2005-03-14 10:07:40 +0000 | [diff] [blame] | 62 | typedef DWORD (APIENTRY *PF_NPOpenEnum)(DWORD dwScope, DWORD dwType, DWORD dwUsage, |
Juan Lang | 2feebb4 | 2004-04-05 23:14:26 +0000 | [diff] [blame] | 63 | LPNETRESOURCEW lpNetResource, LPHANDLE lphEnum); |
Martin Fuchs | 2bbc794 | 2005-03-14 10:07:40 +0000 | [diff] [blame] | 64 | typedef DWORD (APIENTRY *PF_NPEnumResource)(HANDLE hEnum, LPDWORD lpcCount, |
Juan Lang | 2feebb4 | 2004-04-05 23:14:26 +0000 | [diff] [blame] | 65 | LPVOID lpBuffer, LPDWORD lpBufferSize); |
Martin Fuchs | 2bbc794 | 2005-03-14 10:07:40 +0000 | [diff] [blame] | 66 | typedef DWORD (APIENTRY *PF_NPCloseEnum)(HANDLE hEnum); |
Juan Lang | 2feebb4 | 2004-04-05 23:14:26 +0000 | [diff] [blame] | 67 | |
| 68 | /* connection-related */ |
Martin Fuchs | 2bbc794 | 2005-03-14 10:07:40 +0000 | [diff] [blame] | 69 | typedef DWORD (APIENTRY *PF_NPAddConnection)(LPNETRESOURCEW lpNetResource, |
Juan Lang | 2feebb4 | 2004-04-05 23:14:26 +0000 | [diff] [blame] | 70 | LPWSTR lpPassword, LPWSTR lpUserName); |
Martin Fuchs | 2bbc794 | 2005-03-14 10:07:40 +0000 | [diff] [blame] | 71 | typedef DWORD (APIENTRY *PF_NPAddConnection3)(HWND hwndOwner, |
Juan Lang | 2feebb4 | 2004-04-05 23:14:26 +0000 | [diff] [blame] | 72 | LPNETRESOURCEW lpNetResource, LPWSTR lpPassword, LPWSTR lpUserName, |
| 73 | DWORD dwFlags); |
Martin Fuchs | 2bbc794 | 2005-03-14 10:07:40 +0000 | [diff] [blame] | 74 | typedef DWORD (APIENTRY *PF_NPCancelConnection)(LPWSTR lpName, BOOL fForce); |
| 75 | typedef DWORD (APIENTRY *PF_NPGetConnection)(LPWSTR lpLocalName, |
Juan Lang | 2feebb4 | 2004-04-05 23:14:26 +0000 | [diff] [blame] | 76 | LPWSTR lpRemoteName, LPDWORD lpnBufferLen); |
| 77 | |
| 78 | /* network name manipulation */ |
Martin Fuchs | 2bbc794 | 2005-03-14 10:07:40 +0000 | [diff] [blame] | 79 | typedef DWORD (APIENTRY *PF_NPGetUniversalName)(LPWSTR lpLocalPath, |
Juan Lang | 2feebb4 | 2004-04-05 23:14:26 +0000 | [diff] [blame] | 80 | DWORD dwInfoLevel, LPVOID lpBuffer, LPDWORD lpnBufferSize); |
Martin Fuchs | 2bbc794 | 2005-03-14 10:07:40 +0000 | [diff] [blame] | 81 | typedef DWORD (APIENTRY *PF_NPFormatNetworkName)(LPWSTR lpRemoteName, |
Juan Lang | 2feebb4 | 2004-04-05 23:14:26 +0000 | [diff] [blame] | 82 | LPWSTR lpFormattedName, LPDWORD lpnLength, DWORD dwFlags, |
| 83 | DWORD dwAveCharPerLine); |
| 84 | |
| 85 | /* dialogs */ |
Martin Fuchs | 2bbc794 | 2005-03-14 10:07:40 +0000 | [diff] [blame] | 86 | typedef DWORD (APIENTRY *PF_NPDeviceMode)(HWND hParent); |
Juan Lang | 2feebb4 | 2004-04-05 23:14:26 +0000 | [diff] [blame] | 87 | |
| 88 | /* search dialog */ |
| 89 | #define WNSRCH_REFRESH_FIRST_LEVEL 0x00000001 |
| 90 | |
Martin Fuchs | 2bbc794 | 2005-03-14 10:07:40 +0000 | [diff] [blame] | 91 | typedef DWORD (APIENTRY *PF_NPSearchDialog)(HWND hwndParent, |
Juan Lang | 2feebb4 | 2004-04-05 23:14:26 +0000 | [diff] [blame] | 92 | LPNETRESOURCEW lpNetResource, LPVOID lpBuffer, DWORD cbBuffer, |
| 93 | LPDWORD lpnFlags); |
| 94 | |
| 95 | /* property dialog */ |
| 96 | |
| 97 | #define WNTYPE_DRIVE 1 |
| 98 | #define WNTYPE_FILE 2 |
| 99 | #define WNTYPE_PRINTER 3 |
| 100 | #define WNTYPE_COMM 4 |
| 101 | |
| 102 | #define WNPS_FILE 0 |
| 103 | #define WNPS_DIR 1 |
| 104 | #define WNPS_MULT 2 |
| 105 | |
Martin Fuchs | 2bbc794 | 2005-03-14 10:07:40 +0000 | [diff] [blame] | 106 | typedef DWORD (APIENTRY *PF_NPGetPropertyText)(DWORD iButton, DWORD nPropSel, |
Juan Lang | 2feebb4 | 2004-04-05 23:14:26 +0000 | [diff] [blame] | 107 | LPWSTR lpName, LPWSTR lpButtonName, DWORD nButtonNameLen, DWORD nType); |
| 108 | |
Martin Fuchs | 2bbc794 | 2005-03-14 10:07:40 +0000 | [diff] [blame] | 109 | typedef DWORD (APIENTRY *PF_NPPropertyDialog)(HWND hwndParent, DWORD iButtonDlg, |
Juan Lang | 2feebb4 | 2004-04-05 23:14:26 +0000 | [diff] [blame] | 110 | DWORD nPropSel, LPWSTR lpFileName, DWORD nType); |
| 111 | |
| 112 | /* admin */ |
| 113 | #define WNDT_NORMAL 0 |
| 114 | #define WNDT_NETWORK 1 |
| 115 | |
| 116 | #define WNDN_MKDIR 1 |
| 117 | #define WNDN_RMDIR 2 |
| 118 | #define WNDN_MVDIR 3 |
| 119 | |
Martin Fuchs | 2bbc794 | 2005-03-14 10:07:40 +0000 | [diff] [blame] | 120 | typedef DWORD (APIENTRY *PF_NPGetDirectoryType)(LPWSTR lpName, LPINT lpType, |
Juan Lang | 2feebb4 | 2004-04-05 23:14:26 +0000 | [diff] [blame] | 121 | BOOL bFlushCache); |
Martin Fuchs | 2bbc794 | 2005-03-14 10:07:40 +0000 | [diff] [blame] | 122 | typedef DWORD (APIENTRY *PF_NPDirectoryNotify)(HWND hwnd, LPWSTR lpDir, |
Juan Lang | 2feebb4 | 2004-04-05 23:14:26 +0000 | [diff] [blame] | 123 | DWORD dwOper); |
| 124 | |
| 125 | /* permission editor dialogs */ |
| 126 | #define WNPERMC_PERM 0x00000001 |
| 127 | #define WNPERMC_AUDIT 0x00000002 |
| 128 | #define WNPERMC_OWNER 0x00000004 |
| 129 | |
Martin Fuchs | 2bbc794 | 2005-03-14 10:07:40 +0000 | [diff] [blame] | 130 | typedef DWORD (APIENTRY *PF_NPFMXGetPermCaps)(LPWSTR lpDriveName); |
Juan Lang | 2feebb4 | 2004-04-05 23:14:26 +0000 | [diff] [blame] | 131 | |
| 132 | #define WNPERM_DLG_PERM 0 |
| 133 | #define WNPERM_DLG_AUDIT 1 |
| 134 | #define WNPERM_DLG_OWNER 2 |
| 135 | |
Martin Fuchs | 2bbc794 | 2005-03-14 10:07:40 +0000 | [diff] [blame] | 136 | typedef DWORD (APIENTRY *PF_NPFMXEditPerm)(LPWSTR lpDriveName, HWND hwndFMX, |
Juan Lang | 2feebb4 | 2004-04-05 23:14:26 +0000 | [diff] [blame] | 137 | DWORD nDialogType); |
| 138 | |
Martin Fuchs | 2bbc794 | 2005-03-14 10:07:40 +0000 | [diff] [blame] | 139 | typedef DWORD (APIENTRY *PF_NPFMXGetPermHelp)(LPWSTR lpDriveName, |
Juan Lang | 2feebb4 | 2004-04-05 23:14:26 +0000 | [diff] [blame] | 140 | DWORD nDialogType, BOOL fDirectory, LPVOID lpFileNameBuffer, |
| 141 | LPDWORD lpBufferSize, LPDWORD lpnHelpContext); |
| 142 | |
| 143 | VOID WINAPI WNetSetLastErrorA(DWORD err, LPSTR lpError, LPSTR lpProviders); |
| 144 | VOID WINAPI WNetSetLastErrorW(DWORD err, LPWSTR lpError, LPWSTR lpProviders); |
| 145 | #define WNetSetLastError WINELIB_NAME_AW(WNetSetLastError) |
| 146 | |
| 147 | /* provider classes */ |
| 148 | #define WN_NETWORK_CLASS 0x00000001 |
| 149 | #define WN_CREDENTIAL_CLASS 0x00000002 |
| 150 | #define WN_PRIMARY_AUTHENT_CLASS 0x00000004 |
| 151 | #define WN_SERVICE_CLASS 0x00000008 |
| 152 | |
| 153 | #define WN_VALID_LOGON_ACCOUNT 0x00000001 |
| 154 | #define WN_NT_PASSWORD_CHANGED 0x00000002 |
| 155 | |
| 156 | /* notifications */ |
Martin Fuchs | 2bbc794 | 2005-03-14 10:07:40 +0000 | [diff] [blame] | 157 | typedef DWORD (APIENTRY *PF_NPLogonNotify)(PLUID lpLogonId, |
Juan Lang | 2feebb4 | 2004-04-05 23:14:26 +0000 | [diff] [blame] | 158 | LPCWSTR lpAuthentInfoType, LPVOID lpAuthentInfo, |
| 159 | LPCWSTR lpPreviousAuthentInfoType, LPVOID lpPreviousAuthentInfo, |
| 160 | LPWSTR lpStationName, LPVOID StationHandle, LPWSTR *lpLogonScript); |
Martin Fuchs | 2bbc794 | 2005-03-14 10:07:40 +0000 | [diff] [blame] | 161 | typedef DWORD (APIENTRY *PF_NPPasswordChangeNotify)(LPCWSTR lpAuthentInfoType, |
Juan Lang | 2feebb4 | 2004-04-05 23:14:26 +0000 | [diff] [blame] | 162 | LPVOID lpAuthentInfo, LPCWSTR lpPreviousAuthentInfoType, |
| 163 | LPVOID lpPreviousAuthentInfo, LPWSTR lpStationName, LPVOID StationHandle, |
| 164 | DWORD dwChangeInfo); |
| 165 | |
| 166 | #define NOTIFY_PRE 0x00000001 |
| 167 | #define NOTIFY_POST 0x00000002 |
| 168 | |
| 169 | typedef struct _NOTIFYINFO |
| 170 | { |
| 171 | DWORD dwNotifyStatus; |
| 172 | DWORD dwOperationStatus; |
| 173 | LPVOID lpContext; |
| 174 | } NOTIFYINFO, *LPNOTIFYINFO; |
| 175 | |
| 176 | /* FIXME: NetResource is declared as a NETRESOURCE in psdk, not a NETRESOURCEW, |
| 177 | * but how can the type change in a service provider? Defaulting to wide-char |
| 178 | * for consistency with the rest of the api. |
| 179 | */ |
| 180 | typedef struct _NOTIFYADD |
| 181 | { |
| 182 | HWND hwndOwner; |
| 183 | NETRESOURCEW NetResource; |
| 184 | DWORD dwAddFlags; |
| 185 | } NOTIFYADD, *LPNOTIFYADD; |
| 186 | |
| 187 | /* FIXME: lpName and lpProvider are declared as LPTSTRs in psdk, but again |
| 188 | * for consistency with rest of api defaulting to LPWSTRs. |
| 189 | */ |
| 190 | typedef struct _NOTIFYCANCEL |
| 191 | { |
| 192 | LPWSTR lpName; |
| 193 | LPWSTR lpProvider; |
| 194 | DWORD dwFlags; |
| 195 | BOOL fForce; |
| 196 | } NOTIFYCANCEL, *LPNOTIFYCANCEL; |
| 197 | |
Martin Fuchs | 2bbc794 | 2005-03-14 10:07:40 +0000 | [diff] [blame] | 198 | typedef DWORD (APIENTRY *PF_AddConnectNotify)(LPNOTIFYINFO lpNotifyInfo, |
Juan Lang | 2feebb4 | 2004-04-05 23:14:26 +0000 | [diff] [blame] | 199 | LPNOTIFYADD lpAddInfo); |
Martin Fuchs | 2bbc794 | 2005-03-14 10:07:40 +0000 | [diff] [blame] | 200 | typedef DWORD (APIENTRY *PF_CancelConnectNotify)(LPNOTIFYINFO lpNotifyInfo, |
Juan Lang | 2feebb4 | 2004-04-05 23:14:26 +0000 | [diff] [blame] | 201 | LPNOTIFYADD lpAddInfo); |
| 202 | |
| 203 | #endif /* ndef __WINE_NPAPI_H__ */ |