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
1d8879bc
Commit
1d8879bc
authored
Apr 04, 2007
by
Rob Shearman
Committed by
Alexandre Julliard
Apr 04, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Add a test that shows CoFreeUnusedLibraries only frees unused libraries…
ole32: Add a test that shows CoFreeUnusedLibraries only frees unused libraries from the current apartment.
parent
c40f1b66
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
0 deletions
+53
-0
compobj.c
dlls/ole32/tests/compobj.c
+53
-0
No files found.
dlls/ole32/tests/compobj.c
View file @
1d8879bc
...
...
@@ -27,6 +27,7 @@
#include "winbase.h"
#include "objbase.h"
#include "shlguid.h"
#include "urlmon.h"
/* for CLSID_FileProtocol */
#include "wine/test.h"
...
...
@@ -701,6 +702,57 @@ static void test_CoRegisterClassObject(void)
CoUninitialize
();
}
static
DWORD
CALLBACK
free_libraries_thread
(
LPVOID
p
)
{
CoFreeUnusedLibraries
();
return
0
;
}
static
inline
BOOL
is_module_loaded
(
const
char
*
module
)
{
return
GetModuleHandle
(
module
)
?
TRUE
:
FALSE
;
}
static
void
test_CoFreeUnusedLibraries
(
void
)
{
HRESULT
hr
;
IUnknown
*
pUnk
;
DWORD
tid
;
HANDLE
thread
;
pCoInitializeEx
(
NULL
,
COINIT_APARTMENTTHREADED
);
ok
(
!
is_module_loaded
(
"urlmon.dll"
),
"urlmon.dll shouldn't be loaded
\n
"
);
hr
=
CoCreateInstance
(
&
CLSID_FileProtocol
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IUnknown
,
(
void
**
)
&
pUnk
);
if
(
hr
==
REGDB_E_CLASSNOTREG
)
{
trace
(
"IE not installed so can't run CoFreeUnusedLibraries test
\n
"
);
return
;
}
ok_ole_success
(
hr
,
"CoCreateInstance"
);
ok
(
is_module_loaded
(
"urlmon.dll"
),
"urlmon.dll should be loaded
\n
"
);
IUnknown_Release
(
pUnk
);
ok
(
is_module_loaded
(
"urlmon.dll"
),
"urlmon.dll should be loaded
\n
"
);
thread
=
CreateThread
(
NULL
,
0
,
free_libraries_thread
,
NULL
,
0
,
&
tid
);
WaitForSingleObject
(
thread
,
INFINITE
);
CloseHandle
(
thread
);
todo_wine
ok
(
is_module_loaded
(
"urlmon.dll"
),
"urlmon.dll should be loaded
\n
"
);
CoFreeUnusedLibraries
();
ok
(
!
is_module_loaded
(
"urlmon.dll"
),
"urlmon.dll shouldn't be loaded
\n
"
);
CoUninitialize
();
}
START_TEST
(
compobj
)
{
HMODULE
hOle32
=
GetModuleHandle
(
"ole32"
);
...
...
@@ -724,4 +776,5 @@ START_TEST(compobj)
test_CoMarshalInterface
();
test_CoMarshalInterThreadInterfaceInStream
();
test_CoRegisterClassObject
();
test_CoFreeUnusedLibraries
();
}
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