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
0739aa61
Commit
0739aa61
authored
Aug 19, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 25, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Pass resource ID as a string in DIALOG_CreateControls32.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=53566
parent
2e9c40d5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
91 additions
and
1 deletion
+91
-1
dialog.c
dlls/user32/dialog.c
+22
-1
dialog.c
dlls/user32/tests/dialog.c
+59
-0
resource.rc
dlls/user32/tests/resource.rc
+10
-0
No files found.
dlls/user32/dialog.c
View file @
0739aa61
...
@@ -220,8 +220,19 @@ static BOOL DIALOG_CreateControls32( HWND hwnd, LPCSTR template, const DLG_TEMPL
...
@@ -220,8 +220,19 @@ static BOOL DIALOG_CreateControls32( HWND hwnd, LPCSTR template, const DLG_TEMPL
}
}
if
(
unicode
)
if
(
unicode
)
{
{
const
WCHAR
*
caption
=
info
.
windowName
;
WCHAR
caption_buf
[
3
];
if
(
IS_INTRESOURCE
(
caption
)
&&
caption
)
{
caption_buf
[
0
]
=
0xffff
;
caption_buf
[
1
]
=
PtrToUlong
(
caption
);
caption_buf
[
2
]
=
0
;
caption
=
caption_buf
;
}
hwndCtrl
=
CreateWindowExW
(
info
.
exStyle
|
WS_EX_NOPARENTNOTIFY
,
hwndCtrl
=
CreateWindowExW
(
info
.
exStyle
|
WS_EX_NOPARENTNOTIFY
,
info
.
className
,
info
.
windowName
,
info
.
className
,
caption
,
info
.
style
|
WS_CHILD
,
info
.
style
|
WS_CHILD
,
MulDiv
(
info
.
x
,
dlgInfo
->
xBaseUnit
,
4
),
MulDiv
(
info
.
x
,
dlgInfo
->
xBaseUnit
,
4
),
MulDiv
(
info
.
y
,
dlgInfo
->
yBaseUnit
,
8
),
MulDiv
(
info
.
y
,
dlgInfo
->
yBaseUnit
,
8
),
...
@@ -236,6 +247,7 @@ static BOOL DIALOG_CreateControls32( HWND hwnd, LPCSTR template, const DLG_TEMPL
...
@@ -236,6 +247,7 @@ static BOOL DIALOG_CreateControls32( HWND hwnd, LPCSTR template, const DLG_TEMPL
LPCSTR
caption
=
(
LPCSTR
)
info
.
windowName
;
LPCSTR
caption
=
(
LPCSTR
)
info
.
windowName
;
LPSTR
class_tmp
=
NULL
;
LPSTR
class_tmp
=
NULL
;
LPSTR
caption_tmp
=
NULL
;
LPSTR
caption_tmp
=
NULL
;
char
caption_buf
[
4
];
if
(
!
IS_INTRESOURCE
(
class
))
if
(
!
IS_INTRESOURCE
(
class
))
{
{
...
@@ -251,6 +263,15 @@ static BOOL DIALOG_CreateControls32( HWND hwnd, LPCSTR template, const DLG_TEMPL
...
@@ -251,6 +263,15 @@ static BOOL DIALOG_CreateControls32( HWND hwnd, LPCSTR template, const DLG_TEMPL
WideCharToMultiByte
(
CP_ACP
,
0
,
info
.
windowName
,
-
1
,
caption_tmp
,
len
,
NULL
,
NULL
);
WideCharToMultiByte
(
CP_ACP
,
0
,
info
.
windowName
,
-
1
,
caption_tmp
,
len
,
NULL
,
NULL
);
caption
=
caption_tmp
;
caption
=
caption_tmp
;
}
}
else
if
(
caption
)
{
caption_buf
[
0
]
=
0xff
;
caption_buf
[
1
]
=
PtrToUlong
(
caption
);
caption_buf
[
2
]
=
PtrToUlong
(
caption
)
>>
8
;
caption_buf
[
3
]
=
0
;
caption
=
caption_buf
;
}
hwndCtrl
=
CreateWindowExA
(
info
.
exStyle
|
WS_EX_NOPARENTNOTIFY
,
hwndCtrl
=
CreateWindowExA
(
info
.
exStyle
|
WS_EX_NOPARENTNOTIFY
,
class
,
caption
,
info
.
style
|
WS_CHILD
,
class
,
caption
,
info
.
style
|
WS_CHILD
,
MulDiv
(
info
.
x
,
dlgInfo
->
xBaseUnit
,
4
),
MulDiv
(
info
.
x
,
dlgInfo
->
xBaseUnit
,
4
),
...
...
dlls/user32/tests/dialog.c
View file @
0739aa61
...
@@ -2260,6 +2260,64 @@ static void test_capture_release(void)
...
@@ -2260,6 +2260,64 @@ static void test_capture_release(void)
DestroyWindow
(
window
);
DestroyWindow
(
window
);
}
}
static
WNDPROC
orig_static_proc
;
static
WCHAR
cs_name_paramW
[
3
];
static
char
cs_name_paramA
[
4
];
static
LRESULT
WINAPI
test_static_create_procW
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
{
if
(
msg
==
WM_NCCREATE
)
{
CREATESTRUCTW
*
cs
=
(
CREATESTRUCTW
*
)
lparam
;
memcpy
(
cs_name_paramW
,
cs
->
lpszName
,
sizeof
(
cs_name_paramW
)
);
}
return
orig_static_proc
(
hwnd
,
msg
,
wparam
,
lparam
);
}
static
LRESULT
WINAPI
test_static_create_procA
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
{
if
(
msg
==
WM_NCCREATE
)
{
CREATESTRUCTA
*
cs
=
(
CREATESTRUCTA
*
)
lparam
;
memcpy
(
cs_name_paramA
,
cs
->
lpszName
,
sizeof
(
cs_name_paramA
)
);
}
return
orig_static_proc
(
hwnd
,
msg
,
wparam
,
lparam
);
}
static
void
test_create_controls
(
void
)
{
HWND
control
;
INT_PTR
ret
;
control
=
CreateWindowA
(
"static"
,
""
,
0
,
100
,
200
,
300
,
400
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
control
!=
0
,
"failed to create control window
\n
"
);
orig_static_proc
=
(
WNDPROC
)
SetClassLongPtrA
(
control
,
GCLP_WNDPROC
,
(
ULONG_PTR
)
test_static_create_procA
);
cs_name_paramW
[
0
]
=
0
;
ret
=
DialogBoxParamA
(
GetModuleHandleA
(
NULL
),
"IDD_SS_ICON_DIALOG"
,
0
,
DestroyOnCloseDlgWinProc
,
0
);
ok
(
0
==
ret
,
"DialogBoxParamA returned %Id, expected 0
\n
"
,
ret
);
ok
(
!
memcmp
(
cs_name_paramA
,
"
\xff\0\x61
"
,
3
),
"name param = %s
\n
"
,
debugstr_an
(
cs_name_paramA
,
3
));
SetClassLongPtrA
(
control
,
GCLP_WNDPROC
,
(
ULONG_PTR
)
orig_static_proc
);
DestroyWindow
(
control
);
control
=
CreateWindowW
(
L"static"
,
L""
,
0
,
100
,
200
,
300
,
400
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
control
!=
0
,
"failed to create control window
\n
"
);
orig_static_proc
=
(
WNDPROC
)
SetClassLongPtrW
(
control
,
GCLP_WNDPROC
,
(
ULONG_PTR
)
test_static_create_procW
);
ret
=
DialogBoxParamW
(
GetModuleHandleW
(
NULL
),
L"IDD_SS_ICON_DIALOG"
,
0
,
DestroyOnCloseDlgWinProc
,
0
);
ok
(
0
==
ret
,
"DialogBoxParamW returned %Id, expected 0
\n
"
,
ret
);
ok
(
!
memcmp
(
cs_name_paramW
,
L"
\xffff\x6100
"
,
2
*
sizeof
(
WCHAR
)),
"name param = %s
\n
"
,
debugstr_wn
(
cs_name_paramW
,
2
));
SetClassLongPtrW
(
control
,
GCLP_WNDPROC
,
(
ULONG_PTR
)
orig_static_proc
);
DestroyWindow
(
control
);
}
START_TEST
(
dialog
)
START_TEST
(
dialog
)
{
{
g_hinst
=
GetModuleHandleA
(
0
);
g_hinst
=
GetModuleHandleA
(
0
);
...
@@ -2273,6 +2331,7 @@ START_TEST(dialog)
...
@@ -2273,6 +2331,7 @@ START_TEST(dialog)
test_focus
();
test_focus
();
test_GetDlgItem
();
test_GetDlgItem
();
test_GetDlgItemText
();
test_GetDlgItemText
();
test_create_controls
();
test_DialogBoxParam
();
test_DialogBoxParam
();
test_DisabledDialogTest
();
test_DisabledDialogTest
();
test_MessageBoxFontTest
();
test_MessageBoxFontTest
();
...
...
dlls/user32/tests/resource.rc
View file @
0739aa61
...
@@ -276,3 +276,13 @@ FONT 8, "MS Shell Dlg"
...
@@ -276,3 +276,13 @@ FONT 8, "MS Shell Dlg"
}
}
MENUITEM "&Quit", 300
MENUITEM "&Quit", 300
}
}
IDD_SS_ICON_DIALOG DIALOG 0, 0, 186, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Dialog"
FONT 8, "MS Sans Serif"
BEGIN
CONTROL 0x6100, 1003, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 7, 57, 21, 20
DEFPUSHBUTTON "OK",IDOK,129,7,50,14
PUSHBUTTON "Cancel",IDCANCEL,129,24,50,14
END
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