Currently I have a windows service written in C# (running as LocalSystem) which creates a user account, needed for impersonation, by using the DirectoryEntry to add the user/password and associated UserFlags. Then it simply uses this account to perform some tasks (using impersonation) using the...
Is there a way to force a logoff (knowing this is not recommended) of the current interactive (logged-on) user and then login with a new user account (interactive - not using stuff like LogonUser and other impersonation tricks) to simulate someone physically pressing LOGOFF and then selecting a...
I have a tool which I use to programmatically create local user accounts as follows:
DirectoryEntry NewUser = dirEntryLocalMachine.Children.Add("UserName", "user");
NewUser.Invoke("SetPassword", new object[] { "Passsord" });
NewUser.Invoke("Put", new object[] { "Description"...
My system has 2 accounts (USER and ADMIN) and a service (Service.exe) running under LocalSystem.
The user logs into the USER account, the LocalService can then launch a process (CreateProcessAsUser(...)) as the ADMIN user.
The process the Service runs (Tool.exe) is a legacy C++ application that...
I need to find a reliable way to update a running Windows Service (Service.exe).
The service is run under the LocalSystem account whereas the logged-in user is in a non-admin User account.
My current solution would be as follows:
- The Service.exe checks for updates (files) regularily
- When an...
At my company we have a product which pretty much interacts with everything you can imagine... registry, databases, devices, etc... it is composed of many parts but the entire application is launched by a single executable (start.exe) which is responsbile for launching everything else - this is...
There is a LocalSystem Service (Job.exe) which performs a certain absolutly required task (for example: file system watching), this service is run for all users (at least when they logon).
There is another LocalSystem Service (Serv.exe) which uses CreateProcessAsUser(...) to launch a process as...
I have a class (NamedPipeManager) which has a thread (PipeThread) that waits for a NamedPipe connection using (ConnectNamedPipe) and then reads (ReadFile) - these are blocking calls (not-overlapped) - however there comes a point when I want to unblock them - for example when the calling class...
I am using Named Pipes to transfer data from a client (C++) to a server (C#), the client does the following:
struct MESSAGE
{
char cCommand[8];
string sParameter;
};
MESSAGE msg;
strcpy(msg.cCommand, "COMMAND");
strcpy(msg.sParameter, "DO SOMETHING");
DWORD dwWrote = 0...
I have a created a C# windows service (Serv.exe) which is responsible for performing various tasks at the request of a running application (A.exe), some of these can take long periods of time and I need a way to know the status of my requested operation (running on the service) from the calling...
Currently I have 2 applications that reside on the same system (local applications) that need to communicate. One is a C++ program that already uses mailslots to communicate with other system (remote) and the other is a new C# service I have just written.
Given that the C++ application is...
I have a little situation that I can't seem to resolve and was hoping someone might have some suggestions ...
I have a Windows Service (Serv.exe) which runs under LocalSystem when a user is logged-on (it is only running when users are logged-on), this service is responsible for performing...
Currently I have an application (A.exe) which determines when things need to be done, when such a time arises it launches another application (B.exe) with the appropriate parameters to do the actual work required, some of which could be administrative work (installing MSI, editing registry...
I am trying to customize my sorting of a LIST using a compare_function, but for some odd reason it keeps giving me the following error:
error C2064: term does not evaluate to a function taking 2 arguments
Specifically, I have list created within class B which needs to be sorted, the list...
I'm having an issue using my operator<< overload, I am creating a pointer to a ClassA and storing it in a list, then I get the pointer out of my list using an iterator and when I try to cout << (*iterator) I get the address itself, I don't get the actual operator<< overload to execute ...
This...
The age old issue of string parsing comes up again ...
I have a text file that contains lines that are SUPPOSED to follow a set format, specifically:
string, string, long string int string double int
The delimiters are therefore:
Comma (,) for the first two fields
Spaces for all other fields...
Not sure this is going to be easy to explain but ...
I have a class (A) that needs to have access to a map (mapCodes), this map is the same for all instances of class(A), therefore I don't want to create an instance of the map for each instance of class A and populate it, etc ....
This is my...
I'm trying to declare a std::map that is keyed by a char and has a function pointer as a second parameter, these functions would be a member function of my class. But for some odd reason I cannot call the functions when extracted...
So, I have a class A as shown below, it contains a map as well...
I want to pass an object by reference into a function (of another class), can this be done without causing a memory leak or requiring me to perform a delete?
Allow me to illustrate what I mean ...
class A
{
vector<B*> v; // vector of pointers to Class B objects
void Add(B &b) // function to...
Is there a way, using CIN, to block users from entering non-digit characters?
For example - I am prompting for the user to enter the Width of a box, obvious the response "abc" is not going to work ... aside from validating (getline(...) and return an error message) is there a way to simply block...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.