00001 /* ///////////////////////////////////////////////////////////////////////// 00002 * File: winstl/toolhelp/heap_sequence.hpp 00003 * 00004 * Purpose: TOOLHELP heap sequence class. 00005 * 00006 * Created: 21st May 2005 00007 * Updated: 10th August 2009 00008 * 00009 * Thanks: To Pablo for contributing this great library. 00010 * 00011 * Home: http://stlsoft.org/ 00012 * 00013 * Copyright (c) 2005-2009, Pablo Aguilar 00014 * Copyright (c) 2006-2007, Matthew Wilson 00015 * All rights reserved. 00016 * 00017 * Redistribution and use in source and binary forms, with or without 00018 * modification, are permitted provided that the following conditions are met: 00019 * 00020 * - Redistributions of source code must retain the above copyright notice, this 00021 * list of conditions and the following disclaimer. 00022 * - Redistributions in binary form must reproduce the above copyright notice, 00023 * this list of conditions and the following disclaimer in the documentation 00024 * and/or other materials provided with the distribution. 00025 * - Neither the name(s) of Matthew Wilson and Synesis Software, nor Pablo 00026 * Aguilar, nor the names of any contributors may be used to endorse or 00027 * promote products derived from this software without specific prior written 00028 * permission. 00029 * 00030 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00031 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00032 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00033 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 00034 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00035 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00036 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00037 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00038 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00039 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00040 * POSSIBILITY OF SUCH DAMAGE. 00041 * 00042 * ////////////////////////////////////////////////////////////////////// */ 00043 00044 00051 #ifndef WINSTL_INCL_WINSTL_TOOLHELP_HPP_HEAP_SEQUENCE 00052 #define WINSTL_INCL_WINSTL_TOOLHELP_HPP_HEAP_SEQUENCE 00053 00054 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION 00055 # define WINSTL_VER_WINSTL_TOOLHELP_HPP_HEAP_SEQUENCE_MAJOR 1 00056 # define WINSTL_VER_WINSTL_TOOLHELP_HPP_HEAP_SEQUENCE_MINOR 1 00057 # define WINSTL_VER_WINSTL_TOOLHELP_HPP_HEAP_SEQUENCE_REVISION 2 00058 # define WINSTL_VER_WINSTL_TOOLHELP_HPP_HEAP_SEQUENCE_EDIT 9 00059 #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */ 00060 00061 /* ///////////////////////////////////////////////////////////////////////// 00062 * Includes 00063 */ 00064 00065 #ifndef WINSTL_INCL_WINSTL_H_WINSTL 00066 # include <winstl/winstl.h> 00067 #endif /* !WINSTL_INCL_WINSTL_H_WINSTL */ 00068 #ifdef STLSOFT_CF_PRAGMA_ONCE_SUPPORT 00069 # pragma once 00070 #endif /* STLSOFT_CF_PRAGMA_ONCE_SUPPORT */ 00071 #ifndef WINSTL_INCL_WINSTL_TOOLHELP_HPP_SEQUENCE_BASE 00072 # include <winstl/toolhelp/sequence_base.hpp> 00073 #endif /* !WINSTL_INCL_WINSTL_TOOLHELP_HPP_SEQUENCE_BASE */ 00074 00075 /* ///////////////////////////////////////////////////////////////////////// 00076 * Namespace 00077 */ 00078 00079 #ifndef _WINSTL_NO_NAMESPACE 00080 # if defined(_STLSOFT_NO_NAMESPACE) || \ 00081 defined(STLSOFT_DOCUMENTATION_SKIP_SECTION) 00082 /* There is no stlsoft namespace, so must define ::winstl */ 00083 namespace winstl 00084 { 00085 # else 00086 /* Define stlsoft::winstl_project */ 00087 00088 namespace stlsoft 00089 { 00090 00091 namespace winstl_project 00092 { 00093 00094 # endif /* _STLSOFT_NO_NAMESPACE */ 00095 #endif /* !_WINSTL_NO_NAMESPACE */ 00096 00097 /* ///////////////////////////////////////////////////////////////////////// 00098 * Classes 00099 */ 00100 00101 // th_sequence_value_traits specialization for heap_sequence 00103 #define WINSTL_TH_API_SEQUENCE_VALUE_TRAITS_VALUE HEAPLIST32 00104 #define WINSTL_TH_API_SEQUENCE_VALUE_TRAITS_FIRST Heap32ListFirst 00105 #define WINSTL_TH_API_SEQUENCE_VALUE_TRAITS_NEXT Heap32ListNext 00106 #define WINSTL_TH_API_SEQUENCE_VALUE_TRAITS_FLAG TH32CS_SNAPHEAPLIST 00107 #define WINSTL_TH_API_SEQUENCE_VALUE_TRAITS_CREATE_SNAPSHOT_FAIL_MESSAGE TEXT("Could not create heap list snapshot") 00108 #include <winstl/toolhelp/sequence_value_traits.hpp> 00109 00114 typedef th_sequence_base<HEAPLIST32> heap_sequence; 00115 00121 STLSOFT_TEMPLATE_SPECIALISATION 00122 struct sequence_doesnt_use_pid<HEAPLIST32> 00123 {}; 00124 00131 inline DWORD get_pid(HEAPLIST32 const& hl) 00132 { 00133 return hl.th32ProcessID; 00134 } 00135 00136 /* ////////////////////////////////////////////////////////////////////// */ 00137 00138 #ifndef _WINSTL_NO_NAMESPACE 00139 # if defined(_STLSOFT_NO_NAMESPACE) || \ 00140 defined(STLSOFT_DOCUMENTATION_SKIP_SECTION) 00141 } // namespace winstl 00142 # else 00143 } // namespace winstl_project 00144 } // namespace stlsoft 00145 # endif /* _STLSOFT_NO_NAMESPACE */ 00146 #endif /* !_WINSTL_NO_NAMESPACE */ 00147 00148 /* ////////////////////////////////////////////////////////////////////// */ 00149 00150 #endif /* WINSTL_INCL_WINSTL_TOOLHELP_HPP_HEAP_SEQUENCE */ 00151 00152 /* ///////////////////////////// end of file //////////////////////////// */