//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES OR INDEMNITIES.
//
/*++
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.
Copyright (c) Microsoft Corporation. All rights reserved.
-----------------------------------------------------------------------------
@doc EXTERNAL
@module SIMMGR.H - SIM Manager |
SIM Manager is an API set that allows access to information stored on the SIM Card
-----------------------------------------------------------------------------
--*/
#ifndef _SIMMGR_H_
#define _SIMMGR_H_
#include <windows.h>
#ifdef __cplusplus
extern "C" {
#endif
// -----------------------------------------------------------------------------
//
// @doc EXTERNAL
//
// @constants Error Class | Each SIM error falls into a general error class bucket
//
// @comm In SIM Manager, the low order 16 bits are divided into an 8-bit error class and
// an 8-bit error value. Use the SIMERRORCLASS macro to obtain the error
// class from a SIM HRESULT.
//
// -----------------------------------------------------------------------------
#define SIM_ERRORCLASS_NONE 0x00 // @constdefine Misc error
#define SIM_ERRORCLASS_PASSWORD 0x01 // @constdefine Unspecified phone failure
#define SIM_ERRORCLASS_SIM 0x02 // @constdefine Problem with the SIM
#define SIM_ERRORCLASS_STORAGE 0x03 // @constdefine Error relating to storage
#define MAKE_SIMERROR(errclass,code) \
( (unsigned long)(errclass)<<8) | ((unsigned long)(code) )
#define SIMERRORCLASS(simerror) \
((unsigned long) (((simerror)>>8) & 0xff))
// -----------------------------------------------------------------------------
//
// @doc EXTERNAL
//
// @constants Error | Various errors
//
// @comm None
//
// -----------------------------------------------------------------------------
#define FACILITY_SIM 0x800
#define SIM_E_SIMFAILURE (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_SIM,0x01))) // @constdefine SIM failure was detected
#define SIM_E_SIMBUSY (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_SIM,0x02))) // @constdefine SIM is busy
#define SIM_E_SIMWRONG (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_SIM,0x03))) // @constdefine Inorrect SIM was inserted
#define SIM_E_NOSIMMSGSTORAGE (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_SIM,0x04))) // @constdefine SIM isn't capable of storing messages
#define SIM_E_SIMTOOLKITBUSY (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_SIM,0x05))) // @constdefine SIM Application Toolkit is busy
#define SIM_E_SIMDOWNLOADERROR (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_SIM,0x06))) // @constdefine SIM data download error
#define SIM_E_SIMNOTINSERTED (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_SIM,0x07))) // @constdefine SIM isn't inserted into the phone
#define SIM_E_PHSIMPINREQUIRED (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_PASSWORD,0x20))) // @constdefine PH-SIM PIN is required to perform this operation
#define SIM_E_PHFSIMPINREQUIRED (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_PASSWORD,0x21))) // @constdefine PH-FSIM PIN is required to perform this operation
#define SIM_E_PHFSIMPUKREQUIRED (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_PASSWORD,0x22))) // @constdefine PH-FSIM PUK is required to perform this operation
#define SIM_E_SIMPINREQUIRED (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_PASSWORD,0x23))) // @constdefine SIM PIN is required to perform this operation
#define SIM_E_SIMPUKREQUIRED (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_PASSWORD,0x24))) // @constdefine SIM PUK is required to perform this operation
#define SIM_E_INCORRECTPASSWORD (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_PASSWORD,0x25))) // @constdefine Incorrect password was supplied
#define SIM_E_SIMPIN2REQUIRED (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_PASSWORD,0x26))) // @constdefine SIM PIN2 is required to perform this operation
#define SIM_E_SIMPUK2REQUIRED (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_PASSWORD,0x27))) // @constdefine SIM PUK2 is required to perform this operation
#define SIM_E_NETWKPINREQUIRED (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_PASSWORD,0x28))) // @constdefine Network Personalization PIN is required to perform this operation
#define SIM_E_NETWKPUKREQUIRED (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_PASSWORD,0x29))) // @constdefine Network Personalization PUK is required to perform this operation
#define SIM_E_SUBSETPINREQUIRED (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_PASSWORD,0x2A))) // @constdefine Network Subset Personalization PIN is required to perform this operation
#define SIM_E_SUBSETPUKREQUIRED (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_PASSWORD,0x2B))) // @constdefine Network Subset Personalization PUK is required to perform this operation
#define SIM_E_SVCPINREQUIRED (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_PASSWORD,0x2C))) // @constdefine Service Provider Personalization PIN is required to perform this operation
#define SIM_E_SVCPUKREQUIRED (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_PASSWORD,0x2D))) // @constdefine Service Provider Personalization PUK is required to perform this operation
#define SIM_E_CORPPINREQUIRED (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_PASSWORD,0x2E))) // @constdefine Corporate Personalization PIN is required to perform this operation
#define SIM_E_CORPPUKREQUIRED (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_PASSWORD,0x2F))) // @constdefine Corporate Personalization PUK is required to perform this operation
#define SIM_E_MEMORYFULL (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_STORAGE,0x40))) // @constdefine Storage memory is full
#define SIM_E_INVALIDINDEX (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_STORAGE,0x41))) // @constdefine Invalid storage index was supplied
#define SIM_E_NOTFOUND (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_STORAGE,0x42))) // @constdefine A requested storage entry was not found
#define SIM_E_MEMORYFAILURE (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_STORAGE,0x43))) // @constdefine Storage memory failure
#define SIM_E_SIMMSGSTORAGEFULL (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMER