[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/w32.c,v
From: |
Jason Rumney |
Subject: |
[Emacs-diffs] Changes to emacs/src/w32.c,v |
Date: |
Sat, 26 Jan 2008 01:07:50 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Jason Rumney <jasonr> 08/01/26 01:07:49
Index: w32.c
===================================================================
RCS file: /sources/emacs/emacs/src/w32.c,v
retrieving revision 1.121
retrieving revision 1.122
diff -u -b -r1.121 -r1.122
--- w32.c 8 Jan 2008 20:44:14 -0000 1.121
+++ w32.c 26 Jan 2008 01:07:49 -0000 1.122
@@ -1938,6 +1938,36 @@
return attrs;
}
+/* Ensure a network connection is authenticated. */
+static void
+logon_network_drive (const char *path)
+{
+ NETRESOURCE resource;
+ char share[MAX_PATH];
+ int i, n_slashes;
+
+ /* Only logon to networked drives. */
+ if (!IS_DIRECTORY_SEP (path[0]) || !IS_DIRECTORY_SEP (path[1]))
+ return;
+ n_slashes = 2;
+ strncpy (share, path, MAX_PATH);
+ /* Truncate to just server and share name. */
+ for (i = 2; i < MAX_PATH; i++)
+ {
+ if (IS_DIRECTORY_SEP (share[i]) && ++n_slashes > 3)
+ {
+ share[i] = '\0';
+ break;
+ }
+ }
+
+ resource.dwType = RESOURCETYPE_DISK;
+ resource.lpLocalName = NULL;
+ resource.lpRemoteName = share;
+ resource.lpProvider = NULL;
+
+ WNetAddConnection2 (&resource, NULL, NULL, CONNECT_INTERACTIVE);
+}
/* Shadow some MSVC runtime functions to map requests for long filenames
to reasonable short names if necessary. This was originally added to
@@ -2495,6 +2525,9 @@
}
else
{
+ if (IS_DIRECTORY_SEP (name[0]) && IS_DIRECTORY_SEP (name[1]))
+ logon_network_drive (name);
+
fh = FindFirstFile (name, &wfd);
if (fh == INVALID_HANDLE_VALUE)
{
- [Emacs-diffs] Changes to emacs/src/w32.c,v, Dan Nicolaescu, 2008/01/05
- [Emacs-diffs] Changes to emacs/src/w32.c,v, Miles Bader, 2008/01/08
- [Emacs-diffs] Changes to emacs/src/w32.c,v,
Jason Rumney <=
- [Emacs-diffs] Changes to emacs/src/w32.c,v, Eli Zaretskii, 2008/01/26
- [Emacs-diffs] Changes to emacs/src/w32.c,v, Eli Zaretskii, 2008/01/26
- [Emacs-diffs] Changes to emacs/src/w32.c,v, Eli Zaretskii, 2008/01/26
- [Emacs-diffs] Changes to emacs/src/w32.c,v, Eli Zaretskii, 2008/01/26
- [Emacs-diffs] Changes to emacs/src/w32.c,v, Jason Rumney, 2008/01/28