The UpdateRecord method constructs an APDU command that updates a specific record with the bits given in the APDU command.
Note When using current record addressing, the command sets the record pointer on the successfully updated record.
HRESULT UpdateRecord(
BYTE byRecordId,
BYTE byRefCtrl,
LPBYTEBUFFER pData,
LPSCARDCMD *ppCmd
);
P1 = 00 designates the current record
P1 != '00' is the number of the specified record
Meaning | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
---|---|---|---|---|---|---|---|---|
Current EF | 0 | 0 | 0 | 0 | 0 | - | - | - |
Short EF ID | x | x | x | x | x | - | - | - |
First Record | - | - | - | - | - | 0 | 0 | 0 |
Last Record | - | - | - | - | - | 0 | 0 | 1 |
Next Record | - | - | - | - | - | 0 | 1 | 0 |
Previous Record | - | - | - | - | - | 0 | 1 | 1 |
Record # in P1 | - | - | - | - | - | 1 | 0 | 0 |
On return, it is filled with the APDU command constructed by this operation. If ppCmd was set to NULL, a smart card ISCardCmd object is internally created and returned via the ppCmd pointer.
The possible return values are the following:
Value | Meaning |
---|---|
S_OK | Operation completed successfully. |
E_INVALIDARG | Invalid parameter. |
E_POINTER | A bad pointer was passed in. |
E_OUTOFMEMORY | Out of memory. |
The encapsulated command can only be performed if the security status of the smart card satisfies the security attributes of the elementary file being processed.
When the command contains a valid short elementary identifier, it sets the file as current elementary file. If another elementary file is currently selected at the time of issuing this command, this command may be processed without identification of the currently selected file.
If the constructed command applies to a linear-fixed or cyclic-structured elementary file, it will abort if the record length is different from the length of the existing record.
If the command applies to a linear-variable structured elementary file, it may be carried out when the record length is different from the length of the existing record.
The "previous" option of the command (P2=xxxxx011), applied to a cyclic file, has the same behavior as a command constructed by AppendRecord.
Elementary files without a record structure cannot be read. The constructed command aborts if applied to an elementary file without record structure.
For a list of all the methods provided by the ISCardISO7816 interface, see ISCardISO7816.
In addition to the COM error codes listed above, this interface may return a smart card error code if a smart card function was called to complete the request. For information on smart card error codes, see Error Codes.
Windows NT: Use version 4.0 SP3 and later.
Windows: Use Windows 95 OSR2.1.
Windows CE: Unsupported.
Header: Declared in scardsrv.h.
Import Library: scardsrv.tlb.
AppendRecord, ISCardISO7816, ReadRecord, WriteRecord