Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
76037ffb
Commit
76037ffb
authored
Aug 20, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase: Support PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
36663d9a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
1 deletion
+66
-1
console.c
dlls/kernel32/tests/console.c
+37
-1
process.c
dlls/kernel32/tests/process.c
+12
-0
process.c
dlls/kernelbase/process.c
+17
-0
No files found.
dlls/kernel32/tests/console.c
View file @
76037ffb
...
...
@@ -3957,9 +3957,14 @@ static DWORD WINAPI read_pipe_proc( void *handle )
static
void
test_pseudo_console
(
void
)
{
STARTUPINFOEXA
startup
=
{{
sizeof
(
startup
)
}};
HANDLE
console_pipe
,
console_pipe2
,
thread
;
char
**
argv
,
cmdline
[
MAX_PATH
];
PROCESS_INFORMATION
info
;
HPCON
pseudo_console
;
SIZE_T
attr_size
;
COORD
size
;
BOOL
ret
;
HRESULT
hres
;
if
(
!
pCreatePseudoConsole
)
...
...
@@ -3995,6 +4000,22 @@ static void test_pseudo_console(void)
ok
(
hres
==
S_OK
,
"CreatePseudoConsole failed: %08x
\n
"
,
hres
);
CloseHandle
(
console_pipe2
);
InitializeProcThreadAttributeList
(
NULL
,
1
,
0
,
&
attr_size
);
startup
.
lpAttributeList
=
HeapAlloc
(
GetProcessHeap
(),
0
,
attr_size
);
InitializeProcThreadAttributeList
(
startup
.
lpAttributeList
,
1
,
0
,
&
attr_size
);
UpdateProcThreadAttribute
(
startup
.
lpAttributeList
,
0
,
PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE
,
pseudo_console
,
sizeof
(
pseudo_console
),
NULL
,
NULL
);
winetest_get_mainargs
(
&
argv
);
sprintf
(
cmdline
,
"
\"
%s
\"
%s --pseudo-console"
,
argv
[
0
],
argv
[
1
]);
ret
=
CreateProcessA
(
NULL
,
cmdline
,
NULL
,
NULL
,
FALSE
,
EXTENDED_STARTUPINFO_PRESENT
,
NULL
,
NULL
,
&
startup
.
StartupInfo
,
&
info
);
ok
(
ret
,
"CreateProcessW failed: %u
\n
"
,
GetLastError
());
CloseHandle
(
info
.
hThread
);
HeapFree
(
GetProcessHeap
(),
0
,
startup
.
lpAttributeList
);
wait_child_process
(
info
.
hProcess
);
CloseHandle
(
info
.
hProcess
);
pClosePseudoConsole
(
pseudo_console
);
}
...
...
@@ -4003,6 +4024,7 @@ START_TEST(console)
HANDLE
hConIn
,
hConOut
;
BOOL
ret
,
test_current
;
CONSOLE_SCREEN_BUFFER_INFO
sbi
;
BOOL
using_pseudo_console
;
DWORD
size
;
char
**
argv
;
int
argc
;
...
...
@@ -4026,8 +4048,9 @@ START_TEST(console)
}
test_current
=
argc
>=
3
&&
!
strcmp
(
argv
[
2
],
"--current"
);
using_pseudo_console
=
argc
>=
3
&&
!
strcmp
(
argv
[
2
],
"--pseudo-console"
);
if
(
!
test_current
)
if
(
!
test_current
&&
!
using_pseudo_console
)
{
static
const
char
font_name
[]
=
"Lucida Console"
;
HKEY
console_key
;
...
...
@@ -4093,6 +4116,19 @@ START_TEST(console)
ok
(
hConIn
!=
INVALID_HANDLE_VALUE
,
"Opening ConIn
\n
"
);
ok
(
hConOut
!=
INVALID_HANDLE_VALUE
,
"Opening ConOut
\n
"
);
if
(
using_pseudo_console
)
{
DWORD
mode
;
ret
=
GetConsoleMode
(
hConIn
,
&
mode
);
ok
(
ret
,
"GetConsoleMode failed: %u
\n
"
,
GetLastError
());
todo_wine
ok
(
mode
==
(
ENABLE_PROCESSED_INPUT
|
ENABLE_LINE_INPUT
|
ENABLE_ECHO_INPUT
|
ENABLE_MOUSE_INPUT
|
ENABLE_INSERT_MODE
|
ENABLE_QUICK_EDIT_MODE
|
ENABLE_EXTENDED_FLAGS
|
ENABLE_AUTO_POSITION
),
"mode = %x
\n
"
,
mode
);
return
;
}
ret
=
GetConsoleScreenBufferInfo
(
hConOut
,
&
sbi
);
ok
(
ret
,
"Getting sb info
\n
"
);
if
(
!
ret
)
return
;
...
...
dlls/kernel32/tests/process.c
View file @
76037ffb
...
...
@@ -3887,6 +3887,18 @@ static void test_ProcThreadAttributeList(void)
expect_list
.
count
++
;
}
ret
=
pUpdateProcThreadAttribute
(
&
list
,
0
,
PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE
,
handles
,
sizeof
(
PROCESSOR_NUMBER
),
NULL
,
NULL
);
ok
(
ret
||
broken
(
GetLastError
()
==
ERROR_NOT_SUPPORTED
),
"got %d gle %d
\n
"
,
ret
,
GetLastError
());
if
(
ret
)
{
unsigned
int
i
=
expect_list
.
count
++
;
expect_list
.
mask
|=
1
<<
ProcThreadAttributePseudoConsole
;
expect_list
.
attrs
[
i
].
attr
=
PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE
;
expect_list
.
attrs
[
i
].
size
=
sizeof
(
HPCON
);
expect_list
.
attrs
[
i
].
value
=
handles
;
}
ok
(
!
memcmp
(
&
list
,
&
expect_list
,
size
),
"mismatch
\n
"
);
pDeleteProcThreadAttributeList
(
&
list
);
...
...
dlls/kernelbase/process.c
View file @
76037ffb
...
...
@@ -28,6 +28,7 @@
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "wincontypes.h"
#include "winternl.h"
#include "kernelbase.h"
...
...
@@ -568,6 +569,14 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR
handle_list
=
&
attrs
->
attrs
[
i
];
TRACE
(
"PROC_THREAD_ATTRIBUTE_HANDLE_LIST handle count %Iu.
\n
"
,
attrs
->
attrs
[
i
].
size
/
sizeof
(
HANDLE
));
break
;
case
PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE
:
{
struct
pseudo_console
*
console
=
attrs
->
attrs
[
i
].
value
;
TRACE
(
"PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE %p reference %p
\n
"
,
console
,
console
->
reference
);
params
->
ConsoleHandle
=
console
->
reference
;
break
;
}
default:
FIXME
(
"Unsupported attribute %#Ix.
\n
"
,
attrs
->
attrs
[
i
].
attr
);
break
;
...
...
@@ -1730,6 +1739,14 @@ BOOL WINAPI DECLSPEC_HOTPATCH UpdateProcThreadAttribute( struct _PROC_THREAD_ATT
}
break
;
case
PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE
:
if
(
size
!=
sizeof
(
HPCON
))
{
SetLastError
(
ERROR_BAD_LENGTH
);
return
FALSE
;
}
break
;
default:
SetLastError
(
ERROR_NOT_SUPPORTED
);
FIXME
(
"Unhandled attribute %lu
\n
"
,
attr
&
PROC_THREAD_ATTRIBUTE_NUMBER
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment