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
18a9aba0
Commit
18a9aba0
authored
Nov 01, 2013
by
Francois Gouget
Committed by
Alexandre Julliard
Nov 01, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Windows 8 returns different error codes.
parent
f399e903
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
54 deletions
+56
-54
console.c
dlls/kernel32/tests/console.c
+56
-54
No files found.
dlls/kernel32/tests/console.c
View file @
18a9aba0
...
...
@@ -704,7 +704,7 @@ static void testScreenBuffer(HANDLE hConOut)
WCHAR
test_unicode
[]
=
{
0x0442
,
0x0435
,
0x0441
,
0x0442
,
0
};
WCHAR
str_wbuf
[
20
];
char
str_buf
[
20
];
DWORD
len
;
DWORD
len
,
error
;
COORD
c
;
BOOL
ret
;
DWORD
oldcp
;
...
...
@@ -782,25 +782,25 @@ static void testScreenBuffer(HANDLE hConOut)
/* trying to write non-console handle */
SetLastError
(
0xdeadbeef
);
ok
(
!
WriteConsoleA
(
hFileOutRW
,
test_str1
,
lstrlenA
(
test_str1
),
&
len
,
NULL
),
"Shouldn't succeed
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"GetLastError: expecting %u got %u
\n
"
,
ERROR_INVALID_HANDLE
,
GetLastError
()
);
ret
=
WriteConsoleA
(
hFileOutRW
,
test_str1
,
lstrlenA
(
test_str1
),
&
len
,
NULL
);
error
=
GetLastError
(
);
ok
(
!
ret
,
"Shouldn't succeed
\n
"
);
ok
(
error
==
ERROR_INVALID_HANDLE
||
error
==
ERROR_INVALID_FUNCTION
,
"GetLastError: got %u
\n
"
,
error
);
SetLastError
(
0xdeadbeef
);
ok
(
!
WriteConsoleA
(
hFileOutRO
,
test_str1
,
lstrlenA
(
test_str1
),
&
len
,
NULL
),
"Shouldn't succeed
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"GetLastError: expecting %u got %u
\n
"
,
ERROR_INVALID_HANDLE
,
GetLastError
()
);
ret
=
WriteConsoleA
(
hFileOutRO
,
test_str1
,
lstrlenA
(
test_str1
),
&
len
,
NULL
);
error
=
GetLastError
(
);
ok
(
!
ret
,
"Shouldn't succeed
\n
"
);
ok
(
error
==
ERROR_INVALID_HANDLE
||
error
==
ERROR_INVALID_FUNCTION
,
"GetLastError: got %u
\n
"
,
error
);
SetLastError
(
0xdeadbeef
);
ok
(
!
WriteConsoleA
(
hFileOutWT
,
test_str1
,
lstrlenA
(
test_str1
),
&
len
,
NULL
),
"Shouldn't succeed
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"GetLastError: expecting %u got %u
\n
"
,
ERROR_INVALID_HANDLE
,
GetLastError
()
);
ret
=
WriteConsoleA
(
hFileOutWT
,
test_str1
,
lstrlenA
(
test_str1
),
&
len
,
NULL
);
error
=
GetLastError
(
);
ok
(
!
ret
,
"Shouldn't succeed
\n
"
);
todo_wine
ok
(
error
==
ERROR_INVALID_HANDLE
||
error
==
ERROR_INVALID_FUNCTION
,
"GetLastError: got %u
\n
"
,
error
);
CloseHandle
(
hFileOutRW
);
CloseHandle
(
hFileOutRO
);
...
...
@@ -1051,6 +1051,7 @@ static void test_OpenConsoleW(void)
static
const
WCHAR
conoutW
[]
=
{
'C'
,
'O'
,
'N'
,
'O'
,
'U'
,
'T'
,
'$'
,
0
};
static
const
WCHAR
emptyW
[]
=
{
0
};
static
const
WCHAR
invalidW
[]
=
{
'I'
,
'N'
,
'V'
,
'A'
,
'L'
,
'I'
,
'D'
,
0
};
DWORD
gle
;
static
const
struct
{
...
...
@@ -1058,42 +1059,42 @@ static void test_OpenConsoleW(void)
DWORD
access
;
BOOL
inherit
;
DWORD
creation
;
DWORD
gle
;
DWORD
gle
,
gle2
;
}
invalid_table
[]
=
{
{
NULL
,
0
,
FALSE
,
0
,
ERROR_INVALID_PARAMETER
},
{
NULL
,
0xdeadbeef
,
0xdeadbeef
,
0xdeadbeef
,
ERROR_INVALID_PARAMETER
},
{
NULL
,
0
,
FALSE
,
OPEN_ALWAYS
,
ERROR_INVALID_PARAMETER
},
{
NULL
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
0
,
ERROR_INVALID_PARAMETER
},
{
NULL
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
OPEN_ALWAYS
,
ERROR_INVALID_PARAMETER
},
{
NULL
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
OPEN_EXISTING
,
ERROR_INVALID_PARAMETER
},
{
emptyW
,
0
,
FALSE
,
0
,
ERROR_INVALID_PARAMETER
},
{
emptyW
,
0xdeadbeef
,
0xdeadbeef
,
0xdeadbeef
,
ERROR_INVALID_PARAMETER
},
{
emptyW
,
0
,
FALSE
,
OPEN_ALWAYS
,
ERROR_INVALID_PARAMETER
},
{
emptyW
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
0
,
ERROR_INVALID_PARAMETER
},
{
emptyW
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
OPEN_ALWAYS
,
ERROR_INVALID_PARAMETER
},
{
emptyW
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
OPEN_EXISTING
,
ERROR_INVALID_PARAMETER
},
{
invalidW
,
0
,
FALSE
,
0
,
ERROR_INVALID_PARAMETER
},
{
invalidW
,
0xdeadbeef
,
0xdeadbeef
,
0xdeadbeef
,
ERROR_INVALID_PARAMETER
},
{
invalidW
,
0
,
FALSE
,
OPEN_ALWAYS
,
ERROR_INVALID_PARAMETER
},
{
invalidW
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
0
,
ERROR_INVALID_PARAMETER
},
{
invalidW
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
OPEN_ALWAYS
,
ERROR_INVALID_PARAMETER
},
{
invalidW
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
OPEN_EXISTING
,
ERROR_INVALID_PARAMETER
},
{
coninW
,
0
,
FALSE
,
0
,
ERROR_SHARING_VIOLATION
},
{
coninW
,
0xdeadbeef
,
0xdeadbeef
,
0xdeadbeef
,
ERROR_INVALID_PARAMETER
},
{
coninW
,
0
,
FALSE
,
OPEN_ALWAYS
,
ERROR_INVALID_PARAMETER
},
{
coninW
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
0
,
ERROR_SHARING_VIOLATION
},
{
coninW
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
CREATE_NEW
,
ERROR_SHARING_VIOLATION
},
{
coninW
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
CREATE_ALWAYS
,
ERROR_SHARING_VIOLATION
},
{
coninW
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
OPEN_ALWAYS
,
ERROR_INVALID_PARAMETER
},
{
coninW
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
TRUNCATE_EXISTING
,
ERROR_INVALID_PARAMETER
},
{
conoutW
,
0
,
FALSE
,
0
,
ERROR_SHARING_VIOLATION
},
{
conoutW
,
0xdeadbeef
,
0xdeadbeef
,
0xdeadbeef
,
ERROR_INVALID_PARAMETER
},
{
conoutW
,
0
,
FALSE
,
OPEN_ALWAYS
,
ERROR_INVALID_PARAMETER
},
{
conoutW
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
0
,
ERROR_SHARING_VIOLATION
},
{
conoutW
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
CREATE_NEW
,
ERROR_SHARING_VIOLATION
},
{
conoutW
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
CREATE_ALWAYS
,
ERROR_SHARING_VIOLATION
},
{
conoutW
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
OPEN_ALWAYS
,
ERROR_INVALID_PARAMETER
},
{
conoutW
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
TRUNCATE_EXISTING
,
ERROR_INVALID_PARAMETER
},
{
NULL
,
0
,
FALSE
,
0
,
ERROR_INVALID_PARAMETER
,
ERROR_PATH_NOT_FOUND
},
{
NULL
,
0xdeadbeef
,
0xdeadbeef
,
0xdeadbeef
,
ERROR_INVALID_PARAMETER
,
ERROR_PATH_NOT_FOUND
},
{
NULL
,
0
,
FALSE
,
OPEN_ALWAYS
,
ERROR_INVALID_PARAMETER
,
ERROR_PATH_NOT_FOUND
},
{
NULL
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
0
,
ERROR_INVALID_PARAMETER
,
ERROR_PATH_NOT_FOUND
},
{
NULL
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
OPEN_ALWAYS
,
ERROR_INVALID_PARAMETER
,
ERROR_PATH_NOT_FOUND
},
{
NULL
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
OPEN_EXISTING
,
ERROR_INVALID_PARAMETER
,
ERROR_PATH_NOT_FOUND
},
{
emptyW
,
0
,
FALSE
,
0
,
ERROR_INVALID_PARAMETER
,
ERROR_PATH_NOT_FOUND
},
{
emptyW
,
0xdeadbeef
,
0xdeadbeef
,
0xdeadbeef
,
ERROR_INVALID_PARAMETER
,
ERROR_PATH_NOT_FOUND
},
{
emptyW
,
0
,
FALSE
,
OPEN_ALWAYS
,
ERROR_INVALID_PARAMETER
,
ERROR_PATH_NOT_FOUND
},
{
emptyW
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
0
,
ERROR_INVALID_PARAMETER
,
ERROR_PATH_NOT_FOUND
},
{
emptyW
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
OPEN_ALWAYS
,
ERROR_INVALID_PARAMETER
,
ERROR_PATH_NOT_FOUND
},
{
emptyW
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
OPEN_EXISTING
,
ERROR_INVALID_PARAMETER
,
ERROR_PATH_NOT_FOUND
},
{
invalidW
,
0
,
FALSE
,
0
,
ERROR_INVALID_PARAMETER
,
ERROR_FILE_NOT_FOUND
},
{
invalidW
,
0xdeadbeef
,
0xdeadbeef
,
0xdeadbeef
,
ERROR_INVALID_PARAMETER
,
0
},
{
invalidW
,
0
,
FALSE
,
OPEN_ALWAYS
,
ERROR_INVALID_PARAMETER
,
ERROR_FILE_NOT_FOUND
},
{
invalidW
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
0
,
ERROR_INVALID_PARAMETER
,
ERROR_FILE_NOT_FOUND
},
{
invalidW
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
OPEN_ALWAYS
,
ERROR_INVALID_PARAMETER
,
ERROR_FILE_NOT_FOUND
},
{
invalidW
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
OPEN_EXISTING
,
ERROR_INVALID_PARAMETER
,
ERROR_FILE_NOT_FOUND
},
{
coninW
,
0
,
FALSE
,
0
,
ERROR_SHARING_VIOLATION
,
0
},
{
coninW
,
0xdeadbeef
,
0xdeadbeef
,
0xdeadbeef
,
ERROR_INVALID_PARAMETER
,
0
},
{
coninW
,
0
,
FALSE
,
OPEN_ALWAYS
,
ERROR_INVALID_PARAMETER
,
0
},
{
coninW
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
0
,
ERROR_SHARING_VIOLATION
,
0
},
{
coninW
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
CREATE_NEW
,
ERROR_SHARING_VIOLATION
,
0
},
{
coninW
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
CREATE_ALWAYS
,
ERROR_SHARING_VIOLATION
,
0
},
{
coninW
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
OPEN_ALWAYS
,
ERROR_INVALID_PARAMETER
,
0
},
{
coninW
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
TRUNCATE_EXISTING
,
ERROR_INVALID_PARAMETER
,
0
},
{
conoutW
,
0
,
FALSE
,
0
,
ERROR_SHARING_VIOLATION
,
0
},
{
conoutW
,
0xdeadbeef
,
0xdeadbeef
,
0xdeadbeef
,
ERROR_INVALID_PARAMETER
,
0
},
{
conoutW
,
0
,
FALSE
,
OPEN_ALWAYS
,
ERROR_INVALID_PARAMETER
,
0
},
{
conoutW
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
0
,
ERROR_SHARING_VIOLATION
,
0
},
{
conoutW
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
CREATE_NEW
,
ERROR_SHARING_VIOLATION
,
0
},
{
conoutW
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
CREATE_ALWAYS
,
ERROR_SHARING_VIOLATION
,
0
},
{
conoutW
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
OPEN_ALWAYS
,
ERROR_INVALID_PARAMETER
,
0
},
{
conoutW
,
GENERIC_READ
|
GENERIC_WRITE
,
FALSE
,
TRUNCATE_EXISTING
,
ERROR_INVALID_PARAMETER
,
0
},
};
int
index
;
...
...
@@ -1110,12 +1111,13 @@ static void test_OpenConsoleW(void)
SetLastError
(
0xdeadbeef
);
ret
=
pOpenConsoleW
(
invalid_table
[
index
].
name
,
invalid_table
[
index
].
access
,
invalid_table
[
index
].
inherit
,
invalid_table
[
index
].
creation
);
gle
=
GetLastError
();
ok
(
ret
==
INVALID_HANDLE_VALUE
,
"Expected OpenConsoleW to return INVALID_HANDLE_VALUE for index %d, got %p
\n
"
,
index
,
ret
);
ok
(
GetLastError
()
==
invalid_table
[
index
].
gle
,
"Expected GetLastError() to return %u for index %d, got %u
\n
"
,
invalid_table
[
index
].
gle
,
in
dex
,
GetLastError
()
);
ok
(
gle
==
invalid_table
[
index
].
gle
||
(
gle
!=
0
&&
gle
==
invalid_table
[
index
].
gle2
)
,
"Expected GetLastError() to return %u
/%u
for index %d, got %u
\n
"
,
invalid_table
[
index
].
gle
,
in
valid_table
[
index
].
gle2
,
index
,
gle
);
}
/* OpenConsoleW should not touch the last error on success. */
...
...
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