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
6a3c56a5
Commit
6a3c56a5
authored
Sep 16, 2009
by
Paul Vriens
Committed by
Alexandre Julliard
Sep 16, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comdlg32/tests: Test the correct path length for CDM_GETFOLDERPATH.
parent
e997909b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
0 deletions
+62
-0
filedlg.c
dlls/comdlg32/tests/filedlg.c
+62
-0
No files found.
dlls/comdlg32/tests/filedlg.c
View file @
6a3c56a5
...
...
@@ -873,6 +873,67 @@ static void test_arrange(void)
}
}
static
CHAR
WINDIR
[
MAX_PATH
];
static
UINT_PTR
CALLBACK
path_hook_proc
(
HWND
hDlg
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
LPNMHDR
nmh
;
if
(
msg
==
WM_NOTIFY
)
{
nmh
=
(
LPNMHDR
)
lParam
;
if
(
nmh
->
code
==
CDN_INITDONE
)
{
PostMessage
(
GetParent
(
hDlg
),
WM_COMMAND
,
IDCANCEL
,
FALSE
);
}
else
if
(
nmh
->
code
==
CDN_FOLDERCHANGE
)
{
char
buf
[
1024
];
int
ret
;
memset
(
buf
,
0x66
,
sizeof
(
buf
));
ret
=
SendMessageA
(
GetParent
(
hDlg
),
CDM_GETFOLDERPATH
,
sizeof
(
buf
),
(
LPARAM
)
buf
);
ok
(
!
lstrcmpA
(
WINDIR
,
buf
),
"Expected '%s', got '%s'
\n
"
,
WINDIR
,
buf
);
ok
(
lstrlenA
(
WINDIR
)
+
1
==
ret
,
"Expected %d, got %d
\n
"
,
lstrlenA
(
WINDIR
)
+
1
,
ret
);
}
}
return
0
;
}
static
void
test_getfolderpath
(
void
)
{
OPENFILENAMEA
ofn
;
BOOL
result
;
char
szFileName
[
MAX_PATH
]
=
""
;
char
szInitialDir
[
MAX_PATH
];
GetWindowsDirectory
(
szInitialDir
,
MAX_PATH
);
lstrcpyA
(
WINDIR
,
szInitialDir
);
ZeroMemory
(
&
ofn
,
sizeof
(
ofn
));
ofn
.
lStructSize
=
sizeof
(
ofn
);
ofn
.
hwndOwner
=
NULL
;
ofn
.
lpstrFilter
=
"Text Files (*.txt)
\0
*.txt
\0
All Files (*.*)
\0
*.*
\0
"
;
ofn
.
lpstrFile
=
szFileName
;
ofn
.
nMaxFile
=
MAX_PATH
;
ofn
.
Flags
=
OFN_EXPLORER
|
OFN_FILEMUSTEXIST
|
OFN_HIDEREADONLY
|
OFN_ENABLEHOOK
;
ofn
.
lpstrDefExt
=
"txt"
;
ofn
.
lpfnHook
=
path_hook_proc
;
ofn
.
lpstrInitialDir
=
szInitialDir
;
result
=
GetOpenFileNameA
(
&
ofn
);
ok
(
0
==
result
,
"expected 0, got %d
\n
"
,
result
);
ok
(
0
==
CommDlgExtendedError
(),
"expected 0, got %d
\n
"
,
CommDlgExtendedError
());
result
=
GetSaveFileNameA
(
&
ofn
);
ok
(
0
==
result
,
"expected 0, got %d
\n
"
,
result
);
ok
(
0
==
CommDlgExtendedError
(),
"expected 0, got %d
\n
"
,
CommDlgExtendedError
());
}
START_TEST
(
filedlg
)
{
test_DialogCancel
();
...
...
@@ -881,4 +942,5 @@ START_TEST(filedlg)
test_arrange
();
test_resize
();
test_ok
();
test_getfolderpath
();
}
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