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
3ef08159
Commit
3ef08159
authored
Oct 25, 2022
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Oct 31, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32/tests: Add DBCS file name tests for DragQueryFile.
parent
9cd5bc0d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
10 deletions
+58
-10
shellole.c
dlls/shell32/tests/shellole.c
+58
-10
No files found.
dlls/shell32/tests/shellole.c
View file @
3ef08159
...
...
@@ -746,7 +746,6 @@ static void test_SHCreateQueryCancelAutoPlayMoniker(void)
}
#define WM_EXPECTED_VALUE WM_APP
#define DROPTEST_FILENAME "c:\\wintest.bin"
struct
DragParam
{
HWND
hwnd
;
HANDLE
ready
;
...
...
@@ -755,10 +754,12 @@ struct DragParam {
static
LRESULT
WINAPI
drop_window_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
{
static
BOOL
expected
;
static
char
expected_filename
[
MAX_PATH
];
switch
(
msg
)
{
case
WM_EXPECTED_VALUE
:
{
lstrcpynA
(
expected_filename
,
(
const
char
*
)
wparam
,
sizeof
(
expected_filename
));
expected
=
lparam
;
break
;
}
...
...
@@ -768,19 +769,44 @@ static LRESULT WINAPI drop_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA
char
filename
[
MAX_PATH
]
=
"dummy"
;
POINT
pt
;
BOOL
r
;
UINT
num
;
UINT
num
,
len
;
winetest_push_context
(
"%s"
,
wine_dbgstr_a
(
expected_filename
));
num
=
DragQueryFileA
(
hDrop
,
0xffffffff
,
NULL
,
0
);
ok
(
num
==
1
,
"expected 1, got %u
\n
"
,
num
);
num
=
DragQueryFileA
(
hDrop
,
0xffffffff
,
(
char
*
)
0xdeadbeef
,
0xffffffff
);
ok
(
num
==
1
,
"expected 1, got %u
\n
"
,
num
);
len
=
strlen
(
expected_filename
);
num
=
DragQueryFileA
(
hDrop
,
0
,
NULL
,
0
);
todo_wine_if
(
expected_filename
[
0
]
==
'd'
)
ok
(
num
==
len
,
"expected %u, got %u
\n
"
,
len
,
num
);
num
=
DragQueryFileA
(
hDrop
,
0
,
filename
,
0
);
todo_wine_if
(
expected_filename
[
0
]
==
'd'
)
ok
(
num
==
len
,
"expected %u, got %u
\n
"
,
len
,
num
);
ok
(
!
strcmp
(
filename
,
"dummy"
),
"got %s
\n
"
,
filename
);
num
=
DragQueryFileA
(
hDrop
,
0
,
filename
,
sizeof
(
filename
));
ok
(
num
==
strlen
(
DROPTEST_FILENAME
),
"got %u
\n
"
,
num
);
ok
(
!
strcmp
(
filename
,
DROPTEST_FILENAME
),
"got %s
\n
"
,
filename
);
todo_wine_if
(
expected_filename
[
0
]
==
'd'
)
ok
(
num
==
len
,
"expected %u, got %u
\n
"
,
len
,
num
);
ok
(
!
strcmp
(
filename
,
expected_filename
),
"expected %s, got %s
\n
"
,
expected_filename
,
filename
);
memset
(
filename
,
0xaa
,
sizeof
(
filename
));
num
=
DragQueryFileA
(
hDrop
,
0
,
filename
,
2
);
todo_wine
ok
(
num
==
1
,
"expected 1, got %u
\n
"
,
num
);
ok
(
filename
[
0
]
==
expected_filename
[
0
],
"expected '%c', got '%c'
\n
"
,
expected_filename
[
0
],
filename
[
0
]);
ok
(
filename
[
1
]
==
'\0'
,
"expected nul, got %#x
\n
"
,
(
BYTE
)
filename
[
1
]);
r
=
DragQueryPoint
(
hDrop
,
&
pt
);
ok
(
r
==
expected
,
"expected %d, got %d
\n
"
,
expected
,
r
);
ok
(
pt
.
x
==
10
,
"expected 10, got %ld
\n
"
,
pt
.
x
);
ok
(
pt
.
y
==
20
,
"expected 20, got %ld
\n
"
,
pt
.
y
);
DragFinish
(
hDrop
);
winetest_pop_context
();
return
0
;
}
}
...
...
@@ -841,8 +867,15 @@ static void test_DragQueryFile(BOOL non_client_flag)
DWORD
rc
;
HGLOBAL
hDrop
;
DROPFILES
*
pDrop
;
int
ret
;
int
ret
,
i
;
BOOL
r
;
static
const
struct
{
UINT
codepage
;
const
char
*
filename
;
}
testcase
[]
=
{
{
0
,
"c:
\\
wintest.bin"
},
{
932
,
"d:
\\\x89\xb9\x8a\x79
_02.CHY"
},
};
param
.
ready
=
CreateEventA
(
NULL
,
FALSE
,
FALSE
,
NULL
);
ok
(
param
.
ready
!=
NULL
,
"can't create event
\n
"
);
...
...
@@ -851,24 +884,40 @@ static void test_DragQueryFile(BOOL non_client_flag)
rc
=
WaitForSingleObject
(
param
.
ready
,
5000
);
ok
(
rc
==
WAIT_OBJECT_0
,
"got %lu
\n
"
,
rc
);
hDrop
=
GlobalAlloc
(
GHND
,
sizeof
(
DROPFILES
)
+
(
strlen
(
DROPTEST_FILENAME
)
+
2
)
*
sizeof
(
WCHAR
));
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
testcase
);
i
++
)
{
winetest_push_context
(
"%d"
,
i
);
if
(
testcase
[
i
].
codepage
&&
testcase
[
i
].
codepage
!=
GetACP
())
{
skip
(
"need codepage %u for this test
\n
"
,
testcase
[
i
].
codepage
);
winetest_pop_context
();
continue
;
}
ret
=
MultiByteToWideChar
(
CP_ACP
,
0
,
testcase
[
i
].
filename
,
-
1
,
NULL
,
0
);
ok
(
ret
>
0
,
"got %d
\n
"
,
ret
);
hDrop
=
GlobalAlloc
(
GHND
,
sizeof
(
DROPFILES
)
+
(
ret
+
1
)
*
sizeof
(
WCHAR
));
pDrop
=
GlobalLock
(
hDrop
);
pDrop
->
pt
.
x
=
10
;
pDrop
->
pt
.
y
=
20
;
pDrop
->
fNC
=
non_client_flag
;
pDrop
->
pFiles
=
sizeof
(
DROPFILES
);
ret
=
MultiByteToWideChar
(
CP_ACP
,
0
,
DROPTEST_FILENAME
,
-
1
,
(
LPWSTR
)(
pDrop
+
1
),
strlen
(
DROPTEST_FILENAME
)
+
1
);
ret
=
MultiByteToWideChar
(
CP_ACP
,
0
,
testcase
[
i
].
filename
,
-
1
,
(
LPWSTR
)(
pDrop
+
1
),
ret
);
ok
(
ret
>
0
,
"got %d
\n
"
,
ret
);
pDrop
->
fWide
=
TRUE
;
GlobalUnlock
(
hDrop
);
r
=
PostMessageA
(
param
.
hwnd
,
WM_EXPECTED_VALUE
,
0
,
!
non_client_flag
);
r
=
PostMessageA
(
param
.
hwnd
,
WM_EXPECTED_VALUE
,
(
WPARAM
)
testcase
[
i
].
filename
,
!
non_client_flag
);
ok
(
r
,
"got %d
\n
"
,
r
);
r
=
PostMessageA
(
param
.
hwnd
,
WM_DROPFILES
,
(
WPARAM
)
hDrop
,
0
);
ok
(
r
,
"got %d
\n
"
,
r
);
winetest_pop_context
();
}
r
=
PostMessageA
(
param
.
hwnd
,
WM_QUIT
,
0
,
0
);
ok
(
r
,
"got %d
\n
"
,
r
);
...
...
@@ -879,7 +928,6 @@ static void test_DragQueryFile(BOOL non_client_flag)
CloseHandle
(
hThread
);
}
#undef WM_EXPECTED_VALUE
#undef DROPTEST_FILENAME
static
void
test_SHCreateSessionKey
(
void
)
{
...
...
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