call SMS functions from driver

pocket pc

    Next

  • 1. lineGetGeneralInfo returns LINEERR_OPERATIONUNAVAIL
    Hi. I am working with WM5 phone edition to get IMEI of it. I found some articles mentioning lineGetGeneralInfo to get IMEI, so I did. But it returns LINEERR_OPERATIONUNAVAIL error. Every article I found say that it is the certificate problem since the API is priviliged, but I have signed my app properly as trusted app. So I don't think this is the problem. My guess is.. The phone function is on, but actually this device is not active. I mean, it is not in flight mode but not registered at carriers. Does that affects? I think I've read that IMEI can be changed by carrier, but I can't recall where I read it. And it is CDMA device. MSDN says some of lineGetGeneralInfo can be limited for CDMA devices, so I suspect that, too. Above are all I can imagine. Does anyone help me to find out? Thank you. With BR, Daniel Kim

call SMS functions from driver

Postby Avex » Wed, 23 Nov 2005 12:20:38 GMT

Hi All,

Can I use SMS functions(smsopen, SendSmsMessage...) in my driver? I am 
developing a driver, I called sms functions from my driver, however it 
return the fail code - 120 which means

      120 This function is not valid on this platform. 
ERROR_CALL_NOT_IMPLEMENTED


The the functions I called in a normal application, it works fine. Can 
anyone tell me whether I can not use SMS function calls in driver?

-- 
Avex 



Re: call SMS functions from driver

Postby Michael J. Salamone » Wed, 23 Nov 2005 23:21:17 GMT

Sms messages are supposed to return HRESULTs, not Win32 error codes.  Are 
you getting E_NOTIMPL?  If you are really getting 
ERROR_CALL_NOT_IMPLEMENTED, are you getting it as a return code from 
SmsOpen/SendMessage, or by calling GetLastError?  If calling GetLastError, 
you shouldn't be calling that.

