SCardAddReaderToGroupA function (winscard.h)
The SCardAddReaderToGroup function adds a reader to a reader group.
Syntax
LONG SCardAddReaderToGroupA(
[in] SCARDCONTEXT hContext,
[in] LPCSTR szReaderName,
[in] LPCSTR szGroupName
);
Parameters
[in] hContext
Handle that identifies the resource manager context. The resource manager context is set by a previous call to SCardEstablishContext. This parameter cannot be NULL.
[in] szReaderName
Display name of the reader that you are adding.
[in] szGroupName
Display name of the group to which you are adding the reader.
Return value
This function returns different values depending on whether it succeeds or fails.
Return code | Description |
---|---|
|
SCARD_S_SUCCESS. |
|
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");
Note
The winscard.h header defines SCardAddReaderToGroup as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows XP [desktop apps only] |
Minimum supported server | Windows Server 2003 [desktop apps only] |
Target Platform | Windows |
Header | winscard.h |
Library | Winscard.lib |
DLL | Winscard.dll |