Question

Briefly describe the Win32 EnumProcesses function. Explain its return type, functions usage, parameters, and parameter data...

Briefly describe the Win32 EnumProcesses function. Explain its return type, functions usage, parameters, and parameter data types.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

EnumProcesses function

Retrieves the process identifier for each process object in the system.

Syntax

BOOL EnumProcesses(
  DWORD   *lpidProcess,
  DWORD   cb,
  LPDWORD lpcbNeeded
);

Parameters

lpidProcess

A pointer to an array that receives the list of process identifiers.

cb

The size of the pProcessIds array, in bytes.

lpcbNeeded

The number of bytes returned in the pProcessIds array.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

It is a good idea to use a large array, because it is hard to predict how many processes there will be at the time you call EnumProcesses.

To determine how many processes were enumerated, divide the pBytesReturned value by sizeof(DWORD). There is no indication given when the buffer is too small to store all process identifiers. Therefore, if pBytesReturned equals cb, consider retrying the call with a larger array.

Add a comment
Know the answer?
Add Answer to:
Briefly describe the Win32 EnumProcesses function. Explain its return type, functions usage, parameters, and parameter data...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT