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
95a80d35
Commit
95a80d35
authored
Feb 24, 2020
by
Daniel Lehman
Committed by
Alexandre Julliard
Feb 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wintrust: Set last error in WinVerifyTrust.
Signed-off-by:
Daniel Lehman
<
dlehman25@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
690fbf64
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
softpub.c
dlls/wintrust/tests/softpub.c
+10
-0
wintrust_main.c
dlls/wintrust/wintrust_main.c
+1
-0
No files found.
dlls/wintrust/tests/softpub.c
View file @
95a80d35
...
...
@@ -845,7 +845,9 @@ static void test_wintrust(void)
file
.
pcwszFilePath
=
pathW
;
/* Test with an empty file */
file
.
hFile
=
create_temp_file
(
pathW
);
SetLastError
(
0xdeadbeef
);
r
=
WinVerifyTrust
(
INVALID_HANDLE_VALUE
,
&
generic_action_v2
,
&
wtd
);
ok
(
r
==
GetLastError
(),
"expected %08x, got %08x
\n
"
,
GetLastError
(),
r
);
ok
(
r
==
TRUST_E_SUBJECT_FORM_UNKNOWN
,
"expected TRUST_E_SUBJECT_FORM_UNKNOWN, got %08x
\n
"
,
r
);
CloseHandle
(
file
.
hFile
);
...
...
@@ -853,18 +855,26 @@ static void test_wintrust(void)
file
.
hFile
=
NULL
;
/* Test with a known file path, which we expect not have a signature */
getNotepadPath
(
pathW
,
MAX_PATH
);
SetLastError
(
0xdeadbeef
);
r
=
WinVerifyTrust
(
INVALID_HANDLE_VALUE
,
&
generic_action_v2
,
&
wtd
);
ok
(
r
==
GetLastError
(),
"expected %08x, got %08x
\n
"
,
GetLastError
(),
r
);
ok
(
r
==
TRUST_E_NOSIGNATURE
||
r
==
CRYPT_E_FILE_ERROR
,
"expected TRUST_E_NOSIGNATURE or CRYPT_E_FILE_ERROR, got %08x
\n
"
,
r
);
wtd
.
dwStateAction
=
WTD_STATEACTION_CLOSE
;
SetLastError
(
0xdeadbeef
);
r
=
WinVerifyTrust
(
INVALID_HANDLE_VALUE
,
&
generic_action_v2
,
&
wtd
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"expected 0xdeadbeef, got %08x
\n
"
,
GetLastError
());
ok
(
r
==
S_OK
,
"WinVerifyTrust failed: %08x
\n
"
,
r
);
wtd
.
dwStateAction
=
WTD_STATEACTION_VERIFY
;
SetLastError
(
0xdeadbeef
);
hr
=
WinVerifyTrustEx
(
INVALID_HANDLE_VALUE
,
&
generic_action_v2
,
&
wtd
);
ok
(
hr
==
GetLastError
(),
"expected %08x, got %08x
\n
"
,
GetLastError
(),
hr
);
ok
(
hr
==
TRUST_E_NOSIGNATURE
||
hr
==
CRYPT_E_FILE_ERROR
,
"expected TRUST_E_NOSIGNATURE or CRYPT_E_FILE_ERROR, got %08x
\n
"
,
hr
);
wtd
.
dwStateAction
=
WTD_STATEACTION_CLOSE
;
SetLastError
(
0xdeadbeef
);
r
=
WinVerifyTrust
(
INVALID_HANDLE_VALUE
,
&
generic_action_v2
,
&
wtd
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"expected 0xdeadbeef, got %08x
\n
"
,
GetLastError
());
ok
(
r
==
S_OK
,
"WinVerifyTrust failed: %08x
\n
"
,
r
);
}
...
...
dlls/wintrust/wintrust_main.c
View file @
95a80d35
...
...
@@ -732,6 +732,7 @@ LONG WINAPI WinVerifyTrust( HWND hwnd, GUID *ActionID, LPVOID ActionData )
}
}
if
(
err
)
SetLastError
(
err
);
TRACE
(
"returning %08x
\n
"
,
err
);
return
err
;
}
...
...
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