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
8a332db2
Commit
8a332db2
authored
Nov 25, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
Dec 07, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Change ReadDirEntry return type to HRESULT.
parent
df13a1d1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
51 deletions
+45
-51
stg_stream.c
dlls/ole32/stg_stream.c
+13
-13
storage32.c
dlls/ole32/storage32.c
+31
-37
storage32.h
dlls/ole32/storage32.h
+1
-1
No files found.
dlls/ole32/stg_stream.c
View file @
8a332db2
...
...
@@ -188,7 +188,7 @@ static void StgStreamImpl_OpenBlockChain(
StgStreamImpl
*
This
)
{
DirEntry
currentEntry
;
BOOL
readSuccessful
;
HRESULT
hr
;
/*
* Make sure no old object is left over.
...
...
@@ -208,11 +208,11 @@ static void StgStreamImpl_OpenBlockChain(
/*
* Read the information from the directory entry.
*/
readSuccessful
=
StorageImpl_ReadDirEntry
(
This
->
parentStorage
->
ancestorStorage
,
hr
=
StorageImpl_ReadDirEntry
(
This
->
parentStorage
->
ancestorStorage
,
This
->
dirEntry
,
&
currentEntry
);
if
(
readSuccessful
)
if
(
SUCCEEDED
(
hr
)
)
{
This
->
streamSize
=
currentEntry
.
size
;
...
...
@@ -546,7 +546,7 @@ static HRESULT WINAPI StgStreamImpl_SetSize(
StgStreamImpl
*
const
This
=
(
StgStreamImpl
*
)
iface
;
DirEntry
currentEntry
;
BOOL
Success
;
HRESULT
hr
;
TRACE
(
"(%p, %d)
\n
"
,
iface
,
libNewSize
.
u
.
LowPart
);
...
...
@@ -605,7 +605,7 @@ static HRESULT WINAPI StgStreamImpl_SetSize(
/*
* Read this stream's size to see if it's small blocks or big blocks
*/
S
uccess
=
S
torageImpl_ReadDirEntry
(
This
->
parentStorage
->
ancestorStorage
,
StorageImpl_ReadDirEntry
(
This
->
parentStorage
->
ancestorStorage
,
This
->
dirEntry
,
&
currentEntry
);
/*
...
...
@@ -640,24 +640,24 @@ static HRESULT WINAPI StgStreamImpl_SetSize(
if
(
This
->
smallBlockChain
!=
0
)
{
S
uccess
=
S
mallBlockChainStream_SetSize
(
This
->
smallBlockChain
,
libNewSize
);
SmallBlockChainStream_SetSize
(
This
->
smallBlockChain
,
libNewSize
);
}
else
{
Success
=
BlockChainStream_SetSize
(
This
->
bigBlockChain
,
libNewSize
);
BlockChainStream_SetSize
(
This
->
bigBlockChain
,
libNewSize
);
}
/*
* Write the new information about this stream to the directory entry
*/
Success
=
StorageImpl_ReadDirEntry
(
This
->
parentStorage
->
ancestorStorage
,
hr
=
StorageImpl_ReadDirEntry
(
This
->
parentStorage
->
ancestorStorage
,
This
->
dirEntry
,
&
currentEntry
);
currentEntry
.
size
.
u
.
HighPart
=
libNewSize
.
u
.
HighPart
;
currentEntry
.
size
.
u
.
LowPart
=
libNewSize
.
u
.
LowPart
;
if
(
S
uccess
)
if
(
S
UCCEEDED
(
hr
)
)
{
StorageImpl_WriteDirEntry
(
This
->
parentStorage
->
ancestorStorage
,
This
->
dirEntry
,
...
...
@@ -835,7 +835,7 @@ static HRESULT WINAPI StgStreamImpl_Stat(
StgStreamImpl
*
const
This
=
(
StgStreamImpl
*
)
iface
;
DirEntry
currentEntry
;
BOOL
readSuccessful
;
HRESULT
hr
;
TRACE
(
"%p %p %d
\n
"
,
This
,
pstatstg
,
grfStatFlag
);
...
...
@@ -852,11 +852,11 @@ static HRESULT WINAPI StgStreamImpl_Stat(
/*
* Read the information from the directory entry.
*/
readSuccessful
=
StorageImpl_ReadDirEntry
(
This
->
parentStorage
->
ancestorStorage
,
hr
=
StorageImpl_ReadDirEntry
(
This
->
parentStorage
->
ancestorStorage
,
This
->
dirEntry
,
&
currentEntry
);
if
(
readSuccessful
)
if
(
SUCCEEDED
(
hr
)
)
{
StorageUtl_CopyDirEntryToSTATSTG
(
This
->
parentStorage
,
pstatstg
,
...
...
@@ -873,7 +873,7 @@ static HRESULT WINAPI StgStreamImpl_Stat(
}
WARN
(
"failed to read entry
\n
"
);
return
E_FAIL
;
return
hr
;
}
/***
...
...
dlls/ole32/storage32.c
View file @
8a332db2
...
...
@@ -673,7 +673,6 @@ static HRESULT WINAPI StorageBaseImpl_Stat(
{
StorageBaseImpl
*
This
=
(
StorageBaseImpl
*
)
iface
;
DirEntry
currentEntry
;
BOOL
readSuccessful
;
HRESULT
res
=
STG_E_UNKNOWN
;
TRACE
(
"(%p, %p, %x)
\n
"
,
...
...
@@ -691,12 +690,12 @@ static HRESULT WINAPI StorageBaseImpl_Stat(
goto
end
;
}
re
adSuccessful
=
StorageImpl_ReadDirEntry
(
re
s
=
StorageImpl_ReadDirEntry
(
This
->
ancestorStorage
,
This
->
storageDirEntry
,
&
currentEntry
);
if
(
readSuccessful
)
if
(
SUCCEEDED
(
res
)
)
{
StorageUtl_CopyDirEntryToSTATSTG
(
This
,
...
...
@@ -706,13 +705,8 @@ static HRESULT WINAPI StorageBaseImpl_Stat(
pstatstg
->
grfMode
=
This
->
openFlags
;
pstatstg
->
grfStateBits
=
This
->
stateBits
;
res
=
S_OK
;
goto
end
;
}
res
=
E_FAIL
;
end:
if
(
res
==
S_OK
)
{
...
...
@@ -962,19 +956,18 @@ static HRESULT WINAPI StorageBaseImpl_SetClass(
REFCLSID
clsid
)
/* [in] */
{
StorageBaseImpl
*
This
=
(
StorageBaseImpl
*
)
iface
;
HRESULT
hRes
=
E_FAIL
;
HRESULT
hRes
;
DirEntry
currentEntry
;
BOOL
success
;
TRACE
(
"(%p, %p)
\n
"
,
iface
,
clsid
);
if
(
!
This
->
ancestorStorage
)
return
STG_E_REVERTED
;
succes
s
=
StorageImpl_ReadDirEntry
(
This
->
ancestorStorage
,
hRe
s
=
StorageImpl_ReadDirEntry
(
This
->
ancestorStorage
,
This
->
storageDirEntry
,
&
currentEntry
);
if
(
success
)
if
(
SUCCEEDED
(
hRes
)
)
{
currentEntry
.
clsid
=
*
clsid
;
...
...
@@ -2065,13 +2058,15 @@ static HRESULT removeFromTree(
DirRef
deletedIndex
)
{
HRESULT
hr
=
S_OK
;
BOOL
res
=
TRUE
;
DirEntry
entryToDelete
;
DirEntry
parentEntry
;
DirRef
parentEntryRef
;
ULONG
typeOfRelation
;
res
=
StorageImpl_ReadDirEntry
(
This
,
deletedIndex
,
&
entryToDelete
);
hr
=
StorageImpl_ReadDirEntry
(
This
,
deletedIndex
,
&
entryToDelete
);
if
(
hr
!=
S_OK
)
return
hr
;
/*
* Find the element that links to the one we want to delete.
...
...
@@ -2110,13 +2105,13 @@ static HRESULT removeFromTree(
do
{
res
=
StorageImpl_ReadDirEntry
(
hr
=
StorageImpl_ReadDirEntry
(
This
,
newRightChildParent
,
&
newRightChildParentEntry
);
if
(
!
res
)
if
(
FAILED
(
hr
)
)
{
return
E_FAIL
;
return
hr
;
}
if
(
newRightChildParentEntry
.
rightChild
!=
DIRENTRY_NULL
)
...
...
@@ -2230,7 +2225,6 @@ static HRESULT StorageImpl_Construct(
StorageImpl
*
This
;
HRESULT
hr
=
S_OK
;
DirEntry
currentEntry
;
BOOL
readSuccessful
;
DirRef
currentEntryRef
;
if
(
FAILED
(
validateSTGM
(
openFlags
)
))
...
...
@@ -2405,12 +2399,12 @@ static HRESULT StorageImpl_Construct(
do
{
readSuccessful
=
StorageImpl_ReadDirEntry
(
hr
=
StorageImpl_ReadDirEntry
(
This
,
currentEntryRef
,
&
currentEntry
);
if
(
readSuccessful
)
if
(
SUCCEEDED
(
hr
)
)
{
if
(
(
currentEntry
.
sizeOfNameString
!=
0
)
&&
(
currentEntry
.
stgType
==
STGTY_ROOT
)
)
...
...
@@ -2421,9 +2415,9 @@ static HRESULT StorageImpl_Construct(
currentEntryRef
++
;
}
while
(
readSuccessful
&&
(
This
->
base
.
storageDirEntry
==
DIRENTRY_NULL
)
);
}
while
(
SUCCEEDED
(
hr
)
&&
(
This
->
base
.
storageDirEntry
==
DIRENTRY_NULL
)
);
if
(
!
readSuccessful
)
if
(
FAILED
(
hr
)
)
{
hr
=
STG_E_READFAULT
;
goto
end
;
...
...
@@ -3247,7 +3241,7 @@ void UpdateRawDirEntry(BYTE *buffer, const DirEntry *newData)
*
* This method will read the specified directory entry.
*/
BOOL
StorageImpl_ReadDirEntry
(
HRESULT
StorageImpl_ReadDirEntry
(
StorageImpl
*
This
,
DirRef
index
,
DirEntry
*
buffer
)
...
...
@@ -3326,7 +3320,7 @@ BOOL StorageImpl_ReadDirEntry(
buffer
->
size
.
u
.
HighPart
=
0
;
}
return
SUCCEEDED
(
readRes
)
?
TRUE
:
FALSE
;
return
readRes
;
}
/*********************************************************************
...
...
@@ -3858,7 +3852,7 @@ static HRESULT WINAPI IEnumSTATSTGImpl_Reset(
IEnumSTATSTGImpl
*
const
This
=
(
IEnumSTATSTGImpl
*
)
iface
;
DirEntry
storageEntry
;
BOOL
readSuccessful
;
HRESULT
hr
;
/*
* Re-initialize the search stack to an empty stack
...
...
@@ -3868,12 +3862,12 @@ static HRESULT WINAPI IEnumSTATSTGImpl_Reset(
/*
* Read the storage entry from the top-level storage.
*/
readSuccessful
=
StorageImpl_ReadDirEntry
(
hr
=
StorageImpl_ReadDirEntry
(
This
->
parentStorage
,
This
->
storageDirEntry
,
&
storageEntry
);
if
(
readSuccessful
)
if
(
SUCCEEDED
(
hr
)
)
{
assert
(
storageEntry
.
sizeOfNameString
!=
0
);
...
...
@@ -3883,7 +3877,7 @@ static HRESULT WINAPI IEnumSTATSTGImpl_Reset(
IEnumSTATSTGImpl_PushSearchNode
(
This
,
storageEntry
.
dirRootEntry
);
}
return
S_OK
;
return
hr
;
}
static
HRESULT
WINAPI
IEnumSTATSTGImpl_Clone
(
...
...
@@ -3934,7 +3928,7 @@ static void IEnumSTATSTGImpl_PushSearchNode(
DirRef
nodeToPush
)
{
DirEntry
storageEntry
;
BOOL
readSuccessful
;
HRESULT
hr
;
/*
* First, make sure we're not trying to push an unexisting node.
...
...
@@ -3962,12 +3956,12 @@ static void IEnumSTATSTGImpl_PushSearchNode(
/*
* Read the storage entry from the top-level storage.
*/
readSuccessful
=
StorageImpl_ReadDirEntry
(
hr
=
StorageImpl_ReadDirEntry
(
This
->
parentStorage
,
nodeToPush
,
&
storageEntry
);
if
(
readSuccessful
)
if
(
SUCCEEDED
(
hr
)
)
{
assert
(
storageEntry
.
sizeOfNameString
!=
0
);
...
...
@@ -4327,19 +4321,19 @@ void BlockChainStream_Destroy(BlockChainStream* This)
static
ULONG
BlockChainStream_GetHeadOfChain
(
BlockChainStream
*
This
)
{
DirEntry
chainEntry
;
BOOL
readSuccessful
;
HRESULT
hr
;
if
(
This
->
headOfStreamPlaceHolder
!=
0
)
return
*
(
This
->
headOfStreamPlaceHolder
);
if
(
This
->
ownerDirEntry
!=
DIRENTRY_NULL
)
{
readSuccessful
=
StorageImpl_ReadDirEntry
(
hr
=
StorageImpl_ReadDirEntry
(
This
->
parentStorage
,
This
->
ownerDirEntry
,
&
chainEntry
);
if
(
readSuccessful
)
if
(
SUCCEEDED
(
hr
)
)
{
return
chainEntry
.
startingBlock
;
}
...
...
@@ -4855,19 +4849,19 @@ static ULONG SmallBlockChainStream_GetHeadOfChain(
SmallBlockChainStream
*
This
)
{
DirEntry
chainEntry
;
BOOL
readSuccessful
;
HRESULT
hr
;
if
(
This
->
headOfStreamPlaceHolder
!=
NULL
)
return
*
(
This
->
headOfStreamPlaceHolder
);
if
(
This
->
ownerDirEntry
)
{
readSuccessful
=
StorageImpl_ReadDirEntry
(
hr
=
StorageImpl_ReadDirEntry
(
This
->
parentStorage
,
This
->
ownerDirEntry
,
&
chainEntry
);
if
(
readSuccessful
)
if
(
SUCCEEDED
(
hr
)
)
{
return
chainEntry
.
startingBlock
;
}
...
...
dlls/ole32/storage32.h
View file @
8a332db2
...
...
@@ -331,7 +331,7 @@ HRESULT StorageImpl_WriteRawDirEntry(
ULONG
index
,
const
BYTE
*
buffer
);
BOOL
StorageImpl_ReadDirEntry
(
HRESULT
StorageImpl_ReadDirEntry
(
StorageImpl
*
This
,
DirRef
index
,
DirEntry
*
buffer
);
...
...
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