ReactOS 0.4.15-dev-7958-gcd0bb1a
nps.c
Go to the documentation of this file.
1/*
2 * MPR Network Provider Services functions
3 *
4 * Copyright 1999 Ulrich Weigand
5 * Copyright 2004 Mike McCormack for CodeWeavers Inc.
6 *
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.
11 *
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.
16 *
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
20 */
21
22#include <stdarg.h>
23
24#include "windef.h"
25#include "winbase.h"
26#include "winuser.h"
27#include "netspi.h"
28#include "wine/debug.h"
29#include "winerror.h"
30
32
33
34#include "mprres.h"
35
36/***********************************************************************
37 * NPS_ProxyPasswordDialog
38 */
40 HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
41{
42 HWND hitem;
43 LPAUTHDLGSTRUCTA lpAuthDlgStruct;
44
45 if( uMsg == WM_INITDIALOG )
46 {
47 TRACE("WM_INITDIALOG (%08lx)\n", lParam);
48
49 /* save the parameter list */
50 lpAuthDlgStruct = (LPAUTHDLGSTRUCTA) lParam;
52
53 if( lpAuthDlgStruct->lpExplainText )
54 {
55 hitem = GetDlgItem( hdlg, IDC_EXPLAIN );
56 SetWindowTextA( hitem, lpAuthDlgStruct->lpExplainText );
57 }
58
59 /* extract the Realm from the proxy response and show it */
60 if( lpAuthDlgStruct->lpResource )
61 {
62 hitem = GetDlgItem( hdlg, IDC_REALM );
63 SetWindowTextA( hitem, lpAuthDlgStruct->lpResource );
64 }
65
66 return TRUE;
67 }
68
69 lpAuthDlgStruct = (LPAUTHDLGSTRUCTA) GetWindowLongPtrW( hdlg, GWLP_USERDATA );
70
71 switch( uMsg )
72 {
73 case WM_COMMAND:
74 if( wParam == IDOK )
75 {
76 hitem = GetDlgItem( hdlg, IDC_USERNAME );
77 if( hitem )
78 GetWindowTextA( hitem, lpAuthDlgStruct->lpUsername, lpAuthDlgStruct->cbUsername );
79
80 hitem = GetDlgItem( hdlg, IDC_PASSWORD );
81 if( hitem )
82 GetWindowTextA( hitem, lpAuthDlgStruct->lpPassword, lpAuthDlgStruct->cbPassword );
83
84 EndDialog( hdlg, WN_SUCCESS );
85 return TRUE;
86 }
87 if( wParam == IDCANCEL )
88 {
89 EndDialog( hdlg, WN_CANCEL );
90 return TRUE;
91 }
92 break;
93 }
94 return FALSE;
95}
96
97/*****************************************************************
98 * NPSAuthenticationDialogA [MPR.@]
99 */
101{
102 HMODULE hwininet = GetModuleHandleA( "mpr.dll" );
103
104 TRACE("%p\n", lpAuthDlgStruct);
105
106 if( !lpAuthDlgStruct )
107 return WN_BAD_POINTER;
108 if( lpAuthDlgStruct->cbStructure < sizeof *lpAuthDlgStruct )
109 return WN_BAD_POINTER;
110
111 TRACE("%s %s %s\n",lpAuthDlgStruct->lpResource,
112 lpAuthDlgStruct->lpOUTitle, lpAuthDlgStruct->lpExplainText);
113
114 return DialogBoxParamW( hwininet, MAKEINTRESOURCEW( IDD_PROXYDLG ),
115 lpAuthDlgStruct->hwndOwner, NPS_ProxyPasswordDialog,
116 (LPARAM) lpAuthDlgStruct );
117}
118
119/*****************************************************************
120 * NPSGetProviderHandleA [MPR.@]
121 */
123{
124 FIXME( "(%p): stub\n", phProvider );
125 return WN_NOT_SUPPORTED;
126}
127
128/*****************************************************************
129 * NPSGetProviderNameA [MPR.@]
130 */
132{
133 FIXME( "(%p, %p): stub\n", hProvider, lpszProviderName );
134 return WN_NOT_SUPPORTED;
135}
136
137/*****************************************************************
138 * NPSGetSectionNameA [MPR.@]
139 */
141{
142 FIXME( "(%p, %p): stub\n", hProvider, lpszSectionName );
143 return WN_NOT_SUPPORTED;
144}
145
146/*****************************************************************
147 * NPSSetExtendedErrorA [MPR.@]
148 */
149DWORD WINAPI NPSSetExtendedErrorA( DWORD NetSpecificError, LPSTR lpExtendedErrorText )
150{
151 FIXME( "(%08x, %s): stub\n", NetSpecificError, debugstr_a(lpExtendedErrorText) );
152 return WN_NOT_SUPPORTED;
153}
154
155/*****************************************************************
156 * NPSSetCustomTextA [MPR.@]
157 */
158VOID WINAPI NPSSetCustomTextA( LPSTR lpCustomErrorText )
159{
160 FIXME( "(%s): stub\n", debugstr_a(lpCustomErrorText) );
161}
162
163/*****************************************************************
164 * NPSCopyStringA [MPR.@]
165 */
167{
168 FIXME( "(%s, %p, %p): stub\n", debugstr_a(lpString), lpBuffer, lpdwBufferSize );
169 return WN_NOT_SUPPORTED;
170}
171
172/*****************************************************************
173 * NPSDeviceGetNumberA [MPR.@]
174 */
175DWORD WINAPI NPSDeviceGetNumberA( LPSTR lpLocalName, LPDWORD lpdwNumber, LPDWORD lpdwType )
176{
177 FIXME( "(%s, %p, %p): stub\n", debugstr_a(lpLocalName), lpdwNumber, lpdwType );
178 return WN_NOT_SUPPORTED;
179}
180
181/*****************************************************************
182 * NPSDeviceGetStringA [MPR.@]
183 */
184DWORD WINAPI NPSDeviceGetStringA( DWORD dwNumber, DWORD dwType, LPSTR lpLocalName, LPDWORD lpdwBufferSize )
185{
186 FIXME( "(%d, %d, %p, %p): stub\n", dwNumber, dwType, lpLocalName, lpdwBufferSize );
187 return WN_NOT_SUPPORTED;
188}
189
190/*****************************************************************
191 * NPSNotifyRegisterA [MPR.@]
192 */
193DWORD WINAPI NPSNotifyRegisterA( enum NOTIFYTYPE NotifyType, NOTIFYCALLBACK pfNotifyCallBack )
194{
195 FIXME( "(%d, %p): stub\n", NotifyType, pfNotifyCallBack );
196 return WN_NOT_SUPPORTED;
197}
198
199/*****************************************************************
200 * NPSNotifyGetContextA [MPR.@]
201 */
203{
204 FIXME( "(%p): stub\n", pfNotifyCallBack );
205 return NULL;
206}
207
208/*****************************************************************
209 * PwdGetPasswordStatusA [MPR.@]
210 */
212{
213 FIXME("%s %d %p\n", debugstr_a(lpProvider), dwIndex, status );
214 *status = 0;
215 return WN_SUCCESS;
216}
217
218/*****************************************************************
219 * PwdGetPasswordStatusA [MPR.@]
220 */
222{
223 FIXME("%s %d %p\n", debugstr_w(lpProvider), dwIndex, status );
224 *status = 0;
225 return WN_SUCCESS;
226}
227
228/*****************************************************************
229 * PwdSetPasswordStatusA [MPR.@]
230 */
232{
233 FIXME("%s %d %d\n", debugstr_a(lpProvider), dwIndex, status );
234 return WN_SUCCESS;
235}
236
237/*****************************************************************
238 * PwdSetPasswordStatusW [MPR.@]
239 */
241{
242 FIXME("%s %d %d\n", debugstr_w(lpProvider), dwIndex, status );
243 return WN_SUCCESS;
244}
245
246typedef struct _CHANGEPWDINFOA {
251
252typedef struct _CHANGEPWDINFOW {
257
258/*****************************************************************
259 * PwdChangePasswordA [MPR.@]
260 */
262{
263 FIXME("%s %p %x %p\n", debugstr_a(lpProvider), hWnd, flags, info );
264 return WN_SUCCESS;
265}
266
267/*****************************************************************
268 * PwdChangePasswordA [MPR.@]
269 */
271{
272 FIXME("%s %p %x %p\n", debugstr_w(lpProvider), hWnd, flags, info );
273 return WN_SUCCESS;
274}
HWND hWnd
Definition: settings.c:17
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define IDC_USERNAME
Definition: resource.h:82
#define FIXME(fmt,...)
Definition: debug.h:111
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:175
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define IDC_PASSWORD
Definition: resource.h:20
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
unsigned long DWORD
Definition: ntddk_ex.h:95
WDFWMIPROVIDER hProvider
Definition: fxwmiapi.cpp:165
GLbitfield flags
Definition: glext.h:7161
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_w
Definition: kernel32.h:32
#define IDC_REALM
Definition: mprres.h:29
#define IDC_EXPLAIN
Definition: mprres.h:33
#define IDD_PROXYDLG
Definition: mprres.h:26
unsigned int UINT
Definition: ndis.h:50
NOTIFYTYPE
Definition: netspi.h:93
HPROVIDER * PHPROVIDER
Definition: netspi.h:36
DWORD(CALLBACK * NOTIFYCALLBACK)(LPNOTIFYINFO, LPVOID)
Definition: netspi.h:146
#define HPROVIDER
Definition: netspi.h:35
struct AUTHDLGSTRUCTA * LPAUTHDLGSTRUCTA
DWORD WINAPI NPSCopyStringA(LPCSTR lpString, LPVOID lpBuffer, LPDWORD lpdwBufferSize)
Definition: nps.c:166
DWORD WINAPI PwdChangePasswordW(LPCWSTR lpProvider, HWND hWnd, DWORD flags, LPCHANGEPWDINFOW info)
Definition: nps.c:270
struct _CHANGEPWDINFOA CHANGEPWDINFOA
struct _CHANGEPWDINFOA * LPCHANGEPWDINFOA
LPVOID WINAPI NPSNotifyGetContextA(NOTIFYCALLBACK pfNotifyCallBack)
Definition: nps.c:202
DWORD WINAPI NPSDeviceGetNumberA(LPSTR lpLocalName, LPDWORD lpdwNumber, LPDWORD lpdwType)
Definition: nps.c:175
static INT_PTR WINAPI NPS_ProxyPasswordDialog(HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: nps.c:39
DWORD WINAPI PwdSetPasswordStatusA(LPCSTR lpProvider, DWORD dwIndex, DWORD status)
Definition: nps.c:231
DWORD WINAPI NPSGetProviderHandleA(PHPROVIDER phProvider)
Definition: nps.c:122
DWORD WINAPI PwdGetPasswordStatusW(LPCWSTR lpProvider, DWORD dwIndex, LPDWORD status)
Definition: nps.c:221
VOID WINAPI NPSSetCustomTextA(LPSTR lpCustomErrorText)
Definition: nps.c:158
DWORD WINAPI NPSSetExtendedErrorA(DWORD NetSpecificError, LPSTR lpExtendedErrorText)
Definition: nps.c:149
DWORD WINAPI PwdSetPasswordStatusW(LPCWSTR lpProvider, DWORD dwIndex, DWORD status)
Definition: nps.c:240
DWORD WINAPI NPSGetProviderNameA(HPROVIDER hProvider, LPCSTR *lpszProviderName)
Definition: nps.c:131
DWORD WINAPI NPSDeviceGetStringA(DWORD dwNumber, DWORD dwType, LPSTR lpLocalName, LPDWORD lpdwBufferSize)
Definition: nps.c:184
DWORD WINAPI NPSNotifyRegisterA(enum NOTIFYTYPE NotifyType, NOTIFYCALLBACK pfNotifyCallBack)
Definition: nps.c:193
struct _CHANGEPWDINFOW * LPCHANGEPWDINFOW
DWORD WINAPI NPSAuthenticationDialogA(LPAUTHDLGSTRUCTA lpAuthDlgStruct)
Definition: nps.c:100
DWORD WINAPI PwdChangePasswordA(LPCSTR lpProvider, HWND hWnd, DWORD flags, LPCHANGEPWDINFOA info)
Definition: nps.c:261
DWORD WINAPI NPSGetSectionNameA(HPROVIDER hProvider, LPCSTR *lpszSectionName)
Definition: nps.c:140
DWORD WINAPI PwdGetPasswordStatusA(LPCSTR lpProvider, DWORD dwIndex, LPDWORD status)
Definition: nps.c:211
struct _CHANGEPWDINFOW CHANGEPWDINFOW
#define TRACE(s)
Definition: solgame.cpp:4
DWORD cbPassword
Definition: netspi.h:46
HWND hwndOwner
Definition: netspi.h:41
LPCSTR lpExplainText
Definition: netspi.h:50
LPSTR lpPassword
Definition: netspi.h:45
LPSTR lpUsername
Definition: netspi.h:43
LPCSTR lpOUTitle
Definition: netspi.h:49
DWORD cbUsername
Definition: netspi.h:44
DWORD cbStructure
Definition: netspi.h:40
LPCSTR lpResource
Definition: netspi.h:42
DWORD cbPassword
Definition: nps.c:249
LPSTR lpUsername
Definition: nps.c:247
LPSTR lpPassword
Definition: nps.c:248
LPWSTR lpPassword
Definition: nps.c:254
LPWSTR lpUsername
Definition: nps.c:253
DWORD cbPassword
Definition: nps.c:255
Definition: ps.c:97
#define GWLP_USERDATA
Definition: treelist.c:63
int32_t INT_PTR
Definition: typedefs.h:64
uint32_t * LPDWORD
Definition: typedefs.h:59
int WINAPI GetWindowTextA(HWND hWnd, LPSTR lpString, int nMaxCount)
Definition: window.c:1330
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
#define WN_NOT_SUPPORTED
Definition: winnetwk.h:113
#define WN_CANCEL
Definition: winnetwk.h:114
#define WN_SUCCESS
Definition: winnetwk.h:111
#define WN_BAD_POINTER
Definition: winnetwk.h:118
BOOL WINAPI SetWindowTextA(_In_ HWND, _In_opt_ LPCSTR)
#define GetWindowLongPtrW
Definition: winuser.h:4829
#define IDCANCEL
Definition: winuser.h:831
#define WM_COMMAND
Definition: winuser.h:1740
#define WM_INITDIALOG
Definition: winuser.h:1739
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDOK
Definition: winuser.h:830
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define SetWindowLongPtrW
Definition: winuser.h:5346
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
const char * LPCSTR
Definition: xmlstorage.h:183
char * LPSTR
Definition: xmlstorage.h:182
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185