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
d78f7736
Commit
d78f7736
authored
Sep 08, 2006
by
Paul Vriens
Committed by
Alexandre Julliard
Sep 10, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32/tests: Added tests for CryptSIPAddProvider and CryptSIPRemoveProvider.
parent
f7ea4629
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
81 additions
and
0 deletions
+81
-0
main.c
dlls/crypt32/tests/main.c
+81
-0
No files found.
dlls/crypt32/tests/main.c
View file @
d78f7736
...
...
@@ -25,6 +25,7 @@
#include <winerror.h>
#include <wincrypt.h>
#include <winreg.h>
#include <mssip.h>
#include "wine/test.h"
...
...
@@ -343,6 +344,85 @@ static void test_getDefaultCryptProv(void)
CryptReleaseContext
(
prov
,
0
);
}
static
void
test_AddRemoveProvider
(
void
)
{
BOOL
ret
;
SIP_ADD_NEWPROVIDER
newprov
;
GUID
actionid
=
{
0xdeadbe
,
0xefde
,
0xadbe
,
{
0xef
,
0xde
,
0xad
,
0xbe
,
0xef
,
0xde
,
0xad
,
0xbe
}};
static
WCHAR
dummydll
[]
=
{
'd'
,
'e'
,
'a'
,
'd'
,
'b'
,
'e'
,
'e'
,
'f'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
};
static
WCHAR
dummyfunction
[]
=
{
'd'
,
'u'
,
'm'
,
'm'
,
'y'
,
'f'
,
'u'
,
'n'
,
'c'
,
't'
,
'i'
,
'o'
,
'n'
,
0
};
/* NULL check */
SetLastError
(
0xdeadbeef
);
ret
=
CryptSIPRemoveProvider
(
NULL
);
ok
(
!
ret
,
"Expected CryptSIPRemoveProvider to fail.
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %ld.
\n
"
,
GetLastError
());
/* nonexistent provider should result in a registry error */
SetLastError
(
0xdeadbeef
);
ret
=
CryptSIPRemoveProvider
(
&
actionid
);
ok
(
!
ret
,
"Expected CryptSIPRemoveProvider to fail.
\n
"
);
ok
(
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"Expected ERROR_FILE_NOT_FOUND, got %ld.
\n
"
,
GetLastError
());
/* Everything OK, pwszIsFunctionName and pwszIsFunctionNameFmt2 are left NULL
* as allowed */
memset
(
&
newprov
,
0
,
sizeof
(
SIP_ADD_NEWPROVIDER
));
newprov
.
cbStruct
=
sizeof
(
SIP_ADD_NEWPROVIDER
);
newprov
.
pgSubject
=
&
actionid
;
newprov
.
pwszDLLFileName
=
dummydll
;
newprov
.
pwszGetFuncName
=
dummyfunction
;
newprov
.
pwszPutFuncName
=
dummyfunction
;
newprov
.
pwszCreateFuncName
=
dummyfunction
;
newprov
.
pwszVerifyFuncName
=
dummyfunction
;
newprov
.
pwszRemoveFuncName
=
dummyfunction
;
SetLastError
(
0xdeadbeef
);
ret
=
CryptSIPAddProvider
(
&
newprov
);
ok
(
ret
,
"CryptSIPAddProvider should have succeeded
\n
"
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %ld
\n
"
,
GetLastError
());
/* Dummy provider will be deleted, but the function still fails because
* pwszIsFunctionName and pwszIsFunctionNameFmt2 are not present in the
* registry.
*/
SetLastError
(
0xdeadbeef
);
ret
=
CryptSIPRemoveProvider
(
&
actionid
);
ok
(
!
ret
,
"Expected CryptSIPRemoveProvider to fail.
\n
"
);
ok
(
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"Expected ERROR_FILE_NOT_FOUND, got %ld.
\n
"
,
GetLastError
());
/* Everything OK */
memset
(
&
newprov
,
0
,
sizeof
(
SIP_ADD_NEWPROVIDER
));
newprov
.
cbStruct
=
sizeof
(
SIP_ADD_NEWPROVIDER
);
newprov
.
pgSubject
=
&
actionid
;
newprov
.
pwszDLLFileName
=
dummydll
;
newprov
.
pwszGetFuncName
=
dummyfunction
;
newprov
.
pwszPutFuncName
=
dummyfunction
;
newprov
.
pwszCreateFuncName
=
dummyfunction
;
newprov
.
pwszVerifyFuncName
=
dummyfunction
;
newprov
.
pwszRemoveFuncName
=
dummyfunction
;
newprov
.
pwszIsFunctionNameFmt2
=
dummyfunction
;
newprov
.
pwszIsFunctionName
=
dummyfunction
;
SetLastError
(
0xdeadbeef
);
ret
=
CryptSIPAddProvider
(
&
newprov
);
ok
(
ret
,
"CryptSIPAddProvider should have succeeded
\n
"
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %ld
\n
"
,
GetLastError
());
/* Dummy provider should be deleted */
SetLastError
(
0xdeadbeef
);
ret
=
CryptSIPRemoveProvider
(
&
actionid
);
todo_wine
{
ok
(
ret
,
"CryptSIPRemoveProvider should have succeeded
\n
"
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %ld
\n
"
,
GetLastError
());
}
}
START_TEST
(
main
)
{
hCrypt
=
LoadLibraryA
(
"crypt32.dll"
);
...
...
@@ -354,4 +434,5 @@ START_TEST(main)
test_cryptTls
();
test_readTrustedPublisherDWORD
();
test_getDefaultCryptProv
();
test_AddRemoveProvider
();
}
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