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
13b96664
Commit
13b96664
authored
Oct 28, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
Oct 30, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Convert adjustPropertyChain into real binary tree removal.
Finding the parent of a node in a binary tree is a detail that should be handled inside the function.
parent
fd993b7d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
30 deletions
+27
-30
storage32.c
dlls/ole32/storage32.c
+27
-30
No files found.
dlls/ole32/storage32.c
View file @
13b96664
...
...
@@ -169,12 +169,10 @@ static HRESULT deleteStreamProperty(
ULONG
foundPropertyIndexToDelete
,
StgProperty
propertyToDelete
);
static
HRESULT
adjustPropertyChain
(
static
HRESULT
removeFromTree
(
StorageImpl
*
This
,
StgProperty
propertyToDelete
,
StgProperty
parentProperty
,
ULONG
parentPropertyId
,
INT
typeOfRelation
);
ULONG
parentStorageIndex
,
ULONG
deletedIndex
);
/***********************************************************************
* Declaration of the functions used to manipulate StgProperty
...
...
@@ -1755,10 +1753,7 @@ static HRESULT WINAPI StorageImpl_DestroyElement(
HRESULT
hr
=
S_OK
;
StgProperty
propertyToDelete
;
StgProperty
parentProperty
;
ULONG
foundPropertyIndexToDelete
;
ULONG
typeOfRelation
;
ULONG
parentPropertyId
=
0
;
TRACE
(
"(%p, %s)
\n
"
,
iface
,
debugstr_w
(
pwcsName
));
...
...
@@ -1780,15 +1775,6 @@ static HRESULT WINAPI StorageImpl_DestroyElement(
return
STG_E_FILENOTFOUND
;
}
/*
* Find the property that links to the one we want to delete.
*/
hr
=
findTreeParent
(
This
->
base
.
ancestorStorage
,
This
->
base
.
rootPropertySetIndex
,
pwcsName
,
&
parentProperty
,
&
parentPropertyId
,
&
typeOfRelation
);
if
(
hr
!=
S_OK
)
return
hr
;
if
(
propertyToDelete
.
propertyType
==
PROPTYPE_STORAGE
)
{
hr
=
deleteStorageProperty
(
...
...
@@ -1810,12 +1796,10 @@ static HRESULT WINAPI StorageImpl_DestroyElement(
/*
* Adjust the property chain
*/
hr
=
adjustPropertyChain
(
This
,
propertyToDelete
,
parentProperty
,
parentPropertyId
,
typeOfRelation
);
hr
=
removeFromTree
(
This
->
base
.
ancestorStorage
,
This
->
base
.
rootPropertySetIndex
,
foundPropertyIndexToDelete
);
/*
* Invalidate the property by zeroing its name member.
...
...
@@ -2018,18 +2002,31 @@ static void setPropertyLink(StgProperty *property, ULONG relation, ULONG new_tar
*
* Internal Method
*
* This method
takes the previous and the next property link of a property
*
to be deleted and find them a place in the Storage
.
* This method
removes a directory entry from its parent storage tree without
*
freeing any resources attached to it
.
*/
static
HRESULT
adjustPropertyChain
(
static
HRESULT
removeFromTree
(
StorageImpl
*
This
,
StgProperty
propertyToDelete
,
StgProperty
parentProperty
,
ULONG
parentPropertyId
,
INT
typeOfRelation
)
ULONG
parentStorageIndex
,
ULONG
deletedIndex
)
{
HRESULT
hr
=
S_OK
;
BOOL
res
=
TRUE
;
StgProperty
propertyToDelete
;
StgProperty
parentProperty
;
ULONG
parentPropertyId
;
ULONG
typeOfRelation
;
res
=
StorageImpl_ReadProperty
(
This
,
deletedIndex
,
&
propertyToDelete
);
/*
* Find the property that links to the one we want to delete.
*/
hr
=
findTreeParent
(
This
,
parentStorageIndex
,
propertyToDelete
.
name
,
&
parentProperty
,
&
parentPropertyId
,
&
typeOfRelation
);
if
(
hr
!=
S_OK
)
return
hr
;
if
(
propertyToDelete
.
leftChild
!=
PROPERTY_NULL
)
{
...
...
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