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
e1f5370f
Commit
e1f5370f
authored
Aug 12, 2004
by
James Hawkins
Committed by
Alexandre Julliard
Aug 12, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup A->W cross call in CryptEnumProviders.
parent
b4599521
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
21 deletions
+33
-21
crypt.c
dlls/advapi32/crypt.c
+33
-21
No files found.
dlls/advapi32/crypt.c
View file @
e1f5370f
...
...
@@ -939,7 +939,7 @@ BOOL WINAPI CryptEncrypt (HCRYPTKEY hKey, HCRYPTHASH hHash, BOOL Final,
}
/******************************************************************************
* CryptEnumProviders
A
(ADVAPI32.@)
* CryptEnumProviders
W
(ADVAPI32.@)
*
* Returns the next availabe CPS.
*
...
...
@@ -960,45 +960,57 @@ BOOL WINAPI CryptEncrypt (HCRYPTKEY hKey, HCRYPTHASH hHash, BOOL Final,
* If pszProvName is NULL, CryptEnumProvidersA sets the size of the name
* for memory allocation purposes.
*/
BOOL
WINAPI
CryptEnumProviders
A
(
DWORD
dwIndex
,
DWORD
*
pdwReserved
,
DWORD
dwFlags
,
DWORD
*
pdwProvType
,
LPSTR
pszProvName
,
DWORD
*
pcbProvName
)
BOOL
WINAPI
CryptEnumProviders
W
(
DWORD
dwIndex
,
DWORD
*
pdwReserved
,
DWORD
dwFlags
,
DWORD
*
pdwProvType
,
LP
W
STR
pszProvName
,
DWORD
*
pcbProvName
)
{
HKEY
hKey
;
static
const
WCHAR
providerW
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'M'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'\\'
,
'C'
,
'r'
,
'y'
,
'p'
,
't'
,
'o'
,
'g'
,
'r'
,
'a'
,
'p'
,
'h'
,
'y'
,
'\\'
,
'D'
,
'e'
,
'f'
,
'a'
,
'u'
,
'l'
,
't'
,
's'
,
'\\'
,
'P'
,
'r'
,
'o'
,
'v'
,
'i'
,
'd'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
typeW
[]
=
{
'T'
,
'y'
,
'p'
,
'e'
,
0
};
TRACE
(
"(%ld, %p, %ld, %p, %p, %p)
\n
"
,
dwIndex
,
pdwReserved
,
dwFlags
,
pdwProvType
,
pszProvName
,
pcbProvName
);
if
(
pdwReserved
||
!
pcbProvName
)
CRYPT_ReturnLastError
(
ERROR_INVALID_PARAMETER
);
if
(
dwFlags
)
CRYPT_ReturnLastError
(
NTE_BAD_FLAGS
);
if
(
RegOpenKey
A
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Microsoft
\\
Cryptography
\\
Defaults
\\
Provider"
,
&
hKey
))
if
(
RegOpenKey
W
(
HKEY_LOCAL_MACHINE
,
providerW
,
&
hKey
))
CRYPT_ReturnLastError
(
NTE_FAIL
);
if
(
!
pszProvName
)
{
DWORD
numkeys
;
char
*
provName
;
WCHAR
*
provNameW
;
RegQueryInfoKeyA
(
hKey
,
NULL
,
NULL
,
NULL
,
&
numkeys
,
pcbProvName
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
RegQueryInfoKeyW
(
hKey
,
NULL
,
NULL
,
NULL
,
&
numkeys
,
pcbProvName
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
if
(
!
(
provName
=
CRYPT_Alloc
(
*
pcbProvName
)))
if
(
!
(
provName
W
=
CRYPT_Alloc
(
*
pcbProvName
*
sizeof
(
WCHAR
)
)))
CRYPT_ReturnLastError
(
ERROR_NOT_ENOUGH_MEMORY
);
RegEnumKeyEx
A
(
hKey
,
dwIndex
,
provName
,
pcbProvName
,
NULL
,
NULL
,
NULL
,
NULL
);
RegEnumKeyEx
W
(
hKey
,
dwIndex
,
provNameW
,
pcbProvName
,
NULL
,
NULL
,
NULL
,
NULL
);
(
*
pcbProvName
)
++
;
*
pcbProvName
*=
sizeof
(
WCHAR
);
CRYPT_Free
(
provName
);
CRYPT_Free
(
provName
W
);
if
(
dwIndex
>=
numkeys
)
CRYPT_ReturnLastError
(
ERROR_NO_MORE_ITEMS
);
}
else
{
DWORD
size
=
sizeof
(
DWORD
);
HKEY
subkey
;
if
(
RegEnumKey
A
(
hKey
,
dwIndex
,
pszProvName
,
*
pcbProvName
))
if
(
RegEnumKey
W
(
hKey
,
dwIndex
,
pszProvName
,
*
pcbProvName
/
sizeof
(
WCHAR
)
))
return
FALSE
;
if
(
RegOpenKey
A
(
hKey
,
pszProvName
,
&
subkey
))
if
(
RegOpenKey
W
(
hKey
,
pszProvName
,
&
subkey
))
return
FALSE
;
if
(
RegQueryValueEx
A
(
subkey
,
"Type"
,
NULL
,
NULL
,
(
BYTE
*
)
pdwProvType
,
&
size
))
if
(
RegQueryValueEx
W
(
subkey
,
typeW
,
NULL
,
NULL
,
(
BYTE
*
)
pdwProvType
,
&
size
))
return
FALSE
;
RegCloseKey
(
subkey
);
}
...
...
@@ -1007,30 +1019,30 @@ BOOL WINAPI CryptEnumProvidersA (DWORD dwIndex, DWORD *pdwReserved,
}
/******************************************************************************
* CryptEnumProviders
W
(ADVAPI32.@)
* CryptEnumProviders
A
(ADVAPI32.@)
*
* see CryptEnumProviders
A
* see CryptEnumProviders
W
*/
BOOL
WINAPI
CryptEnumProviders
W
(
DWORD
dwIndex
,
DWORD
*
pdwReserved
,
DWORD
dwFlags
,
DWORD
*
pdwProvType
,
LP
W
STR
pszProvName
,
DWORD
*
pcbProvName
)
BOOL
WINAPI
CryptEnumProviders
A
(
DWORD
dwIndex
,
DWORD
*
pdwReserved
,
DWORD
dwFlags
,
DWORD
*
pdwProvType
,
LPSTR
pszProvName
,
DWORD
*
pcbProvName
)
{
PSTR
str
=
NULL
;
P
W
STR
str
=
NULL
;
DWORD
strlen
;
BOOL
ret
;
/* = FALSE; */
TRACE
(
"(%ld, %p, %08ld, %p, %p, %p)
\n
"
,
dwIndex
,
pdwReserved
,
dwFlags
,
pdwProvType
,
pszProvName
,
pcbProvName
);
strlen
=
*
pcbProvName
/
sizeof
(
WCHAR
);
strlen
=
*
pcbProvName
*
sizeof
(
WCHAR
);
if
(
pszProvName
&&
!
(
str
=
CRYPT_Alloc
(
strlen
))
)
CRYPT_ReturnLastError
(
ERROR_NOT_ENOUGH_MEMORY
);
ret
=
CryptEnumProviders
A
(
dwIndex
,
pdwReserved
,
dwFlags
,
pdwProvType
,
str
,
&
strlen
);
ret
=
CryptEnumProviders
W
(
dwIndex
,
pdwReserved
,
dwFlags
,
pdwProvType
,
str
,
&
strlen
);
if
(
str
)
{
CRYPT_
ANSIToUnicode
(
str
,
&
pszProvName
,
*
pcbProvName
);
CRYPT_
UnicodeToANSI
(
str
,
&
pszProvName
,
*
pcbProvName
);
CRYPT_Free
(
str
);
}
*
pcbProvName
=
strlen
*
sizeof
(
WCHAR
);
*
pcbProvName
=
strlen
/
sizeof
(
WCHAR
);
/* FIXME: not correct */
return
ret
;
}
...
...
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