Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
f87c4a36
Commit
f87c4a36
authored
Apr 05, 2012
by
Robert van Herk
Committed by
Alexandre Julliard
Apr 06, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Fixed MsiGetFileHashW for empty files.
parent
b08f2237
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
12 deletions
+28
-12
msi.c
dlls/msi/msi.c
+22
-12
msi.c
dlls/msi/tests/msi.c
+6
-0
No files found.
dlls/msi/msi.c
View file @
f87c4a36
...
...
@@ -4014,24 +4014,34 @@ UINT WINAPI MsiGetFileHashW( LPCWSTR szFilePath, DWORD dwOptions,
}
length
=
GetFileSize
(
handle
,
NULL
);
mapping
=
CreateFileMappingW
(
handle
,
NULL
,
PAGE_READONLY
,
0
,
0
,
NULL
);
if
(
mapping
)
if
(
length
)
{
p
=
MapViewOfFile
(
mapping
,
FILE_MAP_READ
,
0
,
0
,
length
);
if
(
p
)
mapping
=
CreateFileMappingW
(
handle
,
NULL
,
PAGE_READONLY
,
0
,
0
,
NULL
);
if
(
mapping
)
{
MD5_CTX
ctx
;
p
=
MapViewOfFile
(
mapping
,
FILE_MAP_READ
,
0
,
0
,
length
);
if
(
p
)
{
MD5_CTX
ctx
;
MD5Init
(
&
ctx
);
MD5Update
(
&
ctx
,
p
,
length
);
MD5Final
(
&
ctx
);
UnmapViewOfFile
(
p
);
MD5Init
(
&
ctx
);
MD5Update
(
&
ctx
,
p
,
length
);
MD5Final
(
&
ctx
);
UnmapViewOfFile
(
p
);
memcpy
(
pHash
->
dwData
,
ctx
.
digest
,
sizeof
pHash
->
dwData
);
r
=
ERROR_SUCCESS
;
memcpy
(
pHash
->
dwData
,
ctx
.
digest
,
sizeof
pHash
->
dwData
);
r
=
ERROR_SUCCESS
;
}
CloseHandle
(
mapping
);
}
CloseHandle
(
mapping
);
}
else
{
/* Empty file -> set hash to 0 */
memset
(
pHash
->
dwData
,
0
,
sizeof
pHash
->
dwData
);
r
=
ERROR_SUCCESS
;
}
CloseHandle
(
handle
);
return
r
;
...
...
dlls/msi/tests/msi.c
View file @
f87c4a36
...
...
@@ -417,6 +417,12 @@ static const struct
MSIFILEHASHINFO
hash
;
}
hash_data
[]
=
{
{
""
,
0
,
{
HASHSIZE
,
{
0
,
0
,
0
,
0
},
},
},
{
"abc"
,
0
,
{
HASHSIZE
,
{
0x98500190
,
0xb04fd23c
,
0x7d3f96d6
,
0x727fe128
},
...
...
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