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