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
bfc32ae0
Commit
bfc32ae0
authored
Jan 27, 2009
by
Huw Davies
Committed by
Alexandre Julliard
Jan 28, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Add a helper function to return the file size and modify EnsureExists to use it.
parent
cc7edbe3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
10 deletions
+31
-10
stg_bigblockfile.c
dlls/ole32/stg_bigblockfile.c
+29
-8
storage32.h
dlls/ole32/storage32.h
+2
-2
No files found.
dlls/ole32/stg_bigblockfile.c
View file @
bfc32ae0
...
@@ -827,10 +827,12 @@ HRESULT BIGBLOCKFILE_WriteAt(BigBlockFile *This, ULARGE_INTEGER offset,
...
@@ -827,10 +827,12 @@ HRESULT BIGBLOCKFILE_WriteAt(BigBlockFile *This, ULARGE_INTEGER offset,
* Sets the size of the file.
* Sets the size of the file.
*
*
*/
*/
void
BIGBLOCKFILE_SetSize
(
BigBlockFile
*
This
,
ULARGE_INTEGER
newSize
)
HRESULT
BIGBLOCKFILE_SetSize
(
BigBlockFile
*
This
,
ULARGE_INTEGER
newSize
)
{
{
HRESULT
hr
=
S_OK
;
if
(
This
->
filesize
.
u
.
LowPart
==
newSize
.
u
.
LowPart
)
if
(
This
->
filesize
.
u
.
LowPart
==
newSize
.
u
.
LowPart
)
return
;
return
hr
;
TRACE
(
"from %u to %u
\n
"
,
This
->
filesize
.
u
.
LowPart
,
newSize
.
u
.
LowPart
);
TRACE
(
"from %u to %u
\n
"
,
This
->
filesize
.
u
.
LowPart
,
newSize
.
u
.
LowPart
);
...
@@ -882,6 +884,20 @@ void BIGBLOCKFILE_SetSize(BigBlockFile *This, ULARGE_INTEGER newSize)
...
@@ -882,6 +884,20 @@ void BIGBLOCKFILE_SetSize(BigBlockFile *This, ULARGE_INTEGER newSize)
This
->
filesize
.
u
.
HighPart
=
newSize
.
u
.
HighPart
;
This
->
filesize
.
u
.
HighPart
=
newSize
.
u
.
HighPart
;
BIGBLOCKFILE_RemapAllMappedPages
(
This
);
BIGBLOCKFILE_RemapAllMappedPages
(
This
);
return
hr
;
}
/******************************************************************************
* BIGBLOCKFILE_GetSize
*
* Gets the size of the file.
*
*/
static
HRESULT
BIGBLOCKFILE_GetSize
(
BigBlockFile
*
This
,
ULARGE_INTEGER
*
size
)
{
HRESULT
hr
=
S_OK
;
*
size
=
This
->
filesize
;
return
hr
;
}
}
/******************************************************************************
/******************************************************************************
...
@@ -889,22 +905,27 @@ void BIGBLOCKFILE_SetSize(BigBlockFile *This, ULARGE_INTEGER newSize)
...
@@ -889,22 +905,27 @@ void BIGBLOCKFILE_SetSize(BigBlockFile *This, ULARGE_INTEGER newSize)
*
*
* Grows the file if necessary to make sure the block is valid.
* Grows the file if necessary to make sure the block is valid.
*/
*/
void
BIGBLOCKFILE_EnsureExists
(
BigBlockFile
*
This
,
ULONG
index
)
HRESULT
BIGBLOCKFILE_EnsureExists
(
BigBlockFile
*
This
,
ULONG
index
)
{
{
ULARGE_INTEGER
size
;
HRESULT
hr
;
/* Block index starts at -1 translate to zero based index */
/* Block index starts at -1 translate to zero based index */
if
(
index
==
0xffffffff
)
if
(
index
==
0xffffffff
)
index
=
0
;
index
=
0
;
else
else
index
++
;
index
++
;
hr
=
BIGBLOCKFILE_GetSize
(
This
,
&
size
);
if
(
FAILED
(
hr
))
return
hr
;
/* make sure that the block physically exists */
/* make sure that the block physically exists */
if
((
This
->
blocksize
*
(
index
+
1
))
>
This
->
filesize
.
u
.
Low
Part
)
if
((
This
->
blocksize
*
(
index
+
1
))
>
size
.
Quad
Part
)
{
{
ULARGE_INTEGER
newSize
;
ULARGE_INTEGER
newSize
;
newSize
.
u
.
HighPart
=
0
;
newSize
.
QuadPart
=
This
->
blocksize
*
(
index
+
1
);
newSize
.
u
.
LowPart
=
This
->
blocksize
*
(
index
+
1
);
hr
=
BIGBLOCKFILE_SetSize
(
This
,
newSize
);
BIGBLOCKFILE_SetSize
(
This
,
newSize
);
}
}
return
hr
;
}
}
dlls/ole32/storage32.h
View file @
bfc32ae0
...
@@ -164,8 +164,8 @@ BigBlockFile* BIGBLOCKFILE_Construct(HANDLE hFile,
...
@@ -164,8 +164,8 @@ BigBlockFile* BIGBLOCKFILE_Construct(HANDLE hFile,
ULONG
blocksize
,
ULONG
blocksize
,
BOOL
fileBased
);
BOOL
fileBased
);
void
BIGBLOCKFILE_Destructor
(
LPBIGBLOCKFILE
This
);
void
BIGBLOCKFILE_Destructor
(
LPBIGBLOCKFILE
This
);
void
BIGBLOCKFILE_EnsureExists
(
LPBIGBLOCKFILE
This
,
ULONG
index
);
HRESULT
BIGBLOCKFILE_EnsureExists
(
LPBIGBLOCKFILE
This
,
ULONG
index
);
void
BIGBLOCKFILE_SetSize
(
LPBIGBLOCKFILE
This
,
ULARGE_INTEGER
newSize
);
HRESULT
BIGBLOCKFILE_SetSize
(
LPBIGBLOCKFILE
This
,
ULARGE_INTEGER
newSize
);
HRESULT
BIGBLOCKFILE_ReadAt
(
LPBIGBLOCKFILE
This
,
ULARGE_INTEGER
offset
,
HRESULT
BIGBLOCKFILE_ReadAt
(
LPBIGBLOCKFILE
This
,
ULARGE_INTEGER
offset
,
void
*
buffer
,
ULONG
size
,
ULONG
*
bytesRead
);
void
*
buffer
,
ULONG
size
,
ULONG
*
bytesRead
);
HRESULT
BIGBLOCKFILE_WriteAt
(
LPBIGBLOCKFILE
This
,
ULARGE_INTEGER
offset
,
HRESULT
BIGBLOCKFILE_WriteAt
(
LPBIGBLOCKFILE
This
,
ULARGE_INTEGER
offset
,
...
...
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