![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Vista service - session 0 isolation I'm having a problem with a windows service running on a Vista client. Situation: A windows service running as LocalSystem hosts a .net remoting object. When some event raises then the service starts a process. That process is a windows forms applicatation. That process must run under the LocalSystem account because it needs some (local)admin privileges. Under XP we used the "interact with desktop" functionality to show the forms application. With Vista (Session 0 Isolation) this is no longer possible. Anyone some advice about this? Kind regards, Gene |
My System Specs![]() |
| | #2 (permalink) |
| | RE: Vista service - session 0 isolation You need to rearchitect your application and factor the UI piece into an interactive program. Then you can use LPC to communicate between that and the service. This book will tell you how: http://www.amazon.com/Writing-Secure...6841908&sr=1-2 --- Your question may already be answered in Windows Vista Security: http://www.amazon.com/gp/product/047...otectyourwi-20 "Gene Vangampelaere" wrote: > I'm having a problem with a windows service running on a Vista client. > Situation: > A windows service running as LocalSystem hosts a .net remoting object. When > some event raises then the service starts a process. That process is a > windows forms applicatation. That process must run under the LocalSystem > account because it needs some (local)admin privileges. Under XP we used the > "interact with desktop" functionality to show the forms application. With > Vista (Session 0 Isolation) this is no longer possible. Anyone some advice > about this? > > > Kind regards, > > Gene > > > > > > > |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Vista service - session 0 isolation Gene Vangampelaere wrote: > I'm having a problem with a windows service running on a Vista client. > Situation: > A windows service running as LocalSystem hosts a .net remoting object. > When some event raises then the service starts a process. That process is > a windows forms applicatation. That process must run under the LocalSystem > account because it needs some (local)admin privileges. Under XP we used > the "interact with desktop" functionality to show the forms application. > With Vista (Session 0 Isolation) this is no longer possible. Anyone some > advice about this? > If a service running as LocalSystem really wants to run a process as LocalSystem on a user desktop in a Terminal Services session other than 0, it is esay to do. I have code to do that, which uses the following sequence of calls. The code below is modified somewhat from my working code to simplify it, and I have not actually compiled or run it, but it should give you the general idea. You need to add code to set sessionID to the user's Terminal Services session ID, and to declare commandLine and set it to the command to be executed. STARTUPINFO si; PROCESS_INFORMATION pi; HANDLE hToken = NULL; HANDLE hPrimaryToken = NULL; DWORD dwSize; DWORD sessionID; .. .. .. if (ImpersonateSelf(SecurityImpersonation)) { if (OpenThreadToken(GetCurrentThread(), TOKEN_ALL_ACCESS, FALSE, &hToken)) { dwSize = sizeof sessionID; if (SetTokenInformation(hToken, TokenSessionId, &sessionID, dwSize)) { if (DuplicateTokenEx(hToken, MAXIMUM_ALLOWED, NULL, SecurityImpersonation, TokenPrimary, &hPrimaryToken)) { ZeroMemory(&pi, sizeof pi); ZeroMemory(&si, sizeof si); si.cb = sizeof(STARTUPINFO); si.lpDesktop = "winsta0\\default"; if (CreateProcessAsUser(hPrimaryToken, NULL, commandLine, NULL, NULL, FALSE, CREATE_NEW_CONSOLE, NULL, NULL, &si, &pi)) { CloseHandle(pi.hThread); CloseHandle(pi.hProcess); } CloseHandle(hPrimaryToken); } } CloseHandle(hToken); } RevertToSelf(); } -- Larry Futrell |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Local Session Manager Service | General Discussion | |||
| Error in service user profile in session initialization - Cannot l | Vista General | |||
| Terminal Service session slow on Vista for just one server | Vista General | |||
| Vista service - session 0 isolation | Vista General | |||
| Local Session Manager Service - Excessive Handle Count? | Vista General | |||