Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
81e6f0c1
Commit
81e6f0c1
authored
Jul 13, 2004
by
Michael Jung
Committed by
Alexandre Julliard
Jul 13, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reference counting for CRYPTPROV objects.
Implemented CryptContextAddRef.
parent
932533ca
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
12 deletions
+27
-12
crypt.c
dlls/advapi32/crypt.c
+26
-12
crypt.h
dlls/advapi32/crypt.h
+1
-0
No files found.
dlls/advapi32/crypt.c
View file @
81e6f0c1
...
...
@@ -183,6 +183,7 @@ PCRYPTPROV CRYPT_LoadProvider(PSTR pImage)
FIXME
(
"Failed to load dll %s
\n
"
,
debugstr_a
(
pImage
));
goto
error
;
}
provider
->
refcount
=
1
;
errorcode
=
NTE_PROVIDER_DLL_FAIL
;
CRYPT_GetProvFunc
(
CPAcquireContext
);
...
...
@@ -525,9 +526,18 @@ BOOL WINAPI CryptAcquireContextW (HCRYPTPROV *phProv, LPCWSTR pszContainer,
*/
BOOL
WINAPI
CryptContextAddRef
(
HCRYPTPROV
hProv
,
DWORD
*
pdwReserved
,
DWORD
dwFlags
)
{
FIXME
(
"(0x%lx, %p, %08lx): stub!
\n
"
,
hProv
,
pdwReserved
,
dwFlags
);
return
FALSE
;
/* InterlockIncrement?? */
PCRYPTPROV
pProv
=
(
PCRYPTPROV
)
hProv
;
TRACE
(
"(0x%lx, %p, %08lx)
\n
"
,
hProv
,
pdwReserved
,
dwFlags
);
if
(
!
pProv
)
{
SetLastError
(
NTE_BAD_UID
);
return
FALSE
;
}
pProv
->
refcount
++
;
return
TRUE
;
}
/******************************************************************************
...
...
@@ -546,7 +556,7 @@ BOOL WINAPI CryptContextAddRef (HCRYPTPROV hProv, DWORD *pdwReserved, DWORD dwFl
BOOL
WINAPI
CryptReleaseContext
(
HCRYPTPROV
hProv
,
DWORD
dwFlags
)
{
PCRYPTPROV
pProv
=
(
PCRYPTPROV
)
hProv
;
BOOL
ret
;
BOOL
ret
=
TRUE
;
TRACE
(
"(0x%lx, %08ld)
\n
"
,
hProv
,
dwFlags
);
...
...
@@ -555,16 +565,20 @@ BOOL WINAPI CryptReleaseContext (HCRYPTPROV hProv, DWORD dwFlags)
SetLastError
(
NTE_BAD_UID
);
return
FALSE
;
}
/* FIXME: Decrement the counter here first if possible */
ret
=
pProv
->
pFuncs
->
pCPReleaseContext
(
pProv
->
hPrivate
,
dwFlags
);
FreeLibrary
(
pProv
->
hModule
);
pProv
->
refcount
--
;
if
(
pProv
->
refcount
<=
0
)
{
ret
=
pProv
->
pFuncs
->
pCPReleaseContext
(
pProv
->
hPrivate
,
dwFlags
);
FreeLibrary
(
pProv
->
hModule
);
#if 0
CRYPT_Free(pProv->pVTable->pContextInfo);
CRYPT_Free(pProv->pVTable->pContextInfo);
#endif
CRYPT_Free
(
pProv
->
pVTable
->
pszProvName
);
CRYPT_Free
(
pProv
->
pVTable
);
CRYPT_Free
(
pProv
->
pFuncs
);
CRYPT_Free
(
pProv
);
CRYPT_Free
(
pProv
->
pVTable
->
pszProvName
);
CRYPT_Free
(
pProv
->
pVTable
);
CRYPT_Free
(
pProv
->
pFuncs
);
CRYPT_Free
(
pProv
);
}
return
ret
;
}
...
...
dlls/advapi32/crypt.h
View file @
81e6f0c1
...
...
@@ -58,6 +58,7 @@ typedef struct tagPROVFUNCS
typedef
struct
tagCRYPTPROV
{
UINT
refcount
;
HMODULE
hModule
;
PPROVFUNCS
pFuncs
;
HCRYPTPROV
hPrivate
;
/*CSP's handle - Should not be given to application under any circumstances!*/
...
...
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