Have you had progress? I think I see now what you are trying to do. You want to send the LINE_CREATEDIALOGINSTANCE in response to a TSPI_lineMakeCall command in order to find out which user is requesting the makecall. Is that correct?
If so, I think you should still handle one problem at the time. If you could momentarily assume the user info and process the makecall request you would still have to solve the invalid typecast first. In order to solve this look at what you will the linehandle with at the TSPI_lineOpen code. In the MakeCall function you only get back what you provided the Telephony Service with in the third parameter of the TSPI_lineOpen
Parameters
dwDeviceID Identifies the line device to be opened.
htLine The TAPI handle for the line device to be used in subsequent calls to the LINEEVENT callback procedure to identify the device.
lphdLine A pointer to an HDRVLINE where the service provider fills in its handle for the line device.
dwTSPIVersion The TSPI version.
lpfnEventProc A pointer to the LINEEVENT callback procedure supplied by TAPI that the service provider calls to report subsequent events on the line.
If that works correctly please look at the string pointer you put in the lParams struct. Is that scope correct? I would create a static string and point the variable to that like this
static WCHAR szUIDLLName[] = L"TSP_ATSPMod.tsp";
lParams->lpszUIDLLName = szUIDLLName;
Third and finally, I am confused about how you call the callback function. According to the LINE_CREATEDIALOGINSTANCE documentation you are correct. However if you look at the Line_Event callback function the last three params should really be DWORD_PTR which make sense if you want to compile for 64 bit.
This all is really more comment than answer. Please let me know if any of it makes sense. This solution to the differing context process of the user and the TSP is new to me and I would love to make it work for you because I will probably be wanting to use it to some day.