Possibly wrong declarations for CryptEnumProviders in wincrypt.h

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

Possibly wrong declarations for CryptEnumProviders in wincrypt.h

Edward Diener-3
In the latest w32api-4.0.3-1-mingw32 in the wincrypt.h file the
declarations for CryptEnumProviders are:

WINADVAPI BOOL WINAPI
CryptEnumProvidersA(DWORD,DWORD*,DWORD,DWORD*,LPTSTR,DWORD*);
WINADVAPI BOOL WINAPI
CryptEnumProvidersW(DWORD,DWORD*,DWORD,DWORD*,LPTSTR,DWORD*);

Should not the declarations be :

WINADVAPI BOOL WINAPI
CryptEnumProvidersA(DWORD,DWORD*,DWORD,DWORD*,LPSTR,DWORD*);
WINADVAPI BOOL WINAPI
CryptEnumProvidersW(DWORD,DWORD*,DWORD,DWORD*,LPWSTR,DWORD*);

?



------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: Possibly wrong declarations for CryptEnumProviders in wincrypt.h

David Gressett-6

W32api V4 is very buggy; don't use it.  Check the declarations in the latest V3;

 

From: Edward Diener [mailto:[hidden email]]
Sent: Wednesday, July 01, 2015 7:21 PM
To: [hidden email]
Subject: [Mingw-users] Possibly wrong declarations for CryptEnumProviders in wincrypt.h

 

In the latest w32api-4.0.3-1-mingw32 in the wincrypt.h file the
declarations for CryptEnumProviders are:

WINADVAPI BOOL WINAPI
CryptEnumProvidersA(DWORD,DWORD*,DWORD,DWORD*,LPTSTR,DWORD*);
WINADVAPI BOOL WINAPI
CryptEnumProvidersW(DWORD,DWORD*,DWORD,DWORD*,LPTSTR,DWORD*);

Should not the declarations be :

WINADVAPI BOOL WINAPI
CryptEnumProvidersA(DWORD,DWORD*,DWORD,DWORD*,LPSTR,DWORD*);
WINADVAPI BOOL WINAPI
CryptEnumProvidersW(DWORD,DWORD*,DWORD,DWORD*,LPWSTR,DWORD*);

?



------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: [hidden email]


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: Possibly wrong declarations for CryptEnumProviders in wincrypt.h

Edward Diener-3
On 7/2/2015 11:45 AM, David Gressett wrote:
> W32api V4 is very buggy; don't use it.  Check the declarations in the
> latest V3;

Thanks ! I never realized that I should still be using V3.

>
> *From:*Edward Diener [mailto:[hidden email]]
> *Sent:* Wednesday, July 01, 2015 7:21 PM
> *To:* [hidden email]
> *Subject:* [Mingw-users] Possibly wrong declarations for
> CryptEnumProviders in wincrypt.h
>
> In the latest w32api-4.0.3-1-mingw32 in the wincrypt.h file the
> declarations for CryptEnumProviders are:
>
> WINADVAPI BOOL WINAPI
> CryptEnumProvidersA(DWORD,DWORD*,DWORD,DWORD*,LPTSTR,DWORD*);
> WINADVAPI BOOL WINAPI
> CryptEnumProvidersW(DWORD,DWORD*,DWORD,DWORD*,LPTSTR,DWORD*);
>
> Should not the declarations be :
>
> WINADVAPI BOOL WINAPI
> CryptEnumProvidersA(DWORD,DWORD*,DWORD,DWORD*,LPSTR,DWORD*);
> WINADVAPI BOOL WINAPI
> CryptEnumProvidersW(DWORD,DWORD*,DWORD,DWORD*,LPWSTR,DWORD*);
>
> ?



------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: Possibly wrong declarations for CryptEnumProviders in wincrypt.h

Edward Diener-3
In reply to this post by David Gressett-6
On 7/2/2015 11:45 AM, David Gressett wrote:
> W32api V4 is very buggy; don't use it.  Check the declarations in the
> latest V3;

