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
ba7207cb
Commit
ba7207cb
authored
Feb 14, 2007
by
Louis Lenders
Committed by
Alexandre Julliard
Feb 15, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Fix error return values in DialogBoxParam + simple test.
parent
ee3ac7a8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
6 deletions
+30
-6
dialog.c
dlls/user32/dialog.c
+6
-6
dialog.c
dlls/user32/tests/dialog.c
+15
-0
resource.rc
dlls/user32/tests/resource.rc
+9
-0
No files found.
dlls/user32/dialog.c
View file @
ba7207cb
...
@@ -800,11 +800,11 @@ INT_PTR WINAPI DialogBoxParamA( HINSTANCE hInst, LPCSTR name,
...
@@ -800,11 +800,11 @@ INT_PTR WINAPI DialogBoxParamA( HINSTANCE hInst, LPCSTR name,
HRSRC
hrsrc
;
HRSRC
hrsrc
;
LPCDLGTEMPLATEA
ptr
;
LPCDLGTEMPLATEA
ptr
;
if
(
!
(
hrsrc
=
FindResourceA
(
hInst
,
name
,
(
LPSTR
)
RT_DIALOG
)))
return
0
;
if
(
!
(
hrsrc
=
FindResourceA
(
hInst
,
name
,
(
LPSTR
)
RT_DIALOG
)))
return
-
1
;
if
(
!
(
ptr
=
(
LPCDLGTEMPLATEA
)
LoadResource
(
hInst
,
hrsrc
)))
return
0
;
if
(
!
(
ptr
=
(
LPCDLGTEMPLATEA
)
LoadResource
(
hInst
,
hrsrc
)))
return
-
1
;
hwnd
=
DIALOG_CreateIndirect
(
hInst
,
ptr
,
owner
,
dlgProc
,
param
,
FALSE
,
TRUE
);
hwnd
=
DIALOG_CreateIndirect
(
hInst
,
ptr
,
owner
,
dlgProc
,
param
,
FALSE
,
TRUE
);
if
(
hwnd
)
return
DIALOG_DoDialogBox
(
hwnd
,
owner
);
if
(
hwnd
)
return
DIALOG_DoDialogBox
(
hwnd
,
owner
);
return
-
1
;
return
0
;
}
}
...
@@ -818,11 +818,11 @@ INT_PTR WINAPI DialogBoxParamW( HINSTANCE hInst, LPCWSTR name,
...
@@ -818,11 +818,11 @@ INT_PTR WINAPI DialogBoxParamW( HINSTANCE hInst, LPCWSTR name,
HRSRC
hrsrc
;
HRSRC
hrsrc
;
LPCDLGTEMPLATEW
ptr
;
LPCDLGTEMPLATEW
ptr
;
if
(
!
(
hrsrc
=
FindResourceW
(
hInst
,
name
,
(
LPWSTR
)
RT_DIALOG
)))
return
0
;
if
(
!
(
hrsrc
=
FindResourceW
(
hInst
,
name
,
(
LPWSTR
)
RT_DIALOG
)))
return
-
1
;
if
(
!
(
ptr
=
(
LPCDLGTEMPLATEW
)
LoadResource
(
hInst
,
hrsrc
)))
return
0
;
if
(
!
(
ptr
=
(
LPCDLGTEMPLATEW
)
LoadResource
(
hInst
,
hrsrc
)))
return
-
1
;
hwnd
=
DIALOG_CreateIndirect
(
hInst
,
ptr
,
owner
,
dlgProc
,
param
,
TRUE
,
TRUE
);
hwnd
=
DIALOG_CreateIndirect
(
hInst
,
ptr
,
owner
,
dlgProc
,
param
,
TRUE
,
TRUE
);
if
(
hwnd
)
return
DIALOG_DoDialogBox
(
hwnd
,
owner
);
if
(
hwnd
)
return
DIALOG_DoDialogBox
(
hwnd
,
owner
);
return
-
1
;
return
0
;
}
}
...
...
dlls/user32/tests/dialog.c
View file @
ba7207cb
...
@@ -861,6 +861,20 @@ static void test_GetDlgItemText(void)
...
@@ -861,6 +861,20 @@ static void test_GetDlgItemText(void)
ok
(
string
[
0
]
==
'\0'
,
"string retrieved using GetDlgItemText should have been NULL terminated
\n
"
);
ok
(
string
[
0
]
==
'\0'
,
"string retrieved using GetDlgItemText should have been NULL terminated
\n
"
);
}
}
static
void
test_DialogBoxParamA
(
void
)
{
int
ret
;
HWND
hwnd_invalid
=
(
HWND
)
0x4444
;
SetLastError
(
0xdeadbeef
);
ret
=
DialogBoxParamA
(
GetModuleHandle
(
NULL
),
"IDD_DIALOG"
,
hwnd_invalid
,
0
,
0
);
ok
(
0
==
ret
,
"DialogBoxParamA returned %d, expected 0
\n
"
,
ret
);
ok
(
ERROR_INVALID_WINDOW_HANDLE
==
GetLastError
(),
"got %d, expected ERROR_INVALID_WINDOW_HANDLE
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
DialogBoxParamA
(
GetModuleHandle
(
NULL
),
"RESOURCE_INVALID"
,
0
,
0
,
0
);
ok
(
-
1
==
ret
,
"DialogBoxParamA returned %d, expected -1
\n
"
,
ret
);
ok
(
ERROR_RESOURCE_NAME_NOT_FOUND
==
GetLastError
(),
"got %d, expected ERROR_RESOURCE_NAME_NOT_FOUND
\n
"
,
GetLastError
());
}
START_TEST
(
dialog
)
START_TEST
(
dialog
)
{
{
...
@@ -873,4 +887,5 @@ START_TEST(dialog)
...
@@ -873,4 +887,5 @@ START_TEST(dialog)
WM_NEXTDLGCTLTest
();
WM_NEXTDLGCTLTest
();
InitialFocusTest
();
InitialFocusTest
();
test_GetDlgItemText
();
test_GetDlgItemText
();
test_DialogBoxParamA
();
}
}
dlls/user32/tests/resource.rc
View file @
ba7207cb
...
@@ -80,6 +80,15 @@ FONT 8, "MS Shell Dlg"
...
@@ -80,6 +80,15 @@ FONT 8, "MS Shell Dlg"
EDITTEXT 200,4,4,50,14
EDITTEXT 200,4,4,50,14
}
}
IDD_DIALOG DIALOG DISCARDABLE 0, 0, 186, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Dialog"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,129,7,50,14
PUSHBUTTON "Cancel",IDCANCEL,129,24,50,14
END
/* BINRES test_mono.bmp */
/* BINRES test_mono.bmp */
100 BITMAP test_mono.bmp
100 BITMAP test_mono.bmp
/* {
/* {
...
...
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