SimReadRecord

Send Feedback

The SimReadRecord function reads a file from the SIM. This function is part of the SIM Manager API set that enables access to information stored on the SIM card.

HRESULT SimReadRecord (
  HSIM hSim,
  DWORD dwAddress,
  DWORD dwRecordType,
  DWORD dwIndex,
  LPBYTE lpData,
  DWORD dwBufferSize,
  LPDWORD lpdwBytesRead
);

Parameters

  • hSim
    Points to a valid HSIM handle.
  • dwAddress
    A unique ID specifying the name of the SIM record.
  • dwRecordType
    A SIM_RECORDTYPE constant. See the Remarks section for a listing of all possible SIM_RECORDTYPE constants.
  • dwIndex
    Applies only to the SIM_RECORDTYPE_CYCLIC and SIM_RECORDTYPE_LINEAR constants; this parameter is ignored in any other case.
  • lpData
    Data buffer.
  • dwBufferSize
    Size of the data buffer.
  • lpdwBytesRead
    Number of bytes read.

Return Values

HRESULTs are either S_OK for success, or one of the SIM_E error constants defined in the SIM Manager Error Constants table.

Remarks

The following table contains a listing of all the SIM_RECORDTYPE constants.

Constant Value Description
SIM_RECORDTYPE_UNKNOWN 0x00000000 An unknown record type.
SIM_RECORDTYPE_TRANSPARENT 0x00000001 A single variable-length record.
SIM_RECORDTYPE_CYCLIC 0x00000002 A cyclic set of records, each of the same length.
SIM_RECORDTYPE_LINEAR 0x00000003 A linear set of records, each of the same length.
SIM_RECORDTYPE_MASTER 0x00000004 Every SIM has a single master record, effectively the head node.
SIM_RECORDTYPE_DEDICATED 0x00000005 Effectively, a directory record that is a parent of other records.

The SIM record system contains several folders, some of which are for specific record types. Some records are stored at the root level, and must be accessed differently than those in folders. You are restricted to accessing records within the currently selected folder. To access records in folders other than the current folder, you must navigate through the folder structure first.

The SimReadRecord function can only be used to read the first 255 bytes from a transparent (binary) file.

Note   This is a privileged API.

Requirements

Smartphone: Smartphone 2002 and later
Pocket PC: Pocket PC 2002 and later
OS Versions: Windows CE 3.0 and later
Header: simmgr.h
Library: cellcore.lib

See Also

SIM Manager Structures

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.