Is there a compile-time macro that specifies which version of the w32api
library is being used ?

>
> *From:*Edward Diener [mailto:[hidden email]]
> *Sent:* Wednesday, July 01, 2015 7:21 PM
> *To:* [hidden email]
> *Subject:* [Mingw-users] Possibly wrong declarations for
> CryptEnumProviders in wincrypt.h
>
> In the latest w32api-4.0.3-1-mingw32 in the wincrypt.h file the
> declarations for CryptEnumProviders are:
>
> WINADVAPI BOOL WINAPI
> CryptEnumProvidersA(DWORD,DWORD*,DWORD,DWORD*,LPTSTR,DWORD*);
> WINADVAPI BOOL WINAPI
> CryptEnumProvidersW(DWORD,DWORD*,DWORD,DWORD*,LPTSTR,DWORD*);
>
> Should not the declarations be :
>
> WINADVAPI BOOL WINAPI
> CryptEnumProvidersA(DWORD,DWORD*,DWORD,DWORD*,LPSTR,DWORD*);
> WINADVAPI BOOL WINAPI
> CryptEnumProvidersW(DWORD,DWORD*,DWORD,DWORD*,LPWSTR,DWORD*);
>
> ?



------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: Possibly wrong declarations for CryptEnumProviders in wincrypt.h

Eli Zaretskii
> From: Edward Diener <[hidden email]>
> Date: Thu, 2 Jul 2015 15:47:28 -0400
>
> Is there a compile-time macro that specifies which version of the w32api
> library is being used ?

Yes, a few.  See w32api.h.

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: Possibly wrong declarations for CryptEnumProviders in wincrypt.h

Edward Diener-3
On 7/2/2015 4:15 PM, Eli Zaretskii wrote:
>> From: Edward Diener <[hidden email]>
>> Date: Thu, 2 Jul 2015 15:47:28 -0400
>>
>> Is there a compile-time macro that specifies which version of the w32api
>> library is being used ?
>
> Yes, a few.  See w32api.h.

Unfortunately the __W32API_VERSION information says 3.17 in both the
3.17 release and the 4.0.3 release. Furthermore in the 4.0.3 relase
there is a line which says:

#warning WARNING - The w32api.h header file is deprecated and will be
removed.

The "problem" I reported in my OP exists for both the 3.17 release and
the 4.0.3 release.


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: Possibly wrong declarations for CryptEnumProviders in wincrypt.h

Eli Zaretskii
> From: Edward Diener <[hidden email]>
> Date: Thu, 2 Jul 2015 16:54:36 -0400
>
> On 7/2/2015 4:15 PM, Eli Zaretskii wrote:
> >> From: Edward Diener <[hidden email]>
> >> Date: Thu, 2 Jul 2015 15:47:28 -0400
> >>
> >> Is there a compile-time macro that specifies which version of the w32api
> >> library is being used ?
> >
> > Yes, a few.  See w32api.h.
>
> Unfortunately the __W32API_VERSION information says 3.17 in both the
> 3.17 release and the 4.0.3 release.

One more bug in the 4.x release, I'd say.  Unless none of the headers
changed since 3.17.

> Furthermore in the 4.0.3 relase there is a line which says:
>
> #warning WARNING - The w32api.h header file is deprecated and will be
> removed.

I don't think this means the version macros are going away.  They
shouldn't.

> The "problem" I reported in my OP exists for both the 3.17 release and
> the 4.0.3 release.

Then the fact that the version macros are identical is not really a
problem in this case, is it?

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: Possibly wrong declarations for CryptEnumProviders in wincrypt.h

Edward Diener-3
On 7/3/2015 2:10 AM, Eli Zaretskii wrote:

