Re: call SMS functions from driver



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


"Avex" <Spammer@xxxxxxxxxxx> wrote in message
news:dm0jt7$ag7$2@xxxxxxxxxxxxxxxxxxxx
>
>> 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.
>
> 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?
>
>> 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.
>
> 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?
>
>
>
>
>


.



Relevant Pages

  • Re: call SMS functions from driver
    ... > Sms messages are supposed to return HRESULTs, ... > SmsOpen/SendMessage, or by calling GetLastError? ... If calling GetLastError, ... there may already be a driver that has it open. ...
    (microsoft.public.pocketpc.developer)
  • Re: Wierd Visual Problem in all my office apps
    ... Having gone through every device on my device manager i can find no mention ... have a mirror driver anyway. ... It was caused by Windows defaulting to the SMS Mirror Driver ... Steve Rindsberg, PPT MVP ...
    (microsoft.public.office.misc)
  • Re: Wierd Visual Problem in all my office apps
    ... Having gone through every device on my device manager i can find no mention ... have a mirror driver anyway. ... The two things different on my PC since my old install of windows is i am ... It was caused by Windows defaulting to the SMS Mirror Driver ...
    (microsoft.public.office.misc)
  • Re: Image pushing failing after minint folder has been installed.
    ... Initially I did have that problem but once I pointed the package to the ... like windows PE doesn't have the correct driver. ... nic driver to the following folders in the Customwinpe folder in my sms ...
    (microsoft.public.sms.tools)
  • Re: How to use SMS in kernel mode ?
    ... I don't know what is behind the SMS and SmsOpen, ... Stream drivers don't run in kernel mode ... You can call whatever You want from the driver code, ... I am writing a "Virtual COM Port to SMS" driver which creates ...
    (microsoft.public.windowsce.platbuilder)