Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

SCardAddReaderToGroup function

The SCardAddReaderToGroup function adds a reader to a reader group.

Syntax


LONG WINAPI SCardAddReaderToGroup(
  _In_  SCARDCONTEXT hContext,
  _In_  LPCTSTR szReaderName,
  _In_  LPCTSTR szGroupName
);

Parameters

hContext [in]

Handle that identifies the resource manager context. The resource manager context is set by a previous call to SCardEstablishContext. This parameter cannot be NULL.

szReaderName [in]

Display name of the reader that you are adding.

szGroupName [in]

Display name of the group to which you are adding the reader.

ValueMeaning
SCARD_ALL_READERS
TEXT("SCard$AllReaders\000")

Group used when no group name is provided when listing readers. Returns a list of all readers, regardless of what group or groups the readers are in.

SCARD_DEFAULT_READERS
TEXT("SCard$DefaultReaders\000")

Default group to which all readers are added when introduced into the system.

SCARD_LOCAL_READERS
TEXT("SCard$LocalReaders\000")

Unused legacy value. This is an internally managed group that cannot be modified by using any reader group APIs. It is intended to be used for enumeration only.

SCARD_SYSTEM_READERS
TEXT("SCard$SystemReaders\000")

Unused legacy value. This is an internally managed group that cannot be modified by using any reader group APIs. It is intended to be used for enumeration only.

 

Return value

This function returns different values depending on whether it succeeds or fails.

Return codeDescription
Success

SCARD_S_SUCCESS.

Failure

An error code. For more information, see Smart Card Return Values.

 

Remarks

SCardAddReaderToGroup automatically creates the reader group specified if it does not already exist.

The SCardAddReaderToGroup function is a database management function. For more information on other database management functions, see Smart Card Database Management Functions.

Examples

The following example demonstrates how to add a smart card reader to a group. The example assumes that lReturn is an existing variable of type LONG, that hContext is a valid handle received from a previous call to the SCardEstablishContext function, and that "MyReader" and "MyReaderGroup" are known by the system through previous calls to the SCardIntroduceReader and SCardIntroduceReaderGroup functions, respectively.



lReturn = SCardAddReaderToGroup( hContext, 
                                L"MyReader",
                                L"MyReaderGroup");
if ( SCARD_S_SUCCESS != lReturn )
    printf("Failed SCardAddReaderToGroup\n");


Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Winscard.h

Library

Winscard.lib

DLL

Winscard.dll

Unicode and ANSI names

SCardAddReaderToGroupW (Unicode) and SCardAddReaderToGroupA (ANSI)

See also

SCardEstablishContext
SCardIntroduceReader
SCardIntroduceReaderGroup
SCardRemoveReaderFromGroup

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.