>> From: Edward Diener <[hidden email]>
>> Date: Thu, 2 Jul 2015 16:54:36 -0400
>>
>> On 7/2/2015 4:15 PM, Eli Zaretskii wrote:
>>>> From: Edward Diener <[hidden email]>
>>>> Date: Thu, 2 Jul 2015 15:47:28 -0400
>>>>
>>>> Is there a compile-time macro that specifies which version of the w32api
>>>> library is being used ?
>>>
>>> Yes, a few.  See w32api.h.
>>
>> Unfortunately the __W32API_VERSION information says 3.17 in both the
>> 3.17 release and the 4.0.3 release.
>
> One more bug in the 4.x release, I'd say.  Unless none of the headers
> changed since 3.17.
>

The headers are definitely different.

>> Furthermore in the 4.0.3 relase there is a line which says:
>>
>> #warning WARNING - The w32api.h header file is deprecated and will be
>> removed.
>
> I don't think this means the version macros are going away.  They
> shouldn't.
>

OK.

>> The "problem" I reported in my OP exists for both the 3.17 release and
>> the 4.0.3 release.
>
> Then the fact that the version macros are identical is not really a
> problem in this case, is it?

Correct.

But in some other cases things are different. For instance the
UnregisterWait and UnregisterWaitEx declarations in 4.0+ says that XP is
needed ( incorrectly ) while in 3.0+ it correctly says that only Windows
2000 is needed.


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: Possibly wrong declarations for CryptEnumProviders in wincrypt.h

Keith Marshall-3
In reply to this post by Edward Diener-3
On 02/07/15 21:54, Edward Diener wrote:

> On 7/2/2015 4:15 PM, Eli Zaretskii wrote:
>>> From: Edward Diener <[hidden email]>
>>> Date: Thu, 2 Jul 2015 15:47:28 -0400
>>>
>>> Is there a compile-time macro that specifies which version of the w32api
>>> library is being used ?
>>
>> Yes, a few.  See w32api.h.
>
> Unfortunately the __W32API_VERSION information says 3.17 in both the
> 3.17 release and the 4.0.3 release.

As Eli has already suggested: clearly a bug, (albeit documentary only).

> Furthermore in the 4.0.3 relase there is a line which says:
>
> #warning WARNING - The w32api.h header file is deprecated and will be
> removed.

A unilateral declaration by Earnie.  Perhaps he will clarify his
rationale; maybe his intent is that sdkddkver.h will ultimately
supersede w32api.h.  However, I have (near) future plans for a more
concrete purpose for w32api.h, (which currently isn't used unless it is
explicitly included by user code), which would make it an essential
complement to sdkddkver.h, and ensure that it will NOT be deprecated.

> The "problem" I reported in my OP exists for both the 3.17 release and
> the 4.0.3 release.

If it really IS a problem, then it's a long standing bug, which should
be fixed.  However, do note that the current declarations:

> WINADVAPI BOOL WINAPI
> CryptEnumProvidersA(DWORD,DWORD*,DWORD,DWORD*,LPTSTR,DWORD*);
> WINADVAPI BOOL WINAPI
> CryptEnumProvidersW(DWORD,DWORD*,DWORD,DWORD*,LPTSTR,DWORD*);

are consistent with MSDN documentation for CrypEnumProviders:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa379929%28v=vs.85%29.aspx

| CryptEnumProviders(DWORD,DWORD*,DWORD,DWORD*,LPTSTR,DWORD*);

Notice that this declaration is generic, for both ANSI and Unicode
variants.  You aren't expected to invoke either CryptEnumProvidersA() or
CryptEnumProvidersW() directly; rather, you should define, (or not
define), UNICODE as appropriate, and invoke CryptEnumProviders().  If
you do this as intended, then CryptEnumProviders() becomes equivalent to
CryptEnumProvidersW() and LPTSTR correctly becomes a pointer to WCHAR
when UNICODE is defined, otherwise CryptEnumProviders() becomes
equivalent to CryptEnumProvidersA() with LPTSTR as a pointer to CHAR.
Thus, the prototypes as currently specified should work correctly,
provided your usage matches Microsoft's intent.  However, I do accept
your point, that:

