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
b984e46b
Commit
b984e46b
authored
Nov 12, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
Nov 17, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Rename property variables in the StorageBaseImpl methods.
parent
de3ed0bb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
104 additions
and
107 deletions
+104
-107
storage32.c
dlls/ole32/storage32.c
+104
-107
No files found.
dlls/ole32/storage32.c
View file @
b984e46b
...
...
@@ -395,8 +395,8 @@ static HRESULT WINAPI StorageBaseImpl_OpenStream(
{
StorageBaseImpl
*
This
=
(
StorageBaseImpl
*
)
iface
;
StgStreamImpl
*
newStream
;
DirEntry
current
Propert
y
;
ULONG
foundPropertyIndex
;
DirEntry
current
Entr
y
;
ULONG
streamEntryRef
;
HRESULT
res
=
STG_E_UNKNOWN
;
TRACE
(
"(%p, %s, %p, %x, %d, %p)
\n
"
,
...
...
@@ -441,19 +441,19 @@ static HRESULT WINAPI StorageBaseImpl_OpenStream(
/*
* Search for the element with the given name
*/
foundPropertyIndex
=
findElement
(
streamEntryRef
=
findElement
(
This
->
ancestorStorage
,
This
->
storageDirEntry
,
pwcsName
,
&
current
Propert
y
);
&
current
Entr
y
);
/*
* If it was found, construct the stream object and return a pointer to it.
*/
if
(
(
foundPropertyIndex
!=
DIRENTRY_NULL
)
&&
(
current
Propert
y
.
stgType
==
STGTY_STREAM
)
)
if
(
(
streamEntryRef
!=
DIRENTRY_NULL
)
&&
(
current
Entr
y
.
stgType
==
STGTY_STREAM
)
)
{
newStream
=
StgStreamImpl_Construct
(
This
,
grfMode
,
foundPropertyIndex
);
newStream
=
StgStreamImpl_Construct
(
This
,
grfMode
,
streamEntryRef
);
if
(
newStream
!=
0
)
{
...
...
@@ -497,8 +497,8 @@ static HRESULT WINAPI StorageBaseImpl_OpenStorage(
{
StorageBaseImpl
*
This
=
(
StorageBaseImpl
*
)
iface
;
StorageInternalImpl
*
newStorage
;
DirEntry
current
Propert
y
;
ULONG
foundPropertyIndex
;
DirEntry
current
Entr
y
;
ULONG
storageEntryRef
;
HRESULT
res
=
STG_E_UNKNOWN
;
TRACE
(
"(%p, %s, %p, %x, %p, %d, %p)
\n
"
,
...
...
@@ -549,19 +549,19 @@ static HRESULT WINAPI StorageBaseImpl_OpenStorage(
*
ppstg
=
NULL
;
foundPropertyIndex
=
findElement
(
storageEntryRef
=
findElement
(
This
->
ancestorStorage
,
This
->
storageDirEntry
,
pwcsName
,
&
current
Propert
y
);
&
current
Entr
y
);
if
(
(
foundPropertyIndex
!=
DIRENTRY_NULL
)
&&
(
current
Propert
y
.
stgType
==
STGTY_STORAGE
)
)
if
(
(
storageEntryRef
!=
DIRENTRY_NULL
)
&&
(
current
Entr
y
.
stgType
==
STGTY_STORAGE
)
)
{
newStorage
=
StorageInternalImpl_Construct
(
This
->
ancestorStorage
,
grfMode
,
foundPropertyIndex
);
storageEntryRef
);
if
(
newStorage
!=
0
)
{
...
...
@@ -588,7 +588,7 @@ end:
* Storage32BaseImpl_EnumElements (IStorage)
*
* This method will create an enumerator object that can be used to
* retrieve information about all the
propertie
s in the storage object.
* retrieve information about all the
element
s in the storage object.
*
* See Windows documentation for more details on IStorage methods.
*/
...
...
@@ -637,7 +637,7 @@ static HRESULT WINAPI StorageBaseImpl_Stat(
DWORD
grfStatFlag
)
/* [in] */
{
StorageBaseImpl
*
This
=
(
StorageBaseImpl
*
)
iface
;
DirEntry
cur
Propert
y
;
DirEntry
cur
rentEntr
y
;
BOOL
readSuccessful
;
HRESULT
res
=
STG_E_UNKNOWN
;
...
...
@@ -653,13 +653,13 @@ static HRESULT WINAPI StorageBaseImpl_Stat(
readSuccessful
=
StorageImpl_ReadDirEntry
(
This
->
ancestorStorage
,
This
->
storageDirEntry
,
&
cur
Propert
y
);
&
cur
rentEntr
y
);
if
(
readSuccessful
)
{
StorageUtl_CopyDirEntryToSTATSTG
(
pstatstg
,
&
cur
Propert
y
,
&
cur
rentEntr
y
,
grfStatFlag
);
pstatstg
->
grfMode
=
This
->
openFlags
;
...
...
@@ -693,21 +693,21 @@ static HRESULT WINAPI StorageBaseImpl_RenameElement(
const
OLECHAR
*
pwcsNewName
)
/* [in] */
{
StorageBaseImpl
*
This
=
(
StorageBaseImpl
*
)
iface
;
DirEntry
current
Propert
y
;
ULONG
foundPropertyIndex
;
DirEntry
current
Entr
y
;
ULONG
currentEntryRef
;
TRACE
(
"(%p, %s, %s)
\n
"
,
iface
,
debugstr_w
(
pwcsOldName
),
debugstr_w
(
pwcsNewName
));
foundPropertyIndex
=
findElement
(
This
->
ancestorStorage
,
currentEntryRef
=
findElement
(
This
->
ancestorStorage
,
This
->
storageDirEntry
,
pwcsNewName
,
&
current
Propert
y
);
&
current
Entr
y
);
if
(
foundPropertyIndex
!=
DIRENTRY_NULL
)
if
(
currentEntryRef
!=
DIRENTRY_NULL
)
{
/*
* There is already a
property
with the new name
* There is already a
n element
with the new name
*/
return
STG_E_FILEALREADYEXISTS
;
}
...
...
@@ -715,31 +715,31 @@ static HRESULT WINAPI StorageBaseImpl_RenameElement(
/*
* Search for the old element name
*/
foundPropertyIndex
=
findElement
(
This
->
ancestorStorage
,
currentEntryRef
=
findElement
(
This
->
ancestorStorage
,
This
->
storageDirEntry
,
pwcsOldName
,
&
current
Propert
y
);
&
current
Entr
y
);
if
(
foundPropertyIndex
!=
DIRENTRY_NULL
)
if
(
currentEntryRef
!=
DIRENTRY_NULL
)
{
/* Remove the element from its current position in the tree */
removeFromTree
(
This
->
ancestorStorage
,
This
->
storageDirEntry
,
foundPropertyIndex
);
currentEntryRef
);
/* Change the name of the element */
strcpyW
(
current
Propert
y
.
name
,
pwcsNewName
);
strcpyW
(
current
Entr
y
.
name
,
pwcsNewName
);
StorageImpl_WriteDirEntry
(
This
->
ancestorStorage
,
foundPropertyIndex
,
&
current
Propert
y
);
StorageImpl_WriteDirEntry
(
This
->
ancestorStorage
,
currentEntryRef
,
&
current
Entr
y
);
/* Insert the element in a new position in the tree */
insertIntoTree
(
This
->
ancestorStorage
,
This
->
storageDirEntry
,
foundPropertyIndex
);
currentEntryRef
);
}
else
{
/*
* There is no
property
with the old name
* There is no
element
with the old name
*/
return
STG_E_FILENOTFOUND
;
}
...
...
@@ -764,8 +764,8 @@ static HRESULT WINAPI StorageBaseImpl_CreateStream(
{
StorageBaseImpl
*
This
=
(
StorageBaseImpl
*
)
iface
;
StgStreamImpl
*
newStream
;
DirEntry
current
Property
,
newStreamPropert
y
;
ULONG
foundPropertyIndex
,
newPropertyIndex
;
DirEntry
current
Entry
,
newStreamEntr
y
;
ULONG
currentEntryRef
,
newStreamEntryRef
;
TRACE
(
"(%p, %s, %x, %d, %d, %p)
\n
"
,
iface
,
debugstr_w
(
pwcsName
),
grfMode
,
...
...
@@ -811,12 +811,12 @@ static HRESULT WINAPI StorageBaseImpl_CreateStream(
*
ppstm
=
0
;
foundPropertyIndex
=
findElement
(
This
->
ancestorStorage
,
currentEntryRef
=
findElement
(
This
->
ancestorStorage
,
This
->
storageDirEntry
,
pwcsName
,
&
current
Propert
y
);
&
current
Entr
y
);
if
(
foundPropertyIndex
!=
DIRENTRY_NULL
)
if
(
currentEntryRef
!=
DIRENTRY_NULL
)
{
/*
* An element with this name already exists
...
...
@@ -827,7 +827,7 @@ static HRESULT WINAPI StorageBaseImpl_CreateStream(
LIST_FOR_EACH_ENTRY
(
strm
,
&
This
->
strmHead
,
StgStreamImpl
,
StrmListEntry
)
{
if
(
strm
->
dirEntry
==
foundPropertyIndex
)
if
(
strm
->
dirEntry
==
currentEntryRef
)
{
TRACE
(
"Stream deleted %p
\n
"
,
strm
);
strm
->
parentStorage
=
NULL
;
...
...
@@ -846,51 +846,51 @@ static HRESULT WINAPI StorageBaseImpl_CreateStream(
}
/*
* memset the empty
propert
y
* memset the empty
entr
y
*/
memset
(
&
newStream
Propert
y
,
0
,
sizeof
(
DirEntry
));
memset
(
&
newStream
Entr
y
,
0
,
sizeof
(
DirEntry
));
newStream
Propert
y
.
sizeOfNameString
=
newStream
Entr
y
.
sizeOfNameString
=
(
lstrlenW
(
pwcsName
)
+
1
)
*
sizeof
(
WCHAR
);
if
(
newStream
Propert
y
.
sizeOfNameString
>
DIRENTRY_NAME_BUFFER_LEN
)
if
(
newStream
Entr
y
.
sizeOfNameString
>
DIRENTRY_NAME_BUFFER_LEN
)
return
STG_E_INVALIDNAME
;
strcpyW
(
newStream
Propert
y
.
name
,
pwcsName
);
strcpyW
(
newStream
Entr
y
.
name
,
pwcsName
);
newStream
Propert
y
.
stgType
=
STGTY_STREAM
;
newStream
Propert
y
.
startingBlock
=
BLOCK_END_OF_CHAIN
;
newStream
Propert
y
.
size
.
u
.
LowPart
=
0
;
newStream
Propert
y
.
size
.
u
.
HighPart
=
0
;
newStream
Entr
y
.
stgType
=
STGTY_STREAM
;
newStream
Entr
y
.
startingBlock
=
BLOCK_END_OF_CHAIN
;
newStream
Entr
y
.
size
.
u
.
LowPart
=
0
;
newStream
Entr
y
.
size
.
u
.
HighPart
=
0
;
newStream
Propert
y
.
leftChild
=
DIRENTRY_NULL
;
newStream
Propert
y
.
rightChild
=
DIRENTRY_NULL
;
newStream
Propert
y
.
dirRootEntry
=
DIRENTRY_NULL
;
newStream
Entr
y
.
leftChild
=
DIRENTRY_NULL
;
newStream
Entr
y
.
rightChild
=
DIRENTRY_NULL
;
newStream
Entr
y
.
dirRootEntry
=
DIRENTRY_NULL
;
/* call CoFileTime to get the current time
newStream
Propert
y.ctime
newStream
Propert
y.mtime
newStream
Entr
y.ctime
newStream
Entr
y.mtime
*/
/* newStream
Property.propertyUniqueID
*/
/* newStream
Entry.clsid
*/
/*
*
Save the new property into a new property spot
*
Create an entry with the new data
*/
createDirEntry
(
This
->
ancestorStorage
,
&
newStream
Property
,
&
newPropertyIndex
);
createDirEntry
(
This
->
ancestorStorage
,
&
newStream
Entry
,
&
newStreamEntryRef
);
/*
*
Find a spot in the property chain for our newly created property
.
*
Insert the new entry in the parent storage's tree
.
*/
insertIntoTree
(
This
->
ancestorStorage
,
This
->
storageDirEntry
,
new
PropertyIndex
);
new
StreamEntryRef
);
/*
* Open the stream to return it.
*/
newStream
=
StgStreamImpl_Construct
(
This
,
grfMode
,
new
PropertyIndex
);
newStream
=
StgStreamImpl_Construct
(
This
,
grfMode
,
new
StreamEntryRef
);
if
(
newStream
!=
0
)
{
...
...
@@ -909,7 +909,7 @@ static HRESULT WINAPI StorageBaseImpl_CreateStream(
/************************************************************************
* Storage32BaseImpl_SetClass (IStorage)
*
* This method will write the specified CLSID in the
propert
y of this
* This method will write the specified CLSID in the
directory entr
y of this
* storage.
*
* See Windows documentation for more details on IStorage methods.
...
...
@@ -920,21 +920,21 @@ static HRESULT WINAPI StorageBaseImpl_SetClass(
{
StorageBaseImpl
*
This
=
(
StorageBaseImpl
*
)
iface
;
HRESULT
hRes
=
E_FAIL
;
DirEntry
cur
Propert
y
;
DirEntry
cur
rentEntr
y
;
BOOL
success
;
TRACE
(
"(%p, %p)
\n
"
,
iface
,
clsid
);
success
=
StorageImpl_ReadDirEntry
(
This
->
ancestorStorage
,
This
->
storageDirEntry
,
&
cur
Propert
y
);
&
cur
rentEntr
y
);
if
(
success
)
{
cur
Propert
y
.
clsid
=
*
clsid
;
cur
rentEntr
y
.
clsid
=
*
clsid
;
success
=
StorageImpl_WriteDirEntry
(
This
->
ancestorStorage
,
This
->
storageDirEntry
,
&
cur
Propert
y
);
&
cur
rentEntr
y
);
if
(
success
)
hRes
=
S_OK
;
}
...
...
@@ -963,10 +963,10 @@ static HRESULT WINAPI StorageBaseImpl_CreateStorage(
{
StorageBaseImpl
*
const
This
=
(
StorageBaseImpl
*
)
iface
;
DirEntry
current
Propert
y
;
DirEntry
new
Propert
y
;
ULONG
foundPropertyIndex
;
ULONG
new
PropertyIndex
;
DirEntry
current
Entr
y
;
DirEntry
new
Entr
y
;
ULONG
currentEntryRef
;
ULONG
new
EntryRef
;
HRESULT
hr
;
TRACE
(
"(%p, %s, %x, %d, %d, %p)
\n
"
,
...
...
@@ -997,12 +997,12 @@ static HRESULT WINAPI StorageBaseImpl_CreateStorage(
return
STG_E_ACCESSDENIED
;
}
foundPropertyIndex
=
findElement
(
This
->
ancestorStorage
,
currentEntryRef
=
findElement
(
This
->
ancestorStorage
,
This
->
storageDirEntry
,
pwcsName
,
&
current
Propert
y
);
&
current
Entr
y
);
if
(
foundPropertyIndex
!=
DIRENTRY_NULL
)
if
(
currentEntryRef
!=
DIRENTRY_NULL
)
{
/*
* An element with this name already exists
...
...
@@ -1026,49 +1026,46 @@ static HRESULT WINAPI StorageBaseImpl_CreateStorage(
return
STG_E_ACCESSDENIED
;
}
/*
* memset the empty property
*/
memset
(
&
newProperty
,
0
,
sizeof
(
DirEntry
));
memset
(
&
newEntry
,
0
,
sizeof
(
DirEntry
));
new
Propert
y
.
sizeOfNameString
=
(
lstrlenW
(
pwcsName
)
+
1
)
*
sizeof
(
WCHAR
);
new
Entr
y
.
sizeOfNameString
=
(
lstrlenW
(
pwcsName
)
+
1
)
*
sizeof
(
WCHAR
);
if
(
new
Propert
y
.
sizeOfNameString
>
DIRENTRY_NAME_BUFFER_LEN
)
if
(
new
Entr
y
.
sizeOfNameString
>
DIRENTRY_NAME_BUFFER_LEN
)
{
FIXME
(
"name too long
\n
"
);
return
STG_E_INVALIDNAME
;
}
strcpyW
(
new
Propert
y
.
name
,
pwcsName
);
strcpyW
(
new
Entr
y
.
name
,
pwcsName
);
new
Propert
y
.
stgType
=
STGTY_STORAGE
;
new
Propert
y
.
startingBlock
=
BLOCK_END_OF_CHAIN
;
new
Propert
y
.
size
.
u
.
LowPart
=
0
;
new
Propert
y
.
size
.
u
.
HighPart
=
0
;
new
Entr
y
.
stgType
=
STGTY_STORAGE
;
new
Entr
y
.
startingBlock
=
BLOCK_END_OF_CHAIN
;
new
Entr
y
.
size
.
u
.
LowPart
=
0
;
new
Entr
y
.
size
.
u
.
HighPart
=
0
;
new
Propert
y
.
leftChild
=
DIRENTRY_NULL
;
new
Propert
y
.
rightChild
=
DIRENTRY_NULL
;
new
Propert
y
.
dirRootEntry
=
DIRENTRY_NULL
;
new
Entr
y
.
leftChild
=
DIRENTRY_NULL
;
new
Entr
y
.
rightChild
=
DIRENTRY_NULL
;
new
Entr
y
.
dirRootEntry
=
DIRENTRY_NULL
;
/* call CoFileTime to get the current time
new
Propert
y.ctime
new
Propert
y.mtime
new
Entr
y.ctime
new
Entr
y.mtime
*/
/* new
StorageProperty.propertyUniqueID
*/
/* new
Entry.clsid
*/
/*
*
Save the new property into a new property spot
*
Create a new directory entry for the storage
*/
createDirEntry
(
This
->
ancestorStorage
,
&
new
Property
,
&
newPropertyIndex
);
createDirEntry
(
This
->
ancestorStorage
,
&
new
Entry
,
&
newEntryRef
);
/*
*
Find a spot in the property chain for our newly created property.
*
Insert the new directory entry into the parent storage's tree
*/
insertIntoTree
(
This
->
ancestorStorage
,
This
->
storageDirEntry
,
new
PropertyIndex
);
new
EntryRef
);
/*
* Open it to get a pointer to return.
...
...
@@ -1721,8 +1718,8 @@ static HRESULT WINAPI StorageBaseImpl_DestroyElement(
StorageBaseImpl
*
const
This
=
(
StorageBaseImpl
*
)
iface
;
HRESULT
hr
=
S_OK
;
DirEntry
propert
yToDelete
;
ULONG
foundPropertyIndexToDelete
;
DirEntry
entr
yToDelete
;
ULONG
entryToDeleteRef
;
TRACE
(
"(%p, %s)
\n
"
,
iface
,
debugstr_w
(
pwcsName
));
...
...
@@ -1733,49 +1730,49 @@ static HRESULT WINAPI StorageBaseImpl_DestroyElement(
if
(
STGM_ACCESS_MODE
(
This
->
openFlags
)
==
STGM_READ
)
return
STG_E_ACCESSDENIED
;
foundPropertyIndexToDelete
=
findElement
(
entryToDeleteRef
=
findElement
(
This
->
ancestorStorage
,
This
->
storageDirEntry
,
pwcsName
,
&
propert
yToDelete
);
&
entr
yToDelete
);
if
(
foundPropertyIndexToDelete
==
DIRENTRY_NULL
)
if
(
entryToDeleteRef
==
DIRENTRY_NULL
)
{
return
STG_E_FILENOTFOUND
;
}
if
(
propert
yToDelete
.
stgType
==
STGTY_STORAGE
)
if
(
entr
yToDelete
.
stgType
==
STGTY_STORAGE
)
{
hr
=
deleteStorageContents
(
This
,
foundPropertyIndexToDelete
,
propert
yToDelete
);
entryToDeleteRef
,
entr
yToDelete
);
}
else
if
(
propert
yToDelete
.
stgType
==
STGTY_STREAM
)
else
if
(
entr
yToDelete
.
stgType
==
STGTY_STREAM
)
{
hr
=
deleteStreamContents
(
This
,
foundPropertyIndexToDelete
,
propert
yToDelete
);
entryToDeleteRef
,
entr
yToDelete
);
}
if
(
hr
!=
S_OK
)
return
hr
;
/*
*
Adjust the property chain
*
Remove the entry from its parent storage
*/
hr
=
removeFromTree
(
This
->
ancestorStorage
,
This
->
storageDirEntry
,
foundPropertyIndexToDelete
);
entryToDeleteRef
);
/*
* Invalidate the
propert
y
* Invalidate the
entr
y
*/
if
(
SUCCEEDED
(
hr
))
destroyDirEntry
(
This
->
ancestorStorage
,
foundPropertyIndexToDelete
);
entryToDeleteRef
);
return
hr
;
}
...
...
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