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
bf9f8da3
Commit
bf9f8da3
authored
Aug 19, 2004
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 19, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ref counting fixes.
parent
dbfe39fe
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
75 additions
and
4 deletions
+75
-4
.cvsignore
dlls/oleaut32/tests/.cvsignore
+1
-0
Makefile.in
dlls/oleaut32/tests/Makefile.in
+1
-0
typelib.c
dlls/oleaut32/tests/typelib.c
+66
-0
typelib.c
dlls/oleaut32/typelib.c
+7
-4
No files found.
dlls/oleaut32/tests/.cvsignore
View file @
bf9f8da3
...
...
@@ -2,5 +2,6 @@ Makefile
olefont.ok
safearray.ok
testlist.c
typelib.ok
vartest.ok
vartype.ok
dlls/oleaut32/tests/Makefile.in
View file @
bf9f8da3
...
...
@@ -9,6 +9,7 @@ EXTRALIBS = -luuid
CTESTS
=
\
olefont.c
\
safearray.c
\
typelib.c
\
vartest.c
\
vartype.c
...
...
dlls/oleaut32/tests/typelib.c
0 → 100644
View file @
bf9f8da3
/*
* ITypeLib and ITypeInfo test
*
* Copyright 2004 Jacek Caban
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define COBJMACROS
#include <wine/test.h>
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "oleauto.h"
void
ref_count_test
(
LPCWSTR
type_lib
)
{
ITypeLib
*
iface
;
ITypeInfo
*
iti1
,
*
iti2
;
HRESULT
hRes
;
int
ref_count
;
trace
(
"Loading type library
\n
"
);
hRes
=
LoadTypeLib
(
type_lib
,
&
iface
);
ok
(
hRes
==
S_OK
,
"Could not load type library
\n
"
);
if
(
hRes
!=
S_OK
)
return
;
hRes
=
ITypeLib_GetTypeInfo
(
iface
,
1
,
&
iti1
);
ok
(
hRes
==
S_OK
,
"ITypeLib_GetTypeInfo failed on index = 1
\n
"
);
ok
(
ref_count
=
ITypeLib_Release
(
iface
)
>
0
,
"ITypeLib destroyed while ITypeInfo has back pointer
\n
"
);
if
(
!
ref_count
)
return
;
hRes
=
ITypeLib_GetTypeInfo
(
iface
,
1
,
&
iti2
);
ok
(
hRes
==
S_OK
,
"ITypeLib_GetTypeInfo failed on index = 1
\n
"
);
ok
(
iti1
==
iti2
,
"ITypeLib_GetTypeInfo returned different pointers for same indexes
\n
"
);
ITypeLib_AddRef
(
iface
);
ITypeInfo_Release
(
iti2
);
ITypeInfo_Release
(
iti1
);
ok
(
ITypeLib_Release
(
iface
)
==
0
,
"ITypeLib should be destroyed here.
\n
"
);
}
START_TEST
(
typelib
)
{
static
const
WCHAR
type_lib_olepro32
[]
=
{
'o'
,
'l'
,
'e'
,
'p'
,
'r'
,
'o'
,
'3'
,
'2'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
};
static
const
WCHAR
type_lib_stdole32
[]
=
{
's'
,
't'
,
'd'
,
'o'
,
'l'
,
'e'
,
'3'
,
'2'
,
'.'
,
't'
,
'l'
,
'b'
,
0
};
ref_count_test
(
type_lib_olepro32
);
ref_count_test
(
type_lib_stdole32
);
}
dlls/oleaut32/typelib.c
View file @
bf9f8da3
...
...
@@ -2460,7 +2460,6 @@ static ITypeLib2* ITypeLib2_Constructor_MSFT(LPVOID pLib, DWORD dwTLBLength)
{
*
ppTI
=
MSFT_DoTypeInfo
(
&
cx
,
i
,
pTypeLibImpl
);
ITypeInfo_AddRef
((
ITypeInfo
*
)
*
ppTI
);
ppTI
=
&
((
*
ppTI
)
->
next
);
(
pTypeLibImpl
->
TypeInfoCount
)
++
;
}
...
...
@@ -4079,6 +4078,7 @@ static ULONG WINAPI ITypeInfo_fnAddRef( ITypeInfo2 *iface)
ICOM_THIS
(
ITypeInfoImpl
,
iface
);
++
(
This
->
ref
);
ITypeLib2_AddRef
((
ITypeLib2
*
)
This
->
pTypeLib
);
TRACE
(
"(%p)->ref is %u
\n
"
,
This
,
This
->
ref
);
return
This
->
ref
;
...
...
@@ -4086,7 +4086,7 @@ static ULONG WINAPI ITypeInfo_fnAddRef( ITypeInfo2 *iface)
/* ITypeInfo::Release
*/
static
ULONG
WINAPI
ITypeInfo_fnRelease
(
ITypeInfo2
*
iface
)
static
ULONG
WINAPI
ITypeInfo_fnRelease
(
ITypeInfo2
*
iface
)
{
ICOM_THIS
(
ITypeInfoImpl
,
iface
);
...
...
@@ -4094,8 +4094,11 @@ static ULONG WINAPI ITypeInfo_fnRelease( ITypeInfo2 *iface)
TRACE
(
"(%p)->(%u)
\n
"
,
This
,
This
->
ref
);
if
(
!
This
->
ref
)
{
if
(
This
->
ref
)
{
/* We don't release ITypeLib when ref=0 becouse
it means that funtion is called by ITypeLi2_Release */
ITypeLib2_Release
((
ITypeLib2
*
)
This
->
pTypeLib
);
}
else
{
FIXME
(
"destroy child objects
\n
"
);
TRACE
(
"destroying ITypeInfo(%p)
\n
"
,
This
);
...
...
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