G
Guest
Hi there,
I had 2 questions.
In SCardConnect function in Winscard.h:
extern WINSCARDAPI LONG WINAPI
SCardConnectA(
IN SCARDCONTEXT hContext,
IN LPCSTR szReader,
IN DWORD dwShareMode,
IN DWORD dwPreferredProtocols,
OUT LPSCARDHANDLE phCard,
OUT LPDWORD pdwActiveProtocol);
How do we simulate IN and OUT in C#? I know you can simulate either this:
out keyword
or
[In] attribute
or
[Out] attribute
But there is no In keyword?
And i used DWORD in C# as System.UInt32. I hope it is a right conversion.
[DllImport("winscard.dll", SetLastError=true)]
private static extern int SCardConnectA(UInt32 hContext, String szReader,
UInt32 dwShareMode, UInt32 dwPreferredProtocols, out UInt32 phCard, out
UInt32 pdwActiveProtocol);
Please correct me if i am wrong.
2)
I had some confusion when to use SCardConnectA or SCardConnectW. Unicode and
non unicode, does it makes difference? Can anyone elaborate please?
Below are the codes extracted from Winscard.h:
extern WINSCARDAPI LONG WINAPI
SCardConnectA(
IN SCARDCONTEXT hContext,
IN LPCSTR szReader,
IN DWORD dwShareMode,
IN DWORD dwPreferredProtocols,
OUT LPSCARDHANDLE phCard,
OUT LPDWORD pdwActiveProtocol);
extern WINSCARDAPI LONG WINAPI
SCardConnectW(
IN SCARDCONTEXT hContext,
IN LPCWSTR szReader,
IN DWORD dwShareMode,
IN DWORD dwPreferredProtocols,
OUT LPSCARDHANDLE phCard,
OUT LPDWORD pdwActiveProtocol);
#ifdef UNICODE
#define SCardConnect SCardConnectW
#else
#define SCardConnect SCardConnectA
#endif // !UNICODE
Thanks.
I had 2 questions.
In SCardConnect function in Winscard.h:
extern WINSCARDAPI LONG WINAPI
SCardConnectA(
IN SCARDCONTEXT hContext,
IN LPCSTR szReader,
IN DWORD dwShareMode,
IN DWORD dwPreferredProtocols,
OUT LPSCARDHANDLE phCard,
OUT LPDWORD pdwActiveProtocol);
How do we simulate IN and OUT in C#? I know you can simulate either this:
out keyword
or
[In] attribute
or
[Out] attribute
But there is no In keyword?
And i used DWORD in C# as System.UInt32. I hope it is a right conversion.
[DllImport("winscard.dll", SetLastError=true)]
private static extern int SCardConnectA(UInt32 hContext, String szReader,
UInt32 dwShareMode, UInt32 dwPreferredProtocols, out UInt32 phCard, out
UInt32 pdwActiveProtocol);
Please correct me if i am wrong.
2)
I had some confusion when to use SCardConnectA or SCardConnectW. Unicode and
non unicode, does it makes difference? Can anyone elaborate please?
Below are the codes extracted from Winscard.h:
extern WINSCARDAPI LONG WINAPI
SCardConnectA(
IN SCARDCONTEXT hContext,
IN LPCSTR szReader,
IN DWORD dwShareMode,
IN DWORD dwPreferredProtocols,
OUT LPSCARDHANDLE phCard,
OUT LPDWORD pdwActiveProtocol);
extern WINSCARDAPI LONG WINAPI
SCardConnectW(
IN SCARDCONTEXT hContext,
IN LPCWSTR szReader,
IN DWORD dwShareMode,
IN DWORD dwPreferredProtocols,
OUT LPSCARDHANDLE phCard,
OUT LPDWORD pdwActiveProtocol);
#ifdef UNICODE
#define SCardConnect SCardConnectW
#else
#define SCardConnect SCardConnectA
#endif // !UNICODE
Thanks.