> WINADVAPI BOOL WINAPI
> CryptEnumProvidersA(DWORD,DWORD*,DWORD,DWORD*,LPSTR,DWORD*);
> WINADVAPI BOOL WINAPI
> CryptEnumProvidersW(DWORD,DWORD*,DWORD,DWORD*,LPWSTR,DWORD*);

may be more explicitly correct, but even better would be:

  WINADVAPI BOOL WINAPI
  CryptEnumProvidersA(DWORD,DWORD*,DWORD,DWORD*,char*,DWORD*);
  WINADVAPI BOOL WINAPI
  CryptEnumProvidersW(DWORD,DWORD*,DWORD,DWORD*,wchar_t*,DWORD*);

(why cow-tow to the Microsoft god of unnecessary type obfuscation?)

--
Regards,
Keith.

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: Possibly wrong declarations for CryptEnumProviders in wincrypt.h

Edward Diener-3
On 7/3/2015 12:49 PM, Keith Marshall wrote:

> On 02/07/15 21:54, Edward Diener wrote:
>> On 7/2/2015 4:15 PM, Eli Zaretskii wrote:
>>>> From: Edward Diener <[hidden email]>
>>>> Date: Thu, 2 Jul 2015 15:47:28 -0400
>>>>
>>>> Is there a compile-time macro that specifies which version of the w32api
>>>> library is being used ?
>>>
>>> Yes, a few.  See w32api.h.
>>
>> Unfortunately the __W32API_VERSION information says 3.17 in both the
>> 3.17 release and the 4.0.3 release.
>
> As Eli has already suggested: clearly a bug, (albeit documentary only).
>
>> Furthermore in the 4.0.3 relase there is a line which says:
>>
>> #warning WARNING - The w32api.h header file is deprecated and will be
>> removed.
>
> A unilateral declaration by Earnie.  Perhaps he will clarify his
> rationale; maybe his intent is that sdkddkver.h will ultimately
> supersede w32api.h.  However, I have (near) future plans for a more
> concrete purpose for w32api.h, (which currently isn't used unless it is
> explicitly included by user code), which would make it an essential
> complement to sdkddkver.h, and ensure that it will NOT be deprecated.
>
>> The "problem" I reported in my OP exists for both the 3.17 release and
>> the 4.0.3 release.
>
> If it really IS a problem, then it's a long standing bug, which should
> be fixed.  However, do note that the current declarations:
>
>> WINADVAPI BOOL WINAPI
>> CryptEnumProvidersA(DWORD,DWORD*,DWORD,DWORD*,LPTSTR,DWORD*);
>> WINADVAPI BOOL WINAPI
>> CryptEnumProvidersW(DWORD,DWORD*,DWORD,DWORD*,LPTSTR,DWORD*);
>
> are consistent with MSDN documentation for CrypEnumProviders:
> https://msdn.microsoft.com/en-us/library/windows/desktop/aa379929%28v=vs.85%29.aspx

No they are not. Your link points to the declaration for
CryptEnumProviders while the declarations above are for
CryptEnumProvidersA and CryptEnumProvidersW respectively. They are not
the same. I hope I don't have to explain further why your declarations
are wrong.

