From: "Billy O'Neal (VC LIBS)" <bion@microsoft.com>
To: Davis Herring <herring@lanl.gov>, Bruno Haible <bruno@clisp.org>,
"Eli Zaretskii" <eliz@gnu.org>, Paul Eggert <eggert@cs.ucla.edu>
Cc: "bug-gnulib@gnu.org" <bug-gnulib@gnu.org>,
"kbrown@cornell.edu" <kbrown@cornell.edu>,
"emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: RE: [Emacs-diffs] master 085c7f6 2/2: Test format-time-string with zone arg
Date: Wed, 3 May 2017 21:12:33 +0000 [thread overview]
Message-ID: <MWHPR03MB2687FDDE0B3ADAE2A00FB792CB160@MWHPR03MB2687.namprd03.prod.outlook.com> (raw)
In-Reply-To: <428de2ef-f817-a04d-83cd-b5eb68e5a979@lanl.gov>
[-- Attachment #1: Type: text/plain, Size: 3988 bytes --]
I’m not an expert at all in this area. I did run a few queries against Win sources though.
I think ERROR_INVALID_DRIVE is dead. The only place I found it mentioned was in the CRT trying to translate it to ENOENT. There was a comment from 1989 there, it may have meant something in the DOS / Win9x days.
ERROR_BAD_NETPATH seems to happen when the path looks okay but DNS fails on the input:
//
// MessageId: ERROR_BAD_NETPATH
//
// MessageText:
//
// The network path was not found.
//
#define ERROR_BAD_NETPATH 53L
C:\Users\bion\Desktop>type test_error.cpp
#include <stdio.h>
#include <system_error>
#include <Windows.h>
int wmain(int argc, wchar_t *argv[]) {
if (argc != 2) {
puts("usage: test_error.exe path");
return -1;
}
HANDLE hFile = CreateFileW(
argv[1],
FILE_READ_ATTRIBUTES,
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
0,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
nullptr);
if (hFile != INVALID_HANDLE_VALUE) {
puts("didn't get expected error");
CloseHandle(hFile);
return -1;
}
DWORD lastError = GetLastError();
printf("GetLastError() == %lu == 0x%08lX: %s", lastError, lastError,
std::system_category().message(lastError).c_str());
return 0;
}
C:\Users\bion\Desktop>cl /nologo /EHsc /W4 /WX .\test_error.cpp
test_error.cpp
C:\Users\bion\Desktop>.\test_error.exe \\notaserver.example.com\foo\bar\baz
GetLastError() == 53 == 0x00000035: The network path was not found.
C:\Users\bion\Desktop>
I don’t think ERROR_DEV_NOT_EXIST can be triggered from a file path. I saw it only in places where mount points were being processed. (e.g. you tried to mount this device but that device doesn’t exist) But I’m not positive.
Hope that helps,
Billy3
From: Davis Herring<mailto:herring@lanl.gov>
Sent: Wednesday, May 3, 2017 12:36 PM
To: Bruno Haible<mailto:bruno@clisp.org>; Eli Zaretskii<mailto:eliz@gnu.org>; Paul Eggert<mailto:eggert@cs.ucla.edu>
Cc: bug-gnulib@gnu.org<mailto:bug-gnulib@gnu.org>; kbrown@cornell.edu<mailto:kbrown@cornell.edu>; emacs-devel@gnu.org<mailto:emacs-devel@gnu.org>; Billy O'Neal (VC LIBS)<mailto:bion@microsoft.com>
Subject: Re: [Emacs-diffs] master 085c7f6 2/2: Test format-time-string with zone arg
On 05/02/2017 03:55 PM, Bruno Haible wrote:
> Filename GetLastError() errno in Emacs errno in Gnulib
>
> '\\server' ERROR_BAD_PATHNAME EINVAL ENOENT
> '\\server\nonexistentshare\<file://server/nonexistentshare/>' ERROR_BAD_NET_NAME EINVAL ENOENT
> ? ERROR_INVALID_DRIVE ENOENT EINVAL
> ? ERROR_BAD_NETPATH ENOENT EINVAL
> ? ERROR_DEV_NOT_EXIST ENOENT EINVAL
> 'C:\System Volume Information\foo' ERROR_ACCESS_DENIED EACCES EACCESS or EPERM (*)
> 'C:\pagefile.sys' ERROR_SHARING_VIOLATION EACCES EACCESS or EPERM (*)
>
> (*) According to POSIX: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpubs.opengroup.org%2Fonlinepubs%2F9699919799%2Ffunctions%2Futime.html&data=02%7C01%7Cbion%40microsoft.com%7C60b0e84189a14768804d08d4925ba869%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636294369742721148&sdata=s77csbmK5uw8tn7mB6JvCYJ%2BlMQFB9FDtCrgi01z5EE%3D&reserved=0
>
> Can you tell me how to provoke a ERROR_INVALID_DRIVE, ERROR_BAD_NETPATH, or
> ERROR_DEV_NOT_EXIST error code?
Billy O'Neal (copied) at Microsoft might be able to help; he's been
doing similar error-code mapping for their filesystems (for C++17).
Davis
--
This product is sold by volume, not by mass. If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.
[-- Attachment #2: Type: text/html, Size: 14866 bytes --]
next prev parent reply other threads:[~2017-05-03 21:12 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20170427222412.28742.14016@vcs0.savannah.gnu.org>
[not found] ` <20170427222413.8FBA722040@vcs0.savannah.gnu.org>
2017-04-30 20:41 ` [Emacs-diffs] master 085c7f6 2/2: Test format-time-string with zone arg Ken Brown
2017-04-30 20:49 ` Paul Eggert
2017-04-30 21:28 ` Ken Brown
2017-05-01 15:02 ` Eli Zaretskii
2017-05-01 16:59 ` Ken Brown
2017-05-01 7:43 ` Eli Zaretskii
2017-05-01 17:49 ` Paul Eggert
2017-05-01 19:36 ` Eli Zaretskii
2017-05-01 23:05 ` Paul Eggert
2017-05-02 6:29 ` Eli Zaretskii
2017-05-02 7:52 ` Paul Eggert
2017-05-02 17:09 ` Eli Zaretskii
2017-05-02 21:55 ` Bruno Haible
2017-05-02 22:35 ` Paul Eggert
2017-05-03 15:49 ` Eli Zaretskii
2017-05-03 15:33 ` Eli Zaretskii
2017-05-03 19:33 ` Davis Herring
2017-05-03 21:12 ` Billy O'Neal (VC LIBS) [this message]
2017-05-04 14:26 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=MWHPR03MB2687FDDE0B3ADAE2A00FB792CB160@MWHPR03MB2687.namprd03.prod.outlook.com \
--to=bion@microsoft.com \
--cc=bruno@clisp.org \
--cc=bug-gnulib@gnu.org \
--cc=eggert@cs.ucla.edu \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=herring@lanl.gov \
--cc=kbrown@cornell.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).