2 ===================================================================
3 --- mpr.spec (revision 49877)
4 +++ mpr.spec (working copy)
45 22 stdcall @(long) MPR_Alloc
46 23 stdcall @(ptr long) MPR_ReAlloc
47 24 stdcall @(ptr) MPR_Free
49 ===================================================================
50 --- wnet.c (revision 71983)
51 +++ wnet.c (working copy)
53 PF_NPAddConnection addConnection;
54 PF_NPAddConnection3 addConnection3;
55 PF_NPCancelConnection cancelConnection;
57 + PF_NPGetConnection getConnection;
59 } WNetProvider, *PWNetProvider;
61 typedef struct _WNetProviderTable
63 provider->addConnection = MPR_GETPROC(NPAddConnection);
64 provider->addConnection3 = MPR_GETPROC(NPAddConnection3);
65 provider->cancelConnection = MPR_GETPROC(NPCancelConnection);
67 + provider->getConnection = MPR_GETPROC(NPGetConnection);
69 TRACE("NPAddConnection %p\n", provider->addConnection);
70 TRACE("NPAddConnection3 %p\n", provider->addConnection3);
71 TRACE("NPCancelConnection %p\n", provider->cancelConnection);
72 @@ -1870,6 +1866,43 @@
77 + if (ret == WN_SUCCESS && ctxt->flags & CONNECT_UPDATE_PROFILE)
81 + if (netres.dwType == RESOURCETYPE_PRINT)
83 + FIXME("Persistent connection are not supported for printers\n");
87 + if (RegOpenCurrentUser(KEY_ALL_ACCESS, &user_profile) == ERROR_SUCCESS)
90 + WCHAR subkey[10] = {'N', 'e', 't', 'w', 'o', 'r', 'k', '\\', netres.lpLocalName[0], 0};
92 + if (RegCreateKeyExW(user_profile, subkey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &network, NULL) == ERROR_SUCCESS)
94 + DWORD dword_arg = RESOURCETYPE_DISK;
95 + DWORD len = (strlenW(provider->name) + 1) * sizeof(WCHAR);
97 + RegSetValueExW(network, L"ConnectionType", 0, REG_DWORD, (const BYTE *)&dword_arg, sizeof(DWORD));
98 + RegSetValueExW(network, L"ProviderName", 0, REG_SZ, (const BYTE *)provider->name, len);
99 + dword_arg = provider->dwNetType;
100 + RegSetValueExW(network, L"ProviderType", 0, REG_DWORD, (const BYTE *)&dword_arg, sizeof(DWORD));
101 + len = (strlenW(netres.lpRemoteName) + 1) * sizeof(WCHAR);
102 + RegSetValueExW(network, L"RemotePath", 0, REG_SZ, (const BYTE *)netres.lpRemoteName, len);
104 + RegSetValueExW(network, L"UserName", 0, REG_SZ, (const BYTE *)netres.lpRemoteName, len);
105 + RegCloseKey(network);
108 + RegCloseKey(user_profile);
116 @@ -2188,6 +2221,7 @@
117 /* find the network connection for a given drive; helper for WNetGetConnection */
118 static DWORD get_drive_connection( WCHAR letter, LPWSTR remote, LPDWORD size )
122 struct mountmgr_unix_drive *data = (struct mountmgr_unix_drive *)buffer;
124 @@ -2230,6 +2264,32 @@
129 + DWORD ret = WN_NO_NETWORK;
131 + WCHAR local[3] = {letter, ':', 0};
133 + if (providerTable != NULL)
135 + for (index = 0; index < providerTable->numProviders; index++)
137 + if(providerTable->table[index].getCaps(WNNC_CONNECTION) &
138 + WNNC_CON_GETCONNECTIONS)
140 + if (providerTable->table[index].getConnection)
141 + ret = providerTable->table[index].getConnection(
142 + local, remote, size);
144 + ret = WN_NO_NETWORK;
145 + if (ret == WN_SUCCESS || ret == WN_MORE_DATA)
156 /**************************************************************************