S_OK (0) indicates success.  Other HRESULTs should indicate the specific 
error (don't call GetLastError).

Is it SmsOpen or SmsSendMessage that is failing?

Are you getting SMS_E_RECEIVEHANDLEALREADYOPEN from SmsOpen?  In device.exe 
space, there may already be a driver that has it open.  I think the MS Sms 
receiver is in a different process, but I'm not certain about that.

-- 
Michael Salamone [eMVP]
Entrek Software, Inc.
www.entrek.com









Re: call SMS functions from driver

Postby Avex » Thu, 24 Nov 2005 11:24:40 GMT


I work on 'Dopod 818' pocket pc phone which has SMS functions 
supported(sms.dll). On
this device I wrote an SMS application, it runs well. However, the same SMS 
function I used cannot be run in my driver application.

The error code SmsOpen gived is  E_FAIL(80004005), I use GetLastError it 
returns ERROR_INVALID_HANDLE(6)  and ERROR_CALL_NOT_IMPLEMENTED(120).

What does it mean E_FAIL?


No,
Everytime I am going to try my driver, I tried a normal SMS application 
which I wrote to ensure that SMS is not occupied and close it before trying 
my driver.

I just want to ensure that whether if I can use SMS functions in driver?






Re: call SMS functions from driver

Postby Michael J. Salamone » Thu, 24 Nov 2005 13:12:36 GMT

Again, don't call GetLastError().  It is incorrect to do so, and the code it 
returns does not relate to the call to SmsOpen.

Read the doc about SMS_E_RECEVEHANDLEALREADYOPEN.  It says SmsOpen will 
succeed the first time called in each process, so you open multiple times 
from multiple processes.  But only one time in each process.  Since you are 
a driver and presumably loaded into device.exe, it is possible that another 
driver (an MS driver?) already called SmsOpen in that process.  Subsequent 
attempts to open would fail.

E_FAIL is a general error that is not at all informative.  It means an error 
occured, but it conveys no clue as to what the error is.  It should be 
banned from use (it should have never been invented).  It's unbelievable to 
me that it's still in use.

-- 
Michael Salamone [eMVP]
Entrek Software, Inc.
www.entrek.com









Re: call SMS functions from driver

Postby Avex » Thu, 24 Nov 2005 15:15:45 GMT


I have already check SMS_E_RECEVEHANDLEALREADYOPEN for SmsOpen, however it 
never happened.

 hr = SmsOpen (SMS_MSGTYPE_TEXT, SMS_MODE_RECEIVE, &smshHandle, 
&hReadEvent);
 if (hr == SMS_E_RECEIVEHANDLEALREADYOPEN)
 {
    ....  // never came into this subroutine
 }
 else if (hr != ERROR_SUCCESS)
 {
   ....
 }


I can't have enough information about E_FAIL, hence I guess there should be 
something I need when using SMS in driver. The same function works well in 
applications I wrote.




Similar Threads:

1.call SMS functions from driver

Can I use SMS functions(smsopen, SendSmsMessage...) in my driver? I am
developing a driver, I called sms functions from my driver, however it
return the fail code - 120 which means

      120 This function is not valid on this platform.
ERROR_CALL_NOT_IMPLEMENTED


The the functions I called in a normal application, it works fine. Can
anyone tell me whether I can not use SMS function calls in driver?



2.SQLDriverConnect ODBC function call to SQL Server causes access violation

Calling SQLDriverConnect odbc function from my ISAPI filter causes
access violation. Here is the code i'm using to call the
SQLDriverConnect. Getting the connection handle, setting the
environment attribute(3.x) works fine.

SQLRETURN  rc;
SQLCHAR connString[800];
SQLCHAR connStrOut[1025];
SQLSMALLINT cbConnString;

strcpy(connString,"Provider=sqloledb;Driver=SQL
Server;Server=myServer;Database=myDB;UID=myUID;PWD=myPWD")
 
rc = SQLDriverConnect(hDBC, (SQLHWND) NULL, connString, SQL_NTS,
connStrOut, 1024, &cbConnString, SQL_DRIVER_NOPROMPT );

The problem is the call works fine for one user at a time. But if i
stress test my isapi application with multiple users accessing at the
same time i get the access violation error.

I have tried the varying version of SQLDriverConnect but to no avail.

i.e 
rc = SQLDriverConnect(hDBC, (SQLHWND) NULL, connString, SQL_NTS, NULL,
0, NULL, SQL_DRIVER_NOPROMPT );

Please let me know if it is anything i'm doing wrong or is it a buffer
overflow bug in SQL Server.

Thanks In Advance,
Niraj.

3.Calling WdfDpcEnqueue() inside EvtDpcFunc() function

Is it possible to include WdfDpcEnqueue() function inside EvtDpcFunc()??
Where EvtDpcFunc() is the dpc objects callback function.

Ex:I want to queue request in DPC B from DPC A's callback routine....!!!!

4.Calling inf file or installing .sys file from DriverEntry function

Hi ALL,
I am installing a new driver through INF file. I inserted my card into USB 
and it ask me for path for INF file. I browse the the inf file and it calls 
DriverEntry function of my sys file ( correct me if am wrong)
                 Now from this DriverEntry function i want to install 
another sys file or want to call INF file passing my own hardware ID to INF 
file. Can you tell me if this is possible?. Is there any way through which i 
can 
load/install .sys files from another sys file (lets say from DriverEntry 
Function of another sys file).

I appreciate for any kind of inputs.

Regards
Wanni.

5.do not use CM_xxx function call

Hi,

I need to discover and know the scsi disk enclosure port/bus/target/LUN 
numbers. I read some MSDN sample and learn how to enumerate them and can find 
the disk enclosures attached to my Windows 2003 x64 server. And I use the 
CM_Get_DevNode_Registry_Property to get the bus/target/LUN of the enclosure, 
but I could not get the scsi port number. And MSDN mentioned "Do not use..." 
the CM_ function I used and suggest to use SetupDixxx instead. But they 
require different input parameters: CM_xxx use "handle of device instance" 
while SetupDixxx use "handle of device infoset" and "device info data" I 
think.  May someone hint me how to get the parameters used in SetupDixxx from 
the CM_xx device instance handle? Also how to get the scsi port number please?

Thanks,

Ken

6. Spooler hangs when StartPage() function is called from application

7. what stop the MiniportHalt function to be called?

8. problem in calling startdocport function of usbmon.dll



Return to pocket pc

 

Who is online

Users browsing this forum: No registered users and 56 guest