msxml3: Corrected Entity Reference Test.
[wine.git] / dlls / mpr / nps.c
blob2f75674b903f8986536283c11f4fc436ce206b86
1 /*
2 * MPR Network Provider Services functions
4 * Copyright 1999 Ulrich Weigand
5 * Copyright 2004 Mike McCormack for CodeWeavers Inc.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #include "config.h"
24 #include <stdarg.h>
26 #include "windef.h"
27 #include "winbase.h"
28 #include "winuser.h"
29 #include "netspi.h"
30 #include "wine/debug.h"
31 #include "winerror.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(mpr);
35 #include "wine/unicode.h"
37 #include "mprres.h"
39 /***********************************************************************
40 * NPS_ProxyPasswordDialog
42 static INT_PTR WINAPI NPS_ProxyPasswordDialog(
43 HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
45 HWND hitem;
46 LPAUTHDLGSTRUCTA lpAuthDlgStruct;
48 if( uMsg == WM_INITDIALOG )
50 TRACE("WM_INITDIALOG (%08lx)\n", lParam);
52 /* save the parameter list */
53 lpAuthDlgStruct = (LPAUTHDLGSTRUCTA) lParam;
54 SetWindowLongPtrW( hdlg, GWLP_USERDATA, lParam );
56 if( lpAuthDlgStruct->lpExplainText )
58 hitem = GetDlgItem( hdlg, IDC_EXPLAIN );
59 SetWindowTextA( hitem, lpAuthDlgStruct->lpExplainText );
62 /* extract the Realm from the proxy response and show it */
63 if( lpAuthDlgStruct->lpResource )
65 hitem = GetDlgItem( hdlg, IDC_REALM );
66 SetWindowTextA( hitem, lpAuthDlgStruct->lpResource );
69 return TRUE;
72 lpAuthDlgStruct = (LPAUTHDLGSTRUCTA) GetWindowLongPtrW( hdlg, GWLP_USERDATA );
74 switch( uMsg )
76 case WM_COMMAND:
77 if( wParam == IDOK )
79 WCHAR username[0x20], password[0x20];
81 username[0] = 0;
82 hitem = GetDlgItem( hdlg, IDC_USERNAME );
83 if( hitem )
84 GetWindowTextA( hitem, lpAuthDlgStruct->lpUsername, lpAuthDlgStruct->cbUsername );
86 password[0] = 0;
87 hitem = GetDlgItem( hdlg, IDC_PASSWORD );
88 if( hitem )
89 GetWindowTextA( hitem, lpAuthDlgStruct->lpPassword, lpAuthDlgStruct->cbPassword );
91 EndDialog( hdlg, WN_SUCCESS );
92 return TRUE;
94 if( wParam == IDCANCEL )
96 EndDialog( hdlg, WN_CANCEL );
97 return TRUE;
99 break;
101 return FALSE;
104 /*****************************************************************
105 * NPSAuthenticationDialogA [MPR.@]
107 DWORD WINAPI NPSAuthenticationDialogA( LPAUTHDLGSTRUCTA lpAuthDlgStruct )
109 HMODULE hwininet = GetModuleHandleA( "mpr.dll" );
111 TRACE("%p\n", lpAuthDlgStruct);
113 if( !lpAuthDlgStruct )
114 return WN_BAD_POINTER;
115 if( lpAuthDlgStruct->cbStructure < sizeof *lpAuthDlgStruct )
116 return WN_BAD_POINTER;
118 TRACE("%s %s %s\n",lpAuthDlgStruct->lpResource,
119 lpAuthDlgStruct->lpOUTitle, lpAuthDlgStruct->lpExplainText);
121 return DialogBoxParamW( hwininet, MAKEINTRESOURCEW( IDD_PROXYDLG ),
122 lpAuthDlgStruct->hwndOwner, NPS_ProxyPasswordDialog,
123 (LPARAM) lpAuthDlgStruct );
126 /*****************************************************************
127 * NPSGetProviderHandleA [MPR.@]
129 DWORD WINAPI NPSGetProviderHandleA( PHPROVIDER phProvider )
131 FIXME( "(%p): stub\n", phProvider );
132 return WN_NOT_SUPPORTED;
135 /*****************************************************************
136 * NPSGetProviderNameA [MPR.@]
138 DWORD WINAPI NPSGetProviderNameA( HPROVIDER hProvider, LPCSTR *lpszProviderName )
140 FIXME( "(%p, %p): stub\n", hProvider, lpszProviderName );
141 return WN_NOT_SUPPORTED;
144 /*****************************************************************
145 * NPSGetSectionNameA [MPR.@]
147 DWORD WINAPI NPSGetSectionNameA( HPROVIDER hProvider, LPCSTR *lpszSectionName )
149 FIXME( "(%p, %p): stub\n", hProvider, lpszSectionName );
150 return WN_NOT_SUPPORTED;
153 /*****************************************************************
154 * NPSSetExtendedErrorA [MPR.@]
156 DWORD WINAPI NPSSetExtendedErrorA( DWORD NetSpecificError, LPSTR lpExtendedErrorText )
158 FIXME( "(%08x, %s): stub\n", NetSpecificError, debugstr_a(lpExtendedErrorText) );
159 return WN_NOT_SUPPORTED;
162 /*****************************************************************
163 * NPSSetCustomTextA [MPR.@]
165 VOID WINAPI NPSSetCustomTextA( LPSTR lpCustomErrorText )
167 FIXME( "(%s): stub\n", debugstr_a(lpCustomErrorText) );
170 /*****************************************************************
171 * NPSCopyStringA [MPR.@]
173 DWORD WINAPI NPSCopyStringA( LPCSTR lpString, LPVOID lpBuffer, LPDWORD lpdwBufferSize )
175 FIXME( "(%s, %p, %p): stub\n", debugstr_a(lpString), lpBuffer, lpdwBufferSize );
176 return WN_NOT_SUPPORTED;
179 /*****************************************************************
180 * NPSDeviceGetNumberA [MPR.@]
182 DWORD WINAPI NPSDeviceGetNumberA( LPSTR lpLocalName, LPDWORD lpdwNumber, LPDWORD lpdwType )
184 FIXME( "(%s, %p, %p): stub\n", debugstr_a(lpLocalName), lpdwNumber, lpdwType );
185 return WN_NOT_SUPPORTED;
188 /*****************************************************************
189 * NPSDeviceGetStringA [MPR.@]
191 DWORD WINAPI NPSDeviceGetStringA( DWORD dwNumber, DWORD dwType, LPSTR lpLocalName, LPDWORD lpdwBufferSize )
193 FIXME( "(%d, %d, %p, %p): stub\n", dwNumber, dwType, lpLocalName, lpdwBufferSize );
194 return WN_NOT_SUPPORTED;
197 /*****************************************************************
198 * NPSNotifyRegisterA [MPR.@]
200 DWORD WINAPI NPSNotifyRegisterA( enum NOTIFYTYPE NotifyType, NOTIFYCALLBACK pfNotifyCallBack )
202 FIXME( "(%d, %p): stub\n", NotifyType, pfNotifyCallBack );
203 return WN_NOT_SUPPORTED;
206 /*****************************************************************
207 * NPSNotifyGetContextA [MPR.@]
209 LPVOID WINAPI NPSNotifyGetContextA( NOTIFYCALLBACK pfNotifyCallBack )
211 FIXME( "(%p): stub\n", pfNotifyCallBack );
212 return NULL;
215 /*****************************************************************
216 * PwdGetPasswordStatusA [MPR.@]
218 DWORD WINAPI PwdGetPasswordStatusA( LPCSTR lpProvider, DWORD dwIndex, LPDWORD status )
220 FIXME("%s %d %p\n", debugstr_a(lpProvider), dwIndex, status );
221 *status = 0;
222 return WN_SUCCESS;
225 /*****************************************************************
226 * PwdGetPasswordStatusA [MPR.@]
228 DWORD WINAPI PwdGetPasswordStatusW( LPCWSTR lpProvider, DWORD dwIndex, LPDWORD status )
230 FIXME("%s %d %p\n", debugstr_w(lpProvider), dwIndex, status );
231 *status = 0;
232 return WN_SUCCESS;
235 /*****************************************************************
236 * PwdSetPasswordStatusA [MPR.@]
238 DWORD WINAPI PwdSetPasswordStatusA( LPCSTR lpProvider, DWORD dwIndex, DWORD status )
240 FIXME("%s %d %d\n", debugstr_a(lpProvider), dwIndex, status );
241 return WN_SUCCESS;
244 /*****************************************************************
245 * PwdSetPasswordStatusW [MPR.@]
247 DWORD WINAPI PwdSetPasswordStatusW( LPCWSTR lpProvider, DWORD dwIndex, DWORD status )
249 FIXME("%s %d %d\n", debugstr_w(lpProvider), dwIndex, status );
250 return WN_SUCCESS;
253 typedef struct _CHANGEPWDINFOA {
254 LPSTR lpUsername;
255 LPSTR lpPassword;
256 DWORD cbPassword;
257 } CHANGEPWDINFOA, *LPCHANGEPWDINFOA;
259 typedef struct _CHANGEPWDINFOW {
260 LPWSTR lpUsername;
261 LPWSTR lpPassword;
262 DWORD cbPassword;
263 } CHANGEPWDINFOW, *LPCHANGEPWDINFOW;
265 /*****************************************************************
266 * PwdChangePasswordA [MPR.@]
268 DWORD WINAPI PwdChangePasswordA( LPCSTR lpProvider, HWND hWnd, DWORD flags, LPCHANGEPWDINFOA info )
270 FIXME("%s %p %x %p\n", debugstr_a(lpProvider), hWnd, flags, info );
271 return WN_SUCCESS;
274 /*****************************************************************
275 * PwdChangePasswordA [MPR.@]
277 DWORD WINAPI PwdChangePasswordW( LPCWSTR lpProvider, HWND hWnd, DWORD flags, LPCHANGEPWDINFOW info )
279 FIXME("%s %p %x %p\n", debugstr_w(lpProvider), hWnd, flags, info );
280 return WN_SUCCESS;