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
2cee7ac6
Commit
2cee7ac6
authored
Jan 19, 2004
by
Mike McCormack
Committed by
Alexandre Julliard
Jan 19, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't use CreateFileMapping on a zero length file.
parent
4cd80a36
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
14 deletions
+23
-14
stg_bigblockfile.c
dlls/ole32/stg_bigblockfile.c
+23
-14
No files found.
dlls/ole32/stg_bigblockfile.c
View file @
2cee7ac6
...
...
@@ -222,22 +222,27 @@ static BOOL BIGBLOCKFILE_FileInit(LPBIGBLOCKFILE This, HANDLE hFile)
if
(
This
->
hfile
==
INVALID_HANDLE_VALUE
)
return
FALSE
;
/* create the file mapping object
*/
This
->
hfilemap
=
CreateFileMappingA
(
This
->
hfile
,
NULL
,
This
->
flProtect
,
0
,
0
,
NULL
);
This
->
filesize
.
s
.
LowPart
=
GetFileSize
(
This
->
hfile
,
&
This
->
filesize
.
s
.
HighPart
);
if
(
!
This
->
hfilemap
)
if
(
This
->
filesize
.
s
.
LowPart
||
This
->
filesize
.
s
.
HighPart
)
{
CloseHandle
(
This
->
hfile
);
return
FALSE
;
}
/* create the file mapping object
*/
This
->
hfilemap
=
CreateFileMappingA
(
This
->
hfile
,
NULL
,
This
->
flProtect
,
0
,
0
,
NULL
);
This
->
filesize
.
s
.
LowPart
=
GetFileSize
(
This
->
hfile
,
&
This
->
filesize
.
s
.
HighPart
);
if
(
!
This
->
hfilemap
)
{
CloseHandle
(
This
->
hfile
);
return
FALSE
;
}
}
else
This
->
hfilemap
=
NULL
;
This
->
maplist
=
NULL
;
...
...
@@ -420,7 +425,8 @@ void BIGBLOCKFILE_SetSize(LPBIGBLOCKFILE This, ULARGE_INTEGER newSize)
/*
* close file-mapping object, must be done before call to SetEndFile
*/
CloseHandle
(
This
->
hfilemap
);
if
(
This
->
hfilemap
)
CloseHandle
(
This
->
hfilemap
);
This
->
hfilemap
=
0
;
/*
...
...
@@ -662,6 +668,9 @@ static BOOL BIGBLOCKFILE_MapPage(LPBIGBLOCKFILE This, MappedPage *page)
DWORD
numBytesToMap
;
DWORD
desired_access
;
if
(
!
This
->
hfilemap
)
return
FALSE
;
if
(
lowoffset
+
PAGE_SIZE
>
This
->
filesize
.
s
.
LowPart
)
numBytesToMap
=
This
->
filesize
.
s
.
LowPart
-
lowoffset
;
else
...
...
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