Search results

  1. S

    How to prevent user from logon of an account used for impersonation only? [C#]

    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...
  2. S

    How to programatically Logoff interactive user and Logon as another [C#]

    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...
  3. S

    LoadUserProfile not creating local user profile when it does not exist [C#]

    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"...
  4. S

    CreateProcessAsUser() not showing CreateWindow of running Process [C#]

    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...
  5. S

    Is the best way to update a running Service by using another service? [C#]

    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...
  6. S

    Run prog using LocalSystem Service CreateProcessAsUser or click on desktop icon? [C#]

    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...
  7. S

    Service not running for Impersonated user with CreateProcessAsUser [C#]

    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...
  8. S

    How to unblock ConnectNamedPipe and ReadFile? [C#]

    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...
  9. S

    How to rebuild a struct from bytes after transfer [C#]

    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...
  10. S

    How to get a Windows Service custom Status? [C++/C#]

    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...
  11. S

    Need to use 2 Mailslots to communicate between local applications? [C++ & C#]

    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...
  12. S

    Finding a way to access CURRENT_USER registry as a LocalSystem Service [C#]

    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...
  13. S

    Communication between running application and service [C++]

    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...
  14. S

    List.Sort(compare_function) - term does not evaluate to a function taking 2 arguments

    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...
  15. S

    Why my operator<< overload doesn't work and prints out a memory location? [C++]

    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...
  16. S

    String Parsing using known delimiters? [C++]

    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...
  17. S

    How to create a static map that is only loaded once? [C++]

    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...
  18. S

    How to call a class member function via function pointer in map [C++]

    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...
  19. S

    Can I pass a NEW object into a function by-ref & without a delete? [C++]

    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...
  20. S

    Block users from typing non-digits CIN [C++]

    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...
Top Bottom