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
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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
22 deletions
+34
-22
crypt.c
dlls/advapi32/crypt.c
+34
-22
No files found.
dlls/advapi32/crypt.c
View file @
e1f5370f
...
@@ -939,7 +939,7 @@ BOOL WINAPI CryptEncrypt (HCRYPTKEY hKey, HCRYPTHASH hHash, BOOL Final,
...
@@ -939,7 +939,7 @@ BOOL WINAPI CryptEncrypt (HCRYPTKEY hKey, HCRYPTHASH hHash, BOOL Final,
}
}
/******************************************************************************
/******************************************************************************
* CryptEnumProviders
A
(ADVAPI32.@)
* CryptEnumProviders
W
(ADVAPI32.@)
*
*
* Returns the next availabe CPS.
* Returns the next availabe CPS.
*
*
...
@@ -960,10 +960,20 @@ BOOL WINAPI CryptEncrypt (HCRYPTKEY hKey, HCRYPTHASH hHash, BOOL Final,
...
@@ -960,10 +960,20 @@ BOOL WINAPI CryptEncrypt (HCRYPTKEY hKey, HCRYPTHASH hHash, BOOL Final,
* If pszProvName is NULL, CryptEnumProvidersA sets the size of the name
* If pszProvName is NULL, CryptEnumProvidersA sets the size of the name
* for memory allocation purposes.
* for memory allocation purposes.
*/
*/
BOOL
WINAPI
CryptEnumProviders
A
(
DWORD
dwIndex
,
DWORD
*
pdwReserved
,
BOOL
WINAPI
CryptEnumProviders
W
(
DWORD
dwIndex
,
DWORD
*
pdwReserved
,
DWORD
dwFlags
,
DWORD
*
pdwProvType
,
LPSTR
pszProvName
,
DWORD
*
pcbProvName
)
DWORD
dwFlags
,
DWORD
*
pdwProvType
,
LP
W
STR
pszProvName
,
DWORD
*
pcbProvName
)
{
{
HKEY
hKey
;
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
,
TRACE
(
"(%ld, %p, %ld, %p, %p, %p)
\n
"
,
dwIndex
,
pdwReserved
,
dwFlags
,
pdwProvType
,
pszProvName
,
pcbProvName
);
pdwProvType
,
pszProvName
,
pcbProvName
);
...
@@ -971,34 +981,36 @@ BOOL WINAPI CryptEnumProvidersA (DWORD dwIndex, DWORD *pdwReserved,
...
@@ -971,34 +981,36 @@ BOOL WINAPI CryptEnumProvidersA (DWORD dwIndex, DWORD *pdwReserved,
if
(
pdwReserved
||
!
pcbProvName
)
CRYPT_ReturnLastError
(
ERROR_INVALID_PARAMETER
);
if
(
pdwReserved
||
!
pcbProvName
)
CRYPT_ReturnLastError
(
ERROR_INVALID_PARAMETER
);
if
(
dwFlags
)
CRYPT_ReturnLastError
(
NTE_BAD_FLAGS
);
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
);
CRYPT_ReturnLastError
(
NTE_FAIL
);
if
(
!
pszProvName
)
if
(
!
pszProvName
)
{
{
DWORD
numkeys
;
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
);
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
)
++
;
*
pcbProvName
*=
sizeof
(
WCHAR
);
CRYPT_Free
(
provName
);
CRYPT_Free
(
provName
W
);
if
(
dwIndex
>=
numkeys
)
if
(
dwIndex
>=
numkeys
)
CRYPT_ReturnLastError
(
ERROR_NO_MORE_ITEMS
);
CRYPT_ReturnLastError
(
ERROR_NO_MORE_ITEMS
);
}
else
{
}
else
{
DWORD
size
=
sizeof
(
DWORD
);
DWORD
size
=
sizeof
(
DWORD
);
HKEY
subkey
;
HKEY
subkey
;
if
(
RegEnumKey
A
(
hKey
,
dwIndex
,
pszProvName
,
*
pcbProvName
))
if
(
RegEnumKey
W
(
hKey
,
dwIndex
,
pszProvName
,
*
pcbProvName
/
sizeof
(
WCHAR
)
))
return
FALSE
;
return
FALSE
;
if
(
RegOpenKey
A
(
hKey
,
pszProvName
,
&
subkey
))
if
(
RegOpenKey
W
(
hKey
,
pszProvName
,
&
subkey
))
return
FALSE
;
return
FALSE
;
if
(
RegQueryValueEx
A
(
subkey
,
"Type"
,
NULL
,
NULL
,
(
BYTE
*
)
pdwProvType
,
&
size
))
if
(
RegQueryValueEx
W
(
subkey
,
typeW
,
NULL
,
NULL
,
(
BYTE
*
)
pdwProvType
,
&
size
))
return
FALSE
;
return
FALSE
;
RegCloseKey
(
subkey
);
RegCloseKey
(
subkey
);
}
}
...
@@ -1007,30 +1019,30 @@ BOOL WINAPI CryptEnumProvidersA (DWORD dwIndex, DWORD *pdwReserved,
...
@@ -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
,
BOOL
WINAPI
CryptEnumProviders
A
(
DWORD
dwIndex
,
DWORD
*
pdwReserved
,
DWORD
dwFlags
,
DWORD
*
pdwProvType
,
LP
W
STR
pszProvName
,
DWORD
*
pcbProvName
)
DWORD
dwFlags
,
DWORD
*
pdwProvType
,
LPSTR
pszProvName
,
DWORD
*
pcbProvName
)
{
{
PSTR
str
=
NULL
;
P
W
STR
str
=
NULL
;
DWORD
strlen
;
DWORD
strlen
;
BOOL
ret
;
/* = FALSE; */
BOOL
ret
;
/* = FALSE; */
TRACE
(
"(%ld, %p, %08ld, %p, %p, %p)
\n
"
,
dwIndex
,
pdwReserved
,
dwFlags
,
TRACE
(
"(%ld, %p, %08ld, %p, %p, %p)
\n
"
,
dwIndex
,
pdwReserved
,
dwFlags
,
pdwProvType
,
pszProvName
,
pcbProvName
);
pdwProvType
,
pszProvName
,
pcbProvName
);
strlen
=
*
pcbProvName
/
sizeof
(
WCHAR
);
strlen
=
*
pcbProvName
*
sizeof
(
WCHAR
);
if
(
pszProvName
&&
!
(
str
=
CRYPT_Alloc
(
strlen
))
)
if
(
pszProvName
&&
!
(
str
=
CRYPT_Alloc
(
strlen
))
)
CRYPT_ReturnLastError
(
ERROR_NOT_ENOUGH_MEMORY
);
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
)
if
(
str
)
{
{
CRYPT_
ANSIToUnicode
(
str
,
&
pszProvName
,
*
pcbProvName
);
CRYPT_
UnicodeToANSI
(
str
,
&
pszProvName
,
*
pcbProvName
);
CRYPT_Free
(
str
);
CRYPT_Free
(
str
);
}
}
*
pcbProvName
=
strlen
*
sizeof
(
WCHAR
);
*
pcbProvName
=
strlen
/
sizeof
(
WCHAR
);
/* FIXME: not correct */
return
ret
;
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