[PATCH 4/6]: msvcp110: Add tr2_sys__Stat implementation and test.

Piotr Caban piotr.caban at gmail.com
Mon Jun 29 04:55:00 CDT 2015


On 06/27/15 19:50, YongHaoHu wrote:
> +static file_type stat_set_error(int *err_code)
> +{
> +    file_type ret;
> +    *err_code = ERROR_SUCCESS;
> +
> +    switch(GetLastError()) {
> +        case ERROR_FILE_NOT_FOUND:
> +        case ERROR_BAD_NETPATH:
> +        case ERROR_INVALID_NAME:
> +        case ERROR_BAD_PATHNAME:
> +        case ERROR_PATH_NOT_FOUND:
> +            ret = file_not_found;
> +            break;
> +        case ERROR_BAD_DEV_TYPE:
> +            ret = regular_file;
> +            break;
> +        default:
> +            ret = status_unknown;
Shouldn't err_code be set to GetLastError in default case? You end up 
setting it to ERROR_SUCCESS in every case except if path is NULL.

Why are you handling ERROR_BAD_DEV_TYPE error here?

> +    TRACE("(%s %p)\n", debugstr_a(path), err_code);
> +    DWORD attr;
This will produce a compilation warning.

Cheers,
Piotr



More information about the wine-devel mailing list