Code Gem

Code Gem

Knowledge was arriving in dribs and drabs

Code Gem RSS Feed
 
 
 
 

Archive for Uncategorized

Turn off the Information Bar in IE

Start from the Internet Explorer in XP SP2, Microsoft added a new feature called Information Bar under the name of security. The Information Bar is used to block some actions that were considered “risky” for security, including

Active X Install Prompts
Non-user-initiated Download Prompts
Pop-up Windows
ActiveX Control Blocked Errors
Local Machine Zone Lockdown

For any [...]

HEX Speaks

While debugging applications, we have to face raw memory in many cases, and knowing some magic number can be a great help to find a clue of the problem.
For example:

0xBAADF00D means uninitialized allocated heap memory.
0xABCDBBBA, 0xABCDBBBB, 0xABCDAAAA, 0xDBCAAAAA … in page heap block structure

There are some more to find at

http://en.wikipedia.org/wiki/Hexspeak
http://en.wikipedia.org/wiki/Magic_number_(programming)#Magic_debug_values

[...]

2 Windows Commands for Setting up File Association

Recently I learnt the following 2 commands which can be used for querying and setting file association in Win32 platform. Quite useful when we are trying to something through batch script. We can call the commands instead of doing the registry dirty work.
ASSOC
Displays or modifies file extension associations
ASSOC [.ext[=[fileType]]]
  .ext      Specifies the file [...]

An Easy Way to Visualize Customize Data Structure in Visual Studio

Start from Visual Studio 2005, STL containers can be shown in the Watch windows, and we can expand the tree-like control to navigator through the whole data structure to exam every element of the container. This brings a great benefit of debugging code, and it is one of the major reason why I prefer STL [...]

GENERIC_READ? FILE_GENERIC_READ?

WTF the difference is?!
Today I got a task to refine an application to make it check the file access at more detailed level. I ran into the problem of the difference of GENERIC_READ and FILE_GENERIC_READ. In MSDN the definition of GENERIC_READ is:
GENERIC_READ

FILE_READ_ATTRIBUTES
FILE_READ_DATA
FILE_READ_EA
STANDARD_RIGHTS_READ
SYNCHRONIZE

But in WinNT.h it is:
#define GENERIC_READ [...]

September 2010
M T W T F S S
« Feb «-»  
 12345
6789101112
13141516171819
20212223242526
27282930  

Blogroll