Igor Delovski Board Forum Index Igor Delovski Board
My Own Personal Slashdot!
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Services & Processes

 
Post new topic   Reply to topic    Igor Delovski Board Forum Index -> General Programming
General Programming  
Author Message
delovski



Joined: 14 Jun 2006
Posts: 3524
Location: Zagreb

PostPosted: Thu Sep 07, 2006 6:40 pm    Post subject: Services & Processes Reply with quote

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
View user's profile Send private message Visit poster's website
Guest






PostPosted: Fri Sep 15, 2006 11:49 pm    Post subject: Reply with quote

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

PostPosted: Sat Sep 23, 2006 7:16 pm    Post subject: Reply with quote

How to get cpu usage by prcess

"I need to get a process cpu usage by his ID in win32, how can i do it ?

> GetProcessTimes()

> http://windowssdk.msdn.microsoft.com/en-us/library/ms683223.aspx "
Back to top
View user's profile Send private message Visit poster's website
Guest






PostPosted: Tue Sep 26, 2006 6:03 pm    Post subject: Reply with quote

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

PostPosted: Fri Oct 06, 2006 8:51 am    Post subject: Reply with quote

JoS: "Finding" an application in Win32

"See the functions CreateToolhelp32Snapshot, Process32First, Process32Next.

http://windowssdk.msdn.microsoft.com/en-us/library/ms686701.aspx "

...

"As Turtle Rustler suggested, a mutex is probably the best way to go - if
you use a file then you'd have to worry about how to clear up after a crash etc."

...

http://www.michaelmoser.org/instance.htm might give you come clues.
...

Perhaps also http://devauthority.com/blogs/jwooley/archive/2005/07/28/318.aspx
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3524
Location: Zagreb

PostPosted: Tue Dec 05, 2006 8:41 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3524
Location: Zagreb

PostPosted: Wed Dec 06, 2006 6:49 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3524
Location: Zagreb

PostPosted: Fri Dec 08, 2006 10:01 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3524
Location: Zagreb

PostPosted: Sat Dec 16, 2006 4:10 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3524
Location: Zagreb

PostPosted: Thu Dec 21, 2006 10:52 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3136
Location: Europe

PostPosted: Sun Feb 04, 2007 7:32 pm    Post subject: Reply with quote

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
View user's profile Send private message
delovski



Joined: 14 Jun 2006
Posts: 3524
Location: Zagreb

PostPosted: Mon Feb 05, 2007 8:50 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
XNote
Kapetan


Joined: 16 Jun 2006
Posts: 532

PostPosted: Sat Feb 17, 2007 12:03 am    Post subject: Reply with quote

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
View user's profile Send private message
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3136
Location: Europe

PostPosted: Sun Apr 01, 2007 5:30 pm    Post subject: Reply with quote

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
View user's profile Send private message
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3136
Location: Europe

PostPosted: Wed May 02, 2007 4:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3136
Location: Europe

PostPosted: Thu May 03, 2007 4:46 pm    Post subject: Reply with quote

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
View user's profile Send private message
XNote
Kapetan


Joined: 16 Jun 2006
Posts: 532

PostPosted: Fri Jun 01, 2007 7:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3136
Location: Europe

PostPosted: Sat Sep 08, 2007 6:17 pm    Post subject: Reply with quote

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
View user's profile Send private message
delovski



Joined: 14 Jun 2006
Posts: 3524
Location: Zagreb

PostPosted: Sun Aug 17, 2008 1:00 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3136
Location: Europe

PostPosted: Thu Sep 04, 2008 12:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
XNote
Kapetan


Joined: 16 Jun 2006
Posts: 532

PostPosted: Tue Sep 23, 2008 8:53 pm    Post subject: Reply with quote

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
View user's profile Send private message
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3136
Location: Europe

PostPosted: Tue Dec 09, 2008 1:48 pm    Post subject: Reply with quote

JoS: How do I get a exe name from it's PID (C++/Win32)

"My application gets a process PID and then it needs to translate this PID to
it's executable name."
Back to top
View user's profile Send private message
XNote
Kapetan


Joined: 16 Jun 2006
Posts: 532

PostPosted: Mon Jan 19, 2009 5:53 pm    Post subject: Reply with quote

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
View user's profile Send private message
delovski



Joined: 14 Jun 2006
Posts: 3524
Location: Zagreb

PostPosted: Tue Mar 10, 2009 12:35 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Igor Delovski Board Forum Index -> General Programming All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Delovski.hr
Powered by php-B.B. © 2001, 2005 php-B.B. Group