Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
a95e0708
Commit
a95e0708
authored
Jan 05, 2010
by
Paul Vriens
Committed by
Alexandre Julliard
Jan 05, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Add a stubbed GetConsoleProcessList().
parent
289047c7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
4 deletions
+81
-4
console.c
dlls/kernel32/console.c
+16
-0
kernel32.spec
dlls/kernel32/kernel32.spec
+1
-1
console.c
dlls/kernel32/tests/console.c
+64
-3
No files found.
dlls/kernel32/console.c
View file @
a95e0708
...
@@ -2690,3 +2690,19 @@ DWORD WINAPI GetConsoleAliasW(LPWSTR lpSource, LPWSTR lpTargetBuffer,
...
@@ -2690,3 +2690,19 @@ DWORD WINAPI GetConsoleAliasW(LPWSTR lpSource, LPWSTR lpTargetBuffer,
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
return
0
;
return
0
;
}
}
/******************************************************************
* GetConsoleProcessList (KERNEL32.@)
*/
DWORD
WINAPI
GetConsoleProcessList
(
LPDWORD
processlist
,
DWORD
processcount
)
{
FIXME
(
"(%p,%d): stub
\n
"
,
processlist
,
processcount
);
if
(
!
processlist
||
processcount
<
1
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
0
;
}
return
0
;
}
dlls/kernel32/kernel32.spec
View file @
a95e0708
...
@@ -478,7 +478,7 @@
...
@@ -478,7 +478,7 @@
@ stdcall GetConsoleMode(long ptr)
@ stdcall GetConsoleMode(long ptr)
@ stub GetConsoleNlsMode
@ stub GetConsoleNlsMode
@ stdcall GetConsoleOutputCP()
@ stdcall GetConsoleOutputCP()
# @ stub GetConsoleProcessList
@ stdcall GetConsoleProcessList(ptr long)
@ stdcall GetConsoleScreenBufferInfo(long ptr)
@ stdcall GetConsoleScreenBufferInfo(long ptr)
# @ stub GetConsoleSelectionInfo
# @ stub GetConsoleSelectionInfo
@ stdcall GetConsoleTitleA(ptr long)
@ stdcall GetConsoleTitleA(ptr long)
...
...
dlls/kernel32/tests/console.c
View file @
a95e0708
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
#include <stdio.h>
#include <stdio.h>
static
BOOL
(
WINAPI
*
pGetConsoleInputExeNameA
)(
DWORD
,
LPSTR
);
static
BOOL
(
WINAPI
*
pGetConsoleInputExeNameA
)(
DWORD
,
LPSTR
);
static
DWORD
(
WINAPI
*
pGetConsoleProcessList
)(
LPDWORD
,
DWORD
);
static
BOOL
(
WINAPI
*
pSetConsoleInputExeNameA
)(
LPCSTR
);
static
BOOL
(
WINAPI
*
pSetConsoleInputExeNameA
)(
LPCSTR
);
/* DEFAULT_ATTRIB is used for all initial filling of the console.
/* DEFAULT_ATTRIB is used for all initial filling of the console.
...
@@ -63,6 +64,7 @@ static void init_function_pointers(void)
...
@@ -63,6 +64,7 @@ static void init_function_pointers(void)
hKernel32
=
GetModuleHandleA
(
"kernel32.dll"
);
hKernel32
=
GetModuleHandleA
(
"kernel32.dll"
);
KERNEL32_GET_PROC
(
GetConsoleInputExeNameA
);
KERNEL32_GET_PROC
(
GetConsoleInputExeNameA
);
KERNEL32_GET_PROC
(
GetConsoleProcessList
);
KERNEL32_GET_PROC
(
SetConsoleInputExeNameA
);
KERNEL32_GET_PROC
(
SetConsoleInputExeNameA
);
#undef KERNEL32_GET_PROC
#undef KERNEL32_GET_PROC
...
@@ -926,6 +928,66 @@ static void test_GetSetConsoleInputExeName(void)
...
@@ -926,6 +928,66 @@ static void test_GetSetConsoleInputExeName(void)
ok
(
!
lstrcmpA
(
buffer
,
input_exe
),
"got %s expected %s
\n
"
,
buffer
,
input_exe
);
ok
(
!
lstrcmpA
(
buffer
,
input_exe
),
"got %s expected %s
\n
"
,
buffer
,
input_exe
);
}
}
static
void
test_GetConsoleProcessList
(
void
)
{
DWORD
ret
,
*
list
=
NULL
;
if
(
!
pGetConsoleProcessList
)
{
win_skip
(
"GetConsoleProcessList is not available
\n
"
);
return
;
}
SetLastError
(
0xdeadbeef
);
ret
=
pGetConsoleProcessList
(
NULL
,
0
);
ok
(
ret
==
0
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
pGetConsoleProcessList
(
NULL
,
1
);
ok
(
ret
==
0
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
());
/* We should only have 1 process but only for these specific unit tests as
* we created our own console. An AttachConsole(ATTACH_PARENT_PROCESS) would
* give us two processes for example.
*/
list
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
DWORD
));
SetLastError
(
0xdeadbeef
);
ret
=
pGetConsoleProcessList
(
list
,
0
);
ok
(
ret
==
0
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
pGetConsoleProcessList
(
list
,
1
);
todo_wine
ok
(
ret
==
1
,
"Expected 1, got %d
\n
"
,
ret
);
HeapFree
(
GetProcessHeap
(),
0
,
list
);
list
=
HeapAlloc
(
GetProcessHeap
(),
0
,
ret
*
sizeof
(
DWORD
));
SetLastError
(
0xdeadbeef
);
ret
=
pGetConsoleProcessList
(
list
,
ret
);
todo_wine
ok
(
ret
==
1
,
"Expected 1, got %d
\n
"
,
ret
);
if
(
ret
==
1
)
{
DWORD
pid
=
GetCurrentProcessId
();
ok
(
list
[
0
]
==
pid
,
"Expected %d, got %d
\n
"
,
pid
,
list
[
0
]);
}
HeapFree
(
GetProcessHeap
(),
0
,
list
);
}
START_TEST
(
console
)
START_TEST
(
console
)
{
{
HANDLE
hConIn
,
hConOut
;
HANDLE
hConIn
,
hConOut
;
...
@@ -971,10 +1033,9 @@ START_TEST(console)
...
@@ -971,10 +1033,9 @@ START_TEST(console)
/* still to be done: access rights & access on objects */
/* still to be done: access rights & access on objects */
if
(
!
pGetConsoleInputExeNameA
||
!
pSetConsoleInputExeNameA
)
if
(
!
pGetConsoleInputExeNameA
||
!
pSetConsoleInputExeNameA
)
{
win_skip
(
"GetConsoleInputExeNameA and/or SetConsoleInputExeNameA is not available
\n
"
);
win_skip
(
"GetConsoleInputExeNameA and/or SetConsoleInputExeNameA is not available
\n
"
);
return
;
}
else
else
test_GetSetConsoleInputExeName
();
test_GetSetConsoleInputExeName
();
test_GetConsoleProcessList
();
}
}
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