WTSSendMessage fail with error Access Denied ON Window VISTA



i describe my Issue that i am developing virtual printer driver DLL
which is run by
spooler service of operation system, means my driver is run under
spooler service.

Now i need to show one MessageBox from my this DLL in Window vista
but
vista not support any user interface from service thats why i use
this
WTSSendMessage function but this function give me error "ACCESS
DENIED"...


//Code i used


#define WTS_CURRENT_SERVER ((HANDLE)NULL)
#define WTS_CURRENT_SERVER_HANDLE ((HANDLE)NULL)
#define WTS_CURRENT_SERVER_NAME (NULL)


#define WTS_CURRENT_SESSION ((DWORD)-1)


//defination of WTSSendmessage Function pointer
typedef BOOL (*funPtr) ( HANDLE,
DWORD,
LPWSTR,
DWORD, LPWSTR, DWORD, DWORD, DWORD, DWORD*,
BOOL);


funPtr callFun;
HMODULE hModule = LoadLibrary(L"Wtsapi32.dll");
if(hModule)
{
callFun = (funPtr) GetProcAddress(hModule, "WTSSendMessageW");
if(callFun) {
DWORD result;
BOOL ret =
callFun( WTS_CURRENT_SERVER_HANDLE,


WTS_CURRENT_SESSION,


(LPWSTR)L"Thunder Driver",
38,
MB_OK,
FALSE,
&result,
0);


if(!ret) {
Print_Error();
}


}//end getproc
}//end loadlibrary


function return with "Error : Access Denied";;
WTSSendmesage function fail
and return with error "ACCESS DENIED".


This function failed is happening on Window vista only,
One more thing is this same code is running successfully On Window XP
means i think that
there is some problem arise due to Vista securtiy...


So please help me ....
Thanks in Advance....

.



Relevant Pages

  • WTSSendMessage fail with error Access Denied
    ... i describe my Issue that i am developing virtual printer driver DLL ... spooler service of operation system, means my driver is run under ... Now i need to show one MessageBox from my this DLL in Window vista ... WTSSendMessage function but this function give me error "ACCESS ...
    (microsoft.public.win32.programmer.kernel)
  • Re: WTSSendMessage fail with error Access Denied
    ... If you're a service then you're running in session 0, and the user is running in some other session. ... Now i need to show one MessageBox from my this DLL in Window vista ... WTSSendMessage function but this function give me error "ACCESS ... L"Thunder Driver", ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Printing issues
    ... thin clients are running RCP 5.1 and an upgrade is not available yet. ... Microsoft MVP - Terminal Services ... I agree on the printer driver issue. ... and general communication issues with the spooler service. ...
    (microsoft.public.windows.terminal_services)
  • Re: WTSsendMessage not compile in DDK
    ... If the spooler runs in session 0, ... So if i want to use this Function in my driver and build from DDK ... Now i am using this WTSSendmessage function from loading ... This function failed is happening on Window vista, ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Track Down Print Job Crashing Spooler
    ... Since I am also developing printer drivers, I am also interested in any ... > The driver developers like my process since once I have the offending file ... >> Periodically a specific print job will crash the spooler service. ...
    (microsoft.public.win2000.printing)