This reverts commit fd8d212a80,
and thereby restores partial support for using libuv under Wine
(which does not implement GetQueuedCompletionStatusEx).
PR-URL: https://github.com/libuv/libuv/pull/1963
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Bert Belder <bertbelder@gmail.com>
They were only there to aid Windows XP support, which libuv no longer
does.
PR-URL: https://github.com/libuv/libuv/pull/1858
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
All Windows versions that libuv supports have GetQueuedCompletionStatusEx,
so this fallback option is no longer needed.
PR-URL: https://github.com/libuv/libuv/pull/1858
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
The fallback implementation existed to support Windows XP and Server 2003,
but these old versions of windows are no longer supporter by libuv.
PR-URL: https://github.com/libuv/libuv/pull/1852
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Libuv is not supported on Windows XP, as stated in the
SUPPORTED_PLATFORMS document. It also can't possibly work because
`ReOpenFile()` in src/win/fs.c is not weakly linked, so any executable
that links libuv would simply fail to load on XP.
This reverts commit 17eaa956bd.
Refs: https://github.com/libuv/libuv/pull/1810
PR-URL: https://github.com/libuv/libuv/pull/1854
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* Don't silently ignore ERROR_OPERATION_ABORTED.
Code to silently ignore this error was added in c42a4ca, under the
false premise that this error is somehow equivalent to EINTR on posix
platforms. This isn't true; ERROR_OPERATION_ABORTED doesn't happen
unless the application explicitly aborts an I/O operation.
Silently ignoring this error elsewhere could potentially hide bugs,
hence libuv shouldn't do it. Instead, explicitly deal with it where
it is expected.
* Don't mark aborted reads as successful.
The worker thread used to call ReadFile() on synchronous pipes would
incorrectly mark cancelled read requests as successful, leading to
issues later on.
* Rely on main thread to restart aborted reads.
After a blocking ReadFile() call was cancelled, the worker thread
would previously attempt to restart it immediately, making
synchronization logic needlessly complex. Instead, we simply cancel
the operation, and leave it to the main loop to restart it if so
desired.
Since we now realy on the main thread to restart interrupted
ReadFile() calls, we can now have a single function interrupts a
synchronous read until the event loop restarts it again.
* Clean up uv__pipe_read_stop().
A single function to interrupt blocking reads also allows us to
remove weird logic in uv__pipe_read_stop() that quickly pauses and
unpauses a read operation in the hope of cancelling it.
* Assume CancelIo() and CancelSynchronousIo() are always available.
Since libuv doesn't support windows XP and Server 2003 any more, we
can assume that these APIs are always available, and do away with
branching around them.
PR-URL: https://github.com/libuv/libuv/pull/1843
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Back in the day I wrote comments in a really unusual way. Nowadays it
makes my eyes bleed, and clang-format doesn't know how to deal with it.
PR-URL: https://github.com/libuv/libuv/pull/1853
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
This commit attempts to dynamically load
ConvertInterfaceIndexToLuid() and ConvertInterfaceLuidToNameW()
from iphlpapi.dll before using them. If they are not available,
UV_ENOSYS is returned.
PR-URL: https://github.com/libuv/libuv/pull/1810
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
SetWinEventHook is not available on some Windows versions.
Fixes: https://github.com/nodejs/node/issues/16603
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Add SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE to CreateSymbolicLink
which allows unelevated users to create symbolic links on supported
platforms.
Fixes: https://github.com/libuv/libuv/issues/1157
PR-URL: https://github.com/libuv/libuv/pull/1466
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Remove use of the DUMMYUNIONNAME macro from our definitions of
internal winapi anonymous unions. This macro was added to
winternl.h in Windows SDK v7.0a in combination with a conditional
definition of DUMMYUNIONNAME to either empty or `u` depending on
compiler support. libuv doesn't support any compilers that lack
anonymous unions, but does support compilers such as VS 2008 that
complain about the presence of the DUMMYUNIONNAME identifier on an
anonymous union because their winapi headers do not define the
macro publicly.
PR-URL: https://github.com/libuv/libuv/pull/1090
Reviewed-By: João Reis <reis@janeasystems.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
When Windows resumes after sleep GetQueuedCompletionStatus timeout is
not updated. This commit adds a method for signaling all loops to
wake up and update their timers.
Fixes: https://github.com/nodejs/node/issues/6763
PR-URL: https://github.com/libuv/libuv/pull/962
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Equivalent to realpath(3), returns the full resolved absolute path of a
file or directory.
PR-URL: https://github.com/libuv/libuv/pull/531
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
They're no longer needed, since the Windows-native SRWLock functions are
no longer used.
PR-URL: https://github.com/libuv/libuv/pull/525
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
This implements locking around the blocking call to ReadFile to get
around a Windows kernel bug where a blocking ReadFile operation on a
stream can deadlock the thread. This allows uv_read_stop to immediately
cancel a pending IO operation, and allows uv_pipe_getsockname to
"pause" any pending read (from libuv) while it retrieves the
sockname information.
If unsupported by the OS (pre-Vista), this reverts to the old
(e.g. deadlock-prone) behavior
Closes#1313
On older mingw installations, DEVICE_TYPE isn't defined. This was
redefined in windows.h, but it was done after it was already attempted
to be used. This moves the #define for DEVICE_TYPE above the usage of
it in windows.h to prevent compilation failures.
This commit adds bootstrap code, function signatures, struct definitions
etc. to make it possible for libuv to use NtQueryVolumeInformationFile.
Most of this comes from the NT DDK, which libuv mirrors so that people
don't need the DDK to compile it.
mingw32 doesn't have the JOB_OBJECT_XXX defines. Provide them ourselves
when they are not already defined.
This is possibly only an issue with older versions of mingw32 because
mingw-w64 2.0 _does_ export the defines.
__MINGW64__ is only defined when using mingw-w64 in 64bits mode, not when
using the 32bits version of the compiler.
Instead, to detect usage of mingw-w64 instead of mingw version of GCC we
should look at __MINGW64_VERSION_MAJOR and __MINGW64_VERSION_MINOR. If one
of these is defined means we are running on mingw-w64 compiler and headers
and not mingw.org build.
Read more here: http://bit.ly/detect-mingw-w64-vs-mingwCloses#384
Read/write locks are emulated with critical sections on Windows XP and Vista
because those platforms don't have a (complete) native read/write lock API.