1999-08-07 16:32:33 +02:00
|
|
|
/*
|
|
|
|
* MPR Network Provider Services functions
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* Copyright 1999 Ulrich Weigand
|
2005-01-10 15:27:29 +01:00
|
|
|
* Copyright 2004 Mike McCormack for CodeWeavers Inc.
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
1999-08-07 16:32:33 +02:00
|
|
|
*/
|
|
|
|
|
2005-01-10 15:27:29 +01:00
|
|
|
#include "config.h"
|
|
|
|
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include "windef.h"
|
1999-08-07 16:32:33 +02:00
|
|
|
#include "winbase.h"
|
2005-01-10 15:27:29 +01:00
|
|
|
#include "winuser.h"
|
1999-08-07 16:32:33 +02:00
|
|
|
#include "netspi.h"
|
2002-03-10 00:29:33 +01:00
|
|
|
#include "wine/debug.h"
|
2005-01-10 15:27:29 +01:00
|
|
|
#include "winerror.h"
|
1999-08-07 16:32:33 +02:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(mpr);
|
1999-08-07 16:32:33 +02:00
|
|
|
|
2005-01-10 15:27:29 +01:00
|
|
|
#include "wine/unicode.h"
|
|
|
|
|
|
|
|
#include "mprres.h"
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* NPS_ProxyPasswordDialog
|
|
|
|
*/
|
|
|
|
static INT_PTR WINAPI NPS_ProxyPasswordDialog(
|
|
|
|
HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
|
|
|
|
{
|
|
|
|
HWND hitem;
|
|
|
|
LPAUTHDLGSTRUCTA lpAuthDlgStruct;
|
|
|
|
|
|
|
|
if( uMsg == WM_INITDIALOG )
|
|
|
|
{
|
|
|
|
TRACE("WM_INITDIALOG (%08lx)\n", lParam);
|
|
|
|
|
|
|
|
/* save the parameter list */
|
|
|
|
lpAuthDlgStruct = (LPAUTHDLGSTRUCTA) lParam;
|
|
|
|
SetWindowLongPtrW( hdlg, GWLP_USERDATA, lParam );
|
|
|
|
|
|
|
|
if( lpAuthDlgStruct->lpExplainText )
|
|
|
|
{
|
|
|
|
hitem = GetDlgItem( hdlg, IDC_EXPLAIN );
|
|
|
|
SetWindowTextA( hitem, lpAuthDlgStruct->lpExplainText );
|
|
|
|
}
|
|
|
|
|
|
|
|
/* extract the Realm from the proxy response and show it */
|
|
|
|
if( lpAuthDlgStruct->lpResource )
|
|
|
|
{
|
|
|
|
hitem = GetDlgItem( hdlg, IDC_REALM );
|
|
|
|
SetWindowTextA( hitem, lpAuthDlgStruct->lpResource );
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
lpAuthDlgStruct = (LPAUTHDLGSTRUCTA) GetWindowLongPtrW( hdlg, GWLP_USERDATA );
|
|
|
|
|
|
|
|
switch( uMsg )
|
|
|
|
{
|
|
|
|
case WM_COMMAND:
|
|
|
|
if( wParam == IDOK )
|
|
|
|
{
|
|
|
|
hitem = GetDlgItem( hdlg, IDC_USERNAME );
|
|
|
|
if( hitem )
|
|
|
|
GetWindowTextA( hitem, lpAuthDlgStruct->lpUsername, lpAuthDlgStruct->cbUsername );
|
2008-04-21 23:23:15 +02:00
|
|
|
|
2005-01-10 15:27:29 +01:00
|
|
|
hitem = GetDlgItem( hdlg, IDC_PASSWORD );
|
|
|
|
if( hitem )
|
|
|
|
GetWindowTextA( hitem, lpAuthDlgStruct->lpPassword, lpAuthDlgStruct->cbPassword );
|
|
|
|
|
|
|
|
EndDialog( hdlg, WN_SUCCESS );
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
if( wParam == IDCANCEL )
|
|
|
|
{
|
|
|
|
EndDialog( hdlg, WN_CANCEL );
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
1999-08-07 16:32:33 +02:00
|
|
|
|
|
|
|
/*****************************************************************
|
2001-06-19 20:20:47 +02:00
|
|
|
* NPSAuthenticationDialogA [MPR.@]
|
1999-08-07 16:32:33 +02:00
|
|
|
*/
|
|
|
|
DWORD WINAPI NPSAuthenticationDialogA( LPAUTHDLGSTRUCTA lpAuthDlgStruct )
|
|
|
|
{
|
2005-01-10 15:27:29 +01:00
|
|
|
HMODULE hwininet = GetModuleHandleA( "mpr.dll" );
|
|
|
|
|
|
|
|
TRACE("%p\n", lpAuthDlgStruct);
|
|
|
|
|
|
|
|
if( !lpAuthDlgStruct )
|
|
|
|
return WN_BAD_POINTER;
|
|
|
|
if( lpAuthDlgStruct->cbStructure < sizeof *lpAuthDlgStruct )
|
|
|
|
return WN_BAD_POINTER;
|
|
|
|
|
|
|
|
TRACE("%s %s %s\n",lpAuthDlgStruct->lpResource,
|
|
|
|
lpAuthDlgStruct->lpOUTitle, lpAuthDlgStruct->lpExplainText);
|
|
|
|
|
|
|
|
return DialogBoxParamW( hwininet, MAKEINTRESOURCEW( IDD_PROXYDLG ),
|
|
|
|
lpAuthDlgStruct->hwndOwner, NPS_ProxyPasswordDialog,
|
|
|
|
(LPARAM) lpAuthDlgStruct );
|
1999-08-07 16:32:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************
|
2001-06-19 20:20:47 +02:00
|
|
|
* NPSGetProviderHandleA [MPR.@]
|
1999-08-07 16:32:33 +02:00
|
|
|
*/
|
|
|
|
DWORD WINAPI NPSGetProviderHandleA( PHPROVIDER phProvider )
|
|
|
|
{
|
|
|
|
FIXME( "(%p): stub\n", phProvider );
|
|
|
|
return WN_NOT_SUPPORTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************
|
2001-06-19 20:20:47 +02:00
|
|
|
* NPSGetProviderNameA [MPR.@]
|
1999-08-07 16:32:33 +02:00
|
|
|
*/
|
|
|
|
DWORD WINAPI NPSGetProviderNameA( HPROVIDER hProvider, LPCSTR *lpszProviderName )
|
|
|
|
{
|
|
|
|
FIXME( "(%p, %p): stub\n", hProvider, lpszProviderName );
|
|
|
|
return WN_NOT_SUPPORTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************
|
2001-06-19 20:20:47 +02:00
|
|
|
* NPSGetSectionNameA [MPR.@]
|
1999-08-07 16:32:33 +02:00
|
|
|
*/
|
|
|
|
DWORD WINAPI NPSGetSectionNameA( HPROVIDER hProvider, LPCSTR *lpszSectionName )
|
|
|
|
{
|
|
|
|
FIXME( "(%p, %p): stub\n", hProvider, lpszSectionName );
|
|
|
|
return WN_NOT_SUPPORTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************
|
2001-06-19 20:20:47 +02:00
|
|
|
* NPSSetExtendedErrorA [MPR.@]
|
1999-08-07 16:32:33 +02:00
|
|
|
*/
|
|
|
|
DWORD WINAPI NPSSetExtendedErrorA( DWORD NetSpecificError, LPSTR lpExtendedErrorText )
|
|
|
|
{
|
2006-10-12 21:34:20 +02:00
|
|
|
FIXME( "(%08x, %s): stub\n", NetSpecificError, debugstr_a(lpExtendedErrorText) );
|
1999-08-07 16:32:33 +02:00
|
|
|
return WN_NOT_SUPPORTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************
|
2001-06-19 20:20:47 +02:00
|
|
|
* NPSSetCustomTextA [MPR.@]
|
1999-08-07 16:32:33 +02:00
|
|
|
*/
|
|
|
|
VOID WINAPI NPSSetCustomTextA( LPSTR lpCustomErrorText )
|
|
|
|
{
|
|
|
|
FIXME( "(%s): stub\n", debugstr_a(lpCustomErrorText) );
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************
|
2001-06-19 20:20:47 +02:00
|
|
|
* NPSCopyStringA [MPR.@]
|
1999-08-07 16:32:33 +02:00
|
|
|
*/
|
|
|
|
DWORD WINAPI NPSCopyStringA( LPCSTR lpString, LPVOID lpBuffer, LPDWORD lpdwBufferSize )
|
|
|
|
{
|
|
|
|
FIXME( "(%s, %p, %p): stub\n", debugstr_a(lpString), lpBuffer, lpdwBufferSize );
|
|
|
|
return WN_NOT_SUPPORTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************
|
2001-06-19 20:20:47 +02:00
|
|
|
* NPSDeviceGetNumberA [MPR.@]
|
1999-08-07 16:32:33 +02:00
|
|
|
*/
|
|
|
|
DWORD WINAPI NPSDeviceGetNumberA( LPSTR lpLocalName, LPDWORD lpdwNumber, LPDWORD lpdwType )
|
|
|
|
{
|
|
|
|
FIXME( "(%s, %p, %p): stub\n", debugstr_a(lpLocalName), lpdwNumber, lpdwType );
|
|
|
|
return WN_NOT_SUPPORTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************
|
2001-06-19 20:20:47 +02:00
|
|
|
* NPSDeviceGetStringA [MPR.@]
|
1999-08-07 16:32:33 +02:00
|
|
|
*/
|
|
|
|
DWORD WINAPI NPSDeviceGetStringA( DWORD dwNumber, DWORD dwType, LPSTR lpLocalName, LPDWORD lpdwBufferSize )
|
|
|
|
{
|
2006-10-12 21:34:20 +02:00
|
|
|
FIXME( "(%d, %d, %p, %p): stub\n", dwNumber, dwType, lpLocalName, lpdwBufferSize );
|
1999-08-07 16:32:33 +02:00
|
|
|
return WN_NOT_SUPPORTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************
|
2001-06-19 20:20:47 +02:00
|
|
|
* NPSNotifyRegisterA [MPR.@]
|
1999-08-07 16:32:33 +02:00
|
|
|
*/
|
|
|
|
DWORD WINAPI NPSNotifyRegisterA( enum NOTIFYTYPE NotifyType, NOTIFYCALLBACK pfNotifyCallBack )
|
|
|
|
{
|
|
|
|
FIXME( "(%d, %p): stub\n", NotifyType, pfNotifyCallBack );
|
|
|
|
return WN_NOT_SUPPORTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************
|
2001-06-19 20:20:47 +02:00
|
|
|
* NPSNotifyGetContextA [MPR.@]
|
1999-08-07 16:32:33 +02:00
|
|
|
*/
|
|
|
|
LPVOID WINAPI NPSNotifyGetContextA( NOTIFYCALLBACK pfNotifyCallBack )
|
|
|
|
{
|
|
|
|
FIXME( "(%p): stub\n", pfNotifyCallBack );
|
|
|
|
return NULL;
|
|
|
|
}
|
2006-03-04 16:55:30 +01:00
|
|
|
|
|
|
|
/*****************************************************************
|
|
|
|
* PwdGetPasswordStatusA [MPR.@]
|
|
|
|
*/
|
|
|
|
DWORD WINAPI PwdGetPasswordStatusA( LPCSTR lpProvider, DWORD dwIndex, LPDWORD status )
|
|
|
|
{
|
2006-10-12 21:34:20 +02:00
|
|
|
FIXME("%s %d %p\n", debugstr_a(lpProvider), dwIndex, status );
|
2006-03-04 16:55:30 +01:00
|
|
|
*status = 0;
|
|
|
|
return WN_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************
|
|
|
|
* PwdGetPasswordStatusA [MPR.@]
|
|
|
|
*/
|
|
|
|
DWORD WINAPI PwdGetPasswordStatusW( LPCWSTR lpProvider, DWORD dwIndex, LPDWORD status )
|
|
|
|
{
|
2006-10-12 21:34:20 +02:00
|
|
|
FIXME("%s %d %p\n", debugstr_w(lpProvider), dwIndex, status );
|
2006-03-04 16:55:30 +01:00
|
|
|
*status = 0;
|
|
|
|
return WN_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************
|
|
|
|
* PwdSetPasswordStatusA [MPR.@]
|
|
|
|
*/
|
|
|
|
DWORD WINAPI PwdSetPasswordStatusA( LPCSTR lpProvider, DWORD dwIndex, DWORD status )
|
|
|
|
{
|
2006-10-12 21:34:20 +02:00
|
|
|
FIXME("%s %d %d\n", debugstr_a(lpProvider), dwIndex, status );
|
2006-03-04 16:55:30 +01:00
|
|
|
return WN_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************
|
|
|
|
* PwdSetPasswordStatusW [MPR.@]
|
|
|
|
*/
|
|
|
|
DWORD WINAPI PwdSetPasswordStatusW( LPCWSTR lpProvider, DWORD dwIndex, DWORD status )
|
|
|
|
{
|
2006-10-12 21:34:20 +02:00
|
|
|
FIXME("%s %d %d\n", debugstr_w(lpProvider), dwIndex, status );
|
2006-03-04 16:55:30 +01:00
|
|
|
return WN_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
typedef struct _CHANGEPWDINFOA {
|
|
|
|
LPSTR lpUsername;
|
|
|
|
LPSTR lpPassword;
|
|
|
|
DWORD cbPassword;
|
|
|
|
} CHANGEPWDINFOA, *LPCHANGEPWDINFOA;
|
|
|
|
|
|
|
|
typedef struct _CHANGEPWDINFOW {
|
|
|
|
LPWSTR lpUsername;
|
|
|
|
LPWSTR lpPassword;
|
|
|
|
DWORD cbPassword;
|
|
|
|
} CHANGEPWDINFOW, *LPCHANGEPWDINFOW;
|
|
|
|
|
|
|
|
/*****************************************************************
|
|
|
|
* PwdChangePasswordA [MPR.@]
|
|
|
|
*/
|
|
|
|
DWORD WINAPI PwdChangePasswordA( LPCSTR lpProvider, HWND hWnd, DWORD flags, LPCHANGEPWDINFOA info )
|
|
|
|
{
|
2006-10-12 21:34:20 +02:00
|
|
|
FIXME("%s %p %x %p\n", debugstr_a(lpProvider), hWnd, flags, info );
|
2006-03-04 16:55:30 +01:00
|
|
|
return WN_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************
|
|
|
|
* PwdChangePasswordA [MPR.@]
|
|
|
|
*/
|
|
|
|
DWORD WINAPI PwdChangePasswordW( LPCWSTR lpProvider, HWND hWnd, DWORD flags, LPCHANGEPWDINFOW info )
|
|
|
|
{
|
2006-10-12 21:34:20 +02:00
|
|
|
FIXME("%s %p %x %p\n", debugstr_w(lpProvider), hWnd, flags, info );
|
2006-03-04 16:55:30 +01:00
|
|
|
return WN_SUCCESS;
|
|
|
|
}
|