npapi.h 7.31 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/*
 * Copyright (C) 2004 Juan Lang
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
16
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 18 19 20
 */
#ifndef __WINE_NPAPI_H__
#define __WINE_NPAPI_H__

21 22 23 24
#ifdef __cplusplus
extern "C" {
#endif

25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
/* capabilities */
#define WNNC_SPEC_VERSION          0x00000001
#define WNNC_SPEC_VERSION51        0x00050001
#define WNNC_NET_TYPE              0x00000002
#define WNNC_NET_NONE              0x00000000

#define WNNC_DRIVER_VERSION        0x00000003

#define WNNC_USER                  0x00000004
#define WNNC_USR_GETUSER           0x00000001

#define WNNC_CONNECTION            0x00000006
#define WNNC_CON_ADDCONNECTION     0x00000001
#define WNNC_CON_CANCELCONNECTION  0x00000002
#define WNNC_CON_GETCONNECTIONS    0x00000004
#define WNNC_CON_ADDCONNECTION3    0x00000008
41 42
#define WNNC_CON_GETPERFORMANCE    0x00000040
#define WNNC_CON_DEFER             0x00000080
43 44 45 46 47 48

#define WNNC_DIALOG                0x00000008
#define WNNC_DLG_DEVICEMODE        0x00000001
#define WNNC_DLG_PROPERTYDIALOG    0x00000020
#define WNNC_DLG_SEARCHDIALOG      0x00000040
#define WNNC_DLG_FORMATNETWORKNAME 0x00000080
49 50 51
#define WNNC_DLG_PERMISSIONEDITOR  0x00000100
#define WNNC_DLG_GETRESOURCEPARENT 0x00000200
#define WNNC_DLG_GETRESOURCEINFORMATION 0x00000800
52 53 54 55 56 57 58 59

#define WNNC_ADMIN                 0x00000009
#define WNNC_ADM_GETDIRECTORYTYPE  0x00000001
#define WNNC_ADM_DIRECTORYNOTIFY   0x00000002

#define WNNC_ENUMERATION           0x0000000b
#define WNNC_ENUM_GLOBAL           0x00000001
#define WNNC_ENUM_LOCAL            0x00000002
60
#define WNNC_ENUM_CONTEXT          0x00000004
61 62 63 64

#define WNNC_START                 0x0000000c
#define WNNC_WAIT_FOR_START        0x00000001

65
typedef DWORD (APIENTRY *PF_NPGetCaps)(DWORD ndex);
66 67

/* get user */
68
typedef DWORD (APIENTRY *PF_NPGetUser)(LPWSTR lpName, LPWSTR lpUserName,
69 70 71
 LPDWORD lpnBufferLen);

/* enumeration-related */
72
typedef DWORD (APIENTRY *PF_NPOpenEnum)(DWORD dwScope, DWORD dwType, DWORD dwUsage,
73
 LPNETRESOURCEW lpNetResource, LPHANDLE lphEnum);
74
typedef DWORD (APIENTRY *PF_NPEnumResource)(HANDLE hEnum, LPDWORD lpcCount,
75
 LPVOID lpBuffer, LPDWORD lpBufferSize);
76
typedef DWORD (APIENTRY *PF_NPCloseEnum)(HANDLE hEnum);
77 78
typedef DWORD (APIENTRY *PF_NPGetResourceInformation)(LPNETRESOURCEW lpNetResource,
 LPVOID lpBuffer, LPDWORD lpcbBuffer, LPWSTR* lplpSystem);
79 80

/* connection-related */
81
typedef DWORD (APIENTRY *PF_NPAddConnection)(LPNETRESOURCEW lpNetResource,
82
 LPWSTR lpPassword, LPWSTR lpUserName);
83
typedef DWORD (APIENTRY *PF_NPAddConnection3)(HWND hwndOwner,
84 85
 LPNETRESOURCEW lpNetResource, LPWSTR lpPassword, LPWSTR lpUserName,
 DWORD dwFlags);
86 87
typedef DWORD (APIENTRY *PF_NPCancelConnection)(LPWSTR lpName, BOOL fForce);
typedef DWORD (APIENTRY *PF_NPGetConnection)(LPWSTR lpLocalName,
88 89 90
 LPWSTR lpRemoteName, LPDWORD lpnBufferLen);

/* network name manipulation */
91
typedef DWORD (APIENTRY *PF_NPGetUniversalName)(LPWSTR lpLocalPath,
92
 DWORD dwInfoLevel, LPVOID lpBuffer, LPDWORD lpnBufferSize);
93
typedef DWORD (APIENTRY *PF_NPFormatNetworkName)(LPWSTR lpRemoteName,
94 95 96 97
 LPWSTR lpFormattedName, LPDWORD lpnLength, DWORD dwFlags,
 DWORD dwAveCharPerLine);

/* dialogs */
98
typedef DWORD (APIENTRY *PF_NPDeviceMode)(HWND hParent);
99 100 101 102

/* search dialog */
#define WNSRCH_REFRESH_FIRST_LEVEL 0x00000001

103
typedef DWORD (APIENTRY *PF_NPSearchDialog)(HWND hwndParent,
104 105 106 107 108 109 110 111 112 113 114 115 116 117
 LPNETRESOURCEW lpNetResource, LPVOID lpBuffer, DWORD cbBuffer,
 LPDWORD lpnFlags);

/* property dialog */

#define WNTYPE_DRIVE   1
#define WNTYPE_FILE    2
#define WNTYPE_PRINTER 3
#define WNTYPE_COMM    4

#define WNPS_FILE 0
#define WNPS_DIR  1
#define WNPS_MULT 2

118
typedef DWORD (APIENTRY *PF_NPGetPropertyText)(DWORD iButton, DWORD nPropSel,
119 120
 LPWSTR lpName, LPWSTR lpButtonName, DWORD nButtonNameLen, DWORD nType);

121
typedef DWORD (APIENTRY *PF_NPPropertyDialog)(HWND hwndParent, DWORD iButtonDlg,
122 123 124 125 126 127 128 129 130 131
 DWORD nPropSel, LPWSTR lpFileName, DWORD nType);

/* admin */
#define WNDT_NORMAL  0
#define WNDT_NETWORK 1

#define WNDN_MKDIR 1
#define WNDN_RMDIR 2
#define WNDN_MVDIR 3

132
typedef DWORD (APIENTRY *PF_NPGetDirectoryType)(LPWSTR lpName, LPINT lpType,
133
 BOOL bFlushCache);
134
typedef DWORD (APIENTRY *PF_NPDirectoryNotify)(HWND hwnd, LPWSTR lpDir,
135 136 137 138 139 140 141
 DWORD dwOper);

/* permission editor dialogs */
#define WNPERMC_PERM  0x00000001
#define WNPERMC_AUDIT 0x00000002
#define WNPERMC_OWNER 0x00000004

142
typedef DWORD (APIENTRY *PF_NPFMXGetPermCaps)(LPWSTR lpDriveName);
143 144 145 146 147

#define WNPERM_DLG_PERM  0
#define WNPERM_DLG_AUDIT 1
#define WNPERM_DLG_OWNER 2

148
typedef DWORD (APIENTRY *PF_NPFMXEditPerm)(LPWSTR lpDriveName, HWND hwndFMX,
149 150
 DWORD nDialogType);

151
typedef DWORD (APIENTRY *PF_NPFMXGetPermHelp)(LPWSTR lpDriveName,
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
 DWORD nDialogType, BOOL fDirectory, LPVOID lpFileNameBuffer,
 LPDWORD lpBufferSize, LPDWORD lpnHelpContext);

VOID WINAPI WNetSetLastErrorA(DWORD err, LPSTR lpError, LPSTR lpProviders);
VOID WINAPI WNetSetLastErrorW(DWORD err, LPWSTR lpError, LPWSTR lpProviders);
#define WNetSetLastError WINELIB_NAME_AW(WNetSetLastError)

/* provider classes */
#define WN_NETWORK_CLASS         0x00000001
#define WN_CREDENTIAL_CLASS      0x00000002
#define WN_PRIMARY_AUTHENT_CLASS 0x00000004
#define WN_SERVICE_CLASS         0x00000008

#define WN_VALID_LOGON_ACCOUNT   0x00000001
#define WN_NT_PASSWORD_CHANGED   0x00000002

/* notifications */
169
typedef DWORD (APIENTRY *PF_NPLogonNotify)(PLUID lpLogonId,
170 171 172
 LPCWSTR lpAuthentInfoType, LPVOID lpAuthentInfo,
 LPCWSTR lpPreviousAuthentInfoType, LPVOID lpPreviousAuthentInfo,
 LPWSTR lpStationName, LPVOID StationHandle, LPWSTR *lpLogonScript);
173
typedef DWORD (APIENTRY *PF_NPPasswordChangeNotify)(LPCWSTR lpAuthentInfoType,
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209
 LPVOID lpAuthentInfo, LPCWSTR lpPreviousAuthentInfoType,
 LPVOID lpPreviousAuthentInfo, LPWSTR lpStationName, LPVOID StationHandle,
 DWORD dwChangeInfo);

#define NOTIFY_PRE  0x00000001
#define NOTIFY_POST 0x00000002

typedef struct _NOTIFYINFO
{
    DWORD  dwNotifyStatus;
    DWORD  dwOperationStatus;
    LPVOID lpContext;
} NOTIFYINFO, *LPNOTIFYINFO;

/* FIXME: NetResource is declared as a NETRESOURCE in psdk, not a NETRESOURCEW,
 * but how can the type change in a service provider?  Defaulting to wide-char
 * for consistency with the rest of the api.
 */
typedef struct _NOTIFYADD
{
    HWND         hwndOwner;
    NETRESOURCEW NetResource;
    DWORD        dwAddFlags;
} NOTIFYADD, *LPNOTIFYADD;

/* FIXME: lpName and lpProvider are declared as LPTSTRs in psdk, but again
 * for consistency with rest of api defaulting to LPWSTRs.
 */
typedef struct _NOTIFYCANCEL
{
    LPWSTR lpName;
    LPWSTR lpProvider;
    DWORD  dwFlags;
    BOOL   fForce;
} NOTIFYCANCEL, *LPNOTIFYCANCEL;

210
typedef DWORD (APIENTRY *PF_AddConnectNotify)(LPNOTIFYINFO lpNotifyInfo,
211
 LPNOTIFYADD lpAddInfo);
212
typedef DWORD (APIENTRY *PF_CancelConnectNotify)(LPNOTIFYINFO lpNotifyInfo,
213 214
 LPNOTIFYADD lpAddInfo);

215 216 217 218
#ifdef __cplusplus
}
#endif

219
#endif /* ndef __WINE_NPAPI_H__ */