Jump to content

How ot get Phone number or Sim number in Smartphone2002?


Guest lduck

Recommended Posts

Guest lduck

Hi! :oops:

Do you know if i can get the phone number or number of Sim Card in SmartPhone2002 by using API (WinCE 3.0) or some other way(read keys in registry)?

Thanks!

Link to comment
Share on other sites

Guest spacemonkey

There is a program dbview (search this board for it) which demonstrates reading the databases on the smartphone (which I think includes number databases...) Have a look for that and see if it helps point you in the right direction. Otherwise look in the online help in the SDK. I saw some API calls the other day for access the call history, and I'm sure there's others for phone numbers.

Link to comment
Share on other sites

Guest benjymous

I think the 'POOM' stuff in the sdk is what you want to use (Pocket Outlook something something) - it should let your code interface with pocket outlook and get the data you need

Link to comment
Share on other sites

Guest fraser

Woah! Is that not a major security risk? Haven't Microsoft learned their lesson yet? User level applications should not be able to access the directory, as it makes virus writing and propagation very easy.

Most modern viruses leech your address book to find new targets to mail itself out to. It's also a serious privacy threat with the ever-growing spyware problem.

Link to comment
Share on other sites

Guest rcraswell

That's the reason behind the security model where apps have to be running in a privileged context to access certain APIs. The fact that they botched the security implementation elsewhere doesn't change the intent.

There are two different ways to get data from the SIM card (depending on what data you want.) Take a look at the SIM Manager functions (start with SimInitialize...) -- this will let you read and write data records on the SIM. Also look at the exTAPI functions, especially lineGetGeneralInfo -- this will tell you things like the phone number, the carrier, etc. Note that you may or may not actually be able to get this data from any given SIM. Note also that you must be running as a privileged app to access these functions (in the security model as deployed on an out-of-the-box Orange SPV.)

Link to comment
Share on other sites

Guest benjymous

Yeah, as far as I know, there's no way (yet) to make Pocket Outlook automatically open an attachment, so a virus would have to use the old "Photos of spacemonkey in his underwear!" rouse.

That coupled with the fact that most people don't have smartphones, and most smartphone owners won't have de-certified, I can't imagine a virus being too successful

When (If) the time comes that the majority of all phones are microsoft powered, then it'll be a much bigger problem

Link to comment
Share on other sites

Guest spacemonkey

Underwear? What's that?

Anyway, Smartphone 2002 does have a security model where privileged functions will not be accessable to user level applications. However, I think (not sure tho) user level applications can read the address book, however this won't help the virus writer because a user level application will not be able to create emails, sms's, or make calls.

Link to comment
Share on other sites

Guest lduck

Hi, All:

Thanks for your answers!

But what i want to know is not the phone numbers in phone book or SMS, but the local number in one Sim card !

Please help me!

Link to comment
Share on other sites

Guest rcraswell

For IMEI and SimSerial, use lineGetGeneralInfo which returns a LPLINEGENERALINFO. dwSubscriberNumber is the phone IMEI. The Sim card serial number is dwSerialNumber.

For phone number use lineGetAddressCaps which returns a LPLINEADDRESSCAPS. dwAddressOffset is the phone number.

Link to comment
Share on other sites

Guest lduck

Afer my test , i think subscriber number can indicate one special Sim card becase it will be different after i change the Sim card and serial number is still as same as before .

And maybe SMSGetPhoneNumber is also useful.

Thanks all of you from the bottom of my heart!

I think this issue can be closed. :)

Link to comment
Share on other sites

  • 1 year later...
Guest Sasa Popovic

Hello everyone,

I have a problem finding IMEI number on Smartphone.

Here is the source code I use to retrive IMEI number:

HRESULT hr = S_OK; 


	WCHAR buf[255]; 


	DWORD dwAPIVersion = TAPI_CURRENT_VERSION; 


	LINEINITIALIZEEXPARAMS liparams; 




	liparams.dwTotalSize = sizeof(LINEINITIALIZEEXPARAMS); 


	liparams.dwNeededSize = 0; 


	liparams.dwUsedSize = 0; 


	liparams.dwOptions = LINEINITIALIZEEXOPTION_USEEVENT; 


	liparams.Handles.hEvent = 0; 


	liparams.dwCompletionKey = 0; 




	hr = lineInitializeEx(&m_hLineApp, NULL, NULL, L"MyPhone", &m_dwDeviceCount, &dwAPIVersion, &liparams); 




	hr = lineOpen(m_hLineApp, i, &m_hTestLine, dwAPIVersion, 0, NULL, LINECALLPRIVILEGE_NONE, LINEMEDIAMODE_DATAMODEM, NULL); 




	LINEGENERALINFO  lpLineGeneralInfo;


	memset(lpLineGeneralInfo, 0, sizeof(LINEGENERALINFO));




	hr = lineGetGeneralInfo(m_hTestLine, &lpLineGeneralInfo);
After the call to "lineGetGeneralInfo", I always get: "LINEERR_INVALPOINTER" error code. Am I doing something wrong? I also tried this (insted of last 3 lines of code):
LPLINEGENERALINFO  lpLineGeneralInfo = new LINEGENERALINFO;




	hr = lineGetGeneralInfo(m_hTestLine, lpLineGeneralInfo);

I would apreciate any help.

Thanks in advance,

Sasa

Link to comment
Share on other sites

Guest rcraswell

you'll want to initialize the LINEGENERALINFO structure.

LINEGENERALINFO  lpLineGeneralInfo; 



memset(lpLineGeneralInfo, 0, sizeof(LINEGENERALINFO));

lpLineGeneralInfo.dwTotalSize = sizeof(lpLineGeneralInfo);



hr = lineGetGeneralInfo(m_hTestLine, &lpLineGeneralInfo);[/code]

Hope that helps.

Link to comment
Share on other sites

Guest Sasa Popovic

Thank you for such a fast answer!

I tried that and the lpLineGeneralInfo.dwTotalSize was filled with a value 52 (13 x 4 bytes).

After that I got error code: "LINEERR_OPERATIONUNAVAIL".

I tried this on a Smartphone emulator but don't have a device right now.

Have I got that error message because I started that application on emulator?

Thanks again,

Sasa

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.