SCardConnect function Null safety winscard

int SCardConnect(
  1. int hContext,
  2. Pointer<Utf16> szReader,
  3. int dwShareMode,
  4. int dwPreferredProtocols,
  5. Pointer<IntPtr> phCard,
  6. Pointer<Uint32> pdwActiveProtocol
)

The SCardConnect function establishes a connection (using a specific resource manager context) between the calling application and a smart card contained by a specific reader. If no card exists in the specified reader, an error is returned.

LONG SCardConnectW(
  SCARDCONTEXT  hContext,
  LPCWSTR       szReader,
  DWORD         dwShareMode,
  DWORD         dwPreferredProtocols,
  LPSCARDHANDLE phCard,
  LPDWORD       pdwActiveProtocol
);

Implementation

int SCardConnect(
        int hContext,
        Pointer<Utf16> szReader,
        int dwShareMode,
        int dwPreferredProtocols,
        Pointer<IntPtr> phCard,
        Pointer<Uint32> pdwActiveProtocol) =>
    _SCardConnect(hContext, szReader, dwShareMode, dwPreferredProtocols, phCard,
        pdwActiveProtocol);