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
ce8c450d
Commit
ce8c450d
authored
Jul 30, 2010
by
Andrew Nguyen
Committed by
Alexandre Julliard
Jul 30, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32/tests: Test typelib registration in the user registry.
parent
f2610a61
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
2 deletions
+38
-2
typelib.c
dlls/oleaut32/tests/typelib.c
+38
-2
No files found.
dlls/oleaut32/tests/typelib.c
View file @
ce8c450d
...
...
@@ -55,8 +55,19 @@
#define ok_ole_success(hr, func) ok(hr == S_OK, #func " failed with error 0x%08x\n", hr)
static
HRESULT
WINAPI
(
*
pRegisterTypeLibForUser
)(
ITypeLib
*
,
OLECHAR
*
,
OLECHAR
*
);
static
HRESULT
WINAPI
(
*
pUnRegisterTypeLibForUser
)(
REFGUID
,
WORD
,
WORD
,
LCID
,
SYSKIND
);
static
const
WCHAR
wszStdOle2
[]
=
{
's'
,
't'
,
'd'
,
'o'
,
'l'
,
'e'
,
'2'
,
'.'
,
't'
,
'l'
,
'b'
,
0
};
static
void
init_function_pointers
(
void
)
{
HMODULE
hmod
=
GetModuleHandleA
(
"oleaut32.dll"
);
pRegisterTypeLibForUser
=
(
void
*
)
GetProcAddress
(
hmod
,
"RegisterTypeLibForUser"
);
pUnRegisterTypeLibForUser
=
(
void
*
)
GetProcAddress
(
hmod
,
"UnRegisterTypeLibForUser"
);
}
static
void
ref_count_test
(
LPCWSTR
type_lib
)
{
ITypeLib
*
iface
;
...
...
@@ -2173,7 +2184,7 @@ static void test_create_typelibs(void)
}
static
void
test_register_typelib
(
void
)
static
void
test_register_typelib
(
BOOL
system_registration
)
{
HRESULT
hr
;
WCHAR
filename
[
MAX_PATH
];
...
...
@@ -2203,13 +2214,32 @@ static void test_register_typelib(void)
{
TKIND_DISPATCH
,
TYPEFLAG_FDISPATCHABLE
}
};
trace
(
"Starting %s typelib registration tests
\n
"
,
system_registration
?
"system"
:
"user"
);
if
(
!
system_registration
&&
(
!
pRegisterTypeLibForUser
||
!
pUnRegisterTypeLibForUser
))
{
win_skip
(
"User typelib registration functions are not available
\n
"
);
return
;
}
filenameA
=
create_test_typelib
(
3
);
MultiByteToWideChar
(
CP_ACP
,
0
,
filenameA
,
-
1
,
filename
,
MAX_PATH
);
hr
=
LoadTypeLibEx
(
filename
,
REGKIND_NONE
,
&
typelib
);
ok
(
SUCCEEDED
(
hr
),
"got %08x
\n
"
,
hr
);
if
(
system_registration
)
hr
=
RegisterTypeLib
(
typelib
,
filename
,
NULL
);
else
hr
=
pRegisterTypeLibForUser
(
typelib
,
filename
,
NULL
);
if
(
hr
==
TYPE_E_REGISTRYACCESS
)
{
win_skip
(
"Insufficient privileges to register typelib in the registry
\n
"
);
ITypeLib_Release
(
typelib
);
DeleteFileA
(
filenameA
);
return
;
}
ok
(
SUCCEEDED
(
hr
),
"got %08x
\n
"
,
hr
);
count
=
ITypeLib_GetTypeInfoCount
(
typelib
);
...
...
@@ -2272,7 +2302,10 @@ static void test_register_typelib(void)
ITypeInfo_Release
(
typeinfo
);
}
if
(
system_registration
)
hr
=
UnRegisterTypeLib
(
&
LIBID_register_test
,
1
,
0
,
LOCALE_NEUTRAL
,
sizeof
(
void
*
)
==
8
?
SYS_WIN64
:
SYS_WIN32
);
else
hr
=
pUnRegisterTypeLibForUser
(
&
LIBID_register_test
,
1
,
0
,
LOCALE_NEUTRAL
,
sizeof
(
void
*
)
==
8
?
SYS_WIN64
:
SYS_WIN32
);
ok
(
SUCCEEDED
(
hr
),
"got %08x
\n
"
,
hr
);
ITypeLib_Release
(
typelib
);
...
...
@@ -2283,6 +2316,8 @@ START_TEST(typelib)
{
const
char
*
filename
;
init_function_pointers
();
ref_count_test
(
wszStdOle2
);
test_TypeComp
();
test_CreateDispTypeInfo
();
...
...
@@ -2297,7 +2332,8 @@ START_TEST(typelib)
DeleteFile
(
filename
);
}
test_register_typelib
();
test_register_typelib
(
TRUE
);
test_register_typelib
(
FALSE
);
test_create_typelibs
();
}
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