>
> | CryptEnumProviders(DWORD,DWORD*,DWORD,DWORD*,LPTSTR,DWORD*);
>
> Notice that this declaration is generic, for both ANSI and Unicode
> variants.  You aren't expected to invoke either CryptEnumProvidersA() or
> CryptEnumProvidersW() directly; rather, you should define, (or not
> define), UNICODE as appropriate, and invoke CryptEnumProviders().  If
> you do this as intended, then CryptEnumProviders() becomes equivalent to
> CryptEnumProvidersW() and LPTSTR correctly becomes a pointer to WCHAR
> when UNICODE is defined, otherwise CryptEnumProviders() becomes
> equivalent to CryptEnumProvidersA() with LPTSTR as a pointer to CHAR.
> Thus, the prototypes as currently specified should work correctly,
> provided your usage matches Microsoft's intent.  However, I do accept
> your point, that:
>
>> WINADVAPI BOOL WINAPI
>> CryptEnumProvidersA(DWORD,DWORD*,DWORD,DWORD*,LPSTR,DWORD*);
>> WINADVAPI BOOL WINAPI
>> CryptEnumProvidersW(DWORD,DWORD*,DWORD,DWORD*,LPWSTR,DWORD*);
>
> may be more explicitly correct, but even better would be:
>
>    WINADVAPI BOOL WINAPI
>    CryptEnumProvidersA(DWORD,DWORD*,DWORD,DWORD*,char*,DWORD*);
>    WINADVAPI BOOL WINAPI
>    CryptEnumProvidersW(DWORD,DWORD*,DWORD,DWORD*,wchar_t*,DWORD*);
>
> (why cow-tow to the Microsoft god of unnecessary type obfuscation?)
>



------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: Possibly wrong declarations for CryptEnumProviders in wincrypt.h

Keith Marshall-3
On 04/07/15 02:32, Edward Diener wrote:

>> If it really IS a problem, then it's a long standing bug, which should
>> be fixed.  However, do note that the current declarations:
>>
>>> WINADVAPI BOOL WINAPI
>>> CryptEnumProvidersA(DWORD,DWORD*,DWORD,DWORD*,LPTSTR,DWORD*);
>>> WINADVAPI BOOL WINAPI
>>> CryptEnumProvidersW(DWORD,DWORD*,DWORD,DWORD*,LPTSTR,DWORD*);
>>
>> are consistent with MSDN documentation for CrypEnumProviders:
>> https://msdn.microsoft.com/en-us/library/windows/desktop/aa379929%28v=vs.85%29.aspx
>
> No they are not.

Yes, they are, insofar as they use the documented data types for:

> Your link points to the declaration for CryptEnumProviders

Which is the API function you are *supposed* to call, (after defining
UNICODE appropriately for the wchar_t* version, or leaving it undefined
for the char* version).

> while the declarations above are for CryptEnumProvidersA and
> CryptEnumProvidersW respectively. They are not the same. I hope I
> don't have to explain further why your declarations are wrong.

1) They aren't *my* declarations, to begin with.

2) Yes, they are defective, but not critically so, if you use the API
   correctly.

I've already spent more time on this than I can really spare.  I'll
correct it, when a window of opportunity presents itself.  To ensure
that I don't forget, please file a formal bug report.

--
Regards,
Keith.

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: Possibly wrong declarations for CryptEnumProviders in wincrypt.h

Edward Diener-3
On 7/4/2015 7:46 AM, Keith Marshall wrote:

> On 04/07/15 02:32, Edward Diener wrote:
>>> If it really IS a problem, then it's a long standing bug, which should
>>> be fixed.  However, do note that the current declarations:
>>>
>>>> WINADVAPI BOOL WINAPI
>>>> CryptEnumProvidersA(DWORD,DWORD*,DWORD,DWORD*,LPTSTR,DWORD*);
>>>> WINADVAPI BOOL WINAPI
>>>> CryptEnumProvidersW(DWORD,DWORD*,DWORD,DWORD*,LPTSTR,DWORD*);
>>>
>>> are consistent with MSDN documentation for CrypEnumProviders:
>>> https://msdn.microsoft.com/en-us/library/windows/desktop/aa379929%28v=vs.85%29.aspx
>>
>> No they are not.
>
> Yes, they are, insofar as they use the documented data types for:
>
>> Your link points to the declaration for CryptEnumProviders
>
> Which is the API function you are *supposed* to call, (after defining
> UNICODE appropriately for the wchar_t* version, or leaving it undefined
> for the char* version).
>
>> while the declarations above are for CryptEnumProvidersA and
>> CryptEnumProvidersW respectively. They are not the same. I hope I
>> don't have to explain further why your declarations are wrong.
>
> 1) They aren't *my* declarations, to begin with.

