Skip to content

Commit e7f66b6

Browse files
committed
[MPR]
Import Wine commits: - 39ec97ea9dcba270bbea31a7eaa7b842bf1beb1f, Implement WNetAddConnectionA(), WNetAddConnection2A(), WNetAddConnection3A(). - 092c60e98cec9956127145f7c8a5db88082ce7d2, Implement WNetAddConnectionW(), WNetAddConnection2W(), WNetAddConnection3W(). CORE-10032 ROSAPPS-303 svn path=/trunk/; revision=70619
1 parent 68e9874 commit e7f66b6

File tree

1 file changed

+18
-28
lines changed

1 file changed

+18
-28
lines changed

reactos/dll/win32/mpr/wnet.c

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1477,11 +1477,12 @@ DWORD WINAPI WNetGetResourceParentW( LPNETRESOURCEW lpNetResource,
14771477
DWORD WINAPI WNetAddConnectionA( LPCSTR lpRemoteName, LPCSTR lpPassword,
14781478
LPCSTR lpLocalName )
14791479
{
1480-
FIXME( "(%s, %p, %s): stub\n",
1481-
debugstr_a(lpRemoteName), lpPassword, debugstr_a(lpLocalName) );
1480+
NETRESOURCEA resourcesA;
14821481

1483-
SetLastError(WN_NO_NETWORK);
1484-
return WN_NO_NETWORK;
1482+
memset(&resourcesA, 0, sizeof(resourcesA));
1483+
resourcesA.lpRemoteName = (LPSTR)lpRemoteName;
1484+
resourcesA.lpLocalName = (LPSTR)lpLocalName;
1485+
return WNetUseConnectionA(NULL, &resourcesA, lpPassword, NULL, 0, NULL, 0, NULL);
14851486
}
14861487

14871488
/*********************************************************************
@@ -1490,11 +1491,12 @@ DWORD WINAPI WNetAddConnectionA( LPCSTR lpRemoteName, LPCSTR lpPassword,
14901491
DWORD WINAPI WNetAddConnectionW( LPCWSTR lpRemoteName, LPCWSTR lpPassword,
14911492
LPCWSTR lpLocalName )
14921493
{
1493-
FIXME( "(%s, %p, %s): stub\n",
1494-
debugstr_w(lpRemoteName), lpPassword, debugstr_w(lpLocalName) );
1494+
NETRESOURCEW resourcesW;
14951495

1496-
SetLastError(WN_NO_NETWORK);
1497-
return WN_NO_NETWORK;
1496+
memset(&resourcesW, 0, sizeof(resourcesW));
1497+
resourcesW.lpRemoteName = (LPWSTR)lpRemoteName;
1498+
resourcesW.lpLocalName = (LPWSTR)lpLocalName;
1499+
return WNetUseConnectionW(NULL, &resourcesW, lpPassword, NULL, 0, NULL, 0, NULL);
14981500
}
14991501

15001502
/*********************************************************************
@@ -1504,11 +1506,8 @@ DWORD WINAPI WNetAddConnection2A( LPNETRESOURCEA lpNetResource,
15041506
LPCSTR lpPassword, LPCSTR lpUserID,
15051507
DWORD dwFlags )
15061508
{
1507-
FIXME( "(%p, %p, %s, 0x%08X): stub\n",
1508-
lpNetResource, lpPassword, debugstr_a(lpUserID), dwFlags );
1509-
1510-
SetLastError(WN_NO_NETWORK);
1511-
return WN_NO_NETWORK;
1509+
return WNetUseConnectionA(NULL, lpNetResource, lpPassword, lpUserID, dwFlags,
1510+
NULL, 0, NULL);
15121511
}
15131512

15141513
/*********************************************************************
@@ -1518,11 +1517,8 @@ DWORD WINAPI WNetAddConnection2W( LPNETRESOURCEW lpNetResource,
15181517
LPCWSTR lpPassword, LPCWSTR lpUserID,
15191518
DWORD dwFlags )
15201519
{
1521-
FIXME( "(%p, %p, %s, 0x%08X): stub\n",
1522-
lpNetResource, lpPassword, debugstr_w(lpUserID), dwFlags );
1523-
1524-
SetLastError(WN_NO_NETWORK);
1525-
return WN_NO_NETWORK;
1520+
return WNetUseConnectionW(NULL, lpNetResource, lpPassword, lpUserID, dwFlags,
1521+
NULL, 0, NULL);
15261522
}
15271523

15281524
/*********************************************************************
@@ -1532,11 +1528,8 @@ DWORD WINAPI WNetAddConnection3A( HWND hwndOwner, LPNETRESOURCEA lpNetResource,
15321528
LPCSTR lpPassword, LPCSTR lpUserID,
15331529
DWORD dwFlags )
15341530
{
1535-
FIXME( "(%p, %p, %p, %s, 0x%08X), stub\n",
1536-
hwndOwner, lpNetResource, lpPassword, debugstr_a(lpUserID), dwFlags );
1537-
1538-
SetLastError(WN_NO_NETWORK);
1539-
return WN_NO_NETWORK;
1531+
return WNetUseConnectionA(hwndOwner, lpNetResource, lpPassword, lpUserID,
1532+
dwFlags, NULL, 0, NULL);
15401533
}
15411534

15421535
/*********************************************************************
@@ -1546,11 +1539,8 @@ DWORD WINAPI WNetAddConnection3W( HWND hwndOwner, LPNETRESOURCEW lpNetResource,
15461539
LPCWSTR lpPassword, LPCWSTR lpUserID,
15471540
DWORD dwFlags )
15481541
{
1549-
FIXME( "(%p, %p, %p, %s, 0x%08X), stub\n",
1550-
hwndOwner, lpNetResource, lpPassword, debugstr_w(lpUserID), dwFlags );
1551-
1552-
SetLastError(WN_NO_NETWORK);
1553-
return WN_NO_NETWORK;
1542+
return WNetUseConnectionW(hwndOwner, lpNetResource, lpPassword, lpUserID,
1543+
dwFlags, NULL, 0, NULL);
15541544
}
15551545

15561546
/*****************************************************************

0 commit comments

Comments
 (0)