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
7aa1b2e4
Commit
7aa1b2e4
authored
Apr 23, 2007
by
Lei Zhang
Committed by
Alexandre Julliard
Apr 24, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comdlg32: Initialize CommDlgExtendedError() return value for file dialogs.
parent
2100b9dc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
112 additions
and
1 deletion
+112
-1
filedlg.c
dlls/comdlg32/filedlg.c
+6
-0
Makefile.in
dlls/comdlg32/tests/Makefile.in
+2
-1
filedlg.c
dlls/comdlg32/tests/filedlg.c
+104
-0
No files found.
dlls/comdlg32/filedlg.c
View file @
7aa1b2e4
...
@@ -323,6 +323,9 @@ BOOL WINAPI GetFileDialog95A(LPOPENFILENAMEA ofn,UINT iDlgType)
...
@@ -323,6 +323,9 @@ BOOL WINAPI GetFileDialog95A(LPOPENFILENAMEA ofn,UINT iDlgType)
LPWSTR
filter
=
NULL
;
LPWSTR
filter
=
NULL
;
LPWSTR
customfilter
=
NULL
;
LPWSTR
customfilter
=
NULL
;
/* Initialize CommDlgExtendedError() */
COMDLG32_SetCommDlgExtendedError
(
0
);
/* Initialize FileOpenDlgInfos structure */
/* Initialize FileOpenDlgInfos structure */
ZeroMemory
(
&
fodInfos
,
sizeof
(
FileOpenDlgInfos
));
ZeroMemory
(
&
fodInfos
,
sizeof
(
FileOpenDlgInfos
));
...
@@ -453,6 +456,9 @@ BOOL WINAPI GetFileDialog95W(LPOPENFILENAMEW ofn,UINT iDlgType)
...
@@ -453,6 +456,9 @@ BOOL WINAPI GetFileDialog95W(LPOPENFILENAMEW ofn,UINT iDlgType)
FileOpenDlgInfos
fodInfos
;
FileOpenDlgInfos
fodInfos
;
LPWSTR
lpstrSavDir
=
NULL
;
LPWSTR
lpstrSavDir
=
NULL
;
/* Initialize CommDlgExtendedError() */
COMDLG32_SetCommDlgExtendedError
(
0
);
/* Initialize FileOpenDlgInfos structure */
/* Initialize FileOpenDlgInfos structure */
ZeroMemory
(
&
fodInfos
,
sizeof
(
FileOpenDlgInfos
));
ZeroMemory
(
&
fodInfos
,
sizeof
(
FileOpenDlgInfos
));
...
...
dlls/comdlg32/tests/Makefile.in
View file @
7aa1b2e4
...
@@ -3,9 +3,10 @@ TOPOBJDIR = ../../..
...
@@ -3,9 +3,10 @@ TOPOBJDIR = ../../..
SRCDIR
=
@srcdir@
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
VPATH
=
@srcdir@
TESTDLL
=
comdlg32.dll
TESTDLL
=
comdlg32.dll
IMPORTS
=
comdlg32 kernel32
IMPORTS
=
comdlg32
user32
kernel32
CTESTS
=
\
CTESTS
=
\
filedlg.c
\
printdlg.c
printdlg.c
@MAKE_TEST_RULES@
@MAKE_TEST_RULES@
...
...
dlls/comdlg32/tests/filedlg.c
0 → 100644
View file @
7aa1b2e4
/*
* Unit test suite for comdlg32 API functions: file dialogs
*
* Copyright 2007 Google (Lei Zhang)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
*/
#include <windows.h>
#include <wine/test.h>
/* ##### */
static
UINT
CALLBACK
OFNHookProc
(
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
);
}
}
return
0
;
}
/* bug 6829 */
static
void
test_DialogCancel
(
void
)
{
OPENFILENAMEA
ofn
;
BOOL
result
;
char
szFileName
[
MAX_PATH
]
=
""
;
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
=
(
LPOFNHOOKPROC
)
OFNHookProc
;
PrintDlgA
(
NULL
);
ok
(
CDERR_INITIALIZATION
==
CommDlgExtendedError
(),
"expected %d, got %d
\n
"
,
CDERR_INITIALIZATION
,
CommDlgExtendedError
());
result
=
GetOpenFileNameA
(
&
ofn
);
ok
(
0
==
result
,
"expected %d, got %d
\n
"
,
0
,
result
);
ok
(
0
==
CommDlgExtendedError
(),
"expected %d, got %d
\n
"
,
0
,
CommDlgExtendedError
());
PrintDlgA
(
NULL
);
ok
(
CDERR_INITIALIZATION
==
CommDlgExtendedError
(),
"expected %d, got %d
\n
"
,
CDERR_INITIALIZATION
,
CommDlgExtendedError
());
result
=
GetOpenFileNameW
((
LPOPENFILENAMEW
)
&
ofn
);
ok
(
0
==
result
,
"expected %d, got %d
\n
"
,
0
,
result
);
ok
(
0
==
CommDlgExtendedError
(),
"expected %d, got %d
\n
"
,
0
,
CommDlgExtendedError
());
PrintDlgA
(
NULL
);
ok
(
CDERR_INITIALIZATION
==
CommDlgExtendedError
(),
"expected %d, got %d
\n
"
,
CDERR_INITIALIZATION
,
CommDlgExtendedError
());
result
=
GetSaveFileNameA
(
&
ofn
);
ok
(
0
==
result
,
"expected %d, got %d
\n
"
,
0
,
result
);
ok
(
0
==
CommDlgExtendedError
(),
"expected %d, got %d
\n
"
,
0
,
CommDlgExtendedError
());
PrintDlgA
(
NULL
);
ok
(
CDERR_INITIALIZATION
==
CommDlgExtendedError
(),
"expected %d, got %d
\n
"
,
CDERR_INITIALIZATION
,
CommDlgExtendedError
());
result
=
GetSaveFileNameW
((
LPOPENFILENAMEW
)
&
ofn
);
ok
(
0
==
result
,
"expected %d, got %d
\n
"
,
0
,
result
);
ok
(
0
==
CommDlgExtendedError
(),
"expected %d, got %d
\n
"
,
0
,
CommDlgExtendedError
());
}
START_TEST
(
filedlg
)
{
test_DialogCancel
();
}
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