Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
925d6027
Commit
925d6027
authored
Jan 31, 2002
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CodeWeavers
Small fixes.
parent
bb2eab5f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
159 additions
and
62 deletions
+159
-62
stg_stream.c
dlls/ole32/stg_stream.c
+27
-16
storage32.c
dlls/ole32/storage32.c
+121
-38
storage32.h
dlls/ole32/storage32.h
+11
-8
No files found.
dlls/ole32/stg_stream.c
View file @
925d6027
...
...
@@ -246,7 +246,7 @@ void StgStreamImpl_OpenBlockChain(
BOOL
readSucessful
;
/*
* Make sure no old object is
staying behind
.
* Make sure no old object is
left over
.
*/
if
(
This
->
smallBlockChain
!=
0
)
{
...
...
@@ -303,7 +303,7 @@ void StgStreamImpl_OpenBlockChain(
/***
* This method is part of the ISequentialStream interface.
*
* I
f
reads a block of information from the stream at the current
* I
t
reads a block of information from the stream at the current
* position. It then moves the current position at the end of the
* read block
*
...
...
@@ -319,12 +319,13 @@ HRESULT WINAPI StgStreamImpl_Read(
ULONG
bytesReadBuffer
;
ULONG
bytesToReadFromBuffer
;
HRESULT
res
=
S_FALSE
;
TRACE
(
"(%p, %p, %ld, %p)
\n
"
,
iface
,
pv
,
cb
,
pcbRead
);
/*
* If the caller is not interested in the nu
bm
er of bytes read,
* If the caller is not interested in the nu
mb
er of bytes read,
* we use another buffer to avoid "if" statements in the code.
*/
if
(
pcbRead
==
0
)
...
...
@@ -338,7 +339,7 @@ HRESULT WINAPI StgStreamImpl_Read(
/*
* Depending on the type of chain that was opened when the stream was constructed,
* we delegate the work to the method that read the block chains.
* we delegate the work to the method that read
s
the block chains.
*/
if
(
This
->
smallBlockChain
!=
0
)
{
...
...
@@ -365,7 +366,8 @@ HRESULT WINAPI StgStreamImpl_Read(
*/
*
pcbRead
=
0
;
return
S_OK
;
res
=
S_OK
;
goto
end
;
}
/*
...
...
@@ -379,14 +381,23 @@ HRESULT WINAPI StgStreamImpl_Read(
*/
This
->
currentPosition
.
s
.
LowPart
+=
*
pcbRead
;
/*
* The function returns S_OK if at least one byte could be read.
* FIXME: What should be returned if pcbRead argument is NULL?
*/
if
(
*
pcbRead
>
0
)
return
S_OK
;
if
(
*
pcbRead
!=
cb
)
{
WARN
(
"read %ld instead of the required %ld bytes !
\n
"
,
*
pcbRead
,
cb
);
/*
* this used to return S_FALSE, however MSDN docu says that an app should
* be prepared to handle error in case of stream end reached, as *some*
* implementations *might* return an error (IOW: most do *not*).
* As some program fails on returning S_FALSE, I better use S_OK here.
*/
res
=
S_OK
;
}
else
res
=
S_OK
;
return
S_FALSE
;
end:
TRACE
(
"<-- %08lx
\n
"
,
res
);
return
res
;
}
/***
...
...
@@ -632,7 +643,7 @@ HRESULT WINAPI StgStreamImpl_SetSize(
}
/*
* Write t
o the property the new information about this stream
* Write t
he new information about this stream to the property
*/
Success
=
StorageImpl_ReadProperty
(
This
->
parentStorage
->
ancestorStorage
,
This
->
ownerProperty
,
...
...
@@ -686,8 +697,8 @@ HRESULT WINAPI StgStreamImpl_CopyTo(
totalBytesWritten
.
s
.
LowPart
=
totalBytesWritten
.
s
.
HighPart
=
0
;
/*
* use stack to store data temporarly
* there is surely more performant way of doing it, for now this basic
* use stack to store data temporar
i
ly
* there is surely
a
more performant way of doing it, for now this basic
* implementation will do the job
*/
while
(
cb
.
s
.
LowPart
>
0
)
...
...
@@ -706,7 +717,7 @@ HRESULT WINAPI StgStreamImpl_CopyTo(
totalBytesWritten
.
s
.
LowPart
+=
bytesWritten
;
/*
* Check that read & write operations were succes
ful
l
* Check that read & write operations were succes
sfu
l
*/
if
(
bytesRead
!=
bytesWritten
)
{
...
...
dlls/ole32/storage32.c
View file @
925d6027
This diff is collapsed.
Click to expand it.
dlls/ole32/storage32.h
View file @
925d6027
...
...
@@ -179,15 +179,15 @@ HRESULT OLECONVERT_CreateCompObjStream(LPSTORAGE pStorage, LPCSTR strOleTypeName
/****************************************************************************
* Storage32BaseImpl definitions.
*
* This stucture defines the base information contained in all implementations
* of IStorage32 contained in this file
e
storage implementation.
* This st
r
ucture defines the base information contained in all implementations
* of IStorage32 contained in this file storage implementation.
*
* In OOP terms, this is the base class for all the IStorage32 implementations
* contained in this file.
*/
struct
StorageBaseImpl
{
ICOM_VFIELD
(
IStorage
);
/* Needs to be the first item in the stuct
ICOM_VFIELD
(
IStorage
);
/* Needs to be the first item in the st
r
uct
* since we want to cast this in a Storage32 pointer */
/*
...
...
@@ -281,8 +281,8 @@ HRESULT WINAPI StorageBaseImpl_SetClass(
*/
struct
StorageImpl
{
ICOM_VFIELD
(
IStorage
);
/* Needs to be the first item in the st
uct
* since we want to cast this in a Storage32 pointer */
ICOM_VFIELD
(
IStorage
);
/* Needs to be the first item in the str
uct
* since we want to cast this in a Storage32 pointer */
/*
* Declare the member of the Storage32BaseImpl class to allow
...
...
@@ -300,6 +300,9 @@ struct StorageImpl
HANDLE
hFile
;
/* Physical support for the Docfile */
LPOLESTR
pwcsName
;
/* Full path of the document file */
/* FIXME: should this be in Storage32BaseImpl ? */
WCHAR
filename
[
PROPERTY_NAME_BUFFER_LEN
];
/*
* File header
*/
...
...
@@ -477,7 +480,7 @@ void Storage32Impl_SetExtDepotBlock(StorageImpl* This,
*/
struct
StorageInternalImpl
{
ICOM_VFIELD
(
IStorage
);
/* Needs to be the first item in the stuct
ICOM_VFIELD
(
IStorage
);
/* Needs to be the first item in the st
r
uct
* since we want to cast this in a Storage32 pointer */
/*
...
...
@@ -521,7 +524,7 @@ HRESULT WINAPI StorageInternalImpl_Revert(
*/
struct
IEnumSTATSTGImpl
{
ICOM_VFIELD
(
IEnumSTATSTG
);
/* Needs to be the first item in the stuct
ICOM_VFIELD
(
IEnumSTATSTG
);
/* Needs to be the first item in the st
r
uct
* since we want to cast this in a IEnumSTATSTG pointer */
ULONG
ref
;
/* Reference count */
...
...
@@ -606,7 +609,7 @@ INT IEnumSTATSTGImpl_FindParentProperty(
*/
struct
StgStreamImpl
{
ICOM_VFIELD
(
IStream
);
/* Needs to be the first item in the stuct
ICOM_VFIELD
(
IStream
);
/* Needs to be the first item in the st
r
uct
* since we want to cast this in a IStream pointer */
/*
...
...
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