bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Emacs-diffs] master 085c7f6 2/2: Test format-time-string with zone


From: Billy O'Neal (VC LIBS)
Subject: RE: [Emacs-diffs] master 085c7f6 2/2: Test format-time-string with zone arg
Date: Wed, 3 May 2017 21:12:33 +0000

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
Sent: Wednesday, May 3, 2017 12:36 PM
To: Bruno Haible; Eli Zaretskii; Paul Eggert
Cc: address@hidden; address@hidden; address@hidden; Billy O'Neal (VC LIBS)
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\'        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="">
>
> 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.

 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]