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
79d88ffe
Commit
79d88ffe
authored
Oct 06, 2008
by
Henri Verbeet
Committed by
Alexandre Julliard
Oct 07, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
secur32: Use ~0UL instead of -1 for invalid schannel handles.
parent
abe7846a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
schannel.c
dlls/secur32/schannel.c
+7
-5
No files found.
dlls/secur32/schannel.c
View file @
79d88ffe
...
...
@@ -48,6 +48,8 @@ MAKE_FUNCPTR(gnutls_global_set_log_function);
MAKE_FUNCPTR
(
gnutls_global_set_log_level
);
#undef MAKE_FUNCPTR
#define SCHAN_INVALID_HANDLE ~0UL
enum
schan_handle_type
{
SCHAN_HANDLE_CRED
,
...
...
@@ -82,7 +84,7 @@ static ULONG_PTR schan_alloc_handle(void *object, enum schan_handle_type type)
if
(
handle
->
type
!=
SCHAN_HANDLE_FREE
)
{
ERR
(
"Handle %d(%p) is in the free list, but has type %#x.
\n
"
,
(
handle
-
schan_handle_table
),
handle
,
handle
->
type
);
return
-
1
;
return
SCHAN_INVALID_HANDLE
;
}
schan_free_handles
=
(
struct
schan_handle
*
)
handle
->
object
;
handle
->
object
=
object
;
...
...
@@ -98,7 +100,7 @@ static ULONG_PTR schan_alloc_handle(void *object, enum schan_handle_type type)
if
(
!
new_table
)
{
ERR
(
"Failed to grow the handle table
\n
"
);
return
-
1
;
return
SCHAN_INVALID_HANDLE
;
}
schan_handle_table
=
new_table
;
schan_handle_table_size
=
new_size
;
...
...
@@ -116,7 +118,7 @@ static void *schan_free_handle(ULONG_PTR handle_idx, enum schan_handle_type type
struct
schan_handle
*
handle
;
void
*
object
;
if
(
handle_idx
==
-
1
)
return
NULL
;
if
(
handle_idx
==
SCHAN_INVALID_HANDLE
)
return
NULL
;
handle
=
&
schan_handle_table
[
handle_idx
];
if
(
handle
->
type
!=
type
)
{
...
...
@@ -283,7 +285,7 @@ static SECURITY_STATUS schan_AcquireClientCredentials(const SCHANNEL_CRED *schan
if
(
!
creds
)
return
SEC_E_INSUFFICIENT_MEMORY
;
handle
=
schan_alloc_handle
(
creds
,
SCHAN_HANDLE_CRED
);
if
(
handle
==
-
1
)
if
(
handle
==
SCHAN_INVALID_HANDLE
)
{
HeapFree
(
GetProcessHeap
(),
0
,
creds
);
return
SEC_E_INTERNAL_ERROR
;
...
...
@@ -325,7 +327,7 @@ static SECURITY_STATUS schan_AcquireServerCredentials(const SCHANNEL_CRED *schan
creds
->
credential_use
=
SECPKG_CRED_INBOUND
;
handle
=
schan_alloc_handle
(
creds
,
SCHAN_HANDLE_CRED
);
if
(
handle
==
-
1
)
if
(
handle
==
SCHAN_INVALID_HANDLE
)
{
HeapFree
(
GetProcessHeap
(),
0
,
creds
);
return
SEC_E_INTERNAL_ERROR
;
...
...
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