On Jun 22, 4:50 pm, kalpesh <kalpeshge...@gmail.com> wrote:
> 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....
I found some more help on this topic that every service having some
terminal service Permissions
like..
<<< Terminal Services Permissions >>
-- Query sessions and servers for information.
-- Configure connection properties
-- View or actively control another user's session
-- Log on to a session on the server.
-- Log off a user from a session. Be aware that logging off a user
without warning can result in loss of data at the client.
-- Send a message to another user's sessions
-- Connect to another session.
-- Disconnect a session.
-- Use virtual channels. Be aware that turning off virtual channels
disables some Terminal Services features such as clipboard and printer
redirection.
-- End a session. Be aware that ending a session without warning can
result in loss of data at the client.
for more help Link-->
http://msdn2.microsoft.com/En-US/library/aa383488.aspx
Now each service is run under specific Access Accout this are:::
1) Full Access
2) User Access
3) Guest Access
Full Access have full permission, do all terminal service task while
user access have some and guest have only one which
is
Guest access allows users to:
· Log on to a session on the server.
More Info visit Link::
http://207.46.196.114/windowsserver/....mspx?mfr=true http://207.46.196.114/windowsserver/....mspx?mfr=true http://207.46.196.114/windowsserver/....mspx?mfr=true
>From this Access permission i think that my virtual printer driver DLL
run with guest access because it give access denied error for
WTSSendMessage function and also for OpenProcessToken function..
so tell me after read this message and study from the link which i
given..
After all what is the solution for My problem to show one message box
from service (My virtual printer driver DLL)..
Help me...
Thanks in Advance..