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
e240aeb7
Commit
e240aeb7
authored
Feb 23, 2022
by
Eric Pouech
Committed by
Alexandre Julliard
Feb 23, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comdlg32/tests: Enable compilation with long types.
Signed-off-by:
Eric Pouech
<
eric.pouech@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
cd4c58f5
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
564 additions
and
565 deletions
+564
-565
Makefile.in
dlls/comdlg32/tests/Makefile.in
+0
-1
filedlg.c
dlls/comdlg32/tests/filedlg.c
+63
-63
finddlg.c
dlls/comdlg32/tests/finddlg.c
+1
-1
fontdlg.c
dlls/comdlg32/tests/fontdlg.c
+4
-4
itemdlg.c
dlls/comdlg32/tests/itemdlg.c
+468
-468
printdlg.c
dlls/comdlg32/tests/printdlg.c
+28
-28
No files found.
dlls/comdlg32/tests/Makefile.in
View file @
e240aeb7
EXTRADEFS
=
-DWINE_NO_LONG_TYPES
TESTDLL
=
comdlg32.dll
IMPORTS
=
uuid shell32 ole32 comdlg32 winspool user32 gdi32
...
...
dlls/comdlg32/tests/filedlg.c
View file @
e240aeb7
...
...
@@ -50,7 +50,7 @@ static void toolbarcheck( HWND hDlg)
}
ok
(
ctrl
!=
NULL
,
"could not get the toolbar control
\n
"
);
ret
=
SendMessageA
(
ctrl
,
TB_ADDSTRINGA
,
0
,
(
LPARAM
)
"winetestwinetest
\0\0
"
);
ok
(
ret
==
0
,
"addstring returned %d (expected 0)
\n
"
,
ret
);
ok
(
ret
==
0
,
"addstring returned %
l
d (expected 0)
\n
"
,
ret
);
maxtextrows
=
SendMessageA
(
ctrl
,
TB_GETTEXTROWS
,
0
,
0
);
ok
(
maxtextrows
==
0
||
broken
(
maxtextrows
==
1
),
/* Win2k and below */
"Get(Max)TextRows returned %d (expected 0)
\n
"
,
maxtextrows
);
...
...
@@ -108,25 +108,25 @@ static void test_DialogCancel(void)
PrintDlgA
(
NULL
);
ok
(
CDERR_INITIALIZATION
==
CommDlgExtendedError
(),
"expected CDERR_INITIALIZATION, got %d
\n
"
,
CommDlgExtendedError
());
"expected CDERR_INITIALIZATION, got %
l
d
\n
"
,
CommDlgExtendedError
());
result
=
GetOpenFileNameA
(
&
ofn
);
ok
(
FALSE
==
result
,
"expected FALSE, got %d
\n
"
,
result
);
ok
(
0
==
CommDlgExtendedError
(),
"expected 0, got %d
\n
"
,
ok
(
0
==
CommDlgExtendedError
(),
"expected 0, got %
l
d
\n
"
,
CommDlgExtendedError
());
PrintDlgA
(
NULL
);
ok
(
CDERR_INITIALIZATION
==
CommDlgExtendedError
(),
"expected CDERR_INITIALIZATION, got %d
\n
"
,
CommDlgExtendedError
());
"expected CDERR_INITIALIZATION, got %
l
d
\n
"
,
CommDlgExtendedError
());
result
=
GetSaveFileNameA
(
&
ofn
);
ok
(
FALSE
==
result
,
"expected FALSE, got %d
\n
"
,
result
);
ok
(
0
==
CommDlgExtendedError
(),
"expected 0, got %d
\n
"
,
ok
(
0
==
CommDlgExtendedError
(),
"expected 0, got %
l
d
\n
"
,
CommDlgExtendedError
());
PrintDlgA
(
NULL
);
ok
(
CDERR_INITIALIZATION
==
CommDlgExtendedError
(),
"expected CDERR_INITIALIZATION, got %d
\n
"
,
CommDlgExtendedError
());
"expected CDERR_INITIALIZATION, got %
l
d
\n
"
,
CommDlgExtendedError
());
/* Before passing the ofn to Unicode functions, remove the ANSI strings */
ofn
.
lpstrFilter
=
NULL
;
...
...
@@ -135,7 +135,7 @@ static void test_DialogCancel(void)
PrintDlgA
(
NULL
);
ok
(
CDERR_INITIALIZATION
==
CommDlgExtendedError
(),
"expected CDERR_INITIALIZATION, got %d
\n
"
,
CommDlgExtendedError
());
"expected CDERR_INITIALIZATION, got %
l
d
\n
"
,
CommDlgExtendedError
());
SetLastError
(
0xdeadbeef
);
result
=
GetOpenFileNameW
((
LPOPENFILENAMEW
)
&
ofn
);
...
...
@@ -144,7 +144,7 @@ static void test_DialogCancel(void)
else
{
ok
(
FALSE
==
result
,
"expected FALSE, got %d
\n
"
,
result
);
ok
(
0
==
CommDlgExtendedError
(),
"expected 0, got %d
\n
"
,
CommDlgExtendedError
());
ok
(
0
==
CommDlgExtendedError
(),
"expected 0, got %
l
d
\n
"
,
CommDlgExtendedError
());
}
SetLastError
(
0xdeadbeef
);
...
...
@@ -154,7 +154,7 @@ static void test_DialogCancel(void)
else
{
ok
(
FALSE
==
result
,
"expected FALSE, got %d
\n
"
,
result
);
ok
(
0
==
CommDlgExtendedError
(),
"expected 0, got %d
\n
"
,
CommDlgExtendedError
());
ok
(
0
==
CommDlgExtendedError
(),
"expected 0, got %
l
d
\n
"
,
CommDlgExtendedError
());
}
}
...
...
@@ -173,7 +173,7 @@ static UINT_PTR CALLBACK create_view_window2_hook(HWND dlg, UINT msg, WPARAM wPa
RECT
rect
=
{
0
,
0
,
0
,
0
};
hr
=
IShellBrowser_QueryActiveShellView
(
shell_browser
,
&
shell_view
);
ok
(
SUCCEEDED
(
hr
),
"QueryActiveShellView returned %#x
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"QueryActiveShellView returned %#
l
x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
goto
cleanup
;
hr
=
IShellView_QueryInterface
(
shell_view
,
&
IID_IShellView2
,
(
void
**
)
&
shell_view2
);
...
...
@@ -182,11 +182,11 @@ static UINT_PTR CALLBACK create_view_window2_hook(HWND dlg, UINT msg, WPARAM wPa
win_skip
(
"IShellView2 not supported
\n
"
);
goto
cleanup
;
}
ok
(
SUCCEEDED
(
hr
),
"QueryInterface returned %#x
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"QueryInterface returned %#
l
x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
goto
cleanup
;
hr
=
IShellView2_DestroyViewWindow
(
shell_view2
);
ok
(
SUCCEEDED
(
hr
),
"DestroyViewWindow returned %#x
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"DestroyViewWindow returned %#
l
x
\n
"
,
hr
);
folder_settings
.
ViewMode
=
FVM_LIST
;
folder_settings
.
fFlags
=
0
;
...
...
@@ -205,17 +205,17 @@ static UINT_PTR CALLBACK create_view_window2_hook(HWND dlg, UINT msg, WPARAM wPa
win_skip
(
"CreateViewWindow2 is broken on Vista/W2K8
\n
"
);
goto
cleanup
;
}
ok
(
SUCCEEDED
(
hr
),
"CreateViewWindow2 returned %#x
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"CreateViewWindow2 returned %#
l
x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
goto
cleanup
;
hr
=
IShellView2_GetCurrentInfo
(
shell_view2
,
&
folder_settings
);
ok
(
SUCCEEDED
(
hr
),
"GetCurrentInfo returned %#x
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"GetCurrentInfo returned %#
l
x
\n
"
,
hr
);
ok
(
folder_settings
.
ViewMode
==
FVM_LIST
,
"view mode is %d, expected FVM_LIST
\n
"
,
folder_settings
.
ViewMode
);
hr
=
IShellView2_DestroyViewWindow
(
shell_view2
);
ok
(
SUCCEEDED
(
hr
),
"DestroyViewWindow returned %#x
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"DestroyViewWindow returned %#
l
x
\n
"
,
hr
);
/* XP and W2K3 need this. On W2K the call to DestroyWindow() fails and has
* no side effects. NT4 doesn't get here. (FIXME: Vista doesn't get here yet).
...
...
@@ -224,11 +224,11 @@ static UINT_PTR CALLBACK create_view_window2_hook(HWND dlg, UINT msg, WPARAM wPa
view_params
.
pvid
=
&
VID_Details
;
hr
=
IShellView2_CreateViewWindow2
(
shell_view2
,
&
view_params
);
ok
(
SUCCEEDED
(
hr
),
"CreateViewWindow2 returned %#x
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"CreateViewWindow2 returned %#
l
x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
goto
cleanup
;
hr
=
IShellView2_GetCurrentInfo
(
shell_view2
,
&
folder_settings
);
ok
(
SUCCEEDED
(
hr
),
"GetCurrentInfo returned %#x
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"GetCurrentInfo returned %#
l
x
\n
"
,
hr
);
ok
(
folder_settings
.
ViewMode
==
FVM_DETAILS
||
broken
(
folder_settings
.
ViewMode
==
FVM_LIST
),
/* nt4 */
"view mode is %d, expected FVM_DETAILS
\n
"
,
folder_settings
.
ViewMode
);
...
...
@@ -275,9 +275,9 @@ static void test_create_view_window2(void)
ofn
.
lpfnHook
=
create_view_window2_hook
;
ofn
.
Flags
=
OFN_ENABLEHOOK
|
OFN_EXPLORER
;
ret
=
GetOpenFileNameA
(
&
ofn
);
ok
(
!
ret
,
"GetOpenFileNameA returned %#x
\n
"
,
ret
);
ok
(
!
ret
,
"GetOpenFileNameA returned %#
l
x
\n
"
,
ret
);
ret
=
CommDlgExtendedError
();
ok
(
!
ret
,
"CommDlgExtendedError returned %#x
\n
"
,
ret
);
ok
(
!
ret
,
"CommDlgExtendedError returned %#
l
x
\n
"
,
ret
);
}
static
void
test_create_view_template
(
void
)
...
...
@@ -295,9 +295,9 @@ static void test_create_view_template(void)
ofn
.
lpTemplateName
=
"template1"
;
ofn
.
lpstrFilter
=
"text
\0
*.txt
\0
All
\0
*
\0\0
"
;
ret
=
GetOpenFileNameA
(
&
ofn
);
ok
(
!
ret
,
"GetOpenFileNameA returned %#x
\n
"
,
ret
);
ok
(
!
ret
,
"GetOpenFileNameA returned %#
l
x
\n
"
,
ret
);
ret
=
CommDlgExtendedError
();
ok
(
!
ret
,
"CommDlgExtendedError returned %#x
\n
"
,
ret
);
ok
(
!
ret
,
"CommDlgExtendedError returned %#
l
x
\n
"
,
ret
);
}
/* test cases for resizing of the file dialog */
...
...
@@ -397,10 +397,10 @@ static UINT_PTR WINAPI resize_template_hook(HWND dlg, UINT msg, WPARAM wParam, L
GetWindowRect
(
parent
,
&
rc
);
todo_wine_if
(
resize_testcases
[
index
].
todo
){
ok
(
resize
==
rc
.
right
-
rc
.
left
-
initrc
.
right
+
initrc
.
left
,
"testid %d size-x change %d expected %d
\n
"
,
index
,
"testid %d size-x change %
l
d expected %d
\n
"
,
index
,
rc
.
right
-
rc
.
left
-
initrc
.
right
+
initrc
.
left
,
resize
);
ok
(
resize
==
rc
.
bottom
-
rc
.
top
-
initrc
.
bottom
+
initrc
.
top
,
"testid %d size-y change %d expected %d
\n
"
,
index
,
"testid %d size-y change %
l
d expected %d
\n
"
,
index
,
rc
.
bottom
-
rc
.
top
-
initrc
.
bottom
+
initrc
.
top
,
resize
);
}
if
(
resize_testcases
[
index
].
testcontrols
)
{
...
...
@@ -532,9 +532,9 @@ static void test_resize(void)
ofn
.
Flags
=
resize_testcases
[
i
].
flags
|
OFN_ENABLEHOOK
|
OFN_EXPLORER
|
OFN_ENABLETEMPLATE
|
OFN_SHOWHELP
;
ret
=
GetOpenFileNameA
(
&
ofn
);
ok
(
!
ret
,
"GetOpenFileName returned %#x
\n
"
,
ret
);
ok
(
!
ret
,
"GetOpenFileName returned %#
l
x
\n
"
,
ret
);
ret
=
CommDlgExtendedError
();
ok
(
!
ret
,
"CommDlgExtendedError returned %#x
\n
"
,
ret
);
ok
(
!
ret
,
"CommDlgExtendedError returned %#
l
x
\n
"
,
ret
);
}
}
...
...
@@ -628,7 +628,7 @@ static void test_ok(void)
BOOL
cdret
;
cdret
=
GetCurrentDirectoryA
(
sizeof
(
curdir
),
curdir
);
ok
(
cdret
,
"Failed to get current dir err %d
\n
"
,
GetLastError
());
ok
(
cdret
,
"Failed to get current dir err %
l
d
\n
"
,
GetLastError
());
if
(
!
GetTempFileNameA
(
"."
,
"txt"
,
0
,
tmpfilename
))
{
skip
(
"Failed to create a temporary file name
\n
"
);
return
;
...
...
@@ -646,14 +646,14 @@ static void test_ok(void)
ok
(
ok_testcases
[
i
].
expclose
==
ok_testcases
[
i
].
actclose
,
"testid %d: Open File dialog should %shave closed.
\n
"
,
i
,
ok_testcases
[
i
].
expclose
?
""
:
"NOT "
);
ok
(
ret
==
ok_testcases
[
i
].
expclose
,
"testid %d: GetOpenFileName returned %#x
\n
"
,
i
,
ret
);
ok
(
ret
==
ok_testcases
[
i
].
expclose
,
"testid %d: GetOpenFileName returned %#
l
x
\n
"
,
i
,
ret
);
ret
=
CommDlgExtendedError
();
ok
(
!
ret
,
"CommDlgExtendedError returned %#x
\n
"
,
ret
);
ok
(
!
ret
,
"CommDlgExtendedError returned %#
l
x
\n
"
,
ret
);
cdret
=
SetCurrentDirectoryA
(
curdir
);
ok
(
cdret
,
"Failed to restore current dir err %d
\n
"
,
GetLastError
());
ok
(
cdret
,
"Failed to restore current dir err %
l
d
\n
"
,
GetLastError
());
}
ret
=
DeleteFileA
(
tmpfilename
);
ok
(
ret
,
"Failed to delete temporary file %s err %d
\n
"
,
tmpfilename
,
GetLastError
());
ok
(
ret
,
"Failed to delete temporary file %s err %
l
d
\n
"
,
tmpfilename
,
GetLastError
());
}
/* test arranging with a custom template */
...
...
@@ -759,18 +759,18 @@ static UINT_PTR WINAPI template_hook_arrange(HWND dlgChild, UINT msg, WPARAM wPa
if
(
!
(
style
&
WS_SIZEBOX
))
{
/* without the OFN_ENABLESIZING flag */
ok
(
wrcParent
.
bottom
-
wrcParent
.
top
==
expecty
,
"Wrong height of dialog %d, expected %d
\n
"
,
"Wrong height of dialog %
l
d, expected %d
\n
"
,
wrcParent
.
bottom
-
wrcParent
.
top
,
expecty
);
ok
(
wrcParent
.
right
-
wrcParent
.
left
==
expectx
,
"Wrong width of dialog %d, expected %d
\n
"
,
"Wrong width of dialog %
l
d, expected %d
\n
"
,
wrcParent
.
right
-
wrcParent
.
left
,
expectx
);
}
else
{
/* with the OFN_ENABLESIZING flag */
ok
(
wrcParent
.
bottom
-
wrcParent
.
top
>
expecty
,
"Wrong height of dialog %d, expected more than %d
\n
"
,
"Wrong height of dialog %
l
d, expected more than %d
\n
"
,
wrcParent
.
bottom
-
wrcParent
.
top
,
expecty
);
ok
(
wrcParent
.
right
-
wrcParent
.
left
>
expectx
,
"Wrong width of dialog %d, expected more than %d
\n
"
,
"Wrong width of dialog %
l
d, expected more than %d
\n
"
,
wrcParent
.
right
-
wrcParent
.
left
,
expectx
);
}
...
...
@@ -851,9 +851,9 @@ static void test_arrange(void)
itemtemplateBtn
->
cx
=
arrange_tests
[
i
].
poszBtn
.
cx
;
itemtemplateBtn
->
cy
=
arrange_tests
[
i
].
poszBtn
.
cy
;
ret
=
GetOpenFileNameA
(
&
ofn
);
ok
(
!
ret
,
"GetOpenFileNameA returned %#x
\n
"
,
ret
);
ok
(
!
ret
,
"GetOpenFileNameA returned %#
l
x
\n
"
,
ret
);
ret
=
CommDlgExtendedError
();
ok
(
!
ret
,
"CommDlgExtendedError returned %#x
\n
"
,
ret
);
ok
(
!
ret
,
"CommDlgExtendedError returned %#
l
x
\n
"
,
ret
);
}
}
...
...
@@ -912,12 +912,12 @@ static void test_getfolderpath(void)
result
=
GetOpenFileNameA
(
&
ofn
);
ok
(
FALSE
==
result
,
"expected FALSE, got %d
\n
"
,
result
);
ok
(
0
==
CommDlgExtendedError
(),
"expected 0, got %d
\n
"
,
ok
(
0
==
CommDlgExtendedError
(),
"expected 0, got %
l
d
\n
"
,
CommDlgExtendedError
());
result
=
GetSaveFileNameA
(
&
ofn
);
ok
(
FALSE
==
result
,
"expected FALSE, got %d
\n
"
,
result
);
ok
(
0
==
CommDlgExtendedError
(),
"expected 0, got %d
\n
"
,
ok
(
0
==
CommDlgExtendedError
(),
"expected 0, got %
l
d
\n
"
,
CommDlgExtendedError
());
}
...
...
@@ -942,24 +942,24 @@ static void test_resizable2(void)
ret
=
GetOpenFileNameA
(
&
ofn
);
ok
(
ret
==
TRUE
,
"File Dialog should have been sizable
\n
"
);
ret
=
CommDlgExtendedError
();
ok
(
!
ret
,
"CommDlgExtendedError returned %#x
\n
"
,
ret
);
ok
(
!
ret
,
"CommDlgExtendedError returned %#
l
x
\n
"
,
ret
);
ofn
.
Flags
=
OFN_EXPLORER
|
OFN_ENABLETEMPLATE
;
ret
=
GetOpenFileNameA
(
&
ofn
);
ok
(
!
ret
,
"File Dialog should NOT have been sizable
\n
"
);
ret
=
CommDlgExtendedError
();
ok
(
!
ret
,
"CommDlgExtendedError returned %#x
\n
"
,
ret
);
ok
(
!
ret
,
"CommDlgExtendedError returned %#
l
x
\n
"
,
ret
);
ofn
.
Flags
=
OFN_EXPLORER
|
OFN_ENABLETEMPLATEHANDLE
;
ofn
.
hInstance
=
LoadResource
(
GetModuleHandleA
(
NULL
),
FindResourceA
(
GetModuleHandleA
(
NULL
),
"template1"
,
(
LPSTR
)
RT_DIALOG
));
ofn
.
lpTemplateName
=
NULL
;
ret
=
GetOpenFileNameA
(
&
ofn
);
ok
(
!
ret
,
"File Dialog should NOT have been sizable
\n
"
);
ret
=
CommDlgExtendedError
();
ok
(
!
ret
,
"CommDlgExtendedError returned %#x
\n
"
,
ret
);
ok
(
!
ret
,
"CommDlgExtendedError returned %#
l
x
\n
"
,
ret
);
ofn
.
Flags
=
OFN_EXPLORER
|
OFN_ENABLEHOOK
;
ret
=
GetOpenFileNameA
(
&
ofn
);
ok
(
!
ret
,
"File Dialog should NOT have been sizable
\n
"
);
ret
=
CommDlgExtendedError
();
ok
(
!
ret
,
"CommDlgExtendedError returned %#x
\n
"
,
ret
);
ok
(
!
ret
,
"CommDlgExtendedError returned %#
l
x
\n
"
,
ret
);
}
static
void
test_mru
(
void
)
...
...
@@ -982,15 +982,15 @@ static void test_mru(void)
SetLastError
(
0xdeadbeef
);
ret
=
CreateDirectoryA
(
test_dir_name
,
NULL
);
ok
(
ret
==
TRUE
,
"CreateDirectoryA should have succeeded: %d
\n
"
,
GetLastError
());
ok
(
ret
==
TRUE
,
"CreateDirectoryA should have succeeded: %
l
d
\n
"
,
GetLastError
());
/* "teach" comdlg32 about this directory */
strcpy
(
filename_buf
,
test_full_path
);
SetLastError
(
0xdeadbeef
);
ret
=
GetOpenFileNameA
(
&
ofn
);
ok
(
ret
,
"GetOpenFileNameA should have succeeded: %d
\n
"
,
GetLastError
());
ok
(
ret
,
"GetOpenFileNameA should have succeeded: %
l
d
\n
"
,
GetLastError
());
ret
=
CommDlgExtendedError
();
ok
(
!
ret
,
"CommDlgExtendedError returned %x
\n
"
,
ret
);
ok
(
!
ret
,
"CommDlgExtendedError returned %
l
x
\n
"
,
ret
);
ok
(
testcase
.
actclose
,
"Open File dialog should have closed.
\n
"
);
ok
(
!
strcmp
(
ofn
.
lpstrFile
,
test_full_path
),
"Expected to get %s, got %s
\n
"
,
test_full_path
,
ofn
.
lpstrFile
);
...
...
@@ -999,16 +999,16 @@ static void test_mru(void)
strcpy
(
filename_buf
,
test_file_name
);
SetLastError
(
0xdeadbeef
);
ret
=
GetOpenFileNameA
(
&
ofn
);
ok
(
ret
,
"GetOpenFileNameA should have succeeded: %d
\n
"
,
GetLastError
());
ok
(
ret
,
"GetOpenFileNameA should have succeeded: %
l
d
\n
"
,
GetLastError
());
ret
=
CommDlgExtendedError
();
ok
(
!
ret
,
"CommDlgExtendedError returned %x
\n
"
,
ret
);
ok
(
!
ret
,
"CommDlgExtendedError returned %
l
x
\n
"
,
ret
);
ok
(
testcase
.
actclose
,
"Open File dialog should have closed.
\n
"
);
if
(
strcmp
(
ofn
.
lpstrFile
,
test_full_path
)
!=
0
)
win_skip
(
"Platform doesn't save MRU data
\n
"
);
SetLastError
(
0xdeadbeef
);
ret
=
RemoveDirectoryA
(
test_dir_name
);
ok
(
ret
==
TRUE
,
"RemoveDirectoryA should have succeeded: %d
\n
"
,
GetLastError
());
ok
(
ret
==
TRUE
,
"RemoveDirectoryA should have succeeded: %
l
d
\n
"
,
GetLastError
());
}
static
UINT_PTR
WINAPI
test_extension_wndproc
(
HWND
dlg
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
...
...
@@ -1040,7 +1040,7 @@ static void test_extension_helper(OPENFILENAMEA* ofn, const char *filter,
ok
(
boolret
,
"%s: expected TRUE
\n
"
,
filter
);
ret
=
CommDlgExtendedError
();
ok
(
!
ret
,
"%s: CommDlgExtendedError returned %#x
\n
"
,
filter
,
ret
);
ok
(
!
ret
,
"%s: CommDlgExtendedError returned %#
l
x
\n
"
,
filter
,
ret
);
filename_ptr
=
ofn
->
lpstrFile
+
ofn
->
nFileOffset
;
ok
(
strcmp
(
filename_ptr
,
expected_filename
)
==
0
,
...
...
@@ -1071,7 +1071,7 @@ static void test_extension(void)
};
boolret
=
GetTempPathA
(
sizeof
(
dir
),
dir
);
ok
(
boolret
,
"Failed to get current dir err %d
\n
"
,
GetLastError
());
ok
(
boolret
,
"Failed to get current dir err %
l
d
\n
"
,
GetLastError
());
ofn
.
hwndOwner
=
NULL
;
ofn
.
lpstrFile
=
filename
;
...
...
@@ -1168,9 +1168,9 @@ static void test_null_filename(void)
ofnA
.
lpstrFilter
=
"text
\0
*.txt
\0
All
\0
*
\0\0
"
;
ofnA
.
lpstrDefExt
=
NULL
;
ret
=
GetOpenFileNameA
(
&
ofnA
);
todo_wine
ok
(
ret
,
"GetOpenFileNameA returned %#x
\n
"
,
ret
);
todo_wine
ok
(
ret
,
"GetOpenFileNameA returned %#
l
x
\n
"
,
ret
);
ret
=
CommDlgExtendedError
();
todo_wine
ok
(
!
ret
,
"CommDlgExtendedError returned %#x, should be 0
\n
"
,
ret
);
todo_wine
ok
(
!
ret
,
"CommDlgExtendedError returned %#
l
x, should be 0
\n
"
,
ret
);
todo_wine
ok
(
ofnA
.
nFileOffset
!=
0xdead
,
"ofnA.nFileOffset is 0xdead
\n
"
);
todo_wine
ok
(
ofnA
.
nFileExtension
!=
0xbeef
,
"ofnA.nFileExtension is 0xbeef
\n
"
);
...
...
@@ -1180,9 +1180,9 @@ static void test_null_filename(void)
ofnA
.
nFileOffset
=
0xdead
;
ofnA
.
nFileExtension
=
0xbeef
;
ret
=
GetOpenFileNameA
(
&
ofnA
);
ok
(
ret
,
"GetOpenFileNameA returned %#x
\n
"
,
ret
);
ok
(
ret
,
"GetOpenFileNameA returned %#
l
x
\n
"
,
ret
);
ret
=
CommDlgExtendedError
();
ok
(
!
ret
,
"CommDlgExtendedError returned %#x
\n
"
,
ret
);
ok
(
!
ret
,
"CommDlgExtendedError returned %#
l
x
\n
"
,
ret
);
ok
(
ofnA
.
nFileOffset
!=
0xdead
,
"ofnA.nFileOffset is 0xdead
\n
"
);
ok
(
ofnA
.
nFileExtension
==
0
,
"ofnA.nFileExtension is 0x%x, should be 0
\n
"
,
ofnA
.
nFileExtension
);
...
...
@@ -1199,9 +1199,9 @@ static void test_null_filename(void)
ofnW
.
lpstrFilter
=
filterW
;
ofnW
.
lpstrDefExt
=
NULL
;
ret
=
GetOpenFileNameW
(
&
ofnW
);
todo_wine
ok
(
ret
,
"GetOpenFileNameW returned %#x
\n
"
,
ret
);
todo_wine
ok
(
ret
,
"GetOpenFileNameW returned %#
l
x
\n
"
,
ret
);
ret
=
CommDlgExtendedError
();
todo_wine
ok
(
!
ret
,
"CommDlgExtendedError returned %#x
\n
"
,
ret
);
todo_wine
ok
(
!
ret
,
"CommDlgExtendedError returned %#
l
x
\n
"
,
ret
);
todo_wine
ok
(
ofnW
.
nFileOffset
!=
0xdead
,
"ofnW.nFileOffset is 0xdead
\n
"
);
todo_wine
ok
(
ofnW
.
nFileExtension
!=
0xbeef
,
"ofnW.nFileExtension is 0xbeef
\n
"
);
...
...
@@ -1211,9 +1211,9 @@ static void test_null_filename(void)
ofnW
.
nFileOffset
=
0xdead
;
ofnW
.
nFileExtension
=
0xbeef
;
ret
=
GetOpenFileNameW
(
&
ofnW
);
ok
(
ret
,
"GetOpenFileNameA returned %#x
\n
"
,
ret
);
ok
(
ret
,
"GetOpenFileNameA returned %#
l
x
\n
"
,
ret
);
ret
=
CommDlgExtendedError
();
ok
(
!
ret
,
"CommDlgExtendedError returned %#x
\n
"
,
ret
);
ok
(
!
ret
,
"CommDlgExtendedError returned %#
l
x
\n
"
,
ret
);
ok
(
ofnW
.
nFileOffset
!=
0xdead
,
"ofnW.nFileOffset is 0xdead
\n
"
);
ok
(
ofnW
.
nFileExtension
==
0
,
"ofnW.nFileExtension is 0x%x, should be 0
\n
"
,
ofnW
.
nFileExtension
);
...
...
@@ -1244,7 +1244,7 @@ static void test_directory_filename(void)
ofnA
.
lpstrFilter
=
"text
\0
*.txt
\0
All
\0
*
\0\0
"
;
ofnA
.
lpstrDefExt
=
NULL
;
ret
=
GetOpenFileNameA
(
&
ofnA
);
todo_wine
ok
(
!
ret
,
"GetOpenFileNameA returned %#x
\n
"
,
ret
);
todo_wine
ok
(
!
ret
,
"GetOpenFileNameA returned %#
l
x
\n
"
,
ret
);
/* unicode tests */
ofnW
.
lStructSize
=
OPENFILENAME_SIZE_VERSION_400W
;
...
...
@@ -1256,7 +1256,7 @@ static void test_directory_filename(void)
ofnW
.
lpstrFilter
=
filterW
;
ofnW
.
lpstrDefExt
=
NULL
;
ret
=
GetOpenFileNameW
(
&
ofnW
);
todo_wine
ok
(
!
ret
,
"GetOpenFileNameW returned %#x
\n
"
,
ret
);
todo_wine
ok
(
!
ret
,
"GetOpenFileNameW returned %#
l
x
\n
"
,
ret
);
}
static
UINT_PTR
WINAPI
test_ole_init_wndproc
(
HWND
dlg
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
...
...
@@ -1264,7 +1264,7 @@ static UINT_PTR WINAPI test_ole_init_wndproc(HWND dlg, UINT msg, WPARAM wParam,
HRESULT
hr
;
hr
=
OleInitialize
(
NULL
);
ok
(
hr
==
S_FALSE
,
"OleInitialize() returned %#x
\n
"
,
hr
);
ok
(
hr
==
S_FALSE
,
"OleInitialize() returned %#
l
x
\n
"
,
hr
);
OleUninitialize
();
if
(
msg
==
WM_NOTIFY
)
...
...
@@ -1291,7 +1291,7 @@ static LRESULT CALLBACK hook_proc(int code, WPARAM wp, LPARAM lp)
hr
=
OleInitialize
(
NULL
);
ok
((
first_dlg
?
hr
==
S_OK
:
hr
==
S_FALSE
)
||
broken
(
first_dlg
&&
hr
==
S_FALSE
),
"OleInitialize() returned %#x (first dialog %#x)
\n
"
,
hr
,
first_dlg
);
"OleInitialize() returned %#
l
x (first dialog %#x)
\n
"
,
hr
,
first_dlg
);
OleUninitialize
();
first_dlg
=
FALSE
;
}
...
...
@@ -1320,7 +1320,7 @@ static void test_ole_initialization(void)
ok
(
!
ret
,
"GetOpenFileNameA returned %#x
\n
"
,
ret
);
hr
=
OleInitialize
(
NULL
);
ok
(
hr
==
S_OK
,
"OleInitialize() returned %#x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"OleInitialize() returned %#
l
x
\n
"
,
hr
);
OleUninitialize
();
UnhookWindowsHookEx
(
hook
);
...
...
dlls/comdlg32/tests/finddlg.c
View file @
e240aeb7
...
...
@@ -58,7 +58,7 @@ static void test_param_check(void)
ok(is_ok, "%s should%s fail\n", #FUNC, FAIL ? "" : "n't"); \
if (FAIL && is_ok) { \
DWORD ext_err = CommDlgExtendedError(); \
ok(ext_err == ERR_CODE, "expected err %x got %x\n", \
ok(ext_err == ERR_CODE, "expected err %x got %
l
x\n", \
ERR_CODE, ext_err); \
} else { \
DestroyWindow(hwnd); \
...
...
dlls/comdlg32/tests/fontdlg.c
View file @
e240aeb7
...
...
@@ -108,8 +108,8 @@ static void test_ChooseFontA(void)
ok
(
ret
==
TRUE
,
"ChooseFontA returned FALSE
\n
"
);
ok
(
cfa
.
iPointSize
==
expected_pointsize
,
"Expected %i, got %i
\n
"
,
expected_pointsize
,
cfa
.
iPointSize
);
ok
(
lfa
.
lfHeight
==
expected_lfheight
,
"Expected %i, got %i
\n
"
,
expected_lfheight
,
lfa
.
lfHeight
);
ok
(
lfa
.
lfWeight
==
FW_NORMAL
,
"Expected FW_NORMAL, got %i
\n
"
,
lfa
.
lfWeight
);
ok
(
lfa
.
lfHeight
==
expected_lfheight
,
"Expected %i, got %
l
i
\n
"
,
expected_lfheight
,
lfa
.
lfHeight
);
ok
(
lfa
.
lfWeight
==
FW_NORMAL
,
"Expected FW_NORMAL, got %
l
i
\n
"
,
lfa
.
lfWeight
);
ok
(
lfa
.
lfCharSet
==
SYMBOL_CHARSET
,
"Expected SYMBOL_CHARSET, got %i
\n
"
,
lfa
.
lfCharSet
);
ok
(
strcmp
(
lfa
.
lfFaceName
,
"Symbol"
)
==
0
,
"Expected Symbol, got %s
\n
"
,
lfa
.
lfFaceName
);
...
...
@@ -142,8 +142,8 @@ static void test_ChooseFontA(void)
ok
(
ret
==
TRUE
,
"ChooseFontA returned FALSE
\n
"
);
ok
(
cfa
.
iPointSize
==
expected_pointsize
,
"Expected %i, got %i
\n
"
,
expected_pointsize
,
cfa
.
iPointSize
);
ok
(
lfa
.
lfHeight
==
expected_lfheight
,
"Expected %i, got %i
\n
"
,
expected_lfheight
,
lfa
.
lfHeight
);
ok
(
lfa
.
lfWeight
==
FW_NORMAL
,
"Expected FW_NORMAL, got %i
\n
"
,
lfa
.
lfWeight
);
ok
(
lfa
.
lfHeight
==
expected_lfheight
,
"Expected %i, got %
l
i
\n
"
,
expected_lfheight
,
lfa
.
lfHeight
);
ok
(
lfa
.
lfWeight
==
FW_NORMAL
,
"Expected FW_NORMAL, got %
l
i
\n
"
,
lfa
.
lfWeight
);
ok
((
strcmp
(
lfa
.
lfFaceName
,
"Symbol"
)
==
0
)
||
broken
(
*
lfa
.
lfFaceName
==
0
),
"Expected Symbol, got %s
\n
"
,
lfa
.
lfFaceName
);
...
...
dlls/comdlg32/tests/itemdlg.c
View file @
e240aeb7
...
...
@@ -96,10 +96,10 @@ static HWND get_hwnd_from_ifiledialog(IFileDialog *pfd)
HRESULT
hr
;
hr
=
IFileDialog_QueryInterface
(
pfd
,
&
IID_IOleWindow
,
(
void
**
)
&
pow
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got 0x%08
l
x
\n
"
,
hr
);
hr
=
IOleWindow_GetWindow
(
pow
,
&
dlg_hwnd
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got 0x%08
l
x
\n
"
,
hr
);
IOleWindow_Release
(
pow
);
...
...
@@ -213,7 +213,7 @@ static HRESULT WINAPI IFileDialogEvents_fnOnFolderChange(IFileDialogEvents *ifac
ok
(
dlg_hwnd
!=
NULL
,
"Got NULL.
\n
"
);
hr
=
IFileDialog_SetFileName
(
pfd
,
This
->
set_filename
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got 0x%08
l
x
\n
"
,
hr
);
if
(
!
This
->
set_filename_tried
)
{
...
...
@@ -290,7 +290,7 @@ static HRESULT WINAPI IFileDialogEvents_fnOnOverwrite(IFileDialogEvents *iface,
This
->
OnOverwrite
++
;
ok
(
*
pResponse
==
FDEOR_DEFAULT
,
"overwrite response %u
\n
"
,
*
pResponse
);
*
pResponse
=
FDEOR_ACCEPT
;
ok
(
!
This
->
OnFileOk
,
"OnFileOk already called %u times
\n
"
,
This
->
OnFileOk
);
ok
(
!
This
->
OnFileOk
,
"OnFileOk already called %
l
u times
\n
"
,
This
->
OnFileOk
);
return
S_OK
;
}
...
...
@@ -337,88 +337,88 @@ static BOOL test_instantiation(void)
win_skip
(
"Could not instantiate the FileOpenDialog.
\n
"
);
return
FALSE
;
}
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileOpenDialog_QueryInterface
(
pfod
,
&
IID_IFileDialog
,
(
void
**
)
&
pfd
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
IFileDialog_Release
(
pfd
);
hr
=
IFileOpenDialog_QueryInterface
(
pfod
,
&
IID_IFileDialogCustomize
,
(
void
**
)
&
punk
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileOpenDialog_QueryInterface
(
pfod
,
&
IID_IFileDialogCustomizeAlt
,
(
void
**
)
&
unk2
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
punk
==
unk2
,
"got %p, %p
\n
"
,
punk
,
unk2
);
IUnknown_Release
(
punk
);
IUnknown_Release
(
unk2
);
hr
=
IFileOpenDialog_QueryInterface
(
pfod
,
&
IID_IFileSaveDialog
,
(
void
**
)
&
pfsd
);
ok
(
hr
==
E_NOINTERFACE
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_NOINTERFACE
,
"got 0x%08
l
x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
IFileSaveDialog_Release
(
pfsd
);
hr
=
IFileOpenDialog_QueryInterface
(
pfod
,
&
IID_IServiceProvider
,
(
void
**
)
&
psp
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
IExplorerBrowser
*
peb
;
IShellBrowser
*
psb
;
hr
=
IServiceProvider_QueryService
(
psp
,
&
SID_SExplorerBrowserFrame
,
&
IID_ICommDlgBrowser
,
(
void
**
)
&
punk
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
IUnknown_Release
(
punk
);
/* since win8, the result is E_NOTIMPL for all other services */
hr
=
IServiceProvider_QueryService
(
psp
,
&
SID_STopLevelBrowser
,
&
IID_IExplorerBrowser
,
(
void
**
)
&
peb
);
ok
(
hr
==
E_NOTIMPL
||
broken
(
hr
==
E_FAIL
),
"got 0x%08x (expected E_NOTIMPL)
\n
"
,
hr
);
ok
(
hr
==
E_NOTIMPL
||
broken
(
hr
==
E_FAIL
),
"got 0x%08
l
x (expected E_NOTIMPL)
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
IExplorerBrowser_Release
(
peb
);
hr
=
IServiceProvider_QueryService
(
psp
,
&
SID_STopLevelBrowser
,
&
IID_IShellBrowser
,
(
void
**
)
&
psb
);
ok
(
hr
==
E_NOTIMPL
||
broken
(
hr
==
E_FAIL
),
"got 0x%08x (expected E_NOTIMPL)
\n
"
,
hr
);
ok
(
hr
==
E_NOTIMPL
||
broken
(
hr
==
E_FAIL
),
"got 0x%08
l
x (expected E_NOTIMPL)
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
IShellBrowser_Release
(
psb
);
hr
=
IServiceProvider_QueryService
(
psp
,
&
SID_STopLevelBrowser
,
&
IID_ICommDlgBrowser
,
(
void
**
)
&
punk
);
ok
(
hr
==
E_NOTIMPL
||
broken
(
hr
==
E_FAIL
),
"got 0x%08x (expected E_NOTIMPL)
\n
"
,
hr
);
ok
(
hr
==
E_NOTIMPL
||
broken
(
hr
==
E_FAIL
),
"got 0x%08
l
x (expected E_NOTIMPL)
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
IUnknown_Release
(
punk
);
hr
=
IServiceProvider_QueryService
(
psp
,
&
SID_STopLevelBrowser
,
&
IID_IUnknown
,
(
void
**
)
&
punk
);
ok
(
hr
==
E_NOTIMPL
||
broken
(
hr
==
E_FAIL
),
"got 0x%08x (expected E_NOTIMPL)
\n
"
,
hr
);
ok
(
hr
==
E_NOTIMPL
||
broken
(
hr
==
E_FAIL
),
"got 0x%08
l
x (expected E_NOTIMPL)
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
IUnknown_Release
(
punk
);
hr
=
IServiceProvider_QueryService
(
psp
,
&
IID_IUnknown
,
&
IID_IUnknown
,
(
void
**
)
&
punk
);
ok
(
hr
==
E_NOTIMPL
||
broken
(
hr
==
E_FAIL
),
"got 0x%08x (expected E_NOTIMPL)
\n
"
,
hr
);
ok
(
hr
==
E_NOTIMPL
||
broken
(
hr
==
E_FAIL
),
"got 0x%08
l
x (expected E_NOTIMPL)
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
IUnknown_Release
(
punk
);
IServiceProvider_Release
(
psp
);
}
hr
=
IFileOpenDialog_QueryInterface
(
pfod
,
&
IID_IFileDialogEvents
,
(
void
**
)
&
punk
);
ok
(
hr
==
E_NOINTERFACE
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_NOINTERFACE
,
"got 0x%08
l
x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
IUnknown_Release
(
punk
);
hr
=
IFileOpenDialog_QueryInterface
(
pfod
,
&
IID_IExplorerBrowser
,
(
void
**
)
&
punk
);
ok
(
hr
==
E_NOINTERFACE
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_NOINTERFACE
,
"got 0x%08
l
x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
IUnknown_Release
(
punk
);
hr
=
IFileOpenDialog_QueryInterface
(
pfod
,
&
IID_IExplorerBrowserEvents
,
(
void
**
)
&
punk
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
IUnknown_Release
(
punk
);
hr
=
IFileOpenDialog_QueryInterface
(
pfod
,
&
IID_ICommDlgBrowser3
,
(
void
**
)
&
punk
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
IUnknown_Release
(
punk
);
hr
=
IFileOpenDialog_QueryInterface
(
pfod
,
&
IID_IShellBrowser
,
(
void
**
)
&
punk
);
ok
(
hr
==
E_NOINTERFACE
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_NOINTERFACE
,
"got 0x%08
l
x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
IUnknown_Release
(
punk
);
hr
=
IFileOpenDialog_QueryInterface
(
pfod
,
&
IID_IOleWindow
,
(
void
**
)
&
pow
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
HWND
hwnd
;
hr
=
IOleWindow_ContextSensitiveHelp
(
pow
,
TRUE
);
todo_wine
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
hr
==
S_OK
,
"Got 0x%08
l
x
\n
"
,
hr
);
hr
=
IOleWindow_ContextSensitiveHelp
(
pow
,
FALSE
);
todo_wine
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
hr
==
S_OK
,
"Got 0x%08
l
x
\n
"
,
hr
);
if
(
0
)
{
...
...
@@ -427,14 +427,14 @@ static BOOL test_instantiation(void)
}
hr
=
IOleWindow_GetWindow
(
pow
,
&
hwnd
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got 0x%08
l
x
\n
"
,
hr
);
ok
(
hwnd
==
NULL
,
"Got %p
\n
"
,
hwnd
);
IOleWindow_Release
(
pow
);
}
ref
=
IFileOpenDialog_Release
(
pfod
);
ok
(
!
ref
,
"Got refcount %d, should have been released.
\n
"
,
ref
);
ok
(
!
ref
,
"Got refcount %
l
d, should have been released.
\n
"
,
ref
);
/* Instantiate FileSaveDialog */
hr
=
CoCreateInstance
(
&
CLSID_FileSaveDialog
,
NULL
,
CLSCTX_INPROC_SERVER
,
...
...
@@ -444,56 +444,56 @@ static BOOL test_instantiation(void)
win_skip
(
"Could not instantiate the FileSaveDialog.
\n
"
);
return
FALSE
;
}
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileSaveDialog_QueryInterface
(
pfsd
,
&
IID_IFileDialog
,
(
void
**
)
&
pfd
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
IFileDialog_Release
(
pfd
);
hr
=
IFileSaveDialog_QueryInterface
(
pfsd
,
&
IID_IFileDialogCustomize
,
(
void
**
)
&
punk
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileSaveDialog_QueryInterface
(
pfsd
,
&
IID_IFileDialogCustomizeAlt
,
(
void
**
)
&
unk2
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
punk
==
unk2
,
"got %p, %p
\n
"
,
punk
,
unk2
);
IUnknown_Release
(
punk
);
IUnknown_Release
(
unk2
);
hr
=
IFileSaveDialog_QueryInterface
(
pfsd
,
&
IID_IFileOpenDialog
,
(
void
**
)
&
pfod
);
ok
(
hr
==
E_NOINTERFACE
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_NOINTERFACE
,
"got 0x%08
l
x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
IFileOpenDialog_Release
(
pfod
);
hr
=
IFileSaveDialog_QueryInterface
(
pfsd
,
&
IID_IFileDialogEvents
,
(
void
**
)
&
punk
);
ok
(
hr
==
E_NOINTERFACE
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_NOINTERFACE
,
"got 0x%08
l
x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
IFileDialog_Release
(
pfd
);
hr
=
IFileSaveDialog_QueryInterface
(
pfsd
,
&
IID_IExplorerBrowser
,
(
void
**
)
&
punk
);
ok
(
hr
==
E_NOINTERFACE
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_NOINTERFACE
,
"got 0x%08
l
x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
IUnknown_Release
(
punk
);
hr
=
IFileSaveDialog_QueryInterface
(
pfsd
,
&
IID_IExplorerBrowserEvents
,
(
void
**
)
&
punk
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
IUnknown_Release
(
punk
);
hr
=
IFileSaveDialog_QueryInterface
(
pfsd
,
&
IID_ICommDlgBrowser3
,
(
void
**
)
&
punk
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
IUnknown_Release
(
punk
);
hr
=
IFileSaveDialog_QueryInterface
(
pfsd
,
&
IID_IShellBrowser
,
(
void
**
)
&
punk
);
ok
(
hr
==
E_NOINTERFACE
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_NOINTERFACE
,
"got 0x%08
l
x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
IUnknown_Release
(
punk
);
hr
=
IFileSaveDialog_QueryInterface
(
pfsd
,
&
IID_IOleWindow
,
(
void
**
)
&
pow
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
HWND
hwnd
;
hr
=
IOleWindow_ContextSensitiveHelp
(
pow
,
TRUE
);
todo_wine
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
hr
==
S_OK
,
"Got 0x%08
l
x
\n
"
,
hr
);
hr
=
IOleWindow_ContextSensitiveHelp
(
pow
,
FALSE
);
todo_wine
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
hr
==
S_OK
,
"Got 0x%08
l
x
\n
"
,
hr
);
if
(
0
)
{
...
...
@@ -502,7 +502,7 @@ static BOOL test_instantiation(void)
}
hr
=
IOleWindow_GetWindow
(
pow
,
&
hwnd
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got 0x%08
l
x
\n
"
,
hr
);
ok
(
hwnd
==
NULL
,
"Got %p
\n
"
,
hwnd
);
IOleWindow_Release
(
pow
);
...
...
@@ -510,7 +510,7 @@ static BOOL test_instantiation(void)
ref
=
IFileSaveDialog_Release
(
pfsd
);
ok
(
!
ref
,
"Got refcount %d, should have been released.
\n
"
,
ref
);
ok
(
!
ref
,
"Got refcount %
l
d, should have been released.
\n
"
,
ref
);
return
TRUE
;
}
...
...
@@ -558,205 +558,205 @@ static void test_basics(void)
/* Instantiate FileOpenDialog and FileSaveDialog */
hr
=
CoCreateInstance
(
&
CLSID_FileOpenDialog
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IFileOpenDialog
,
(
void
**
)
&
pfod
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
CoCreateInstance
(
&
CLSID_FileSaveDialog
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IFileSaveDialog
,
(
void
**
)
&
pfsd
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
/* ClearClientData */
todo_wine
{
hr
=
IFileOpenDialog_ClearClientData
(
pfod
);
ok
(
hr
==
E_FAIL
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_FAIL
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileSaveDialog_ClearClientData
(
pfsd
);
ok
(
hr
==
E_FAIL
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_FAIL
,
"got 0x%08
l
x.
\n
"
,
hr
);
}
/* GetOptions */
hr
=
IFileOpenDialog_GetOptions
(
pfod
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileSaveDialog_GetOptions
(
pfsd
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08
l
x.
\n
"
,
hr
);
/* Check default options */
hr
=
IFileOpenDialog_GetOptions
(
pfod
,
&
fdoptions
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
fdoptions
==
(
FOS_PATHMUSTEXIST
|
FOS_FILEMUSTEXIST
|
FOS_NOCHANGEDIR
),
"Unexpected default options: 0x%08x
\n
"
,
fdoptions
);
"Unexpected default options: 0x%08
l
x
\n
"
,
fdoptions
);
hr
=
IFileSaveDialog_GetOptions
(
pfsd
,
&
fdoptions
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
fdoptions
==
(
FOS_OVERWRITEPROMPT
|
FOS_NOREADONLYRETURN
|
FOS_PATHMUSTEXIST
|
FOS_NOCHANGEDIR
),
"Unexpected default options: 0x%08x
\n
"
,
fdoptions
);
"Unexpected default options: 0x%08
l
x
\n
"
,
fdoptions
);
/* Check SetOptions invalid options handling */
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
invalid_fos
);
i
++
)
{
hr
=
IFileOpenDialog_SetOptions
(
pfod
,
invalid_fos
[
i
]);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileOpenDialog_GetOptions
(
pfod
,
&
fdoptions
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
fdoptions
==
(
FOS_PATHMUSTEXIST
|
FOS_FILEMUSTEXIST
|
FOS_NOCHANGEDIR
),
"got %08x
\n
"
,
fdoptions
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
fdoptions
==
(
FOS_PATHMUSTEXIST
|
FOS_FILEMUSTEXIST
|
FOS_NOCHANGEDIR
),
"got %08
l
x
\n
"
,
fdoptions
);
hr
=
IFileSaveDialog_SetOptions
(
pfsd
,
invalid_fos
[
i
]);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileSaveDialog_GetOptions
(
pfsd
,
&
fdoptions
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
fdoptions
==
(
FOS_OVERWRITEPROMPT
|
FOS_NOREADONLYRETURN
|
FOS_PATHMUSTEXIST
|
FOS_NOCHANGEDIR
),
"got %08x
\n
"
,
fdoptions
);
"got %08
l
x
\n
"
,
fdoptions
);
}
/* GetResult */
hr
=
IFileOpenDialog_GetResult
(
pfod
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileSaveDialog_GetResult
(
pfsd
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08
l
x.
\n
"
,
hr
);
psi
=
(
void
*
)
0xdeadbeef
;
hr
=
IFileOpenDialog_GetResult
(
pfod
,
&
psi
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
psi
==
(
void
*
)
0xdeadbeef
,
"got %p.
\n
"
,
psi
);
psi
=
(
void
*
)
0xdeadbeef
;
hr
=
IFileSaveDialog_GetResult
(
pfsd
,
&
psi
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
psi
==
(
void
*
)
0xdeadbeef
,
"got %p.
\n
"
,
psi
);
/* GetCurrentSelection */
if
(
0
)
{
/* Crashes on Vista/W2K8. Tests below passes on Windows 7 */
hr
=
IFileOpenDialog_GetCurrentSelection
(
pfod
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileSaveDialog_GetCurrentSelection
(
pfsd
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileOpenDialog_GetCurrentSelection
(
pfod
,
&
psi
);
ok
(
hr
==
E_FAIL
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_FAIL
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileSaveDialog_GetCurrentSelection
(
pfsd
,
&
psi
);
ok
(
hr
==
E_FAIL
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_FAIL
,
"got 0x%08
l
x.
\n
"
,
hr
);
}
/* GetFileName */
hr
=
IFileOpenDialog_GetFileName
(
pfod
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08
l
x.
\n
"
,
hr
);
filename
=
(
void
*
)
0xdeadbeef
;
hr
=
IFileOpenDialog_GetFileName
(
pfod
,
&
filename
);
ok
(
hr
==
E_FAIL
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_FAIL
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
filename
==
NULL
,
"got %p
\n
"
,
filename
);
hr
=
IFileSaveDialog_GetFileName
(
pfsd
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08
l
x.
\n
"
,
hr
);
filename
=
(
void
*
)
0xdeadbeef
;
hr
=
IFileSaveDialog_GetFileName
(
pfsd
,
&
filename
);
ok
(
hr
==
E_FAIL
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_FAIL
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
filename
==
NULL
,
"got %p
\n
"
,
filename
);
/* GetFileTypeIndex */
hr
=
IFileOpenDialog_GetFileTypeIndex
(
pfod
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08
l
x.
\n
"
,
hr
);
filetype
=
0x12345
;
hr
=
IFileOpenDialog_GetFileTypeIndex
(
pfod
,
&
filetype
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
filetype
==
0
,
"got %d.
\n
"
,
filetype
);
hr
=
IFileSaveDialog_GetFileTypeIndex
(
pfsd
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08
l
x.
\n
"
,
hr
);
filetype
=
0x12345
;
hr
=
IFileSaveDialog_GetFileTypeIndex
(
pfsd
,
&
filetype
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
filetype
==
0
,
"got %d.
\n
"
,
filetype
);
/* SetFileTypes / SetFileTypeIndex */
hr
=
IFileOpenDialog_SetFileTypes
(
pfod
,
0
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileOpenDialog_SetFileTypes
(
pfod
,
0
,
filterspec
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileOpenDialog_SetFileTypeIndex
(
pfod
,
0
);
ok
(
hr
==
E_FAIL
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_FAIL
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileOpenDialog_SetFileTypeIndex
(
pfod
,
1
);
ok
(
hr
==
E_FAIL
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_FAIL
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileOpenDialog_SetFileTypes
(
pfod
,
1
,
filterspec
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileOpenDialog_SetFileTypes
(
pfod
,
0
,
filterspec
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileOpenDialog_SetFileTypes
(
pfod
,
0
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileOpenDialog_SetFileTypeIndex
(
pfod
,
0
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileOpenDialog_GetFileTypeIndex
(
pfod
,
&
filetype
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
filetype
==
1
,
"got %d
\n
"
,
filetype
);
hr
=
IFileOpenDialog_SetFileTypeIndex
(
pfod
,
100
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileOpenDialog_GetFileTypeIndex
(
pfod
,
&
filetype
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
filetype
==
1
,
"got %d
\n
"
,
filetype
);
hr
=
IFileOpenDialog_SetFileTypes
(
pfod
,
1
,
filterspec
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileOpenDialog_SetFileTypes
(
pfod
,
1
,
&
filterspec
[
1
]);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileSaveDialog_SetFileTypeIndex
(
pfsd
,
0
);
ok
(
hr
==
E_FAIL
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_FAIL
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileSaveDialog_SetFileTypeIndex
(
pfsd
,
1
);
ok
(
hr
==
E_FAIL
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_FAIL
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileSaveDialog_SetFileTypes
(
pfsd
,
2
,
filterspec
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileSaveDialog_GetFileTypeIndex
(
pfsd
,
&
filetype
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
/* I hope no one relies on this one */
todo_wine
ok
(
filetype
==
0
,
"got %d
\n
"
,
filetype
);
hr
=
IFileSaveDialog_SetFileTypeIndex
(
pfsd
,
0
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileSaveDialog_GetFileTypeIndex
(
pfsd
,
&
filetype
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
filetype
==
1
,
"got %d
\n
"
,
filetype
);
hr
=
IFileSaveDialog_SetFileTypeIndex
(
pfsd
,
100
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileSaveDialog_GetFileTypeIndex
(
pfsd
,
&
filetype
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
filetype
==
2
,
"got %d
\n
"
,
filetype
);
hr
=
IFileSaveDialog_SetFileTypes
(
pfsd
,
1
,
filterspec
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileSaveDialog_SetFileTypes
(
pfsd
,
1
,
&
filterspec
[
1
]);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08
l
x.
\n
"
,
hr
);
/* SetFilter */
todo_wine
{
hr
=
IFileOpenDialog_SetFilter
(
pfod
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileSaveDialog_SetFilter
(
pfsd
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
}
/* SetFolder */
hr
=
IFileOpenDialog_SetFolder
(
pfod
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileSaveDialog_SetFolder
(
pfsd
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
/* SetDefaultExtension */
hr
=
IFileOpenDialog_SetDefaultExtension
(
pfod
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileOpenDialog_SetDefaultExtension
(
pfod
,
txt
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileOpenDialog_SetDefaultExtension
(
pfod
,
null
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileSaveDialog_SetDefaultExtension
(
pfsd
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileSaveDialog_SetDefaultExtension
(
pfsd
,
txt
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileSaveDialog_SetDefaultExtension
(
pfsd
,
null
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
/* SetDefaultFolder */
hr
=
IFileOpenDialog_SetDefaultFolder
(
pfod
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileSaveDialog_SetDefaultFolder
(
pfsd
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileOpenDialog_SetDefaultFolder
(
pfod
,
psidesktop
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileSaveDialog_SetDefaultFolder
(
pfsd
,
psidesktop
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
if
(
0
)
{
...
...
@@ -767,27 +767,27 @@ static void test_basics(void)
/* GetFolder / SetFolder */
hr
=
IFileOpenDialog_GetFolder
(
pfod
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileOpenDialog_GetFolder
(
pfod
,
&
psi_original
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IFileOpenDialog_SetFolder
(
pfod
,
psidesktop
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileOpenDialog_SetFolder
(
pfod
,
psi_original
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
IShellItem_Release
(
psi_original
);
}
hr
=
IFileSaveDialog_GetFolder
(
pfsd
,
&
psi_original
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IFileSaveDialog_SetFolder
(
pfsd
,
psidesktop
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileSaveDialog_SetFolder
(
pfsd
,
psi_original
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
IShellItem_Release
(
psi_original
);
}
...
...
@@ -800,105 +800,105 @@ static void test_basics(void)
}
hr
=
IFileOpenDialog_AddPlace
(
pfod
,
psidesktop
,
FDAP_TOP
+
1
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileOpenDialog_AddPlace
(
pfod
,
psidesktop
,
FDAP_BOTTOM
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileOpenDialog_AddPlace
(
pfod
,
psidesktop
,
FDAP_TOP
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileSaveDialog_AddPlace
(
pfsd
,
psidesktop
,
FDAP_TOP
+
1
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileSaveDialog_AddPlace
(
pfsd
,
psidesktop
,
FDAP_BOTTOM
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileSaveDialog_AddPlace
(
pfsd
,
psidesktop
,
FDAP_TOP
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
/* SetFileName */
hr
=
IFileOpenDialog_SetFileName
(
pfod
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileOpenDialog_SetFileName
(
pfod
,
null
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
filename
=
NULL
;
hr
=
IFileOpenDialog_GetFileName
(
pfod
,
&
filename
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got 0x%08
l
x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
filename
,
null
),
"Strings do not match.
\n
"
);
CoTaskMemFree
(
filename
);
hr
=
IFileOpenDialog_SetFileName
(
pfod
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
filename
=
(
void
*
)
0xdeadbeef
;
hr
=
IFileOpenDialog_GetFileName
(
pfod
,
&
filename
);
ok
(
hr
==
E_FAIL
,
"Got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
E_FAIL
,
"Got 0x%08
l
x
\n
"
,
hr
);
ok
(
filename
==
NULL
,
"got %p.
\n
"
,
filename
);
hr
=
IFileOpenDialog_SetFileName
(
pfod
,
txt
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileOpenDialog_GetFileName
(
pfod
,
&
filename
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got 0x%08
l
x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
filename
,
txt
),
"Strings do not match.
\n
"
);
CoTaskMemFree
(
filename
);
hr
=
IFileSaveDialog_SetFileName
(
pfsd
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileSaveDialog_SetFileName
(
pfsd
,
null
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileSaveDialog_SetFileName
(
pfsd
,
txt
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileSaveDialog_GetFileName
(
pfsd
,
&
filename
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got 0x%08
l
x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
filename
,
txt
),
"Strings do not match.
\n
"
);
CoTaskMemFree
(
filename
);
/* SetFileNameLabel */
hr
=
IFileOpenDialog_SetFileNameLabel
(
pfod
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileOpenDialog_SetFileNameLabel
(
pfod
,
null
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileOpenDialog_SetFileNameLabel
(
pfod
,
txt
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileSaveDialog_SetFileNameLabel
(
pfsd
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileSaveDialog_SetFileNameLabel
(
pfsd
,
null
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileSaveDialog_SetFileNameLabel
(
pfsd
,
txt
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
/* Close */
hr
=
IFileOpenDialog_Close
(
pfod
,
S_FALSE
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileSaveDialog_Close
(
pfsd
,
S_FALSE
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
/* SetOkButtonLabel */
hr
=
IFileOpenDialog_SetOkButtonLabel
(
pfod
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileOpenDialog_SetOkButtonLabel
(
pfod
,
null
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileOpenDialog_SetOkButtonLabel
(
pfod
,
txt
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileSaveDialog_SetOkButtonLabel
(
pfsd
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileSaveDialog_SetOkButtonLabel
(
pfsd
,
null
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileSaveDialog_SetOkButtonLabel
(
pfsd
,
txt
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
/* SetTitle */
hr
=
IFileOpenDialog_SetTitle
(
pfod
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileOpenDialog_SetTitle
(
pfod
,
null
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileOpenDialog_SetTitle
(
pfod
,
txt
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileSaveDialog_SetTitle
(
pfsd
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileSaveDialog_SetTitle
(
pfsd
,
null
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileSaveDialog_SetTitle
(
pfsd
,
txt
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
/** IFileOpenDialog specific **/
...
...
@@ -910,7 +910,7 @@ static void test_basics(void)
}
psia
=
(
void
*
)
0xdeadbeef
;
hr
=
IFileOpenDialog_GetResults
(
pfod
,
&
psia
);
ok
(
hr
==
E_FAIL
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_FAIL
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
psia
==
NULL
,
"got %p.
\n
"
,
psia
);
/* GetSelectedItems */
...
...
@@ -918,10 +918,10 @@ static void test_basics(void)
{
/* Crashes under W2K8 */
hr
=
IFileOpenDialog_GetSelectedItems
(
pfod
,
NULL
);
ok
(
hr
==
E_FAIL
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_FAIL
,
"got 0x%08
l
x.
\n
"
,
hr
);
psia
=
(
void
*
)
0xdeadbeef
;
hr
=
IFileOpenDialog_GetSelectedItems
(
pfod
,
&
psia
);
ok
(
hr
==
E_FAIL
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_FAIL
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
psia
==
(
void
*
)
0xdeadbeef
,
"got %p.
\n
"
,
psia
);
}
...
...
@@ -937,10 +937,10 @@ static void test_basics(void)
/* GetProperties */
hr
=
IFileSaveDialog_GetProperties
(
pfsd
,
NULL
);
todo_wine
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08
l
x
\n
"
,
hr
);
pps
=
(
void
*
)
0xdeadbeef
;
hr
=
IFileSaveDialog_GetProperties
(
pfsd
,
&
pps
);
todo_wine
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08
l
x
\n
"
,
hr
);
ok
(
pps
==
(
void
*
)
0xdeadbeef
,
"got %p
\n
"
,
pps
);
/* SetProperties */
...
...
@@ -948,72 +948,72 @@ static void test_basics(void)
{
/* Crashes under W2K8 */
hr
=
IFileSaveDialog_SetProperties
(
pfsd
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
}
/* SetCollectedProperties */
todo_wine
{
hr
=
IFileSaveDialog_SetCollectedProperties
(
pfsd
,
NULL
,
TRUE
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileSaveDialog_SetCollectedProperties
(
pfsd
,
NULL
,
FALSE
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
}
/* SetSaveAsItem */
todo_wine
{
hr
=
IFileSaveDialog_SetSaveAsItem
(
pfsd
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileSaveDialog_SetSaveAsItem
(
pfsd
,
psidesktop
);
ok
(
hr
==
MK_E_NOOBJECT
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
MK_E_NOOBJECT
,
"got 0x%08
l
x
\n
"
,
hr
);
}
/** IFileDialog2 **/
hr
=
IFileOpenDialog_QueryInterface
(
pfod
,
&
IID_IFileDialog2
,
(
void
**
)
&
pfd2
);
ok
((
hr
==
S_OK
)
||
broken
(
hr
==
E_NOINTERFACE
),
"got 0x%08x
\n
"
,
hr
);
ok
((
hr
==
S_OK
)
||
broken
(
hr
==
E_NOINTERFACE
),
"got 0x%08
l
x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
/* SetCancelButtonLabel */
hr
=
IFileDialog2_SetOkButtonLabel
(
pfd2
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileDialog2_SetOkButtonLabel
(
pfd2
,
null
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileDialog2_SetOkButtonLabel
(
pfd2
,
txt
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
/* SetNavigationRoot */
todo_wine
{
hr
=
IFileDialog2_SetNavigationRoot
(
pfd2
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileDialog2_SetNavigationRoot
(
pfd2
,
psidesktop
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
}
IFileDialog2_Release
(
pfd2
);
}
hr
=
IFileSaveDialog_QueryInterface
(
pfsd
,
&
IID_IFileDialog2
,
(
void
**
)
&
pfd2
);
ok
((
hr
==
S_OK
)
||
broken
(
hr
==
E_NOINTERFACE
),
"got 0x%08x
\n
"
,
hr
);
ok
((
hr
==
S_OK
)
||
broken
(
hr
==
E_NOINTERFACE
),
"got 0x%08
l
x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
/* SetCancelButtonLabel */
hr
=
IFileDialog2_SetOkButtonLabel
(
pfd2
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileDialog2_SetOkButtonLabel
(
pfd2
,
null
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileDialog2_SetOkButtonLabel
(
pfd2
,
txt
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
/* SetNavigationRoot */
todo_wine
{
hr
=
IFileDialog2_SetNavigationRoot
(
pfd2
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileDialog2_SetNavigationRoot
(
pfd2
,
psidesktop
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
}
IFileDialog2_Release
(
pfd2
);
...
...
@@ -1022,20 +1022,20 @@ static void test_basics(void)
/* Cleanup */
IShellItem_Release
(
psidesktop
);
ref
=
IFileOpenDialog_Release
(
pfod
);
ok
(
!
ref
,
"Got refcount %d, should have been released.
\n
"
,
ref
);
ok
(
!
ref
,
"Got refcount %
l
d, should have been released.
\n
"
,
ref
);
ref
=
IFileSaveDialog_Release
(
pfsd
);
ok
(
!
ref
,
"Got refcount %d, should have been released.
\n
"
,
ref
);
ok
(
!
ref
,
"Got refcount %
l
d, should have been released.
\n
"
,
ref
);
}
static
void
ensure_zero_events_
(
const
char
*
file
,
int
line
,
IFileDialogEventsImpl
*
impl
)
{
ok_
(
file
,
line
)(
!
impl
->
OnFileOk
,
"OnFileOk: %d
\n
"
,
impl
->
OnFileOk
);
ok_
(
file
,
line
)(
!
impl
->
OnFolderChanging
,
"OnFolderChanging: %d
\n
"
,
impl
->
OnFolderChanging
);
ok_
(
file
,
line
)(
!
impl
->
OnFolderChange
,
"OnFolderChange: %d
\n
"
,
impl
->
OnFolderChange
);
ok_
(
file
,
line
)(
!
impl
->
OnSelectionChange
,
"OnSelectionChange: %d
\n
"
,
impl
->
OnSelectionChange
);
ok_
(
file
,
line
)(
!
impl
->
OnShareViolation
,
"OnShareViolation: %d
\n
"
,
impl
->
OnShareViolation
);
ok_
(
file
,
line
)(
!
impl
->
OnTypeChange
,
"OnTypeChange: %d
\n
"
,
impl
->
OnTypeChange
);
ok_
(
file
,
line
)(
!
impl
->
OnOverwrite
,
"OnOverwrite: %d
\n
"
,
impl
->
OnOverwrite
);
ok_
(
file
,
line
)(
!
impl
->
OnFileOk
,
"OnFileOk: %
l
d
\n
"
,
impl
->
OnFileOk
);
ok_
(
file
,
line
)(
!
impl
->
OnFolderChanging
,
"OnFolderChanging: %
l
d
\n
"
,
impl
->
OnFolderChanging
);
ok_
(
file
,
line
)(
!
impl
->
OnFolderChange
,
"OnFolderChange: %
l
d
\n
"
,
impl
->
OnFolderChange
);
ok_
(
file
,
line
)(
!
impl
->
OnSelectionChange
,
"OnSelectionChange: %
l
d
\n
"
,
impl
->
OnSelectionChange
);
ok_
(
file
,
line
)(
!
impl
->
OnShareViolation
,
"OnShareViolation: %
l
d
\n
"
,
impl
->
OnShareViolation
);
ok_
(
file
,
line
)(
!
impl
->
OnTypeChange
,
"OnTypeChange: %
l
d
\n
"
,
impl
->
OnTypeChange
);
ok_
(
file
,
line
)(
!
impl
->
OnOverwrite
,
"OnOverwrite: %
l
d
\n
"
,
impl
->
OnOverwrite
);
impl
->
OnFileOk
=
impl
->
OnFolderChanging
=
impl
->
OnFolderChange
=
0
;
impl
->
OnSelectionChange
=
impl
->
OnShareViolation
=
impl
->
OnTypeChange
=
0
;
impl
->
OnOverwrite
=
0
;
...
...
@@ -1057,55 +1057,55 @@ static void test_advise_helper(IFileDialog *pfd)
if
(
0
)
{
hr
=
IFileDialog_Advise
(
pfd
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileDialog_Advise
(
pfd
,
pfde
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08
l
x
\n
"
,
hr
);
}
hr
=
IFileDialog_Advise
(
pfd
,
NULL
,
&
cookie
[
0
]);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
ok
(
pfdeimpl
->
ref
==
1
,
"got ref %d
\n
"
,
pfdeimpl
->
ref
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08
l
x
\n
"
,
hr
);
ok
(
pfdeimpl
->
ref
==
1
,
"got ref %
l
d
\n
"
,
pfdeimpl
->
ref
);
ensure_zero_events
(
pfdeimpl
);
hr
=
IFileDialog_Unadvise
(
pfd
,
0
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08
l
x
\n
"
,
hr
);
for
(
i
=
0
;
i
<
10
;
i
++
)
{
hr
=
IFileDialog_Advise
(
pfd
,
pfde
,
&
cookie
[
i
]);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
cookie
[
i
]
==
i
+
cookie
[
0
],
"Got cookie: %d
\n
"
,
cookie
[
i
]);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
ok
(
cookie
[
i
]
==
i
+
cookie
[
0
],
"Got cookie: %
l
d
\n
"
,
cookie
[
i
]);
}
ok
(
pfdeimpl
->
ref
==
10
+
1
,
"got ref %d
\n
"
,
pfdeimpl
->
ref
);
ok
(
pfdeimpl
->
ref
==
10
+
1
,
"got ref %
l
d
\n
"
,
pfdeimpl
->
ref
);
ensure_zero_events
(
pfdeimpl
);
for
(
i
=
3
;
i
<
7
;
i
++
)
{
hr
=
IFileDialog_Unadvise
(
pfd
,
cookie
[
i
]);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
}
ok
(
pfdeimpl
->
ref
==
6
+
1
,
"got ref %d
\n
"
,
pfdeimpl
->
ref
);
ok
(
pfdeimpl
->
ref
==
6
+
1
,
"got ref %
l
d
\n
"
,
pfdeimpl
->
ref
);
ensure_zero_events
(
pfdeimpl
);
for
(
i
=
0
;
i
<
3
;
i
++
)
{
hr
=
IFileDialog_Unadvise
(
pfd
,
cookie
[
i
]);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
}
ok
(
pfdeimpl
->
ref
==
3
+
1
,
"got ref %d
\n
"
,
pfdeimpl
->
ref
);
ok
(
pfdeimpl
->
ref
==
3
+
1
,
"got ref %
l
d
\n
"
,
pfdeimpl
->
ref
);
ensure_zero_events
(
pfdeimpl
);
for
(
i
=
7
;
i
<
10
;
i
++
)
{
hr
=
IFileDialog_Unadvise
(
pfd
,
cookie
[
i
]);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
}
ok
(
pfdeimpl
->
ref
==
1
,
"got ref %d
\n
"
,
pfdeimpl
->
ref
);
ok
(
pfdeimpl
->
ref
==
1
,
"got ref %
l
d
\n
"
,
pfdeimpl
->
ref
);
ensure_zero_events
(
pfdeimpl
);
hr
=
IFileDialog_Unadvise
(
pfd
,
cookie
[
9
]
+
1
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
ok
(
pfdeimpl
->
ref
==
1
,
"got ref %d
\n
"
,
pfdeimpl
->
ref
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08
l
x
\n
"
,
hr
);
ok
(
pfdeimpl
->
ref
==
1
,
"got ref %
l
d
\n
"
,
pfdeimpl
->
ref
);
ensure_zero_events
(
pfdeimpl
);
hr
=
IFileDialog_Advise
(
pfd
,
pfde
,
&
cookie
[
0
]);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
cookie
[
0
]
>=
1
,
"got cookie: %d
\n
"
,
cookie
[
0
]);
ok
(
pfdeimpl
->
ref
==
1
+
1
,
"got ref %d
\n
"
,
pfdeimpl
->
ref
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
ok
(
cookie
[
0
]
>=
1
,
"got cookie: %
l
d
\n
"
,
cookie
[
0
]);
ok
(
pfdeimpl
->
ref
==
1
+
1
,
"got ref %
l
d
\n
"
,
pfdeimpl
->
ref
);
ensure_zero_events
(
pfdeimpl
);
hr
=
IFileDialog_Unadvise
(
pfd
,
cookie
[
0
]);
...
...
@@ -1130,18 +1130,18 @@ static void test_advise(void)
trace
(
"Testing FileOpenDialog (advise)
\n
"
);
hr
=
CoCreateInstance
(
&
CLSID_FileOpenDialog
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IFileDialog
,
(
void
**
)
&
pfd
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
test_advise_helper
(
pfd
);
ref
=
IFileDialog_Release
(
pfd
);
ok
(
!
ref
,
"Got refcount %d, should have been released.
\n
"
,
ref
);
ok
(
!
ref
,
"Got refcount %
l
d, should have been released.
\n
"
,
ref
);
trace
(
"Testing FileSaveDialog (advise)
\n
"
);
hr
=
CoCreateInstance
(
&
CLSID_FileSaveDialog
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IFileDialog
,
(
void
**
)
&
pfd
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
test_advise_helper
(
pfd
);
ref
=
IFileDialog_Release
(
pfd
);
ok
(
!
ref
,
"Got refcount %d, should have been released.
\n
"
,
ref
);
ok
(
!
ref
,
"Got refcount %
l
d, should have been released.
\n
"
,
ref
);
}
static
void
filedialog_change_filetype
(
IFileDialog
*
pfd
,
HWND
dlg_hwnd
)
...
...
@@ -1191,35 +1191,35 @@ static void test_events(void)
*/
hr
=
CoCreateInstance
(
&
CLSID_FileOpenDialog
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IFileDialog
,
(
void
**
)
&
pfd
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
pfde
=
IFileDialogEvents_Constructor
();
pfdeimpl
=
impl_from_IFileDialogEvents
(
pfde
);
pfdeimpl
->
events_test
=
IFDEVENT_TEST2
;
hr
=
IFileDialog_Advise
(
pfd
,
pfde
,
&
cookie
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialog_Show
(
pfd
,
NULL
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_CANCELLED
),
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_CANCELLED
),
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
pfdeimpl
->
OnFolderChanging
==
1
,
"Got %d
\n
"
,
pfdeimpl
->
OnFolderChanging
);
ok
(
pfdeimpl
->
OnFolderChanging
==
1
,
"Got %
l
d
\n
"
,
pfdeimpl
->
OnFolderChanging
);
pfdeimpl
->
OnFolderChanging
=
0
;
ok
(
pfdeimpl
->
OnFolderChange
==
1
,
"Got %d
\n
"
,
pfdeimpl
->
OnFolderChange
);
ok
(
pfdeimpl
->
OnFolderChange
==
1
,
"Got %
l
d
\n
"
,
pfdeimpl
->
OnFolderChange
);
pfdeimpl
->
OnFolderChange
=
0
;
/* pfdeimpl->OnSelectionChange too unreliable to test. Can be 0, 1 or even 2. */
pfdeimpl
->
OnSelectionChange
=
0
;
ok
(
pfdeimpl
->
OnTypeChange
==
0
,
"Got %d
\n
"
,
pfdeimpl
->
OnTypeChange
);
ok
(
pfdeimpl
->
OnTypeChange
==
0
,
"Got %
l
d
\n
"
,
pfdeimpl
->
OnTypeChange
);
pfdeimpl
->
OnTypeChange
=
0
;
ensure_zero_events
(
pfdeimpl
);
hr
=
IFileDialog_Unadvise
(
pfd
,
cookie
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
IFileDialogEvents_Release
(
pfde
);
ref
=
IFileDialog_Release
(
pfd
);
ok
(
!
ref
||
broken
(
ref
/* win2008_64 (intermittently) */
),
"Got %d
\n
"
,
ref
);
ok
(
!
ref
||
broken
(
ref
/* win2008_64 (intermittently) */
),
"Got %
l
d
\n
"
,
ref
);
/*
...
...
@@ -1227,41 +1227,41 @@ static void test_events(void)
*/
hr
=
CoCreateInstance
(
&
CLSID_FileOpenDialog
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IFileDialog
,
(
void
**
)
&
pfd
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
pfde
=
IFileDialogEvents_Constructor
();
pfdeimpl
=
impl_from_IFileDialogEvents
(
pfde
);
pfdeimpl
->
events_test
=
IFDEVENT_TEST2
;
hr
=
IFileDialog_Advise
(
pfd
,
pfde
,
&
cookie
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialog_SetFileTypes
(
pfd
,
2
,
filterspec
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ensure_zero_events
(
pfdeimpl
);
hr
=
IFileDialog_Show
(
pfd
,
NULL
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_CANCELLED
),
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_CANCELLED
),
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
pfdeimpl
->
OnFolderChanging
==
1
,
"Got %d
\n
"
,
pfdeimpl
->
OnFolderChanging
);
ok
(
pfdeimpl
->
OnFolderChanging
==
1
,
"Got %
l
d
\n
"
,
pfdeimpl
->
OnFolderChanging
);
pfdeimpl
->
OnFolderChanging
=
0
;
ok
(
pfdeimpl
->
OnFolderChange
==
1
,
"Got %d
\n
"
,
pfdeimpl
->
OnFolderChange
);
ok
(
pfdeimpl
->
OnFolderChange
==
1
,
"Got %
l
d
\n
"
,
pfdeimpl
->
OnFolderChange
);
pfdeimpl
->
OnFolderChange
=
0
;
/* pfdeimpl->OnSelectionChange too unreliable to test. Can be 0, 1 or even 2. */
pfdeimpl
->
OnSelectionChange
=
0
;
/* Called once just by showing the dialog */
ok
(
pfdeimpl
->
OnTypeChange
==
1
,
"Got %d
\n
"
,
pfdeimpl
->
OnTypeChange
);
ok
(
pfdeimpl
->
OnTypeChange
==
1
,
"Got %
l
d
\n
"
,
pfdeimpl
->
OnTypeChange
);
pfdeimpl
->
OnTypeChange
=
0
;
ensure_zero_events
(
pfdeimpl
);
hr
=
IFileDialog_Unadvise
(
pfd
,
cookie
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
IFileDialogEvents_Release
(
pfde
);
ref
=
IFileDialog_Release
(
pfd
);
ok
(
!
ref
||
broken
(
ref
/* win2008_64 (intermittently) */
),
"Got %d
\n
"
,
ref
);
ok
(
!
ref
||
broken
(
ref
/* win2008_64 (intermittently) */
),
"Got %
l
d
\n
"
,
ref
);
/*
...
...
@@ -1269,41 +1269,41 @@ static void test_events(void)
*/
hr
=
CoCreateInstance
(
&
CLSID_FileOpenDialog
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IFileDialog
,
(
void
**
)
&
pfd
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
pfde
=
IFileDialogEvents_Constructor
();
pfdeimpl
=
impl_from_IFileDialogEvents
(
pfde
);
pfdeimpl
->
events_test
=
IFDEVENT_TEST3
;
hr
=
IFileDialog_Advise
(
pfd
,
pfde
,
&
cookie
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialog_SetFileTypes
(
pfd
,
2
,
filterspec
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ensure_zero_events
(
pfdeimpl
);
hr
=
IFileDialog_Show
(
pfd
,
NULL
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_CANCELLED
),
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_CANCELLED
),
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
pfdeimpl
->
OnFolderChanging
==
1
,
"Got %d
\n
"
,
pfdeimpl
->
OnFolderChanging
);
ok
(
pfdeimpl
->
OnFolderChanging
==
1
,
"Got %
l
d
\n
"
,
pfdeimpl
->
OnFolderChanging
);
pfdeimpl
->
OnFolderChanging
=
0
;
ok
(
pfdeimpl
->
OnFolderChange
==
1
,
"Got %d
\n
"
,
pfdeimpl
->
OnFolderChange
);
ok
(
pfdeimpl
->
OnFolderChange
==
1
,
"Got %
l
d
\n
"
,
pfdeimpl
->
OnFolderChange
);
pfdeimpl
->
OnFolderChange
=
0
;
/* pfdeimpl->OnSelectionChange too unreliable to test. Can be 0, 1 or even 2. */
pfdeimpl
->
OnSelectionChange
=
0
;
/* Called once by showing the dialog and once again when changing the filetype */
todo_wine
ok
(
pfdeimpl
->
OnTypeChange
==
2
,
"Got %d
\n
"
,
pfdeimpl
->
OnTypeChange
);
todo_wine
ok
(
pfdeimpl
->
OnTypeChange
==
2
,
"Got %
l
d
\n
"
,
pfdeimpl
->
OnTypeChange
);
pfdeimpl
->
OnTypeChange
=
0
;
ensure_zero_events
(
pfdeimpl
);
hr
=
IFileDialog_Unadvise
(
pfd
,
cookie
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
IFileDialogEvents_Release
(
pfde
);
ref
=
IFileDialog_Release
(
pfd
);
ok
(
!
ref
||
broken
(
ref
/* win2008_64 (intermittently) */
),
"Got %d
\n
"
,
ref
);
ok
(
!
ref
||
broken
(
ref
/* win2008_64 (intermittently) */
),
"Got %
l
d
\n
"
,
ref
);
}
static
void
touch_file
(
LPCWSTR
filename
)
...
...
@@ -1329,48 +1329,48 @@ static void test_filename_savedlg_(LPCWSTR set_filename, LPCWSTR defext,
hr
=
CoCreateInstance
(
&
CLSID_FileSaveDialog
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IFileSaveDialog
,
(
void
**
)
&
pfsd
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"Got 0x%08
l
x
\n
"
,
hr
);
if
(
fs_count
)
{
hr
=
IFileSaveDialog_SetFileTypes
(
pfsd
,
fs_count
,
filterspec
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"SetFileTypes failed: Got 0x%08x
\n
"
,
hr
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"SetFileTypes failed: Got 0x%08
l
x
\n
"
,
hr
);
}
if
(
defext
)
{
hr
=
IFileSaveDialog_SetDefaultExtension
(
pfsd
,
defext
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"SetDefaultExtensions failed: Got 0x%08x
\n
"
,
hr
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"SetDefaultExtensions failed: Got 0x%08
l
x
\n
"
,
hr
);
}
pfde
=
IFileDialogEvents_Constructor
();
pfdeimpl
=
impl_from_IFileDialogEvents
(
pfde
);
pfdeimpl
->
set_filename
=
set_filename
;
hr
=
IFileSaveDialog_Advise
(
pfsd
,
pfde
,
&
cookie
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"Advise failed: Got 0x%08x
\n
"
,
hr
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"Advise failed: Got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileSaveDialog_Show
(
pfsd
,
NULL
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"Show failed: Got 0x%08x
\n
"
,
hr
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"Show failed: Got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileSaveDialog_GetFileName
(
pfsd
,
&
filename
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"GetFileName failed: Got 0x%08x
\n
"
,
hr
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"GetFileName failed: Got 0x%08
l
x
\n
"
,
hr
);
ok_
(
file
,
line
)(
!
lstrcmpW
(
filename
,
set_filename
),
"Got %s
\n
"
,
wine_dbgstr_w
(
filename
));
CoTaskMemFree
(
filename
);
hr
=
IFileSaveDialog_GetResult
(
pfsd
,
&
psi
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"GetResult failed: Got 0x%08x
\n
"
,
hr
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"GetResult failed: Got 0x%08
l
x
\n
"
,
hr
);
hr
=
IShellItem_GetDisplayName
(
psi
,
SIGDN_PARENTRELATIVEPARSING
,
&
filename
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"GetDisplayName failed: Got 0x%08x
\n
"
,
hr
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"GetDisplayName failed: Got 0x%08
l
x
\n
"
,
hr
);
ok_
(
file
,
line
)(
!
lstrcmpW
(
filename
,
exp_filename
),
"(GetDisplayName) Got %s
\n
"
,
wine_dbgstr_w
(
filename
));
CoTaskMemFree
(
filename
);
IShellItem_Release
(
psi
);
hr
=
IFileSaveDialog_Unadvise
(
pfsd
,
cookie
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"Unadvise failed: Got 0x%08x
\n
"
,
hr
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"Unadvise failed: Got 0x%08
l
x
\n
"
,
hr
);
ref
=
IFileSaveDialog_Release
(
pfsd
);
ok_
(
file
,
line
)(
!
ref
,
"Got refcount %d, should have been released.
\n
"
,
ref
);
ok_
(
file
,
line
)(
!
ref
,
"Got refcount %
l
d, should have been released.
\n
"
,
ref
);
IFileDialogEvents_Release
(
pfde
);
}
...
...
@@ -1393,51 +1393,51 @@ static void test_filename_opendlg_(LPCWSTR set_filename, IShellItem *psi_current
hr
=
CoCreateInstance
(
&
CLSID_FileOpenDialog
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IFileOpenDialog
,
(
void
**
)
&
pfod
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"CoCreateInstance failed: Got 0x%08x
\n
"
,
hr
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"CoCreateInstance failed: Got 0x%08
l
x
\n
"
,
hr
);
if
(
defext
)
{
hr
=
IFileOpenDialog_SetDefaultExtension
(
pfod
,
defext
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"SetDefaultExtensions failed: Got 0x%08x
\n
"
,
hr
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"SetDefaultExtensions failed: Got 0x%08
l
x
\n
"
,
hr
);
}
if
(
fs_count
)
{
hr
=
IFileOpenDialog_SetFileTypes
(
pfod
,
2
,
filterspec
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"SetFileTypes failed: Got 0x%08x
\n
"
,
hr
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"SetFileTypes failed: Got 0x%08
l
x
\n
"
,
hr
);
}
hr
=
IFileOpenDialog_SetFolder
(
pfod
,
psi_current
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"SetFolder failed: Got 0x%08x
\n
"
,
hr
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"SetFolder failed: Got 0x%08
l
x
\n
"
,
hr
);
pfde
=
IFileDialogEvents_Constructor
();
pfdeimpl
=
impl_from_IFileDialogEvents
(
pfde
);
pfdeimpl
->
set_filename
=
set_filename
;
pfdeimpl
->
set_filename_tried
=
FALSE
;
hr
=
IFileOpenDialog_Advise
(
pfod
,
pfde
,
&
cookie
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"Advise failed: Got 0x%08x
\n
"
,
hr
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"Advise failed: Got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileOpenDialog_Show
(
pfod
,
NULL
);
ok_
(
file
,
line
)(
hr
==
S_OK
||
(
!
exp_filename
&&
hr
==
HRESULT_FROM_WIN32
(
ERROR_CANCELLED
)),
"Show failed: Got 0x%08x
\n
"
,
hr
);
"Show failed: Got 0x%08
l
x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
hr
=
IFileOpenDialog_GetResult
(
pfod
,
&
psi
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"GetResult failed: Got 0x%08x
\n
"
,
hr
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"GetResult failed: Got 0x%08
l
x
\n
"
,
hr
);
hr
=
IShellItem_GetDisplayName
(
psi
,
SIGDN_PARENTRELATIVEPARSING
,
&
filename
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"GetDisplayName(Result) failed: Got 0x%08x
\n
"
,
hr
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"GetDisplayName(Result) failed: Got 0x%08
l
x
\n
"
,
hr
);
ok_
(
file
,
line
)(
!
lstrcmpW
(
filename
,
exp_filename
),
"(GetResult) Got %s
\n
"
,
wine_dbgstr_w
(
filename
));
CoTaskMemFree
(
filename
);
IShellItem_Release
(
psi
);
hr
=
IFileOpenDialog_GetResults
(
pfod
,
&
psia
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"GetResults failed: Got 0x%08x
\n
"
,
hr
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"GetResults failed: Got 0x%08
l
x
\n
"
,
hr
);
hr
=
IShellItemArray_GetItemAt
(
psia
,
0
,
&
psi
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"GetItemAt failed: Got 0x%08x
\n
"
,
hr
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"GetItemAt failed: Got 0x%08
l
x
\n
"
,
hr
);
hr
=
IShellItem_GetDisplayName
(
psi
,
SIGDN_PARENTRELATIVEPARSING
,
&
filename
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"GetDisplayName(Results) failed: Got 0x%08x
\n
"
,
hr
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"GetDisplayName(Results) failed: Got 0x%08
l
x
\n
"
,
hr
);
ok_
(
file
,
line
)(
!
lstrcmpW
(
filename
,
exp_filename
),
"(GetResults) Got %s
\n
"
,
wine_dbgstr_w
(
filename
));
CoTaskMemFree
(
filename
);
...
...
@@ -1447,23 +1447,23 @@ static void test_filename_opendlg_(LPCWSTR set_filename, IShellItem *psi_current
else
{
hr
=
IFileOpenDialog_GetResult
(
pfod
,
&
psi
);
ok_
(
file
,
line
)(
hr
==
E_UNEXPECTED
,
"GetResult: Got 0x%08x
\n
"
,
hr
);
ok_
(
file
,
line
)(
hr
==
E_UNEXPECTED
,
"GetResult: Got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileOpenDialog_GetResults
(
pfod
,
&
psia
);
ok_
(
file
,
line
)(
hr
==
E_FAIL
,
"GetResults: Got 0x%08x
\n
"
,
hr
);
ok_
(
file
,
line
)(
hr
==
E_FAIL
,
"GetResults: Got 0x%08
l
x
\n
"
,
hr
);
}
hr
=
IFileOpenDialog_GetFileName
(
pfod
,
&
filename
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"GetFileName failed: Got 0x%08x
\n
"
,
hr
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"GetFileName failed: Got 0x%08
l
x
\n
"
,
hr
);
ok_
(
file
,
line
)(
!
lstrcmpW
(
filename
,
set_filename
),
"(GetFileName) Got %s
\n
"
,
wine_dbgstr_w
(
filename
));
CoTaskMemFree
(
filename
);
hr
=
IFileOpenDialog_Unadvise
(
pfod
,
cookie
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"Unadvise failed: Got 0x%08x
\n
"
,
hr
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"Unadvise failed: Got 0x%08
l
x
\n
"
,
hr
);
ref
=
IFileOpenDialog_Release
(
pfod
);
ok_
(
file
,
line
)(
!
ref
,
"Got refcount %d, should have been released.
\n
"
,
ref
);
ok_
(
file
,
line
)(
!
ref
,
"Got refcount %
l
d, should have been released.
\n
"
,
ref
);
IFileDialogEvents_Release
(
pfde
);
}
...
...
@@ -1520,7 +1520,7 @@ static void test_filename(void)
GetCurrentDirectoryW
(
MAX_PATH
,
buf
);
ok
(
!!
pSHCreateItemFromParsingName
,
"SHCreateItemFromParsingName is missing.
\n
"
);
hr
=
pSHCreateItemFromParsingName
(
buf
,
NULL
,
&
IID_IShellItem
,
(
void
**
)
&
psi_current
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got 0x%08
l
x
\n
"
,
hr
);
touch_file
(
filename_noextW
);
touch_file
(
filename_defextW
);
...
...
@@ -1643,10 +1643,10 @@ static void test_customize(void)
HRESULT
hr
;
hr
=
CoCreateInstance
(
&
CLSID_FileOpenDialog
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IFileDialog
,
(
void
**
)
&
pfod
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialog_QueryInterface
(
pfod
,
&
IID_IFileDialogCustomize
,
(
void
**
)
&
pfdc
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
if
(
FAILED
(
hr
))
{
skip
(
"Skipping IFileDialogCustomize tests.
\n
"
);
...
...
@@ -1656,195 +1656,195 @@ static void test_customize(void)
i
=
0
;
hr
=
IFileDialogCustomize_AddPushButton
(
pfdc
,
i
,
pushbutton1W
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_AddPushButton
(
pfdc
,
i
,
pushbutton1W
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialog_QueryInterface
(
pfod
,
&
IID_IOleWindow
,
(
void
**
)
&
pow
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got 0x%08
l
x
\n
"
,
hr
);
hr
=
IOleWindow_GetWindow
(
pow
,
&
dlg_hwnd
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got 0x%08
l
x
\n
"
,
hr
);
ok
(
dlg_hwnd
==
NULL
,
"NULL
\n
"
);
IOleWindow_Release
(
pow
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlState
(
pfdc
,
i
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_ENABLEDVISIBLE
,
"got 0x%08x.
\n
"
,
cdstate
);
hr
=
IFileDialogCustomize_AddControlItem
(
pfdc
,
i
,
0
,
label
);
ok
(
hr
==
E_NOINTERFACE
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_NOINTERFACE
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_SetControlLabel
(
pfdc
,
i
,
label2
);
ok
(
hr
==
S_OK
,
"got 0x%08x (control: %d).
\n
"
,
hr
,
i
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x (control: %d).
\n
"
,
hr
,
i
);
hr
=
IFileDialogCustomize_EnableOpenDropDown
(
pfdc
,
i
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_EnableOpenDropDown
(
pfdc
,
++
i
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_EnableOpenDropDown
(
pfdc
,
i
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_EnableOpenDropDown
(
pfdc
,
i
+
1
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08
l
x.
\n
"
,
hr
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlState
(
pfdc
,
i
,
&
cdstate
);
ok
(
hr
==
E_NOTIMPL
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_NOTIMPL
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
0xdeadbeef
,
"got 0x%08x.
\n
"
,
cdstate
);
hr
=
IFileDialogCustomize_AddControlItem
(
pfdc
,
i
,
0
,
label
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_AddControlItem
(
pfdc
,
i
,
0
,
label
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08
l
x.
\n
"
,
hr
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlItemState
(
pfdc
,
i
,
0
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_ENABLEDVISIBLE
,
"got 0x%08x.
\n
"
,
cdstate
);
hr
=
IFileDialogCustomize_SetControlItemState
(
pfdc
,
i
,
0
,
0
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlItemState
(
pfdc
,
i
,
0
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
!
cdstate
,
"got 0x%08x.
\n
"
,
cdstate
);
hr
=
IFileDialogCustomize_SetControlItemState
(
pfdc
,
i
,
0
,
CDCS_ENABLEDVISIBLE
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlItemState
(
pfdc
,
i
,
0
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_ENABLEDVISIBLE
,
"got 0x%08x.
\n
"
,
cdstate
);
hr
=
IFileDialogCustomize_SetControlLabel
(
pfdc
,
i
,
label2
);
ok
(
hr
==
E_NOTIMPL
,
"got 0x%08x (control: %d).
\n
"
,
hr
,
i
);
ok
(
hr
==
E_NOTIMPL
,
"got 0x%08
l
x (control: %d).
\n
"
,
hr
,
i
);
hr
=
IFileDialogCustomize_AddMenu
(
pfdc
,
i
,
menuW
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_AddMenu
(
pfdc
,
++
i
,
label
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlState
(
pfdc
,
i
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_ENABLEDVISIBLE
,
"got 0x%08x.
\n
"
,
cdstate
);
hr
=
IFileDialogCustomize_AddControlItem
(
pfdc
,
i
,
0
,
label
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_AddControlItem
(
pfdc
,
i
,
0
,
label
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_SetControlLabel
(
pfdc
,
i
,
label2
);
ok
(
hr
==
S_OK
,
"got 0x%08x (control: %d).
\n
"
,
hr
,
i
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x (control: %d).
\n
"
,
hr
,
i
);
hr
=
IFileDialogCustomize_AddPushButton
(
pfdc
,
i
,
pushbutton2W
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_AddPushButton
(
pfdc
,
++
i
,
pushbutton2W
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlState
(
pfdc
,
i
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_ENABLEDVISIBLE
,
"got 0x%08x.
\n
"
,
cdstate
);
hr
=
IFileDialogCustomize_AddControlItem
(
pfdc
,
i
,
0
,
label
);
ok
(
hr
==
E_NOINTERFACE
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_NOINTERFACE
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_SetControlLabel
(
pfdc
,
i
,
label2
);
ok
(
hr
==
S_OK
,
"got 0x%08x (control: %d).
\n
"
,
hr
,
i
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x (control: %d).
\n
"
,
hr
,
i
);
hr
=
IFileDialogCustomize_AddComboBox
(
pfdc
,
i
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_AddComboBox
(
pfdc
,
++
i
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlState
(
pfdc
,
i
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_ENABLEDVISIBLE
,
"got 0x%08x.
\n
"
,
cdstate
);
hr
=
IFileDialogCustomize_AddControlItem
(
pfdc
,
i
,
0
,
label
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_AddControlItem
(
pfdc
,
i
,
0
,
label
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_SetControlLabel
(
pfdc
,
i
,
label2
);
ok
(
hr
==
S_OK
,
"got 0x%08x (control: %d).
\n
"
,
hr
,
i
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x (control: %d).
\n
"
,
hr
,
i
);
hr
=
IFileDialogCustomize_AddRadioButtonList
(
pfdc
,
i
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_AddRadioButtonList
(
pfdc
,
++
i
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlState
(
pfdc
,
i
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_ENABLEDVISIBLE
,
"got 0x%08x.
\n
"
,
cdstate
);
hr
=
IFileDialogCustomize_AddControlItem
(
pfdc
,
i
,
0
,
radiobutton1W
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_AddControlItem
(
pfdc
,
i
,
0
,
radiobutton1W
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_SetControlLabel
(
pfdc
,
i
,
radiobutton2W
);
ok
(
hr
==
S_OK
,
"got 0x%08x (control: %d).
\n
"
,
hr
,
i
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x (control: %d).
\n
"
,
hr
,
i
);
hr
=
IFileDialogCustomize_AddCheckButton
(
pfdc
,
i
,
label
,
TRUE
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_AddCheckButton
(
pfdc
,
++
i
,
checkbutton1W
,
TRUE
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlState
(
pfdc
,
i
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_ENABLEDVISIBLE
,
"got 0x%08x.
\n
"
,
cdstate
);
hr
=
IFileDialogCustomize_AddControlItem
(
pfdc
,
i
,
0
,
label
);
ok
(
hr
==
E_NOINTERFACE
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_NOINTERFACE
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_SetControlLabel
(
pfdc
,
i
,
checkbutton2W
);
ok
(
hr
==
S_OK
,
"got 0x%08x (control: %d).
\n
"
,
hr
,
i
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x (control: %d).
\n
"
,
hr
,
i
);
if
(
SUCCEEDED
(
hr
))
{
BOOL
checked
;
hr
=
IFileDialogCustomize_GetCheckButtonState
(
pfdc
,
i
,
&
checked
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
checked
,
"checkbox not checked.
\n
"
);
hr
=
IFileDialogCustomize_SetCheckButtonState
(
pfdc
,
i
,
FALSE
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_GetCheckButtonState
(
pfdc
,
i
,
&
checked
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
!
checked
,
"checkbox checked.
\n
"
);
hr
=
IFileDialogCustomize_SetCheckButtonState
(
pfdc
,
i
,
TRUE
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_GetCheckButtonState
(
pfdc
,
i
,
&
checked
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
checked
,
"checkbox not checked.
\n
"
);
}
hr
=
IFileDialogCustomize_AddEditBox
(
pfdc
,
i
,
label
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_AddEditBox
(
pfdc
,
++
i
,
editbox1W
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlState
(
pfdc
,
i
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_ENABLEDVISIBLE
,
"got 0x%08x.
\n
"
,
cdstate
);
hr
=
IFileDialogCustomize_AddControlItem
(
pfdc
,
i
,
0
,
label
);
ok
(
hr
==
E_NOINTERFACE
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_NOINTERFACE
,
"got 0x%08
l
x.
\n
"
,
hr
);
/* Does not affect the text in the editbox */
hr
=
IFileDialogCustomize_SetControlLabel
(
pfdc
,
i
,
editbox2W
);
ok
(
hr
==
S_OK
,
"got 0x%08x (control: %d).
\n
"
,
hr
,
i
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x (control: %d).
\n
"
,
hr
,
i
);
hr
=
IFileDialogCustomize_GetEditBoxText
(
pfdc
,
i
,
&
tmpstr
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
ok
(
!
lstrcmpW
(
tmpstr
,
editbox1W
),
"got %s.
\n
"
,
wine_dbgstr_w
(
tmpstr
));
...
...
@@ -1852,10 +1852,10 @@ static void test_customize(void)
}
hr
=
IFileDialogCustomize_SetEditBoxText
(
pfdc
,
i
,
label2
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_GetEditBoxText
(
pfdc
,
i
,
&
tmpstr
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
ok
(
!
lstrcmpW
(
tmpstr
,
label2
),
"got %s.
\n
"
,
wine_dbgstr_w
(
tmpstr
));
...
...
@@ -1863,96 +1863,96 @@ static void test_customize(void)
}
hr
=
IFileDialogCustomize_AddSeparator
(
pfdc
,
i
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_AddSeparator
(
pfdc
,
++
i
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlState
(
pfdc
,
i
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_ENABLEDVISIBLE
,
"got 0x%08x.
\n
"
,
cdstate
);
hr
=
IFileDialogCustomize_AddControlItem
(
pfdc
,
i
,
0
,
label
);
ok
(
hr
==
E_NOINTERFACE
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_NOINTERFACE
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_SetControlLabel
(
pfdc
,
i
,
separatorW
);
ok
(
hr
==
S_OK
,
"got 0x%08x (control: %d).
\n
"
,
hr
,
i
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x (control: %d).
\n
"
,
hr
,
i
);
hr
=
IFileDialogCustomize_AddText
(
pfdc
,
i
,
label
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_AddText
(
pfdc
,
++
i
,
textW
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlState
(
pfdc
,
i
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_ENABLEDVISIBLE
,
"got 0x%08x.
\n
"
,
cdstate
);
hr
=
IFileDialogCustomize_AddControlItem
(
pfdc
,
i
,
0
,
label
);
ok
(
hr
==
E_NOINTERFACE
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_NOINTERFACE
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_SetControlLabel
(
pfdc
,
i
,
text2W
);
ok
(
hr
==
S_OK
,
"got 0x%08x (control: %d).
\n
"
,
hr
,
i
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x (control: %d).
\n
"
,
hr
,
i
);
hr
=
IFileDialogCustomize_StartVisualGroup
(
pfdc
,
i
,
label
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_StartVisualGroup
(
pfdc
,
++
i
,
visualgroup1W
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_AddControlItem
(
pfdc
,
i
,
0
,
label
);
ok
(
hr
==
E_NOINTERFACE
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_NOINTERFACE
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_SetControlLabel
(
pfdc
,
i
,
visualgroup2W
);
ok
(
hr
==
S_OK
,
"got 0x%08x (control: %d).
\n
"
,
hr
,
i
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x (control: %d).
\n
"
,
hr
,
i
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlState
(
pfdc
,
i
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_ENABLEDVISIBLE
,
"got 0x%08x.
\n
"
,
cdstate
);
hr
=
IFileDialogCustomize_StartVisualGroup
(
pfdc
,
++
i
,
label
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_EndVisualGroup
(
pfdc
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
i
++
;
/* Nonexisting control */
hr
=
IFileDialogCustomize_AddControlItem
(
pfdc
,
i
,
0
,
label
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x.
\n
"
,
hr
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_SetControlLabel
(
pfdc
,
i
,
label2
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x (control: %d).
\n
"
,
hr
,
i
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08
l
x (control: %d).
\n
"
,
hr
,
i
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlState
(
pfdc
,
i
,
&
cdstate
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x.
\n
"
,
hr
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
0xdeadbeef
,
"got 0x%08x.
\n
"
,
cdstate
);
pfde
=
IFileDialogEvents_Constructor
();
pfdeimpl
=
impl_from_IFileDialogEvents
(
pfde
);
pfdeimpl
->
events_test
=
IFDEVENT_TEST1
;
hr
=
IFileDialog_Advise
(
pfod
,
pfde
,
&
cookie
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileDialog_Show
(
pfod
,
NULL
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_CANCELLED
),
"Got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_CANCELLED
),
"Got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileDialog_Unadvise
(
pfod
,
cookie
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got 0x%08
l
x
\n
"
,
hr
);
IFileDialogEvents_Release
(
pfde
);
IFileDialogCustomize_Release
(
pfdc
);
ref
=
IFileDialog_Release
(
pfod
);
ok
(
!
ref
,
"Refcount not zero (%d).
\n
"
,
ref
);
ok
(
!
ref
,
"Refcount not zero (%
l
d).
\n
"
,
ref
);
hr
=
CoCreateInstance
(
&
CLSID_FileOpenDialog
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IFileDialog
,
(
void
**
)
&
pfod
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialog_QueryInterface
(
pfod
,
&
IID_IFileDialogCustomize
,
(
void
**
)
&
pfdc
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
i
=
0
;
hr
=
IFileDialogCustomize_AddMenu
(
pfdc
,
++
i
,
label
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
DWORD
selected
;
...
...
@@ -1961,42 +1961,42 @@ static void test_customize(void)
for
(
j
=
0
;
j
<
10
;
j
++
)
{
hr
=
IFileDialogCustomize_AddControlItem
(
pfdc
,
i
,
j
,
label
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
}
hr
=
IFileDialogCustomize_GetSelectedControlItem
(
pfdc
,
i
,
&
selected
);
ok
(
hr
==
E_NOTIMPL
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_NOTIMPL
,
"got 0x%08
l
x.
\n
"
,
hr
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlItemState
(
pfdc
,
i
,
0
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_ENABLEDVISIBLE
,
"got 0x%08x.
\n
"
,
cdstate
);
hr
=
IFileDialogCustomize_SetControlItemState
(
pfdc
,
i
,
0
,
0
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlItemState
(
pfdc
,
i
,
0
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
0
,
"got 0x%08x.
\n
"
,
cdstate
);
hr
=
IFileDialogCustomize_SetControlItemState
(
pfdc
,
i
,
0
,
CDCS_ENABLEDVISIBLE
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlItemState
(
pfdc
,
i
,
0
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_ENABLEDVISIBLE
,
"got 0x%08x.
\n
"
,
cdstate
);
hr
=
IFileDialogCustomize_RemoveAllControlItems
(
pfdc
,
i
);
ok
(
hr
==
E_NOTIMPL
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_NOTIMPL
,
"got 0x%08
l
x.
\n
"
,
hr
);
for
(
j
=
0
;
j
<
10
;
j
++
)
{
hr
=
IFileDialogCustomize_RemoveControlItem
(
pfdc
,
i
,
j
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
}
}
hr
=
IFileDialogCustomize_AddPushButton
(
pfdc
,
++
i
,
label
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_AddComboBox
(
pfdc
,
++
i
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
DWORD
selected
=
-
1
;
...
...
@@ -2005,54 +2005,54 @@ static void test_customize(void)
for
(
j
=
0
;
j
<
10
;
j
++
)
{
hr
=
IFileDialogCustomize_AddControlItem
(
pfdc
,
i
,
j
,
label
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
}
hr
=
IFileDialogCustomize_GetSelectedControlItem
(
pfdc
,
i
,
&
selected
);
ok
(
hr
==
E_FAIL
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
selected
==
-
1
,
"got %d.
\n
"
,
selected
);
ok
(
hr
==
E_FAIL
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
selected
==
-
1
,
"got %
l
d.
\n
"
,
selected
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlItemState
(
pfdc
,
i
,
0
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_ENABLEDVISIBLE
,
"got 0x%08x.
\n
"
,
cdstate
);
hr
=
IFileDialogCustomize_SetControlItemState
(
pfdc
,
i
,
0
,
0
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlItemState
(
pfdc
,
i
,
0
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
0
,
"got 0x%08x.
\n
"
,
cdstate
);
hr
=
IFileDialogCustomize_SetControlItemState
(
pfdc
,
i
,
0
,
CDCS_ENABLEDVISIBLE
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlItemState
(
pfdc
,
i
,
0
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_ENABLEDVISIBLE
,
"got 0x%08x.
\n
"
,
cdstate
);
for
(
j
=
0
;
j
<
10
;
j
++
)
{
hr
=
IFileDialogCustomize_SetSelectedControlItem
(
pfdc
,
i
,
j
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_GetSelectedControlItem
(
pfdc
,
i
,
&
selected
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
selected
==
j
,
"got %d.
\n
"
,
selected
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
selected
==
j
,
"got %
l
d.
\n
"
,
selected
);
}
j
++
;
hr
=
IFileDialogCustomize_SetSelectedControlItem
(
pfdc
,
i
,
j
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_RemoveAllControlItems
(
pfdc
,
i
);
ok
(
hr
==
E_NOTIMPL
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_NOTIMPL
,
"got 0x%08
l
x.
\n
"
,
hr
);
for
(
j
=
0
;
j
<
10
;
j
++
)
{
hr
=
IFileDialogCustomize_RemoveControlItem
(
pfdc
,
i
,
j
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
}
}
hr
=
IFileDialogCustomize_AddRadioButtonList
(
pfdc
,
++
i
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
DWORD
selected
=
-
1
;
...
...
@@ -2061,53 +2061,53 @@ static void test_customize(void)
for
(
j
=
0
;
j
<
10
;
j
++
)
{
hr
=
IFileDialogCustomize_AddControlItem
(
pfdc
,
i
,
j
,
label
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
}
hr
=
IFileDialogCustomize_GetSelectedControlItem
(
pfdc
,
i
,
&
selected
);
ok
(
hr
==
E_FAIL
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
selected
==
-
1
,
"got %d.
\n
"
,
selected
);
ok
(
hr
==
E_FAIL
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
selected
==
-
1
,
"got %
l
d.
\n
"
,
selected
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlItemState
(
pfdc
,
i
,
0
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_ENABLEDVISIBLE
,
"got 0x%08x.
\n
"
,
cdstate
);
hr
=
IFileDialogCustomize_SetControlItemState
(
pfdc
,
i
,
0
,
0
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlItemState
(
pfdc
,
i
,
0
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
0
,
"got 0x%08x.
\n
"
,
cdstate
);
hr
=
IFileDialogCustomize_SetControlItemState
(
pfdc
,
i
,
0
,
CDCS_ENABLEDVISIBLE
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlItemState
(
pfdc
,
i
,
0
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_ENABLEDVISIBLE
,
"got 0x%08x.
\n
"
,
cdstate
);
for
(
j
=
0
;
j
<
10
;
j
++
)
{
hr
=
IFileDialogCustomize_SetSelectedControlItem
(
pfdc
,
i
,
j
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_GetSelectedControlItem
(
pfdc
,
i
,
&
selected
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
selected
==
j
,
"got %d.
\n
"
,
selected
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
selected
==
j
,
"got %
l
d.
\n
"
,
selected
);
}
j
++
;
hr
=
IFileDialogCustomize_SetSelectedControlItem
(
pfdc
,
i
,
j
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_RemoveAllControlItems
(
pfdc
,
i
);
ok
(
hr
==
E_NOTIMPL
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_NOTIMPL
,
"got 0x%08
l
x.
\n
"
,
hr
);
for
(
j
=
0
;
j
<
10
;
j
++
)
{
hr
=
IFileDialogCustomize_RemoveControlItem
(
pfdc
,
i
,
j
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
}
}
hr
=
IFileDialogCustomize_EnableOpenDropDown
(
pfdc
,
++
i
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
DWORD
selected
=
-
1
;
...
...
@@ -2116,166 +2116,166 @@ static void test_customize(void)
for
(
j
=
0
;
j
<
10
;
j
++
)
{
hr
=
IFileDialogCustomize_AddControlItem
(
pfdc
,
i
,
j
,
label
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
}
hr
=
IFileDialogCustomize_GetSelectedControlItem
(
pfdc
,
i
,
&
selected
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
selected
==
0
,
"got %d.
\n
"
,
selected
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
selected
==
0
,
"got %
l
d.
\n
"
,
selected
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlItemState
(
pfdc
,
i
,
0
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_ENABLEDVISIBLE
,
"got 0x%08x.
\n
"
,
cdstate
);
hr
=
IFileDialogCustomize_SetControlItemState
(
pfdc
,
i
,
0
,
0
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlItemState
(
pfdc
,
i
,
0
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
0
,
"got 0x%08x.
\n
"
,
cdstate
);
hr
=
IFileDialogCustomize_SetControlItemState
(
pfdc
,
i
,
0
,
CDCS_ENABLEDVISIBLE
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlItemState
(
pfdc
,
i
,
0
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_ENABLEDVISIBLE
,
"got 0x%08x.
\n
"
,
cdstate
);
hr
=
IFileDialogCustomize_SetSelectedControlItem
(
pfdc
,
i
,
0
);
todo_wine
ok
(
hr
==
E_NOTIMPL
,
"got 0x%08x.
\n
"
,
hr
);
todo_wine
ok
(
hr
==
E_NOTIMPL
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_RemoveAllControlItems
(
pfdc
,
i
);
ok
(
hr
==
E_NOTIMPL
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
E_NOTIMPL
,
"got 0x%08
l
x.
\n
"
,
hr
);
for
(
j
=
0
;
j
<
10
;
j
++
)
{
hr
=
IFileDialogCustomize_RemoveControlItem
(
pfdc
,
i
,
j
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
}
}
IFileDialogCustomize_Release
(
pfdc
);
ref
=
IFileDialog_Release
(
pfod
);
ok
(
!
ref
,
"Refcount not zero (%d).
\n
"
,
ref
);
ok
(
!
ref
,
"Refcount not zero (%
l
d).
\n
"
,
ref
);
/* Some more tests for VisualGroup behavior */
hr
=
CoCreateInstance
(
&
CLSID_FileOpenDialog
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IFileDialog
,
(
void
**
)
&
pfod
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialog_QueryInterface
(
pfod
,
&
IID_IFileDialogCustomize
,
(
void
**
)
&
pfdc
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
i
=
-
1
;
id_vgroup1
=
++
i
;
hr
=
IFileDialogCustomize_StartVisualGroup
(
pfdc
,
id_vgroup1
,
visualgroup1W
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlState
(
pfdc
,
id_vgroup1
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_ENABLEDVISIBLE
,
"got 0x%08x.
\n
"
,
cdstate
);
id_text
=
++
i
;
hr
=
IFileDialogCustomize_AddText
(
pfdc
,
id_text
,
label
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlState
(
pfdc
,
id_text
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_ENABLEDVISIBLE
,
"got 0x%08x.
\n
"
,
cdstate
);
id_editbox1
=
++
i
;
hr
=
IFileDialogCustomize_AddEditBox
(
pfdc
,
id_editbox1
,
editbox1W
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlState
(
pfdc
,
id_editbox1
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_ENABLEDVISIBLE
,
"got 0x%08x.
\n
"
,
cdstate
);
/* Set all Visible but not Enabled */
hr
=
IFileDialogCustomize_SetControlState
(
pfdc
,
id_vgroup1
,
CDCS_VISIBLE
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlState
(
pfdc
,
id_vgroup1
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_VISIBLE
,
"got 0x%08x.
\n
"
,
cdstate
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlState
(
pfdc
,
id_text
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_ENABLEDVISIBLE
,
"got 0x%08x.
\n
"
,
cdstate
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlState
(
pfdc
,
id_editbox1
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_ENABLEDVISIBLE
,
"got 0x%08x.
\n
"
,
cdstate
);
/* Set text to Visible but not Enabled */
hr
=
IFileDialogCustomize_SetControlState
(
pfdc
,
id_text
,
CDCS_VISIBLE
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlState
(
pfdc
,
id_vgroup1
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_VISIBLE
,
"got 0x%08x.
\n
"
,
cdstate
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlState
(
pfdc
,
id_text
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_VISIBLE
,
"got 0x%08x.
\n
"
,
cdstate
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlState
(
pfdc
,
id_editbox1
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_ENABLEDVISIBLE
,
"got 0x%08x.
\n
"
,
cdstate
);
/* Set vgroup to inactive */
hr
=
IFileDialogCustomize_SetControlState
(
pfdc
,
id_vgroup1
,
CDCS_INACTIVE
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlState
(
pfdc
,
id_vgroup1
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_INACTIVE
,
"got 0x%08x.
\n
"
,
cdstate
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlState
(
pfdc
,
id_text
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_VISIBLE
,
"got 0x%08x.
\n
"
,
cdstate
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlState
(
pfdc
,
id_editbox1
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_ENABLEDVISIBLE
,
"got 0x%08x.
\n
"
,
cdstate
);
/* Set vgroup to Enabled and Visible again */
hr
=
IFileDialogCustomize_SetControlState
(
pfdc
,
id_vgroup1
,
CDCS_ENABLEDVISIBLE
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlState
(
pfdc
,
id_vgroup1
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_ENABLEDVISIBLE
,
"got 0x%08x.
\n
"
,
cdstate
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlState
(
pfdc
,
id_text
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_VISIBLE
,
"got 0x%08x.
\n
"
,
cdstate
);
cdstate
=
0xdeadbeef
;
hr
=
IFileDialogCustomize_GetControlState
(
pfdc
,
id_editbox1
,
&
cdstate
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
ok
(
cdstate
==
CDCS_ENABLEDVISIBLE
,
"got 0x%08x.
\n
"
,
cdstate
);
hr
=
IFileDialogCustomize_MakeProminent
(
pfdc
,
id_vgroup1
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
IFileDialogCustomize_Release
(
pfdc
);
ref
=
IFileDialog_Release
(
pfod
);
ok
(
!
ref
,
"Refcount not zero (%d).
\n
"
,
ref
);
ok
(
!
ref
,
"Refcount not zero (%
l
d).
\n
"
,
ref
);
}
static
void
test_persistent_state
(
void
)
...
...
@@ -2285,7 +2285,7 @@ static void test_persistent_state(void)
hr
=
CoCreateInstance
(
&
CLSID_FileOpenDialog
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IFileDialog
,
(
void
**
)
&
fd
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
if
(
0
)
{
...
...
@@ -2294,10 +2294,10 @@ if (0)
}
hr
=
IFileDialog_SetClientGuid
(
fd
,
&
IID_IUnknown
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileDialog_SetClientGuid
(
fd
,
&
IID_NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
IFileDialog_Release
(
fd
);
}
...
...
@@ -2317,40 +2317,40 @@ static void test_overwrite(void)
GetCurrentDirectoryW
(
MAX_PATH
,
buf
);
ok
(
!!
pSHCreateItemFromParsingName
,
"SHCreateItemFromParsingName is missing.
\n
"
);
hr
=
pSHCreateItemFromParsingName
(
buf
,
NULL
,
&
IID_IShellItem
,
(
void
**
)
&
psi_current
);
ok
(
hr
==
S_OK
,
"Got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got 0x%08
l
x
\n
"
,
hr
);
touch_file
(
filename_winetest
);
/* FOS_OVERWRITEPROMPT has no effect on open dialog */
hr
=
CoCreateInstance
(
&
CLSID_FileOpenDialog
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IFileDialog
,
(
void
**
)
&
fd
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialog_SetOptions
(
fd
,
FOS_OVERWRITEPROMPT
|
FOS_NOCHANGEDIR
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialog_SetFolder
(
fd
,
psi_current
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
pfde
=
IFileDialogEvents_Constructor
();
pfdeimpl
=
impl_from_IFileDialogEvents
(
pfde
);
pfdeimpl
->
set_filename
=
filename_winetest
;
hr
=
IFileDialog_Advise
(
fd
,
pfde
,
&
cookie
);
ok
(
hr
==
S_OK
,
"Advise failed: Got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Advise failed: Got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileDialog_Show
(
fd
,
NULL
);
ok
(
hr
==
S_OK
,
"Show failed: Got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Show failed: Got 0x%08
l
x
\n
"
,
hr
);
ok
(
!
pfdeimpl
->
OnOverwrite
,
"got %u overwrite events
\n
"
,
pfdeimpl
->
OnOverwrite
);
ok
(
pfdeimpl
->
OnFileOk
==
1
,
"got %u ok events
\n
"
,
pfdeimpl
->
OnFileOk
);
ok
(
!
pfdeimpl
->
OnOverwrite
,
"got %
l
u overwrite events
\n
"
,
pfdeimpl
->
OnOverwrite
);
ok
(
pfdeimpl
->
OnFileOk
==
1
,
"got %
l
u ok events
\n
"
,
pfdeimpl
->
OnFileOk
);
hr
=
IFileDialog_GetFileName
(
fd
,
&
filename
);
ok
(
hr
==
S_OK
,
"GetFileName failed: Got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"GetFileName failed: Got 0x%08
l
x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
filename
,
filename_winetest
),
"Got %s
\n
"
,
wine_dbgstr_w
(
filename
));
CoTaskMemFree
(
filename
);
hr
=
IFileDialog_Unadvise
(
fd
,
cookie
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
IFileDialog_Release
(
fd
);
...
...
@@ -2359,33 +2359,33 @@ static void test_overwrite(void)
/* Save dialog doesn't check for overwrite without FOS_OVERWRITEPROMPT set */
hr
=
CoCreateInstance
(
&
CLSID_FileSaveDialog
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IFileDialog
,
(
void
**
)
&
fd
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialog_SetOptions
(
fd
,
FOS_NOREADONLYRETURN
|
FOS_PATHMUSTEXIST
|
FOS_NOCHANGEDIR
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialog_SetFolder
(
fd
,
psi_current
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
pfde
=
IFileDialogEvents_Constructor
();
pfdeimpl
=
impl_from_IFileDialogEvents
(
pfde
);
pfdeimpl
->
set_filename
=
filename_winetest
;
hr
=
IFileDialog_Advise
(
fd
,
pfde
,
&
cookie
);
ok
(
hr
==
S_OK
,
"Advise failed: Got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Advise failed: Got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileDialog_Show
(
fd
,
NULL
);
ok
(
hr
==
S_OK
,
"Show failed: Got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Show failed: Got 0x%08
l
x
\n
"
,
hr
);
ok
(
!
pfdeimpl
->
OnOverwrite
,
"got %u overwrite events
\n
"
,
pfdeimpl
->
OnOverwrite
);
ok
(
pfdeimpl
->
OnFileOk
==
1
,
"got %u ok events
\n
"
,
pfdeimpl
->
OnFileOk
);
ok
(
!
pfdeimpl
->
OnOverwrite
,
"got %
l
u overwrite events
\n
"
,
pfdeimpl
->
OnOverwrite
);
ok
(
pfdeimpl
->
OnFileOk
==
1
,
"got %
l
u ok events
\n
"
,
pfdeimpl
->
OnFileOk
);
hr
=
IFileDialog_GetFileName
(
fd
,
&
filename
);
ok
(
hr
==
S_OK
,
"GetFileName failed: Got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"GetFileName failed: Got 0x%08
l
x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
filename
,
filename_winetest
),
"Got %s
\n
"
,
wine_dbgstr_w
(
filename
));
CoTaskMemFree
(
filename
);
hr
=
IFileDialog_Unadvise
(
fd
,
cookie
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
IFileDialog_Release
(
fd
);
...
...
@@ -2394,30 +2394,30 @@ static void test_overwrite(void)
/* Save dialog with FOS_OVERWRITEPROMPT set */
hr
=
CoCreateInstance
(
&
CLSID_FileSaveDialog
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IFileDialog
,
(
void
**
)
&
fd
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialog_SetFolder
(
fd
,
psi_current
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
pfde
=
IFileDialogEvents_Constructor
();
pfdeimpl
=
impl_from_IFileDialogEvents
(
pfde
);
pfdeimpl
->
set_filename
=
filename_winetest
;
hr
=
IFileDialog_Advise
(
fd
,
pfde
,
&
cookie
);
ok
(
hr
==
S_OK
,
"Advise failed: Got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Advise failed: Got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileDialog_Show
(
fd
,
NULL
);
ok
(
hr
==
S_OK
,
"Show failed: Got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Show failed: Got 0x%08
l
x
\n
"
,
hr
);
ok
(
pfdeimpl
->
OnOverwrite
==
1
,
"got %u overwrite events
\n
"
,
pfdeimpl
->
OnOverwrite
);
ok
(
pfdeimpl
->
OnFileOk
==
1
,
"got %u ok events
\n
"
,
pfdeimpl
->
OnFileOk
);
ok
(
pfdeimpl
->
OnOverwrite
==
1
,
"got %
l
u overwrite events
\n
"
,
pfdeimpl
->
OnOverwrite
);
ok
(
pfdeimpl
->
OnFileOk
==
1
,
"got %
l
u ok events
\n
"
,
pfdeimpl
->
OnFileOk
);
hr
=
IFileDialog_GetFileName
(
fd
,
&
filename
);
ok
(
hr
==
S_OK
,
"GetFileName failed: Got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"GetFileName failed: Got 0x%08
l
x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
filename
,
filename_winetest
),
"Got %s
\n
"
,
wine_dbgstr_w
(
filename
));
CoTaskMemFree
(
filename
);
hr
=
IFileDialog_Unadvise
(
fd
,
cookie
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
IFileDialog_Release
(
fd
);
...
...
@@ -2428,30 +2428,30 @@ static void test_overwrite(void)
/* Save dialog with FOS_OVERWRITEPROMPT set but without existing file */
hr
=
CoCreateInstance
(
&
CLSID_FileSaveDialog
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IFileDialog
,
(
void
**
)
&
fd
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
hr
=
IFileDialog_SetFolder
(
fd
,
psi_current
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
pfde
=
IFileDialogEvents_Constructor
();
pfdeimpl
=
impl_from_IFileDialogEvents
(
pfde
);
pfdeimpl
->
set_filename
=
filename_winetest
;
hr
=
IFileDialog_Advise
(
fd
,
pfde
,
&
cookie
);
ok
(
hr
==
S_OK
,
"Advise failed: Got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Advise failed: Got 0x%08
l
x
\n
"
,
hr
);
hr
=
IFileDialog_Show
(
fd
,
NULL
);
ok
(
hr
==
S_OK
,
"Show failed: Got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Show failed: Got 0x%08
l
x
\n
"
,
hr
);
ok
(
!
pfdeimpl
->
OnOverwrite
,
"got %u overwrite events
\n
"
,
pfdeimpl
->
OnOverwrite
);
ok
(
pfdeimpl
->
OnFileOk
==
1
,
"got %u ok events
\n
"
,
pfdeimpl
->
OnFileOk
);
ok
(
!
pfdeimpl
->
OnOverwrite
,
"got %
l
u overwrite events
\n
"
,
pfdeimpl
->
OnOverwrite
);
ok
(
pfdeimpl
->
OnFileOk
==
1
,
"got %
l
u ok events
\n
"
,
pfdeimpl
->
OnFileOk
);
hr
=
IFileDialog_GetFileName
(
fd
,
&
filename
);
ok
(
hr
==
S_OK
,
"GetFileName failed: Got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"GetFileName failed: Got 0x%08
l
x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
filename
,
filename_winetest
),
"Got %s
\n
"
,
wine_dbgstr_w
(
filename
));
CoTaskMemFree
(
filename
);
hr
=
IFileDialog_Unadvise
(
fd
,
cookie
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x.
\n
"
,
hr
);
IFileDialog_Release
(
fd
);
...
...
dlls/comdlg32/tests/printdlg.c
View file @
e240aeb7
...
...
@@ -65,7 +65,7 @@ static void test_PageSetupDlgA(void)
SetLastError
(
0xdeadbeef
);
res
=
PageSetupDlgA
(
NULL
);
ok
(
!
res
&&
(
CommDlgExtendedError
()
==
CDERR_INITIALIZATION
),
"returned %
u with %u and 0x%
x (expected '0' and "
"returned %
lu with %lu and 0x%l
x (expected '0' and "
"CDERR_INITIALIZATION)
\n
"
,
res
,
GetLastError
(),
CommDlgExtendedError
());
ZeroMemory
(
pDlg
,
sizeof
(
PAGESETUPDLGA
));
...
...
@@ -73,7 +73,7 @@ static void test_PageSetupDlgA(void)
SetLastError
(
0xdeadbeef
);
res
=
PageSetupDlgA
(
pDlg
);
ok
(
!
res
&&
(
CommDlgExtendedError
()
==
CDERR_STRUCTSIZE
),
"returned %
u with %u and 0x%
x (expected '0' and "
"returned %
lu with %lu and 0x%l
x (expected '0' and "
"CDERR_STRUCTSIZE)
\n
"
,
res
,
GetLastError
(),
CommDlgExtendedError
());
ZeroMemory
(
pDlg
,
sizeof
(
PAGESETUPDLGA
));
...
...
@@ -82,7 +82,7 @@ static void test_PageSetupDlgA(void)
SetLastError
(
0xdeadbeef
);
res
=
PageSetupDlgA
(
pDlg
);
ok
(
!
res
&&
(
CommDlgExtendedError
()
==
CDERR_STRUCTSIZE
),
"returned %
u with %u and 0x%
x (expected '0' and CDERR_STRUCTSIZE)
\n
"
,
"returned %
lu with %lu and 0x%l
x (expected '0' and CDERR_STRUCTSIZE)
\n
"
,
res
,
GetLastError
(),
CommDlgExtendedError
());
...
...
@@ -92,7 +92,7 @@ static void test_PageSetupDlgA(void)
SetLastError
(
0xdeadbeef
);
res
=
PageSetupDlgA
(
pDlg
);
ok
(
res
||
(
CommDlgExtendedError
()
==
PDERR_NODEFAULTPRN
),
"returned %
u with %u and 0x%
x (expected '!= 0' or '0' and "
"returned %
lu with %lu and 0x%l
x (expected '!= 0' or '0' and "
"PDERR_NODEFAULTPRN)
\n
"
,
res
,
GetLastError
(),
CommDlgExtendedError
());
if
(
!
res
&&
(
CommDlgExtendedError
()
==
PDERR_NODEFAULTPRN
))
{
...
...
@@ -146,7 +146,7 @@ static void test_PrintDlgA(void)
SetLastError
(
0xdeadbeef
);
res
=
PrintDlgA
(
NULL
);
ok
(
!
res
&&
(
CommDlgExtendedError
()
==
CDERR_INITIALIZATION
),
"returned %
d with 0x%x and 0x%
x (expected '0' and "
"returned %
ld with 0x%lx and 0x%l
x (expected '0' and "
"CDERR_INITIALIZATION)
\n
"
,
res
,
GetLastError
(),
CommDlgExtendedError
());
ZeroMemory
(
pDlg
,
sizeof
(
PRINTDLGA
));
...
...
@@ -154,7 +154,7 @@ static void test_PrintDlgA(void)
SetLastError
(
0xdeadbeef
);
res
=
PrintDlgA
(
pDlg
);
ok
(
!
res
&&
(
CommDlgExtendedError
()
==
CDERR_STRUCTSIZE
),
"returned %
d with 0x%x and 0x%
x (expected '0' and "
"returned %
ld with 0x%lx and 0x%l
x (expected '0' and "
"CDERR_STRUCTSIZE)
\n
"
,
res
,
GetLastError
(),
CommDlgExtendedError
());
ZeroMemory
(
pDlg
,
sizeof
(
PRINTDLGA
));
...
...
@@ -163,7 +163,7 @@ static void test_PrintDlgA(void)
SetLastError
(
0xdeadbeef
);
res
=
PrintDlgA
(
pDlg
);
ok
(
!
res
&&
(
CommDlgExtendedError
()
==
CDERR_STRUCTSIZE
),
"returned %
u with %u and 0x%
x (expected '0' and "
"returned %
lu with %lu and 0x%l
x (expected '0' and "
"CDERR_STRUCTSIZE)
\n
"
,
res
,
GetLastError
(),
CommDlgExtendedError
());
...
...
@@ -173,7 +173,7 @@ static void test_PrintDlgA(void)
SetLastError
(
0xdeadbeef
);
res
=
PrintDlgA
(
pDlg
);
ok
(
res
||
(
CommDlgExtendedError
()
==
PDERR_NODEFAULTPRN
),
"returned %
d with 0x%x and 0x%
x (expected '!= 0' or '0' and "
"returned %
ld with 0x%lx and 0x%l
x (expected '!= 0' or '0' and "
"PDERR_NODEFAULTPRN)
\n
"
,
res
,
GetLastError
(),
CommDlgExtendedError
());
if
(
!
res
&&
(
CommDlgExtendedError
()
==
PDERR_NODEFAULTPRN
))
{
...
...
@@ -213,7 +213,7 @@ static void test_PrintDlgA(void)
res
=
GetProfileStringA
(
PrinterPortsA
,
device
,
emptyA
,
buffer
,
sizeof
(
buffer
));
ptr
=
strchr
(
buffer
,
','
);
ok
(
(
res
>
1
)
&&
(
ptr
!=
NULL
),
"got %
u with %
u and %p for '%s' (expected '>1' and '!= NULL')
\n
"
,
"got %
lu with %l
u and %p for '%s' (expected '>1' and '!= NULL')
\n
"
,
res
,
GetLastError
(),
ptr
,
buffer
);
if
(
ptr
)
ptr
[
0
]
=
'\0'
;
...
...
@@ -240,7 +240,7 @@ static void test_PrintDlgA(void)
pDlg
->
Flags
=
PD_ENABLEPRINTHOOK
;
pDlg
->
lpfnPrintHook
=
print_hook_proc
;
res
=
PrintDlgA
(
pDlg
);
ok
(
res
,
"PrintDlg error %#x
\n
"
,
CommDlgExtendedError
());
ok
(
res
,
"PrintDlg error %#
l
x
\n
"
,
CommDlgExtendedError
());
/* Version of Microsoft XPS Document Writer driver shipped before Win7
* reports that it can print multiple copies, but returns 1.
*/
...
...
@@ -259,7 +259,7 @@ static void test_PrintDlgA(void)
pDlg
->
Flags
=
PD_ENABLEPRINTHOOK
|
PD_USEDEVMODECOPIES
;
pDlg
->
lpfnPrintHook
=
print_hook_proc
;
res
=
PrintDlgA
(
pDlg
);
ok
(
res
,
"PrintDlg error %#x
\n
"
,
CommDlgExtendedError
());
ok
(
res
,
"PrintDlg error %#
l
x
\n
"
,
CommDlgExtendedError
());
ok
(
pDlg
->
nCopies
==
1
,
"expected nCopies 1, got %d
\n
"
,
pDlg
->
nCopies
);
ok
(
pDlg
->
hDevMode
!=
0
,
"hDevMode should not be 0
\n
"
);
dm
=
GlobalLock
(
pDlg
->
hDevMode
);
...
...
@@ -308,7 +308,7 @@ static HRESULT WINAPI callback_SelectionChange(IPrintDialogCallback *iface)
static
HRESULT
WINAPI
callback_HandleMessage
(
IPrintDialogCallback
*
iface
,
HWND
hdlg
,
UINT
msg
,
WPARAM
wp
,
LPARAM
lp
,
LRESULT
*
res
)
{
trace
(
"callback_HandleMessage %p,%04x,%
lx,%l
x,%p
\n
"
,
hdlg
,
msg
,
wp
,
lp
,
res
);
trace
(
"callback_HandleMessage %p,%04x,%
Ix,%I
x,%p
\n
"
,
hdlg
,
msg
,
wp
,
lp
,
res
);
/* *res = PD_RESULT_PRINT; */
return
S_OK
;
}
...
...
@@ -386,7 +386,7 @@ static void test_PrintDlgExW(void)
SetLastError
(
0xdeadbeef
);
res
=
pPrintDlgExW
(
NULL
);
ok
(
(
res
==
E_INVALIDARG
),
"got 0x%
x with %u and %
u (expected 'E_INVALIDARG')
\n
"
,
"got 0x%
lx with %lu and %l
u (expected 'E_INVALIDARG')
\n
"
,
res
,
GetLastError
(),
CommDlgExtendedError
()
);
}
...
...
@@ -400,7 +400,7 @@ static void test_PrintDlgExW(void)
SetLastError
(
0xdeadbeef
);
res
=
pPrintDlgExW
(
pDlg
);
ok
(
(
res
==
E_INVALIDARG
),
"got 0x%
x with %u and %
u (expected 'E_INVALIDARG')
\n
"
,
"got 0x%
lx with %lu and %l
u (expected 'E_INVALIDARG')
\n
"
,
res
,
GetLastError
(),
CommDlgExtendedError
());
...
...
@@ -410,7 +410,7 @@ static void test_PrintDlgExW(void)
SetLastError
(
0xdeadbeef
);
res
=
pPrintDlgExW
(
pDlg
);
ok
(
(
res
==
E_INVALIDARG
),
"got 0x%
x with %u and %
u (expected 'E_INVALIDARG')
\n
"
,
"got 0x%
lx with %lu and %l
u (expected 'E_INVALIDARG')
\n
"
,
res
,
GetLastError
(),
CommDlgExtendedError
());
...
...
@@ -419,7 +419,7 @@ static void test_PrintDlgExW(void)
SetLastError
(
0xdeadbeef
);
res
=
pPrintDlgExW
(
pDlg
);
ok
(
(
res
==
E_HANDLE
),
"got 0x%
x with %u and %
u (expected 'E_HANDLE')
\n
"
,
"got 0x%
lx with %lu and %l
u (expected 'E_HANDLE')
\n
"
,
res
,
GetLastError
(),
CommDlgExtendedError
());
/* nStartPage must be START_PAGE_GENERAL for the general page or a valid property sheet index */
...
...
@@ -428,7 +428,7 @@ static void test_PrintDlgExW(void)
pDlg
->
hwndOwner
=
GetDesktopWindow
();
pDlg
->
Flags
=
PD_RETURNDEFAULT
|
PD_NOWARNING
|
PD_NOPAGENUMS
;
res
=
pPrintDlgExW
(
pDlg
);
ok
((
res
==
E_INVALIDARG
),
"got 0x%x (expected 'E_INVALIDARG')
\n
"
,
res
);
ok
((
res
==
E_INVALIDARG
),
"got 0x%
l
x (expected 'E_INVALIDARG')
\n
"
,
res
);
/* Use PD_NOPAGENUMS or set nMaxPageRanges and lpPageRanges */
ZeroMemory
(
pDlg
,
sizeof
(
PRINTDLGEXW
));
...
...
@@ -437,7 +437,7 @@ static void test_PrintDlgExW(void)
pDlg
->
Flags
=
PD_RETURNDEFAULT
|
PD_NOWARNING
;
pDlg
->
nStartPage
=
START_PAGE_GENERAL
;
res
=
pPrintDlgExW
(
pDlg
);
ok
((
res
==
E_INVALIDARG
),
"got 0x%x (expected 'E_INVALIDARG')
\n
"
,
res
);
ok
((
res
==
E_INVALIDARG
),
"got 0x%
l
x (expected 'E_INVALIDARG')
\n
"
,
res
);
/* this is invalid: a valid lpPageRanges with 0 for nMaxPageRanges */
ZeroMemory
(
pDlg
,
sizeof
(
PRINTDLGEXW
));
...
...
@@ -447,7 +447,7 @@ static void test_PrintDlgExW(void)
pDlg
->
lpPageRanges
=
pagerange
;
pDlg
->
nStartPage
=
START_PAGE_GENERAL
;
res
=
pPrintDlgExW
(
pDlg
);
ok
((
res
==
E_INVALIDARG
),
"got 0x%x (expected 'E_INVALIDARG')
\n
"
,
res
);
ok
((
res
==
E_INVALIDARG
),
"got 0x%
l
x (expected 'E_INVALIDARG')
\n
"
,
res
);
/* this is invalid: NULL for lpPageRanges with a valid nMaxPageRanges */
ZeroMemory
(
pDlg
,
sizeof
(
PRINTDLGEXW
));
...
...
@@ -457,7 +457,7 @@ static void test_PrintDlgExW(void)
pDlg
->
nMaxPageRanges
=
1
;
pDlg
->
nStartPage
=
START_PAGE_GENERAL
;
res
=
pPrintDlgExW
(
pDlg
);
ok
((
res
==
E_INVALIDARG
),
"got 0x%x (expected 'E_INVALIDARG')
\n
"
,
res
);
ok
((
res
==
E_INVALIDARG
),
"got 0x%
l
x (expected 'E_INVALIDARG')
\n
"
,
res
);
/* this works: lpPageRanges with a valid nMaxPageRanges */
ZeroMemory
(
pDlg
,
sizeof
(
PRINTDLGEXW
));
...
...
@@ -475,7 +475,7 @@ static void test_PrintDlgExW(void)
return
;
}
ok
(
res
==
S_OK
,
"got 0x%x (expected S_OK)
\n
"
,
res
);
ok
(
res
==
S_OK
,
"got 0x%
l
x (expected S_OK)
\n
"
,
res
);
dn
=
GlobalLock
(
pDlg
->
hDevNames
);
ok
(
dn
!=
NULL
,
"expected '!= NULL' for GlobalLock(%p)
\n
"
,
pDlg
->
hDevNames
);
...
...
@@ -498,7 +498,7 @@ static void test_PrintDlgExW(void)
pDlg
->
Flags
=
PD_RETURNDEFAULT
|
PD_NOWARNING
|
PD_NOPAGENUMS
;
pDlg
->
nStartPage
=
START_PAGE_GENERAL
;
res
=
pPrintDlgExW
(
pDlg
);
ok
(
res
==
S_OK
,
"got 0x%x (expected S_OK)
\n
"
,
res
);
ok
(
res
==
S_OK
,
"got 0x%
l
x (expected S_OK)
\n
"
,
res
);
GlobalFree
(
pDlg
->
hDevMode
);
GlobalFree
(
pDlg
->
hDevNames
);
...
...
@@ -509,7 +509,7 @@ static void test_PrintDlgExW(void)
pDlg
->
Flags
=
PD_RETURNDEFAULT
|
PD_NOWARNING
|
PD_NOPAGENUMS
|
PD_RETURNDC
;
pDlg
->
nStartPage
=
START_PAGE_GENERAL
;
res
=
pPrintDlgExW
(
pDlg
);
ok
(
res
==
S_OK
,
"got 0x%x (expected S_OK)
\n
"
,
res
);
ok
(
res
==
S_OK
,
"got 0x%
l
x (expected S_OK)
\n
"
,
res
);
ok
(
pDlg
->
hDC
!=
NULL
,
"HDC missing for PD_RETURNDC
\n
"
);
GlobalFree
(
pDlg
->
hDevMode
);
GlobalFree
(
pDlg
->
hDevNames
);
...
...
@@ -522,7 +522,7 @@ static void test_PrintDlgExW(void)
pDlg
->
Flags
=
PD_RETURNDEFAULT
|
PD_NOWARNING
|
PD_NOPAGENUMS
|
PD_RETURNIC
;
pDlg
->
nStartPage
=
START_PAGE_GENERAL
;
res
=
pPrintDlgExW
(
pDlg
);
ok
(
res
==
S_OK
,
"got 0x%x (expected S_OK)
\n
"
,
res
);
ok
(
res
==
S_OK
,
"got 0x%
l
x (expected S_OK)
\n
"
,
res
);
ok
(
pDlg
->
hDC
!=
NULL
,
"HDC missing for PD_RETURNIC
\n
"
);
GlobalFree
(
pDlg
->
hDevMode
);
GlobalFree
(
pDlg
->
hDevNames
);
...
...
@@ -545,8 +545,8 @@ static void test_PrintDlgExW(void)
pDlg
->
lpCallback
=
&
unknown
;
pDlg
->
dwResultAction
=
S_OK
;
res
=
pPrintDlgExW
(
pDlg
);
ok
(
res
==
S_OK
,
"got 0x%x (expected S_OK)
\n
"
,
res
);
ok
(
pDlg
->
dwResultAction
==
PD_RESULT_PRINT
,
"expected PD_RESULT_PRINT, got %#x
\n
"
,
pDlg
->
dwResultAction
);
ok
(
res
==
S_OK
,
"got 0x%
l
x (expected S_OK)
\n
"
,
res
);
ok
(
pDlg
->
dwResultAction
==
PD_RESULT_PRINT
,
"expected PD_RESULT_PRINT, got %#
l
x
\n
"
,
pDlg
->
dwResultAction
);
ok
(
pDlg
->
hDC
!=
NULL
,
"HDC missing for PD_RETURNIC
\n
"
);
GlobalFree
(
pDlg
->
hDevMode
);
GlobalFree
(
pDlg
->
hDevNames
);
...
...
@@ -602,7 +602,7 @@ static void test_abort_proc(void)
ok
(
job_id
>
0
||
GetLastError
()
==
ERROR_SPL_NO_STARTDOC
,
/* Vista can fail with this error when using the XPS driver */
"StartDocA failed ret %d gle %d
\n
"
,
job_id
,
GetLastError
());
"StartDocA failed ret %d gle %
l
d
\n
"
,
job_id
,
GetLastError
());
if
(
job_id
<=
0
)
{
...
...
@@ -630,7 +630,7 @@ static void test_abort_proc(void)
end:
SetLastError
(
0xdeadbeef
);
if
(
!
DeleteFileA
(
filename
))
trace
(
"Failed to delete temporary file (err = %x)
\n
"
,
GetLastError
());
trace
(
"Failed to delete temporary file (err = %
l
x)
\n
"
,
GetLastError
());
}
/* ########################### */
...
...
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