📄 simmgr.h
字号:
//
// 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_SIMERROR(SIM_ERRORCLASS_STORAGE,0x44))) // @constdefine Message storage on the SIM is full
#define SIM_E_EMPTYINDEX (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_STORAGE,0x45))) // @constdefine Storage location is empty
#define SIM_E_TEXTSTRINGTOOLONG (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_STORAGE,0x46))) // @constdefine Supplied text string is too long
#define SIM_E_DIALSTRINGTOOLONG (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_STORAGE,0x47))) // @constdefine Supplied dial string contains invalid characters
#define SIM_E_NOTREADY (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_NONE,0x60))) // @constdefine SIM isn't yet ready to perform the requested operation
#define SIM_E_SECURITYFAILURE (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_NONE,0x61))) // @constdefine SIM isn't yet ready to perform the requested operation
#define SIM_E_BUFFERTOOSMALL (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_NONE,0x62))) // @constdefine Buffer too small
#define SIM_E_NOTTEXTMESSAGE (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_NONE,0x63))) // @constdefine Requested SMS message is not a text message
#define SIM_E_NOSIM (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_NONE,0x64))) // @constdefine Device doesn't have a SIM
#define SIM_E_NETWORKERROR (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_NONE,0x65))) // @constdefine There was a network error
#define SIM_E_MOBILEERROR (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_NONE,0x66))) // @constdefine Mobile error
#define SIM_E_UNSUPPORTED (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_NONE,0x67))) // @constdefine The command is unsupported
#define SIM_E_BADPARAM (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_NONE,0x68))) // @constdefine Bad parameter
#define SIM_E_UNDETERMINED (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_NONE,0x69))) // @constdefine Undetermined error
#define SIM_E_RADIONOTPRESENT (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_NONE,0x6A))) // @constdefine The Radio is not present
#define SIM_E_RADIOOFF (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_SIM, MAKE_SIMERROR(SIM_ERRORCLASS_NONE,0x6B))) // @constdefine The Radio is off
// -----------------------------------------------------------------------------
//
// @doc EXTERNAL
//
// @constants Callback | Various notifications that are passed to the callback
//
// @comm None
//
// -----------------------------------------------------------------------------
#define SIM_NOTIFY_CARD_REMOVED (0x100) // @constdefine SIM card was removed; lpData is NULL
#define SIM_NOTIFY_FILE_REFRESH (0x101) // @constdefine Files on the SIM were refreshed; lpData points to a SIMFILEREFRESH structure
#define SIM_NOTIFY_MSG_STORED (0x102) // @constdefine A message was stored to the SIM; lpData points to a SIMMESSAGECHANGE structure
#define SIM_NOTIFY_MSG_DELETED (0x103) // @constdefine A message was removed from the SIM; lpData points to a SIMMESSAGECHANGE structure
#define SIM_NOTIFY_PBE_STORED (0x104) // @constdefine A phone book entry was stored to the SIM; lpData points to a SIMPBECHANGE structure
#define SIM_NOTIFY_PBE_DELETED (0x105) // @constdefine A phone book entry was removed from the SIM; lpData points to a SIMPBECHANGE structure
#define SIM_NOTIFY_MSG_RECEIVED (0x106) // @constdefine Class 2 SMS was sent directly to the SIM; lpData points to a SIMMESSAGECHANGE structure
#define SIM_NOTIFY_RADIOOFF (0x107) // @constdefine The Radio has been turned off but AT interpreter is still on; lpData is NULL
#define SIM_NOTIFY_RADIOON (0x108) // @constdefine The Radio is present and is now on; lpData is NULL
#define SIM_NOTIFY_RADIOPRESENT (0x109) // @constdefine A Radio Module/Driver has been installed; lpData is points to a DWORD which is 0 if the radio is OFF and 1 if the radio is ON
#define SIM_NOTIFY_RADIOREMOVED (0x10A) // @constdefine A Radio Module/Driver has been removed; lpData is NULL
#define SIM_NOTIFY_SMSSTORAGEFULL (0x10B) // @constdefine SIM SMS Store is full; lpData points to a SIMSMSSTORAGESTATUS structure. Only supports SIM_SMSSTORAGE_SIM
// Parameter flags for SimInitialize
#define SIM_INIT_NONE (0x00000000) // @constdefine Do not send any notifications
#define SIM_INIT_SIMCARD_NOTIFICATIONS (0x00000001) // @constdefine Send SIM card related notifications
// -----------------------------------------------------------------------------
//
// @doc EXTERNAL
//
// @params SIMPHONEBOOKENTRY
//
// @comm None
//
// -----------------------------------------------------------------------------
#define SIM_PARAM_PBE_ADDRESS (0x00000001) // @paramdefine lpszAddress field is valid
#define SIM_PARAM_PBE_ADDRESS_TYPE (0x00000002) // @paramdefine dwAddressType field is valid
#define SIM_PARAM_PBE_NUMPLAN (0x00000004) // @paramdefine dwNumPlan field is valid
#define SIM_PARAM_PBE_TEXT (0x00000008) // @paramdefine lpszText field is valid
#define SIM_PARAM_PBE_ALL (0x0000000f) // @paramdefine All fields are valid
// -----------------------------------------------------------------------------
//
// @doc EXTERNAL
//
// @params SIMPHONEBOOKENTRYEX
//
// @comm None
//
// -----------------------------------------------------------------------------
#define SIM_PARAM_PBEX_ADDRESS (0x00000001) // @paramdefine lpszAddress field is valid
#define SIM_PARAM_PBEX_ADDRESS_TYPE (0x00000002) // @paramdefine dwAddressType field is valid
#define SIM_PARAM_PBEX_NUMPLAN (0x00000004) // @paramdefine dwNumPlan field is valid
#define SIM_PARAM_PBEX_TEXT (0x00000008) // @paramdefine lpszText field is valid
#define SIM_PARAM_PBEX_SECONDNAME (0x00000010) // @paramdefine lpszSecondName field is valid
#define SIM_PARAM_PBEX_HIDDEN (0x00000020) // @paramdefine fHidden field is valid
#define SIM_PARAM_PBEX_GROUPIDCOUNT (0x00000040) // @paramdefine dwGroupIdCount field is valid
#define SIM_PARAM_PBEX_GROUPID (0x00000080) // @paramdefine rgdwGroupId field is valid
#define SIM_PARAM_PBEX_UID (0x00000100) // @paramdefine dwUid field is valid
#define SIM_PARAM_PBEX_ADDITIONALNUMCOUNT (0x00000200) // @paramdefine dwAdditionalNumCount field is valid
#define SIM_PARAM_PBEX_ADDITIONALNUMBERS (0x00000400) // @paramdefine lpAdditionalNumbers field is valid
#define SIM_PARAM_PBEX_EMAILCOUNT (0x00000800) // @paramdefine dwEmailCount field is valid
#define SIM_PARAM_PBEX_EMAILADDRESSES (0x00001000) // @paramdefine lpEmailAddresses field is valid
#define SIM_PARAM_PBEX_INDEX (0x00002000) // @paramdefine dwIndex field is valid
#define SIM_PARAM_PBEX_ALL (0x00003FFF) // @paramdefine All fields are valid
// -----------------------------------------------------------------------------
//
// @doc EXTERNAL
//
// @params SIMMESSAGE
//
// @comm None
//
// -----------------------------------------------------------------------------
#define SIM_PARAM_MSG_ADDRESS (0x00000001) // @paramdefine lpszAddress field is valid
#define SIM_PARAM_MSG_ADDRESS_TYPE (0x00000002) // @paramdefine dwAddressType field is valid
#define SIM_PARAM_MSG_NUMPLAN (0x00000004) // @paramdefine dwNumPlan field is valid
#define SIM_PARAM_MSG_RECEIVE_TIME (0x00000008) // @paramdefine stReceiveTime field is valid
#define SIM_PARAM_MSG_HEADER (0x00000010) // @paramdefine rgbHeader field is valid
#define SIM_PARAM_MSG_HEADER_LENGTH (0x00000020) // @paramdefine cbHdrLength field is valid
#define SIM_PARAM_MSG_MESSAGE (0x00000040) // @paramdefine lpszMessage field is valid
#define SIM_PARAM_MSG_ALL (0x0000007f) // @paramdefine All fields are valid
// -----------------------------------------------------------------------------
//
// @doc EXTERNAL
//
// @params SIMCAPS
//
// @comm None
//
// -----------------------------------------------------------------------------
#define SIM_PARAM_CAPS_PBSTORAGES (0x00000001) // @paramdefine dwPBStorages field is valid
#define SIM_PARAM_CAPS_PBEMAXADDRESSLENGTH (0x00000002) // @paramdefine dwPBEMaxAddressLength field is valid
#define SIM_PARAM_CAPS_PBEMAXTEXTLENGTH (0x00000004) // @paramdefine dwPBEMaxTextLength field is valid
#define SIM_PARAM_CAPS_PBEMININDEX (0x00000008) // @paramdefine dwMinPBIndex field is valid
#define SIM_PARAM_CAPS_PBEMAXINDEX (0x00000010) // @paramdefine dwMaxPBIndex field is valid
#define SIM_PARAM_CAPS_LOCKFACILITIES (0x00000020) // @paramdefine dwLockFacilities field is valid
#define SIM_PARAM_CAPS_LOCKINGPWDLENGTH (0x00000040) // @paramdefine dwNumLockingPwdLengths and rgLockingPwdLengths fields are valid
#define SIM_PARAM_CAPS_READMSGSTORAGES (0x00000080) // @paramdefine dwReadMsgStorages field is valid
#define SIM_PARAM_CAPS_WRITEMSGSTORAGES (0x00000100) // @paramdefine dwWriteMsgStorages field is valid
#define SIM_PARAM_CAPS_ALL (0x000001ff) // @paramdefine All fields are valid
// -----------------------------------------------------------------------------
//
// @doc EXTERNAL
//
// @params SIMPHONEBOOKCAPS
//
// @comm None
//
// -----------------------------------------------------------------------------
#define SIM_PARAM_PBCAPS_STORAGES (0x00000001) // @paramdefine dwStorages field is valid
#define SIM_PARAM_PBCAPS_MININDEX (0x00000002) // @paramdefine dwMinIndex field is valid
#define SIM_PARAM_PBCAPS_MAXINDEX (0x00000004) // @paramdefine dwMaxIndex field is valid
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -