Discussion:
RpcImpersonateClient() returns 1725(RPC_S_NO_CALL_ACTIVE)
(too old to reply)
Rohan Shetty
2014-07-09 11:02:17 UTC
Permalink
Hi,

Even I wanted to support user based tsp, and after going through couple of articles I have found that RpcImpersonateClient() is the only way to get the "current loggedin user"

RpcImpersonateClient() seems to be working fine if it is placed in the functions which are directly invoked by the TAPI application.
For instance it works in TSPI_lineMakeCall

I have implemented a thread, in which I would come to know the user switch(i.e WTSWaitSystemEvent), and during the user switch I would need to get some information about the "current user"
In this thread if I call RpcImpersonateClient(), it always returns an error(1725 which means RPC_S_NO_CALL_ACTIVE).

Question:
So,I was thinking of the following solution
- In the thread, I would invoke lpfnEventProc(which was passed to us as part of TSPI_lineOpen) along with some parameters, so that TAPI would invoke one of the functions say TSPI_lineGetLineDevStatus(and in I could write RpcImpersonateClient)

I am not sure whether TSPI_lineGetLineDevStatus is the right function, may be you could suggest a proper one.

Or is there some function which would be called by the TAPI application in regular intervals?

Experts, can you please help with the above?

Regards,
Rohan
Andreas Marschall [exMVP TAPI]
2014-09-04 11:35:26 UTC
Permalink
Post by Rohan Shetty
RpcImpersonateClient() seems to be working fine if it is placed in the functions which are directly invoked by the TAPI application.
For instance it works in TSPI_lineMakeCall
I have implemented a thread, in which I would come to know the user switch(i.e WTSWaitSystemEvent), and during the user switch I would need to get some information about the "current user"
In this thread if I call RpcImpersonateClient(), it always returns an error(1725 which means RPC_S_NO_CALL_ACTIVE).
So,I was thinking of the following solution
- In the thread, I would invoke lpfnEventProc(which was passed to us as part of TSPI_lineOpen) along with some parameters, so that TAPI would invoke one of the functions say TSPI_lineGetLineDevStatus(and in I could write RpcImpersonateClient)
I am not sure whether TSPI_lineGetLineDevStatus is the right function, may be you could suggest a proper one.
Rohan,
do I understand it correctly. you are already detecting logged on user changes from within your TSP and want to determine the new user?

For this you may wamt to try firing a LINE_LINEDEVSTATE(LINEDEVSTATE_REINIT) via TSPI.
And then do your RpcImpersonateClient() as usual.
--
Best Regards
Andreas Marschall
Microsoft MVP for TAPI / Windows SDK
TAPI / TSP Developer and Tester
My TAPI and TSPI FAQ:
http://www.I-B-A-M.de/Andreas_Marschall's_TAPI_and_TSPI_FAQ.htm
My Toto® Tools (a collection of free, mostly TAPI related tools):
http://www.i-b-a-m.de/Andreas_Marschall's_Toto_Tools.htm
TAPI development around the world (Frappr! map):
http://www.frappr.com/TAPIaroundTheWorld
* Please post all messages and replies to the newsgroup so all may
* benefit from the discussion. Private mail is usually not replied to.
* This posting is provided "AS IS" with no warranties, and confers no rights.
Loading...