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
56d085cc
Commit
56d085cc
authored
Feb 12, 2008
by
Paul Vriens
Committed by
Alexandre Julliard
Feb 12, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Only use functions if they are implemented.
parent
b1789fc7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
9 deletions
+24
-9
crypt.c
dlls/advapi32/tests/crypt.c
+24
-9
No files found.
dlls/advapi32/tests/crypt.c
View file @
56d085cc
...
...
@@ -34,7 +34,6 @@ static const char szKeySet[] = "wine_test_keyset";
static
const
char
szBadKeySet
[]
=
"wine_test_bad_keyset"
;
#define NON_DEF_PROV_TYPE 999
static
HMODULE
hadvapi32
;
static
BOOL
(
WINAPI
*
pCryptAcquireContextA
)(
HCRYPTPROV
*
,
LPCSTR
,
LPCSTR
,
DWORD
,
DWORD
);
static
BOOL
(
WINAPI
*
pCryptEnumProviderTypesA
)(
DWORD
,
DWORD
*
,
DWORD
,
DWORD
*
,
LPSTR
,
DWORD
*
);
static
BOOL
(
WINAPI
*
pCryptEnumProvidersA
)(
DWORD
,
DWORD
*
,
DWORD
,
DWORD
*
,
LPSTR
,
DWORD
*
);
...
...
@@ -68,7 +67,7 @@ static BOOL (WINAPI *pCryptVerifySignatureW)(HCRYPTHASH, BYTE*, DWORD, HCRYPTKEY
static
void
init_function_pointers
(
void
)
{
hadvapi32
=
GetModuleHandleA
(
"advapi32.dll"
);
HMODULE
hadvapi32
=
GetModuleHandleA
(
"advapi32.dll"
);
pCryptAcquireContextA
=
(
void
*
)
GetProcAddress
(
hadvapi32
,
"CryptAcquireContextA"
);
pCryptEnumProviderTypesA
=
(
void
*
)
GetProcAddress
(
hadvapi32
,
"CryptEnumProviderTypesA"
);
...
...
@@ -324,10 +323,15 @@ static void test_incorrect_api_usage(void)
result
=
pCryptImportKey
(
hProv
,
&
temp
,
1
,
(
HCRYPTKEY
)
NULL
,
0
,
&
hKey2
);
ok
(
!
result
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"%d
\n
"
,
GetLastError
());
dwLen
=
1
;
result
=
pCryptSignHashW
(
hHash
,
0
,
NULL
,
0
,
&
temp
,
&
dwLen
);
ok
(
!
result
&&
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
||
GetLastError
()
==
ERROR_CALL_NOT_IMPLEMENTED
),
"%d
\n
"
,
GetLastError
());
if
(
pCryptSignHashW
)
{
dwLen
=
1
;
result
=
pCryptSignHashW
(
hHash
,
0
,
NULL
,
0
,
&
temp
,
&
dwLen
);
ok
(
!
result
&&
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
||
GetLastError
()
==
ERROR_CALL_NOT_IMPLEMENTED
),
"%d
\n
"
,
GetLastError
());
}
else
skip
(
"CryptSignHashW is not available
\n
"
);
result
=
pCryptSetKeyParam
(
hKey
,
0
,
&
temp
,
1
);
ok
(
!
result
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"%d
\n
"
,
GetLastError
());
...
...
@@ -338,9 +342,14 @@ static void test_incorrect_api_usage(void)
result
=
pCryptSetProvParam
(
hProv
,
0
,
&
temp
,
1
);
ok
(
!
result
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"%d
\n
"
,
GetLastError
());
result
=
pCryptVerifySignatureW
(
hHash
,
&
temp
,
1
,
hKey
,
NULL
,
0
);
ok
(
!
result
&&
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
||
GetLastError
()
==
ERROR_CALL_NOT_IMPLEMENTED
),
"%d
\n
"
,
GetLastError
());
if
(
pCryptVerifySignatureW
)
{
result
=
pCryptVerifySignatureW
(
hHash
,
&
temp
,
1
,
hKey
,
NULL
,
0
);
ok
(
!
result
&&
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
||
GetLastError
()
==
ERROR_CALL_NOT_IMPLEMENTED
),
"%d
\n
"
,
GetLastError
());
}
else
skip
(
"CryptVerifySignatureW is not available
\n
"
);
result
=
pCryptDestroyHash
(
hHash
);
ok
(
!
result
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"%d
\n
"
,
GetLastError
());
...
...
@@ -383,6 +392,12 @@ static void test_verify_sig(void)
HCRYPTHASH
hash
;
BYTE
bogus
[]
=
{
0
};
if
(
!
pCryptVerifySignatureW
)
{
skip
(
"CryptVerifySignatureW is not available
\n
"
);
return
;
}
SetLastError
(
0xdeadbeef
);
ret
=
pCryptVerifySignatureW
(
0
,
NULL
,
0
,
0
,
NULL
,
0
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
...
...
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