次の方法で共有


SimReadRecord (Compact 2013)

3/26/2014

This function reads a record from the SIM.

Syntax

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

Parameters

  • [in] hSim
    Points to a valid HSIM handle.
  • [in] dwAddress
    A unique ID specifying the name of the SIM record.
  • [in] dwIndex
    Used when the dwRecordType value is SIM_RECORDTYPE_CYCLIC or SIM_RECORDTYPE_LINEAR. Otherwise, this parameter is ignored.
  • [in,out] lpData
    [in] A pointer to a storage area to read the record into.

    [out] The returned record data, which is lpdwBytesRead in length.

  • [in] dwBufferSize
    lpData data size in bytes.
  • [in,out] lpdwBytesRead
    The number of bytes actually read.

Return Value

HRESULT is S_OK for success, or one of the SIM_E error constants defined in the SIM Manager Error Constants table.

Example

HRESULT       hr;
HSIM          hSim;
SIMRECORDINFO simRecordInfo;
DWORD         dwIndex      = 0;
BYTE          abRecordData[ MAX_SIM_RECORD_SIZE ];
DWORD         dwBytesRead  = 0;

hr = SimInitialize( SIM_INIT_NONE, NULL, 0, &hSim );

hr = SimReadRecord( hSim, 0x6F7B, SIM_RECORDTYPE_TRANSPARENT
   , dwIndex, abRecordData, MAX_SIM_RECORD_SIZE, &dwBytesRead );

// Finished using the SIM Manager
hr = SimDeinitialize( hSim );

Remarks

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.

Requirements

Header

simmgr.h

Library

sim.lib

See Also

Reference

SIM Manager Functions
SIM Manager Structures
SIMRECORDINFO
SimGetRecordInfo
SimReadRecord
SimWriteRecord