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
abdebcdb
Commit
abdebcdb
authored
Sep 25, 2009
by
Markus Stockhausen
Committed by
Alexandre Julliard
Sep 26, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32/storage32: Fix for reference counters in nested storage.
parent
e340a2ff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
3 deletions
+41
-3
storage32.c
dlls/ole32/storage32.c
+1
-3
storage32.c
dlls/ole32/tests/storage32.c
+40
-0
No files found.
dlls/ole32/storage32.c
View file @
abdebcdb
...
...
@@ -3713,7 +3713,6 @@ static void StorageInternalImpl_Destroy( StorageBaseImpl *iface)
{
StorageInternalImpl
*
This
=
(
StorageInternalImpl
*
)
iface
;
StorageBaseImpl_Release
((
IStorage
*
)
This
->
base
.
ancestorStorage
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
@@ -4312,10 +4311,9 @@ static StorageInternalImpl* StorageInternalImpl_Construct(
newStorage
->
base
.
openFlags
=
(
openFlags
&
~
STGM_CREATE
);
/*
* Keep the ancestor storage pointer
and
nail a reference to it.
* Keep the ancestor storage pointer
but do not
nail a reference to it.
*/
newStorage
->
base
.
ancestorStorage
=
ancestorStorage
;
StorageBaseImpl_AddRef
((
IStorage
*
)(
newStorage
->
base
.
ancestorStorage
));
/*
* Keep the index of the root property set for this storage,
...
...
dlls/ole32/tests/storage32.c
View file @
abdebcdb
...
...
@@ -1470,6 +1470,45 @@ static void test_fmtusertypestg(void)
}
}
static
void
test_references
(
void
)
{
IStorage
*
stg
,
*
stg2
;
HRESULT
hr
;
unsigned
c1
,
c2
;
static
const
WCHAR
StorName
[]
=
{
'D'
,
'a'
,
't'
,
'a'
,
'S'
,
'p'
,
'a'
,
'c'
,
'e'
,
'I'
,
'n'
,
'f'
,
'o'
,
0
};
DeleteFileA
(
filenameA
);
hr
=
StgCreateDocfile
(
filename
,
STGM_CREATE
|
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
|
STGM_TRANSACTED
,
0
,
&
stg
);
ok
(
hr
==
S_OK
,
"StgCreateDocfile failed
\n
"
);
if
(
SUCCEEDED
(
hr
))
{
IStorage_Release
(
stg
);
hr
=
StgOpenStorage
(
filename
,
NULL
,
STGM_TRANSACTED
|
STGM_SHARE_EXCLUSIVE
|
STGM_READWRITE
,
NULL
,
0
,
&
stg
);
ok
(
hr
==
S_OK
,
"StgOpenStorage failed (result=%x)
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IStorage_CreateStorage
(
stg
,
StorName
,
STGM_READWRITE
|
STGM_SHARE_EXCLUSIVE
,
0
,
0
,
&
stg2
);
ok
(
hr
==
S_OK
,
"IStorage_CreateStorage failed (result=%x)
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
c1
=
IStorage_AddRef
(
stg
);
ok
(
c1
==
2
,
"creating internal storage added references to ancestor
\n
"
);
c1
=
IStorage_AddRef
(
stg
);
IStorage_Release
(
stg2
);
c2
=
IStorage_AddRef
(
stg
)
-
1
;
ok
(
c1
==
c2
,
"releasing internal storage removed references to ancestor
\n
"
);
}
c1
=
IStorage_Release
(
stg
);
while
(
c1
)
c1
=
IStorage_Release
(
stg
);
}
}
}
START_TEST
(
storage32
)
{
CHAR
temp
[
MAX_PATH
];
...
...
@@ -1497,4 +1536,5 @@ START_TEST(storage32)
test_readonly
();
test_simple
();
test_fmtusertypestg
();
test_references
();
}
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