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
0b994d0a
Commit
0b994d0a
authored
Mar 08, 2010
by
Paul Vriens
Committed by
Alexandre Julliard
Mar 15, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Restore default cryptographic provider after the tests.
parent
e6d540d5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
crypt.c
dlls/advapi32/tests/crypt.c
+17
-1
No files found.
dlls/advapi32/tests/crypt.c
View file @
0b994d0a
...
...
@@ -856,6 +856,8 @@ static void test_set_provider_ex(void)
{
DWORD
result
;
DWORD
notNull
=
5
;
LPSTR
curProvName
=
NULL
;
DWORD
curlen
;
/* results */
LPSTR
pszProvName
=
NULL
;
...
...
@@ -867,6 +869,13 @@ static void test_set_provider_ex(void)
return
;
}
/* store the current one */
pCryptGetDefaultProviderA
(
PROV_RSA_FULL
,
NULL
,
CRYPT_MACHINE_DEFAULT
,
NULL
,
&
curlen
);
if
(
!
(
curProvName
=
LocalAlloc
(
LMEM_ZEROINIT
,
curlen
)))
return
;
result
=
pCryptGetDefaultProviderA
(
PROV_RSA_FULL
,
NULL
,
CRYPT_MACHINE_DEFAULT
,
curProvName
,
&
curlen
);
ok
(
result
,
"%d
\n
"
,
GetLastError
());
/* check pdwReserved for NULL */
result
=
pCryptSetProviderExA
(
MS_DEF_PROV
,
PROV_RSA_FULL
,
&
notNull
,
CRYPT_MACHINE_DEFAULT
);
ok
(
!
result
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"expected %i, got %d
\n
"
,
...
...
@@ -880,6 +889,7 @@ static void test_set_provider_ex(void)
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
||
broken
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
),
"wrong error %u
\n
"
,
GetLastError
()
);
skip
(
"Not enough rights to remove the default provider
\n
"
);
LocalFree
(
curProvName
);
return
;
}
...
...
@@ -889,13 +899,19 @@ static void test_set_provider_ex(void)
/* call CryptGetDefaultProvider to see if they match */
result
=
pCryptGetDefaultProviderA
(
PROV_RSA_FULL
,
NULL
,
CRYPT_MACHINE_DEFAULT
,
NULL
,
&
cbProvName
);
if
(
!
(
pszProvName
=
LocalAlloc
(
LMEM_ZEROINIT
,
cbProvName
)))
return
;
goto
reset
;
result
=
pCryptGetDefaultProviderA
(
PROV_RSA_FULL
,
NULL
,
CRYPT_MACHINE_DEFAULT
,
pszProvName
,
&
cbProvName
);
ok
(
result
&&
!
strcmp
(
MS_DEF_PROV
,
pszProvName
),
"expected %s, got %s
\n
"
,
MS_DEF_PROV
,
pszProvName
);
ok
(
result
&&
cbProvName
==
(
strlen
(
MS_DEF_PROV
)
+
1
),
"expected %i, got %d
\n
"
,
(
lstrlenA
(
MS_DEF_PROV
)
+
1
),
cbProvName
);
LocalFree
(
pszProvName
);
reset:
/* Set the provider back to it's original */
result
=
pCryptSetProviderExA
(
curProvName
,
PROV_RSA_FULL
,
NULL
,
CRYPT_MACHINE_DEFAULT
);
ok
(
result
,
"%d
\n
"
,
GetLastError
());
LocalFree
(
curProvName
);
}
static
void
test_machine_guid
(
void
)
...
...
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