Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsWindows Server 2003Windows 2000Windows NTSmall Business ServerVirtual ServerExchange ServerIISHost Integration ServerISA ServerSMSWSUSMOMWindows Media ServerSecurityCertification
Related Topics
SQL ServerMS WindowsMS OfficePC HardwareMore Topics ...

Windows Server Forum / Security / Cryptography / October 2008

Tip: Looking for answers? Try searching our database.

Problem invoking the Unicode version of CryptEnumProviderTypes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stanimir Stamenkov - 09 Oct 2008 01:26 GMT
Not sure whether this is a suitable group for asking Win32 API
questions.

I'm trying the Cryptography examples from the MSDN Library and I
cannot get the "Example C Program: Enumerating CSP Providers and
Provider Types" [1] to work when compiled for Unicode character set.
 Invoking CryptEnumProviderTypes the second time after the name
buffer size has been determined and allocated always results in
ERROR_MORE_DATA.

I get no such problem if I compile the example for Multi-byte
character set (that is using the ANSI versions of the Win32 API
functions).  What I might be missing?

[1] http://msdn.microsoft.com/bg-bg/library/aa382359(en-us,VS.85).aspx

Signature

Stanimir <stanio(_at_)gbg.bg>

Stanimir Stamenkov - 10 Oct 2008 00:14 GMT
Thu, 09 Oct 2008 03:26:01 +0300, /Stanimir Stamenkov/:

> I'm trying the Cryptography examples from the MSDN Library and I cannot
> get the "Example C Program: Enumerating CSP Providers and Provider
[quoted text clipped - 7 lines]
>
> [1] http://msdn.microsoft.com/bg-bg/library/aa382359(en-us,VS.85).aspx

Just to add more info, comparing the cbName value between the
Unicode and ANSI versions after the first CryptEnumProviderTypes
call, it seems it correctly reports twice more bytes needed for the
Unicode version.  Even if I allocate couple of kilobytes for pszName
(much more than cbName reports after the first call) I get the
ERROR_MORE_DATA on the second call.

FWIW, I'm on Windows XP SP3 using Visual Studio 2005 Standard Edition.

Signature

Stanimir <stanio(_at_)gbg.bg>

Mounir IDRASSI - 11 Oct 2008 12:39 GMT
Hi Stanimir,

This is a bug that was introduced in Windows XP SP3. I had the same problem
as you some time ago and I did many tests that showed that
CryptEnumProviderTypesW never returns the actual name value, returning
ERROR_MORE_DATA instead whenever we fill the pszTypeName parameter.

I didn't try to contact microsoft about but maybe we should since I'm not
the only one having this problem.

Cheers,
Signature

Mounir IDRASSI
IDRIX
http://www.idrix.fr

To reach me: mounir_idrix_fr (replace the underscores with the at and dot
characters respectively)

> Thu, 09 Oct 2008 03:26:01 +0300, /Stanimir Stamenkov/:
>
[quoted text clipped - 18 lines]
>
> FWIW, I'm on Windows XP SP3 using Visual Studio 2005 Standard Edition.
Stanimir Stamenkov - 12 Oct 2008 11:21 GMT
Sat, 11 Oct 2008 04:39:00 -0700, /Mounir IDRASSI/:

> This is a bug that was introduced in Windows XP SP3. I had the same problem
> as you some time ago and I did many tests that showed that
> CryptEnumProviderTypesW never returns the actual name value, returning
> ERROR_MORE_DATA instead whenever we fill the pszTypeName parameter.

Hello Mounir.  Thanks for confirming the problem is not because of
my fault.

Signature

Stanimir <stanio(_at_)gbg.bg>

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.