"your declarations" = mingw's declarations

>
> 2) Yes, they are defective, but not critically so, if you use the API
>     correctly.

In an ANSI build a programmer might want to call the unicode version and
in a unicode build a programmer might want to call the ansi version.
There is no "use the API correctly" in those actions.

>
> I've already spent more time on this than I can really spare.  I'll
> correct it, when a window of opportunity presents itself.  To ensure
> that I don't forget, please file a formal bug report.
>

I was not attacking you personally. I was just trying to point out the
defect in the declarations. I will file a formal bug report.


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: Possibly wrong declarations for CryptEnumProviders in wincrypt.h

Eli Zaretskii
In reply to this post by Keith Marshall-3
> Date: Sat, 04 Jul 2015 12:46:37 +0100
> From: Keith Marshall <[hidden email]>
>
> On 04/07/15 02:32, Edward Diener wrote:
> >> If it really IS a problem, then it's a long standing bug, which should
> >> be fixed.  However, do note that the current declarations:
> >>
> >>> WINADVAPI BOOL WINAPI
> >>> CryptEnumProvidersA(DWORD,DWORD*,DWORD,DWORD*,LPTSTR,DWORD*);
> >>> WINADVAPI BOOL WINAPI
> >>> CryptEnumProvidersW(DWORD,DWORD*,DWORD,DWORD*,LPTSTR,DWORD*);
> >>
> >> are consistent with MSDN documentation for CrypEnumProviders:
> >> https://msdn.microsoft.com/en-us/library/windows/desktop/aa379929%28v=vs.85%29.aspx
> >
> > No they are not.
>
> Yes, they are, insofar as they use the documented data types for:
>
> > Your link points to the declaration for CryptEnumProviders
>
> Which is the API function you are *supposed* to call, (after defining
> UNICODE appropriately for the wchar_t* version, or leaving it undefined
> for the char* version).

But these APIs aren't limited to this pattern of usage.  It is quite
possible and legitimate (and from my POV, much more practical) to
invoke the "wide" APIs directly, without defining UNICODE, I.e. in a
program that otherwise calls ANSI APIs.  When used like that, those
prototypes will cause compilation warnings/errors.

> 2) Yes, they are defective, but not critically so, if you use the API
>    correctly.

I don't think using under UNICODE is the only correct usage here.

Anyway, we all agree that the prototypes are defective, so I suggest
to leave it at that.

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: Possibly wrong declarations for CryptEnumProviders in wincrypt.h

Keith Marshall-3
In reply to this post by Edward Diener-3
On 04/07/15 13:07, Edward Diener wrote:
> "your declarations" = mingw's declarations

But they aren't even that; they are artefacts from the days when the
cygwin folks were custodians of the w32api, so technically they are
cygwin declarations, (and yes, we all agree that they are defective).

>> 2) Yes, they are defective, but not critically so, if you use the API
>>    correctly.
>
> In an ANSI build a programmer might want to call the unicode version and
> in a unicode build a programmer might want to call the ansi version.
> There is no "use the API correctly" in those actions.

I don't want to argue that you shouldn't do this, but you are straying
into undocumented territory here -- Microsoft document *only* the
generic CryptEnumProviders() API, with UNICODE appropriately defined.

>> I've already spent more time on this than I can really spare.  I'll
>> correct it, when a window of opportunity presents itself.  To ensure
>> that I don't forget, please file a formal bug report.
>
> I was not attacking you personally. I was just trying to point out the
> defect in the declarations. I will file a formal bug report.

Thank you.

--
Regards,
Keith.

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe