On 25/04/06, Gil Abel <[EMAIL PROTECTED]> wrote:
> MS has 2 version of each function, an ascii and a double byte version.
> The function name SCardListReaders is actually a define that is directed
> to either SCardListReaderA or SCardListReadersW (wide char), depending
> on the project settings. So if you have a unicode version, the wide char
> version is used, otherwise, the "regular" version is used.
>
> Here is a portion of winscard.h:
> -----------------------
> extern WINSCARDAPI LONG WINAPI
> SCardListReadersA(
>     IN      SCARDCONTEXT hContext,
>     IN      LPCSTR mszGroups,
>     OUT     LPSTR mszReaders,
>     IN OUT  LPDWORD pcchReaders);
> extern WINSCARDAPI LONG WINAPI
> SCardListReadersW(
>     IN      SCARDCONTEXT hContext,
>     IN      LPCWSTR mszGroups,
>     OUT     LPWSTR mszReaders,
>     IN OUT  LPDWORD pcchReaders);
> #ifdef UNICODE
> #define SCardListReaders  SCardListReadersW
> #else
> #define SCardListReaders  SCardListReadersA
> #endif // !UNICODE

And the prototype in MSDN [1] is:
LONG SCardListReaders(
  IN SCARDCONTEXT hContext,
  IN LPCTSTR mszGroups,
  OUT LPTSTR mszReaders,
  IN OUT LPDWORD pcchReaders );

So I guess LPCTSTR can be define as LPCSTR or LPCWSTR depending on the
value of UNICODE.

What do you suggest we should do for pcsc-lite?

I propose to:
- use LPCSTR instead of LPCTSTR in the documentation and API (back to
what we had a few years ago) since pcsc-lite do not use UTF-16 (maybe
one day)
- define LPCTSTR as LPCSTR so we do not break existing code
- do the same for LPTSTR

Or any better idea?

Thanks,

[1] 
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcesdkr/html/_wcesdk_scard_scardlistreaders.asp

--
  Dr Ludovic Rousseau

_______________________________________________
Muscle mailing list
[email protected]
http://lists.drizzle.com/mailman/listinfo/muscle

Reply via email to