mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Import and merge Wine-20041201
svn path=/trunk/; revision=12551
This commit is contained in:
parent
329aa380dd
commit
c606eeb39a
22 changed files with 3247 additions and 0 deletions
9
reactos/lib/mpr/Makefile
Normal file
9
reactos/lib/mpr/Makefile
Normal file
|
@ -0,0 +1,9 @@
|
|||
# $Id: Makefile 7970 2004-02-01 19:48:44Z gvg $
|
||||
|
||||
PATH_TO_TOP = ../..
|
||||
|
||||
TARGET_TYPE = winedll
|
||||
|
||||
include $(PATH_TO_TOP)/rules.mak
|
||||
|
||||
include $(TOOLS_PATH)/helper.mk
|
21
reactos/lib/mpr/Makefile.in
Normal file
21
reactos/lib/mpr/Makefile.in
Normal file
|
@ -0,0 +1,21 @@
|
|||
TOPSRCDIR = @top_srcdir@
|
||||
TOPOBJDIR = ../..
|
||||
SRCDIR = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
MODULE = mpr.dll
|
||||
IMPORTS = user32 advapi32 kernel32
|
||||
EXTRALIBS = $(LIBUNICODE)
|
||||
|
||||
C_SRCS = \
|
||||
auth.c \
|
||||
mpr_main.c \
|
||||
multinet.c \
|
||||
nps.c \
|
||||
pwcache.c \
|
||||
wnet.c
|
||||
|
||||
RC_SRCS = mpr.rc
|
||||
|
||||
@MAKE_DLL_RULES@
|
||||
|
||||
### Dependencies:
|
17
reactos/lib/mpr/Makefile.ros-template
Normal file
17
reactos/lib/mpr/Makefile.ros-template
Normal file
|
@ -0,0 +1,17 @@
|
|||
# $Id: Makefile.ros-template 11910 2004-12-03 23:37:44Z blight $
|
||||
|
||||
TARGET_NAME = mpr
|
||||
|
||||
TARGET_OBJECTS = @C_SRCS@
|
||||
|
||||
TARGET_CFLAGS = -D__REACTOS__
|
||||
|
||||
TARGET_SDKLIBS = @IMPORTS@ kernel32.a wine.a ntdll.a
|
||||
|
||||
TARGET_BASE = $(TARGET_BASE_LIB_MPR)
|
||||
|
||||
default: all
|
||||
|
||||
DEP_OBJECTS = $(TARGET_OBJECTS)
|
||||
|
||||
include $(TOOLS_PATH)/depend.mk
|
95
reactos/lib/mpr/auth.c
Normal file
95
reactos/lib/mpr/auth.c
Normal file
|
@ -0,0 +1,95 @@
|
|||
/*
|
||||
* MPR Authentication and Logon functions
|
||||
*
|
||||
* Copyright 1999 Ulrich Weigand
|
||||
*
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winnetwk.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(mpr);
|
||||
|
||||
|
||||
/*****************************************************************
|
||||
* WNetLogoffA [MPR.@]
|
||||
*/
|
||||
DWORD WINAPI WNetLogoffA( LPCSTR lpProvider, HWND hwndOwner )
|
||||
{
|
||||
FIXME( "(%s, %p): stub\n", debugstr_a(lpProvider), hwndOwner );
|
||||
|
||||
SetLastError(WN_NO_NETWORK);
|
||||
return WN_NO_NETWORK;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* WNetLogoffW [MPR.@]
|
||||
*/
|
||||
DWORD WINAPI WNetLogoffW( LPCWSTR lpProvider, HWND hwndOwner )
|
||||
{
|
||||
FIXME( "(%s, %p): stub\n", debugstr_w(lpProvider), hwndOwner );
|
||||
|
||||
SetLastError(WN_NO_NETWORK);
|
||||
return WN_NO_NETWORK;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* WNetLogonA [MPR.@]
|
||||
*/
|
||||
DWORD WINAPI WNetLogonA( LPCSTR lpProvider, HWND hwndOwner )
|
||||
{
|
||||
FIXME( "(%s, %p): stub\n", debugstr_a(lpProvider), hwndOwner );
|
||||
|
||||
SetLastError(WN_NO_NETWORK);
|
||||
return WN_NO_NETWORK;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* WNetLogonW [MPR.@]
|
||||
*/
|
||||
DWORD WINAPI WNetLogonW( LPCWSTR lpProvider, HWND hwndOwner )
|
||||
{
|
||||
FIXME( "(%s, %p): stub\n", debugstr_w(lpProvider), hwndOwner );
|
||||
|
||||
SetLastError(WN_NO_NETWORK);
|
||||
return WN_NO_NETWORK;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* WNetVerifyPasswordA [MPR.@]
|
||||
*/
|
||||
DWORD WINAPI WNetVerifyPasswordA( LPCSTR lpszPassword, BOOL *pfMatch )
|
||||
{
|
||||
FIXME( "(%p, %p): stub\n", lpszPassword, pfMatch );
|
||||
|
||||
SetLastError(WN_NO_NETWORK);
|
||||
return WN_NO_NETWORK;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* WNetVerifyPasswordW [MPR.@]
|
||||
*/
|
||||
DWORD WINAPI WNetVerifyPasswordW( LPCWSTR lpszPassword, BOOL *pfMatch )
|
||||
{
|
||||
FIXME( "(%p, %p): stub\n", lpszPassword, pfMatch );
|
||||
|
||||
SetLastError(WN_NO_NETWORK);
|
||||
return WN_NO_NETWORK;
|
||||
}
|
33
reactos/lib/mpr/mpr.rc
Normal file
33
reactos/lib/mpr/mpr.rc
Normal file
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* MPR dll resources
|
||||
*
|
||||
* Copyright (C) 2004 Juan Lang
|
||||
*
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "mprres.h"
|
||||
|
||||
#include "version.rc"
|
||||
|
||||
#include "mpr_Cs.rc"
|
||||
#include "mpr_De.rc"
|
||||
#include "mpr_En.rc"
|
||||
#include "mpr_Nl.rc"
|
||||
#include "mpr_Es.rc"
|
||||
#include "mpr_It.rc"
|
||||
#include "mpr_Ja.rc"
|
||||
#include "mpr_Pt.rc"
|
116
reactos/lib/mpr/mpr.spec
Normal file
116
reactos/lib/mpr/mpr.spec
Normal file
|
@ -0,0 +1,116 @@
|
|||
# ordinal exports
|
||||
1 stub @
|
||||
2 stub @
|
||||
3 stub @
|
||||
4 stub @
|
||||
5 stub @
|
||||
6 stub @
|
||||
7 stub @
|
||||
8 stub @
|
||||
9 stub @
|
||||
12 stub @
|
||||
13 stub @
|
||||
14 stub @
|
||||
15 stub @
|
||||
16 stub @
|
||||
17 stub @
|
||||
18 stub @
|
||||
19 stub @
|
||||
20 stub @
|
||||
21 stub @
|
||||
22 stdcall @(long) MPR_Alloc
|
||||
23 stdcall @(ptr long) MPR_ReAlloc
|
||||
24 stdcall @(ptr) MPR_Free
|
||||
25 stdcall @(ptr long) _MPR_25
|
||||
|
||||
@ stdcall -private DllCanUnloadNow() MPR_DllCanUnloadNow
|
||||
@ stub DllGetClassObject
|
||||
@ stdcall MultinetGetConnectionPerformanceA(ptr ptr)
|
||||
@ stdcall MultinetGetConnectionPerformanceW(ptr ptr)
|
||||
@ stdcall MultinetGetErrorTextA(long ptr long)
|
||||
@ stdcall MultinetGetErrorTextW(long ptr long)
|
||||
@ stdcall NPSAuthenticationDialogA(ptr)
|
||||
@ stdcall NPSCopyStringA(str ptr ptr)
|
||||
@ stdcall NPSDeviceGetNumberA(str ptr ptr)
|
||||
@ stdcall NPSDeviceGetStringA(long long ptr long)
|
||||
@ stdcall NPSGetProviderHandleA(ptr)
|
||||
@ stdcall NPSGetProviderNameA(long ptr)
|
||||
@ stdcall NPSGetSectionNameA(long ptr)
|
||||
@ stdcall NPSNotifyGetContextA(ptr)
|
||||
@ stdcall NPSNotifyRegisterA(long ptr)
|
||||
@ stdcall NPSSetCustomTextA(str)
|
||||
@ stdcall NPSSetExtendedErrorA(long str)
|
||||
@ stub PwdChangePasswordA
|
||||
@ stub PwdChangePasswordW
|
||||
@ stub PwdGetPasswordStatusA
|
||||
@ stub PwdGetPasswordStatusW
|
||||
@ stub PwdSetPasswordStatusA
|
||||
@ stub PwdSetPasswordStatusW
|
||||
@ stdcall WNetAddConnection2A(ptr str str long)
|
||||
@ stdcall WNetAddConnection2W(ptr wstr wstr long)
|
||||
@ stdcall WNetAddConnection3A(long ptr str str long)
|
||||
@ stdcall WNetAddConnection3W(long ptr wstr wstr long)
|
||||
@ stdcall WNetAddConnectionA(str str str)
|
||||
@ stdcall WNetAddConnectionW(wstr wstr wstr)
|
||||
@ stdcall WNetCachePassword(str long str long long long)
|
||||
@ stdcall WNetCancelConnection2A(str long long)
|
||||
@ stdcall WNetCancelConnection2W(wstr long long)
|
||||
@ stdcall WNetCancelConnectionA(str long)
|
||||
@ stdcall WNetCancelConnectionW(wstr long)
|
||||
@ stdcall WNetCloseEnum(long)
|
||||
@ stdcall WNetConnectionDialog1A(ptr)
|
||||
@ stdcall WNetConnectionDialog1W(ptr)
|
||||
@ stdcall WNetConnectionDialog(long long)
|
||||
@ stdcall WNetDisconnectDialog1A(ptr)
|
||||
@ stdcall WNetDisconnectDialog1W(ptr)
|
||||
@ stdcall WNetDisconnectDialog(long long)
|
||||
@ stdcall WNetEnumCachedPasswords(str long long ptr long)
|
||||
@ stdcall WNetEnumResourceA(long ptr ptr ptr)
|
||||
@ stdcall WNetEnumResourceW(long ptr ptr ptr)
|
||||
@ stub WNetFormatNetworkNameA
|
||||
@ stub WNetFormatNetworkNameW
|
||||
@ stdcall WNetGetCachedPassword(ptr long ptr ptr long)
|
||||
@ stdcall WNetGetConnectionA(str ptr ptr)
|
||||
@ stdcall WNetGetConnectionW(wstr ptr ptr)
|
||||
@ stub WNetGetHomeDirectoryA
|
||||
@ stub WNetGetHomeDirectoryW
|
||||
@ stdcall WNetGetLastErrorA(ptr ptr long ptr long)
|
||||
@ stdcall WNetGetLastErrorW(ptr ptr long ptr long)
|
||||
@ stdcall WNetGetNetworkInformationA(str ptr)
|
||||
@ stdcall WNetGetNetworkInformationW(wstr ptr)
|
||||
@ stdcall WNetGetProviderNameA(long ptr ptr)
|
||||
@ stdcall WNetGetProviderNameW(long ptr ptr)
|
||||
@ stdcall WNetGetResourceInformationA(ptr ptr ptr ptr)
|
||||
@ stdcall WNetGetResourceInformationW(ptr ptr ptr ptr)
|
||||
@ stdcall WNetGetResourceParentA(ptr ptr ptr)
|
||||
@ stdcall WNetGetResourceParentW(ptr ptr ptr)
|
||||
@ stdcall WNetGetUniversalNameA (str long ptr ptr)
|
||||
@ stdcall WNetGetUniversalNameW (wstr long ptr ptr)
|
||||
@ stdcall WNetGetUserA(str ptr ptr)
|
||||
@ stdcall WNetGetUserW(wstr wstr ptr)
|
||||
@ stdcall WNetLogoffA(str long)
|
||||
@ stdcall WNetLogoffW(wstr long)
|
||||
@ stdcall WNetLogonA(str long)
|
||||
@ stdcall WNetLogonW(wstr long)
|
||||
@ stdcall WNetOpenEnumA(long long long ptr ptr)
|
||||
@ stdcall WNetOpenEnumW(long long long ptr ptr)
|
||||
@ stdcall WNetRemoveCachedPassword(long long long)
|
||||
@ stdcall WNetRestoreConnectionA(long str)
|
||||
@ stdcall WNetRestoreConnectionW(long wstr)
|
||||
@ stdcall WNetSetConnectionA(str long ptr)
|
||||
@ stdcall WNetSetConnectionW(wstr long ptr)
|
||||
@ stdcall WNetUseConnectionA(long ptr str str long str ptr ptr)
|
||||
@ stdcall WNetUseConnectionW(long ptr wstr wstr long wstr ptr ptr)
|
||||
@ stdcall WNetVerifyPasswordA(str ptr)
|
||||
@ stdcall WNetVerifyPasswordW(wstr ptr)
|
||||
|
||||
#additions, not in win95 mpr.dll
|
||||
@ stub WNetRestoreConnection
|
||||
@ stub WNetLogonNotify
|
||||
@ stub WNetPasswordChangeNotify
|
||||
@ stub WNetGetPropertyTextA
|
||||
@ stub WNetPropertyDialogA
|
||||
@ stub WNetGetDirectoryTypeA
|
||||
@ stub WNetFMXGetPermHelp
|
||||
@ stub WNetFMXEditPerm
|
||||
@ stub WNetFMXGetPermCaps
|
26
reactos/lib/mpr/mpr_Cs.rc
Normal file
26
reactos/lib/mpr/mpr_Cs.rc
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Czech MPR dll resources
|
||||
* Copyright (C) 2004 Juan Lang
|
||||
* Copyright (C) 2004 David Kredba
|
||||
*
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_CZECH, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_ENTIRENETWORK "Celá sí»"
|
||||
}
|
26
reactos/lib/mpr/mpr_De.rc
Normal file
26
reactos/lib/mpr/mpr_De.rc
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* MPR dll resources
|
||||
*
|
||||
* Copyright (C) 2004 Henning Gerhardt
|
||||
*
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_GERMAN, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_ENTIRENETWORK "Gesamtes Netzwerk"
|
||||
}
|
26
reactos/lib/mpr/mpr_En.rc
Normal file
26
reactos/lib/mpr/mpr_En.rc
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* MPR dll resources
|
||||
*
|
||||
* Copyright (C) 2004 Juan Lang
|
||||
*
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_ENTIRENETWORK "Entire Network"
|
||||
}
|
26
reactos/lib/mpr/mpr_Es.rc
Normal file
26
reactos/lib/mpr/mpr_Es.rc
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* MPR dll Spanish resources
|
||||
*
|
||||
* Copyright (C) 2004 José Manuel Ferrer Ortiz
|
||||
*
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_SPANISH, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_ENTIRENETWORK "Toda la red"
|
||||
}
|
26
reactos/lib/mpr/mpr_It.rc
Normal file
26
reactos/lib/mpr/mpr_It.rc
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* MPR dll Italian resources
|
||||
*
|
||||
* Copyright 2004 Ivan Leo Puoti
|
||||
*
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_ITALIAN, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_ENTIRENETWORK "Tutta la rete"
|
||||
}
|
26
reactos/lib/mpr/mpr_Ja.rc
Normal file
26
reactos/lib/mpr/mpr_Ja.rc
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* MPR dll resources
|
||||
*
|
||||
* Copyright (C) 2004 Hajime Segawa
|
||||
*
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_ENTIRENETWORK "ƒlƒbƒgƒ<67><C692>[ƒN‘S‘Ì"
|
||||
}
|
26
reactos/lib/mpr/mpr_Nl.rc
Normal file
26
reactos/lib/mpr/mpr_Nl.rc
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Dutch resources for MPR
|
||||
*
|
||||
* Copyright (C) 2004 Hans Leidekker
|
||||
*
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_DUTCH, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_ENTIRENETWORK "Gehele netwerk"
|
||||
}
|
26
reactos/lib/mpr/mpr_Pt.rc
Normal file
26
reactos/lib/mpr/mpr_Pt.rc
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* MPR dll resources
|
||||
*
|
||||
* Copyright (C) 2004 Marcelo Duarte
|
||||
*
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_PORTUGUESE, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_ENTIRENETWORK "Toda a rede"
|
||||
}
|
100
reactos/lib/mpr/mpr_main.c
Normal file
100
reactos/lib/mpr/mpr_main.c
Normal file
|
@ -0,0 +1,100 @@
|
|||
/*
|
||||
* MPR undocumented functions
|
||||
*
|
||||
* Copyright 1999 Ulrich Weigand
|
||||
*
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winnetwk.h"
|
||||
#include "wine/debug.h"
|
||||
#include "wnetpriv.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(mpr);
|
||||
|
||||
/*
|
||||
* FIXME: The following routines should use a private heap ...
|
||||
*/
|
||||
|
||||
/*****************************************************************
|
||||
* @ [MPR.22]
|
||||
*/
|
||||
LPVOID WINAPI MPR_Alloc( DWORD dwSize )
|
||||
{
|
||||
return HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, dwSize );
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* @ [MPR.23]
|
||||
*/
|
||||
LPVOID WINAPI MPR_ReAlloc( LPVOID lpSrc, DWORD dwSize )
|
||||
{
|
||||
if ( lpSrc )
|
||||
return HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, lpSrc, dwSize );
|
||||
else
|
||||
return HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, dwSize );
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* @ [MPR.24]
|
||||
*/
|
||||
BOOL WINAPI MPR_Free( LPVOID lpMem )
|
||||
{
|
||||
if ( lpMem )
|
||||
return HeapFree( GetProcessHeap(), 0, lpMem );
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* @ [MPR.25]
|
||||
*/
|
||||
BOOL WINAPI _MPR_25( LPBYTE lpMem, INT len )
|
||||
{
|
||||
FIXME( "(%p, %d): stub\n", lpMem, len );
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* DllCanUnloadNow [MPR.@]
|
||||
*/
|
||||
DWORD WINAPI MPR_DllCanUnloadNow(void)
|
||||
{
|
||||
FIXME("Stub\n");
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* DllMain [MPR.init]
|
||||
*/
|
||||
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
||||
{
|
||||
switch (fdwReason) {
|
||||
case DLL_PROCESS_ATTACH:
|
||||
DisableThreadLibraryCalls( hinstDLL );
|
||||
wnetInit(hinstDLL);
|
||||
break;
|
||||
|
||||
case DLL_PROCESS_DETACH:
|
||||
wnetFree();
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
23
reactos/lib/mpr/mprres.h
Normal file
23
reactos/lib/mpr/mprres.h
Normal file
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* Copyright (C) 2004 Juan Lang
|
||||
*
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef __WINE_MPRRES_H__
|
||||
#define __WINE_MPRRES_H__
|
||||
|
||||
#define IDS_ENTIRENETWORK 1
|
||||
|
||||
#endif /* ndef __WINE_MPRRES_H__ */
|
81
reactos/lib/mpr/multinet.c
Normal file
81
reactos/lib/mpr/multinet.c
Normal file
|
@ -0,0 +1,81 @@
|
|||
/*
|
||||
* MPR Multinet functions
|
||||
*
|
||||
* Copyright 1999 Ulrich Weigand
|
||||
*
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winnetwk.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(mpr);
|
||||
|
||||
|
||||
/*****************************************************************
|
||||
* MultinetGetConnectionPerformanceA [MPR.@]
|
||||
*
|
||||
* RETURNS
|
||||
* Success: NO_ERROR
|
||||
* Failure: ERROR_NOT_SUPPORTED, ERROR_NOT_CONNECTED,
|
||||
* ERROR_NO_NET_OR_BAD_PATH, ERROR_BAD_DEVICE,
|
||||
* ERROR_BAD_NET_NAME, ERROR_INVALID_PARAMETER,
|
||||
* ERROR_NO_NETWORK, ERROR_EXTENDED_ERROR
|
||||
*/
|
||||
DWORD WINAPI MultinetGetConnectionPerformanceA(
|
||||
LPNETRESOURCEA lpNetResource,
|
||||
LPNETCONNECTINFOSTRUCT lpNetConnectInfoStruct )
|
||||
{
|
||||
FIXME( "(%p, %p): stub\n", lpNetResource, lpNetConnectInfoStruct );
|
||||
|
||||
SetLastError(WN_NO_NETWORK);
|
||||
return WN_NO_NETWORK;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* MultinetGetConnectionPerformanceW [MPR.@]
|
||||
*/
|
||||
DWORD WINAPI MultinetGetConnectionPerformanceW(
|
||||
LPNETRESOURCEW lpNetResource,
|
||||
LPNETCONNECTINFOSTRUCT lpNetConnectInfoStruct )
|
||||
{
|
||||
FIXME( "(%p, %p): stub\n", lpNetResource, lpNetConnectInfoStruct );
|
||||
|
||||
SetLastError(WN_NO_NETWORK);
|
||||
return WN_NO_NETWORK;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* MultinetGetErrorTextA [MPR.@]
|
||||
*/
|
||||
DWORD WINAPI MultinetGetErrorTextA( DWORD x, DWORD y, DWORD z )
|
||||
{
|
||||
FIXME( "(%lx, %lx, %lx): stub\n", x, y, z );
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* MultinetGetErrorTextW [MPR.@]
|
||||
*/
|
||||
DWORD WINAPI MultinetGetErrorTextW( DWORD x, DWORD y, DWORD z )
|
||||
{
|
||||
FIXME( "(%lx, %lx, %lx ): stub\n", x, y, z );
|
||||
return 0;
|
||||
}
|
||||
|
129
reactos/lib/mpr/nps.c
Normal file
129
reactos/lib/mpr/nps.c
Normal file
|
@ -0,0 +1,129 @@
|
|||
/*
|
||||
* MPR Network Provider Services functions
|
||||
*
|
||||
* Copyright 1999 Ulrich Weigand
|
||||
*
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winnetwk.h"
|
||||
#include "netspi.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(mpr);
|
||||
|
||||
|
||||
/*****************************************************************
|
||||
* NPSAuthenticationDialogA [MPR.@]
|
||||
*/
|
||||
DWORD WINAPI NPSAuthenticationDialogA( LPAUTHDLGSTRUCTA lpAuthDlgStruct )
|
||||
{
|
||||
FIXME( "(%p): stub\n", lpAuthDlgStruct );
|
||||
return WN_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* NPSGetProviderHandleA [MPR.@]
|
||||
*/
|
||||
DWORD WINAPI NPSGetProviderHandleA( PHPROVIDER phProvider )
|
||||
{
|
||||
FIXME( "(%p): stub\n", phProvider );
|
||||
return WN_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* NPSGetProviderNameA [MPR.@]
|
||||
*/
|
||||
DWORD WINAPI NPSGetProviderNameA( HPROVIDER hProvider, LPCSTR *lpszProviderName )
|
||||
{
|
||||
FIXME( "(%p, %p): stub\n", hProvider, lpszProviderName );
|
||||
return WN_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* NPSGetSectionNameA [MPR.@]
|
||||
*/
|
||||
DWORD WINAPI NPSGetSectionNameA( HPROVIDER hProvider, LPCSTR *lpszSectionName )
|
||||
{
|
||||
FIXME( "(%p, %p): stub\n", hProvider, lpszSectionName );
|
||||
return WN_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* NPSSetExtendedErrorA [MPR.@]
|
||||
*/
|
||||
DWORD WINAPI NPSSetExtendedErrorA( DWORD NetSpecificError, LPSTR lpExtendedErrorText )
|
||||
{
|
||||
FIXME( "(%08lx, %s): stub\n", NetSpecificError, debugstr_a(lpExtendedErrorText) );
|
||||
return WN_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* NPSSetCustomTextA [MPR.@]
|
||||
*/
|
||||
VOID WINAPI NPSSetCustomTextA( LPSTR lpCustomErrorText )
|
||||
{
|
||||
FIXME( "(%s): stub\n", debugstr_a(lpCustomErrorText) );
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* NPSCopyStringA [MPR.@]
|
||||
*/
|
||||
DWORD WINAPI NPSCopyStringA( LPCSTR lpString, LPVOID lpBuffer, LPDWORD lpdwBufferSize )
|
||||
{
|
||||
FIXME( "(%s, %p, %p): stub\n", debugstr_a(lpString), lpBuffer, lpdwBufferSize );
|
||||
return WN_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* NPSDeviceGetNumberA [MPR.@]
|
||||
*/
|
||||
DWORD WINAPI NPSDeviceGetNumberA( LPSTR lpLocalName, LPDWORD lpdwNumber, LPDWORD lpdwType )
|
||||
{
|
||||
FIXME( "(%s, %p, %p): stub\n", debugstr_a(lpLocalName), lpdwNumber, lpdwType );
|
||||
return WN_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* NPSDeviceGetStringA [MPR.@]
|
||||
*/
|
||||
DWORD WINAPI NPSDeviceGetStringA( DWORD dwNumber, DWORD dwType, LPSTR lpLocalName, LPDWORD lpdwBufferSize )
|
||||
{
|
||||
FIXME( "(%ld, %ld, %p, %p): stub\n", dwNumber, dwType, lpLocalName, lpdwBufferSize );
|
||||
return WN_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* NPSNotifyRegisterA [MPR.@]
|
||||
*/
|
||||
DWORD WINAPI NPSNotifyRegisterA( enum NOTIFYTYPE NotifyType, NOTIFYCALLBACK pfNotifyCallBack )
|
||||
{
|
||||
FIXME( "(%d, %p): stub\n", NotifyType, pfNotifyCallBack );
|
||||
return WN_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* NPSNotifyGetContextA [MPR.@]
|
||||
*/
|
||||
LPVOID WINAPI NPSNotifyGetContextA( NOTIFYCALLBACK pfNotifyCallBack )
|
||||
{
|
||||
FIXME( "(%p): stub\n", pfNotifyCallBack );
|
||||
return NULL;
|
||||
}
|
||||
|
315
reactos/lib/mpr/pwcache.c
Normal file
315
reactos/lib/mpr/pwcache.c
Normal file
|
@ -0,0 +1,315 @@
|
|||
/*
|
||||
* MPR Password Cache functions
|
||||
*
|
||||
* Copyright 1999 Ulrich Weigand
|
||||
* Copyright 2003,2004 Mike McCormack for CodeWeavers
|
||||
*
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winnetwk.h"
|
||||
#include "winreg.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(mpr);
|
||||
|
||||
static const char mpr_key[] = "Software\\Wine\\Wine\\Mpr\\";
|
||||
|
||||
static inline BYTE hex( BYTE x )
|
||||
{
|
||||
if( x <= 9 )
|
||||
return x + '0';
|
||||
return x + 'A' - 10;
|
||||
}
|
||||
|
||||
static inline CHAR ctox( CHAR x )
|
||||
{
|
||||
if( ( x >= '0' ) && ( x <= '9' ) )
|
||||
return x - '0';
|
||||
if( ( x >= 'A' ) && ( x <= 'F' ) )
|
||||
return x - 'A' + 10;
|
||||
if( ( x >= 'a' ) && ( x <= 'a' ) )
|
||||
return x - 'a' + 10;
|
||||
return -1;
|
||||
}
|
||||
|
||||
static LPSTR MPR_GetValueName( LPSTR pbResource, WORD cbResource, BYTE nType )
|
||||
{
|
||||
LPSTR name;
|
||||
DWORD i;
|
||||
|
||||
name = HeapAlloc( GetProcessHeap(), 0, 6+cbResource*2 );
|
||||
if( name )
|
||||
sprintf( name, "X-%02X-", nType );
|
||||
for(i=0; i<cbResource; i++)
|
||||
{
|
||||
name[5+i*2]=hex((pbResource[i]&0xf0)>>4);
|
||||
name[6+i*2]=hex(pbResource[i]&0x0f);
|
||||
}
|
||||
name[5+i*2]=0;
|
||||
TRACE( "Value is %s\n", name );
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* WNetCachePassword [MPR.@] Saves password in cache
|
||||
*
|
||||
* NOTES
|
||||
* only the parameter count is verifyed
|
||||
*
|
||||
* ---- everything below this line might be wrong (js) -----
|
||||
* RETURNS
|
||||
* Success: WN_SUCCESS
|
||||
* Failure: WN_ACCESS_DENIED, WN_BAD_PASSWORD, WN_BADVALUE, WN_NET_ERROR,
|
||||
* WN_NOT_SUPPORTED, WN_OUT_OF_MEMORY
|
||||
*/
|
||||
DWORD WINAPI WNetCachePassword(
|
||||
LPSTR pbResource, /* [in] Name of workgroup, computer, or resource */
|
||||
WORD cbResource, /* [in] Size of name */
|
||||
LPSTR pbPassword, /* [in] Buffer containing password */
|
||||
WORD cbPassword, /* [in] Size of password */
|
||||
BYTE nType, /* [in] Type of password to cache */
|
||||
WORD x)
|
||||
|
||||
{
|
||||
HKEY hkey;
|
||||
DWORD r;
|
||||
LPSTR valname;
|
||||
|
||||
WARN( "(%p(%s), %d, %p(%s), %d, %d, 0x%08x): totally insecure\n",
|
||||
pbResource, debugstr_a(pbResource), cbResource,
|
||||
pbPassword, debugstr_a(pbPassword), cbPassword,
|
||||
nType, x );
|
||||
|
||||
r = RegCreateKeyA( HKEY_CURRENT_USER, mpr_key, &hkey );
|
||||
if( r )
|
||||
return WN_ACCESS_DENIED;
|
||||
|
||||
valname = MPR_GetValueName( pbResource, cbResource, nType );
|
||||
if( valname )
|
||||
{
|
||||
r = RegSetValueExA( hkey, valname, 0, REG_BINARY,
|
||||
pbPassword, cbPassword );
|
||||
if( r )
|
||||
r = WN_CANCEL;
|
||||
else
|
||||
r = WN_SUCCESS;
|
||||
HeapFree( GetProcessHeap(), 0, valname );
|
||||
}
|
||||
else
|
||||
r = WN_OUT_OF_MEMORY;
|
||||
|
||||
RegCloseKey( hkey );
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* WNetRemoveCachedPassword [MPR.@]
|
||||
*/
|
||||
UINT WINAPI WNetRemoveCachedPassword(
|
||||
LPSTR pbResource, /* [in] resource ID to delete */
|
||||
WORD cbResource, /* [in] number of bytes in the resource ID */
|
||||
BYTE nType ) /* [in] Type of the resource to delete */
|
||||
{
|
||||
HKEY hkey;
|
||||
DWORD r;
|
||||
LPSTR valname;
|
||||
|
||||
WARN( "(%p(%s), %d, %d): totally insecure\n",
|
||||
pbResource, debugstr_a(pbResource), cbResource, nType );
|
||||
|
||||
r = RegCreateKeyA( HKEY_CURRENT_USER, mpr_key, &hkey );
|
||||
if( r )
|
||||
return WN_ACCESS_DENIED;
|
||||
|
||||
valname = MPR_GetValueName( pbResource, cbResource, nType );
|
||||
if( valname )
|
||||
{
|
||||
r = RegDeleteValueA( hkey, valname );
|
||||
if( r )
|
||||
r = WN_ACCESS_DENIED;
|
||||
else
|
||||
r = WN_SUCCESS;
|
||||
HeapFree( GetProcessHeap(), 0, valname );
|
||||
}
|
||||
else
|
||||
r = WN_OUT_OF_MEMORY;
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* WNetGetCachedPassword [MPR.@] Retrieves password from cache
|
||||
*
|
||||
* NOTES
|
||||
* the stub seems to be wrong:
|
||||
* arg1: ptr 0x40xxxxxx -> (no string)
|
||||
* arg2: len 36
|
||||
* arg3: ptr 0x40xxxxxx -> (no string)
|
||||
* arg4: ptr 0x40xxxxxx -> 0xc8
|
||||
* arg5: type? 4
|
||||
*
|
||||
* ---- everything below this line might be wrong (js) -----
|
||||
* RETURNS
|
||||
* Success: WN_SUCCESS
|
||||
* Failure: WN_ACCESS_DENIED, WN_BAD_PASSWORD, WN_BAD_VALUE,
|
||||
* WN_NET_ERROR, WN_NOT_SUPPORTED, WN_OUT_OF_MEMORY
|
||||
*/
|
||||
DWORD WINAPI WNetGetCachedPassword(
|
||||
LPSTR pbResource, /* [in] Name of workgroup, computer, or resource */
|
||||
WORD cbResource, /* [in] Size of name */
|
||||
LPSTR pbPassword, /* [out] Buffer to receive password */
|
||||
LPWORD pcbPassword, /* [out] Receives size of password */
|
||||
BYTE nType) /* [in] Type of password to retrieve */
|
||||
{
|
||||
HKEY hkey;
|
||||
DWORD r, type = 0, sz;
|
||||
LPSTR valname;
|
||||
|
||||
WARN( "(%p(%s), %d, %p, %p, %d): totally insecure\n",
|
||||
pbResource, debugstr_a(pbResource), cbResource,
|
||||
pbPassword, pcbPassword, nType );
|
||||
|
||||
memset( pbPassword, 0, *pcbPassword);
|
||||
|
||||
r = RegCreateKeyA( HKEY_CURRENT_USER, mpr_key, &hkey );
|
||||
if( r )
|
||||
return WN_ACCESS_DENIED;
|
||||
|
||||
valname = MPR_GetValueName( pbResource, cbResource, nType );
|
||||
if( valname )
|
||||
{
|
||||
sz = *pcbPassword;
|
||||
r = RegQueryValueExA( hkey, valname, 0, &type, pbPassword, &sz );
|
||||
*pcbPassword = sz;
|
||||
if( r )
|
||||
r = WN_CANCEL;
|
||||
else
|
||||
r = WN_SUCCESS;
|
||||
HeapFree( GetProcessHeap(), 0, valname );
|
||||
}
|
||||
else
|
||||
r = WN_OUT_OF_MEMORY;
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
* WNetEnumCachedPasswords [MPR.@]
|
||||
*
|
||||
* NOTES
|
||||
* the parameter count is verifyed
|
||||
*
|
||||
* This function is a huge security risk, as virii and such can use
|
||||
* it to grab all the passwords in the cache. It's bad enough to
|
||||
* store the passwords (insecurely).
|
||||
*
|
||||
* bpPrefix and cbPrefix are used to filter the returned passwords
|
||||
* the first cbPrefix bytes of the password resource identifier
|
||||
* should match the same number of bytes in bpPrefix
|
||||
*
|
||||
* RETURNS
|
||||
* Success: WN_SUCCESS (even if no entries were enumerated)
|
||||
* Failure: WN_ACCESS_DENIED, WN_BAD_PASSWORD, WN_BAD_VALUE,
|
||||
* WN_NET_ERROR, WN_NOT_SUPPORTED, WN_OUT_OF_MEMORY
|
||||
*/
|
||||
|
||||
UINT WINAPI WNetEnumCachedPasswords(
|
||||
LPSTR pbPrefix, /* [in] prefix to filter cache entries */
|
||||
WORD cbPrefix, /* [in] number of bytes in Prefix substring */
|
||||
BYTE nType, /* [in] match the Type ID of the entry */
|
||||
ENUMPASSWORDPROC enumPasswordProc, /* [in] callback function */
|
||||
DWORD param) /* [in] parameter passed to enum function */
|
||||
{
|
||||
HKEY hkey;
|
||||
DWORD r, type, val_sz, data_sz, i, j, size;
|
||||
PASSWORD_CACHE_ENTRY *entry;
|
||||
CHAR val[256], prefix[6];
|
||||
|
||||
WARN( "(%s, %d, %d, %p, 0x%08lx) totally insecure\n",
|
||||
debugstr_an(pbPrefix,cbPrefix), cbPrefix,
|
||||
nType, enumPasswordProc, param );
|
||||
|
||||
r = RegCreateKeyA( HKEY_CURRENT_USER, mpr_key, &hkey );
|
||||
if( r )
|
||||
return WN_ACCESS_DENIED;
|
||||
|
||||
sprintf(prefix, "X-%02X-", nType );
|
||||
|
||||
i = 0;
|
||||
for( i=0; ; i++ )
|
||||
{
|
||||
val_sz = sizeof val;
|
||||
data_sz = 0;
|
||||
type = 0;
|
||||
val[0] = 0;
|
||||
r = RegEnumValueA( hkey, i, val, &val_sz, NULL, &type, NULL, &data_sz );
|
||||
if( r != ERROR_SUCCESS )
|
||||
break;
|
||||
if( type != REG_BINARY )
|
||||
continue;
|
||||
|
||||
/* check the value is in the format we expect */
|
||||
if( val_sz < sizeof prefix )
|
||||
continue;
|
||||
if( memcmp( prefix, val, 5 ) )
|
||||
continue;
|
||||
|
||||
/* decode the value */
|
||||
for(j=5; j<val_sz; j+=2 )
|
||||
{
|
||||
CHAR hi = ctox( val[j] ), lo = ctox( val[j+1] );
|
||||
if( ( hi < 0 ) || ( lo < 0 ) )
|
||||
break;
|
||||
val[(j-5)/2] = (hi<<4) | lo;
|
||||
}
|
||||
|
||||
/* find the decoded length */
|
||||
val_sz = (j - 5)/2;
|
||||
val[val_sz]=0;
|
||||
if( val_sz < cbPrefix )
|
||||
continue;
|
||||
|
||||
/* check the prefix matches */
|
||||
if( memcmp(val, pbPrefix, cbPrefix) )
|
||||
continue;
|
||||
|
||||
/* read the value data */
|
||||
size = sizeof *entry - sizeof entry->abResource[0] + val_sz + data_sz;
|
||||
entry = HeapAlloc( GetProcessHeap(), 0, sizeof *entry + val_sz + data_sz );
|
||||
memcpy( entry->abResource, val, val_sz );
|
||||
entry->cbEntry = size;
|
||||
entry->cbResource = val_sz;
|
||||
entry->cbPassword = data_sz;
|
||||
entry->iEntry = i;
|
||||
entry->nType = nType;
|
||||
r = RegEnumValueA( hkey, i, NULL, &val_sz, NULL, &type,
|
||||
&entry->abResource[val_sz], &data_sz );
|
||||
if( r == ERROR_SUCCESS )
|
||||
enumPasswordProc( entry, param );
|
||||
HeapFree( GetProcessHeap(), 0, entry );
|
||||
}
|
||||
|
||||
RegCloseKey( hkey );
|
||||
|
||||
return WN_SUCCESS;
|
||||
}
|
28
reactos/lib/mpr/version.rc
Normal file
28
reactos/lib/mpr/version.rc
Normal file
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
* MPR dll version resources
|
||||
*
|
||||
* Copyright (C) 2004 Juan Lang
|
||||
*
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#define WINE_FILEDESCRIPTION_STR "Wine Multiprotocol Router Library"
|
||||
#define WINE_FILENAME_STR "mpr.dll"
|
||||
#define WINE_FILEVERSION 5,0,2195,6611
|
||||
#define WINE_FILEVERSION_STR "5.00.2195.6611"
|
||||
#define WINE_PRODUCTVERSION 5,0,2195,6611
|
||||
#define WINE_PRODUCTVERSION_STR "5.00.2195.6611"
|
||||
|
||||
#include "wine/wine_common_ver.rc"
|
2045
reactos/lib/mpr/wnet.c
Normal file
2045
reactos/lib/mpr/wnet.c
Normal file
File diff suppressed because it is too large
Load diff
27
reactos/lib/mpr/wnetpriv.h
Normal file
27
reactos/lib/mpr/wnetpriv.h
Normal file
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* WNet private definitions
|
||||
*
|
||||
* Copyright (C) 2004 Juan Lang
|
||||
*
|
||||
* 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
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __WNET_PRIV_H__
|
||||
#define __WNET_PRIV_H__
|
||||
|
||||
void wnetInit(HINSTANCE hInstDll);
|
||||
void wnetFree(void);
|
||||
|
||||
#endif /* ndef __WNET_PRIV_H__ */
|
Loading…
Reference in a new issue