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
ad514dbc
Commit
ad514dbc
authored
Oct 17, 2007
by
Juan Lang
Committed by
Alexandre Julliard
Oct 18, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Add basic tests for CryptGetDefaultOIDFunctionAddress.
parent
6b390b40
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
oid.c
dlls/crypt32/tests/oid.c
+42
-0
No files found.
dlls/crypt32/tests/oid.c
View file @
ad514dbc
...
...
@@ -414,6 +414,47 @@ static void test_registerDefaultOIDFunction(void)
"Expected ERROR_FILE_NOT_FOUND, got %08x
\n
"
,
GetLastError
());
}
static
void
test_getDefaultOIDFunctionAddress
(
void
)
{
BOOL
ret
;
HCRYPTOIDFUNCSET
set
;
void
*
funcAddr
;
HCRYPTOIDFUNCADDR
hFuncAddr
;
/* Crash
ret = CryptGetDefaultOIDFunctionAddress(0, 0, NULL, 0, NULL, NULL);
ret = CryptGetDefaultOIDFunctionAddress(0, 0, NULL, 0, &funcAddr, NULL);
ret = CryptGetDefaultOIDFunctionAddress(0, 0, NULL, 0, NULL, &hFuncAddr);
ret = CryptGetDefaultOIDFunctionAddress(0, 0, NULL, 0, &funcAddr,
&hFuncAddr);
*/
set
=
CryptInitOIDFunctionSet
(
"CertDllOpenStoreProv"
,
0
);
ok
(
set
!=
0
,
"CryptInitOIDFunctionSet failed: %d
\n
"
,
GetLastError
());
/* This crashes if hFuncAddr is not 0 to begin with */
hFuncAddr
=
0
;
ret
=
CryptGetDefaultOIDFunctionAddress
(
set
,
0
,
NULL
,
0
,
&
funcAddr
,
&
hFuncAddr
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"Expected ERROR_FILE_NOT_FOUND, got %d
\n
"
,
GetLastError
());
/* This fails with the normal encoding too, so built-in functions aren't
* returned.
*/
ret
=
CryptGetDefaultOIDFunctionAddress
(
set
,
X509_ASN_ENCODING
,
NULL
,
0
,
&
funcAddr
,
&
hFuncAddr
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"Expected ERROR_FILE_NOT_FOUND, got %d
\n
"
,
GetLastError
());
/* Even with a registered dll, this fails (since the dll doesn't exist) */
ret
=
CryptRegisterDefaultOIDFunction
(
0
,
"CertDllOpenStoreProv"
,
0
,
bogusDll
);
ok
(
ret
,
"CryptRegisterDefaultOIDFunction failed: %08x
\n
"
,
GetLastError
());
ret
=
CryptGetDefaultOIDFunctionAddress
(
set
,
0
,
NULL
,
0
,
&
funcAddr
,
&
hFuncAddr
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"Expected ERROR_FILE_NOT_FOUND, got %d
\n
"
,
GetLastError
());
CryptUnregisterDefaultOIDFunction
(
0
,
"CertDllOpenStoreProv"
,
bogusDll
);
}
static
BOOL
WINAPI
countOidInfo
(
PCCRYPT_OID_INFO
pInfo
,
void
*
pvArg
)
{
(
*
(
DWORD
*
)
pvArg
)
++
;
...
...
@@ -499,4 +540,5 @@ START_TEST(oid)
test_installOIDFunctionAddress
();
test_registerOIDFunction
();
test_registerDefaultOIDFunction
();
test_getDefaultOIDFunctionAddress
();
}
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