Author: winesync Date: Thu Nov 29 13:50:33 2007 New Revision: 30871
URL: http://svn.reactos.org/svn/reactos?rev=30871&view=rev Log: Autosyncing with Wine HEAD
Modified: trunk/reactos/dll/win32/mpr/mpr.rbuild trunk/reactos/dll/win32/mpr/mpr_Bg.rc trunk/reactos/dll/win32/mpr/mpr_Ko.rc trunk/reactos/dll/win32/mpr/mpr_No.rc trunk/reactos/dll/win32/mpr/mpr_Pl.rc trunk/reactos/dll/win32/mpr/mpr_Sv.rc trunk/reactos/dll/win32/mpr/mpr_ros.diff trunk/reactos/dll/win32/mpr/nps.c trunk/reactos/dll/win32/mpr/pwcache.c trunk/reactos/dll/win32/mpr/wnet.c
Modified: trunk/reactos/dll/win32/mpr/mpr.rbuild URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mpr/mpr.rbuild?re... ============================================================================== --- trunk/reactos/dll/win32/mpr/mpr.rbuild (original) +++ trunk/reactos/dll/win32/mpr/mpr.rbuild Thu Nov 29 13:50:33 2007 @@ -1,13 +1,12 @@ +<?xml version="1.0"?> +<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> <module name="mpr" type="win32dll" baseaddress="${BASEADDRESS_MPR}" installbase="system32" installname="mpr.dll" allowwarnings="true"> <importlibrary definition="mpr.spec.def" /> <include base="mpr">.</include> <include base="ReactOS">include/reactos/wine</include> - <define name="__REACTOS__" /> <define name="__WINESRC__" /> - <define name="__USE_W32API" /> - <define name="_WIN32_IE">0x600</define> - <define name="_WIN32_WINNT">0x501</define> - <define name="WINVER">0x501</define> + <define name="WINVER">0x600</define> + <define name="_WIN32_WINNT">0x600</define> <library>wine</library> <library>user32</library> <library>advapi32</library>
Modified: trunk/reactos/dll/win32/mpr/mpr_Bg.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mpr/mpr_Bg.rc?rev... ============================================================================== --- trunk/reactos/dll/win32/mpr/mpr_Bg.rc (original) +++ trunk/reactos/dll/win32/mpr/mpr_Bg.rc Thu Nov 29 13:50:33 2007 @@ -1,7 +1,7 @@ /* - * MPR dll resources + * MPR Bulgarian resource * - * Copyright (C) 2004 Juan Lang + * Copyright 2005 Milko Krachounov * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -27,20 +27,20 @@
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Âúâåäåòå ïàðîëà çà ìðåæàòà" +CAPTION "Âúâåäåòå ìðåæîâà ïàðîëà" FONT 8, "MS Shell Dlg" { - LTEXT "Âúâåäåòå ñâîèòå ïîòðåáèòåëñêî èìå è ïàðîëà:", IDC_EXPLAIN, 40, 6, 150, 15 - LTEXT "Ïðåçñúðâúð", -1, 40, 26, 50, 10 -/* LTEXT "Ñòðàíà", -1, 40, 46, 50, 10 */ + LTEXT "Âúâåäåòå âàøåòî ïîòðåáèòåëñêî èìå è ïàðîëà:", IDC_EXPLAIN, 40, 6, 150, 15 + LTEXT "Ïðîêñè", -1, 40, 26, 50, 10 +/* LTEXT "Realm", -1, 40, 46, 50, 10 */ LTEXT "Ïîòðåáèòåë", -1, 40, 66, 50, 10 LTEXT "Ïàðîëà", -1, 40, 86, 50, 10 LTEXT "" IDC_PROXY, 80, 26, 150, 14, 0 LTEXT "" IDC_REALM, 80, 46, 150, 14, 0 EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD - CHECKBOX "&Ñúõðàíÿâàíå íà ïàðîëàòà (íåáåçîïàñíî)", IDC_SAVEPASSWORD, + CHECKBOX "&Save this password (Insecure)", IDC_SAVEPASSWORD, 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - PUSHBUTTON "Äîáðå", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON - PUSHBUTTON "Îòêàç", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON + PUSHBUTTON "Îòìåíè", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP }
Modified: trunk/reactos/dll/win32/mpr/mpr_Ko.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mpr/mpr_Ko.rc?rev... ============================================================================== --- trunk/reactos/dll/win32/mpr/mpr_Ko.rc (original) +++ trunk/reactos/dll/win32/mpr/mpr_Ko.rc Thu Nov 29 13:50:33 2007 @@ -2,7 +2,7 @@ * MPR dll resources * * Copyright (C) 2004 Juan Lang - * Copyright 2005 YunSong Hwang + * Copyright 2005,2007 YunSong Hwang * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -40,7 +40,7 @@ LTEXT "" IDC_REALM, 80, 46, 150, 14, 0 EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD - CHECKBOX "¾ÏÈ£ ÀúÀå(&S) (Insecure)", IDC_SAVEPASSWORD, + CHECKBOX "¾ÏÈ£ ÀúÀå(&S) (º¸¾È¿¡ ÁÖÀÇ)", IDC_SAVEPASSWORD, 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP PUSHBUTTON "È®ÀÎ", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON PUSHBUTTON "Ãë¼Ò", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
Modified: trunk/reactos/dll/win32/mpr/mpr_No.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mpr/mpr_No.rc?rev... ============================================================================== --- trunk/reactos/dll/win32/mpr/mpr_No.rc (original) +++ trunk/reactos/dll/win32/mpr/mpr_No.rc Thu Nov 29 13:50:33 2007 @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-LANGUAGE LANG_NORWEGIAN, SUBLANG_NEUTRAL +LANGUAGE LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL
STRINGTABLE DISCARDABLE {
Modified: trunk/reactos/dll/win32/mpr/mpr_Pl.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mpr/mpr_Pl.rc?rev... ============================================================================== --- trunk/reactos/dll/win32/mpr/mpr_Pl.rc (original) +++ trunk/reactos/dll/win32/mpr/mpr_Pl.rc Thu Nov 29 13:50:33 2007 @@ -28,7 +28,7 @@
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Wprowad has³o do sieci" +CAPTION "Wpisz has³o sieci" FONT 8, "MS Shell Dlg" { LTEXT "Proszê wprowadziæ nazwê u¿ytkownika i has³o:", IDC_EXPLAIN, 40, 6, 150, 15 @@ -40,7 +40,7 @@ LTEXT "" IDC_REALM, 80, 46, 150, 14, 0 EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD - CHECKBOX "&Zapamiêtaj to has³o (nie bezpieczne)", IDC_SAVEPASSWORD, + CHECKBOX "&Zapisz to has³o (niebezpieczne)", IDC_SAVEPASSWORD, 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON PUSHBUTTON "Anuluj", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
Modified: trunk/reactos/dll/win32/mpr/mpr_Sv.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mpr/mpr_Sv.rc?rev... ============================================================================== --- trunk/reactos/dll/win32/mpr/mpr_Sv.rc (original) +++ trunk/reactos/dll/win32/mpr/mpr_Sv.rc Thu Nov 29 13:50:33 2007 @@ -1,7 +1,7 @@ /* - * MPR dll Swedish resources + * MPR dll resources * - * Copyright (C) 2005 Andreas Bjerkeholt + * Copyright (C) 2007 Daniel Nylander * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -15,10 +15,10 @@ * * 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 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL +LANGUAGE LANG_SWEDISH, SUBLANG_DEFAULT
STRINGTABLE DISCARDABLE { @@ -39,7 +39,7 @@ LTEXT "" IDC_REALM, 80, 46, 150, 14, 0 EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD - CHECKBOX "&Spara detta lösenord (Osäkert)", IDC_SAVEPASSWORD, + CHECKBOX "&Spara detta lösenord (osäkert)", IDC_SAVEPASSWORD, 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON PUSHBUTTON "Avbryt", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
Modified: trunk/reactos/dll/win32/mpr/mpr_ros.diff URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mpr/mpr_ros.diff?... ============================================================================== --- trunk/reactos/dll/win32/mpr/mpr_ros.diff (original) +++ trunk/reactos/dll/win32/mpr/mpr_ros.diff Thu Nov 29 13:50:33 2007 @@ -2,12 +2,12 @@ =================================================================== --- mpr.rc (revision 23782) +++ mpr.rc (working copy) -@@ -39,4 +39,7 @@ +@@ -39,5 +39,7 @@ #include "mpr_No.rc" #include "mpr_Pl.rc" #include "mpr_Pt.rc" +#include "mpr_Ru.rc" -+#include "mpr_Sv.rc" + #include "mpr_Sv.rc" #include "mpr_Tr.rc" +#include "mpr_Uk.rc" Index: mpr_Ru.rc @@ -61,57 +61,6 @@ + PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON + PUSHBUTTON "Îòìåíà", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP +} -Index: mpr_Sv.rc -=================================================================== ---- mpr_Sv.rc (revision 23782) -+++ mpr_Sv.rc (working copy) -@@ -0,0 +1,46 @@ -+/* -+ * MPR dll Swedish resources -+ * -+ * Copyright (C) 2005 Andreas Bjerkeholt -+ * -+ * 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_SWEDISH, SUBLANG_NEUTRAL -+ -+STRINGTABLE DISCARDABLE -+{ -+ IDS_ENTIRENETWORK "Hela nätverket" -+} -+ -+IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 -+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -+CAPTION "Ange nätverkslösenord" -+FONT 8, "MS Shell Dlg" -+{ -+ LTEXT "Ange ditt användarnamn och lösenord:", IDC_EXPLAIN, 40, 6, 150, 15 -+ LTEXT "Proxy", -1, 40, 26, 50, 10 -+/* LTEXT "Realm", -1, 40, 46, 50, 10 */ -+ LTEXT "Användare", -1, 40, 66, 50, 10 -+ LTEXT "Lösenord", -1, 40, 86, 50, 10 -+ LTEXT "" IDC_PROXY, 80, 26, 150, 14, 0 -+ LTEXT "" IDC_REALM, 80, 46, 150, 14, 0 -+ EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP -+ EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD -+ CHECKBOX "&Spara detta lösenord (Osäkert)", IDC_SAVEPASSWORD, -+ 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP -+ PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON -+ PUSHBUTTON "Avbryt", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP -+} Index: mpr_Uk.rc =================================================================== --- mpr_Uk.rc (revision 23782)
Modified: trunk/reactos/dll/win32/mpr/nps.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mpr/nps.c?rev=308... ============================================================================== --- trunk/reactos/dll/win32/mpr/nps.c (original) +++ trunk/reactos/dll/win32/mpr/nps.c Thu Nov 29 13:50:33 2007 @@ -82,7 +82,7 @@ hitem = GetDlgItem( hdlg, IDC_USERNAME ); if( hitem ) GetWindowTextA( hitem, lpAuthDlgStruct->lpUsername, lpAuthDlgStruct->cbUsername ); - + password[0] = 0; hitem = GetDlgItem( hdlg, IDC_PASSWORD ); if( hitem ) @@ -119,7 +119,7 @@ lpAuthDlgStruct->lpOUTitle, lpAuthDlgStruct->lpExplainText);
return DialogBoxParamW( hwininet, MAKEINTRESOURCEW( IDD_PROXYDLG ), - lpAuthDlgStruct->hwndOwner, NPS_ProxyPasswordDialog, + lpAuthDlgStruct->hwndOwner, NPS_ProxyPasswordDialog, (LPARAM) lpAuthDlgStruct ); }
Modified: trunk/reactos/dll/win32/mpr/pwcache.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mpr/pwcache.c?rev... ============================================================================== --- trunk/reactos/dll/win32/mpr/pwcache.c (original) +++ trunk/reactos/dll/win32/mpr/pwcache.c Thu Nov 29 13:50:33 2007 @@ -56,8 +56,9 @@ DWORD i;
name = HeapAlloc( GetProcessHeap(), 0, 6+cbResource*2 ); - if( name ) - sprintf( name, "X-%02X-", nType ); + if( !name ) return NULL; + + sprintf( name, "X-%02X-", nType ); for(i=0; i<cbResource; i++) { name[5+i*2]=hex((pbResource[i]&0xf0)>>4); @@ -107,7 +108,7 @@ valname = MPR_GetValueName( pbResource, cbResource, nType ); if( valname ) { - r = RegSetValueExA( hkey, valname, 0, REG_BINARY, + r = RegSetValueExA( hkey, valname, 0, REG_BINARY, (LPBYTE)pbPassword, cbPassword ); if( r ) r = WN_CANCEL; @@ -221,9 +222,9 @@ * * 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 + * 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 @@ -306,7 +307,7 @@ entry->cbPassword = data_sz; entry->iEntry = i; entry->nType = nType; - r = RegEnumValueA( hkey, i, NULL, &val_sz, NULL, &type, + r = RegEnumValueA( hkey, i, NULL, &val_sz, NULL, &type, &entry->abResource[val_sz], &data_sz ); if( r == ERROR_SUCCESS ) enumPasswordProc( entry, param );
Modified: trunk/reactos/dll/win32/mpr/wnet.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mpr/wnet.c?rev=30... ============================================================================== --- trunk/reactos/dll/win32/mpr/wnet.c (original) +++ trunk/reactos/dll/win32/mpr/wnet.c Thu Nov 29 13:50:33 2007 @@ -52,6 +52,7 @@ PF_NPOpenEnum openEnum; PF_NPEnumResource enumResource; PF_NPCloseEnum closeEnum; + PF_NPGetResourceInformation getResourceInformation; } WNetProvider, *PWNetProvider;
typedef struct _WNetProviderTable @@ -133,7 +134,7 @@ { static const WCHAR szProviderName[] = { 'N','a','m','e',0 }; PWSTR name = NULL; - + size = 0; RegQueryValueExW(hKey, szProviderName, NULL, NULL, NULL, &size); if (size) @@ -182,6 +183,10 @@ provider->closeEnum = (PF_NPCloseEnum) GetProcAddress(hLib, "NPCloseEnum"); TRACE("closeEnum is %p\n", provider->closeEnum); + provider->getResourceInformation = (PF_NPGetResourceInformation) + GetProcAddress(hLib, "NPGetResourceInformation"); + TRACE("getResourceInformation is %p\n", + provider->getResourceInformation); if (!provider->openEnum || !provider->enumResource || !provider->closeEnum) { @@ -731,7 +736,7 @@ if (index != BAD_PROVIDER_INDEX) { if (providerTable->table[index].openEnum && - providerTable->table[index].dwEnumScopes & dwScope) + providerTable->table[index].dwEnumScopes & WNNC_ENUM_GLOBAL) { HANDLE handle;
@@ -893,7 +898,7 @@ if (*lpBufferSize < sizeof(NETRESOURCEA)) return WN_MORE_DATA;
- if (!providerTable || enumerator->providerIndex >= + if (!providerTable || enumerator->providerIndex >= providerTable->numProviders) ret = WN_NO_MORE_ENTRIES; else @@ -964,6 +969,7 @@
if (enumerator->providerDone) { + DWORD dwEnum = 0; enumerator->providerDone = FALSE; if (enumerator->handle) { @@ -972,10 +978,15 @@ enumerator->handle = NULL; enumerator->providerIndex++; } + if (enumerator->dwScope == RESOURCE_CONNECTED) + dwEnum = WNNC_ENUM_LOCAL; + else if (enumerator->dwScope == RESOURCE_GLOBALNET) + dwEnum = WNNC_ENUM_GLOBAL; + else if (enumerator->dwScope == RESOURCE_CONTEXT) + dwEnum = WNNC_ENUM_CONTEXT; for (; enumerator->providerIndex < providerTable->numProviders && - !(enumerator->dwScope & providerTable->table - [enumerator->providerIndex].dwEnumScopes); - enumerator->providerIndex++) + !(providerTable->table[enumerator->providerIndex].dwEnumScopes + & dwEnum); enumerator->providerIndex++) ; } return enumerator->providerIndex < providerTable->numProviders ? @@ -1275,30 +1286,157 @@
/********************************************************************* * WNetGetResourceInformationA [MPR.@] + * + * See WNetGetResourceInformationW */ DWORD WINAPI WNetGetResourceInformationA( LPNETRESOURCEA lpNetResource, LPVOID lpBuffer, LPDWORD cbBuffer, LPSTR *lplpSystem ) { - FIXME( "(%p, %p, %p, %p): stub\n", + DWORD ret; + + TRACE( "(%p, %p, %p, %p)\n", lpNetResource, lpBuffer, cbBuffer, lplpSystem );
- SetLastError(WN_NO_NETWORK); - return WN_NO_NETWORK; + if (!providerTable || providerTable->numProviders == 0) + ret = WN_NO_NETWORK; + else if (lpNetResource) + { + LPNETRESOURCEW lpNetResourceW = NULL; + DWORD size = 1024, count = 1; + DWORD len; + + lpNetResourceW = HeapAlloc(GetProcessHeap(), 0, size); + ret = _thunkNetResourceArrayAToW(lpNetResource, &count, lpNetResourceW, &size); + if (ret == WN_MORE_DATA) + { + lpNetResourceW = HeapAlloc(GetProcessHeap(), 0, size); + if (lpNetResourceW) + ret = _thunkNetResourceArrayAToW(lpNetResource, + &count, lpNetResourceW, &size); + else + ret = WN_OUT_OF_MEMORY; + } + if (ret == WN_SUCCESS) + { + LPWSTR lpSystemW = NULL; + LPVOID lpBufferW; + size = 1024; + lpBufferW = HeapAlloc(GetProcessHeap(), 0, size); + if (lpBufferW) + { + ret = WNetGetResourceInformationW(lpNetResourceW, + lpBufferW, &size, &lpSystemW); + if (ret == WN_MORE_DATA) + { + HeapFree(GetProcessHeap(), 0, lpBufferW); + lpBufferW = HeapAlloc(GetProcessHeap(), 0, size); + if (lpBufferW) + ret = WNetGetResourceInformationW(lpNetResourceW, + lpBufferW, &size, &lpSystemW); + else + ret = WN_OUT_OF_MEMORY; + } + if (ret == WN_SUCCESS) + { + ret = _thunkNetResourceArrayWToA(lpBufferW, + &count, lpBuffer, cbBuffer); + lpNetResourceW = lpBufferW; + size = sizeof(NETRESOURCEA); + size += WideCharToMultiByte(CP_ACP, 0, lpNetResourceW->lpRemoteName, + -1, NULL, 0, NULL, NULL); + size += WideCharToMultiByte(CP_ACP, 0, lpNetResourceW->lpProvider, + -1, NULL, 0, NULL, NULL); + + len = WideCharToMultiByte(CP_ACP, 0, lpSystemW, + -1, NULL, 0, NULL, NULL); + if ((len) && ( size + len < *cbBuffer)) + { + *lplpSystem = (char*)lpBuffer + *cbBuffer - len; + WideCharToMultiByte(CP_ACP, 0, lpSystemW, -1, + *lplpSystem, len, NULL, NULL); + ret = WN_SUCCESS; + } + else + ret = WN_MORE_DATA; + } + else + ret = WN_OUT_OF_MEMORY; + HeapFree(GetProcessHeap(), 0, lpBufferW); + } + else + ret = WN_OUT_OF_MEMORY; + HeapFree(GetProcessHeap(), 0, lpSystemW); + } + HeapFree(GetProcessHeap(), 0, lpNetResourceW); + } + else + ret = WN_NO_NETWORK; + + if (ret) + SetLastError(ret); + TRACE("Returning %d\n", ret); + return ret; }
/********************************************************************* * WNetGetResourceInformationW [MPR.@] - */ + * + * WNetGetResourceInformationW function identifies the network provider + * that owns the resource and gets information about the type of the resource. + * + * PARAMS: + * lpNetResource [ I] the pointer to NETRESOURCEW structure, that + * defines a network resource. + * lpBuffer [ O] the pointer to buffer, containing result. It + * contains NETRESOURCEW structure and strings to + * which the members of the NETRESOURCEW structure + * point. + * cbBuffer [I/O] the pointer to DWORD number - size of buffer + * in bytes. + * lplpSystem [ O] the pointer to string in the output buffer, + * containing the part of the resource name without + * names of the server and share. + * + * RETURNS: + * NO_ERROR if the function succeeds. System error code if the function fails. + */ + DWORD WINAPI WNetGetResourceInformationW( LPNETRESOURCEW lpNetResource, LPVOID lpBuffer, LPDWORD cbBuffer, LPWSTR *lplpSystem ) { - FIXME( "(%p, %p, %p, %p): stub\n", - lpNetResource, lpBuffer, cbBuffer, lplpSystem ); - - SetLastError(WN_NO_NETWORK); - return WN_NO_NETWORK; + DWORD ret = WN_NO_NETWORK; + DWORD index; + + TRACE( "(%p, %p, %p, %p)\n", + lpNetResource, lpBuffer, cbBuffer, lplpSystem); + + if (!(lpBuffer)) + ret = WN_OUT_OF_MEMORY; + else + { + /* FIXME: For function value of a variable is indifferent, it does + * search of all providers in a network. + */ + for (index = 0; index < providerTable->numProviders; index++) + { + if(providerTable->table[index].getCaps(WNNC_DIALOG) & + WNNC_DLG_GETRESOURCEINFORMATION) + { + if (providerTable->table[index].getResourceInformation) + ret = providerTable->table[index].getResourceInformation( + lpNetResource, lpBuffer, cbBuffer, lplpSystem); + else + ret = WN_NO_NETWORK; + if (ret == WN_SUCCESS) + break; + } + } + } + if (ret) + SetLastError(ret); + return ret; }
/*********************************************************************