Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/win/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,11 @@ static int fs__readlink_handle(HANDLE handle,
}

assert(target_ptr == NULL || *target_ptr == NULL);
return uv_utf16_to_wtf8(w_target, w_target_len, target_ptr, target_len_ptr);
if (uv_utf16_to_wtf8(w_target, w_target_len, target_ptr, target_len_ptr) != 0) {
SetLastError(ERROR_OUTOFMEMORY);
return -1;
}
return 0;
}


Expand Down Expand Up @@ -709,7 +713,7 @@ LONG fs__filemap_ex_filter(LONG excode, PEXCEPTION_POINTERS pep,
assert(perror != NULL);
if (pep != NULL && pep->ExceptionRecord != NULL &&
pep->ExceptionRecord->NumberParameters >= 3) {
NTSTATUS status = (NTSTATUS)pep->ExceptionRecord->ExceptionInformation[3];
NTSTATUS status = (NTSTATUS)pep->ExceptionRecord->ExceptionInformation[2];
*perror = pRtlNtStatusToDosError(status);
if (*perror != ERROR_SUCCESS) {
return EXCEPTION_EXECUTE_HANDLER;
Expand Down Expand Up @@ -3038,7 +3042,11 @@ static ssize_t fs__realpath_handle(HANDLE handle, char** realpath_ptr) {
assert(*realpath_ptr == NULL);
r = uv_utf16_to_wtf8(w_realpath_ptr, w_realpath_len, realpath_ptr, NULL);
uv__free(w_realpath_buf);
return r;
if (r != 0) {
SetLastError(ERROR_OUTOFMEMORY);
return -1;
}
return 0;
}

static void fs__realpath(uv_fs_t* req) {
Expand Down
8 changes: 4 additions & 4 deletions src/win/pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,10 +398,10 @@ int uv_pipe(uv_file fds[2], int read_flags, int write_flags) {
0,
(uintptr_t) &fds[0]);
if (err != 0)
return err;
return uv_translate_sys_error(err);
temp[0] = _open_osfhandle((intptr_t) readh, 0);
if (temp[0] == -1) {
if (errno == UV_EMFILE)
if (errno == EMFILE)
err = UV_EMFILE;
else
err = UV_UNKNOWN;
Expand All @@ -411,7 +411,7 @@ int uv_pipe(uv_file fds[2], int read_flags, int write_flags) {
}
temp[1] = _open_osfhandle((intptr_t) writeh, 0);
if (temp[1] == -1) {
if (errno == UV_EMFILE)
if (errno == EMFILE)
err = UV_EMFILE;
else
err = UV_UNKNOWN;
Expand Down Expand Up @@ -2266,7 +2266,7 @@ void uv__process_pipe_write_req(uv_loop_t* loop, uv_pipe_t* handle,
uv__free(coalesced_write);
}
if (req->cb) {
req->cb(req, uv_translate_sys_error(err));
req->cb(req, uv_translate_write_sys_error(err));
}

handle->stream.conn.write_reqs_pending--;
Expand Down
1 change: 1 addition & 0 deletions src/win/tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -1262,6 +1262,7 @@ static int uv__tty_move_caret(uv_tty_t* handle, int x, unsigned char x_relative,
retry:
if (!GetConsoleScreenBufferInfo(handle->handle, &info)) {
*error = GetLastError();
return -1;
}

pos = uv__tty_make_real_coord(handle, &info, x, x_relative, y, y_relative);
Expand Down