There is a "version suffix" that defaults to "-dev". A maintainer could
change the suffix (or remove it) by invoking make:
make BUILD_SUFFIX=-foo
make BUILD_SUFFIX=
It can also be changed in gyp builds:
gyp winpty.gyp --depth=1 -D BUILD_SUFFIX=-foo
gyp winpty.gyp --depth=1 -D BUILD_SUFFIX=
If git cannot be executed, the string "none" is used for the commit hash.
* This change reduces the total build time from about 14 seconds to about
9 seconds on my computer.
Also:
* Consolidate all the intermediate files into the build directory to
reduces clutter.
* Allow specifying UNIX_ADAPTER_EXE to make. Perhaps this will be helpful
to the MSYS2 fork, which renames console.exe to winpty.exe. (I like
the renaming, but I don't know about the other winpty users. Maybe
I'll make the change after I've put out another stable release...)
* Rename the WINPTY define to COMPILING_WINPTY_DLL define. The longer
name is clearer. I define the macro inside libwinpty/winpty.cc, so the
build system no longer needs to. (I removed the define from
winpty.gyp.)
* Consolidate config-unix.mk and config-mingw.mk into config.mk. The
separation was previously necessary because each file had a conflicting
definition of CXX.
* Rename the UNIX_LDFLAGS_STATIC_LIBSTDCXX macro to UNIX_LDFLAGS_STATIC,
because libstdc++ isn't the only thing I'm linking statically.
I think it might be possible for m_dirtyLineCount to be greater than the
windowRect.top() + windowRect.height(). If it is, then scanForDirtyLines
will perform an invalid read while trying to initialize prevLineAttr.
Also add agent/EventLoop.h. I don't know why it wasn't listed.
With these changes, gyp no longer complains about missing files.
Unfortunately I can't do more testing at the moment.
This commit might fix issue https://github.com/rprichard/winpty/issues/55.
Prior to Windows 7, the undocumented NtQuerySystemInformation API did
not return valid handle information when called by a WOW64 process. To
work around this problem, the 32-bit test program connects to a 64-bit
worker and uses the existing RPC mechanism, issuing LookupKernelObject
commands, which call NtQuerySystemInformation in a native 64-bit
environment.
Even on Windows 7, the NtQuerySystemInformation API returns truncated
kernel object pointers, so, AFAIK, we still need to do this work. Maybe
not, though, if the lower 32 bits are guaranteed to be unique.
On Windows 10, there is a CompareObjectHandles API that works in WOW64
mode.
It seems that this bug was fixed in WOW64 prior to its fixing in the
normal environment.
It makes no sense to run Test_CreateProcess_Duplicate_PseudoHandleBug_IL
on OS's that don't have inherit lists.
I don't *think* this changes the semantics at all.
Also, move the INVALID_HANDLE_VALUE thing into a note at the bottom.
Improve intra-document bug linking.
* The NULL-to-new-handle conversion only happens when creating a new
console, not when attaching to the parent's console.
* Also, Windows reports that the handle value 0x7 is value, presumably
because it ignores the lowest 2 bits. It's better to just remove those
values from this test.
There's just one test, and it iterates over these combinations:
- CreationConsoleMode=NewConsole and CreationConsoleMode=Inherit
- bInheritHandles=FALSE and bInheritHandles=TRUE
It takes several seconds to run, but that's OK.
* CompareObjectHandles is a documented API, and presumably it could be
faster. The tests actually do run a little faster now on Win10,
dropping from 6.5sec to 3.6sec or so.
* Also make the NtQuerySystemInformation buffer static so we don't have to
repeat the double-buffer-in-a-loop process on every ntHandlePointer
call.
* The read end of a pipe is translated to NULL by the special
bInheritHandles=FALSE, no-STARTF_USESTDHANDLES inheritance mode. The
write end of the pipe works fine.
* Passing bInheritHandles=TRUE with an inheritable pipe handle fixes it.
Adding STARTF_USESTDHANDLES to this also works.
* To version detect 8.1, we need GetVersionEx to return something greater
than Windows 8, which requires creating an app manifest. For now at
least, put the manifest XML next to the EXE. It can be built into the
EXE, but this is good enough (at least for now).
* Add Test_CreateProcess_SpecialInherit
* Add traditional Test_HandleDuplication
* Make handle.dup() use a GetCurrentProcess() target while
handle.dup(handle.worker()) uses a non-pseudo handle.