X-Git-Url: https://git.josue.xyz/?p=VSoRC%2F.git;a=blobdiff_plain;f=node_modules%2Fnode-pty%2Fdeps%2Fwinpty%2Fmisc%2FWin32Test2.cc;fp=node_modules%2Fnode-pty%2Fdeps%2Fwinpty%2Fmisc%2FWin32Test2.cc;h=0000000000000000000000000000000000000000;hp=2777bad456203559c619c4ef7dd9a3c538c288a7;hb=5e96dd57ddd883604e87f62bdddcb111c63a6e1a;hpb=acb5f682a2b75b972710cabd81658f63071324b0 diff --git a/node_modules/node-pty/deps/winpty/misc/Win32Test2.cc b/node_modules/node-pty/deps/winpty/misc/Win32Test2.cc deleted file mode 100644 index 2777bad..0000000 --- a/node_modules/node-pty/deps/winpty/misc/Win32Test2.cc +++ /dev/null @@ -1,70 +0,0 @@ -/* - * This test demonstrates that putting a console into selection mode does not - * block the low-level console APIs, even though it blocks WriteFile. - */ - -#define _WIN32_WINNT 0x0501 -#include "../src/shared/DebugClient.cc" -#include -#include - -const int SC_CONSOLE_MARK = 0xFFF2; - -CALLBACK DWORD writerThread(void*) -{ - CHAR_INFO xChar, fillChar; - memset(&xChar, 0, sizeof(xChar)); - xChar.Char.AsciiChar = 'X'; - xChar.Attributes = 7; - memset(&fillChar, 0, sizeof(fillChar)); - fillChar.Char.AsciiChar = ' '; - fillChar.Attributes = 7; - COORD oneCoord = { 1, 1 }; - COORD zeroCoord = { 0, 0 }; - - while (true) { - SMALL_RECT writeRegion = { 5, 5, 5, 5 }; - WriteConsoleOutput(GetStdHandle(STD_OUTPUT_HANDLE), - &xChar, oneCoord, - zeroCoord, - &writeRegion); - Sleep(500); - SMALL_RECT scrollRect = { 1, 1, 20, 20 }; - COORD destCoord = { 0, 0 }; - ScrollConsoleScreenBuffer(GetStdHandle(STD_OUTPUT_HANDLE), - &scrollRect, - NULL, - destCoord, - &fillChar); - } -} - -int main() -{ - CreateThread(NULL, 0, writerThread, NULL, 0, NULL); - trace("marking console"); - HWND hwnd = GetConsoleWindow(); - PostMessage(hwnd, WM_SYSCOMMAND, SC_CONSOLE_MARK, 0); - - Sleep(2000); - - trace("reading output"); - CHAR_INFO buf[1]; - COORD bufSize = { 1, 1 }; - COORD zeroCoord = { 0, 0 }; - SMALL_RECT readRect = { 0, 0, 0, 0 }; - ReadConsoleOutput(GetStdHandle(STD_OUTPUT_HANDLE), - buf, - bufSize, - zeroCoord, - &readRect); - trace("done reading output"); - - Sleep(2000); - - PostMessage(hwnd, WM_CHAR, 27, 0x00010001); - - Sleep(1100); - - return 0; -}