From: rdparker AT butlermfg DOT org (Parker, Ron) Subject: RE: [rdparker AT butlermfg DOT org: RE: B20 patch: UNC device path handl ing] 5 Nov 1998 09:18:36 -0800 Message-ID: <199811051641.IAA24545.cygnus.cygwin32.developers@cygnus.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="---- =_NextPart_000_01BE08DC.2288C5AE" To: Corinna Vinschen , Christopher Faylor , "Parker, Ron" , cygwin32-developers AT cygnus DOT com This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------ =_NextPart_000_01BE08DC.2288C5AE Content-Type: text/plain My apologies, I forgot to state that my "patch" was just a hand modification of Corinna's. It was intended to give the general idea and was incorrect. Corinna's interpretation of my intentions is accurate. The remainder of this message is in response to Corinna's question. On NT, \\.\ and \\?\ are equivalent. They may be used to access devices which have symbolic links in the WIN32 subsystem portion of the NT Object Manager(OM) name space. These shortcuts include the devices listed by Corinna as well as many other devices. Additionally, these forms bypass interpretation by the WIN32 subsystem and may be used to create files with "reserved" names like AUX, NUL, etc. About the \\.\UNC\ syntax, if you examine the symbolic links mentioned above, you will see that UNC is a symbolic link to \Device\Mup. MUP is an acronym of "Multiple Universal Naming Convention Provider". This device plays a part in decoding the UNC path. In the NT WIN32 subsystem \\machine\share\file is translated to \\.\UNC\machine\share\file. This is then compared against the WIN32 part of the OM name space. "UNC" is then recognized as a symbolic link to \Device\Mup. Then "machine\share\file" is passed on to the MUP device. This device passes it on to the appropriate redirector, which interprets it as referring to a specific file on a specific share of a specific machine. Also X:\file is translated to \\.\X:\file as Corinna mentioned. When this is looked up by the OM it is found that \\.\X: is a symbolic link to \Device\LanmanRedirector\X:\server\share or something similar. The path is then modified to X:\server\share\file and is passed on to the specified redirector where it is finally resolved. I hope this helps. -----Original Message----- From: Corinna Vinschen [mailto:corinna DOT vinschen AT cityweb DOT de] Sent: Wednesday, November 04, 1998 8:02 PM To: Christopher Faylor; Parker, Ron; cygwin32-developers AT cygnus DOT com Subject: Re: [rdparker AT butlermfg DOT org: RE: B20 patch: UNC device path handling] Hello Chris, hello Ron, sorry for the fantastic line wrapping :-( Christopher Faylor wrote: > > Corinna, do you agree with this change? > > cgf > > ----- Forwarded message from "Parker, Ron" > [...] > + if (pathbuf[mount[i].pathlen] != '/' && > + strncmp (mount[i].device, "\\\\.\\", 4) == 0 && > + strchr(mount[i].device[mount[i].devicelen-1] + 4, '\\')) > [...] The above patch is incorrect, the strchr crashes: mount[i].device[foo] is last char in ...device .... + 4 is the same char + 4 (e.g. 'E' instead of 'A') --> 1st parameter to strchr is illegal ptr value. I think, the following is ment: + if (pathbuf[mount[i].pathlen] != '/' && + !(strncmp (mount[i].device, "\\\\.\\", 4) == 0 && + strchr (mount[i].device + 4, '\\') == NULL)) Checks, if the device path has an additional `\' in it. Another theme is: Do such UNC paths exist??? As I know, only the following device paths exist: \\.\X: \\.\physicaldriveX \\.\tapeX \\.\mailslot\foo\bar... \\.\pipe\pipename Ordinary UNC paths are never beginning with \\.\, but with \\foo\... with the exception of wide character syntax in WinNT. Then, paths are beginning with \\?\X:\ on standard paths with drive letter and \\?\UNC\ on UNC paths. If the above presentation is correct, my original patch is also correct. If I'm wrong, I would appreciate, if somebody could explain the meaning of \\.\UNC\ Regards, Corinna ------ =_NextPart_000_01BE08DC.2288C5AE Content-Type: application/ms-tnef Content-Transfer-Encoding: base64 eJ8+IigQAQaQCAAEAAAAAAABAAEAAQeQBgAIAAAA5AQAAAAAAADoAAEIgAcAGAAAAElQTS5NaWNy b3NvZnQgTWFpbC5Ob3RlADEIAQSAAQBGAAAAUkU6IFtyZHBhcmtlckBidXRsZXJtZmcub3JnOiBS RTogQjIwIHBhdGNoOiBVTkMgZGV2aWNlIHBhdGggaGFuZGxpbmddAKMXAQmAAQAhAAAANkI5ODdB MTZDNzc0RDIxMUI5RjEwMDEwNEI4Q0YzRDkAHwcBIIADAA4AAADOBwsABQAKADAAJQAEAEgBAQWA AwAOAAAAzgcLAAUACgAlADQABABMAQENgAQAAgAAAAIAAgABA5AGAL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