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
93c37404
Commit
93c37404
authored
Sep 28, 2006
by
Paul Vriens
Committed by
Alexandre Julliard
Sep 28, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: A small test to verify when to write function pointers.
parent
ecb97fc2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
sip.c
dlls/crypt32/tests/sip.c
+11
-0
No files found.
dlls/crypt32/tests/sip.c
View file @
93c37404
...
...
@@ -283,41 +283,50 @@ static void test_SIPLoad(void)
SetLastError
(
0xdeadbeef
);
memset
(
&
sdi
,
0
,
sizeof
(
SIP_DISPATCH_INFO
));
sdi
.
cbSize
=
sizeof
(
SIP_DISPATCH_INFO
);
sdi
.
pfGet
=
(
pCryptSIPGetSignedDataMsg
)
0xdeadbeef
;
ret
=
CryptSIPLoad
(
&
dummySubject
,
0
,
&
sdi
);
ok
(
!
ret
,
"Expected CryptSIPLoad to fail
\n
"
);
todo_wine
ok
(
GetLastError
()
==
TRUST_E_SUBJECT_FORM_UNKNOWN
,
"Expected TRUST_E_SUBJECT_FORM_UNKNOWN, got 0x%08lx
\n
"
,
GetLastError
());
ok
(
sdi
.
pfGet
==
(
pCryptSIPGetSignedDataMsg
)
0xdeadbeef
,
"Expected no change to the function pointer
\n
"
);
/* cbSize not initialized */
SetLastError
(
0xdeadbeef
);
memset
(
&
sdi
,
0
,
sizeof
(
SIP_DISPATCH_INFO
));
sdi
.
pfGet
=
(
pCryptSIPGetSignedDataMsg
)
0xdeadbeef
;
ret
=
CryptSIPLoad
(
&
dummySubject
,
0
,
&
sdi
);
ok
(
!
ret
,
"Expected CryptSIPLoad to fail
\n
"
);
todo_wine
ok
(
GetLastError
()
==
TRUST_E_SUBJECT_FORM_UNKNOWN
,
"Expected TRUST_E_SUBJECT_FORM_UNKNOWN, got 0x%08lx
\n
"
,
GetLastError
());
ok
(
sdi
.
pfGet
==
(
pCryptSIPGetSignedDataMsg
)
0xdeadbeef
,
"Expected no change to the function pointer
\n
"
);
/* cbSize not initialized, but valid subject (named unknown but registered by wintrust) */
SetLastError
(
0xdeadbeef
);
memset
(
&
sdi
,
0
,
sizeof
(
SIP_DISPATCH_INFO
));
sdi
.
pfGet
=
(
pCryptSIPGetSignedDataMsg
)
0xdeadbeef
;
ret
=
CryptSIPLoad
(
&
unknown
,
0
,
&
sdi
);
todo_wine
{
ok
(
ret
,
"Expected CryptSIPLoad to succeed
\n
"
);
ok
(
GetLastError
()
==
ERROR_PROC_NOT_FOUND
,
"Expected ERROR_PROC_NOT_FOUND, got 0x%08lx
\n
"
,
GetLastError
());
ok
(
sdi
.
pfGet
!=
(
pCryptSIPGetSignedDataMsg
)
0xdeadbeef
,
"Expected a function pointer to be loaded.
\n
"
);
}
/* All OK */
SetLastError
(
0xdeadbeef
);
memset
(
&
sdi
,
0
,
sizeof
(
SIP_DISPATCH_INFO
));
sdi
.
cbSize
=
sizeof
(
SIP_DISPATCH_INFO
);
sdi
.
pfGet
=
(
pCryptSIPGetSignedDataMsg
)
0xdeadbeef
;
ret
=
CryptSIPLoad
(
&
unknown
,
0
,
&
sdi
);
todo_wine
ok
(
ret
,
"Expected CryptSIPLoad to succeed
\n
"
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got 0x%08lx
\n
"
,
GetLastError
());
todo_wine
ok
(
sdi
.
pfGet
!=
(
pCryptSIPGetSignedDataMsg
)
0xdeadbeef
,
"Expected a function pointer to be loaded.
\n
"
);
/* The function addresses returned by CryptSIPLoad are actually the addresses of
* crypt32's own functions. A function calling these addresses will end up first
...
...
@@ -351,11 +360,13 @@ static void test_SIPLoad(void)
SetLastError
(
0xdeadbeef
);
memset
(
&
sdi
,
0
,
sizeof
(
SIP_DISPATCH_INFO
));
sdi
.
cbSize
=
sizeof
(
SIP_DISPATCH_INFO
);
sdi
.
pfGet
=
(
pCryptSIPGetSignedDataMsg
)
0xdeadbeef
;
ret
=
CryptSIPLoad
(
&
unknown
,
1
,
&
sdi
);
ok
(
!
ret
,
"Expected CryptSIPLoad to fail
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got 0x%08lx
\n
"
,
GetLastError
());
ok
(
sdi
.
pfGet
==
(
pCryptSIPGetSignedDataMsg
)
0xdeadbeef
,
"Expected no change to the function pointer
\n
"
);
}
START_TEST
(
sip
)
...
...
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