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
87ed7d9b
Commit
87ed7d9b
authored
Nov 02, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
Nov 11, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Simplify RenameElement by using the same entry in the file.
parent
274a1d11
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
76 deletions
+10
-76
storage32.c
dlls/ole32/storage32.c
+10
-76
No files found.
dlls/ole32/storage32.c
View file @
87ed7d9b
...
...
@@ -686,10 +686,6 @@ end:
* This method will rename the specified element.
*
* See Windows documentation for more details on IStorage methods.
*
* Implementation notes: The method used to rename consists of creating a clone
* of the deleted StgProperty object setting it with the new name and to
* perform a DestroyElement of the old StgProperty.
*/
static
HRESULT
WINAPI
StorageBaseImpl_RenameElement
(
IStorage
*
iface
,
...
...
@@ -726,81 +722,19 @@ static HRESULT WINAPI StorageBaseImpl_RenameElement(
if
(
foundPropertyIndex
!=
PROPERTY_NULL
)
{
StgProperty
renamedProperty
;
ULONG
renamedPropertyIndex
;
/*
* Setup a new property for the renamed property
*/
renamedProperty
.
sizeOfNameString
=
(
lstrlenW
(
pwcsNewName
)
+
1
)
*
sizeof
(
WCHAR
);
if
(
renamedProperty
.
sizeOfNameString
>
PROPERTY_NAME_BUFFER_LEN
)
return
STG_E_INVALIDNAME
;
strcpyW
(
renamedProperty
.
name
,
pwcsNewName
);
renamedProperty
.
propertyType
=
currentProperty
.
propertyType
;
renamedProperty
.
startingBlock
=
currentProperty
.
startingBlock
;
renamedProperty
.
size
.
u
.
LowPart
=
currentProperty
.
size
.
u
.
LowPart
;
renamedProperty
.
size
.
u
.
HighPart
=
currentProperty
.
size
.
u
.
HighPart
;
renamedProperty
.
leftChild
=
PROPERTY_NULL
;
renamedProperty
.
rightChild
=
PROPERTY_NULL
;
/*
* Bring the dirProperty link in case it is a storage and in which
* case the renamed storage elements don't require to be reorganized.
*/
renamedProperty
.
dirProperty
=
currentProperty
.
dirProperty
;
/* call CoFileTime to get the current time
renamedProperty.ctime
renamedProperty.mtime
renamedProperty.propertyUniqueID
*/
/* Remove the element from its current position in the tree */
removeFromTree
(
This
->
ancestorStorage
,
This
->
rootPropertySetIndex
,
foundPropertyIndex
);
/*
* Save the new property into a new property spot
*/
createDirEntry
(
This
->
ancestorStorage
,
&
renamedProperty
,
&
renamedPropertyIndex
);
/* Change the name of the element */
strcpyW
(
currentProperty
.
name
,
pwcsNewName
);
/*
* Find a spot in the property chain for our newly created property.
*/
insertIntoTree
(
This
->
ancestorStorage
,
This
->
rootPropertySetIndex
,
renamedPropertyIndex
);
/*
* At this point the renamed property has been inserted in the tree,
* now, before Destroying the old property we must zero its dirProperty
* otherwise the DestroyProperty below will zap it all and we do not want
* this to happen.
* Also, we fake that the old property is a storage so the DestroyProperty
* will not do a SetSize(0) on the stream data.
*
* This means that we need to tweak the StgProperty if it is a stream or a
* non empty storage.
*/
StorageImpl_ReadProperty
(
This
->
ancestorStorage
,
foundPropertyIndex
,
&
currentProperty
);
currentProperty
.
dirProperty
=
PROPERTY_NULL
;
currentProperty
.
propertyType
=
PROPTYPE_STORAGE
;
StorageImpl_WriteProperty
(
This
->
ancestorStorage
,
foundPropertyIndex
,
&
currentProperty
);
/*
* Invoke Destroy to get rid of the ole property and automatically redo
* the linking of its previous and next members...
*/
IStorage_DestroyElement
(
iface
,
pwcsOldName
);
StorageImpl_WriteProperty
(
This
->
ancestorStorage
,
foundPropertyIndex
,
&
currentProperty
);
/* Insert the element in a new position in the tree */
insertIntoTree
(
This
->
ancestorStorage
,
This
->
rootPropertySetIndex
,
foundPropertyIndex
);
}
else
{
...
...
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