Archive

Archive for February, 2012

Clean memory

February 20th, 2012 No comments
// Swaps the process out of physical RAM memory
SetProcessWorkingSetSize(GetCurrentProcess(), (SIZE_T)-1, (SIZE_T)-1);

Можно ещё делать так, когда память процесса превышает некую “норму”:

EmptyWorkingSet(GetCurrentProcess());

pragma warning

February 3rd, 2012 No comments

#pragma warning – enables selective modification of the behavior of compiler warning messages.

Additional “pragma warning” parameter is suppress – pushes the current state of the pragma on the stack, disables the specified warning for the next line, and then pops the warning stack so that the pragma state is reset.

Also __pragma() can be used instead of #pragma which allows it to use inside macros:

#define __const_cond( c ) \
 __pragma(warning(push)) \
 __pragma(warning(disable:4127)) \
 ( c ) \
 __pragma(warning(pop))

Windows Sysinternals and Sysinternals Live

February 2nd, 2012 No comments

The Sysinternals web site was created in 1996 by Mark Russinovich and Bryce Cogswell to host their advanced system utilities and technical information. Microsoft acquired Sysinternals in July, 2006. Whether you’re an IT Pro or a developer, you’ll find Sysinternals utilities to help you manage, troubleshoot and diagnose your Windows systems and applications. If you have a question about a tool or how to use them, please visit the Sysinternals Forum for answers and help from other users and our moderators.

Sysinternals Live is a service that enables you to execute Sysinternals tools directly from the Web without hunting for and manually downloading them. Simply enter a tool’s Sysinternals Live path into Windows Explorer or a command prompt as http://live.sysinternals.com/<toolname> or \\live.sysinternals.com\tools\<toolname>.

You can view the entire Sysinternals Live tools directory in a browser at live.sysinternals.com.

Or you can map the server to your drive:

net use y: \\live.sysinternals.com\tools