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