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
7aa82c80
Commit
7aa82c80
authored
Aug 13, 2004
by
James Hawkins
Committed by
Alexandre Julliard
Aug 13, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
If the pszProvName param of CryptEnumProviders is too small to hold
the provider name, SetLastError to ERROR_MORE_DATA.
parent
fb504265
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
19 deletions
+19
-19
crypt.c
dlls/advapi32/crypt.c
+9
-6
crypt.c
dlls/advapi32/tests/crypt.c
+10
-13
No files found.
dlls/advapi32/crypt.c
View file @
7aa82c80
...
...
@@ -941,7 +941,7 @@ BOOL WINAPI CryptEncrypt (HCRYPTKEY hKey, HCRYPTHASH hHash, BOOL Final,
/******************************************************************************
* CryptEnumProvidersW (ADVAPI32.@)
*
* Returns the next availabe C
PS
.
* Returns the next availabe C
SP
.
*
* PARAMS
* dwIndex [I] Index of the next provider to be enumerated.
...
...
@@ -950,14 +950,14 @@ BOOL WINAPI CryptEncrypt (HCRYPTKEY hKey, HCRYPTHASH hHash, BOOL Final,
* pdwProvType [O] DWORD designating the type of the provider.
* pszProvName [O] Buffer that receives data from the provider.
* pcbProvName [I/O] Specifies the size of pszProvName. Contains the number
* of bytes stored in the buffer
no
return.
* of bytes stored in the buffer
on
return.
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*
* NOTES
* If pszProvName is NULL, CryptEnumProviders
A
sets the size of the name
* If pszProvName is NULL, CryptEnumProviders
W
sets the size of the name
* for memory allocation purposes.
*/
BOOL
WINAPI
CryptEnumProvidersW
(
DWORD
dwIndex
,
DWORD
*
pdwReserved
,
...
...
@@ -1005,9 +1005,12 @@ BOOL WINAPI CryptEnumProvidersW (DWORD dwIndex, DWORD *pdwReserved,
CRYPT_ReturnLastError
(
ERROR_NO_MORE_ITEMS
);
}
else
{
DWORD
size
=
sizeof
(
DWORD
);
DWORD
result
;
HKEY
subkey
;
if
(
RegEnumKeyW
(
hKey
,
dwIndex
,
pszProvName
,
*
pcbProvName
/
sizeof
(
WCHAR
)))
return
FALSE
;
result
=
RegEnumKeyW
(
hKey
,
dwIndex
,
pszProvName
,
*
pcbProvName
/
sizeof
(
WCHAR
));
if
(
result
)
CRYPT_ReturnLastError
(
result
);
if
(
RegOpenKeyW
(
hKey
,
pszProvName
,
&
subkey
))
return
FALSE
;
if
(
RegQueryValueExW
(
subkey
,
typeW
,
NULL
,
NULL
,
(
BYTE
*
)
pdwProvType
,
&
size
))
...
...
@@ -1058,7 +1061,7 @@ BOOL WINAPI CryptEnumProvidersA (DWORD dwIndex, DWORD *pdwReserved,
* pdwProvType [O] DWORD designating the type of the provider.
* pszTypeName [O] Buffer that receives data from the provider type.
* pcbTypeName [I/O] Specifies the size of pszTypeName. Contains the number
* of bytes stored in the buffer
no
return.
* of bytes stored in the buffer
on
return.
*
* RETURNS
* Success: TRUE
...
...
dlls/advapi32/tests/crypt.c
View file @
7aa82c80
...
...
@@ -179,19 +179,16 @@ static void test_enum_providers(void)
/* alloc provider to half the size required
* cbName holds the size required */
todo_wine
{
providerLen
=
cbName
/
2
;
if
(
!
(
provider
=
((
LPSTR
)
LocalAlloc
(
LMEM_ZEROINIT
,
providerLen
))))
return
;
result
=
CryptEnumProviders
(
dwIndex
,
NULL
,
0
,
&
type
,
provider
,
&
providerLen
);
ok
(
!
result
&&
GetLastError
()
==
ERROR_MORE_DATA
,
"expected %08x, got %08x
\n
"
,
ERROR_MORE_DATA
,
(
unsigned
int
)
GetLastError
());
LocalFree
(
provider
);
}
providerLen
=
cbName
/
2
;
if
(
!
(
provider
=
((
LPSTR
)
LocalAlloc
(
LMEM_ZEROINIT
,
providerLen
))))
return
;
result
=
CryptEnumProviders
(
dwIndex
,
NULL
,
0
,
&
type
,
provider
,
&
providerLen
);
ok
(
!
result
&&
GetLastError
()
==
ERROR_MORE_DATA
,
"expected %08x, got %08x
\n
"
,
ERROR_MORE_DATA
,
(
unsigned
int
)
GetLastError
());
LocalFree
(
provider
);
/* loop through the providers to get the number of providers
* after loop ends, count should be provCount + 1 so subtract 1
* to get actual number of providers */
...
...
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