General Programming |
Author |
Message |
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Thu Sep 07, 2006 6:40 pm Post subject: Services & Processes |
|
|
Basic Win32 Service Control Code
"I need to be able to do basic windows service control remotely (start,
stop, restart...) Does anybody have any simple source for this?"
***
There's a book on the subject: "Win32 System Services: The Heart of
Windows 98 and Windows 2000, 3rd Edition", by Marshall Brain, Ron
Reeves, published by Prentice Hall and I need to find it somehow!
Last edited by delovski on Sat Sep 23, 2006 7:24 pm; edited 3 times in total |
|
Back to top |
|
|
Guest
|
Posted: Fri Sep 15, 2006 11:49 pm Post subject: |
|
|
At JoS: Which temp folder?
"GetTempPath() is safer if your component may be used without an
interactive user session (i.e., in a Windows service)." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
|
Back to top |
|
|
Guest
|
Posted: Tue Sep 26, 2006 6:03 pm Post subject: |
|
|
MSDN: Dynamic Data Exchange
"DDE is most appropriate for data exchanges that do not require ongoing
user interaction. Usually, an application provides a method for the user to
establish the link between the applications exchanging data. Once that link
is established, however, the applications exchange data without further user
involvement."
Raymond Chen: Isn't DDE all asynchronous anyway?
"In particular, it is important for the client to know whether there are
any servers out there at all, because the way the shell interprets DDE-
based file associations is first to attempt a WM_DDE_INITIATE with the
application and topic specified in the registration. If no server is found,
then it launches the server manually and then tries to connect to the
server via DDE a second time." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Tue Dec 05, 2006 8:41 pm Post subject: |
|
|
Same person:
Loading a windows service?
"But, I can't get it to show up the Services list - i.e. I don't know how to LOAD
the service. So, how do I get the service loaded?"
Delete a Legacy Service?
"Other things I am finding out about services:
* SCM does not auto-refresh (have to click refresh button)
* The Interactive property/parameter is required for plain localhost use.
* The StartName property/parameter is the user ACCOUNT name (required with
pwd if not localhost.) " |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Wed Dec 06, 2006 6:49 pm Post subject: |
|
|
C Board: Get info about a proccess
"How can I get the following information on a proccess?:
CPU Usage
Memory Usage
Memory Usage Delta
USER Objects
Virtual Memory Size
etc." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Fri Dec 08, 2006 10:01 am Post subject: |
|
|
C Board: App to run as service and normal process
"WinMain or main entrypoints are not relevant (either can be used) if your
service does not have a user interface. Normally, services do not have a
user interface.
In your main entryproint, you should only have two items. One is a pointer
to an array of type SERVICE_TABLE_ENTRY. The SERVICE_TABLE_ENTRY
should have the service name as its first parm, the second parm is a
function pointer to the named service's implementation. In this case it
would be ServiceMain. The second and last entry in SERVICE_ENTRY_TYPE
should be set to NULL, NULL for service name and function pointer to
indicate the end of the table." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Sat Dec 16, 2006 4:10 pm Post subject: |
|
|
Service : System Event Log, Application Error (1000)
"It looks like the service doesn't handle some error condition (possibly
related to a corrupt user profile or too small Registry heap size) which
causes it to try to run code at 0.
The most appropriate way to find out what's wrong would be to debug the
service (precede ImagePath with your debugger and make service interactive
or, if the service has a switch to make it runnable as a normal application,
use it." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Thu Dec 21, 2006 10:52 pm Post subject: |
|
|
JoS: On S3 power saving mode and startup
"Anyone ever work with any ACPI control APIs? I'm particularly
interested in functionality to schedule when a PC is to wake from
S3 mode (e.g. at 9:00am, come alive from S3 mode)." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3136 Location: Europe
|
Posted: Sun Feb 04, 2007 7:32 pm Post subject: |
|
|
NT Services
xbunny: "Download the platform SDK and look at the sample in
psdk\samples\winbase\service its written in C and should compile with
mingw, possibly the current psdk may not be compatable with mingw
however the sample uses no overly modern API's so I expect the windows
headers with mingw would be fine. The sample can easily be reused as all
you need to compile in service.c and implement ServiceStart and
ServiceStop in your application." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Mon Feb 05, 2007 8:50 pm Post subject: |
|
|
Detect new process without polling
"And if you need an extra file, go for the DLL. If you are really looking
for processes that have windows, go for the hook. If what you you are
looking for is all the processes, even if they open no windows, this is what I
recommend: Read about the registry key Appinit_DLLs
( http://support.microsoft.com/kb/197571 )." |
|
Back to top |
|
|
XNote Kapetan
Joined: 16 Jun 2006 Posts: 532
|
Posted: Sat Feb 17, 2007 12:03 am Post subject: |
|
|
How To Identify Unknown Processes In Windows
"Understanding how to track processes down, can be a big help if you think
your system is infected with spyware, or if performance is sluggish.
You can use Task Manager to quickly see all running processes, but if you
need to drill down and find out what program started the process, Task
Manager falls short of reporting all the needed details. A tool that I use to get
the details, is Process Explorer from Microsoft Windows Sysinternals site." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3136 Location: Europe
|
Posted: Sun Apr 01, 2007 5:30 pm Post subject: |
|
|
cboard: Single hex dump - Error codes / Plain errors...
"I'm getting the error codes (299, ReadProcessMemory or WriteProcessMemory
could not be completed.) Sence I only use ReadProcessMemory, it has to be
that. Error code 998 I have no idea what this error means..." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3136 Location: Europe
|
Posted: Wed May 02, 2007 4:13 pm Post subject: |
|
|
RC: The old-fashioned theory on how processes exit
"Back in the old days, processes were believed to be in control of their
threads. You can see this in the "old fashioned" way of exiting a process,
namely by exiting all the threads." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3136 Location: Europe
|
Posted: Thu May 03, 2007 4:46 pm Post subject: |
|
|
RC: Quick overview of how processes exit on Windows XP
"Note that if you were a good boy and cleaned up all the threads in the process
before calling ExitThread, then you've escaped all this craziness, since there
is nothing to clean up." |
|
Back to top |
|
|
XNote Kapetan
Joined: 16 Jun 2006 Posts: 532
|
Posted: Fri Jun 01, 2007 7:33 pm Post subject: |
|
|
Jeff Atwood: Why Is The System Idle Process Hogging All The Resources?
"When I hit Ctrl-Alt-Delete, I see that the System Idle Process is hogging all
the resources and chewing up 95 percent of the processor's cycles. Doing what?
Doing nothing?" |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3136 Location: Europe
|
Posted: Sat Sep 08, 2007 6:17 pm Post subject: |
|
|
cboard: CreateProcess with arguments
"Hello, I have problems using the 'CreateProcess' win32api function. I have
been searching a bit here but I'm not able to make it run." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Sun Aug 17, 2008 1:00 pm Post subject: |
|
|
cboard - Task Manager: Applications vs Processes
"How does Task Manager know the difference between an application and a
process? Is it because the application is running in the foreground in an open
window?" |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3136 Location: Europe
|
Posted: Thu Sep 04, 2008 12:19 pm Post subject: |
|
|
cboard - How to Search for a certain service and a process in Windows
"I tried the code in the link and it is working but unfortunatly a lot of processes
are <unkown> including the one i am looking for which is "javaw.exe". Is this
issue related to my system or has to do with winapi?? so how can i show the real
name of every process." |
|
Back to top |
|
|
XNote Kapetan
Joined: 16 Jun 2006 Posts: 532
|
Posted: Tue Sep 23, 2008 8:53 pm Post subject: |
|
|
ars - Chrome antics: did Google reverse-engineer Windows?
"It is this secure sandbox that has piqued the curiosity of some observers, and
for a reason that many may find surprising. From reading the source, it looks
as though Google has reverse-engineered Windows, and that's explicitly prohi-
bited by the Windows EULA." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3136 Location: Europe
|
|
Back to top |
|
|
XNote Kapetan
Joined: 16 Jun 2006 Posts: 532
|
Posted: Mon Jan 19, 2009 5:53 pm Post subject: |
|
|
cboard - Find Injected DLLs In A Process?
"I have done much coding on dll injections, including writing code that can
use 2 or 3 different methods of injecting the dll, and code that writes code
in the remote process' address space and executes it so it calls a function
in the dll and what not.
I have, however, not tried writing stuff to prevent them, but I know what I
would do..." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Tue Mar 10, 2009 12:35 am Post subject: |
|
|
ibm - Delve into UNIX process creation
"Examine the life cycle of a process so that you can relate what you see hap-
pening on your system to what's going on within the kernel. System admin-
istrators must know how processes are created and destroyed within the Unix
environment in order to understand how the system fits together and how to
manage misbehaving processes. Similarly, developers must understand the
UNIX processes model in order to write solid applications that run unattend-
ed and won't cause problems for system administrators." |
|
Back to top |
|
|
|