|
Mike Curry - Canada wrote: Is it possible to re-associate a socket with a different io completion
port?
I don't believe so. The only way to disassociate a handle from an IO completion port is to close it.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I have a non interactive service running under a local account. This service starts a process in each desktop by locating instances of explorer.exe then creating a primary token and calling CreateProcessAsUser using that token. Is there a way to get the desktop i.e. winsta0\default for the process I am goint to impersonate?
modified on Thursday, June 19, 2008 7:06 PM
|
|
|
|
|
rcardare wrote: by locating instances of explorer.exe then creating a primary token
That sounds interesting but I don't know what it means, could you be more specific?
led mike
|
|
|
|
|
I have a program running as a system service using the local system account (non interactive). This service then starts and monitors processes running interactively in the users desktop. I detect when a new user has logged in by monitoring instances of the explorer.exe and session id’s. When I have a new explorer.exe, I then impersonate the logged in user by getting the process token for explorer.exe process (OpenProcessToken) and creating a primary impersonation token (DuplicateTokenEx). Once I have the token I start the process that interacts with the user using CreateProcessAsUser and supply the token. The problem I would like to solve is setting the lpDesktop field to a proper value in the STARTUPINFO structure. I would like to get the windows station that is used for the explorer.exe process that I am impersonating. The satellite processes then communicate with the service through pipes which relays messages. I know starting the client process this way is not the best and will break post vista but I need a reliable way to keep the client processes running without having multiple processes monitoring for each desktop session. Any other ideas would be great... This has worked fine on windows server 2000 and XP which is in our production environment but when I moved this to windows 2003 I kept getting a parameter incorrect exception. I am reviewing the code and trying to set the values for what is knows to try and eliminate the error.
|
|
|
|
|
Thanks, that answers my question.
Now to dig in more to your question:
rcardare wrote: This service starts a process in each desktop
"in each desktop"? Does this mean you are working with multiple desktop sessions on the server using Terminal Services. If so you probably want to use the Terminal Services API[^]
led mike
|
|
|
|
|
The interactive window station, Winsta0, is the only window station that can display a user interface or receive user input. It is assigned to the logon session of the interactive user, and contains the keyboard, mouse, and display device. All other window stations are noninteractive, which means they cannot display a user interface or receive user input.
|
|
|
|
|
rcardare wrote: Is there a way to get the desktop i.e. winsta0\default for the process I am goint to impersonate?
Some window station functions are given here ->
http://msdn.microsoft.com/en-us/library/ms687107(VS.85).aspx[^]
Does these help... GetProcessWindowStation , EnumWindowStations .
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
Has anyone used this control?
I'm working on a MDI application that has toolbars in both the MainFrame and the ChildFrame. I want to use large images ( 32x32 ) in the ChildFrame while using normal ( 16x16) in the MainFrame. When I try to do this the MainFrame ToolBar gets mangled, graowing larger and showing some of its images as well as some un-wanted ChildFrame images.
=======================================================
//MainFrame.cpp
const DWORD dwTBStyle = TBSTYLE_FLAT ;
const DWORD dwWndStyle = WS_CHILD | WS_VISIBLE | CBRS_TOP /*| CBRS_GRIPPER*/ | CBRS_TOOLTIPS | CBRS_FLYBY /*| CBRS_SIZE_DYNAMIC*/ ;
if ( !m_wndToolBar.CreateEx(this, dwTBStyle, dwWndStyle) || ! m_wndToolBar.LoadToolBar(IDR_MAINFRAME) )
{
TRACE0( __LOC__ "Failed to create toolbar" ) ;
return( -1 ) ;
}
const CString strMainToolbarTitle( (LPCTSTR)IDS_MAIN_TOOLBAR ) ;
m_wndToolBar.SetWindowText( strMainToolbarTitle ) ;
m_wndToolBar.EnableDocking( CBRS_ALIGN_ANY ) ;
//ChildFrame.cpp
const DWORD dwTBStyle = TBSTYLE_FLAT ;
const DWORD dwWndStyle = WS_CHILD | WS_VISIBLE | CBRS_TOP /*| CBRS_GRIPPER*/ | CBRS_TOOLTIPS | CBRS_FLYBY /*| CBRS_SIZE_DYNAMIC*/ ;
if ( !m_wndSectionBar.CreateEx(this, dwTBStyle, dwWndStyle) ||
!m_wndSectionBar.LoadToolBar( IDR_JOB2) ||
!m_wndSectionBar.SetButtons( HJobButtons, sizeof(HJobButtons) / sizeof(UINT) )
)
|
|
|
|
|
|
"static text"? What does that mean?
led mike
|
|
|
|
|
Its a control on which we put text
|
|
|
|
|
sumit.durg wrote: Its a control
If you mean a Windows control then:
sumit.durg wrote: In ATL
the fact that your using ATL does nothing to change how you change the Font of the Windows Control[^].
led mike
|
|
|
|
|
change the ID of that control...
create a control variable for that ...
now use that variable to change the text ...
|
|
|
|
|
Hi all,
Please anyone can tell me how can i add userID and Password function in SDI type application in VC++ 2005.
I m waiting for your valuable suggestions.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Can you more explain what do you want to do? make a new dialog for password and username or other thing?
|
|
|
|
|
yes sir,
i want use UserId and password function before starting the application.
according to this user or admin can use the application.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
So you need to make a dialogbox with two editboxs for get username and password (dont forget to set password on the property window of editbox that you need to get password).
|
|
|
|
|
_$h@nky_ wrote: Please anyone can tell me how can i add userID and Password function ...
In the same way as you would any other function(s). What trouble are you having?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
i dont understand please tell me with example.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Create a dialog with two edit fields to read userid and password.
validate this input. If success and allow him to proceed or exit the appln with some warning.
|
|
|
|
|
You don't understand how to add functions to a program? It's just basic C stuff.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
no this is not a problem,i m little confused at thet time.now i understand.
i know how can add function.
Anyways thanks sir now its working.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Hi all.
How i can compare two xml file...
thank you
manju
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
What kind of comparison should you perform?
manju#123 wrote: Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
Possibly is Looking.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
CPallini wrote: I am Mnaju
There is a typo in her name itself!
-Saurabh
|
|
|
|