rsaenh: {alloc,release}_handle_table() are not used so remove them.
Francois Gouget
fgouget at free.fr
Wed Feb 4 17:13:33 CST 2009
---
It looks like this was a copy/paste from a generic handle table
implementation but I could not find another copy that really looked
similar. Anyway, we don't allocate handle tables in rsaenh so we can get
rid of {alloc,release}_handle_table(). So I removed them. But we could
also put them in #if 0 if there is some value in keeping the code more
visible for future use or other copy/paste operations.
dlls/rsaenh/handle.c | 62 +-------------------------------------------------
dlls/rsaenh/handle.h | 2 -
2 files changed, 1 insertions(+), 63 deletions(-)
diff --git a/dlls/rsaenh/handle.c b/dlls/rsaenh/handle.c
index 0773813..caa4be1 100644
--- a/dlls/rsaenh/handle.c
+++ b/dlls/rsaenh/handle.c
@@ -44,10 +44,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(handle);
* lpTable [I] Pointer to the HANDLETABLE structure, which is to be initalized.
*
* NOTES
- * Note that alloc_handle_table calls init_handle_table on it's own, which
- * means that you only have to call init_handle_table, if you use a global
- * variable of type HANDLETABLE for your handle table. However, in this
- * case you have to call destroy_handle_table when you don't need the table
+ * You have to call destroy_handle_table when you don't need the table
* any more.
*/
void init_handle_table(HANDLETABLE *lpTable)
@@ -68,9 +65,6 @@ void init_handle_table(HANDLETABLE *lpTable)
*
* PARAMS
* lpTable [I] Pointer to the handle table, which is to be destroyed.
- *
- * NOTES
- * Note that release_handle_table takes care of this.
*/
void destroy_handle_table(HANDLETABLE *lpTable)
{
@@ -146,60 +140,6 @@ static void release_all_handles(HANDLETABLE *lpTable)
}
/******************************************************************************
- * alloc_handle_table
- *
- * Allocates a new handle table
- *
- * PARAMS
- * lplpTable [O] Pointer to the variable, to which the pointer to the newly
- * allocated handle table is written.
- * RETURNS
- * non zero, if successful
- * zero, if not successful (out of process heap memory)
- *
- * NOTES
- * If all you need is a single handle table, you may as well declare a global
- * variable of type HANDLETABLE and call init_handle_table on your own.
- */
-int alloc_handle_table(HANDLETABLE **lplpTable)
-{
- TRACE("(lplpTable=%p)\n", lplpTable);
-
- *lplpTable = HeapAlloc(GetProcessHeap(), 0, sizeof(HANDLETABLE));
- if (*lplpTable)
- {
- init_handle_table(*lplpTable);
- return 1;
- }
- else
- return 0;
-}
-
-/******************************************************************************
- * release_handle_table
- *
- * Releases a handle table and frees the resources it used.
- *
- * PARAMS
- * lpTable [I] Pointer to the handle table, which is to be released.
- *
- * RETURNS
- * non zero, if successful
- * zero, if not successful
- *
- * NOTES
- * All valid handles still in the table are released also.
- */
-int release_handle_table(HANDLETABLE *lpTable)
-{
- TRACE("(lpTable=%p)\n", lpTable);
-
- release_all_handles(lpTable);
- destroy_handle_table(lpTable);
- return HeapFree(GetProcessHeap(), 0, lpTable);
-}
-
-/******************************************************************************
* grow_handle_table [Internal]
*
* Grows the number of entries in the given table by TABLE_SIZE_INCREMENT
diff --git a/dlls/rsaenh/handle.h b/dlls/rsaenh/handle.h
index d17afad..1d7b927 100644
--- a/dlls/rsaenh/handle.h
+++ b/dlls/rsaenh/handle.h
@@ -56,9 +56,7 @@ typedef struct tagHANDLETABLE
CRITICAL_SECTION mutex;
} HANDLETABLE;
-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, HCRYPTKEY handle, DWORD dwType);
int copy_handle (HANDLETABLE *lpTable, HCRYPTKEY handle, DWORD dwType, HCRYPTKEY *copy);
--
1.5.6.5
More information about the wine-patches
mailing list