Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
bfc32ae0
Commit
bfc32ae0
authored
16 years ago
by
Huw Davies
Committed by
Alexandre Julliard
16 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ole32: Add a helper function to return the file size and modify EnsureExists to use it.
parent
cc7edbe3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/ole32/stg_bigblockfile.c
+29
-8
29 additions, 8 deletions
dlls/ole32/stg_bigblockfile.c
dlls/ole32/storage32.h
+2
-2
2 additions, 2 deletions
dlls/ole32/storage32.h
with
31 additions
and
10 deletions
dlls/ole32/stg_bigblockfile.c
+
29
−
8
View file @
bfc32ae0
...
...
@@ -827,10 +827,12 @@ HRESULT BIGBLOCKFILE_WriteAt(BigBlockFile *This, ULARGE_INTEGER offset,
* 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
)
return
;
return
hr
;
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)
This
->
filesize
.
u
.
HighPart
=
newSize
.
u
.
HighPart
;
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)
*
* 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 */
if
(
index
==
0xffffffff
)
index
=
0
;
else
index
++
;
hr
=
BIGBLOCKFILE_GetSize
(
This
,
&
size
);
if
(
FAILED
(
hr
))
return
hr
;
/* 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
;
newSize
.
u
.
HighPart
=
0
;
newSize
.
u
.
LowPart
=
This
->
blocksize
*
(
index
+
1
);
BIGBLOCKFILE_SetSize
(
This
,
newSize
);
newSize
.
QuadPart
=
This
->
blocksize
*
(
index
+
1
);
hr
=
BIGBLOCKFILE_SetSize
(
This
,
newSize
);
}
return
hr
;
}
This diff is collapsed.
Click to expand it.
dlls/ole32/storage32.h
+
2
−
2
View file @
bfc32ae0
...
...
@@ -164,8 +164,8 @@ BigBlockFile* BIGBLOCKFILE_Construct(HANDLE hFile,
ULONG
blocksize
,
BOOL
fileBased
);
void
BIGBLOCKFILE_Destructor
(
LPBIGBLOCKFILE
This
);
void
BIGBLOCKFILE_EnsureExists
(
LPBIGBLOCKFILE
This
,
ULONG
index
);
void
BIGBLOCKFILE_SetSize
(
LPBIGBLOCKFILE
This
,
ULARGE_INTEGER
newSize
);
HRESULT
BIGBLOCKFILE_EnsureExists
(
LPBIGBLOCKFILE
This
,
ULONG
index
);
HRESULT
BIGBLOCKFILE_SetSize
(
LPBIGBLOCKFILE
This
,
ULARGE_INTEGER
newSize
);
HRESULT
BIGBLOCKFILE_ReadAt
(
LPBIGBLOCKFILE
This
,
ULARGE_INTEGER
offset
,
void
*
buffer
,
ULONG
size
,
ULONG
*
bytesRead
);
HRESULT
BIGBLOCKFILE_WriteAt
(
LPBIGBLOCKFILE
This
,
ULARGE_INTEGER
offset
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment