winepulse v18: Latency and compilation improvements
[wine/multimedia.git] / dlls / mpr / nps.c
blobf8a143363f207bfddc5dd1bf69546ef2d11ede1a
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 hitem = GetDlgItem( hdlg, IDC_USERNAME );
80 if( hitem )
81 GetWindowTextA( hitem, lpAuthDlgStruct->lpUsername, lpAuthDlgStruct->cbUsername );
83 hitem = GetDlgItem( hdlg, IDC_PASSWORD );
84 if( hitem )
85 GetWindowTextA( hitem, lpAuthDlgStruct->lpPassword, lpAuthDlgStruct->cbPassword );
87 EndDialog( hdlg, WN_SUCCESS );
88 return TRUE;
90 if( wParam == IDCANCEL )
92 EndDialog( hdlg, WN_CANCEL );
93 return TRUE;
95 break;
97 return FALSE;
100 /*****************************************************************
101 * NPSAuthenticationDialogA [MPR.@]
103 DWORD WINAPI NPSAuthenticationDialogA( LPAUTHDLGSTRUCTA lpAuthDlgStruct )
105 HMODULE hwininet = GetModuleHandleA( "mpr.dll" );
107 TRACE("%p\n", lpAuthDlgStruct);
109 if( !lpAuthDlgStruct )
110 return WN_BAD_POINTER;
111 if( lpAuthDlgStruct->cbStructure < sizeof *lpAuthDlgStruct )
112 return WN_BAD_POINTER;
114 TRACE("%s %s %s\n",lpAuthDlgStruct->lpResource,
115 lpAuthDlgStruct->lpOUTitle, lpAuthDlgStruct->lpExplainText);
117 return DialogBoxParamW( hwininet, MAKEINTRESOURCEW( IDD_PROXYDLG ),
118 lpAuthDlgStruct->hwndOwner, NPS_ProxyPasswordDialog,
119 (LPARAM) lpAuthDlgStruct );
122 /*****************************************************************
123 * NPSGetProviderHandleA [MPR.@]
125 DWORD WINAPI NPSGetProviderHandleA( PHPROVIDER phProvider )
127 FIXME( "(%p): stub\n", phProvider );
128 return WN_NOT_SUPPORTED;
131 /*****************************************************************
132 * NPSGetProviderNameA [MPR.@]
134 DWORD WINAPI NPSGetProviderNameA( HPROVIDER hProvider, LPCSTR *lpszProviderName )
136 FIXME( "(%p, %p): stub\n", hProvider, lpszProviderName );
137 return WN_NOT_SUPPORTED;
140 /*****************************************************************
141 * NPSGetSectionNameA [MPR.@]
143 DWORD WINAPI NPSGetSectionNameA( HPROVIDER hProvider, LPCSTR *lpszSectionName )
145 FIXME( "(%p, %p): stub\n", hProvider, lpszSectionName );
146 return WN_NOT_SUPPORTED;
149 /*****************************************************************
150 * NPSSetExtendedErrorA [MPR.@]
152 DWORD WINAPI NPSSetExtendedErrorA( DWORD NetSpecificError, LPSTR lpExtendedErrorText )
154 FIXME( "(%08x, %s): stub\n", NetSpecificError, debugstr_a(lpExtendedErrorText) );
155 return WN_NOT_SUPPORTED;
158 /*****************************************************************
159 * NPSSetCustomTextA [MPR.@]
161 VOID WINAPI NPSSetCustomTextA( LPSTR lpCustomErrorText )
163 FIXME( "(%s): stub\n", debugstr_a(lpCustomErrorText) );
166 /*****************************************************************
167 * NPSCopyStringA [MPR.@]
169 DWORD WINAPI NPSCopyStringA( LPCSTR lpString, LPVOID lpBuffer, LPDWORD lpdwBufferSize )
171 FIXME( "(%s, %p, %p): stub\n", debugstr_a(lpString), lpBuffer, lpdwBufferSize );
172 return WN_NOT_SUPPORTED;
175 /*****************************************************************
176 * NPSDeviceGetNumberA [MPR.@]
178 DWORD WINAPI NPSDeviceGetNumberA( LPSTR lpLocalName, LPDWORD lpdwNumber, LPDWORD lpdwType )
180 FIXME( "(%s, %p, %p): stub\n", debugstr_a(lpLocalName), lpdwNumber, lpdwType );
181 return WN_NOT_SUPPORTED;
184 /*****************************************************************
185 * NPSDeviceGetStringA [MPR.@]
187 DWORD WINAPI NPSDeviceGetStringA( DWORD dwNumber, DWORD dwType, LPSTR lpLocalName, LPDWORD lpdwBufferSize )
189 FIXME( "(%d, %d, %p, %p): stub\n", dwNumber, dwType, lpLocalName, lpdwBufferSize );
190 return WN_NOT_SUPPORTED;
193 /*****************************************************************
194 * NPSNotifyRegisterA [MPR.@]
196 DWORD WINAPI NPSNotifyRegisterA( enum NOTIFYTYPE NotifyType, NOTIFYCALLBACK pfNotifyCallBack )
198 FIXME( "(%d, %p): stub\n", NotifyType, pfNotifyCallBack );
199 return WN_NOT_SUPPORTED;
202 /*****************************************************************
203 * NPSNotifyGetContextA [MPR.@]
205 LPVOID WINAPI NPSNotifyGetContextA( NOTIFYCALLBACK pfNotifyCallBack )
207 FIXME( "(%p): stub\n", pfNotifyCallBack );
208 return NULL;
211 /*****************************************************************
212 * PwdGetPasswordStatusA [MPR.@]
214 DWORD WINAPI PwdGetPasswordStatusA( LPCSTR lpProvider, DWORD dwIndex, LPDWORD status )
216 FIXME("%s %d %p\n", debugstr_a(lpProvider), dwIndex, status );
217 *status = 0;
218 return WN_SUCCESS;
221 /*****************************************************************
222 * PwdGetPasswordStatusA [MPR.@]
224 DWORD WINAPI PwdGetPasswordStatusW( LPCWSTR lpProvider, DWORD dwIndex, LPDWORD status )
226 FIXME("%s %d %p\n", debugstr_w(lpProvider), dwIndex, status );
227 *status = 0;
228 return WN_SUCCESS;
231 /*****************************************************************
232 * PwdSetPasswordStatusA [MPR.@]
234 DWORD WINAPI PwdSetPasswordStatusA( LPCSTR lpProvider, DWORD dwIndex, DWORD status )
236 FIXME("%s %d %d\n", debugstr_a(lpProvider), dwIndex, status );
237 return WN_SUCCESS;
240 /*****************************************************************
241 * PwdSetPasswordStatusW [MPR.@]
243 DWORD WINAPI PwdSetPasswordStatusW( LPCWSTR lpProvider, DWORD dwIndex, DWORD status )
245 FIXME("%s %d %d\n", debugstr_w(lpProvider), dwIndex, status );
246 return WN_SUCCESS;
249 typedef struct _CHANGEPWDINFOA {
250 LPSTR lpUsername;
251 LPSTR lpPassword;
252 DWORD cbPassword;
253 } CHANGEPWDINFOA, *LPCHANGEPWDINFOA;
255 typedef struct _CHANGEPWDINFOW {
256 LPWSTR lpUsername;
257 LPWSTR lpPassword;
258 DWORD cbPassword;
259 } CHANGEPWDINFOW, *LPCHANGEPWDINFOW;
261 /*****************************************************************
262 * PwdChangePasswordA [MPR.@]
264 DWORD WINAPI PwdChangePasswordA( LPCSTR lpProvider, HWND hWnd, DWORD flags, LPCHANGEPWDINFOA info )
266 FIXME("%s %p %x %p\n", debugstr_a(lpProvider), hWnd, flags, info );
267 return WN_SUCCESS;
270 /*****************************************************************
271 * PwdChangePasswordA [MPR.@]
273 DWORD WINAPI PwdChangePasswordW( LPCWSTR lpProvider, HWND hWnd, DWORD flags, LPCHANGEPWDINFOW info )
275 FIXME("%s %p %x %p\n", debugstr_w(lpProvider), hWnd, flags, info );
276 return WN_SUCCESS;