Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
d7c95765
Commit
d7c95765
authored
Sep 12, 2022
by
Connor McAdams
Committed by
Alexandre Julliard
Sep 20, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uiautomationcore: Increment module reference count when starting provider thread.
Signed-off-by:
Connor McAdams
<
cmcadams@codeweavers.com
>
parent
02b87a40
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
2 deletions
+33
-2
uia_main.c
dlls/uiautomationcore/uia_main.c
+23
-0
uia_private.h
dlls/uiautomationcore/uia_private.h
+2
-0
uia_provider.c
dlls/uiautomationcore/uia_provider.c
+8
-2
No files found.
dlls/uiautomationcore/uia_main.c
View file @
d7c95765
...
...
@@ -27,6 +27,8 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
uiautomation
);
HMODULE
huia_module
;
struct
uia_object_wrapper
{
IUnknown
IUnknown_iface
;
...
...
@@ -349,3 +351,24 @@ HRESULT WINAPI UiaDisconnectProvider(IRawElementProviderSimple *provider)
FIXME
(
"(%p): stub
\n
"
,
provider
);
return
E_NOTIMPL
;
}
/***********************************************************************
* DllMain (uiautomationcore.@)
*/
BOOL
WINAPI
DllMain
(
HINSTANCE
hinst
,
DWORD
reason
,
void
*
reserved
)
{
TRACE
(
"(%p, %ld, %p)
\n
"
,
hinst
,
reason
,
reserved
);
switch
(
reason
)
{
case
DLL_PROCESS_ATTACH
:
DisableThreadLibraryCalls
(
hinst
);
huia_module
=
hinst
;
break
;
default:
break
;
}
return
TRUE
;
}
dlls/uiautomationcore/uia_private.h
View file @
d7c95765
...
...
@@ -21,6 +21,8 @@
#include "uiautomation.h"
#include "uia_classes.h"
extern
HMODULE
huia_module
DECLSPEC_HIDDEN
;
enum
uia_prop_type
{
PROP_TYPE_UNKNOWN
,
PROP_TYPE_ELEM_PROP
,
...
...
dlls/uiautomationcore/uia_provider.c
View file @
d7c95765
...
...
@@ -1193,7 +1193,7 @@ static DWORD WINAPI uia_provider_thread_proc(void *arg)
{
WARN
(
"CreateWindow failed: %ld
\n
"
,
GetLastError
());
CoUninitialize
();
ExitThread
(
1
);
FreeLibraryAndExitThread
(
huia_module
,
1
);
}
SetWindowLongPtrW
(
hwnd
,
GWLP_WNDPROC
,
(
LONG_PTR
)
uia_provider_thread_msg_proc
);
...
...
@@ -1212,7 +1212,7 @@ static DWORD WINAPI uia_provider_thread_proc(void *arg)
DestroyWindow
(
hwnd
);
CoUninitialize
();
ExitThread
(
0
);
FreeLibraryAndExitThread
(
huia_module
,
0
);
}
static
BOOL
uia_start_provider_thread
(
void
)
...
...
@@ -1224,12 +1224,18 @@ static BOOL uia_start_provider_thread(void)
{
HANDLE
ready_event
;
HANDLE
events
[
2
];
HMODULE
hmodule
;
DWORD
wait_obj
;
/* Increment DLL reference count. */
GetModuleHandleExW
(
GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS
,
(
const
WCHAR
*
)
uia_start_provider_thread
,
&
hmodule
);
events
[
0
]
=
ready_event
=
CreateEventW
(
NULL
,
FALSE
,
FALSE
,
NULL
);
if
(
!
(
provider_thread
.
hthread
=
CreateThread
(
NULL
,
0
,
uia_provider_thread_proc
,
ready_event
,
0
,
NULL
)))
{
FreeLibrary
(
hmodule
);
started
=
FALSE
;
goto
exit
;
}
...
...
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