Hi vedsharma,
All what you need can be found in the original winerror.h from any of the released sdks,msdns (search for and download windows sdk). The header in Pelles package is outdated, and does not include all the comments.
// winerror.h
// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
// +-+-+-+-+-+---------------------+-------------------------------+
// |S|R|C|N|r| Facility | Code |
// +-+-+-+-+-+---------------------+-------------------------------+
#include <winerror.h> // if not included from windows.h
// define some custom constants
#define FACILITY_TREE 1234 // any 11-bit value
//1. if depth of tree is equal to the given value of depth passed
#define E_TREE_DEPTH_EQUAL MAKE_HRESULT(SEVERITY_ERROR, FACILITY_TREE, 0)
//2. if depth of tree is greater than the given argument passed
#define E_TREE_DEPTH_GREATER MAKE_HRESULT(SEVERITY_ERROR, FACILITY_TREE, 1)
//3. if depth is less than the given value of integer passed
#define E_TREE_DEPTH_LESS MAKE_HRESULT(SEVERITY_ERROR, FACILITY_TREE, 2)
//4. if the tree is null
// use E_POINTER or E_INVALIDARG, or define another E_TREE_DEPTH_*
The FACILITY constant can be any 11 bit value (0-2047), but in the ideal case it should not conflict with other facilities from winerror.h. Of course you can use error codes and facilities already defined, for example (just pick the correct names):
#define E_TREE_DEPTH_EQUAL MAKE_HRESULT(SEVERITY_ERROR, FACILITY_UI, ERROR_SAME_DRIVE)