Expand Minimize

SCardForgetReader function

The SCardForgetReader function removes a previously introduced reader from control by the smart card subsystem. It is removed from the smart card database, including from any reader group that it may have been added to.

Syntax


LONG WINAPI SCardForgetReader(
  _In_  SCARDCONTEXT hContext,
  _In_  LPCTSTR szReaderName
);

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 to be removed from the smart card database.

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

If the specified reader is the last member of a reader group, the reader group is automatically removed as well.

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

Examples

The following example removes the display name of the specified card reader from the system. The example assumes that lReturn is a valid variable of type LONG and that hContext is a valid handle received from a previous call to the SCardEstablishContext function.



lReturn = SCardForgetReader(hContext, 
                            TEXT("MyReader"));
if ( SCARD_S_SUCCESS != lReturn )
    printf("Failed SCardForgetReader\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

SCardForgetReaderW (Unicode) and SCardForgetReaderA (ANSI)

See also

SCardEstablishContext
SCardForgetCardType
SCardForgetReaderGroup
SCardIntroduceReader

 

 

Community Additions

ADD
Show:
© 2014 Microsoft