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
1cdc0570
Commit
1cdc0570
authored
Apr 21, 2007
by
Yuval Fledel
Committed by
Alexandre Julliard
Apr 23, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rsaenh: Convert handle type from unsigned int to HCRYPTKEY.
parent
4d7d6e96
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
20 deletions
+22
-20
handle.c
dlls/rsaenh/handle.c
+15
-15
handle.h
dlls/rsaenh/handle.h
+7
-5
rsaenh.c
dlls/rsaenh/rsaenh.c
+0
-0
No files found.
dlls/rsaenh/handle.c
View file @
1cdc0570
...
...
@@ -96,12 +96,12 @@ void destroy_handle_table(HANDLETABLE *lpTable)
* non zero, if handle is valid.
* zero, if handle is not valid.
*/
int
is_valid_handle
(
HANDLETABLE
*
lpTable
,
unsigned
int
handle
,
DWORD
dwType
)
int
is_valid_handle
(
HANDLETABLE
*
lpTable
,
HCRYPTKEY
handle
,
DWORD
dwType
)
{
unsigned
int
index
=
HANDLE2INDEX
(
handle
);
int
ret
=
0
;
TRACE
(
"(lpTable=%p, handle=%d)
\n
"
,
lpTable
,
handle
);
TRACE
(
"(lpTable=%p, handle=%
l
d)
\n
"
,
lpTable
,
handle
);
EnterCriticalSection
(
&
lpTable
->
mutex
);
...
...
@@ -259,7 +259,7 @@ static int grow_handle_table(HANDLETABLE *lpTable)
* non zero, if successful
* zero, if not successful (no free handle)
*/
static
int
alloc_handle
(
HANDLETABLE
*
lpTable
,
OBJECTHDR
*
lpObject
,
unsigned
int
*
lpHandle
)
static
int
alloc_handle
(
HANDLETABLE
*
lpTable
,
OBJECTHDR
*
lpObject
,
HCRYPTKEY
*
lpHandle
)
{
int
ret
=
0
;
...
...
@@ -269,7 +269,7 @@ static int alloc_handle(HANDLETABLE *lpTable, OBJECTHDR *lpObject, unsigned int
if
(
lpTable
->
iFirstFree
>=
lpTable
->
iEntries
)
if
(
!
grow_handle_table
(
lpTable
))
{
*
lpHandle
=
(
unsigned
int
)
INVALID_HANDLE_VALUE
;
*
lpHandle
=
(
HCRYPTKEY
)
INVALID_HANDLE_VALUE
;
goto
exit
;
}
...
...
@@ -306,13 +306,13 @@ exit:
* non zero, if successful
* zero, if not successful (invalid handle)
*/
int
release_handle
(
HANDLETABLE
*
lpTable
,
unsigned
int
handle
,
DWORD
dwType
)
int
release_handle
(
HANDLETABLE
*
lpTable
,
HCRYPTKEY
handle
,
DWORD
dwType
)
{
unsigned
int
index
=
HANDLE2INDEX
(
handle
);
OBJECTHDR
*
pObject
;
int
ret
=
0
;
TRACE
(
"(lpTable=%p, hand
e=%
d)
\n
"
,
lpTable
,
handle
);
TRACE
(
"(lpTable=%p, hand
le=%l
d)
\n
"
,
lpTable
,
handle
);
EnterCriticalSection
(
&
lpTable
->
mutex
);
...
...
@@ -322,7 +322,7 @@ int release_handle(HANDLETABLE *lpTable, unsigned int handle, DWORD dwType)
pObject
=
lpTable
->
paEntries
[
index
].
pObject
;
if
(
InterlockedDecrement
(
&
pObject
->
refcount
)
==
0
)
{
TRACE
(
"destroying handle %d
\n
"
,
handle
);
TRACE
(
"destroying handle %
l
d
\n
"
,
handle
);
if
(
pObject
->
destructor
)
pObject
->
destructor
(
pObject
);
}
...
...
@@ -351,11 +351,11 @@ exit:
* non zero, if successful
* zero, if not successful (invalid handle)
*/
int
lookup_handle
(
HANDLETABLE
*
lpTable
,
unsigned
int
handle
,
DWORD
dwType
,
OBJECTHDR
**
lplpObject
)
int
lookup_handle
(
HANDLETABLE
*
lpTable
,
HCRYPTKEY
handle
,
DWORD
dwType
,
OBJECTHDR
**
lplpObject
)
{
int
ret
=
0
;
TRACE
(
"(lpTable=%p, handle=%d, lplpObject=%p)
\n
"
,
lpTable
,
handle
,
lplpObject
);
TRACE
(
"(lpTable=%p, handle=%
l
d, lplpObject=%p)
\n
"
,
lpTable
,
handle
,
lplpObject
);
EnterCriticalSection
(
&
lpTable
->
mutex
);
if
(
!
is_valid_handle
(
lpTable
,
handle
,
dwType
))
...
...
@@ -386,17 +386,17 @@ exit:
* non zero, if successful
* zero, if not successful (invalid handle or out of memory)
*/
int
copy_handle
(
HANDLETABLE
*
lpTable
,
unsigned
int
handle
,
DWORD
dwType
,
unsigned
int
*
copy
)
int
copy_handle
(
HANDLETABLE
*
lpTable
,
HCRYPTKEY
handle
,
DWORD
dwType
,
HCRYPTKEY
*
copy
)
{
OBJECTHDR
*
pObject
;
int
ret
;
TRACE
(
"(lpTable=%p, handle=%d, copy=%p)
\n
"
,
lpTable
,
handle
,
copy
);
TRACE
(
"(lpTable=%p, handle=%
l
d, copy=%p)
\n
"
,
lpTable
,
handle
,
copy
);
EnterCriticalSection
(
&
lpTable
->
mutex
);
if
(
!
lookup_handle
(
lpTable
,
handle
,
dwType
,
&
pObject
))
{
*
copy
=
(
unsigned
int
)
INVALID_HANDLE_VALUE
;
*
copy
=
(
HCRYPTKEY
)
INVALID_HANDLE_VALUE
;
LeaveCriticalSection
(
&
lpTable
->
mutex
);
return
0
;
}
...
...
@@ -429,18 +429,18 @@ int copy_handle(HANDLETABLE *lpTable, unsigned int handle, DWORD dwType, unsigne
* INVALID_HANDLE_VALUE, if something went wrong.
* a handle to the new object, if successful.
*/
unsigned
int
new_object
(
HANDLETABLE
*
lpTable
,
size_t
cbSize
,
DWORD
dwType
,
DESTRUCTOR
destructor
,
HCRYPTKEY
new_object
(
HANDLETABLE
*
lpTable
,
size_t
cbSize
,
DWORD
dwType
,
DESTRUCTOR
destructor
,
OBJECTHDR
**
ppObject
)
{
OBJECTHDR
*
pObject
;
unsigned
int
hObject
;
HCRYPTKEY
hObject
;
if
(
ppObject
)
*
ppObject
=
NULL
;
pObject
=
HeapAlloc
(
GetProcessHeap
(),
0
,
cbSize
);
if
(
!
pObject
)
return
(
unsigned
int
)
INVALID_HANDLE_VALUE
;
return
(
HCRYPTKEY
)
INVALID_HANDLE_VALUE
;
pObject
->
dwType
=
dwType
;
pObject
->
refcount
=
0
;
...
...
dlls/rsaenh/handle.h
View file @
1cdc0570
...
...
@@ -24,6 +24,8 @@
#ifndef __WINE_HANDLE_H
#define __WINE_HANDLE_H
#include "wincrypt.h"
#ifdef __cplusplus
extern
"C"
{
#endif
...
...
@@ -58,12 +60,12 @@ int alloc_handle_table (HANDLETABLE **lplpTable);
void
init_handle_table
(
HANDLETABLE
*
lpTable
);
int
release_handle_table
(
HANDLETABLE
*
lpTable
);
void
destroy_handle_table
(
HANDLETABLE
*
lpTable
);
int
release_handle
(
HANDLETABLE
*
lpTable
,
unsigned
int
handle
,
DWORD
dwType
);
int
copy_handle
(
HANDLETABLE
*
lpTable
,
unsigned
int
handle
,
DWORD
dwType
,
unsigned
int
*
copy
);
int
lookup_handle
(
HANDLETABLE
*
lpTable
,
unsigned
int
handle
,
DWORD
dwType
,
OBJECTHDR
**
lplpObject
);
int
is_valid_handle
(
HANDLETABLE
*
lpTable
,
unsigned
int
handle
,
DWORD
dwType
);
int
release_handle
(
HANDLETABLE
*
lpTable
,
HCRYPTKEY
handle
,
DWORD
dwType
);
int
copy_handle
(
HANDLETABLE
*
lpTable
,
HCRYPTKEY
handle
,
DWORD
dwType
,
HCRYPTKEY
*
copy
);
int
lookup_handle
(
HANDLETABLE
*
lpTable
,
HCRYPTKEY
handle
,
DWORD
dwType
,
OBJECTHDR
**
lplpObject
);
int
is_valid_handle
(
HANDLETABLE
*
lpTable
,
HCRYPTKEY
handle
,
DWORD
dwType
);
unsigned
int
new_object
(
HANDLETABLE
*
lpTable
,
size_t
cbSize
,
DWORD
dwType
,
DESTRUCTOR
destructor
,
HCRYPTKEY
new_object
(
HANDLETABLE
*
lpTable
,
size_t
cbSize
,
DWORD
dwType
,
DESTRUCTOR
destructor
,
OBJECTHDR
**
ppObject
);
#ifdef __cplusplus
...
...
dlls/rsaenh/rsaenh.c
View file @
1cdc0570
This diff is collapsed.
Click to expand it.
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