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
9260fcf7
Commit
9260fcf7
authored
Nov 06, 2007
by
Juan Lang
Committed by
Alexandre Julliard
Nov 07, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rsaenh: Use helper function to delete a key container's registry key.
parent
88405a68
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
19 deletions
+33
-19
rsaenh.c
dlls/rsaenh/rsaenh.c
+33
-19
No files found.
dlls/rsaenh/rsaenh.c
View file @
9260fcf7
...
...
@@ -965,6 +965,38 @@ static BOOL open_container_key(LPCSTR pszContainerName, DWORD dwFlags, HKEY *phK
}
/******************************************************************************
* delete_container_key [Internal]
*
* Deletes a key container's persistent storage.
*
* PARAMS
* pszContainerName [I] Name of the container to be opened.
* dwFlags [I] Flags indicating which keyset to be opened.
*/
static
BOOL
delete_container_key
(
LPCSTR
pszContainerName
,
DWORD
dwFlags
)
{
CHAR
szRegKey
[
MAX_PATH
];
if
(
snprintf
(
szRegKey
,
MAX_PATH
,
RSAENH_REGKEY
,
pszContainerName
)
>=
MAX_PATH
)
{
SetLastError
(
NTE_BAD_KEYSET_PARAM
);
return
FALSE
;
}
else
{
HKEY
hRootKey
;
if
(
dwFlags
&
CRYPT_MACHINE_KEYSET
)
hRootKey
=
HKEY_LOCAL_MACHINE
;
else
hRootKey
=
HKEY_CURRENT_USER
;
if
(
!
RegDeleteKeyA
(
hRootKey
,
szRegKey
))
{
SetLastError
(
ERROR_SUCCESS
);
return
TRUE
;
}
else
{
SetLastError
(
NTE_BAD_KEYSET
);
return
FALSE
;
}
}
}
/******************************************************************************
* store_key_container_keys [Internal]
*
* Stores key container's keys in a persistent location.
...
...
@@ -1479,7 +1511,6 @@ BOOL WINAPI RSAENH_CPAcquireContext(HCRYPTPROV *phProv, LPSTR pszContainer,
DWORD
dwFlags
,
PVTableProvStruc
pVTable
)
{
CHAR
szKeyContainerName
[
MAX_PATH
];
CHAR
szRegKey
[
MAX_PATH
];
TRACE
(
"(phProv=%p, pszContainer=%s, dwFlags=%08x, pVTable=%p)
\n
"
,
phProv
,
debugstr_a
(
pszContainer
),
dwFlags
,
pVTable
);
...
...
@@ -1501,24 +1532,7 @@ BOOL WINAPI RSAENH_CPAcquireContext(HCRYPTPROV *phProv, LPSTR pszContainer,
break
;
case
CRYPT_DELETEKEYSET
:
if
(
snprintf
(
szRegKey
,
MAX_PATH
,
RSAENH_REGKEY
,
szKeyContainerName
)
>=
MAX_PATH
)
{
SetLastError
(
NTE_BAD_KEYSET_PARAM
);
return
FALSE
;
}
else
{
HKEY
hRootKey
;
if
(
dwFlags
&
CRYPT_MACHINE_KEYSET
)
hRootKey
=
HKEY_LOCAL_MACHINE
;
else
hRootKey
=
HKEY_CURRENT_USER
;
if
(
!
RegDeleteKeyA
(
hRootKey
,
szRegKey
))
{
SetLastError
(
ERROR_SUCCESS
);
return
TRUE
;
}
else
{
SetLastError
(
NTE_BAD_KEYSET
);
return
FALSE
;
}
}
break
;
return
delete_container_key
(
szKeyContainerName
,
dwFlags
);
case
CRYPT_NEWKEYSET
:
*
phProv
=
read_key_container
(
szKeyContainerName
,
dwFlags
,
pVTable
);
...
...
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