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
dc1f9a11
Commit
dc1f9a11
authored
Mar 04, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 04, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Factor out find_class.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
cc4fb58d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
45 deletions
+34
-45
class.c
dlls/user32/class.c
+34
-45
No files found.
dlls/user32/class.c
View file @
dc1f9a11
...
...
@@ -296,6 +296,32 @@ static void CLASS_FreeClass( CLASS *classPtr )
USER_Unlock
();
}
static
CLASS
*
find_class
(
HINSTANCE
instance
,
const
WCHAR
*
name
)
{
ATOM
atom
=
get_int_atom_value
(
name
);
CLASS
*
class
;
USER_Lock
();
LIST_FOR_EACH_ENTRY
(
class
,
&
class_list
,
CLASS
,
entry
)
{
if
(
atom
)
{
if
(
class
->
atomName
!=
atom
)
continue
;
}
else
{
if
(
wcsicmp
(
class
->
name
,
name
))
continue
;
}
if
(
!
class
->
local
||
class
->
hInstance
==
instance
)
{
TRACE
(
"%s %p -> %p
\n
"
,
debugstr_w
(
name
),
instance
,
class
);
return
class
;
}
}
USER_Unlock
();
return
NULL
;
}
const
WCHAR
*
CLASS_GetVersionedName
(
const
WCHAR
*
name
,
UINT
*
basename_offset
,
WCHAR
*
combined
,
BOOL
register_class
)
{
ACTCTX_SECTION_KEYED_DATA
data
;
...
...
@@ -349,25 +375,9 @@ const WCHAR *CLASS_GetVersionedName( const WCHAR *name, UINT *basename_offset, W
if
(
register_class
&&
hmod
)
{
BOOL
found
=
FALSE
;
struct
list
*
ptr
;
CLASS
*
class
;
USER_Lock
();
LIST_FOR_EACH
(
ptr
,
&
class_list
)
{
CLASS
*
class
=
LIST_ENTRY
(
ptr
,
CLASS
,
entry
);
if
(
wcsicmp
(
class
->
name
,
ret
))
continue
;
if
(
!
class
->
local
||
class
->
hInstance
==
hmod
)
{
found
=
TRUE
;
break
;
}
}
USER_Unlock
();
if
(
!
found
)
if
(
!
(
class
=
find_class
(
hmod
,
ret
)))
{
BOOL
(
WINAPI
*
pRegisterClassNameW
)(
const
WCHAR
*
class
);
...
...
@@ -375,6 +385,7 @@ const WCHAR *CLASS_GetVersionedName( const WCHAR *name, UINT *basename_offset, W
if
(
pRegisterClassNameW
)
pRegisterClassNameW
(
name
);
}
else
release_class_ptr
(
class
);
}
return
ret
;
...
...
@@ -387,8 +398,7 @@ const WCHAR *CLASS_GetVersionedName( const WCHAR *name, UINT *basename_offset, W
*/
static
CLASS
*
CLASS_FindClass
(
LPCWSTR
name
,
HINSTANCE
hinstance
)
{
struct
list
*
ptr
;
ATOM
atom
=
get_int_atom_value
(
name
);
CLASS
*
class
;
GetDesktopWindow
();
/* create the desktop window to trigger builtin class registration */
...
...
@@ -396,38 +406,17 @@ static CLASS *CLASS_FindClass( LPCWSTR name, HINSTANCE hinstance )
name
=
CLASS_GetVersionedName
(
name
,
NULL
,
NULL
,
TRUE
);
for
(;;
)
while
(
!
(
class
=
find_class
(
hinstance
,
name
))
)
{
USER_Lock
();
LIST_FOR_EACH
(
ptr
,
&
class_list
)
{
CLASS
*
class
=
LIST_ENTRY
(
ptr
,
CLASS
,
entry
);
if
(
atom
)
{
if
(
class
->
atomName
!=
atom
)
continue
;
}
else
{
if
(
wcsicmp
(
class
->
name
,
name
))
continue
;
}
if
(
!
class
->
local
||
class
->
hInstance
==
hinstance
)
{
TRACE
(
"%s %p -> %p
\n
"
,
debugstr_w
(
name
),
hinstance
,
class
);
return
class
;
}
}
USER_Unlock
();
if
(
atom
)
break
;
if
(
IS_INTRESOURCE
(
name
))
break
;
if
(
!
is_comctl32_class
(
name
))
break
;
if
(
GetModuleHandleW
(
L"comctl32.dll"
))
break
;
if
(
!
LoadLibraryW
(
L"comctl32.dll"
))
break
;
TRACE
(
"%s retrying after loading comctl32
\n
"
,
debugstr_w
(
name
)
);
}
TRACE
(
"%s %p -> not found
\n
"
,
debugstr_w
(
name
),
hinstance
);
return
NULL
;
if
(
!
class
)
TRACE
(
"%s %p -> not found
\n
"
,
debugstr_w
(
name
),
hinstance
);
return
class
;
}
/***********************************************************************
...
...
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