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
e8a7587b
Commit
e8a7587b
authored
Jul 24, 2006
by
Mike McCormack
Committed by
Alexandre Julliard
Jul 24, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Implement MsiGetFileHash.
parent
6eb4bfe8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
4 deletions
+66
-4
msi.c
dlls/msi/msi.c
+66
-4
No files found.
dlls/msi/msi.c
View file @
e8a7587b
...
@@ -2102,14 +2102,66 @@ UINT WINAPI MsiReinstallFeatureA( LPCSTR szProduct, LPCSTR szFeature,
...
@@ -2102,14 +2102,66 @@ UINT WINAPI MsiReinstallFeatureA( LPCSTR szProduct, LPCSTR szFeature,
return
rc
;
return
rc
;
}
}
typedef
struct
{
unsigned
int
i
[
2
];
unsigned
int
buf
[
4
];
unsigned
char
in
[
64
];
unsigned
char
digest
[
16
];
}
MD5_CTX
;
extern
VOID
WINAPI
MD5Init
(
MD5_CTX
*
);
extern
VOID
WINAPI
MD5Update
(
MD5_CTX
*
,
const
unsigned
char
*
,
unsigned
int
);
extern
VOID
WINAPI
MD5Final
(
MD5_CTX
*
);
/***********************************************************************
/***********************************************************************
* MsiGetFileHashW [MSI.@]
* MsiGetFileHashW [MSI.@]
*/
*/
UINT
WINAPI
MsiGetFileHashW
(
LPCWSTR
szFilePath
,
DWORD
dwOptions
,
UINT
WINAPI
MsiGetFileHashW
(
LPCWSTR
szFilePath
,
DWORD
dwOptions
,
PMSIFILEHASHINFO
pHash
)
PMSIFILEHASHINFO
pHash
)
{
{
FIXME
(
"%s %08lx %p
\n
"
,
debugstr_w
(
szFilePath
),
dwOptions
,
pHash
);
HANDLE
handle
,
mapping
;
return
ERROR_CALL_NOT_IMPLEMENTED
;
void
*
p
;
DWORD
length
;
UINT
r
=
ERROR_FUNCTION_FAILED
;
TRACE
(
"%s %08lx %p
\n
"
,
debugstr_w
(
szFilePath
),
dwOptions
,
pHash
);
if
(
dwOptions
)
return
ERROR_INVALID_PARAMETER
;
if
(
!
pHash
)
return
ERROR_INVALID_PARAMETER
;
if
(
pHash
->
dwFileHashInfoSize
<
sizeof
*
pHash
)
return
ERROR_INVALID_PARAMETER
;
handle
=
CreateFileW
(
szFilePath
,
GENERIC_READ
,
FILE_SHARE_READ
|
FILE_SHARE_DELETE
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
if
(
handle
==
INVALID_HANDLE_VALUE
)
return
ERROR_FILE_NOT_FOUND
;
length
=
GetFileSize
(
handle
,
NULL
);
mapping
=
CreateFileMappingW
(
handle
,
NULL
,
PAGE_READONLY
,
0
,
0
,
NULL
);
if
(
mapping
)
{
p
=
MapViewOfFile
(
mapping
,
FILE_MAP_READ
,
0
,
0
,
length
);
if
(
p
)
{
MD5_CTX
ctx
;
MD5Init
(
&
ctx
);
MD5Update
(
&
ctx
,
p
,
length
);
MD5Final
(
&
ctx
);
UnmapViewOfFile
(
p
);
memcpy
(
pHash
->
dwData
,
&
ctx
.
digest
,
sizeof
pHash
->
dwData
);
r
=
ERROR_SUCCESS
;
}
CloseHandle
(
mapping
);
}
CloseHandle
(
handle
);
return
r
;
}
}
/***********************************************************************
/***********************************************************************
...
@@ -2118,8 +2170,18 @@ UINT WINAPI MsiGetFileHashW( LPCWSTR szFilePath, DWORD dwOptions,
...
@@ -2118,8 +2170,18 @@ UINT WINAPI MsiGetFileHashW( LPCWSTR szFilePath, DWORD dwOptions,
UINT
WINAPI
MsiGetFileHashA
(
LPCSTR
szFilePath
,
DWORD
dwOptions
,
UINT
WINAPI
MsiGetFileHashA
(
LPCSTR
szFilePath
,
DWORD
dwOptions
,
PMSIFILEHASHINFO
pHash
)
PMSIFILEHASHINFO
pHash
)
{
{
FIXME
(
"%s %08lx %p
\n
"
,
debugstr_a
(
szFilePath
),
dwOptions
,
pHash
);
LPWSTR
file
;
return
ERROR_CALL_NOT_IMPLEMENTED
;
UINT
r
;
TRACE
(
"%s %08lx %p
\n
"
,
debugstr_a
(
szFilePath
),
dwOptions
,
pHash
);
file
=
strdupAtoW
(
szFilePath
);
if
(
szFilePath
&&
!
file
)
return
ERROR_OUTOFMEMORY
;
r
=
MsiGetFileHashW
(
file
,
dwOptions
,
pHash
);
msi_free
(
file
);
return
r
;
}
}
/***********************************************************************
/***********************************************************************
...
...
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