pax_global_header00006660000000000000000000000064140122505600014505gustar00rootroot0000000000000052 comment=e214a6ecf6e68ce3441c95fcd5c2ea5e1d4ba52b duma-VERSION_2_5_21/000077500000000000000000000000001401225056000140715ustar00rootroot00000000000000duma-VERSION_2_5_21/.deepsource.toml000066400000000000000000000011421401225056000172000ustar00rootroot00000000000000version = 1 [[analyzers]] name = "javascript" enabled = true [analyzers.meta] environment = ["browser"] style_guide = "standard" dialect = "typescript" [[transformers]] name = "yapf" enabled = true [[transformers]] name = "autopep8" enabled = true [[transformers]] name = "isort" enabled = true [[transformers]] name = "standardrb" enabled = true [[transformers]] name = "prettier" enabled = true [[transformers]] name = "standardjs" enabled = true [[transformers]] name = "rubocop" enabled = true [[transformers]] name = "black" enabled = true [[transformers]] name = "gofmt" enabled = trueduma-VERSION_2_5_21/.devbots/000077500000000000000000000000001401225056000156155ustar00rootroot00000000000000duma-VERSION_2_5_21/.devbots/lock-pull-request.yaml000066400000000000000000000002411401225056000220660ustar00rootroot00000000000000enabled: true comment: > This pull request's conversation is now locked. If you want to continue this discussion or file a bug, please open a new issue. duma-VERSION_2_5_21/.github/000077500000000000000000000000001401225056000154315ustar00rootroot00000000000000duma-VERSION_2_5_21/.github/workflows/000077500000000000000000000000001401225056000174665ustar00rootroot00000000000000duma-VERSION_2_5_21/.github/workflows/codacy-analysis.yml000066400000000000000000000013371401225056000233000ustar00rootroot00000000000000name: Codacy Security Scan on: push: branches: [ master ] pull_request: branches: [ master ] jobs: codacy-security-scan: name: Codacy Security Scan runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 - name: Run Codacy Analysis CLI uses: codacy/codacy-analysis-cli-action@1.1.0 with: project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} verbose: true output: results.sarif format: sarif gh-code-scanning-compat: true max-allowed-issues: 2147483647 - name: Upload SARIF results file uses: github/codeql-action/upload-sarif@v1 with: sarif_file: results.sarif duma-VERSION_2_5_21/.github/workflows/codeql-analysis.yml000066400000000000000000000011711401225056000233010ustar00rootroot00000000000000name: "CodeQL" on: push: branches: [ master ] pull_request: branches: [ master ] schedule: - cron: '40 8 * * 1' jobs: analyze: name: Analyze runs-on: ubuntu-latest strategy: fail-fast: false matrix: language: [ 'cpp', 'javascript' ] steps: - name: Checkout repository uses: actions/checkout@v2 - name: Initialize CodeQL uses: github/codeql-action/init@v1 with: languages: ${{ matrix.language }} - name: Autobuild uses: github/codeql-action/autobuild@v1 - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v1 duma-VERSION_2_5_21/.github/workflows/codescan-analysis.yml000066400000000000000000000017471401225056000236220ustar00rootroot00000000000000name: CodeScan on: push: branches: [ master ] pull_request: branches: [ master ] jobs: CodeScan: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v2 - name: Cache files uses: actions/cache@v2 with: path: | ~/.sonar key: ${{ runner.os }}-sonar restore-keys: ${{ runner.os }}-sonar - name: Run Analysis uses: codescan-io/codescan-scanner-action@master with: login: ${{ secrets.CODESCAN_AUTH_TOKEN }} organization: ${{ secrets.CODESCAN_ORGANIZATION_KEY }} projectKey: ${{ secrets.CODESCAN_PROJECT_KEY }} - name: Upload SARIF file uses: github/codeql-action/upload-sarif@v1 with: sarif_file: codescan.sarif duma-VERSION_2_5_21/.github/workflows/crunch42-analysis.yml000066400000000000000000000010531401225056000234610ustar00rootroot00000000000000name: "42Crunch REST API Static Security Testing" on: push: branches: [ master ] pull_request: branches: [ master ] schedule: - cron: '17 2 * * 2' jobs: rest-api-static-security-testing: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: 42Crunch REST API Static Security Testing uses: 42Crunch/api-security-audit-action@v1 with: api-token: ${{ secrets.API_TOKEN }} min-score: 75 upload-to-code-scanning: true github-token: ${{ github.token }} duma-VERSION_2_5_21/.github/workflows/ossar-analysis.yml000066400000000000000000000007721401225056000231670ustar00rootroot00000000000000name: OSSAR on: push: pull_request: jobs: OSSAR-Scan: runs-on: windows-latest steps: - name: Checkout repository uses: actions/checkout@v2 with: fetch-depth: 2 - run: git checkout HEAD^2 if: ${{ github.event_name == 'pull_request' }} - name: Run OSSAR uses: github/ossar-action@v1 id: ossar - name: Upload OSSAR results uses: github/codeql-action/upload-sarif@v1 with: sarif_file: ${{ steps.ossar.outputs.sarifFile }} duma-VERSION_2_5_21/.github/workflows/shiftleft-analysis.yml000066400000000000000000000007031401225056000240220ustar00rootroot00000000000000name: SL Scan on: push jobs: Scan-Build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Perform Scan uses: ShiftLeftSecurity/scan-action@master env: WORKSPACE: "" GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SCAN_AUTO_BUILD: true with: output: reports - name: Upload report uses: github/codeql-action/upload-sarif@v1 with: sarif_file: reports duma-VERSION_2_5_21/.github/workflows/veracode-analysis.yml000066400000000000000000000026511401225056000236260ustar00rootroot00000000000000name: Veracode Static Analysis Pipeline Scan on: push: branches: [ master ] pull_request: branches: [ master ] jobs: build-and-pipeline-scan: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: repository: '' - uses: papeloto/action-zip@v1 with: files: / recursive: true dest: veracode-pipeline-scan-results-to-sarif.zip - uses: actions/upload-artifact@v2 with: name: my-artifact path: veracode-pipeline-scan-results-to-sarif.zip - uses: wei/curl@master with: args: -O https://downloads.veracode.com/securityscan/pipeline-scan-LATEST.zip - run: unzip -o pipeline-scan-LATEST.zip - uses: actions/setup-java@v1 with: java-version: 1.8 - run: java -jar pipeline-scan.jar --veracode_api_id "${{secrets.VERACODE_API_ID}}" --veracode_api_key "${{secrets.VERACODE_API_KEY}}" --fail_on_severity="Very High, High" --file veracode-pipeline-scan-results-to-sarif.zip continue-on-error: true - uses: actions/upload-artifact@v2 with: name: ScanResults path: results.json - name: Convert pipeline scan output to SARIF format id: convert uses: veracode/veracode-pipeline-scan-results-to-sarif@master with: pipeline-results-json: results.json - uses: github/codeql-action/upload-sarif@v1 with: sarif_file: veracode-results.sarif duma-VERSION_2_5_21/.github/workflows/xanitizer-analysis.yml000066400000000000000000000015521401225056000240520ustar00rootroot00000000000000name: "Xanitizer Security Analysis" on: push: workflow_dispatch: jobs: xanitizer-security-analysis: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 - name: Set up JDK 11 uses: actions/setup-java@v1 with: java-version: 11 - name: Compile Java code run: mvn -B compile - name: Install JavaScript libraries run: npm install - name: Xanitizer Security Analysis uses: RIGS-IT/xanitizer-action@v1 with: license: ${{ secrets.XANITIZER_LICENSE }} - uses: actions/upload-artifact@v2 with: name: Xanitizer-Reports path: | *-Findings-List.pdf *-Findings-List.sarif - uses: github/codeql-action/upload-sarif@v1 with: sarif_file: Xanitizer-Findings-List.sarif duma-VERSION_2_5_21/.gitignore000066400000000000000000000052371401225056000160700ustar00rootroot00000000000000# Created by https://www.toptal.com/developers/gitignore/api/vim,visualstudiocode,linux,macos,cvs,git,c,c++ # Edit at https://www.toptal.com/developers/gitignore?templates=vim,visualstudiocode,linux,macos,cvs,git,c,c++ ### C ### # Prerequisites *.d # Object files *.o *.ko *.obj *.elf # Linker output *.ilk *.map *.exp # Precompiled Headers *.gch *.pch # Libraries *.lib *.a *.la *.lo # Shared objects (inc. Windows DLLs) *.dll *.so *.so.* *.dylib # Executables *.exe *.out *.app *.i*86 *.x86_64 *.hex # Debug files *.dSYM/ *.su *.idb *.pdb # Kernel Module Compile Results *.mod* *.cmd .tmp_versions/ modules.order Module.symvers Mkfile.old dkms.conf ### C++ ### # Prerequisites # Compiled Object files *.slo # Precompiled Headers # Compiled Dynamic libraries # Fortran module files *.mod *.smod # Compiled Static libraries *.lai # Executables ### CVS ### /CVS/* **/CVS/* .cvsignore */.cvsignore *,v ### Git ### # Created by git for backups. To disable backups in Git: # $ git config --global mergetool.keepBackup false *.orig # Created by git when using merge tools for conflicts *.BACKUP.* *.BASE.* *.LOCAL.* *.REMOTE.* *_BACKUP_*.txt *_BASE_*.txt *_LOCAL_*.txt *_REMOTE_*.txt ### Linux ### *~ # temporary files which can be created if a process still has a handle open of a deleted file .fuse_hidden* # KDE directory preferences .directory # Linux trash folder which might appear on any partition or disk .Trash-* # .nfs files are created when an open file is removed but is still being accessed .nfs* ### macOS ### # General .DS_Store .AppleDouble .LSOverride # Icon must end with two \r Icon # Thumbnails ._* # Files that might appear in the root of a volume .DocumentRevisions-V100 .fseventsd .Spotlight-V100 .TemporaryItems .Trashes .VolumeIcon.icns .com.apple.timemachine.donotpresent # Directories potentially created on remote AFP share .AppleDB .AppleDesktop Network Trash Folder Temporary Items .apdisk ### Vim ### # Swap [._]*.s[a-v][a-z] !*.svg # comment out if you don't need vector files [._]*.sw[a-p] [._]s[a-rt-v][a-z] [._]ss[a-gi-z] [._]sw[a-p] # Session Session.vim Sessionx.vim # Temporary .netrwhist # Auto-generated tag files tags # Persistent undo [._]*.un~ ### VisualStudioCode ### .vscode/* !.vscode/settings.json !.vscode/tasks.json !.vscode/launch.json !.vscode/extensions.json *.code-workspace ### VisualStudioCode Patch ### # Ignore all local history of files .history # End of https://www.toptal.com/developers/gitignore/api/vim,visualstudiocode,linux,macos,cvs,git,c,c++ # The following have been imported from .cvsignore *.ncb *.opt *.plg # Ignore .rej from patch *.rej # No longer ignoring the following (2020-08-25) #createconf #eftest #tstheap duma-VERSION_2_5_21/.gitlab-ci.yml000066400000000000000000000100661401225056000165300ustar00rootroot00000000000000###################### Begin Defaults stages: - all variables: GIT_DEPTH: 0 GIT_STRATEGY: clone default: before_script: - | # before_script echo "Starting before_script actions." echo "Finished before_script actions." after_script: - | # after_script echo "Starting after_script actions." echo "Finished after_script actions." ###################### End Defaults ###################### Begin Common Blocks .scriptCommon: &scriptCommon | # scriptCommon echo "Project Name : $CI_PROJECT_TITLE" echo "Project Git Commit : $CI_COMMIT_SHA" echo "Project Git Branch : $CI_COMMIT_BRANCH" echo "GitLab CI User Details : $GITLAB_USER_LOGIN - $GITLAB_USER_NAME ($GITLAB_USER_ID) $GITLAB_USER_EMAIL" echo "GitLab CI Job Name : $CI_JOB_NAME" echo "GitLab CI Job ID : $CI_JOB_ID" echo "GitLab CI Job Stage : $CI_JOB_STAGE" echo "GitLab CI Runner Details : $CI_RUNNER_VERSION ($CI_RUNNER_REVISION)" .scriptGitPre: &scriptGitPre | # scriptGitPre git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" git --no-pager fetch --tags git --no-pager fetch --all --recurse-submodules=yes git --no-pager update-index -q --refresh --really-refresh git --no-pager for-each-ref --count=1 git --no-pager reset --hard git --no-pager diff --full-index --exit-code ###################### End Common Blocks ###################### Begin Windows Build + Test #windows job: # tags: # - Windows-x86_64 # stage: all # script: # - *scriptCommon # - $env:Path += ";C:\Program Files\Git\cmd;C:\Go\bin;C:\Progra~1\Git" # - *scriptGitPre # - | # # TODO(jhj): PLACEHOLDER - Windows build and test will eventually go here # - | # # status # echo "Windows skipped" ###################### End Windows Build + Test ###################### Begin Linux linux job: tags: - Linux-x86_64 stage: all script: - *scriptCommon - | # upgrade system, install development tools - yum install dnf -y || true :; - yum clean all -y || true :; - dnf upgrade --refresh -y || true :; - dnf groupinstall "Development Tools" -y || true :; - dnf install epel-release centos-release-scl centos-release-scl-rh -y || true :; - dnf install pv valgrind ccache graphviz clang zsh autoconf-archive bash mksh rpmconf scl-utils devtoolset-9 -y || true :; - dnf groupupdate base -y || true :; - yes | /usr/sbin/rpmconf -a || true :; - . /opt/rh/devtoolset-9/enable - dnf clean all -y || true :; - *scriptGitPre - gcc --version - gmake clean - gmake distclean - gmake -k - gmake test -k # - gmake install # - gmake installcheck # - gmake uninstall - gmake clean - gmake distclean - | # status echo "gmake: clean -> distclean -> test -> clean -> distclean: OK" ###################### End Linux Build + Test ####################### Begin macOS Build + Test #macos job: # tags: # - macOS_X-x86_64 # stage: all # script: # - | # # update & upgrade homebrew # bash --norc --noprofile --posix -c "brew update >/dev/null 2>&1 || true :;" >/dev/null 2>&1 || true :; # bash --norc --noprofile --posix -c "brew upgrade >/dev/null 2>&1 || true :;" >/dev/null 2>&1 || true :; # - *scriptCommon # - if type brew >/dev/null 2>&1; then export HOMEBREW_PREFIX=$(brew --prefix 2>/dev/null); for dir in ${HOMEBREW_PREFIX}/opt/*/libexec/gnubin; do export PATH="${dir}:${PATH}"; done; fi # - export PATH="/usr/local/opt/gcc/bin:${PATH}" # - *scriptGitPre # - gcc --version # - gmake clean OS=darwin # - gmake distclean OS=darwin # - gmake OS=darwin -k # - gmake test OS=darwin -k ## - gmake install OS=darwin ## - gmake installcheck OS=darwin ## - gmake uninstall OS=darwin # - gmake clean OS=darwin # - gmake distclean OS=darwin # - | # # status # echo "gmake: clean -> distclean -> test -> clean -> distclean: OK" ####################### End macOS Build + Test duma-VERSION_2_5_21/.mergify.yml000066400000000000000000000002341401225056000163330ustar00rootroot00000000000000pull_request_rules: - name: Automatic merge on approval conditions: - "#approved-reviews-by>=1" actions: merge: method: merge duma-VERSION_2_5_21/.whitesource000066400000000000000000000003271401225056000164350ustar00rootroot00000000000000{ "scanSettings": { "baseBranches": [] }, "checkRunSettings": { "vulnerableCheckRunConclusionLevel": "failure", "displayMode": "diff" }, "issueSettings": { "minSeverityLevel": "NONE" } } duma-VERSION_2_5_21/CHANGELOG000066400000000000000000000772011401225056000153120ustar00rootroot00000000000000CHANGELOG: ========== 2.5.20 * Typo fix and build system updates - nothing functional. 2.5.19 * Updated scripts, Debian release info, minor changes. 2.5.18 * Non-beta tagged release. 2.5.17 * Updated README with extra history and information. (2020-12-15, JJ) * Added SECURITY.md: New Security Policy for bug reporting. (2020-12-15, JJ) * Added LICENSE: Merged COPYING-GPL and COPYING-LGPL. (2020-08-25, JJ) * Updated TODO with items from 2009-12-30 by Daniel Trebbien. (2020-08-25, JJ) * Updated TODO with items from 2008-05-23 by Michael Eddington. (2020-08-25, JJ) * No longer build test programs (for now) to unbreak static builds. (2020-08-24, JJ) * Applied various update patches from the Buildroot Project. (2020-10-28, JJ) * Applied a patch from Swati Kumari for additional NULL checks. (2015-07-30, JJ) * Applied a patch for bug ID #3035145 from Reinhard Katzmann. (2010-07-26, JJ) * Applied a patch for bug ID #2923784 from Daniel Trebbien. (2009-12-30, JJ) * Applied a patch for bug ID #2923779 from Daniel Trebbien. (2009-12-30, JJ) * Applied a patch for bug ID #2831348 from an Anonymous SourceForge user. (2009-07-23, JJ) 2.5.16 * added memmove() implementation based on memove() from klibc. code from Andris Zeila, see http://sourceforge.net/tracker/?func=detail&aid=2792252&group_id=149725&atid=775376 (2009-05-21, HA) * fixed "Broken build in Msys and C++ tests fail": fixed USE_WIN32_CRIT_SECT implementation in sem_inc.c, mingw now uses this one added make section for OSTYPE=msys-sh, which uses mingw32-gcc/g++ and rm * use USE_WIN32_CRIT_SECT implementation also for cygwin, fixes testoperator (2009-05-23, HA) * remove CVS subdirectories from packaging * removed debian subdirectory from CVS (2009-06-07, HA) * fixed "Wrong LD_PRELOAD path in duma.sh". see https://sourceforge.net/tracker/?func=detail&aid=2800139&group_id=149725&atid=775376 (2009-06-12, HA) * fixed "GNUmakefile is missing DESTDIR" using submitted patch: https://sourceforge.net/tracker/?func=detail&aid=2800137&group_id=149725&atid=775376 * moved definition of MAN_INSTALL_DIR and DOC_INSTALL_DIR in GNUmakefile after definition of prefix (2009-06-15, HA) * removed GNUmakefile option "DUMA_SEMAPHORES" (2009-06-14, HA) 2.5.15 * added alternative locking implementation in sem_inc.c using critical sections. code from Peter Harris, see http://code.google.com/p/electric-fence-win32/ * added Windows Threading to testmt.c added win32-msvc.net project file * use of WIN32_SEMAPHORES on Win32-Cygwin in sem_inc.c - the locking mechanism for multi-threading, with this configuration testmt.c works either with pthreads and with the Win32 API * CreateSemaphore() now used with maximum count = initial count = 1 (2008-08-03, HA) * removed usage of strlen() in strncpy() (2009-03-19, HA) * PATCH from Andre Landwehr fixes race condition when using preprocessor macro 'delete' (2009-04-07, HA) * bugfix in strncpy() Roman Jokl reported the bug: error check was too rigorous (2009-04-11, HA) 2.5.14 * added suggested ~/.gdbinit as gdbinit.rc * added hint in mprotectFailed() * removed (gcc) compiler warnings * rename of sem_inc.h to duma_sem.h, cause needed by dumapp.h (2008-03-12, HA) * update of README for Microsoft's pageheap.exe, a built in heap debugging tool (2008-04-20, HA) * PATCH from Philip Mucci on behalf of SiCortex * Fix for malloc(0) which previously always returned NULL. added environment switch DUMA_MALLOC_0_STRATEGY, which may return a special protected piece of memory for malloc(0) * Moved malloc/SHOW_ALLOC printouts before all abort checks (2008-04-20, Philip Mucci, HA) * remove some warnings for "-Wall -Wextra" especially for cygwin * detailed some messages when source filename and lineno were available (2008-04-21, HA) * removed environment variable "DUMA_ALLOW_MALLOC_0" DUMA_MALLOC_0_STRATEGY = 0 is equivalent to previous DUMA_ALLOW_MALLOC_0=0. default is 3. (2008-04-22, HA) * return unique pointer for C++ operator new for DUMA_MALLOC_0_STRATEGY == 3. now it should be really standard conform (2008-04-26, HA) * Fix for C++ operator new with size zero added environment switch DUMA_NEW_0_STRATEGY (2008-04-27, HA) 2.5.13 * applied PATCH(es) from Philip Mucci from the company SiCortex www.sicortex.com : - Fix for pthread_self() and hang of testoperators test case on 64 bit linux platforms (x86_64 and MIPS64) - Added -Wall to Makefile - Properly versioned symbolic library to have the version triple 0.0.0 - Removed control-M's from the sources. Please do not ship unix sources with control-M's (stop editing on Windows) - Make sure ranlib is run on the static library, various platforms require this - Add -DPIC for shared library builds - Added install targets for headers (INC_INSTALL_DIR) - Added install targets for documentation (DOC_INSTALL_DIR) - Added separate 'make test' target - Added proper install target that also refers to GNU standard DESTDIR usage. - Added 'distclean clobber' targets to remove configuration - Added 'reconfig' target to regenerate duma_config.h - Changed makefile flow to recursively run if duma_config.h doesn't exist - Fixed return value error in testmt.c - Fixed args in thread-test.c * updated Makefile: updated PACKAGE_SOURCE and added target dos2unix (2008-03-09, HA) 2.5.12 * enhancement: added environment variable 'DUMA_CHECK_FREQ' to autmatically check all memories no man's land at each n'th allocation/deallocation. n=0 to deactivate automatic checks. (2008-01-24, HA) * updated README.txt for environment variables DUMA_CHECK_FREQ and DUMA_SKIPCOUNT_INIT. (2008-01-25, HA) 2.5.11 * bugfix on thread safety in sem_inc.c thanks to Andrew Kornev writing the right hint as bugreport: "[ 1875926 ] non-thread safe lock() implementation" (2008-01-20, HA) 2.5.10 * added small test program to demonstrate crashing on multithreaded programs from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=67838 (2008-01-15, HA) * added html comparison charts/text and C source code examples from http://www.cs.utexas.edu/~jpmartin/memCheckers.html into subdir comparisons with kind permission of Jean-Philippe Martin * added Makefile for each C source file (2008-01-14, HA) * bugfix for Makefile target install, when DUMASO is empty bug was reported from Louis Strous (2008-01-09, HA) * added hint where no man's land was overwritten: below or above userSpace (2008-01-03, HA) 2.5.9 * added link to mpatrol in README * added shell environment variable 'DUMA_SKIPCOUNT_INIT' (2007-08-22, HA) * added section for NetBSD in Makefile there is always 1 memory leak on NetBSD-3.1 .. but the functionality works (2007-08-28, HA) * tested on powerpc-apple-darwin8.0.0 inside of PearPC 0.4 (Windows): compiles and passes all confidence tests. trying to debug example1 from within gdb crashes whole PearPC; running without gdb creates a core dump one can analyse afterwards with gdb. (2007-09-02, HA) * bugfix for _duma_strncpy(): no more call to strlen() bug was reported from kamallneet * applied patch from Eddy Pronk submitted to sourceforge with title "libduma.so on Solaris" (2007-11-13, HA) * added minor error check in print.c about DUMA_OUTPUT_FILE * some comments in duma.h and dumapp.h (2007-12-23, HA) 2.5.8 * fix: set DUMA_PREFER_GETENV for osx; it doesn't link with environ * fix: MinGW wanted exact declaration as in definition for function DUMA_strerror in print.h * fix: workaround testmt.c to compile on Windows * fix: call duma_init() ifdef DUMA_EXPLICIT_INIT in testoperators.cpp * added notes on prepackaged .rpm files provided by Dries Verachtert at http://dries.ulyssis.org/apt/packages/duma/info.html in README (2007-08-17, HA) * added environment variable 'DUMA_REPORT_ALL_LEAKS' defaulting to 0. * added empty definitions for macro functions DUMA_SET_ALIGNMENT(), DUMA_SET_PROTECT_BELOW() and DUMA_SET_FILL() * updated README on shell environment variable options, added some entries to section 'OTHER ALTERNATIVE/ADDITIONAL DEBUGGING SOFTWARE/TOOLS' and added section 'COMPILATION NOTES FOR RELEASE/PRODUCTION' (2007-08-18, HA) * added single line function 'duma_alloc_return()'. all memory allocated from DUMA is returned through this function. This allows you to set a conditional breakpoint on this function to catch a specific allocation (2007-08-19, HA) 2.5.7 * reformatting: converted tabs to spaces * added test program testenv.c using global environ variable as alternative to getenv() (2007-08-15, HA) * added output of some configuration settings with banner * switched off leak detection in shared library for any platform. use the static library for finding leaks - with information where the piece of memory got allocated. Meanwhile I think leak-checking without further information is quite useless! Too many correct programs don't free all memory, cause the system frees memory up at program end. Thus, too many platforms/environments are reported "broken" from DUMA. * output allocator type (malloc, strdup, ..) with leak report for each non freed memory block * removed option DUMA_USE_FRAMENO and the frameno variable i suppose nobody is using it. but additionally it is not thread safe. * added option DUMA_PREFER_GETENV if you prefer standard C library getenv() over global char **environ * added function duma_check(void*) and its macro DUMA_CHECK(): it checks the No Mans Land - especially the unprotected end - of the memory block * added function duma_checkAll() and its macro DUMA_CHECKALL(): it checks the No Mans Land - especially the unprotected end - of all allocated memory blocks (2007-08-17, HA) 2.5.6 * modified example Makefiles for not linking to pthreads on Windows (2007-08-12, HA) * added win32-msvc.net project file for testoperators.cpp * bugfix: obey for option DUMA_NO_LEAKDETECTION: check for this option before calling any non-existing operators with leak parameters * enhanced comments in Makefile for DUMA_SO_* and DUMA_LIB_* options * changes in Makefile to build dynamic library on osx * preloading duma library now works on osx * added Debian Bug report logs - #241156 as testmt.c (2007-08-14, HA) 2.5.5 * support for Solaris (Solaris 10 with the GNU toolchain from Companion CD) * fix for solaris: strerror() calls calloc() leading to recursion added preprocessor option DUMA_NO_STRERROR * internal redesign: collected several global static variables to one structure and several global non static variables to other structure each with prepended and appended protection space (2007-08-11, HA) 2.5.4 * support for win32 mingw when calling make with OSTYPE=msys call "mingw32-make OSTYPE=msys" from Windows command prompt having added the PATH for MINGW/bin (2007-07-28, HA) * echo single dot '.' for windows command shell (2007-07-31, HA) 2.5.3 * added simple Makefiles for examples in subdir example_makes/ex*/ * modified Makefile to avoid build of shared libs/executables specific to OS * dumapp.h now keeps C macro definitions * support for max osx when calling make with OS=osx * support for win32 cygwin when calling make with OSTYPE=cygwin (2007-07-14, HA) * bugfix in createconf.c for Win32 but non Visual C++ * got cygwin to work: switched off stacktrace (before trying to integrate in Makefile) caddr_t and u_int were already defined use signals as on Linux/Unix in dumatest.c updated Makefile (2007-07-13, HA) 2.5.2 * minor corrections * added preprocessor option "DUMA_SEMAPHORES" to select pthreads locking mechanism: semaphores or mutexes * removed automatically generated visual c++ file detoursexample1.ncb from CVS and archives (2007-07-12, HA) 2.5.1 * turned global variables DUMA_PROTECT_BELOW, DUMA_ALIGNMENT and DUMA_FILL to thread local variables. Acces now with new function macros DUMA_SET_ALIGNMENT(), DUMA_SET_PROTECT_BELOW() and DUMA_SET_FILL() * support for posix_memalign() * pthread_mutex implementation alternative to semaphores (2007-07-03, HA) 2.5 * Documentation updates. Now using Natural Docs * win32: Detours support for using DUMA with just binaries * win32: Can compile a duma dll * win32: DUMA can perform stacktraces of each allocation * win32: Support for Visual Studio 2005 * win32: Support for output to debug console * Support for output to a file * Can control output via environmental variables 2.4.28 fix/enhancement: reworked initialization for RequestID 1458083 on SF checks for recursive calls in _duma_init() and duma_init() (2006-06-17, HA) bugfix in new[] operators occured on alpha-linux1 on sf compile farm (2006-06-18, HA) bugfix in Makefile: DUMA_OPTIONS was not used when compiling createconf.o bugfix: compile error when DUMA_NO_LEAKDETECTION was set in testoperators.cpp fix: obey EXPLICIT_INIT in testoperators.cpp (2006-06-18, HA) fix: as in RequestID 1482267 on SF: updated install directory for manual. $prefix/share/man/man3 should fit the Filesystem Hierarchy Standard 2.3 for /usr and /usr/local (2006-06-18, HA) 2.4.27 this version is now reachable via cvs on sourceforge.net 2.4.27 published a german article on DUMA on http://duma.sourceforge.net/ bugfix: removed buffer overflow in DUMA_sprintf() for long filenames: added parameter maxsize for output buffers in some functions. incremented STRING_BUFFER_SIZE to reduce this risk. this bug was reported by (2006-01-09, HA) 2.4.26 new project file for Dev-C++ 4.9.9.2 for createconf from Benjamin Berkels bugfix/enhancement: avoid recursion from sem_init() in Linux/U*ix where sem_init() may call malloc() which again calls semaphore locking (2005-10-25, HA) bugfix in delete macro: Magic must be a single variable! reported from Benjamin Berkels some more TLS preparation (2005-10-28, HA) 2.4.25 bugfix: semaphores were not initialized correctly; this lead to a hang. thanks for reporting and providing a test environment to Tim Braun updated project files for Dev-C++ 4.9.9.2 / GCC 3.3.1 and bugfixed compiler error for Dev-C++/gcc both reported from Benjamin Berkels modified delete macros DUMA_Magic now array (call_depth) (2005-10-21, HA) 2.4.24 new program testoperators: writes its own member new/delete operator with filename and line number forwarding to DUMA reworked Makefile: added tstheap_so which runs with shared library output in banner now shows which library (static/shared) is used (2005-10-09, HA) 2.4.23 write DUMA's preprocessor flags at compile time of the library to duma_config.h. Thus one no more would have to provide the same flags when compiling his own objects files. changed Makefile, to take care for this (2005-10-07, HA) 2.4.22 C++ 'new' operators now (more) standard conform: allocation of size==0 now returns non 0 pointer new option 'DUMA_SUPPRESS_ATEXIT' as environment variable from Tim Braun : suppress call to C library's atexit() function for DUMA's leak checking function in buggy environments, where atexit() hangs. implemented alternative for C library's atexit() using GNU C compiler's 'destructor' function attribute. new preprocessor flag 'DUMA_PREFER_ATEXIT' in Makefile got updated project files for Dev-C++ 4.9.9.2 / GCC 3.3.1 from Benjamin Berkels updated TODO bugfix: "EF_" was not replaced by "DUMA_" in tstheap.c bugfix: rules how to build test objects; DUMA_OPTIONS were not passed (2005-10-06, HA) 2.4.21 modified Makefile: name for shared library and symbolic links now configurable at start update of README updated TODO; sorted by priority (2005-10-04, HA) bugfix: follow enum _DUMA_FailReturn in _duma_allocate() function bugfix: initialize userAddr in _duma_allocate() function may lead to bug when allocation failed new operators now (nearly) C++ conform (2005-09-29, HA) 2.4.20 integrated patches from Zbynek Vyskovsky : use tighter alignment when size is smaller than default alignment replaced calls to EF_Exit() by EF_Abort() modified README (2005-09-19 - 2005-09-23, ZV) reworked Zbynek's patch to use long in internal adress calculations: autodetect compatible integer types DUMA_ADDR and DUMA_SIZE in createconf. write them to duma_config.h autodetect DUMA_MIN_ALIGNMENT in createconf, write value to duma_config.h use autodetected values in code reworked DUMA_sprintf() and its format specifier bugfixed Makefile: DUMA_SO_OPTIONS also used DUMA_OPTIONS removed '-DDUMA_NO_CPP_SUPPORT', as LD_PRELOAD works for C++ new, new[], delete and delete[] operators (2005-09-24, HA) bugfixed reduceProtectedMemory(): Windows VirtualFree(,,MEM_RELEASE) can only free whole allocations. not parts. bugfix in memory allocation: try allocation in loop until reduceProtectedMemory() fails deallocating more memory. long running programs with much memory handling should benefit. (2005-09-26, HA) added project files for Visual C++ .NET 2003 applied one more patch from Zbynek Vyskovsky concerning alignment his calculation of next lower power of 2 is much smaller bugfix: return '(void*)0' in _duma_allocate(), when userSize==0 (2005-09-27, HA) 2.4.19 fixed compile error in duma.c introduced in 2.4.18 fixed/enhanced Makefile (2005-09-19, HA) added runtime check for DUMA_PAGE_SIZE from duma_config.h (2005-09-17, HA) added check for initialization function "__attribute ((constructor))" (2005-09-18, HA) 2.4.18 checked Source code: DUMA_get_sem() is nor more called, when DUMA_NO_THREAD_SAFETY is set splitted this document into two files: TODO and CHANGELOG created INSTALL document modified Makefile: added special rules for building shared library (2005-09-10, HA) modified README (2005-09-16, HA) removed option DUMA_FREE_WIPES documented the options DUMA_SLACKFILL, DUMA_MALLOC_FAILEXIT, DUMA_MAX_ALLOC, DUMA_FREE_ACCESS, DUMA_SHOW_ALLOC and DUMA_DISABLE_BANNER in README. new preprocessor flag 'DUMA_NO_HANG_MSG' in Makefile (2005-09-16, HA) 2.4.17 forked Electric Fence cause Bruce Perens wrote: > Hayati Ayguen must choose another name for his program. > "Electric Fence" is a trademark he is not permitted to use. opened a "new" project DUMA - Detect Unintended Memory Access rename efence to duma rename Electric Fence to DUMA rename EF_ to DUMA_ rename ef_ to duma_ rename eff_ to duma_ and so on ... (2005-09-10, HA) 2.4.16 added examples for article portability: use standardized strerror() instead sys_nerr and sys_errlist[]. bugfix: error when defined EF_NO_LEAKDETECTION in _eff_allocate() bugfix: error when defined EF_NO_LEAKDETECTION in _eff_deallocate() enhancement: mark allocations from standard libraries before ef_init() is called with lineno = -1 to allow special treatment in leak_checking changed default in eftest to use two signals: SIGSEGV and SIGBUS instead of single PAGE_PROTECTION_VIOLATED_SIGNAL define functions (memcpy, strcpy, strcat) as non-intrinsic for Visual C++ compiler in Release mode (2005-08-28, HA) enhancement: allow alignments bigger than page size (2005-08-23, HA) documented EF_NO_THREAD_SAFETY preprocessor flag in Makefile added EF_EXPLICIT_INIT preprocessor flag to workaround buggy environments: initialisation is done in 2 steps: 1- must do things when allocation is called 2- non must-do like retrieving environment variables, registering atexit() calls to functions getenv(), atexit() and write() are avoided in first step. 3- avoid semaphore locking before 2.step is done (2005-08-21, HA) 2.4.15 bugfixed page management under Windows: virtual address space never got released. unfortunately this "quick" fix avoids memory pooling (under Windows). remove double "Electric Fence:" messages when calling EF_Abort() or EF_Exit() (2005-07-24, HA) added parameter ExitOnFail to Page_Create(). added warning when allocation failed and ExitOnFail is off. extended _eff_allocate() for this. prepared new for standard conformity. (2005-07-20, HA) 2.4.14 integrated code from Tim Braun new EF_SHOW_ALLOC environment variable, which prints allocations and deallocation when variable set check if malloc() and free() are bound to efence (2005-07-15, HA) integrated a patch from Zbynek Vyskovsky in his words: "I modified Electric Efence a little, to be able to catch free-ing memory via watch point in debugger. The patch (attached) solves the problem when you are watching expression for change and suddenly realize the memory containing expression disappeared. It has no other effect, just makes debugging easier." (2005-07-11, HA) bugfix for internal slot mode EFST_DEALLOCATED reported by Mikolas Patocka: error occured when userSpace memory region of freed memory is reused from system and freed again: efence claimed freeing already freed memory. (2005-03-02, HA) now defining macros/functions also for str[n]cpy() and str[n]cat() checking for overlapping memory regions. (2005-02-17, HA) now defining macros/functions also for strdup(), memcpy(). memcpy() checks if memory regions overlap. (2005-02-16, HA) added EF_OLD_DEL_MACRO preprocessor flag to keep compatibility to old DEL_ELEM() / DEL_ARRAY() macros. when not defined a macro for "delete" is defined which has standard conform syntax. (2005-02-14, HA) 2.4.13 added internal flag saving the source (allocation/deallocation) for filename and lineno. added EF_OLD_NEW_MACRO preprocessor flag to keep compatibility to old NEW_ELEM() / NEW_ARRAY() macros. when not defined a macro for "new" is defined which has standard conform syntax. unfortunately you have to use DEL_ELEM/DEL_ARRAY further to utilize filename and linenumber of deallocation calls. (2005-02-10, HA) reworked/revised ALL internal functions !!! freeing already freed memory is now detected (much better) this disallows coalescing memory regions and also stores __FILE__ and __LINE__ of free() to be able to print position of first free. added EF_USE_FRAMENO preprocessor flag. changed not to support EF_newFrame() and EF_delFrame() by default. (2005-02-07, HA) applied bugfix posted by Luis Gonzalez. bug was occuring under SuSE Linux 9.1 when calling eftest with a higher number f.e. 10000. (2005-02-02, HA) bugfixed memalign() which was not exported as extern "C". this bug lead to crashes when freeing memory allocated by memalign(). bug was reported by Grant Goodyear and Steven G. Johnson. now defining macros/functions also for valloc() (2005-02-03, HA) 2.4.12 added EF_NO_GLOBAL_MALLOC_FREE preprocessor flag to workaround buggy environments: no malloc(),free(),realloc(),calloc() are put into the global namespace of the efence library, thus only files which include efence.h call the efence malloc(),.. replacement functions. this flag is also helpful where linking order cannot get controlled f.e. when memory is allocated from a library not using efence but free is called from efence using efence. this is a problem when using .dll libraries which are linked against msvcrt.dll and its malloc/free under MS Windows. the same problem applies when libstdc++ / libgcc is not linked in correct order. (2005-01-04, HA) 2.4.11 bugfixed signal handling in confidence test (eftest), which lead to false errors with my newly installed MandrakeLinux 10.1 (2005-01-03, HA) bugfixed checking at free(), when EF_PROTECT_BELOW flag changed: which lead to false positives. bugfixed error message output to stderr: length of messages were calculated too short. fixed functions EF_Abort() and EF_Exit(). (2004-08-15, HA) 2.4.10 added preprocessor macros for CA_DECLARE, CA_DEFINE, CA_REF in efence.h for declaration, definition and reference to Checked Arrays. these macros allow checks of arrays which are allocated on stack, but they are very slow on references cause every reference has to be checked. added EF_ASSERT() which definitely halts (for debugging) precompiled headers have to be switched off in MS Visual C++ to get all the C++ operators to work. but don't ask me why! implemented all the various new/delete/new[]/delete[] C++ operators. the implementations are not C++ conform concerning their behaviour added type mismatch detection between malloc()/free(), new/delete, new[]/delete[]. This is deactivated when EF_NO_LEAKDETECTION is set. added EF_MALLOC_FAILEXIT parameter. (for now not implemented) extended semantics of EF_PROTECT_FREE. added EF_MAX_ALLOC parameter. bugfix: why should we ever use Page_Delete() when setting up the "dead" page? bugfix: EF_PROTECT_FREE did exactly the opposite of that, what it should do up from Bruce's version 2.2.2 maybe earlier. (2004-07-16, HA) confidence test now PASSes again removed problems when used EF_NO_LEAKDETECTION preprocessor flag got Makefile to work again, also included automatic generation of efence_config.h added automatic generation and inclusion of efence_config.h instead function Page_Size() (2004-07-15, HA) added code for thread safety: only one thread at once is allowed to enter some internal functions. this can be deactivated using the EF_NO_THREAD_SAFETY preprocessor flag. there may be flaws concering threads, when using the c++ operators for leak detection: use the EF_NO_LEAKDETECTION preprocessor flag if you encounter problems! some files (page.c and print.c) have turned to header files, the needed functions are now declared static and are no more visible outside efence.c this way the NDEBUG preprocessor flag has been replaced by EF_NO_EFENCE, EF_NO_CPP_SUPPORT. so be careful not to include efence in your release builds! (2004-03-21, HA) 2.4.9 added checks for no mans land (= space which cannot get protected from the MMU): this area gets filled with EF_FILL on allocation, and gets checked on deallocation. (2002-12-04, HA) 2.4.8 one big fix and many improvements for C++ code. old macros NEW_ELEM, NEW_ARRAY were not usable when allocating classes, which have constructor/destructor. the usage of these macros has not changed (see 2.4.3). (2002-12-04, HA) 2.4.7 get to work with Borland Free Commandline Tools: Borland C++ Builder 5.5 thrown away unnecessary declarations of malloc(), free(), .. Borland didn't like them, and neither MS-Visual C++ 6.0 nor gcc (Dev-C++) needs them. added project files in subdir "win32-vide" for VIDE 1.24 using Borland C++ Builder 5.5 (see http://www.objectcentral.com) (2002-11-22, HA) 2.4.6 remove memory leak in eftest allowed re-inclusion of efence.h after inclusion of efenceint.h added some project files in subdir "win32-devcpp" for Dev-C++ 4.9.6 using gcc (see http://www.bloodshed.net) and saved its generated makefiles left tstheap's memory leaks (2002-11-17, HA) 2.4.5 modifications in print routines (EF_Print, EF_Abort, ..) added direct output to visual c++ debug output window. some additions to Makefile (2002-11-17, HA) 2.4.4 several modifications seperation of c++ files: efencepp.h, efencepp.cpp renamed EF_push()/EF_pop() to EF_newFrame()/EF_delFrame() new compile option "EF_NO_LEAKDETECTION" new compile option "EF_NO_CPP" splitted efence.h to efence.h and efenceint.h added Copyright and License information to many files renamed COPYING to COPYING-GPL (2002-11-03, HA) 2.4.3 added following PreProcessor Macros for Release and Debug Mode #define NEW_ELEM(TYPE) new TYPE #define NEW_ARRAY(TYPE,COUNT) new (TYPE)[COUNT] #define DEL_ELEM(PTR) delete PTR #define DEL_ARRAY(PTR) delete []PTR which are mapped to malloc() and free() in Debug Mode. Use these macros to get filename and linenumber of a C++ style memory leak. (2002-10-07, HA) 2.4.2 added support for implicit and explicit leak checking: void EF_push(void) creates a new memory frame. void EF_pop(void) checks for memory leaks allocated after EF_push(). this function is called automatically onexit(), even without EF_push(). (2002-10-07, HA) 2.4.1 Port to Windows (NT/2000/XP) by adding sections to following functions: Page_AllowAccess(), Page_Create(), Page_Delete(), Page_DenyAccess(), Page_Size() (2002-10-06, HA) 2.4.0 added support for C++ operators new, new[], delete and delete[]. added some project files in subdir "win32-msvc" for MS-Visual C++ 6.0 (2002-10-03, HA) 2.2.2 Oops. Shared library must be position-independent code. 2.2.0 Merge in bug-fixes, multi-thread patch, shared library patch, debian/ subdirectory used for building the Debian package 2.0.1 Add work-arounds for kernel and library bugs under HP-UX. HP has been notified and will repair these soon. 2.0.2 Add support for DEC Alpha. Add %a pattern for printing addresses, which assumes they are passed in a void *. 2.0.3 30-Sep-1993 When realloc is passed a zero address, it should work the same way as malloc(). Fix forward declaration of mprotect() in page.c to use void *, not caddr_t, for addresses. IRIX 5.0.1 complained about that. 2.0.4 29-May-1994 Don't attempt to allow access to a zero-sized page when EF_ALLOW_MALLOC_0 is set. Attempt to un-map memory from Page_Delete(). If that doesn't work, fall back by protecting the page from all references. Un-mapping small segments of a mapping used to crash my SGI IRIX 5.0 system. I assume that nobody is running 5.0 any longer. 2.0.5 20-January-1995 Port to Linux. duma-VERSION_2_5_21/COPYING-GPL000066400000000000000000000430761401225056000155560ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. duma-VERSION_2_5_21/COPYING-LGPL000066400000000000000000000634741401225056000156760ustar00rootroot00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! duma-VERSION_2_5_21/GNUmakefile000066400000000000000000000502151401225056000161460ustar00rootroot00000000000000# DUMA configuration: # # add "-DDUMA_NO_GLOBAL_MALLOC_FREE" (without quotes) # for not defining malloc/free in global namespace # # add "-DDUMA_EXPLICIT_INIT" (without quotes) # to do all the "risky" stuff getenv(), sem_init(), write() .. explicitly # from main(). # you have to call duma_init() explicitly from main() this option also # avoids leak error messages for allocations before duma_init() got called. # this helps for leaky standard environments. # # add "-DDUMA_NO_THREAD_SAFETY" (without quotes) # for not supporting multi-threading # # add "-DDUMA_SO_NO_CPP_SUPPORT" or "-DDUMA_LIB_NO_CPP_SUPPORT" (without quotes) # for not directing new/delete to malloc/free # # add "-DDUMA_SO_NO_LEAKDETECTION" or "-DDUMA_LIB_NO_LEAKDETECTION" (without quotes) # if you don't want support for leak detection # # add "-DDUMA_SO_PREFER_ATEXIT" or "-DDUMA_LIB_PREFER_ATEXIT" (without quotes) # if you prefer atexit() over GNU Compiler's function attribute "destructor" # # add "-DDUMA_SO_PREFER_GETENV" or "-DDUMA_LIB_PREFER_GETENV" (without quotes) # if you prefer standard C library getenv() over global char **environ # # add "-DDUMA_OLD_NEW_MACRO" (without quotes) # if you want to use DUMA's old style NEW_ELEM() / NEW_ARRAY() macros. # when not defining this option, a standard conform new syntax can get used. # unfortunately you have to use DEL_ELEM/DEL_ARRAY further to utilize # filename and linenumber of deallocation calls # # add "-DDUMA_SO_NO_HANG_MSG" or "-DDUMA_LIB_NO_HANG_MSG" (without quotes) # set this if you want to suppress the extra messages around atexit(). # # add "-DDUMA_NO_STRERROR" (without quotes) # set this if you want to suppress calls to strerror() to avoid recursion # on specific platforms. # ######################################## # # preprocessor flags for building the shared library (DUMA_SO_LIBRARY): # - DUMA_SO_NO_CPP_SUPPORT # - DUMA_SO_NO_LEAKDETECTION # - DUMA_SO_PREFER_ATEXIT # - DUMA_SO_PREFER_GETENV # - DUMA_SO_NO_HANG_MSG # # preprocessor flags for building the static library: # - DUMA_LIB_NO_CPP_SUPPORT # - DUMA_LIB_NO_LEAKDETECTION # - DUMA_LIB_PREFER_ATEXIT # - DUMA_LIB_PREFER_GETENV # - DUMA_LIB_NO_HANG_MSG # - DUMA_NO_GLOBAL_MALLOC_FREE # - DUMA_EXPLICIT_INIT # - DUMA_NO_THREAD_SAFETY # - DUMA_OLD_NEW_MACRO # - DUMA_OLD_DEL_MACRO # - DUMA_NO_STRERROR # ######################################## # edit following line DUMA_OPTIONS= # no leak detection on any platform: # use static library for finding leaks - with information memory was allocated # i think leak-checking without further information is quite useless! # additionaly too many platforms/environments are broken. DUMA_OPTIONS += -DDUMA_SO_NO_LEAKDETECTION # some test cases: #DUMA_OPTIONS += -DDUMA_LIB_NO_LEAKDETECTION #DUMA_OPTIONS += -DDUMA_NO_THREAD_SAFETY #DUMA_OPTIONS += -DDUMA_NO_CPP_SUPPORT PIC=-fPIC -DPIC DUMA_SO_OPTIONS=$(PIC) -DDUMA_SO_LIBRARY # for FreeBSD 5.4 # DUMA_OPTIONS += -DPAGE_PROTECTION_VIOLATED_SIGNAL=SIGBUS # # for FreeBSD 5.4 if DUMA_EXPLICIT_INIT is not set # DUMA_OPTIONS += -DDUMA_NO_LEAKDETECTION # # for cygwin environment on Windows # DUMA_OPTIONS += -DDUMA_EXPLICIT_INIT # also define 'WIN32' # some defaults: INSTALL=install RM=rm RMFORCE=rm -f ECHO=echo ECHOLF=echo . CC=cc CXX=c++ LD=ld AR=ar RANLIB=ranlib INSTALL=install ifndef $(OS) OS=$(shell uname -s 2>/dev/null | tr '[:upper:]' '[:lower:]' 2>/dev/null || true) endif # dynamic dependencies DUMA_DYN_DEPS=$(DUMASO) tstheap_so$(EXEPOSTFIX) dumatestpp_so$(EXEPOSTFIX) # some OS specifics: ifeq ($(OS), windows_nt) ifeq ($(OSTYPE), msys) $(info using settings for OS=Windows_NT, OSTYPE=msys) # call mingw32-make OSTYPE=msys # from Windows command prompt # having added the PATH for MINGW/bin # using explicit initialization to avoid leak report # from __w32_sharedptr_initialize() function BSWITCH=101 DUMA_OPTIONS += -DDUMA_EXPLICIT_INIT RM=del RMFORCE=del /F 2>nul ECHO=echo ECHOLF=echo . CURPATH= DUMA_DYN_DEPS= DUMASO= CFLAGS=-g -O0 CPPFLAGS=-g -O0 LIBS= EXEPOSTFIX=.exe endif ifeq ($(OSTYPE), msys-sh) $(info using settings for OS=Windows_NT, OSTYPE=msys-sh) # call mingw32-make OSTYPE=msyssh # from MSYS shell # having added the PATH for MINGW/bin # using explicit initialization to avoid leak report # from __w32_sharedptr_initialize() function BSWITCH=102 DUMA_OPTIONS += -DDUMA_EXPLICIT_INIT CC=mingw32-gcc CXX=mingw32-g++ RM=rm RMFORCE=rm -f ECHO=echo ECHOLF=echo CURPATH=./ DUMA_DYN_DEPS= DUMASO= CFLAGS=-g -O0 CPPFLAGS=-g -O0 LIBS= EXEPOSTFIX=.exe endif ifeq ($(OSTYPE), cygwin) $(info using settings for OS=Windows_NT, OSTYPE=cygwin) # call make OSTYPE=cygwin BSWITCH=103 DUMA_OPTIONS += -DDUMA_EXPLICIT_INIT CURPATH=./ DUMA_DYN_DEPS= DUMASO= CFLAGS=-g -O0 -DWIN32 -Wall -Wextra CPPFLAGS=-g -O0 -DWIN32 -Wall -Wextra LIBS= EXEPOSTFIX=.exe endif ifndef BSWITCH $(info using settings for OS=Windows_NT) BSWITCH=100 DUMA_OPTIONS += -DDUMA_EXPLICIT_INIT CURPATH=./ DUMA_DYN_DEPS= DUMASO= CFLAGS=-g -O0 -DWIN32 CPPFLAGS=-g -O0 -DWIN32 LIBS= EXEPOSTFIX=.exe endif endif ifeq ($(OS), darwin) $(info using settings for OS=darwin) # call: make OS=darwin BSWITCH=210 DUMA_OPTIONS += -DPAGE_PROTECTION_VIOLATED_SIGNAL=SIGBUS DUMA_OPTIONS += -DDUMA_SO_PREFER_GETENV # DUMA_OPTIONS += -DDUMA_LIB_NO_LEAKDETECTION CURPATH=./ # DUMA_DYN_DEPS= DUMASO=libduma.dylib DUMASO_LINK1=libduma.dylib CFLAGS=-g -O0 CPPFLAGS=-g -O0 LIBS=-lpthread EXEPOSTFIX= endif ifeq ($(OS), freebsd) $(info using settings for OS=freebsd) BSWITCH=310 DUMA_OPTIONS += -DDUMA_NO_THREAD_SAFETY DUMA_OPTIONS += -DDUMA_EXPLICIT_INIT CURPATH=./ DUMA_DYN_DEPS= DUMASO= DUMASO_LINK1= CFLAGS=-g -O0 CPPFLAGS=-g -O0 LIBS=-lpthread EXEPOSTFIX= endif ifeq ($(OS), netbsd) $(info using settings for OS=netbsd) BSWITCH=320 CURPATH=./ DUMASO=libduma.so.0.0.0 DUMASO_LINK1=libduma.so.0 DUMASO_LINK2=libduma.so CFLAGS=-g -O0 CPPFLAGS=-g -O0 LIBS=-lpthread EXEPOSTFIX= endif ifeq ($(OS), solaris) $(info using settings for OS=solaris) BSWITCH=410 DUMA_OPTIONS += -DDUMA_NO_STRERROR CURPATH=./ DUMA_DYN_DEPS= DUMASO=libduma.so.0.0.0 DUMASO_LINK1=libduma.so.0 DUMASO_LINK2=libduma.so CFLAGS=-g -O0 CPPFLAGS=-g -O0 LDFLAGS += -lgcc_s LDOPTIONS += -lgcc_s LIBS=-Wl,-R/opt/sfw/lib -lpthread EXEPOSTFIX= endif ifeq ($(OS), linux) ifeq ($(shell $(CXX) -v 2>&1 | grep -c "clang version"), 1) COMPILERX := clang++ else COMPILERX := g++ endif export COMPILERX ifeq ($(shell $(CC) -v 2>&1 | grep -c "clang version"), 1) COMPILER := clang else COMPILER := gcc endif export COMPILER CC=${COMPILER} CXX=${COMPILERX} $(info using CC=${COMPILER}) $(info using CXX=${COMPILERX}) ifeq ($(OSTYPE), pie) $(info using settings for OS=linux, OSTYPE=pie) # Linux PIE-mode with GNU compiler and GNU tools. CC=${COMPILER} -fpie -fPIE CXX=${COMPILERX} -fpie -fPIE BSWITCH=510 else $(info using settings for OS=linux) CC=${COMPILER} CXX=${COMPILERX} BSWITCH=610 endif CURPATH=./ DUMASO=libduma.so.0.0.0 DUMASO_LINK1=libduma.so.0 DUMASO_LINK2=libduma.so CFLAGS=-g -O0 -Wall -Wextra CPPFLAGS=-g -O0 -Wall -Wextra LIBS=-lpthread EXEPOSTFIX= RM=rm RMFORCE=rm -f ECHO=echo ECHOLF=printf '\n' endif ifndef BSWITCH # default is generic full "UNIX" BSWITCH=810 $(warning using default options. OS/OSTYPE not set or contain unknown values!) CURPATH=./ DUMASO=libduma.so.0.0.0 DUMASO_LINK1=libduma.so.0 DUMASO_LINK2=libduma.so CFLAGS=-g -O0 -Wall -Wextra CPPFLAGS=-g -O0 -Wall -Wextra LIBS=-lpthread EXEPOSTFIX= endif ifndef HOST_CFLAGS HOST_CFLAGS=$(CFLAGS) endif ifndef CC_FOR_BUILD CC_FOR_BUILD=$(CC) endif ############################################################ ifndef prefix prefix=/usr $(info using default prefix [$(prefix)]) endif MAN_INSTALL_DIR=$(prefix)/share/man/man3 DOC_INSTALL_DIR=$(prefix)/share/doc/duma ifndef srcdir srcdir=. $(info using default srcdir [$(srcdir)]) endif ifndef exec_prefix exec_prefix=$(prefix) $(info using default exec_prefix [$(exec_prefix)]) endif # The directory for installing executable programs that users can run. ifndef bindir bindir=$(exec_prefix)/bin endif # The directory for installing read-only architecture independent data files. ifndef datadir datadir=$(prefix)/share endif # The directory for installing read-only data files that pertain to a single machine--that is to say, files for configuring a host. ifndef sysconfdir sysconfdir=$(prefix)/etc endif # The directory for object files and libraries of object code. ifndef libdir libdir=$(exec_prefix)/lib endif # The directory for installing header files to be included by user programs with the C `#include' preprocessor directive. ifndef includedir includedir=$(prefix)/include endif PACKAGE_SOURCE=README.txt CHANGELOG LICENSE COPYING-GPL COPYING-LGPL duma.3 GNUmakefile gdbinit.rc \ duma.h dumapp.h duma_sem.h paging.h print.h duma_hlp.h noduma.h \ duma.c dumapp.cpp sem_inc.c print.c \ tests/dumatest.c tests/tstheap.c tests/thread-test.c tests/testmt.c tests/dumatestpp.cpp tests/testoperators.cpp \ createconf.c make_git_source_version.sh OBJECTS=dumapp.o duma.o sem_inc.o print.o SO_OBJECTS=dumapp_so.o duma_so.o sem_inc_so.o print_so.o # Make all the top-level targets the makefile knows about. all: verinfo.h libduma.a $(DUMA_DYN_DEPS) @ $(ECHO) "Build complete - you can now run make test." # Perform self tests on the program this makefile builds. check test: tstheap$(EXEPOSTFIX) dumatest$(EXEPOSTFIX) thread-test$(EXEPOSTFIX) testmt$(EXEPOSTFIX) dumatestpp$(EXEPOSTFIX) testoperators$(EXEPOSTFIX) $(DUMA_DYN_DEPS) @ $(ECHOLF) @ $(ECHO) "Testing DUMA (static library):" $(CURPATH)dumatest$(EXEPOSTFIX) @ $(ECHOLF) $(CURPATH)tstheap$(EXEPOSTFIX) 3072 @ $(ECHOLF) $(CURPATH)testoperators$(EXEPOSTFIX) @ $(ECHOLF) @ $(ECHO) "DUMA static confidence test PASSED." ifdef DUMASO @ $(ECHOLF) @ $(ECHO) "Testing DUMA (dynamic library)." ifeq ($(OS), solaris) LD_PRELOAD=./$(DUMASO) DYLD_INSERT_LIBRARIES=./$(DUMASO) DYLD_FORCE_FLAT_NAMESPACE=1 exec $(CURPATH)tstheap_so 3072 else (export LD_PRELOAD=./$(DUMASO); export DYLD_INSERT_LIBRARIES=./$(DUMASO); export DYLD_FORCE_FLAT_NAMESPACE=1 ; exec $(CURPATH)tstheap_so 3072) endif @ $(ECHOLF) @ $(ECHO) "DUMA dynamic confidence test PASSED." @ $(ECHOLF) @ $(ECHO) "You may now run make install and then installcheck" @ $(ECHOLF) endif # Perform installation tests (if any). # The user must build and install the program before running the tests. installcheck: ifdef DUMASO @ $(ECHOLF) @ $(ECHO) "Testing installed DUMA (dynamic library)." @ $(bindir)/duma $(CURPATH)tstheap_so 3072 @ $(ECHOLF) @ $(ECHO) "DUMA installcheck test PASSED." @ $(ECHOLF) endif # Print variables of GNUmakefile printvars: @echo OS [$(OS)] @echo OSTYPE [$(OSTYPE)] @echo bswitch [$(BSWITCH)] @echo srcdir [$(srcdir)] @echo prefix [$(prefix)] @echo exec_prefix [$(exec_prefix)] @echo bindir [$(bindir)] @echo datadir [$(datadir)] @echo sysconfdir [$(sysconfdir)] @echo libdir [$(libdir)] @echo includedir [$(includedir)] ifneq ($(oldincludedir),) @echo oldincludedir [$(oldincludedir)] else @echo oldincludedir empty endif @echo MAN_INSTALL_DIR [$(MAN_INSTALL_DIR)] @echo DOC_INSTALL_DIR [$(DOC_INSTALL_DIR)] @echo MAKE [$(MAKE)] @echo CC [$(CC)] @echo CFLAGS [$(CFLAGS)] @echo CXX [$(CXX)] @echo CPPFLAGS [$(CPPFLAGS)] @echo LD [$(LD)] @echo AR [$(AR)] @echo LIBS [$(LIBS)] @echo RANLIB [$(RANLIB)] @echo INSTALL [$(INSTALL)] @echo RM [$(RM)] @echo RMFORCE [$(RMFORCE)] @echo ECHO [$(ECHO)] @echo ECHOLF [$(ECHOLF)] @echo PIC [$(PIC)] @echo EXEPOSTFIX [$(EXEPOSTFIX)] @echo CURPATH [$(CURPATH)] @echo DUMA_OPTIONS [$(DUMA_OPTIONS)] @echo DUMA_SO_OPTIONS [$(DUMA_SO_OPTIONS)] @echo OBJECTS [$(OBJECTS)] @echo SO_OBJECTS [$(SO_OBJECTS)] @echo DUMASO [$(DUMASO)] @echo DUMASO_LINK1 [$(DUMASO_LINK1)] @echo DUMASO_LINK2 [$(DUMASO_LINK2)] @echo DUMA_DYN_DEPS [$(DUMA_DYN_DEPS)] @echo PACKAGE_SOURCE [$(PACKAGE_SOURCE)] # Print filenames unknown to git printuk: - git status -s --untracked-files=all 2>/dev/null | grep '^? ' # Print filenames known to git but not "up-to-date" (modified) printmod: - git status -s 2>/dev/null |grep '^\ \?M ' # Copy the executable file into a directory that users typically search for # commands; copy any auxiliary files that the executable uses into the # directories where it will look for them. install: libduma.a duma.3 $(DUMASO) - mkdir -p $(DESTDIR)$(DOC_INSTALL_DIR) $(INSTALL) -m 644 README.txt $(DESTDIR)$(DOC_INSTALL_DIR) - mkdir -p $(DESTDIR)$(includedir) $(INSTALL) -m 644 noduma.h duma.h dumapp.h duma_sem.h duma_config.h $(DESTDIR)$(includedir) - mkdir -p $(DESTDIR)$(bindir) $(INSTALL) -m 755 duma.sh $(DESTDIR)$(bindir)/duma - mkdir -p $(DESTDIR)$(libdir) $(INSTALL) -m 644 libduma.a $(DESTDIR)$(libdir) ifdef DUMASO $(INSTALL) -m 755 $(DUMASO) $(DESTDIR)$(libdir) endif ifdef DUMASO_LINK1 - $(RMFORCE) $(DESTDIR)$(libdir)/$(DUMASO_LINK1) ln -s $(DUMASO) $(DESTDIR)$(libdir)/$(DUMASO_LINK1) endif ifdef DUMASO_LINK2 - $(RMFORCE) $(DESTDIR)$(libdir)/$(DUMASO_LINK2) ln -s $(DUMASO) $(DESTDIR)$(libdir)/$(DUMASO_LINK2) endif - mkdir -p $(DESTDIR)$(MAN_INSTALL_DIR) $(INSTALL) -m 644 duma.3 $(DESTDIR)/$(MAN_INSTALL_DIR)/duma.3 # Delete all the installed files that the `install' target would create uninstall: - $(RMFORCE) $(DESTDIR)$(DOC_INSTALL_DIR)/README.txt - $(RMFORCE) $(DESTDIR)$(includedir)/noduma.h - $(RMFORCE) $(DESTDIR)$(includedir)/duma.h - $(RMFORCE) $(DESTDIR)$(includedir)/dumapp.h - $(RMFORCE) $(DESTDIR)$(includedir)/duma_sem.h - $(RMFORCE) $(DESTDIR)$(includedir)/duma_config.h - $(RMFORCE) $(DESTDIR)$(bindir)/duma - $(RMFORCE) $(DESTDIR)$(libdir)/libduma.a ifdef DUMASO - $(RMFORCE) $(DESTDIR)$(libdir)/$(DUMASO) endif ifdef DUMASO_LINK1 - $(RMFORCE) $(DESTDIR)$(libdir)/$(DUMASO_LINK1) endif ifdef DUMASO_LINK2 - $(RMFORCE) $(DESTDIR)$(libdir)/$(DUMASO_LINK2) endif - $(RMFORCE) $(DESTDIR)$(MAN_INSTALL_DIR)/duma.3 # Delete all files that are normally created by running make. clean: - $(RMFORCE) $(OBJECTS) $(SO_OBJECTS) tstheap.o dumatest.o thread-test.o testmt.o dumatestpp.o \ tstheap_so.o dumatestpp_so.o testoperators.o \ tstheap$(EXEPOSTFIX) tstheap_so$(EXEPOSTFIX) dumatest$(EXEPOSTFIX) dumatestpp$(EXEPOSTFIX) dumatestpp_so$(EXEPOSTFIX) testoperators$(EXEPOSTFIX) \ thread-test$(EXEPOSTFIX) testmt$(EXEPOSTFIX) \ libduma.a $(DUMASO) libduma.cat DUMA.shar # Any of these targets might be defined to delete more files than `clean' does. # For example, this would delete configuration files or links that you would # normally create as preparation for compilation, even if the makefile itself # cannot create these files. distclean realclean clobber: clean - $(RMFORCE) duma_config.h verinfo.h createconf.o createconf$(EXEPOSTFIX) roff: nroff -man < duma.3 > duma.cat DUMA.shar: $(PACKAGE_SOURCE) shar $(PACKAGE_SOURCE) > DUMA.shar shar: DUMA.shar libduma.a: duma_config.h verinfo.h $(OBJECTS) - $(RMFORCE) libduma.a $(AR) crv libduma.a $(OBJECTS) $(RANLIB) libduma.a verinfo.h: FORCE - $(CURPATH)make_git_source_version.sh > $(CURPATH)verinfo.h $(shell touch verinfo.h || true) duma_config.h: $(MAKE) reconfig reconfig: createconf$(EXEPOSTFIX) createconf.o createconf.c - $(CURPATH)createconf$(EXEPOSTFIX) dos2unix: @ dos2unix --d2u $(PACKAGE_SOURCE) createconf$(EXEPOSTFIX): createconf.o - $(RMFORCE) createconf$(EXEPOSTFIX) $(CC_FOR_BUILD) $(HOST_CFLAGS) $(DUMA_OPTIONS) createconf.o -o createconf$(EXEPOSTFIX) tstheap$(EXEPOSTFIX): libduma.a tstheap.o - $(RMFORCE) tstheap$(EXEPOSTFIX) $(CC) $(CFLAGS) tstheap.o libduma.a -o tstheap$(EXEPOSTFIX) $(LIBS) dumatest$(EXEPOSTFIX): libduma.a dumatest.o - $(RMFORCE) dumatest$(EXEPOSTFIX) $(CC) $(CFLAGS) dumatest.o libduma.a -o dumatest$(EXEPOSTFIX) $(LIBS) dumatestpp$(EXEPOSTFIX): libduma.a dumatestpp.o duma_sem.h dumapp.h - $(RMFORCE) dumatestpp$(EXEPOSTFIX) $(CXX) $(CPPFLAGS) dumatestpp.o libduma.a -o dumatestpp$(EXEPOSTFIX) $(LIBS) thread-test$(EXEPOSTFIX): libduma.a thread-test.o - $(RMFORCE) thread-test$(EXEPOSTFIX) $(CC) $(CFLAGS) thread-test.o libduma.a -o thread-test$(EXEPOSTFIX) $(LIBS) testmt$(EXEPOSTFIX): libduma.a testmt.o - $(RMFORCE) testmt$(EXEPOSTFIX) $(CC) $(CFLAGS) testmt.o libduma.a -o testmt$(EXEPOSTFIX) $(LIBS) testoperators$(EXEPOSTFIX): libduma.a testoperators.o duma_sem.h dumapp.h - $(RMFORCE) testoperators$(EXEPOSTFIX) $(CXX) $(CPPFLAGS) testoperators.o libduma.a -o testoperators$(EXEPOSTFIX) $(LIBS) testmemlimit$(EXEPOSTFIX): libduma.a testmemlimit.o - $(RMFORCE) testmemlimit$(EXEPOSTFIX) $(CC) $(CFLAGS) testmemlimit.o libduma.a -o testmemlimit$(EXEPOSTFIX) $(LIBS) tstheap_so$(EXEPOSTFIX): tstheap_so.o - $(RMFORCE) tstheap_so$(EXEPOSTFIX) $(CC) $(CFLAGS) tstheap_so.o -o tstheap_so$(EXEPOSTFIX) $(LIBS) dumatestpp_so$(EXEPOSTFIX): dumatestpp_so.o - $(RMFORCE) dumatestpp_so$(EXEPOSTFIX) $(CXX) $(CPPFLAGS) dumatestpp_so.o -o dumatestpp_so$(EXEPOSTFIX) $(LIBS) testmemlimit_so$(EXEPOSTFIX): testmemlimit_so.o - $(RMFORCE) testmemlimit_so$(EXEPOSTFIX) $(CC) $(CFLAGS) testmemlimit_so.o -o testmemlimit_so$(EXEPOSTFIX) $(LIBS) $(OBJECTS) tstheap.o dumatest.o thread-test.o testmt.o dumatestpp.o: duma.h ifeq ($(OS), windows_nt) # do nothing else ifeq ($(OS), darwin) $(DUMASO): duma_config.h verinfo.h $(SO_OBJECTS) $(CXX) -g -dynamiclib -Wl -o $(DUMASO) $(SO_OBJECTS) -lpthread -lc $(CXX) -g -dynamiclib -o $(DUMASO) $(SO_OBJECTS) -lpthread -lc else $(DUMASO): duma_config.h verinfo.h $(SO_OBJECTS) $(CXX) -g -shared -Wl,-soname,$(DUMASO) -o $(DUMASO) $(SO_OBJECTS) -lpthread -lc # $(CXX) -g -shared -o $(DUMASO) $(SO_OBJECTS) -lpthread -lc endif endif # # define rules how to build objects for createconf # createconf.o: $(CC_FOR_BUILD) $(HOST_CFLAGS) $(DUMA_OPTIONS) -c createconf.c -o $@ # # define rules how to build objects for shared library # dumapp_so.o: dumapp.cpp duma.h duma_sem.h dumapp.h $(CXX) $(CPPFLAGS) $(DUMA_SO_OPTIONS) -c dumapp.cpp -o $@ duma_so.o: duma.c duma.h duma_config.h verinfo.h $(CC) $(CFLAGS) $(DUMA_SO_OPTIONS) -c duma.c -o $@ sem_inc_so.o: sem_inc.c duma_sem.h $(CC) $(CFLAGS) $(DUMA_SO_OPTIONS) -c sem_inc.c -o $@ print_so.o: print.c print.h $(CC) $(CFLAGS) $(DUMA_SO_OPTIONS) -c print.c -o $@ # DUMA_SO_OPTIONS needed cause duma.h is included explicitly tstheap_so.o: $(CC) $(CFLAGS) $(DUMA_SO_OPTIONS) -c tests/tstheap.c -o $@ dumatestpp_so.o: $(CXX) $(CPPFLAGS) $(DUMA_SO_OPTIONS) -c tests/dumatestpp.cpp -o $@ testmemlimit_so.o: $(CC) $(CFLAGS) $(DUMA_SO_OPTIONS) -c tests/testmemlimit.c -o $@ # # define rules how to build objects for static library # dumapp.o: dumapp.cpp duma.h duma_sem.h dumapp.h $(CXX) $(CPPFLAGS) -c dumapp.cpp -o $@ duma.o: duma.c duma.h duma_config.h verinfo.h $(CC) $(CFLAGS) -c duma.c -o $@ sem_inc.o: sem_inc.c duma_sem.h $(CC) $(CFLAGS) -c sem_inc.c -o $@ print.o: print.c print.h $(CC) $(CFLAGS) -c print.c -o $@ # # define rules how to build the test objects # dumatest.o: tests/dumatest.c duma.h duma_config.h verinfo.h $(CC) $(CFLAGS) -c tests/dumatest.c -o $@ dumatestpp.o: tests/dumatestpp.cpp duma.h duma_sem.h dumapp.h duma_config.h verinfo.h $(CXX) $(CPPFLAGS) -c tests/dumatestpp.cpp -o $@ tstheap.o: tests/tstheap.c duma.h duma_config.h verinfo.h $(CC) $(CFLAGS) -c tests/tstheap.c -o $@ testoperators.o: tests/testoperators.cpp duma.h duma_sem.h dumapp.h duma_config.h verinfo.h $(CXX) $(CPPFLAGS) -c tests/testoperators.cpp -o $@ thread-test.o: tests/thread-test.c duma.h duma_config.h verinfo.h $(CC) $(CFLAGS) -c tests/thread-test.c -o $@ testmt.o: tests/testmt.c duma.h duma_config.h verinfo.h $(CC) $(CFLAGS) -c tests/testmt.c -o $@ # # default rules # #.c.o: # $(CC) $(CFLAGS) -c $< -o $@ # #.cpp.o: # $(CXX) $(CPPFLAGS) -c $< -o $@ # .PHONY: check test installcheck install uninstall clean distclean realclean clobber dos2unix printvars printuk printmod FORCE FORCE: duma-VERSION_2_5_21/INSTALL000066400000000000000000000050151401225056000151230ustar00rootroot00000000000000This documents describes if and how the library is installed on your system. I. Linux/Unix environments (including Cygwin and MinGW): Configure the options by editing the Makefile. Read carefully the description of options at top of the Makefile. Take care for the special OS/OSTYPE depending sections. Especially if you are going to use the LD_PRELOAD mechanism. Call GNU make often called 'gmake' for building the library. GNU make is called 'mingw32-make' for MinGW. Add option 'OSTYPE=msys' when calling make for MinGW from command prompt Add option 'OSTYPE=msys-sh' when calling make for MinGW from shell prompt Add option 'OSTYPE=cygwin' when calling make for Cygwin. Add option 'OS=osx' when calling make for MacOS X or Darwin. Add option 'OS=freebsd' when calling make for FreeBSD. Add option 'OS=netbsd' when calling make for NetBSD. Add option 'OS=solaris' when calling make for Solaris. Add option 'OS=linux' when calling make for Linux. Get system user with 'su' or 'sudo', if you are going to install into system directories Call 'make' or 'gmake install' to install into system directories. Note: You need not install DUMA. Setting system PATH for duma.sh or INCLUDE/LIBS variables after compilation may suffice, too. The (outdated) manual page should be installed as well. II. Windows 2000/XP, Visual Studio Environments: Compile and run 'createconf', that generates the file duma_config.h. Compile 'dumalib' and set the directories 'INCLUDE' and 'LIBS' in your environment or project. III. Solaris Environment: Add the location(s) of the GNU Toolchain (gmake, gcc, ar, ..) to the PATH: On my Solaris 10 installation with the Companion CD it is: /opt/sfw/bin and /opt/sfw/lib/bin Also notice that the Makefile has to contain some special settings so that the compiled executable can dynmically find and link to libstdc++. Have a look at the solaris section in DUMA's Makefile. IV. FreeBSD Environment: At least on my FreeBSD-6.2 installation i have to set the shell environment variable with 'export DUMA_DISABLE_BANNER=1' before running any programs linked with libduma.a. There seems to be an initialization problem with the pthreads library. V. NetBSD Environment: At least on my NetBSD-3.1 (HOSTTYPE=i386; OSTYPE=netbsdelf) installation i always get exactly one memory leak. I've not tested to install. Hayati Ayguen 15 September 2005, updated 31 July 2007 updated 11 August 2007 updated 18 August 2007 updated 28 August 2007 updated 17 March 2009 duma-VERSION_2_5_21/LICENSE000066400000000000000000001267101401225056000151050ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. ------------------------------------------------------------------------- GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! duma-VERSION_2_5_21/README.md000066400000000000000000000173301401225056000153540ustar00rootroot00000000000000# **D.U.M.A.** --- [![Codacy Badge](https://api.codacy.com/project/badge/Grade/f777934d666b4a6a9672d89b404c4953)](https://app.codacy.com/gh/johnsonjh/duma?utm_source=github.com&utm_medium=referral&utm_content=johnsonjh/duma&utm_campaign=Badge_Grade) [![License: GPL v2](https://img.shields.io/badge/License-GPL%20v2-blue.svg)](https://github.com/johnsonjh/duma/blob/master/COPYING-GPL) [![License: LGPL v2.1](https://img.shields.io/badge/License-LGPL%20v2.1-blue.svg)](https://github.com/johnsonjh/duma/blob/master/COPYING-LGPL) [![FOSSAStatus](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fjohnsonjh%2Fduma.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fjohnsonjh%2Fduma?ref=badge_shield) [![LocCount](https://img.shields.io/tokei/lines/github/johnsonjh/duma.svg)](https://github.com/XAMPPRocky/tokei) [![GitHubCodeSize](https://img.shields.io/github/languages/code-size/johnsonjh/OldCurve25519ScalarMult.svg)](https://github.com/johnsonjh/OldCurve25519ScalarMult) [![GitHubRelease](https://img.shields.io/github/release/johnsonjh/duma.svg)](https://github.com/johnsonjh/duma/releases/) [![LgtmAlerts](https://img.shields.io/lgtm/alerts/g/johnsonjh/duma.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/johnsonjh/duma/alerts/) [![CodacyBadge](https://api.codacy.com/project/badge/Grade/f777934d666b4a6a9672d89b404c4953)](https://app.codacy.com/gh/johnsonjh/duma?utm_source=github.com&utm_medium=referral&utm_content=johnsonjh/duma&utm_campaign=Badge_Grade) [![CodeBeat](https://codebeat.co/badges/a0be6809-acda-41a7-96a8-0d46698dc42c)](https://codebeat.co/projects/github-com-johnsonjh-duma-master) [![DeepScanGrade](https://deepscan.io/api/teams/12184/projects/15170/branches/299583/badge/grade.svg)](https://deepscan.io/dashboard#view=project&tid=12184&pid=15170&bid=299583) [![DeepSource](https://deepsource.io/gh/johnsonjh/duma.svg/?label=resolved+issues)](https://deepsource.io/gh/johnsonjh/duma/?ref=repository-badge) [![TickgitTODOs](https://img.shields.io/endpoint?url=https://api.tickgit.com/badge?repo=github.com/johnsonjh/duma)](https://www.tickgit.com/browse?repo=github.com/johnsonjh/duma) --- ## **Detect Unintended Memory Access** --- ### **_A Red-Zone memory allocator_** --- #### Introduction After deciding it was important to revive D.U.M.A., it quickly became clear continued use of the `cvs` version control system would be a limiting factor to the success of a new D.U.M.A. distribution. If the project was going to survive in the long-term, it would be necessary to perform a full conversion to a more modern, commonly used, and accessible VCS system. Unaware of the efforts of the [original author](https://github.com/hayguen/duma), I created this repository independently, and expended much effort to identify all contributors and authors of the many patches and contributions that had been produced by the community over many years. After many false starts, I'm now mostly satisfied with the end result - especially considering that many of my conclusions turned out to be very close (and sometimes identical) to those made in the original author's own conversion efforts. It should be noted that I had no special knowledge of this software, besides being a user, and no relationship or even any previous contact with the author. The most time consuming part of the conversion process was determining all the non-canonical changes, figuring out who actually wrote them, and finally deciding if these patches should be incorporated into a new official "mainline" repository. This process required more than a few "educated guesses", and, when the necessary details were not available, simple judgment calls. With such an old, widely distributed, and hacked-upon code-base, which survived as long as it did, without an official maintainer or source for new releases for many years, much of data available is fragmentary and conflicting. Sometimes, the only sources of information are the often fading memories of those originally involved with project. Often, inferences had to be made, usually based on incomplete and inaccurate information. Because of these uncertainties, I am certain that mistakes have been made and new errors introduced. I welcome any contributions from the public that would help to make the repository more historically accurate as well as improve functionality. --- #### The Future of D.U.M.A. A large task, not yet complete, is reconciling this reconstruction against the last version which was released by the [original author](https://github.com/hayguen/duma). The intention is to focus on correctly identifying any significant deviations, especially in regardings to the identification of contributors, and ensuring that any disputes that might arise are fairly handled. As new information becomes available, the commit logs for the project will be updated to provide an accurate record for posterity. The structure of this conversion very closely resembles that of the original `cvs` repository. In contrast, the orignal author's conversion efforts included a radical refactoring the source tree and directory structures. I believe that this was a prudent decision, and eventually plan to incorporate similar restructuring in this repository. While every attempt was been made to ensure correctness, especially when acknowledging contributors, extracting information where available from the original SourceForge site, random web forums, other `cvs`, `svn`, and, `git` repositories, and mailing lists archives, this release does incorporate changes that were never part of the original work, mostly to ensure compatability with modern systems operating systems and environments. --- #### Official D.U.M.A.? This repository should be considered the "official" source for D.U.M.A. releases. Hayati Ayguen, the original author, is no longer actively maintaining D.U.M.A. and has moved on to other projects. While he was happy to correspond about the project, it seems unlikely that he will take on the role of primary maintainer of the package. --- #### History D.U.M.A. started out as a fork of Bruce Perens' venerable "Electric Fence", a tool created at Pixar, back in 1987. D.U.M.A. was ported to Linux as early as 1992. --- #### Conclusion Now, almost 30 years later, we thank to Hayati Ayguen and all other contributors, who put time and effort into this project, but allow them move on to other endeavours. They can do so knowing that D.U.M.A. is not gone or forgotten. Even though it is a mature software and package, it will be properly maintained and updated as needed. --- #### Addendum For some additional information on the history of D.U.M.A. and Electric Fence, see , for short blog entry by Bruce Perens' mentioning the creation of his Electric Fence tool. The orginal author, [Hayati Ayguen](https://github.com/hayguen), remains an active developer. --- #### Availability ##### Source Code (Releases) - [GitHub Releases](https://github.com/johnsonjh/duma/releases/) ##### Source Code (Development Repositories) - [SourceHut Git](https://git.sr.ht/~trn/duma) - [GitHub](https://github.com/johnsonjh/duma) --- #### Issue Tracking - [GitLab Issue Tracker](https://github.com/johnsonjh/duma/issues) --- #### Security Policy - [Security Policy and Vulnerability Reporting](https://github.com/johnsonjh/duma/SECURITY.md) --- #### License - [GNU General Public License v2.0 (GPLv2)](https://tldrlegal.com/license/gnu-general-public-license-v2) - [GNU Lesser General Public License v2.1 (LGPLv2.1)]() - [![FOSSASmallStatus](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fjohnsonjh%2Fduma.svg?type=small)](https://app.fossa.com/projects/git%2Bgithub.com%2Fjohnsonjh%2Fduma?ref=badge_small) --- duma-VERSION_2_5_21/README.txt000066400000000000000000000760431401225056000156010ustar00rootroot00000000000000D.U.M.A. - Detect Unintended Memory Access - A Red-Zone memory allocator: DESCRIPTION: DUMA helps you detect two of the most common programming errors: 1. software that overruns the boundaries of a malloc() memory allocation, 2. software that touches memory allocations already released by free(). Unlike other malloc() debuggers, DUMA will detect read accesses as well as writes, and it will pinpoint the exact instruction that causes an error. It has been in use at Pixar since 1987, and at many other sites for years. DUMA uses the virtual memory hardware of your computer to place an inaccessible memory page immediately after (or before, at the user's option) each memory allocation. When software reads or writes this inaccessible page, the hardware issues a segmentation fault, stopping the program at the offending instruction. It is then trivial to find the erroneous statement using your favorite debugger. In a similar manner, memory that has been released by free() is made inaccessible, and any code that touches it will get a segmentation fault. Simply linking your application with libduma.a will allow you to detect most, but not all, malloc buffer overruns and accesses of free memory. If you want to be reasonably sure that you've found all bugs of this type, you'll have to read and understand the rest of this man page. USAGE: Link your program with the library libduma.a. Make sure you are not linking with '-lmalloc', '-lmallocdebug', or with other malloc-debugger or malloc-enhancer libraries. You can only use one at a time. If your system administrator has installed DUMA for public use, you'll be able to use the '-lduma' argument to the linker, otherwise you'll have to put the path-name for libduma.a in the linker's command line. You can also use dynamic linking. If you're using a Bourne shell, the statement 'export LD_PRELOAD=libduma.so.0.0' will cause DUMA to be loaded to run all dynamic executables. The command 'duma.sh ' runs a single command under DUMA. Some systems will require special arguments to the linker to assure that you are using the DUMA malloc() and not the one from your C library. Run your program using a debugger. It's easier to work this way than to create a core file and post-mortem debug it. DUMA can create huge core files, and some operating systems will thus take minutes simply to dump core! Some operating systems will not create usable core files from programs that are linked with DUMA. If your program has one of the errors detected by DUMA, it will get a segmentation fault (SIGSEGV) at the offending instruction. Use the debugger to locate the erroneous statement, and repair it. GLOBAL AND ENVIRONMENT VARIABLES: DUMA has several configuration switches that can be enabled via the shell environment. These switches change what bugs DUMA will detect, so it's important that you know how to use them. In older versions of DUMA you could set the value of global integer variables (using a debugger). In actual DUMA versions most of the global variables don't exist any more: they changed to thread local variables defined in structures. Instead you can call macro function to set some variables - but not from debugger! You can use the gdb command 'set environment variable value' to set shell environment variables only for the program you are going to debug. This is useful especially if you are using the shared DUMA library. DUMA_ALIGNMENT - This is an integer that specifies the alignment for any memory allocations that will be returned by malloc(), calloc(), and realloc(). The value is specified in bytes, thus a value of 4 will cause memory to be aligned to 32-bit boundaries unless your system doesn't have a 8-bit characters. DUMA_ALIGNMENT is set to the minimum required alignment specific to your environment by default. The minimum required alignment is detected by createconf and stored in the file duma_config.h. If your program requires that allocations be aligned to 64-bit boundaries you'll have to set this value to 8. This is the case when compiling with the '-mips2' flag on MIPS-based systems such as those from SGI. For some architectures the default is defined to even more - x86_64 uses alignment to 16 bytes by default. DUMA internally uses a smaller value if the requested memory size is smaller than the alignment value: the next smaller power of 2 is used. Thus allocating blocks smaller than DUMA_ALIGNMENT may result into smaller alignments - for example when allocating 3 bytes, they would be aligned to 2 byte boundary. This allows better detection of overrun. For this reason, you will sometimes want to set DUMA_ALIGNMENT to 1 (no alignment), so that you can detect overruns of less than your CPU's word size. Be sure to read the section 'WORD-ALIGNMENT AND OVERRUN DETECTION' in this manual page before you try this. To change this value, set DUMA_ALIGNMENT in the shell environment to an integer value, or call the macro function DUMA_SET_ALIGNMENT() from your code. You don't need to change this setting, if you just need bigger alignment for some special buffers. In this case you may use the function memalign(alignment, userSize). DUMA_PROTECT_BELOW - DUMA usually places an inaccessible page immediately after each memory allocation, so that software that runs past the end of the allocation will be detected. Setting DUMA_PROTECT_BELOW to 1 causes DUMA to place the inaccessible page before the allocation in the address space, so that under-runs will be detected instead of over-runs. To change this value, set DUMA_PROTECT_BELOW in the shell environment to an integer value, or call the macro function DUMA_SET_PROTECT_BELOW() from your code. DUMA_SKIPCOUNT_INIT - DUMA usually does its initialization with the first memory allocation. On some systems this may collide with initialization of pthreads or other libaries and produce a hang. To get DUMA work even in these situations you can control (with this environment variable) after how many allocations the full internal initialization of DUMA is done. Default is 0. DUMA_REPORT_ALL_LEAKS - DUMA usually reports only memory leaks where the source filename with line number of the allocating instruction is known. Setting this variable to 1 in shell environment reports all memory leaks. The default is 0 to avoid reporting of irrelevant memory leaks from system/compiler environment: there are many standard libraries leaking memory, which by default is no real problem as the system frees up all memory on program exit. DUMA_FILL - When set to a value between 0 and 255, every byte of allocated memory is initialized to that value. This can help detect reads of uninitialized memory. When set to -1, DUMA does not initialise memory on allocation. But some memory is filled with zeroes (the operating system default on most systems) and some memory will retain the values written to it during its last use. Per default DUMA will initialise all allocated bytes to 255 (=0xFF). To change this value, set DUMA_FILL in the shell environment to an integer value, or call the macro function DUMA_SET_FILL() from your code. DUMA_SLACKFILL - As DUMA internally allocates memory in whole pages, there retains an unused and unprotectable piece of memory: the slack or no mans land. Per default DUMA will initialise this area to 170 (=0xAA), which is 10101010 in binary representation. To change this value, set DUMA_SLACKFILL in the shell environment to an integer value. DUMA automatically checks this area, the no mans land, at deallocation. You can manually induce a check with the macro function DUMA_CHECK() for one memory block. With the macro function DUMA_CHECKALL() all memory blocks get checked. DUMA_CHECK_FREQ - First see DUMA_SLACKFILL above for definition of no mans land. Checking the integrity of the no mans land costs performance. This is why this is usually done only at deallocation of a memory block. Set this variable to let DUMA check all memory blocks no mans land every .th allocation or deallocation. Set this variable to 1, to let DUMA check at each allocation and deallocation. Per default the value 0 is used, which means to check only at deallocation. DUMA_ALLOW_MALLOC_0 - Memory allocation of size zero is ANSI conform. But often this is the result of a software bug. For this reason DUMA may trap such calls to malloc() with size zero. I leave this option disabled by default, but you are free to trap these calls setting the DUMA_ALLOC_MALLOC_0 in the shell environment to an integer value. DUMA_MALLOC_0_STRATEGY - This environment variable controls DUMA's behaviour on malloc(0): 0 - like having former ALLOW_MALLOC_0 = 0 ==> abort program with segfault 1 - return NULL pointer 2 - return always the same pointer to some protected page 3 - return mid address of a unique protected page (=default) ATTENTION: only 1 and 3 are ANSI conform. But value 1 will break most programs, cause value 3 strategy most system libraries use/implement. All returned pointers can be passed to free(). DUMA_NEW_0_STRATEGY - This environment variable controls DUMA's behaviour on C++ operator new with size zero: 2 - return always the same pointer to some protected page 3 - return mid address of a unique protected page (=default) ATTENTION: only 3 is standard conform. Value 2 may break some but will work for most programs. With value 2 you may reduce the memory consumption. DUMA_MALLOC_FAILEXIT - Many programs do not check for allocation failure. This often leads to delayed errors, no more understandable. Set this variable to a positive integer in the shell environment to exit the program immediately when memory allocation fails. This option is set by default. DUMA_PROTECT_FREE - DUMA usually returns free memory to a pool from which it may be re-allocated. If you suspect that a program may be touching free memory, set DUMA_PROTECT_FREE shell environment to -1. This is the default and will cause DUMA not to re-allocate any memory. For programs with many allocations and deallocations this may lead to the consumption of the full address space and thus to the failure of malloc(). To avoid such failures you may limit the amount of protected deallocated memory by setting DUMA_PROTECT_FREE to a positive value. This value in kB will be the limit for such protected free memory. A value of 0 will disable protection of freed memory. DUMA_MAX_ALLOC - This shell environment variable limits the total memory print of a program. This is another way to indirectly limit the sum of freed protected memory (see DUMA_PROTECT_FREE). By default there is no limit (=-1). A positive value is interpreted in kB, which stands for the sum of allocated and freed protected memory. DUMA_FREE_ACCESS - This is a debugging enhancer to catch deallocation of a memory block using watch expressions. DUMA does a write access to the first byte, which may lead a debugger to stop on a watch expression. You have to enable this by setting the shell environment variable to non zero. Default is disabled. DUMA_SHOW_ALLOC - Set this shell environment variable to non-zero to let DUMA print all allocations and deallocations to the console. Although this generates a lot of messages, this option can be useful to detect inefficient code containing many (de)allocations. This is switched off by default. DUMA_SUPPRESS_ATEXIT - Set this shell environment variable to non-zero when DUMA should skip the installation of its exit handler. The exit handler is called at the end of the main program and checks for memory leaks, so the handler's installation should *usually* not be suppressed. One reason for doing so regardless are some buggy environments, where calls to the standard C library's atexit()-function hangs. DUMA_DISABLE_BANNER - Set this shell environment variable to non-zero to suppress the usual startup message on console. Default is 0. DUMA_OUTPUT_DEBUG - Set this shell environment variable to non-zero to output all DUMA messages to the debugging console. This option is only available on Windows and is off by default. DUMA_OUTPUT_STDOUT - Set this shell environment variable to non-zero to output all DUMA messages to STDOUT. This option is off by default. DUMA_OUTPUT_STDERR - Set this shell environment variable to non-zero to output all DUMA messages to STDERR. This option is on by default. DUMA_OUTPUT_FILE - Set this shell environment variable to a filename where all DUMA messages should be written to. This option is off by default. DUMA_OUTPUT_STACKTRACE - Set this shell environment variable to non-zero to output a stacktrace of the allocation that is not free'd. This option is available only on Windows and is off by default. This option also requires a map file generated by the linker. DUMA_OUTPUT_STACKTRACE_MAPFILE - Set this shell environment variable to the map file, when it isn't found. This is very useful when using detours version of DUMA. This option is available only on Windows. DUMA_MEMCPY_OVERLAP - Set this shell environment variable to allow overlapping of memcpy regions if the destination address is less than source address. (workaround for ARM port memmove/memcpy implementation). WORD-ALIGNMENT AND OVERRUN DETECTION: There is a conflict between the alignment restrictions that malloc() operates under and the debugging strategy used by DUMA. When detecting overruns, DUMA malloc() allocates two or more virtual memory pages for each allocation. The last page is made inaccessible in such a way that any read, write, or execute access will cause a segmentation fault. Then, DUMA malloc() will return an address such that the first byte after the end of the allocation is on the inaccessible page. Thus, any overrun of the allocation will cause a segmentation fault. It follows that the address returned by malloc() is the address of the inaccessible page minus the size of the memory allocation. Unfortunately, malloc() is required to return word-aligned allocations, since many CPUs can only access a word when its address is aligned. The conflict happens when software makes a memory allocation using a size that is not a multiple of the word size, and expects to do word accesses to that allocation. The location of the inaccessible page is fixed by hardware at a word-aligned address. If DUMA malloc() is to return an aligned address, it must increase the size of the allocation to a multiple of the word size. In addition, the functions memalign() and valloc() must honor explicit specifications on the alignment of the memory allocation, and this, as well can only be implemented by increasing the size of the allocation. Thus, there will be situations in which the end of a memory allocation contains some padding space, and accesses of that padding space will not be detected, even if they are overruns. DUMA provides the variable DUMA_ALIGNMENT so that the user can control the default alignment used by malloc(), calloc(), and realloc(). To debug overruns as small as a single byte, you can set DUMA_ALIGNMENT to one. This will result in DUMA malloc() returning unaligned addresses for allocations with sizes that are not a multiple of the word size. This is not a problem in most cases, because compilers must pad the size of objects so that alignment restrictions are honored when storing those objects in arrays. The problem surfaces when software allocates odd-sized buffers for objects that must be word-aligned. One case of this is software that allocates a buffer to contain a structure and a string, and the string has an odd size (this example was in a popular TIFF library). If word references are made to un-aligned buffers, you will see a bus error (SIGBUS) instead of a segmentation fault. The only way to fix this is to re-write the offending code to make byte references or not make odd-sized allocations, or to set DUMA_ALIGNMENT to the word size. Another example of software incompatible with DUMA_ALIGNMENT < word-size is the strcmp() function and other string functions on SunOS (and probably Solaris), which make word-sized accesses to character strings, and may attempt to access up to three bytes beyond the end of a string. These result in a segmentation fault (SIGSEGV). The only way around this is to use versions of the string functions that perform byte references instead of word references. CATCHING THE ERRONEOUS LINE: To get the line in your sources, where an error occurs, go as following: 1. Compile your program with debugging information and statically linked to DUMA. 2. Start your program from debugger f.e. with 'gdb ' 3. Set program environment variables like 'set environment DUMA_PROTECT_BELOW 1' 4. set your program arguments with 'set args ..' 5. Run and wait for the segmentation fault alternatively 1. Compile your program (with debugging information) without DUMA. 2. Set 'ulimit -c unlimited' to get core files 3. Start your program, choose one of following options a) Start your program (linked statically with DUMA) b) Start your program with duma.sh 4. Wait for a segmentation fault. this should have created a core[.] file. You can get into a debugger f.e. with 'gdb -c ' INSTRUCTIONS FOR DEBUGGING YOUR PROGRAM: 1. Link with libduma.a as explained above. 2. Run your program in a debugger and fix any overruns or accesses to free memory. 3. Quit the debugger. 4. Set DUMA_PROTECT_BELOW = 1 in the shell environment. 5. Repeat step 2, this time repairing underruns if they occur. 6. Quit the debugger. 7. Read the restrictions in the section on alternatively read and install gdbinit.rc as ~/.gdbinit if you are using a GNU gdb based debugger WORD-ALIGNMENT AND OVERRUN DETECTION: See if you can set DUMA_ALIGNMENT to 1 and repeat step 2. Sometimes this will be too much work, or there will be problems with library routines for which you don't have the source, that will prevent you from doing this. MEMORY USAGE AND EXECUTION SPEED: Since DUMA uses at least two virtual memory pages for each of its allocations, it's a terrible memory hog. I've sometimes found it necessary to add a swap file using swapon(8) so that the system would have enough virtual memory to debug my program. Also, the way we manipulate memory results in various cache and translation buffer entries being flushed with each call to malloc or free. The end result is that your program will be much slower and use more resources while you are debugging it with DUMA. The Linux kernel also limits the number of different page mappings per process. Have a look for /proc/sys/vm/max_map_count f.e. under http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/en-US/Reference_Guide/s3-proc-sys-vm.html You may have to increase this value to allow debugging with DUMA with a command like: "sudo sysctl -w vm.max_map_count=1000000" Don't leave libduma.a linked into production software! Use it only for debugging. See section 'COMPILATION NOTES FOR RELEASE/PRODUCTION' below. MEMORY LEAK DETECTION: All memory allocation is protocoled from DUMA together with the filename and linenumber of the calling function. The atexit() function checks if each allocated memory block was freed. To disable leak detection add the preprocessor definition 'DUMA_SO_NO_LEAKDETECTION' or 'DUMA_LIB_NO_LEAKDETECTION' to DUMA_OPTIONS in Makefile. If a leak is reported without source filename and line number but is reproducible with the same pointer, set a conditional breakpoint on the function 'void * duma_alloc_return( void * address)' f.e. with gdb command 'break duma_alloc_return if address==0x123' C++ MEMORY OPERATORS AND LEAK DETECTION: Macros for "new" and "delete" are defined in dumapp.h. These macros give filename and linenumber of the calling functions to DUMA, thus allowing the same leak detection reports as for malloc and free. 'dumapp.h' needs to be included from your source file(s). For disabling the C++ new/delete/new[] and delete[] operators, add the preprocessor definition 'DUMA_NO_CPP_SUPPORT' to DUMA_OPTIONS in Makefile. DEFINITION OF OWN MEMBER NEW/DELETE OPERATORS: Definition of own member new/delete operators for a class will fail cause the new/delete keywords are defined as macros from DUMA. You will have to undefine DUMA's macros with following line: :#include "noduma.h" Then you have to call DUMA's operators directly inside your own definition. For using DUMA's C++ operators without having the preprocessor macros defined, following syntax can be used: (start code) // const char * file or __FILE__ macro // int line or __LINE__ macro ptr = new(file,line) type; // scalar new throwing bad_alloc() on error ptr = new(std::nothrow,file,line) type; // scalar new returning 0 on error operator delete(ptr,file,line); // scalar delete ptr = new(file,line) type[n]; // vector new throwing bad_alloc() on error ptr = new(std::nothrow,file,line) type[n]; // vector new returning 0 on error operator delete[](ptr, file,line); // vector delete (end code) The default syntax without file/line info can be used, too. PREPACKAGED RPM FILES FOR REDHAT & CO: You can download prepackaged .rpm files for RedHat, Fedora Core and similar systems from http://dries.ulyssis.org/apt/packages/duma/info.html Dries Verachtert wrote the .spec file. COMPILATION NOTES FOR VISUAL C++: Here some Compilation Notes for your Application in Debug Mode for the Microsoft Visual C++ (v6) Compiler: 1) Don't use Program Database for "Edit and Continue": Project-Options -> C++ -> General -> Debug-Info 2) Don't use the "multithreaded-dll" runtime library: Project-Options -> C++ -> Code Generation -> Runtime library 3) Switch off incremental linking Project-Options -> Linker -> General 4) Switch off precompiled headers: Project-Options -> C++ -> Precompiled Headers 5) Add following Linker option "/FORCE:MULTIPLE" Project-Options -> Linker -> General The labels may differ a bit cause i'm using the german version: Options in german language: 1) Projekteinstellungen -> C++ -> Kategorie =Allgemein -> Debug-Info =Programmdatenbank 2) Projekteinstellungen -> C++ -> Kategorie =Codegeneration -> Laufzeitbibliothek anpassen (Release/Debug), nicht die DLL-Variante verwenden 3) Projekteinstellungen -> Linker -> Kategorie =Allgemein - Inkrementelles Binden =Aus 4) Projekteinstellungen -> Linker -> Projekt Optionen "/FORCE:MULTIPLE" unten eingeben Now everything you have to do is to set a dependency to "duma" from your application. COMPILATION NOTES FOR RELEASE/PRODUCTION: Set the preprocessor definition #define DUMA_NO_DUMA in your Makefiles to disable DUMA usage and don't link with DUMA library. With DUMA_NO_DUMA-definition all DUMA macro functions get defined but do nothing. This way you don't have to change your code for release compilation even when using special DUMA macros. WARNINGS: I have tried to do as good a job as I can on this software, but I doubt that it is even theoretically possible to make it bug-free. This software has no warranty. It will not detect some bugs that you might expect it to detect, and will indicate that some non-bugs are bugs. FILES: /dev/zero: Source of memory pages (via mmap(2)). SEE ALSO: malloc(3), mmap(2), mprotect(2), swapon(8) DIAGNOSTICS: Segmentation Fault: Examine the offending statement for violation of the boundaries of a memory allocation. Bus Error: See the section on WORD-ALIGNMENT AND OVERRUN DETECTION in this manual page. BUGS: My explanation of the alignment issue could be improved. Some Sun systems running SunOS 4.1 were reported to signal an access to a protected page with 'SIGBUS' rather than 'SIGSEGV', I suspect this is an undocumented feature of a particular Sun hardware version, not just the operating system. On these systems, dumatest will fail with a bus error until you modify the Makefile to define PAGE_PROTECTION_VIOLATED_SIGNAL as SIGBUS. There are, without doubt, other bugs and porting issues. Please contact me via e-mail if you have any bug reports, ideas, etc. OTHER ALTERNATIVE/ADDITIONAL DEBUGGING SOFTWARE/TOOLS: GCC option -Warray-bounds up from gcc 4.3 options -fmudflap -fmudflapth -fmudflapir up from gcc 4.0 See http://gcc.gnu.org/ See http://gcc.gnu.org/wiki/Mudflap_Pointer_Debugging IBM Stack Smashing Protector aka Pro Police it is a GCC (Gnu Compiler Collection) extension for protecting applications from stack-smashing attacks. Applications written in C will be protected by the method that automatically inserts protection code into an application at compilation time. The protection is realized by buffer overflow detection and the variable reordering feature to avoid the corruption of pointers. The basic idea of buffer overflow detection comes from StackGuard system. See http://www.trl.ibm.com/projects/security/ssp/ Checkergcc a modified version of the GNU C Compiler that instruments all memory references, is available on Linux systems and where GCC is used. It performs some of the same tasks as Purify, but only on code that it has compiled. Valgrind Valgrind is an award-winning suite of tools for debugging and profiling Linux programs. With the tools that come with Valgrind, you can automatically detect many memory management and threading bugs, avoiding hours of frustrating bug-hunting, making your programs more stable. You can also perform detailed profiling, to speed up and reduce memory use of your programs. The Valgrind distribution currently includes four tools: a memory error detector, a cache (time) profiler, a call-graph profiler, and a heap (space) profiler. It runs on the following platforms: X86/Linux, AMD64/Linux, PPC32/Linux, PPC64/Linux. See http://valgrind.org/ Pageheap.exe Another alternative to using duma on Windows (XP, 2000, Server 2003) is to use the built in heap debugging provided by Microsoft. It's not as feature rich as duma, but for complex projects were duma is causing issues it will work with less hassle (it sits in the heap manager itself). You can control it using the global flags (gflags) utility that comes with windbg. You can enable it by saying: gflags.exe /p /full /enable MyProgram.exe And do unaligned by saying: gflags.exe /p /full /unaligned /enable MyProgram.exe gflags will set specific registry keys to enable the pageheap debugging on the executable. You can disable it using the "/disable" flag. See http://support.microsoft.com/kb/286470 MPATROL The mpatrol library is a powerful debugging tool that attempts to diagnose run-time errors that are caused by the wrong use of dynamically allocated memory. It acts as a malloc() debugger for debugging dynamic memory allocations, although it can also trace and profile calls to malloc() and free() too. See http://www.cbmamiga.demon.co.uk/mpatrol/ Purify does a much more thorough job than DUMA, and does not have the huge memory overhead. LibSafe protects Critical Elements of Stack. See http://www.research.avayalabs.com/ DieHard helps buggy programs run correctly and protects them from a range of security vulnerabilities. See http://www.diehard-software.org/ electric-fence-win32 another Win32 port of Electric Fence. See http://code.google.com/p/electric-fence-win32/ FURTHER READING: Hunting Memory Bugs http://www.edm2.com/0508/membug.html An OS/2 Allocator for the STL http://www.edm2.com/0508/stl.html Wikipedia http://en.wikipedia.org/wiki/Memory_debugger CONTACTING THE AUTHOR: Hayati Ayguen Michael Eddington http://duma.sf.net FILES IN PACKAGE: SubDirectories: --------------- win32-vide/* project files for VIDE 1.24 (see http://www.objectcentral.com) using the Borland C++ Builder 5.5 compiler (FreeCommandLineTools, see http://www.borland.com) win32-devcpp/* project files for Dev-C++ 4.9.6 (see http://www.bloodshed.net) using the gcc compiler (see http://gcc.gnu.org) win32-msvc/* projects files for Microsoft Visual C++ 6.0 IDE/compiler (see http://www.microsoft.com) debian/* don't know; maybe some files for the Debian Linux distribution? Projects: --------- dumalib DUMA library. this library should be linked with YOUR program dumatest first small test program tstheap second small test program Files: ------ COPYING-* License files; reade carefully! README this text file CHANGES text file listing done CHANGES duma.h belongs to dumalib this header file should be included from within YOUR C source dumapp.h belongs to dumalib this header file should be included from within YOUR C++ source duma.c belongs to dumalib contains malloc/free/.. functions dumapp.cpp belongs to dumalib contains C++ new/delete/.. functions redirecting them to ANSI C malloc/free page.c belongs to dumalib library internal source file: contains paging functions print.c belongs to dumalib; library internal source file: contains printing/aborting functions dumatest.c belongs to dumatest small test program; checks wether dumalib's paging does its job should work without any errors tstheap.c belongs to tstheap small test program; checks wether dumalib's heap does its job should report many memory leaks after execution. Makefile Makefile for UNIX/Linux/.. duma.3 source for UNIX man page duma.sh script for UNIX/Linux to start other programs using the LD_PRELOAD mechanism LICENSE: Copyright (C) 2006 Michael Eddington Copyright (C) 2002-2008 Hayati Ayguen , Procitec GmbH Copyright (C) 1987-1999 Bruce Perens License: GNU GPL (GNU General Public License, see COPYING-GPL) for all files except dumapp.h License: GNU LGPL (GNU Lesser General Public License, see COPYING-GPL) for dumapp.h --- GPL -- This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --- LGPL -- This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA duma-VERSION_2_5_21/SECURITY.md000066400000000000000000000114061401225056000156640ustar00rootroot00000000000000# Security Policy ## Supported releases - Only the most recent current release is **_SUPPORTED_**.**☨** [![GitHubRelease](https://img.shields.io/github/release/johnsonjh/duma.svg)](https://github.com/johnsonjh/duma/releases/) - **☨** Support is offered on a **best-effort** basis **ONLY**. ```text BECAUSE THE THE SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING, THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. IN NO EVENT, UNLESS REQUIRED BY APPLICABLE LAW, OR AGREED TO IN WRITING, WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING, BUT NOT LIMITED TO, LOSS OF DATA, OR DATA BEING RENDERED INACCURATE, OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES, OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. ``` - Pre-release versions and past releases are **_NOT SUPPORTED_**. ## Report a security vulnerability - Send a **PGP-encrypted** email to ```text -----BEGIN PGP PUBLIC KEY BLOCK----- mQINBF+T+MsBEACtYMkgx9xjhj0cCGwiCMCqieWdjGRcIYEUKZ+VVuWrB69ig1Vp CDGWIUBSWz3I2G/3Orx3gClCLjb0NfsarIaxNMMQJpjKZuxUkBhE/9AUYwAXa1Q9 sEEqiH+rDx1RyV1h0HErBs9p1JsLBCaUbybwwVhyiomJVbA8AnEH/HSWT519vmbs muEBTbcfjuYmt2bAPXBhT70xn+PYyBVTpYc6HXSJj6sbNL5KI0rS0DQE3NOHnWgu WibMlpmWkhmo7QmXFmrrThnTqqw11edMTYHP4R+H8WRUjpKsKIir/Zeq+5OD0y+Z 8U+brfCpy0NL+2V8YPcHI//DOxXoLkesXEMRD+Ut8FFZ3vTbS4e0RpXsjHpfI+t9 f+Z4dUV103aMi8/NwNcpDJTRN7SqHoh0EWgjM2/uhg+7WWZNZCqBhKtQuSDPAdnM XDa24STVZitoPuudrcW9h4zRJTG7NbHNS5AaDTf139jrVSWx/9/46eYxzkm+1onk TbkVePBuoy8Nc3BbWMjbrtsAu12+vHaTfF3Rhz2ZUg9O8s5GQLWgTXebc8MuARUq bU9VZCPLUQAtWq0BEaBLy954iS4OIkcVGuol8dv88LZbQDDG11s3LzbTiG+LgCpp 9by9LgDAeMz+0jVPi/arJ+5JSS/EMta5DfMqUv9D9X0jl3Uh0MMC5NPKzwARAQAB tCRKZWZmcmV5IEguIEpvaG5zb24gPHRybnN6QHBvYm94LmNvbT6JAlQEEwEIAD4W IQSvrWsVt5J8N4AbGg3tvLPrAjvH7QUCX5P4ywIbAwUJB4TOAAULCQgHAgYVCgkI CwIEFgIDAQIeAQIXgAAKCRDtvLPrAjvH7eGXD/4yjiZxYgsEnFedbB5UkFkzV6bG i1vw1R+0Yp6b7pgJaiDOq8IMWFkQBLbkzEs/EGly2rDde4snfinkZa+j7rg7opcI Brzfm9aSgOwdgEmIEkEJd7DYdsz2dGjR1XoYX25mIPk7oUTTCAO6nKaXd6ZMMVf9 Nhfs1Ru7ggRM0QRZv+ymCf8KMgCkKCYiLP8YxsMe1I518yDpyIwMqFnW+SnRQ+7N A+JpMfBXIOnnbRYT867VovQGABrQ0nnw9sxZNFoKfPDNfTcmiU0HLCVpeV0A8XfS wbE1B15dtsgDo/ul6wb7AdUPyYxt5UpIWTxMgtSy/l4wr2EV6nYleNd/RooJL27/ AHYlY7V4OgwGkRTQzW5J4dYP5qPnFMkBAqJGEHQgqUlQiu1jqvemlNHbHnXDB7MB y/CZeZsI287gVPuf8lhnGXEK56WnBSpY8HnKRrqu/ZF/9qELhGXx0lgNIgz87BcH FgpczeTrARENLOgF1SpTfjJJVGXOPZFhkQ2A+WDV9+Lmcg2Az4hNDYM4H4KKSwrv r7XZG2DVk3lN5wI6r2iZXg/3l5O/xB2XXAVyM/ShvR0XQ8NXYtsqJCQ5Hb/SJH2t +wRJHMlB0hrrHsBA3O0e1xvPZ9ZmAKx0h6lQZT5qgALrnA5tEksHFKIkTSdOhjfV OgoquLuzhmOYgqaOV7kCDQRfk/jLARAAunxDFWs1hDfw2A05rhQDXG5gQACw+dRX 9XMVPJgmIr7/sxBT+Un4tAYWppjLkNNsOWuXtJM3Xs3NGn1NKImSKxW0XKCNE5V5 TEm1NWbKL2uB06SSuKWJypP8sudp1mZofhbRfm4tobYNncUGldO15qYYZfsifTD0 ruxtzOjsHLrH48F0lTKhR0dFXF+xdO+y/LKydC2Eo8DBev3C3qf6POCM/vF11R4w a6Hl3kkGtaZtr5X70JxCnklW0BLYb7TrCtZXgywf/AMAW27S69n4QUFYk9IgZCTc OOiE31U7zsL29T4WCV4b+DSo52PDysHy0KF3BjIUM0KNH18cSSdH5gcK8UZM9eFf bCSM1+fuXUqrZn0dDH6iCLQiFx0S7/I3f+hoXrb4VHCaDHu+19ICqfoVWSMYMino ogC56ZH9dDsVrhBAuW57H9sK2KCfLfEznGdT7aCp4MWyNYwjFcnesQ5ze+tLVC2X 4foLh21qRVc6i2G4+gAxDW7orBFw2qsW2qzoVy/POHho22g6XBBhwHhh7dNPJjzC 4HPvXeP8ukVRWNiU3tkPGrC5w84vXc+eWSw+BD7bwAF2oGcKCbvtyCdPRF6u5xrq DqMfSxssYuoNk8GtcTX+GFmanx+ANJN37nTwUAmBYn/ainw57gOh74vKYaHXZGat ka74wUNJNxkAEQEAAYkCPAQYAQgAJhYhBK+taxW3knw3gBsaDe28s+sCO8ftBQJf k/jLAhsMBQkHhM4AAAoJEO28s+sCO8ftE2AP+gJUUoCZboAfvBiXDkUR3pKCt1z+ djlaTu/K2coalemNItQ/facunKG4XUO+4ZGHOXVRbEL0s9t1tp36/QNPv3o/kPfy 5knCrDEadkp8ut1xgN/2rC16yA9JJDxa+O62R3Uw7j+ZN4OBCjIdfPwaApADebvm 9/r0C1bd3mzzkIHoGc4HSYX4maPUzd8S8Vi1xjB4xT6047yVU9lVgPc+SMIrUG6r X1NXukwEqnqiYHNmbbvk+AY06YVHmqynjrJyYiUUbFttKG8WSsJmg/rkk5fu9b63 1XFRZIvhQbyH/05FHFQgi2jTeP8mBPAfbPPFLytOWOXsKhllzlgJ2nLoYfckILVu 3YJul44LuQelZxbQAYVQMPv9OivG13RKgXFKBowBfx4kCCdOkXv1LyKdQb6/66qj fEP6nBVMVEzBql3zkQj27XDo8TLHrPJbptSY5StXopRycDYd9d5kKNcpspO73NvD y4YFFA/pQpSZrIfZG+SzP87GsFLp9//8bb20wdjTIzIN9jHVJfgNpx05bkfDO+iV ArVOSirsDz/oG/H7FxNPGUrwC+7xL1lFYA5LVqrU2HCzVkDeXtp8rcGmdt7viBxX +9C5KMC+yB7FqZ3SUbbDUlIo9HG+pbU1cN0xdYzgUHU/JOt0ghgagVoxy3FdCjHI db6SFclbQx5x03Wn =wvMh -----END PGP PUBLIC KEY BLOCK----- ``` duma-VERSION_2_5_21/TODO000066400000000000000000000156061401225056000145710ustar00rootroot00000000000000TODO items (listed by general priority): ======================================== -Linux symbol support -Win32 use dbghelp for symbol support -Win64 support -In-kernel suppor-In-kernel support -prevent inclusion of duma_sem.h from outside duma headers -memccpy(), bcopy() + test for all overloaded string functions -Interface to cause verification walk -add additional target/compiler switches in GNUmakefile to build with 1- native Solaris compiler / linker 2- Microsoft compiler cl / link -integrate modifications of http://tutorial.gsse.at/dynamicmemory/ http://tutorial.gsse.at/uploads/media/duma_iue.tgz -enhance detection of DUMA_MIN_ALIGNMENT in createconf use defines specifying the target architecture use compiler attributes which specify the necessary alignment -add autoconf/automake build process -use libtool to build shared libraries in Makefile depends on autoconf/automake -use configure to detect if f.e. pthread.h is installed and in search path check if pthread available before using it in Makefile depends on autoconf/automake -add feature to enable floating point exceptions by default C programs work with quiet NANs or similar values after an error this feature shall allow detecting of floating point division by zero, overflow, .. -test duma on several freely available/downloadable compilers: 1- OpenWatcom C/C++ compiler from http://www.openwatcom.org/ 2- Digital MARS C/C++ compiler from http://www.digitalmars.com/ 3- Intel C++ compiler from http://www.intel.com/cd/software/products /asmo-na/eng/compilers/clin/219856.htm 4- Borland C++ Builder from http://www.borland.com/products/downloads/download_cbuilder.html 5- Macintosh Programmer's Workshop from http://developer.apple.com/tools/mpw-tools/ 6- TenDRA C/C++ compiler from http://www.tendra.org/ or http://www.cse.unsw.edu.au/~patrykz/TenDRA/ -test cmake, dmake, pmake, smake maybe no more necessary when build is done via autoconf/automake -find solution for errors, when duma used in combination with STL (and MFC) under MS Visual C++ on Windows -make new variants behave fully C++ conform at least new_handler() gets called now -implement a list structure over pages rather than an array for all slots. this would save copying all slot entries, when list grows -store __func__ additionally to __FILE__ and __LINE__ depends on storing full filename (not just pointer) in slot -modification of manual page duma.3 -check documents for line lengths of 80 coloumns -check and replace tabs in documents -config for long int sysconf (int parameter) Function This function is used to inquire about runtime system parameters. The parameter argument should be one of the _SC_ symbols listed below. The normal return value from sysconf is the value you requested. A value of -1 is returned both if the implementation does not impose a limit, and in case of an error. The following errno error conditions are defined for this function: EINVAL The value of the parameter is invalid. enums: _SC_PAGESIZE Inquire about the virtual memory page size of the machine. getpagesize returns the same value (see Query Memory Parameters). _SC_PHYS_PAGES Inquire about the number of physical pages in the system. _SC_AVPHYS_PAGES Inquire about the number of available physical pages in the system. -config for The ulimit Function: The ulimit function can be used to get and set certain process limits. #include long ulimit (int cmd, /* long newlimit */...); Returns: the value of the requested limit if OK, -1 on error The ulimit function allows a process to get or set some of its limits. The operation performed is determined by the value of the cmd argument, which must be one of the following four values: UL_GMEMLIM This returns the maximum amount of memory the process may use. On successful completion, the requested limit is returned. Otherwise, -1 is returned and the limit is not changed. ==================== PRI LOW ==================== -get duma running/compiling on all platforms which are supported on sourceforge.net's compile farms. see http://sourceforge.net/docman/display_doc.php?docid=762&group_id=1 --> outdated: sourceforge's compile farm is no more available -use configuration file, which is read directly with system calls as replacement for the environment switches which use calls to the C library. this is to avoid hangs in the C library's getenv() function. --> outdated: now using char **environ variable instead getenv() -document 'J. "MUFTI" Scheurich' way of compiling/using DUMA's memory replacement functions only from own source files. Thus usage of DUMA for several system libraries is avoided. --> outdated with preprocessor option DUMA_NO_GLOBAL_MALLOC_FREE and compiler options "-include" (gcc) and "/FI" (MS Visual C++) -Similar to `DUMA_NO_GLOBAL_MALLOC_FREE`, it would be really nice if there were a `DUMA_NO_GLOBAL_NEW_DELETE` option, which would disable the DUMA implementations of `new`, `new[]`, `delete`, and `delete[]` from being included into the library. ==================== DONE ==================== -define new thread-safe macros, which don't have to use the global variable DUMA_PROTECT_BELOW: 1- NEW_PROTECT_BELOW: a 'new' replacement which protects the lower bound 2- NEW_PROTECT_ABOVE: a 'new' replacement which protects the upper bound 3- MALLOC_PROTECT_BELOW: a 'malloc' replacement which protects the lower bound 4- MALLOC_PROTECT_ABOVE: a 'malloc' replacement which protects the upper bound --> done other way: thread safe macro DUMA_SET_PROTECT_BELOW(V) saves setting in TLS -implement/use TLS - Thread Local Storage for some variables f.e. file/line information per delete operator --> done -use "-include" option of preprocessor, when having gcc see http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC11 see http://gcc.gnu.org/onlinedocs/gcc-3.0.4/gcc_3.html#SEC14 see http://gcc.gnu.org/onlinedocs/gcc-4.0.1/gcc/Preprocessor-Options.html --> done: see example_makes/ex6/Makefile -use "/FI" option of preprocessor, when having ms visual c++ see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore /html/_core_.2f.fi.asp --> done: see win32-msvc.net/example6/example6.sln project settings -provide a function/macro, which tests the non-protectable side of an allocated memory block for illegal writes. --> done: duma_check(), duma_checkAll(), DUMA_CHECK() and DUMA_CHECKALL() -check and replace tabs in documents done in version 2.5.7 - gain thread safety: get testmt.c work properly done in version 2.5.11 - add environment variable DUMA_CHECK_FREQ to autmatically check no man's land at each n'th allocation/deallocation. n=0 for no automatic checks done for version 2.5.12 - enhance testmt.c to run on Windows without pthread library done for version 2.5.15 duma-VERSION_2_5_21/WIN32_DETOURS_HOWTO.txt000066400000000000000000000031361401225056000176240ustar00rootroot00000000000000It is now possible to use detours with duma on already compiled binaries. This document will explain an example working configuration and environment. Known Limitations: - Detours v2.1 only works with Visual Studio 2005 currently. It does not build cleanly under 2003. - Detours v1.5 is not directly available for d/l anymore. Contact detours support alias for a copy if you need support for earlier then VS 2005. Things you will need: - Detours v1.5 or v2.1, available from Microsoft research as a free download - DebugView from Sysinternals, this allows you to read the debug console - Microsoft Visual Studio 2003 or 2005 Conifiguration: - Expand detours into your duma\detours folder - Open Visual Studio command prompt, browse to duma\detours and build detours (nmake) - Open Visual Studio, select "Detours1.5" or "Detours2.1" build (instead of debug or release) and build solution - Open detoursexample1 and build (debug version) - Open command prompt and issue the following: : set DUMA_OUTPUT_DEBUG=1 : set DUMA_OUTPUT_STDOUT=0 : set DUMA_OUTPUT_STDERR=0 : set DUMA_OUTPUT_STACKTRACE=1 : set DUMA_OUTPUT_STACKTRACE_MAPFILE=detoursexample1.map - Copy dumadetours.exe, detoursexample1.exe, detoursexample1.map into the dumadetoursdll Detours1.5 or Detours2.1 build folder - Run DebugView - Run "dumadetours detoursexample1.exe" - You should see duma output in the DebugView window. - For detours v2.1 you will also need detoured.dll from the detours distribution in the current directory. Bug reports: Report problems and patches for DUMA + Detours to meddington@gmail.com duma-VERSION_2_5_21/builddocs.bat000066400000000000000000000002251401225056000165300ustar00rootroot00000000000000@echo off cd c:\projects\naturaldocs NaturalDocs -i c:\projects\duma -o html c:\projects\duma\docs -p c:\projects\duma\docs-data cd c:\projects\duma duma-VERSION_2_5_21/comparisons/000077500000000000000000000000001401225056000164265ustar00rootroot00000000000000duma-VERSION_2_5_21/comparisons/README.txt000066400000000000000000000006041401225056000201240ustar00rootroot00000000000000 copy of html comparison charts/text and C source code examples from http://www.cs.utexas.edu/~jpmartin/memCheckers.html with kind permission of Jean-Philippe Martin. i've added Makefiles and "#include" lines to the examples for best DUMA results and to remove compilation errors occuring when autoincluding the DUMA header files. Hayati Ayguen 13 January 2008 updated 14 January 2008 duma-VERSION_2_5_21/comparisons/ex11/000077500000000000000000000000001401225056000172045ustar00rootroot00000000000000duma-VERSION_2_5_21/comparisons/ex11/Makefile000066400000000000000000000005431401225056000206460ustar00rootroot00000000000000 DUMADIR=../.. CFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include duma.h LFLAGS=$(DUMADIR)/libduma.a ifeq ($(OS), Windows_NT) LIBS= else LIBS=-lpthread endif CC=gcc CXX=g++ BIN=wrong1 OBJ=$(BIN).o all: $(BIN) ./$(BIN) clean: - rm -f $(OBJ) $(BIN) $(BIN): $(OBJ) $(CC) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN) .c.o: $(CC) $(CFLAGS) -c $< -o $@ duma-VERSION_2_5_21/comparisons/ex11/wrong1.c000066400000000000000000000003411401225056000205630ustar00rootroot00000000000000#include int main() { printf("Hello world!\n"); int* pI = (int*)malloc(sizeof(int)); *pI=2; free(pI); printf("Now freeing a pointer twice...\n"); free(pI); printf("Did you notice?\n"); return 0; }duma-VERSION_2_5_21/comparisons/ex12/000077500000000000000000000000001401225056000172055ustar00rootroot00000000000000duma-VERSION_2_5_21/comparisons/ex12/Makefile000066400000000000000000000005431401225056000206470ustar00rootroot00000000000000 DUMADIR=../.. CFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include duma.h LFLAGS=$(DUMADIR)/libduma.a ifeq ($(OS), Windows_NT) LIBS= else LIBS=-lpthread endif CC=gcc CXX=g++ BIN=wrong3 OBJ=$(BIN).o all: $(BIN) ./$(BIN) clean: - rm -f $(OBJ) $(BIN) $(BIN): $(OBJ) $(CC) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN) .c.o: $(CC) $(CFLAGS) -c $< -o $@ duma-VERSION_2_5_21/comparisons/ex12/wrong3.c000066400000000000000000000007401401225056000205710ustar00rootroot00000000000000#include int main() { printf("Hello world!\n"); int* pI = (int*)malloc(sizeof(int)); int j; printf("Now reading uninitialized memory\n"); j = *pI+2; printf("Did you notice? (value was %i)\n",j); free(pI); printf("(No memory leak here)\n"); int* pJ; printf("Now writing to uninitialized pointer\n"); *pJ = j; printf("Did you notice?\n"); // valgrind reports 8, but that's ok printf("There should be 2 errors in this run\n"); return 0; }duma-VERSION_2_5_21/comparisons/ex13/000077500000000000000000000000001401225056000172065ustar00rootroot00000000000000duma-VERSION_2_5_21/comparisons/ex13/Makefile000066400000000000000000000005431401225056000206500ustar00rootroot00000000000000 DUMADIR=../.. CFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include duma.h LFLAGS=$(DUMADIR)/libduma.a ifeq ($(OS), Windows_NT) LIBS= else LIBS=-lpthread endif CC=gcc CXX=g++ BIN=wrong6 OBJ=$(BIN).o all: $(BIN) ./$(BIN) clean: - rm -f $(OBJ) $(BIN) $(BIN): $(OBJ) $(CC) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN) .c.o: $(CC) $(CFLAGS) -c $< -o $@ duma-VERSION_2_5_21/comparisons/ex13/wrong6.c000066400000000000000000000004511401225056000205740ustar00rootroot00000000000000#include struct Test { int a; char st[10]; }; int main() { printf("Hello world!\n"); struct Test ar[10]; struct Test b; printf("Let's index out of bounds \n"); ar[10].a=10; printf("Did you notice?\n"); printf("There should be 1 error in this run\n"); return 0; }duma-VERSION_2_5_21/comparisons/ex14/000077500000000000000000000000001401225056000172075ustar00rootroot00000000000000duma-VERSION_2_5_21/comparisons/ex14/Makefile000066400000000000000000000005431401225056000206510ustar00rootroot00000000000000 DUMADIR=../.. CFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include duma.h LFLAGS=$(DUMADIR)/libduma.a ifeq ($(OS), Windows_NT) LIBS= else LIBS=-lpthread endif CC=gcc CXX=g++ BIN=wrong7 OBJ=$(BIN).o all: $(BIN) ./$(BIN) clean: - rm -f $(OBJ) $(BIN) $(BIN): $(OBJ) $(CC) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN) .c.o: $(CC) $(CFLAGS) -c $< -o $@ duma-VERSION_2_5_21/comparisons/ex14/wrong7.c000066400000000000000000000004611401225056000205770ustar00rootroot00000000000000#include int main() { int *p; p = (int*) malloc( sizeof(int) * 10 ); printf("Now writing before our allocated array\n"); p[-1] ^= 0x0F; /* bash before */ printf("... and now after our allocated array\n"); p[10] ^= 0x0F; /* bash after */ printf("Did you notice?\n"); free(p); }duma-VERSION_2_5_21/comparisons/ex15/000077500000000000000000000000001401225056000172105ustar00rootroot00000000000000duma-VERSION_2_5_21/comparisons/ex15/Makefile000066400000000000000000000005421401225056000206510ustar00rootroot00000000000000 DUMADIR=../.. CFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include duma.h LFLAGS=$(DUMADIR)/libduma.a ifeq ($(OS), Windows_NT) LIBS= else LIBS=-lpthread endif CC=gcc CXX=g++ BIN=leak1 OBJ=$(BIN).o all: $(BIN) ./$(BIN) clean: - rm -f $(OBJ) $(BIN) $(BIN): $(OBJ) $(CC) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN) .c.o: $(CC) $(CFLAGS) -c $< -o $@ duma-VERSION_2_5_21/comparisons/ex15/leak1.c000066400000000000000000000002621401225056000203510ustar00rootroot00000000000000#include int main() { printf("Hello world!\n"); int* pI; pI = (int*)malloc(sizeof(int)); printf("Let's leak a pointer to int\n"); *pI = 303; return 0; }duma-VERSION_2_5_21/comparisons/ex16/000077500000000000000000000000001401225056000172115ustar00rootroot00000000000000duma-VERSION_2_5_21/comparisons/ex16/Makefile000066400000000000000000000005421401225056000206520ustar00rootroot00000000000000 DUMADIR=../.. CFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include duma.h LFLAGS=$(DUMADIR)/libduma.a ifeq ($(OS), Windows_NT) LIBS= else LIBS=-lpthread endif CC=gcc CXX=g++ BIN=leak2 OBJ=$(BIN).o all: $(BIN) ./$(BIN) clean: - rm -f $(OBJ) $(BIN) $(BIN): $(OBJ) $(CC) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN) .c.o: $(CC) $(CFLAGS) -c $< -o $@ duma-VERSION_2_5_21/comparisons/ex16/leak2.c000066400000000000000000000005351401225056000203560ustar00rootroot00000000000000#include int main() { printf("Hello world!\n"); int* pI; pI = (int*)malloc(10*sizeof(int)); printf("Let's leak a pointer to an array of 10 ints\n"); int i=0; for (i=0; i<9; i++) { pI[i] = 303+i; } int j=0; for (j=0; j<9; j++) { if (pI[j] != 303+j) printf(" Something strange is happening...\n"); } return 0; }duma-VERSION_2_5_21/comparisons/ex17/000077500000000000000000000000001401225056000172125ustar00rootroot00000000000000duma-VERSION_2_5_21/comparisons/ex17/Makefile000066400000000000000000000005401401225056000206510ustar00rootroot00000000000000 DUMADIR=../.. CFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include duma.h LFLAGS=$(DUMADIR)/libduma.a ifeq ($(OS), Windows_NT) LIBS= else LIBS=-lpthread endif CC=gcc CXX=g++ BIN=ok5 OBJ=$(BIN).o all: $(BIN) ./$(BIN) clean: - rm -f $(OBJ) $(BIN) $(BIN): $(OBJ) $(CC) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN) .c.o: $(CC) $(CFLAGS) -c $< -o $@ duma-VERSION_2_5_21/comparisons/ex17/ok5.c000066400000000000000000000005031401225056000200520ustar00rootroot00000000000000struct Test { int a; char st[10]; }; int main() { printf("Hello world!\n"); struct Test* ar = (struct Test*)malloc(10*sizeof(struct Test)); ar[9].a=10; printf("Let's correctly delete an array of 10 objects\n"); free(ar); printf("Done\n"); printf("There should be 0 error in this run\n"); return 0; }duma-VERSION_2_5_21/comparisons/ex21/000077500000000000000000000000001401225056000172055ustar00rootroot00000000000000duma-VERSION_2_5_21/comparisons/ex21/Makefile000066400000000000000000000005711401225056000206500ustar00rootroot00000000000000 DUMADIR=../.. CPPFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h LFLAGS=$(DUMADIR)/libduma.a ifeq ($(OS), Windows_NT) LIBS= else LIBS=-lpthread endif CC=gcc CXX=g++ BIN=wrong1 OBJ=$(BIN).o all: $(BIN) ./$(BIN) clean: - rm -f $(OBJ) $(BIN) $(BIN): $(OBJ) $(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN) .cc.o: $(CXX) $(CPPFLAGS) -c $< -o $@ duma-VERSION_2_5_21/comparisons/ex21/wrong1.cc000066400000000000000000000004441401225056000207330ustar00rootroot00000000000000#include #include #include using namespace std; int main() { cout << "Hello world!" << endl; int* pI = new int; *pI=2; delete(pI); cerr << "Now deleting a pointer twice..." << endl; delete(pI); cerr << "Did you notice?" << endl; return 0; }duma-VERSION_2_5_21/comparisons/ex22/000077500000000000000000000000001401225056000172065ustar00rootroot00000000000000duma-VERSION_2_5_21/comparisons/ex22/Makefile000066400000000000000000000005711401225056000206510ustar00rootroot00000000000000 DUMADIR=../.. CPPFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h LFLAGS=$(DUMADIR)/libduma.a ifeq ($(OS), Windows_NT) LIBS= else LIBS=-lpthread endif CC=gcc CXX=g++ BIN=wrong2 OBJ=$(BIN).o all: $(BIN) ./$(BIN) clean: - rm -f $(OBJ) $(BIN) $(BIN): $(OBJ) $(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN) .cc.o: $(CXX) $(CPPFLAGS) -c $< -o $@ duma-VERSION_2_5_21/comparisons/ex22/wrong2.cc000066400000000000000000000007361401225056000207410ustar00rootroot00000000000000#include #include #include using namespace std; int main() { cout << "Hello world!" << endl; int* pI = new int; *pI=2; cerr << "Now freeing a pointer instead of deleting it..." << endl; free(pI); cerr << "Did you notice?" << endl; pI = new int; delete(pI); cerr << "Now deleting twice..." << endl; delete(pI); cerr << "Did you notice?" << endl; cerr << "There should be 2 errors in this run" << endl; return 0; }duma-VERSION_2_5_21/comparisons/ex23/000077500000000000000000000000001401225056000172075ustar00rootroot00000000000000duma-VERSION_2_5_21/comparisons/ex23/Makefile000066400000000000000000000005711401225056000206520ustar00rootroot00000000000000 DUMADIR=../.. CPPFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h LFLAGS=$(DUMADIR)/libduma.a ifeq ($(OS), Windows_NT) LIBS= else LIBS=-lpthread endif CC=gcc CXX=g++ BIN=wrong3 OBJ=$(BIN).o all: $(BIN) ./$(BIN) clean: - rm -f $(OBJ) $(BIN) $(BIN): $(OBJ) $(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN) .cc.o: $(CXX) $(CPPFLAGS) -c $< -o $@ duma-VERSION_2_5_21/comparisons/ex23/wrong3.cc000066400000000000000000000011001401225056000207250ustar00rootroot00000000000000#include #include #include using namespace std; int main() { cout << "Hello world!" << endl; int* pI = new int; int j; cerr << "Now reading uninitialized memory" << endl; j = *pI+2; cerr << "Did you notice? (value was " << j << ") " << endl; delete pI; cerr << "(No memory leak here)" << endl; int* pJ; cerr << "Now writing to uninitialized pointer" << endl; *pJ = j; cerr << "Did you notice?" << endl; // valgrind reports 4, but that's ok cerr << "There should be 2 errors in this run" << endl; return 0; }duma-VERSION_2_5_21/comparisons/ex24/000077500000000000000000000000001401225056000172105ustar00rootroot00000000000000duma-VERSION_2_5_21/comparisons/ex24/Makefile000066400000000000000000000005711401225056000206530ustar00rootroot00000000000000 DUMADIR=../.. CPPFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h LFLAGS=$(DUMADIR)/libduma.a ifeq ($(OS), Windows_NT) LIBS= else LIBS=-lpthread endif CC=gcc CXX=g++ BIN=wrong4 OBJ=$(BIN).o all: $(BIN) ./$(BIN) clean: - rm -f $(OBJ) $(BIN) $(BIN): $(OBJ) $(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN) .cc.o: $(CXX) $(CPPFLAGS) -c $< -o $@ duma-VERSION_2_5_21/comparisons/ex24/wrong4.cc000066400000000000000000000007441401225056000207440ustar00rootroot00000000000000#include #include #include using namespace std; int main() { cout << "Hello world!" << endl; { int* pI = new int[10]; cerr << "Let's delete instead of delete [] " << endl; delete pI; cerr << "Did you notice?" << endl; } { int* pI = new int[10]; cerr << "Now let's free instead of delete [] " << endl; free(pI); cerr << "Did you notice?" << endl; } cerr << "There should be 2 errors in this run" << endl; return 0; }duma-VERSION_2_5_21/comparisons/ex25/000077500000000000000000000000001401225056000172115ustar00rootroot00000000000000duma-VERSION_2_5_21/comparisons/ex25/Makefile000066400000000000000000000005711401225056000206540ustar00rootroot00000000000000 DUMADIR=../.. CPPFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h LFLAGS=$(DUMADIR)/libduma.a ifeq ($(OS), Windows_NT) LIBS= else LIBS=-lpthread endif CC=gcc CXX=g++ BIN=wrong5 OBJ=$(BIN).o all: $(BIN) ./$(BIN) clean: - rm -f $(OBJ) $(BIN) $(BIN): $(OBJ) $(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN) .cc.o: $(CXX) $(CPPFLAGS) -c $< -o $@ duma-VERSION_2_5_21/comparisons/ex25/wrong5.cc000066400000000000000000000011261401225056000207410ustar00rootroot00000000000000#include #include #include #include using namespace std; class Test { public: int a; string stdstr; Test() { a=2; stdstr = "test"; } }; int main() { cout << "Hello world!" << endl; { Test* pI = new Test[10]; cerr << "Let's delete instead of delete [] " << endl; delete pI; cerr << "Did you notice?" << endl; } { Test* pI = new Test[10]; cerr << "Now let's free instead of delete [] " << endl; free(pI); cerr << "Did you notice?" << endl; } cerr << "There should be 2 errors in this run" << endl; return 0; }duma-VERSION_2_5_21/comparisons/ex26/000077500000000000000000000000001401225056000172125ustar00rootroot00000000000000duma-VERSION_2_5_21/comparisons/ex26/Makefile000066400000000000000000000005711401225056000206550ustar00rootroot00000000000000 DUMADIR=../.. CPPFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h LFLAGS=$(DUMADIR)/libduma.a ifeq ($(OS), Windows_NT) LIBS= else LIBS=-lpthread endif CC=gcc CXX=g++ BIN=wrong6 OBJ=$(BIN).o all: $(BIN) ./$(BIN) clean: - rm -f $(OBJ) $(BIN) $(BIN): $(OBJ) $(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN) .cc.o: $(CXX) $(CPPFLAGS) -c $< -o $@ duma-VERSION_2_5_21/comparisons/ex26/wrong6.cc000066400000000000000000000007621401225056000207500ustar00rootroot00000000000000#include #include #include #include using namespace std; class Test { public: int a; string stdstr; Test() { a=2; stdstr = "test"; } void doNothing() { cout << " hi!" << endl; }; }; int main() { cout << "Hello world!" << endl; Test ar[10]; Test b; cerr << "Let's index out of bounds " << endl; ar[10].doNothing(); cerr << "Did you notice?" << endl; cerr << "There should be 1 error in this run" << endl; return 0; }duma-VERSION_2_5_21/comparisons/ex27/000077500000000000000000000000001401225056000172135ustar00rootroot00000000000000duma-VERSION_2_5_21/comparisons/ex27/Makefile000066400000000000000000000005701401225056000206550ustar00rootroot00000000000000 DUMADIR=../.. CPPFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h LFLAGS=$(DUMADIR)/libduma.a ifeq ($(OS), Windows_NT) LIBS= else LIBS=-lpthread endif CC=gcc CXX=g++ BIN=leak1 OBJ=$(BIN).o all: $(BIN) ./$(BIN) clean: - rm -f $(OBJ) $(BIN) $(BIN): $(OBJ) $(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN) .cc.o: $(CXX) $(CPPFLAGS) -c $< -o $@ duma-VERSION_2_5_21/comparisons/ex27/leak1.cc000066400000000000000000000003451401225056000205210ustar00rootroot00000000000000#include #include #include using namespace std; int main() { cout << "Hello world!" << endl; int* pI = new int; cerr << "Let's leak a pointer to int" << endl; *pI = 303; return 0; }duma-VERSION_2_5_21/comparisons/ex28/000077500000000000000000000000001401225056000172145ustar00rootroot00000000000000duma-VERSION_2_5_21/comparisons/ex28/Makefile000066400000000000000000000005701401225056000206560ustar00rootroot00000000000000 DUMADIR=../.. CPPFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h LFLAGS=$(DUMADIR)/libduma.a ifeq ($(OS), Windows_NT) LIBS= else LIBS=-lpthread endif CC=gcc CXX=g++ BIN=leak2 OBJ=$(BIN).o all: $(BIN) ./$(BIN) clean: - rm -f $(OBJ) $(BIN) $(BIN): $(OBJ) $(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN) .cc.o: $(CXX) $(CPPFLAGS) -c $< -o $@ duma-VERSION_2_5_21/comparisons/ex28/leak2.cc000066400000000000000000000006101401225056000205160ustar00rootroot00000000000000#include #include #include using namespace std; int main() { cout << "Hello world!" << endl; int* pI = new int[10]; cerr << "Let's leak a pointer to an array of 10 ints" << endl; for (int i=0; i<9; i++) { pI[i] = 303+i; } for (int i=0; i<9; i++) { if (pI[i] != 303+i) cerr << " Something strange is happening..." << endl; } return 0; }duma-VERSION_2_5_21/comparisons/ex29/000077500000000000000000000000001401225056000172155ustar00rootroot00000000000000duma-VERSION_2_5_21/comparisons/ex29/Makefile000066400000000000000000000005661401225056000206640ustar00rootroot00000000000000 DUMADIR=../.. CPPFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h LFLAGS=$(DUMADIR)/libduma.a ifeq ($(OS), Windows_NT) LIBS= else LIBS=-lpthread endif CC=gcc CXX=g++ BIN=ok5 OBJ=$(BIN).o all: $(BIN) ./$(BIN) clean: - rm -f $(OBJ) $(BIN) $(BIN): $(OBJ) $(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN) .cc.o: $(CXX) $(CPPFLAGS) -c $< -o $@ duma-VERSION_2_5_21/comparisons/ex29/ok5.cc000066400000000000000000000007131401225056000202230ustar00rootroot00000000000000#include #include #include #include using namespace std; class Test { public: int a; string stdstr; Test() { a=2; stdstr = "test"; } }; int main() { cout << "Hello world!" << endl; { Test* pI = new Test[10]; cerr << "Let's correctly delete an array of 10 objects " << endl; delete [] pI; cerr << "Done" << endl; } cerr << "There should be 0 errors in this run" << endl; return 0; }duma-VERSION_2_5_21/comparisons/memCheckers-Dateien/000077500000000000000000000000001401225056000222235ustar00rootroot00000000000000duma-VERSION_2_5_21/comparisons/memCheckers-Dateien/boringstyle.css000066400000000000000000000001171401225056000252750ustar00rootroot00000000000000SPAN.definition { font-style: italic; } a { text-decoration: underline; } duma-VERSION_2_5_21/comparisons/memCheckers-Dateien/jpstyle.css000066400000000000000000000007421401225056000244320ustar00rootroot00000000000000a.local { color: blue; text-decoration: none; } a.local:hover { text-decoration: underline; } a.title { color: black; text-decoration: none; } a.title:hover { text-decoration: underline; } a.fold { text-decoration: none; } a.fold:hover { text-decoration: underline; } SPAN.definition { font-style: italic; } h1 { font-size: x-large; } h2 { font-size: large; } /* body { background-color:"#D0D0D0"; color:black; background-image:url("images/stone.gif") } */ duma-VERSION_2_5_21/comparisons/memCheckers-Dateien/viewed-any.gif000066400000000000000000000014121401225056000247600ustar00rootroot00000000000000GIF87aUÄÿÿÿçççÎÆÆÆÆÆÎµµµµµÖžž­­­Ö¡¡¡Þ„„àuu”””ŒŒŒçbb„„„èQQ{{{oooô11ccc÷!!ÿRZZRRRÿJJJ999111!!!,U@ÿ Ždižhª®lùl@0ÌÉ6\ÑPlZ14¼æƒ™ žY§ðÈÕ4L#šƒîz¿ åcìz¿àÙ+.›Ïè´º;–­ß_ˆNÿ¶ëø|þ>cx6SPKE]3ƒA6P“•Cz^|   ­6§]r 3 F ‹3G £I©Ê© >bÞßàáâãäåæçèâ0nŸíî`¡«9oÛ“ ¯x\ï¡ 4PÈÈÆƒ¬¤ê"AÃ…W«â°L°}˜ˆªØ»Ië>ŠìrF·V©ÿP8pàFËka*XX³ŒAI#¹‘1¢ÁÃr¬jõÊU«F8@€`‚‚»  `˜‘©€ àJ³ž z"¡AB4êd—³-œ6âÊK·®Ý»xóêÝ+7”Û¿iüÆß©›f0"‹3B–yø¹ó7¬ˆ¢}Hв†—S ¬ºCÃC“¾pù€äv¡:uO©^ü´’™‘gŠ:ˆò}D¸ë‚ +7’|¹òP¬ä›!aº‘ c¿@°¦À¼¿¡$<êÀåÂÏH˜q¤‹æ ˜Ðt€ 3 aG«Eœ¥Á°Rš*¢l°AK@°ôøå„``ÃPFqPTvT9AH%U-,p@mÅ›GÑA¬,ÓÔ8Zkuq´4ÔŽ¨¼B‘„8€ÀDt ÇHfІDÀÅŽ3XèlBl”ô‰d–if™ÉÝrÍ97Ø Æ)çœtÖiçxæ©§!;duma-VERSION_2_5_21/comparisons/memCheckers.html000066400000000000000000000404551401225056000215520ustar00rootroot00000000000000 Comparison of Free Memory Checkers

Jean-Philippe Martin | Resources | Memory Checkers Comparison


Memory Checkers

Memory checkers are debugging tools that help programmers find improper use of pointers, typically memory leaks.

There are some freely available memory checkers. I ran a series of very simple tests to determine what they can do. The wrong series of tests contains code that makes pointer mistakes that are not memory leaks, for example freeing a pointer twice, writing to uninitialized memory or using delete instead of delete []. The leak series of tests contains simple memory leaks, i.e. pointers that are allocated but not released. The ok series of tests contains programs that are correct and thus should not cause the memory checker to output any alarm message.

C tests

(updated 3/10/2006)

Checker wrong1.c wrong3.c wrong6.c wrong7.c leak1.c leak2.c ok5.c
MALLOC_CHECK_ OK missed missed OK* missed missed OK
dmalloc OK missed missed OK OK OK OK
memCheckDeluxe missed missed missed missed OK OK OK
memwatch OK missed missed* OK OK OK OK
DUMA OK missed missed OK OK OK* OK
valgrind OK OK missed OK OK OK OK

C++ tests

Checker wrong1.cc wrong2.cc wrong3.cc wrong4.cc wrong5.cc wrong6.cc leak1.cc leak2.cc ok5.cc
MALLOC_CHECK_ OK OK missed missed OK missed missed missed OK
dmalloc OK OK* missed* missed OK missed OK OK missed*
DUMA OK OK missed OK OK missed OK OK missed
valgrind OK OK OK* OK OK missed OK OK OK

Conclusion

memWatch and memCheckDeluxe are both memory leak detectors, and they passed all the memory leak tests. Memwatch wins this round because it was able to detect the double-free in wrong1.c and the out-of-bounds accesses in the dynamically allocated array of wrong7.c (not the static array of wrong6 - but no one else did, either). Both programs are designed to work with C and require a recompilation.

MALLOC_CHECK_ is an interesting test: it is triggered simply by setting the environment variable MALLOC_CHECK_ to 1, and the rest of the magic is done by glibc (see the link in references, below). This is the easiest check to set up and it requires no recompilation. It detected the double free in wrong1 and the mismatched malloc/delete or new/free pairs in wrong2.cc and wrong5.cc. It was able to see that something was fishy in wrong7.c, but it reports a single error at the "free" instead of when we are accessing the memory instead of two errors, for each out-of-bounds access. MALLOC_CHECK_ cannot detect memory leaks and did not detect the use of uninitialized memory in wrong3.

dmalloc is more than a leak detector, but it didn't detect as many bad cases as valgrind and requires a recompile. Also, its C++ support is (in the author's words) minimal. In particular, I have not been able to get dmalloc to report line numbers with C++ (log), although that feature mostly works with C code - in both leak1.c and leak2.c it pointed to the return() instead of the line that allocated the unfreed memory. Dmalloc also often reports unfreed memory, even for programs that are correct. This may be because of errors in the c++ library, but it makes the reports harder to read. In contrast, valgrind has a way to hide leaks that it knows about so its reports are more clear. See also the author's comments.

valgrind is clearly the winner of this little contest. valgrind requires no recompilation of the program, so it's very easy to set up. It identified almost all of the incorrect pointer uses and memory leaks. The only test that it missed is wrong6, in which we break the bounds of an array. No other checker spotted that one, though. Also, valgrind has been improved since we ran this test, so it may perform even better than what we show here.

DUMA is a very close second. The results I am posting here come from Koneru Srikanth (kpsrikanth at gmail dot com) who generously sent them to me. DUMA seems not to require a recompile, but the tests were run on recompiled code. DUMA performs really well. It was also able to detect out-of-bounds writes (it is reported as failing wrong3.cc because it missed the out-of-bounds read). If for some reason valgrind does not work for you, then I recommend that you give DUMA a spin.

Reference

I tested:
  • MALLOC_CHECK_ for glibc (C and C++: requires no recompilation)
  • dmalloc-5.2.2 (C, minimal C++ support; requires recompilation)
  • memCheckDeluxe-1.2.2 (C, some C++. Requires recompilation)
  • memwatch-2.71 (C only; requires recompilation)
  • valgrind-1.9.6 (C, C++ and more: requires no recompilation)
  • DUMA version 2.4.26 (C and C++. Documentation says that no recompilation is needed, but the tests were run on recompiled code) (as mentioned above, these tests were contributed by Koneru Srikanth).
I did not test: Test programs:

ToDo

The following memory checkers have been mentionned to me but I haven't tried them yet:
  • mpatrol at http://www.cbmamiga.demon.co.uk/mpatrol/

Change History

March 10, 2006: added DUMA, contributed by Koneru Srikanth
Oct 6, 2003: mention of mpatrol
Sept 29, 2003: added dmalloc
June 25, 2003: minor change in the text
June 24, 2003: corrected result for memwatch's wrong1.c, added wrong7.c
June 15, 2003: initial release

Please contact me if you have feedback or would like to suggest another tool for the test.


[JP Martin] [resources] [contact information]

Best viewed with *any* browser
duma-VERSION_2_5_21/createconf.c000066400000000000000000000525671401225056000163650ustar00rootroot00000000000000/* * DUMA - Red-Zone memory allocator. * * Copyright (C) 2006 Michael Eddington * Copyright (C) 2002-2008 Hayati Ayguen , Procitec GmbH * Copyright (C) 1987-1999 Bruce Perens * * License: GNU GPL (GNU General Public License, see COPYING-GPL) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * * FILE CONTENTS: * -------------- * This is a small tool to generate the "duma_config.h" configuration file. * Its purpose is to allow fixed size memory allocation on stack, which can * get protected calling page protection functions. * Also its nice for the user to be able to see the page size. */ #include #include #include #include #ifdef _MSC_VER #include #endif #ifndef WIN32 #include #include #include #else #define WIN32_LEAN_AND_MEAN 1 #include #include #ifndef __CYGWIN__ /* already defined in cygwin headers */ typedef LPVOID caddr_t; typedef unsigned u_int; #endif #endif /* * retrieve page size * size_t Page_Size(void) */ static size_t Page_Size(void) { #if defined(WIN32) SYSTEM_INFO SystemInfo; GetSystemInfo( &SystemInfo ); return (size_t)SystemInfo.dwPageSize; #elif defined(_SC_PAGESIZE) return (size_t)sysconf(_SC_PAGESIZE); #elif defined(_SC_PAGE_SIZE) return (size_t)sysconf(_SC_PAGE_SIZE); #else /* extern int getpagesize(); */ return getpagesize(); #endif } int initattr_ok = 0; void #ifdef __GNUC__ __attribute ((constructor)) #endif init_function(void) { initattr_ok = 1; } typedef struct { int id; int size; char *type; } DataType_T; DataType_T sIntTypes[] = { { 0, sizeof(char) , "char" } , { 1, sizeof(short int), "short int" } , { 2, sizeof(int) , "int" } , { 3, sizeof(long int) , "long int" } /* add additional compiler specific typer here */ #ifdef _MSC_VER , { 4, sizeof(__int64), "__int64" } #endif #ifdef __GNUC__ , { 5, sizeof(long long int), "long long int" } #endif }; /* test access to each data type */ void testAlignment(int addrIdx, char * buffer, int alignment, int max_sizeof) { int offset; switch ( sIntTypes[addrIdx].id ) { case 0: #define TYPE unsigned char for(offset=0; offset < max_sizeof; ++offset) { TYPE addr = (TYPE)(buffer) + offset; if ( addr % alignment == 0 ) { *( (unsigned char *) addr ) = 0; *( (unsigned short int*) addr ) = 0; *( (unsigned int *) addr ) = 0; *( (unsigned long int *) addr ) = 0L; *( (float *) addr ) = 0.0F; *( (double *) addr ) = 0.0; *( (long double *) addr ) = 0.0; #ifdef _MSC_VER *( (unsigned __int64 *) addr ) = 0L; #endif #ifdef __GNUC__ *( (unsigned long long int *) addr ) = 0L; #endif } } break; case 1: #undef TYPE #define TYPE unsigned short int for(offset=0; offset < max_sizeof; ++offset) { TYPE addr = (TYPE)(buffer) + offset; if ( addr % alignment == 0 ) { *( (unsigned char *) addr ) = 0; *( (unsigned short int*) addr ) = 0; *( (unsigned int *) addr ) = 0; *( (unsigned long int *) addr ) = 0L; *( (float *) addr ) = 0.0F; *( (double *) addr ) = 0.0; *( (long double *) addr ) = 0.0; #ifdef _MSC_VER *( (unsigned __int64 *) addr ) = 0L; #endif #ifdef __GNUC__ *( (unsigned long long int *) addr ) = 0L; #endif } } break; case 2: #undef TYPE #define TYPE unsigned int for(offset=0; offset < max_sizeof; ++offset) { TYPE addr = (TYPE)(buffer) + offset; if ( addr % alignment == 0 ) { *( (unsigned char *) addr ) = 0; *( (unsigned short int*) addr ) = 0; *( (unsigned int *) addr ) = 0; *( (unsigned long int *) addr ) = 0L; *( (float *) addr ) = 0.0F; *( (double *) addr ) = 0.0; *( (long double *) addr ) = 0.0; #ifdef _MSC_VER *( (unsigned __int64 *) addr ) = 0L; #endif #ifdef __GNUC__ *( (unsigned long long int *) addr ) = 0L; #endif } } break; case 3: #undef TYPE #define TYPE unsigned long int for(offset=0; offset < max_sizeof; ++offset) { TYPE addr = (TYPE)(buffer) + offset; if ( addr % alignment == 0 ) { *( (unsigned char *) addr ) = 0; *( (unsigned short int*) addr ) = 0; *( (unsigned int *) addr ) = 0; *( (unsigned long int *) addr ) = 0L; *( (float *) addr ) = 0.0F; *( (double *) addr ) = 0.0; *( (long double *) addr ) = 0.0; #ifdef _MSC_VER *( (unsigned __int64 *) addr ) = 0L; #endif #ifdef __GNUC__ *( (unsigned long long int *) addr ) = 0L; #endif } } break; #ifdef _MSC_VER case 4: #undef TYPE #define TYPE unsigned __int64 for(offset=0; offset < max_sizeof; ++offset) { TYPE addr = (TYPE)(buffer) + offset; if ( addr % alignment == 0 ) { *( (unsigned char *) addr ) = 0; *( (unsigned short int*) addr ) = 0; *( (unsigned int *) addr ) = 0; *( (unsigned long int *) addr ) = 0L; *( (float *) addr ) = 0.0F; *( (double *) addr ) = 0.0; *( (long double *) addr ) = 0.0; #ifdef _MSC_VER *( (unsigned __int64 *) addr ) = 0L; #endif #ifdef __GNUC__ *( (unsigned long long int *) addr ) = 0L; #endif } } break; #endif #ifdef __GNUC__ case 5: #undef TYPE #define TYPE unsigned long long int for(offset=0; offset < max_sizeof; ++offset) { TYPE addr = (TYPE)(buffer) + offset; if ( addr % alignment == 0 ) { *( (unsigned char *) addr ) = 0; *( (unsigned short int*) addr ) = 0; *( (unsigned int *) addr ) = 0; *( (unsigned long int *) addr ) = 0L; *( (float *) addr ) = 0.0F; *( (double *) addr ) = 0.0; *( (long double *) addr ) = 0.0; #ifdef _MSC_VER *( (unsigned __int64 *) addr ) = 0L; #endif #ifdef __GNUC__ *( (unsigned long long int *) addr ) = 0L; #endif } } break; #endif ; } } void writeFile(const char * filename, unsigned long pagesize, int addrIdx, int sizeIdx, int alignment, int malloc0strategy) { FILE * f = fopen(filename, "w"); if (!f) { fprintf(stderr, "createconf: Error: could not open file '%s'\n", filename); return; } fprintf(f, "/*\n"); fprintf(f, " * WARNING: DO NOT CHANGE THIS FILE!\n"); fprintf(f, " * This file is automatically generated from createconf\n"); #if defined(WIN32) #if defined(_MSC_VER) fprintf(f, " * using Microsoft Visual C++ under MS Windows(TM) the %s\n", __DATE__ ); #else fprintf(f, " * under MS Windows(TM) the %s\n", __DATE__ ); #endif #elif ( defined(sgi) ) fprintf(f, " * under sgi the %s\n", __DATE__ ); #elif ( defined(_AIX) ) fprintf(f, " * under AIX the %s\n", __DATE__ ); #elif ( defined(__linux__) ) fprintf(f, " * under Linux the %s\n", __DATE__ ); #else fprintf(f, " * the %s \n", __DATE__ ); #endif fprintf(f, " */\n"); fprintf(f, "\n"); fprintf(f, "#ifndef _DUMA_CONFIG_H_\n"); fprintf(f, "#define _DUMA_CONFIG_H_\n"); fprintf(f, "\n"); fprintf(f, "/*\n"); fprintf(f, " * Configuration of DUMA:\n"); fprintf(f, " */\n"); // DUMA_SO_LIBRARY fprintf(f, "#ifdef DUMA_SO_LIBRARY\n"); fprintf(f, "\n"); fprintf(f, "#ifdef DUMA_NO_GLOBAL_MALLOC_FREE\n"); fprintf(f, "#undef DUMA_NO_GLOBAL_MALLOC_FREE\n"); fprintf(f, "#endif\n\n"); fprintf(f, "#ifdef DUMA_EXPLICIT_INIT\n"); fprintf(f, "#undef DUMA_EXPLICIT_INIT\n"); fprintf(f, "#endif\n\n"); fprintf(f, "#ifdef DUMA_NO_THREAD_SAFETY\n"); fprintf(f, "#undef DUMA_NO_THREAD_SAFETY\n"); fprintf(f, "#endif\n\n"); #ifndef DUMA_SEMAPHORES fprintf(f, "#ifdef DUMA_SEMAPHORES\n"); fprintf(f, "#undef DUMA_SEMAPHORES\n"); fprintf(f, "#endif\n\n"); #else fprintf(f, "#ifndef DUMA_SEMAPHORES\n"); fprintf(f, "#define DUMA_SEMAPHORES\n"); fprintf(f, "#endif\n\n"); #endif #ifndef DUMA_SO_NO_CPP_SUPPORT fprintf(f, "#ifdef DUMA_NO_CPP_SUPPORT\n"); fprintf(f, "#undef DUMA_NO_CPP_SUPPORT\n"); fprintf(f, "#endif\n\n"); #else fprintf(f, "#ifndef DUMA_NO_CPP_SUPPORT\n"); fprintf(f, "#define DUMA_NO_CPP_SUPPORT\n"); fprintf(f, "#endif\n\n"); #endif #ifndef DUMA_SO_NO_LEAKDETECTION fprintf(f, "#ifdef DUMA_NO_LEAKDETECTION\n"); fprintf(f, "#undef DUMA_NO_LEAKDETECTION\n"); fprintf(f, "#endif\n\n"); #else fprintf(f, "#ifndef DUMA_NO_LEAKDETECTION\n"); fprintf(f, "#define DUMA_NO_LEAKDETECTION\n"); fprintf(f, "#endif\n\n"); #endif #ifndef DUMA_SO_PREFER_ATEXIT fprintf(f, "#ifdef DUMA_PREFER_ATEXIT\n"); fprintf(f, "#undef DUMA_PREFER_ATEXIT\n"); fprintf(f, "#endif\n\n"); #else fprintf(f, "#ifndef DUMA_PREFER_ATEXIT\n"); fprintf(f, "#define DUMA_PREFER_ATEXIT\n"); fprintf(f, "#endif\n\n"); #endif #ifndef DUMA_SO_PREFER_GETENV fprintf(f, "#ifdef DUMA_PREFER_GETENV\n"); fprintf(f, "#undef DUMA_PREFER_GETENV\n"); fprintf(f, "#endif\n\n"); #else fprintf(f, "#ifndef DUMA_PREFER_GETENV\n"); fprintf(f, "#define DUMA_PREFER_GETENV\n"); fprintf(f, "#endif\n\n"); #endif fprintf(f, "#ifdef DUMA_OLD_NEW_MACRO\n"); fprintf(f, "#undef DUMA_OLD_NEW_MACRO\n"); fprintf(f, "#endif\n\n"); fprintf(f, "#ifdef DUMA_OLD_DEL_MACRO\n"); fprintf(f, "#undef DUMA_OLD_DEL_MACRO\n"); fprintf(f, "#endif\n\n"); #ifndef DUMA_NO_STRERROR fprintf(f, "#ifdef DUMA_NO_STRERROR\n"); fprintf(f, "#undef DUMA_NO_STRERROR\n"); fprintf(f, "#endif\n\n"); #else fprintf(f, "#ifndef DUMA_NO_STRERROR\n"); fprintf(f, "#define DUMA_NO_STRERROR\n"); fprintf(f, "#endif\n\n"); #endif #ifndef DUMA_SO_NO_HANG_MSG fprintf(f, "#ifdef DUMA_NO_HANG_MSG\n"); fprintf(f, "#undef DUMA_NO_HANG_MSG\n"); fprintf(f, "#endif\n\n"); #else fprintf(f, "#ifndef DUMA_NO_HANG_MSG\n"); fprintf(f, "#define DUMA_NO_HANG_MSG\n"); fprintf(f, "#endif\n\n"); #endif // DUMA_DLL_LIBRARY fprintf(f, "#elif defined(DUMA_DLL_LIBRARY)\n"); fprintf(f, "\n"); fprintf(f, "#define DUMA_SKIP_SETUP 1\n"); fprintf(f, "#define DUMA_NO_GLOBAL_MALLOC_FREE 1\n"); fprintf(f, "#define DUMA_EXPLICIT_INIT 1\n"); fprintf(f, "#ifdef DUMA_NO_THREAD_SAFETY\n"); fprintf(f, "#undef DUMA_NO_THREAD_SAFETY\n"); fprintf(f, "#endif\n\n"); #ifndef DUMA_SO_NO_CPP_SUPPORT fprintf(f, "#ifdef DUMA_NO_CPP_SUPPORT\n"); fprintf(f, "#undef DUMA_NO_CPP_SUPPORT\n"); fprintf(f, "#endif\n\n"); #else fprintf(f, "#ifndef DUMA_NO_CPP_SUPPORT\n"); fprintf(f, "#define DUMA_NO_CPP_SUPPORT\n"); fprintf(f, "#endif\n\n"); #endif #ifndef DUMA_SO_NO_LEAKDETECTION fprintf(f, "#ifdef DUMA_NO_LEAKDETECTION\n"); fprintf(f, "#undef DUMA_NO_LEAKDETECTION\n"); fprintf(f, "#endif\n\n"); #else fprintf(f, "#ifndef DUMA_NO_LEAKDETECTION\n"); fprintf(f, "#define DUMA_NO_LEAKDETECTION\n"); fprintf(f, "#endif\n\n"); #endif #ifndef DUMA_SO_PREFER_ATEXIT fprintf(f, "#ifdef DUMA_PREFER_ATEXIT\n"); fprintf(f, "#undef DUMA_PREFER_ATEXIT\n"); fprintf(f, "#endif\n\n"); #else fprintf(f, "#ifndef DUMA_PREFER_ATEXIT\n"); fprintf(f, "#define DUMA_PREFER_ATEXIT\n"); fprintf(f, "#endif\n\n"); #endif #ifndef DUMA_SO_PREFER_GETENV fprintf(f, "#ifdef DUMA_PREFER_GETENV\n"); fprintf(f, "#undef DUMA_PREFER_GETENV\n"); fprintf(f, "#endif\n\n"); #else fprintf(f, "#ifndef DUMA_PREFER_GETENV\n"); fprintf(f, "#define DUMA_PREFER_GETENV\n"); fprintf(f, "#endif\n\n"); #endif fprintf(f, "#ifdef DUMA_OLD_NEW_MACRO\n"); fprintf(f, "#undef DUMA_OLD_NEW_MACRO\n"); fprintf(f, "#endif\n\n"); fprintf(f, "#ifdef DUMA_OLD_DEL_MACRO\n"); fprintf(f, "#undef DUMA_OLD_DEL_MACRO\n"); fprintf(f, "#endif\n\n"); #ifndef DUMA_SO_NO_HANG_MSG fprintf(f, "#ifdef DUMA_NO_HANG_MSG\n"); fprintf(f, "#undef DUMA_NO_HANG_MSG\n"); fprintf(f, "#endif\n\n"); #else fprintf(f, "#ifndef DUMA_NO_HANG_MSG\n"); fprintf(f, "#define DUMA_NO_HANG_MSG\n"); fprintf(f, "#endif\n\n"); #endif // DUMA_DETOURS fprintf(f, "#elif defined(DUMA_DETOURS)\n"); fprintf(f, "\n"); fprintf(f, "#define DUMA_SKIP_SETUP 1\n"); fprintf(f, "#define DUMA_NO_GLOBAL_MALLOC_FREE 1\n"); fprintf(f, "#define DUMA_EXPLICIT_INIT 1\n"); fprintf(f, "#ifdef DUMA_NO_THREAD_SAFETY\n"); fprintf(f, "#undef DUMA_NO_THREAD_SAFETY\n"); fprintf(f, "#endif\n\n"); #ifndef DUMA_SO_NO_CPP_SUPPORT fprintf(f, "#ifdef DUMA_NO_CPP_SUPPORT\n"); fprintf(f, "#undef DUMA_NO_CPP_SUPPORT\n"); fprintf(f, "#endif\n\n"); #else fprintf(f, "#ifndef DUMA_NO_CPP_SUPPORT\n"); fprintf(f, "#define DUMA_NO_CPP_SUPPORT\n"); fprintf(f, "#endif\n\n"); #endif #ifndef DUMA_SO_NO_LEAKDETECTION fprintf(f, "#ifdef DUMA_NO_LEAKDETECTION\n"); fprintf(f, "#undef DUMA_NO_LEAKDETECTION\n"); fprintf(f, "#endif\n\n"); #else fprintf(f, "#ifndef DUMA_NO_LEAKDETECTION\n"); fprintf(f, "#define DUMA_NO_LEAKDETECTION\n"); fprintf(f, "#endif\n\n"); #endif #ifndef DUMA_SO_PREFER_ATEXIT fprintf(f, "#ifdef DUMA_PREFER_ATEXIT\n"); fprintf(f, "#undef DUMA_PREFER_ATEXIT\n"); fprintf(f, "#endif\n\n"); #else fprintf(f, "#ifndef DUMA_PREFER_ATEXIT\n"); fprintf(f, "#define DUMA_PREFER_ATEXIT\n"); fprintf(f, "#endif\n\n"); #endif #ifndef DUMA_SO_PREFER_GETENV fprintf(f, "#ifdef DUMA_PREFER_GETENV\n"); fprintf(f, "#undef DUMA_PREFER_GETENV\n"); fprintf(f, "#endif\n\n"); #else fprintf(f, "#ifndef DUMA_PREFER_GETENV\n"); fprintf(f, "#define DUMA_PREFER_GETENV\n"); fprintf(f, "#endif\n\n"); #endif fprintf(f, "#ifdef DUMA_OLD_NEW_MACRO\n"); fprintf(f, "#undef DUMA_OLD_NEW_MACRO\n"); fprintf(f, "#endif\n\n"); fprintf(f, "#ifdef DUMA_OLD_DEL_MACRO\n"); fprintf(f, "#undef DUMA_OLD_DEL_MACRO\n"); fprintf(f, "#endif\n\n"); #ifndef DUMA_SO_NO_HANG_MSG fprintf(f, "#ifdef DUMA_NO_HANG_MSG\n"); fprintf(f, "#undef DUMA_NO_HANG_MSG\n"); fprintf(f, "#endif\n\n"); #else fprintf(f, "#ifndef DUMA_NO_HANG_MSG\n"); fprintf(f, "#define DUMA_NO_HANG_MSG\n"); fprintf(f, "#endif\n\n"); #endif // REGULAR CONFIG fprintf(f, "#else\n"); fprintf(f, "\n"); #ifndef DUMA_NO_GLOBAL_MALLOC_FREE fprintf(f, "#ifdef DUMA_NO_GLOBAL_MALLOC_FREE\n"); fprintf(f, "#undef DUMA_NO_GLOBAL_MALLOC_FREE\n"); fprintf(f, "#endif\n\n"); #else fprintf(f, "#ifndef DUMA_NO_GLOBAL_MALLOC_FREE\n"); fprintf(f, "#define DUMA_NO_GLOBAL_MALLOC_FREE\n"); fprintf(f, "#endif\n\n"); #endif #ifndef DUMA_EXPLICIT_INIT fprintf(f, "#ifdef DUMA_EXPLICIT_INIT\n"); fprintf(f, "#undef DUMA_EXPLICIT_INIT\n"); fprintf(f, "#endif\n\n"); #else fprintf(f, "#ifndef DUMA_EXPLICIT_INIT\n"); fprintf(f, "#define DUMA_EXPLICIT_INIT\n"); fprintf(f, "#endif\n\n"); #endif #ifndef DUMA_NO_THREAD_SAFETY fprintf(f, "#ifdef DUMA_NO_THREAD_SAFETY\n"); fprintf(f, "#undef DUMA_NO_THREAD_SAFETY\n"); fprintf(f, "#endif\n\n"); #else fprintf(f, "#ifndef DUMA_NO_THREAD_SAFETY\n"); fprintf(f, "#define DUMA_NO_THREAD_SAFETY\n"); fprintf(f, "#endif\n\n"); #endif #ifndef DUMA_LIB_NO_CPP_SUPPORT fprintf(f, "#ifdef DUMA_NO_CPP_SUPPORT\n"); fprintf(f, "#undef DUMA_NO_CPP_SUPPORT\n"); fprintf(f, "#endif\n\n"); #else fprintf(f, "#ifndef DUMA_NO_CPP_SUPPORT\n"); fprintf(f, "#define DUMA_NO_CPP_SUPPORT\n"); fprintf(f, "#endif\n\n"); #endif #ifndef DUMA_LIB_NO_LEAKDETECTION fprintf(f, "#ifdef DUMA_NO_LEAKDETECTION\n"); fprintf(f, "#undef DUMA_NO_LEAKDETECTION\n"); fprintf(f, "#endif\n\n"); #else fprintf(f, "#ifndef DUMA_NO_LEAKDETECTION\n"); fprintf(f, "#define DUMA_NO_LEAKDETECTION\n"); fprintf(f, "#endif\n\n"); #endif #ifndef DUMA_LIB_PREFER_ATEXIT fprintf(f, "#ifdef DUMA_PREFER_ATEXIT\n"); fprintf(f, "#undef DUMA_PREFER_ATEXIT\n"); fprintf(f, "#endif\n\n"); #else fprintf(f, "#ifndef DUMA_PREFER_ATEXIT\n"); fprintf(f, "#define DUMA_PREFER_ATEXIT\n"); fprintf(f, "#endif\n\n"); #endif #ifndef DUMA_LIB_PREFER_GETENV fprintf(f, "#ifdef DUMA_PREFER_GETENV\n"); fprintf(f, "#undef DUMA_PREFER_GETENV\n"); fprintf(f, "#endif\n\n"); #else fprintf(f, "#ifndef DUMA_PREFER_GETENV\n"); fprintf(f, "#define DUMA_PREFER_GETENV\n"); fprintf(f, "#endif\n\n"); #endif #ifndef DUMA_OLD_NEW_MACRO fprintf(f, "#ifdef DUMA_OLD_NEW_MACRO\n"); fprintf(f, "#undef DUMA_OLD_NEW_MACRO\n"); fprintf(f, "#endif\n\n"); #else fprintf(f, "#ifndef DUMA_OLD_NEW_MACRO\n"); fprintf(f, "#define DUMA_OLD_NEW_MACRO\n"); fprintf(f, "#endif\n\n"); #endif #ifndef DUMA_OLD_DEL_MACRO fprintf(f, "#ifdef DUMA_OLD_DEL_MACRO\n"); fprintf(f, "#undef DUMA_OLD_DEL_MACRO\n"); fprintf(f, "#endif\n\n"); #else fprintf(f, "#ifndef DUMA_OLD_DEL_MACRO\n"); fprintf(f, "#define DUMA_OLD_DEL_MACRO\n"); fprintf(f, "#endif\n\n"); #endif #ifndef DUMA_NO_STRERROR fprintf(f, "#ifdef DUMA_NO_STRERROR\n"); fprintf(f, "#undef DUMA_NO_STRERROR\n"); fprintf(f, "#endif\n\n"); #else fprintf(f, "#ifndef DUMA_NO_STRERROR\n"); fprintf(f, "#define DUMA_NO_STRERROR\n"); fprintf(f, "#endif\n\n"); #endif #ifndef DUMA_LIB_NO_HANG_MSG fprintf(f, "#ifdef DUMA_NO_HANG_MSG\n"); fprintf(f, "#undef DUMA_NO_HANG_MSG\n"); fprintf(f, "#endif\n\n"); #else fprintf(f, "#ifndef DUMA_NO_HANG_MSG\n"); fprintf(f, "#define DUMA_NO_HANG_MSG\n"); fprintf(f, "#endif\n\n"); #endif fprintf(f, "#endif\n"); fprintf(f, "\n"); fprintf(f, "\n"); fprintf(f, "/*\n"); fprintf(f, " * Number of bytes per virtual-memory page, as returned by Page_Size().\n"); fprintf(f, " */\n"); fprintf(f, "#define DUMA_PAGE_SIZE %lu\n", pagesize); fprintf(f, "\n"); fprintf(f, "/*\n"); fprintf(f, " * Minimum required alignment by CPU.\n"); fprintf(f, " */\n"); fprintf(f, "#define DUMA_MIN_ALIGNMENT %d\n", alignment); fprintf(f, "\n"); fprintf(f, "/*\n"); fprintf(f, " * Build environment supports the '__attribute ((constructor))'?\n"); fprintf(f, " */\n"); if (initattr_ok) fprintf(f, "#define DUMA_GNU_INIT_ATTR 1\n"); else fprintf(f, "/* #define DUMA_GNU_INIT_ATTR 0 */\n"); fprintf(f, "\n"); fprintf(f, "/*\n"); fprintf(f, " * An integer type with same size as 'void *'\n"); fprintf(f, " */\n"); if (addrIdx >= 0) fprintf(f, "typedef unsigned %s DUMA_ADDR;\n", sIntTypes[addrIdx].type); else fprintf(f, "/* Error: No datatype for DUMA_ADDR found! */\n"); fprintf(f, "\n"); fprintf(f, "/*\n"); fprintf(f, " * An integer type with same size as 'size_t'\n"); fprintf(f, " */\n"); if (sizeIdx >= 0) fprintf(f, "typedef unsigned %s DUMA_SIZE;\n", sIntTypes[sizeIdx].type); else fprintf(f, "/* No datatype for DUMA_SIZE found! */\n"); fprintf(f, "\n"); fprintf(f, "/*\n"); fprintf(f, " * Default behaviour on malloc(0).\n"); fprintf(f, " */\n"); fprintf(f, "#define DUMA_DEFAULT_MALLOC_0_STRATEGY %d\n", malloc0strategy); fprintf(f, "\n"); fprintf(f, "#endif /* _DUMA_CONFIG_H_ */\n"); fclose(f); } #ifdef __cplusplus #define DUMA_EXTERN_C extern "C" #else #define DUMA_EXTERN_C extern #endif int main() { int iNumIntTypes, iIt; int addrIdx, sizeIdx; int alignment, max_sizeof; int malloc0strategy; char buffer[1024]; char filename[1024]; unsigned long pagesize = Page_Size(); #if defined(__MINGW32__) || defined(__MINGW64__) fprintf(stderr, "createconf: Platform is MINGW\n"); #endif #if defined(__CYGWIN__) fprintf(stderr, "createconf: Platform is CYGWIN\n"); #endif #if defined(WIN32) fprintf(stderr, "createconf: WIN32 is set\n"); #endif #if defined(_MSC_VER) fprintf(stderr, "createconf: Compiler is MS Visual C++ (_MSC_VER set)\n"); #endif iNumIntTypes = sizeof( sIntTypes ) / sizeof( sIntTypes[0] ); // detect compatible type for ADDRESS addrIdx = -1; for (iIt = 0; iIt < iNumIntTypes; ++iIt) { if ( sizeof(void*) == sIntTypes[iIt].size ) { addrIdx = iIt; break; } } // detect compatible type for SIZE_T sizeIdx = -1; for (iIt = 0; iIt < iNumIntTypes; ++iIt) { if ( sizeof(size_t) == sIntTypes[iIt].size ) { sizeIdx = iIt; break; } } /* detect maximum data type, which should be maximum alignment */ max_sizeof = 0; for (iIt = 0; iIt < iNumIntTypes; ++iIt) { if ( max_sizeof < sIntTypes[iIt].size ) max_sizeof = sIntTypes[iIt].size; } if ( max_sizeof < (int)sizeof(float) ) max_sizeof = sizeof(float); if ( max_sizeof < (int)sizeof(double) ) max_sizeof = sizeof(double); if ( max_sizeof < (int)sizeof(long double) ) max_sizeof = sizeof(long double); /* test for behaviour on malloc(0) */ { char * pcNullPtrA = (char*)malloc(0); char * pcNullPtrB = (char*)malloc(0); if ( !pcNullPtrA ) malloc0strategy = 1; else if ( pcNullPtrA == pcNullPtrB ) malloc0strategy = 2; else malloc0strategy = 3; } #ifdef _MSC_VER { /* fix output path when started form Visual C++ IDE */ char directory[1024]; char * start; _getcwd( directory, 1024 ); /* get current directory */ if ( ( start = strstr( directory, "win32-msvc" ) ) ) { *start = 0; strcpy(filename, directory); strcat(filename, "duma_config.h"); } else strcpy( filename, "duma_config.h" ); } #else strcpy( filename, "duma_config.h" ); #endif /* detect minimum alignment */ alignment = max_sizeof; do { /* do the alignment access tests */ testAlignment(addrIdx, buffer, alignment, max_sizeof); /* write whole config file. next test may crash ! */ writeFile(filename, pagesize, addrIdx, sizeIdx, alignment, malloc0strategy); /* try next lower alignment */ alignment >>= 1; } while ( alignment > 0 ); return 0; } duma-VERSION_2_5_21/createconf_new.cpp000066400000000000000000000026611401225056000175640ustar00rootroot00000000000000/* * DUMA - Red-Zone memory allocator. * * Copyright (C) 2008 Hayati Ayguen , Procitec GmbH * * License: GNU GPL (GNU General Public License, see COPYING-GPL) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #include #include #ifdef __cplusplus #define DUMA_EXTERN_C extern "C" #else #define DUMA_EXTERN_C extern #endif DUMA_EXTERN_C int get_new0strategy(void) { /* test for behaviour of operator new with size 0 */ int op_new_0_strategy; int * piNullPtrA; int * piNullPtrB; piNullPtrA = (int*) operator new(0); piNullPtrB = (int*) operator new(0); if ( !piNullPtrA ) op_new_0_strategy = 0; else if ( piNullPtrA == piNullPtrB ) op_new_0_strategy = 1; else op_new_0_strategy = 2; return op_new_0_strategy; } duma-VERSION_2_5_21/debian/000077500000000000000000000000001401225056000153135ustar00rootroot00000000000000duma-VERSION_2_5_21/debian/changelog000066400000000000000000000022211401225056000171620ustar00rootroot00000000000000duma (2.5.19-1) stable; urgency=medium * New Stable Release -- Jeffrey H. Johnson Mon, 01 Jan 2021 00:26:27 +0500 duma (2.5.15-2) unstable; urgency=medium * QA upload. * Set Maintainer to Debian QA Group. (See: #565925) * Switch to source format 3.0 (quilt). (Closes: #497947, #516370, #533554) * Switch from cdbs to dh. * Switch to debhelper-compat (= 12). (Closes: #589715) * Fix some lintian issues. * dumapp.{cpp,h}: Apply patch from Buildroot (thanks, Yann E. MORIN!) to fix FTBFS with C++14. (Closes: #811887) * Move git repository to salsa.d.o. -- Andreas Beckmann Sun, 16 Jun 2019 11:47:57 +0200 duma (2.5.15-1) unstable; urgency=low * New upstream release (Closes: #531169) * Bump standard version -- Julien Danjou Thu, 04 Jun 2009 14:12:00 +0200 duma (2.5.14-2) unstable; urgency=low * Fix typo in long description (Closes: #486736) -- Julien Danjou Wed, 18 Jun 2008 00:09:42 +0200 duma (2.5.14-1) unstable; urgency=low * Initial release (Closes: #484473) -- Julien Danjou Thu, 12 Jun 2008 11:23:57 +0200 duma-VERSION_2_5_21/debian/control000066400000000000000000000033561401225056000167250ustar00rootroot00000000000000Source: duma Section: devel Priority: optional Maintainer: Debian QA Group Build-Depends: debhelper-compat (= 12), Standards-Version: 3.8.1 Homepage: https://github.com/johnsonjh/duma Vcs-Browser: https://github.com/johnsonjh/duma Vcs-Git: https://github.com/johnsonjh/duma.git Package: duma Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: library to detect buffer overruns and under-runs in C and C++ programs Open-source library to detect buffer overruns and under-runs in C and C++ programs. . This library is a fork of Bruce Perens Electric Fence library and adds some new features to it. Features of the DUMA library: * "overloads" all standard memory allocation functions like malloc(), calloc(), memalign(), strdup(), operator new, operator new[] and also their counterpart deallocation functions like free(), operator delete and operator delete[] * utilizes the MMU (memory management unit) of the CPU: allocates and protects an extra memory page to detect any illegal access beyond the top of the buffer (or bottom, at the user's option) * stops the program at exactly that instruction, which does the erroneous access to the protected memory page, allowing location of the defective source code in a debugger detects erroneous writes at the non-protected end of the memory block at deallocation of the memory block * detects mismatch of allocation/deallocation functions: f.e. allocation with malloc() but deallocation with operator delete * leak detection: detect memory blocks which were not deallocated until program exit * preloading of the library * allowing tests without necessity of changing source code or recompilation duma-VERSION_2_5_21/debian/copyright000066400000000000000000000032271401225056000172520ustar00rootroot00000000000000This package was originally debianized by Julien Danjou on Thu, 12 Jun 2008 11:23:57 +0200. DUMA can be downloaded from Upstream Authors: Hayati Ayguen Michael Eddington Lars Hartmann Yann Morin Alexey Neyman Jeffrey H. Johnson Copyright: Copyright (C) 2021 Jeffrey H. Johnson Copyright (C) 2006 Michael Eddington Copyright (C) 2002-2007 Hayati Ayguen , Procitec GmbH Copyright (C) 1987-1999 Bruce Perens License: This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA On Debian systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/GPL-2'. The Debian packaging is (C) 2008, Julien Danjou and is licensed under the GPL, see above. duma-VERSION_2_5_21/debian/docs000066400000000000000000000000201401225056000161560ustar00rootroot00000000000000README.txt TODO duma-VERSION_2_5_21/debian/rules000077500000000000000000000000541401225056000163720ustar00rootroot00000000000000#!/usr/bin/make -f %: dh $@ --no-parallel duma-VERSION_2_5_21/debian/source/000077500000000000000000000000001401225056000166135ustar00rootroot00000000000000duma-VERSION_2_5_21/debian/source/lintian-overrides000066400000000000000000000000561401225056000221750ustar00rootroot00000000000000source-contains-autogenerated-visual-c++-file duma-VERSION_2_5_21/debian/watch000066400000000000000000000003271401225056000163460ustar00rootroot00000000000000version=4 opts="filenamemangle=s%(?:.*?)?v?@PACKAGE@-(\d[\d.]*)\.tar\.xz%@PACKAGE@-$1.tar.xz%" \ https://github.com/johnsonjh/@PACKAGE@/releases \ (?:.*?/)?v?@PACKAGE@-(\d[\d.]*)\.tar\.xz debian uupdate duma-VERSION_2_5_21/detours/000077500000000000000000000000001401225056000155565ustar00rootroot00000000000000duma-VERSION_2_5_21/detours/readme.txt000066400000000000000000000005021401225056000175510ustar00rootroot00000000000000 Due to EULA restrictions we cannot distribute the Detours source with DUMA. To build DUMA with detours support download Detours 1.5 and install to this folder, then build. You should end up with \lib, and \include folders here. http://research.microsoft.com/sn/detours/ See the duma+detours howto in the root folder. duma-VERSION_2_5_21/detoursexample1/000077500000000000000000000000001401225056000172135ustar00rootroot00000000000000duma-VERSION_2_5_21/detoursexample1/detoursexample1.cpp000066400000000000000000000012651401225056000230450ustar00rootroot00000000000000// detoursexample1.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "windows.h" int _tmain(int argc, _TCHAR* argv[]) { fprintf(stderr, "!!!!detoursexample1 starting!!!\n"); printf("!!!!detoursexample1 starting!!!\n"); fflush(stdout); OutputDebugString("!!!! ITS ME !!!!"); for(int i=0; i<100; i++) { fprintf(stderr, "."); char* tmp = (char*) malloc(100); //tmp[110] = 'a'; //free(tmp); } /* HANDLE h = HeapCreate(NULL, 1024, 2024); for(int i=0; i<100; i++) { fprintf(stderr, "+"); char* tmp = (char*) HeapAlloc(h, 0, 100); HeapFree(h, 0, tmp); } HeapDestroy(h); */ fprintf(stderr, "detoursexample1 done\n"); return 0; } duma-VERSION_2_5_21/detoursexample1/stdafx.cpp000066400000000000000000000004461401225056000212140ustar00rootroot00000000000000// stdafx.cpp : source file that includes just the standard includes // detoursexample1.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "stdafx.h" // TODO: reference any additional headers you need in STDAFX.H // and not in this fileduma-VERSION_2_5_21/detoursexample1/stdafx.h000066400000000000000000000004311401225056000206530ustar00rootroot00000000000000// stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, but // are changed infrequently // #pragma once #include #include // TODO: reference additional headers your program requires hereduma-VERSION_2_5_21/docs-data/000077500000000000000000000000001401225056000157305ustar00rootroot00000000000000duma-VERSION_2_5_21/docs-data/Data/000077500000000000000000000000001401225056000166015ustar00rootroot00000000000000duma-VERSION_2_5_21/docs-data/Data/ClassHierarchy.nd000066400000000000000000000000041401225056000220220ustar00rootroot00000000000000#duma-VERSION_2_5_21/docs-data/Data/ConfigFileInfo.nd000066400000000000000000000000271401225056000217440ustar00rootroot00000000000000#E;ûBE;óßE;óßE;óßE;óßduma-VERSION_2_5_21/docs-data/Data/FileInfo.nd000066400000000000000000000155101401225056000206210ustar00rootroot000000000000001.35 C/C++ C:\projects\duma\stacktrace\internal\StackTrace.cpp 1161053048 0 C:\projects\duma\stacktrace\internal\StackTrace.cpp C:\projects\duma\detoursexample1\detoursexample1.cpp 1161053043 0 C:\projects\duma\detoursexample1\detoursexample1.cpp C:\projects\duma\win32-msvc.2005\dumadetoursdll\Detours2.1\dumadetoursdll.exp 1161517813 0 C:\projects\duma\win32-msvc.2005\dumadetoursdll\Detours2.1\dumadetoursdll.exp C:\projects\duma\dumadll\resource.h 1161053046 0 C:\projects\duma\dumadll\resource.h C:\projects\duma\print.c 1161519445 1 C:\projects\duma\print.c C:\projects\duma\paging.h 1161519445 1 paging.h C:\projects\duma\sem_inc.c 1161053034 0 C:\projects\duma\sem_inc.c C:\projects\duma\stacktrace\internal\MapFileEntry.cpp 1161053048 0 C:\projects\duma\stacktrace\internal\MapFileEntry.cpp C:\projects\duma\WIN32_DETOURS_HOWTO.txt 1161558001 1 Win32 Detours Howto C:\projects\duma\win32-msvc.net\dumadll\resource.h 1161053060 0 C:\projects\duma\win32-msvc.net\dumadll\resource.h C:\projects\duma\dumatestpp.cpp 1127862288 0 C:\projects\duma\dumatestpp.cpp C:\projects\duma\dumadetours\stdafx.cpp 1161053045 0 C:\projects\duma\dumadetours\stdafx.cpp C:\projects\duma\dumadetours\dumadetours.cpp 1161519647 0 C:\projects\duma\dumadetours\dumadetours.cpp C:\projects\duma\tstheap.c 1127862288 0 C:\projects\duma\tstheap.c C:\projects\duma\win32-msvc.net\dumadll\stdafx.h 1161053060 0 C:\projects\duma\win32-msvc.net\dumadll\stdafx.h C:\projects\duma\sem_inc.h 1125407927 0 C:\projects\duma\sem_inc.h C:\projects\duma\stacktrace\internal\MapFileEntry.h 1161053048 0 C:\projects\duma\stacktrace\internal\MapFileEntry.h C:\projects\duma\example2.cpp 1161053034 0 C:\projects\duma\example2.cpp C:\projects\duma\testoperators.cpp 1161053034 0 C:\projects\duma\testoperators.cpp C:\projects\duma\win32-msvc.net\dumadll\stdafx.cpp 1161053060 0 C:\projects\duma\win32-msvc.net\dumadll\stdafx.cpp C:\projects\duma\win32-msvc.net\quicktest\quicktest.cpp 1161053060 0 C:\projects\duma\win32-msvc.net\quicktest\quicktest.cpp C:\projects\duma\detours\bin\dtarget.exp 1161518436 0 C:\projects\duma\detours\bin\dtarget.exp C:\projects\duma\dumadll\dumadll.cpp 1161053046 0 C:\projects\duma\dumadll\dumadll.cpp C:\projects\duma\example1.cpp 1161053034 0 C:\projects\duma\example1.cpp C:\projects\duma\stacktrace\linux-i386\printStackTrace.c 1161053049 0 C:\projects\duma\stacktrace\linux-i386\printStackTrace.c C:\projects\duma\win32-msvc.net\quicktest\stdafx.cpp 1161053060 0 C:\projects\duma\win32-msvc.net\quicktest\stdafx.cpp C:\projects\duma\example4.cpp 1125407927 0 C:\projects\duma\example4.cpp C:\projects\duma\README.txt 1161558641 1 README C:\projects\duma\print.h 1125794042 0 C:\projects\duma\print.h C:\projects\duma\win32-msvc.net\quicktest\ReadMe.txt 1161053060 0 C:\projects\duma\win32-msvc.net\quicktest\ReadMe.txt C:\projects\duma\detours\bin\edll1.exp 1161518439 0 C:\projects\duma\detours\bin\edll1.exp C:\projects\duma\win32-msvc.net\dumadll\dumadll.cpp 1161053060 0 C:\projects\duma\win32-msvc.net\dumadll\dumadll.cpp C:\projects\duma\detours\bin\edll3.exp 1161518440 0 C:\projects\duma\detours\bin\edll3.exp C:\projects\duma\win32-msvc.net\quicktest\stdafx.h 1161053060 0 C:\projects\duma\win32-msvc.net\quicktest\stdafx.h C:\projects\duma\dumadetoursdll\dumadetoursdll.cpp 1161519647 0 C:\projects\duma\dumadetoursdll\dumadetoursdll.cpp C:\projects\duma\stacktrace\internal\TextFile.h 1161053048 0 C:\projects\duma\stacktrace\internal\TextFile.h C:\projects\duma\duma.h 1161519444 0 C:\projects\duma\duma.h C:\projects\duma\detours\include\detours.h 1157669994 0 C:\projects\duma\detours\include\detours.h C:\projects\duma\dumadll\stdafx.h 1161053046 0 C:\projects\duma\dumadll\stdafx.h C:\projects\duma\stacktrace\internal\Array.h 1161053048 0 C:\projects\duma\stacktrace\internal\Array.h C:\projects\duma\example5.cpp 1125407927 0 C:\projects\duma\example5.cpp C:\projects\duma\detours\bin\dslept.exp 1161518428 0 C:\projects\duma\detours\bin\dslept.exp C:\projects\duma\dumadetours\stdafx.h 1161053045 0 C:\projects\duma\dumadetours\stdafx.h C:\projects\duma\duma.c 1161507866 1 C:\projects\duma\duma.c C:\projects\duma\stacktrace\internal\MapFile.h 1161053048 0 C:\projects\duma\stacktrace\internal\MapFile.h C:\projects\duma\example6.cpp 1161053034 0 C:\projects\duma\example6.cpp C:\projects\duma\duma_hlp.h 1161053033 1 C:\projects\duma\duma_hlp.h C:\projects\duma\dumapp.h 1161053034 0 C:\projects\duma\dumapp.h C:\projects\duma\example3.cpp 1125407927 0 C:\projects\duma\example3.cpp C:\projects\duma\detours\readme.txt 1161053043 0 C:\projects\duma\detours\readme.txt C:\projects\duma\dumatest.c 1161519445 0 C:\projects\duma\dumatest.c C:\projects\duma\dumadetoursdll\stdafx.h 1161053045 0 C:\projects\duma\dumadetoursdll\stdafx.h C:\projects\duma\detours\lib\detoured.exp 1161518421 0 C:\projects\duma\detours\lib\detoured.exp C:\projects\duma\win32-msvc.2005\stacktrace\ReadMe.txt 1161053058 0 C:\projects\duma\win32-msvc.2005\stacktrace\ReadMe.txt C:\projects\duma\detoursexample1\stdafx.cpp 1161053043 0 C:\projects\duma\detoursexample1\stdafx.cpp C:\projects\duma\win32-msvc.net\dumadll\ReadMe.txt 1161053060 0 C:\projects\duma\win32-msvc.net\dumadll\ReadMe.txt C:\projects\duma\win32-msvc.2005\quicktest\quicktest.cpp 1161053058 0 C:\projects\duma\win32-msvc.2005\quicktest\quicktest.cpp C:\projects\duma\dumadll\stdafx.cpp 1161053046 0 C:\projects\duma\dumadll\stdafx.cpp C:\projects\duma\stacktrace\internal\StackTrace.h 1161053048 0 C:\projects\duma\stacktrace\internal\StackTrace.h C:\projects\duma\stacktrace\printStackTrace.h 1161053049 0 C:\projects\duma\stacktrace\printStackTrace.h C:\projects\duma\detoursexample1\stdafx.h 1161053043 0 C:\projects\duma\detoursexample1\stdafx.h C:\projects\duma\noduma.h 1161053034 0 C:\projects\duma\noduma.h C:\projects\duma\stacktrace\printStackTrace.cpp 1161557734 1 C:\projects\duma\stacktrace\printStackTrace.cpp C:\projects\duma\detours\bin\simple.exp 1161518426 0 C:\projects\duma\detours\bin\simple.exp C:\projects\duma\createconf.c 1161517722 0 C:\projects\duma\createconf.c C:\projects\duma\stacktrace\internal\TextFile.cpp 1161053048 0 C:\projects\duma\stacktrace\internal\TextFile.cpp C:\projects\duma\detours\bin\edll2.exp 1161518439 0 C:\projects\duma\detours\bin\edll2.exp C:\projects\duma\detours\bin\extend.exp 1161518444 0 C:\projects\duma\detours\bin\extend.exp C:\projects\duma\detours\bin\slept.exp 1161518428 0 C:\projects\duma\detours\bin\slept.exp C:\projects\duma\win32-msvc.2005\dumadetoursdll\Detours\dumadetoursdll.exp 1161517733 0 C:\projects\duma\win32-msvc.2005\dumadetoursdll\Detours\dumadetoursdll.exp C:\projects\duma\dumapp.cpp 1161053033 1 C:\projects\duma\dumapp.cpp C:\projects\duma\detours\bin\target.exp 1161518443 0 C:\projects\duma\detours\bin\target.exp C:\projects\duma\dumadetoursdll\stdafx.cpp 1161053045 0 C:\projects\duma\dumadetoursdll\stdafx.cpp C:\projects\duma\stacktrace\internal\MapFile.cpp 1161053048 0 C:\projects\duma\stacktrace\internal\MapFile.cpp duma-VERSION_2_5_21/docs-data/Data/PreviousMenuState.nd000066400000000000000000000007551401225056000225750ustar00rootroot00000000000000#READMEC:\projects\duma\README.txtWin32 Detours Howto(C:\projects\duma\WIN32_DETOURS_HOWTO.txtSourceduma.cC:\projects\duma\duma.c duma_hlp.hC:\projects\duma\duma_hlp.h dumapp.cppC:\projects\duma\dumapp.cpphC:\projects\duma\paging.hprint.cC:\projects\duma\print.cstacktrace\printStackTrace.cpp/C:\projects\duma\stacktrace\printStackTrace.cppIndex EverythinggeneralFilesfile FunctionsfunctionTypestype Variablesvariableduma-VERSION_2_5_21/docs-data/Data/PreviousSettings.nd000066400000000000000000000000741401225056000224620ustar00rootroot00000000000000#C:\projects\duma1C:\projects\duma\docsHTMLduma-VERSION_2_5_21/docs-data/Data/SymbolTable.nd000066400000000000000000000363501401225056000213500ustar00rootroot00000000000000#slotForInternalAddrNextToC:\projects\duma\duma_hlp.hfunctionDstatic struct _DUMA_Slot * slotForInternalAddrNextTo(void * address)0Find the slot structure for an internal address. _duma_vallocC:\projects\duma\duma.cfunction2void * _duma_valloc(size_t size DUMA_PARAMLIST_FL)A version of valloc.DUMA_OUTPUT_FILEC:\projects\duma\duma.cvariablechar* DUMA_OUTPUT_FILEeDUMA_OUTPUT_FILE is a global variable used to control if DUMA output is printed to a specified file.  unUsedSlotsC:\projects\duma\duma.cvariablestatic size_t unUsedSlotskunUsedSlots is the number of Slot structures that are currently available to represent new malloc buffers. slotForInternalAddrPrevToC:\projects\duma\duma_hlp.hfunctionDstatic struct _DUMA_Slot * slotForInternalAddrPrevTo(void * address)mGiven the internal address of a buffer, find the buffer immediately before that buffer in the address space. DUMA_PROTECT_BELOWC:\projects\duma\duma.cvariableint DUMA_PROTECT_BELOWDDUMA_PROTECT_BELOW is used to modify the behavior of the allocator. Variables and EnumerationsC:\projects\duma\duma.cgroupstringErrorReportC:\projects\duma\paging.hfunction+static const char * stringErrorReport(void)'Get formatted error string and return. DUMA_OUTPUT_STACKTRACE_MAPFILEC:\projects\duma\duma.cvariable$char* DUMA_OUTPUT_STACKTRACE_MAPFILEkDUMA_OUTPUT_STACKTRACE_MAPFILE is a global variable used to control what mapfile is used for stack traces. _duma_allocListSizeC:\projects\duma\duma.cvariable!static size_t _duma_allocListSize8_duma_allocListSize is the size of the allocation list. Win32 Detours Howto(C:\projects\duma\WIN32_DETOURS_HOWTO.txtsectionJIt is now possible to use detours with duma on already compiled binaries.  _duma_exitC:\projects\duma\duma.cfunction{void #if ( defined(DUMA_GNU_INIT_ATTR) && !defined(DUMA_PREFER_ATEXIT) ) __attribute ((destructor)) #endif _duma_exit(void)UDUMA's exit function, called atexit() or with GNU C Compiler's destructor attribute.  slotsPerPageC:\projects\duma\duma.cvariablestatic size_t slotsPerPagePslotsPerPage is the number of slot structures that fit in a virtual memory page.MEMORY_CREATION_SIZEC:\projects\duma\duma.cvariable[MEMORY_CREATION_SIZE is the amount of memory to get from the operating system at one time. printcC:\projects\duma\print.cfile DUMA_AbortC:\projects\duma\print.cfunction*void DUMA_Abort(const char * pattern, ...)‚external abort function on Visual C++ it additionally prints to Debug Output of the IDE void DUMA_Abort(const char * pattern, ...) _duma_freeC:\projects\duma\duma.cfunction1void _duma_free(void * baseAdr DUMA_PARAMLIST_FL)A version of free.sumTotalAllocatedMemC:\projects\duma\duma.cvariable static long sumTotalAllocatedMem0internal variable: sum of allocated memory in kBDUMA_FREE_ACCESSC:\projects\duma\duma.cvariablestatic int DUMA_FREE_ACCESSMDUMA_FREE_ACCESS is set if DUMA is to write access memory before freeing it. duma_hlphC:\projects\duma\duma_hlp.hfileDUMA_ALLOW_MALLOC_0C:\projects\duma\duma.cvariablestatic int DUMA_ALLOW_MALLOC_0:DUMA_ALLOW_MALLOC_0 is set if DUMA is to allow malloc(0). _duma_init_slackC:\projects\duma\duma_hlp.hfunction8static void _duma_init_slack( struct _DUMA_Slot * slot )-Initialise the no mans land, for a given slot Page_SizeC:\projects\duma\paging.hfunctionstatic size_t Page_Size(void)Retrieve page size. DUMA_PrintC:\projects\duma\print.cfunction*void DUMA_Print(const char * pattern, ...)‚external print function on Visual C++ it additionally prints to Debug Output of the IDE void DUMA_Print(const char * pattern, ...) numAllocsC:\projects\duma\duma.cvariablestatic long numAllocs9internal variable: number of allocations processed so far2No frames are deleted or modified by this functionC:\projects\duma\duma.cgeneric_duma_cxx_null_addrC:\projects\duma\duma.cvariablep_duma_cxx_null_addr is the address C++ new operator returns, when size is 0 two pages get reserved and protected _duma_strcatC:\projects\duma\duma.cfunctionBchar * _duma_strcat(char *dest, const char *src DUMA_PARAMLIST_FL)WA version of strcat that provides extra checks based on information we know about HEAP. _duma_strdupC:\projects\duma\duma.cfunction7char * _duma_strdup(const char * str DUMA_PARAMLIST_FL)A version of strdup.dumappcppC:\projects\duma\dumapp.cppfiledumacC:\projects\duma\duma.cfilesumAllocatedMemC:\projects\duma\duma.cvariablestatic long sumAllocatedMemBinternal variable: sum of allocated -freed +protected memory in kB Page_CreateC:\projects\duma\paging.hfunctionFstatic void * Page_Create(size_t size, int exitonfail, int printerror)Create memory. paginghC:\projects\duma\paging.hsectionDUMA_SHOW_ALLOCC:\projects\duma\duma.cvariablestatic int DUMA_SHOW_ALLOC]DUMA_SHOW_ALLOC is set if DUMA is to print all allocations and deallocations to the console. DUMA_MAX_ALLOCC:\projects\duma\duma.cvariablestatic long DUMA_MAX_ALLOCÈDUMA_MAX_ALLOC is used to control the maximum memory print of the program in total: When the sum of allocated and protected memory would exceed this value in kB, the protected memory is freed/deleted._duma_deallocateC:\projects\duma\duma.cfunctionmvoid _duma_deallocate(void * address, int protectAllocList, enum _DUMA_Allocator allocator DUMA_PARAMLIST_FL)ODeallocate allocated memory after running some checks, then open slot for use.  slotCountC:\projects\duma\duma.cvariablestatic size_t slotCount=slotCount is the number of Slot structures in allocationList. _duma_strncpyC:\projects\duma\duma.cfunctionPchar * _duma_strncpy(char *dest, const char *src, size_t size DUMA_PARAMLIST_FL)XA version of strncpy that provides extra checks based on information we know about HEAP. numDeallocsC:\projects\duma\duma.cvariablestatic long numDeallocs;internal variable: number of deallocations processed so farreduceProtectedMemoryC:\projects\duma\duma_hlp.hfunction:static int reduceProtectedMemory( size_t reductionSizekB )~delete reductionSizekB amount of memory, which has already been freed but got protected return != 0 when more memory reducableDUMA_OUTPUT_STDERRC:\projects\duma\duma.cvariableint DUMA_OUTPUT_STDERR]DUMA_OUTPUT_STDERR is a global variable used to control if DUMA output is printed to STDERR. stacktrace\printStackTracecpp/C:\projects\duma\stacktrace\printStackTrace.cppfile _duma_initC:\projects\duma\duma.cfunctionRvoid #ifdef DUMA_GNU_INIT_ATTR __attribute ((constructor)) #endif _duma_init(void)[_duma_init sets up the memory allocation arena and the run-time configuration information. READMEC:\projects\duma\README.txtsection _duma_reallocC:\projects\duma\duma.cfunctionHvoid * _duma_realloc(void * oldBuffer, size_t newSize DUMA_PARAMLIST_FL)XA version of realloc that provides extra checks based on information we know about HEAP. _duma_callocC:\projects\duma\duma.cfunctionBvoid * _duma_calloc(size_t nelem, size_t elsize DUMA_PARAMLIST_FL)A version of calloc. duma_initC:\projects\duma\duma.cfunction=#ifndef DUMA_EXPLICIT_INIT static #endif void duma_init(void)'duma_init sets configuration settings.  Page_DeleteC:\projects\duma\paging.hfunction4static void Page_Delete(void * address, size_t size)Free's DUMA allocated memory.  operator newC:\projects\duma\dumapp.cppfunctionHvoid * DUMA_CDECL operator new( DUMA_SIZE_T size ) throw(std::bad_alloc)9Single object form, no debug information (11) = (a) ; ASWDUMA_SUPPRESS_ATEXITC:\projects\duma\duma.cvariablestatic int DUMA_SUPPRESS_ATEXIT€DUMA_SUPPRESS_ATEXIT is set if DUMA is to suppress the installation of an exit handler, called at the exit of the main program. _duma_check_slackC:\projects\duma\duma_hlp.hfunction9static void _duma_check_slack( struct _DUMA_Slot * slot )6Checks the integrity of no mans land, for a given slot _duma_strncatC:\projects\duma\duma.cfunctionPchar * _duma_strncat(char *dest, const char *src, size_t size DUMA_PARAMLIST_FL)XA version of strncat that provides extra checks based on information we know about HEAP.DUMA_MALLOC_FAILEXITC:\projects\duma\duma.cvariablestatic int DUMA_MALLOC_FAILEXIT_DUMA_MALLOC_FAILEXIT controls the behaviour of DUMA when malloc() fails and would return NULL. _duma_allocateC:\projects\duma\duma.cfunction¼void * _duma_allocate(size_t alignment, size_t userSize, int protectBelow, int fillByte, int protectAllocList, enum _DUMA_Allocator allocator, enum _DUMA_FailReturn fail DUMA_PARAMLIST_FL)This is the memory allocator.  _duma_strcpyC:\projects\duma\duma.cfunctionBchar * _duma_strcpy(char *dest, const char *src DUMA_PARAMLIST_FL)WA version of strcpy that provides extra checks based on information we know about HEAP.allocateMoreSlotsC:\projects\duma\duma.cfunction#static void allocateMoreSlots(void)€allocateMoreSlots is called when there are only enough slot structures left to support the allocation of a single malloc buffer._DUMA_SlotStateC:\projects\duma\duma.ctype'State of slot values (empty, free, etc) DUMA_FILLC:\projects\duma\duma.cvariable int DUMA_FILLaDUMA_FILL is set to 0-255 if DUMA should fill all new allocated memory with the specified value.  sprintNumberC:\projects\duma\print.cfunctionHstatic int sprintNumber(char* obuffer, DUMA_ADDR number, DUMA_ADDR base)vinternal function to print a DUMA_ADDR into a buffer int sprintNumber(char* obuffer, DUMA_ADDR number, DUMA_ADDR base)duma_init_doneC:\projects\duma\duma.cvariable*internal variable: state of initialization DUMA_ExitC:\projects\duma\print.cfunction)void DUMA_Exit(const char * pattern, ...)€external exit function on Visual C++ it additionally prints to Debug Output of the IDE void DUMA_Exit(const char * pattern, ...)Page_AllowAccessC:\projects\duma\paging.hfunction2void Page_AllowAccess(void * address, size_t size)(Allow memory access to allocated memory.operator new[]C:\projects\duma\dumapp.cppfunctionJvoid * DUMA_CDECL operator new[]( DUMA_SIZE_T size ) throw(std::bad_alloc)8Array object form, no debug information (21) = (a) ; AAW _duma_memcpyC:\projects\duma\duma.cfunctionOvoid * _duma_memcpy(void *dest, const void *src, size_t size DUMA_PARAMLIST_FL)WA version of memcpy that provides extra checks based on information we know about HEAP.DUMA_PROTECT_FREEC:\projects\duma\duma.cvariablestatic long DUMA_PROTECT_FREE^DUMA_PROTECT_FREE is used to control the disposition of memory that is released using free(). duma_new_operatorC:\projects\duma\dumapp.cppfunction¦void * duma_new_operator(DUMA_SIZE_T userSize, enum _DUMA_Allocator allocator, bool dothrow #ifndef DUMA_NO_LEAKDETECTION , const char * filename, int lineno #endif )5C++ allocation function, which is nearly C++ conform.Page_DenyAccessC:\projects\duma\paging.hfunction8static void Page_DenyAccess(void * address, size_t size)'Deny access to allocated memory region._duma_allocListC:\projects\duma\duma.cvariable#struct _DUMA_Slot * _duma_allocListW_DUMA_allocList points to the array of slot structures used to manage the malloc arena. _duma_assertC:\projects\duma\duma.cfunctionJvoid _duma_assert(const char * exprstr, const char * filename, int lineno)6Print message and halt program execution in crazy way. sprintLongC:\projects\duma\print.cfunction .ft .fi .LP .nf .ft B void * malloc (size_t size); .ft .fi .LP .nf .ft B void free (void *ptr); .ft .fi .LP .nf .ft B void * realloc (void *ptr, size_t size); .ft .fi .LP .nf .ft B void * calloc (size_t nelem, size_t elsize); .ft .fi .LP .nf .ft B void * memalign (size_t alignment, size_t size); .ft .fi .LP .nf .ft B void * valloc (size_t size); .ft .fi .LP .nf .ft B extern int DUMA_ALIGNMENT; .ft .fi .LP .nf .ft B extern int DUMA_PROTECT_BELOW; .ft .fi .LP .nf .ft B extern int DUMA_PROTECT_FREE; .ft .fi .LP .nf .ft B extern int DUMA_ALLOW_MALLOC_0; .ft .fi .LP .nf .ft B extern int DUMA_FILL; .ft .fi .SH DESCRIPTION .I DUMA helps you detect two common programming bugs: software that overruns the boundaries of a malloc() memory allocation, and software that touches a memory allocation that has been released by free(). Unlike other malloc() debuggers, DUMA will detect .I read accesses as well as writes, and it will pinpoint the exact instruction that causes an error. It has been in use at Pixar since 1987, and at many other sites for years. .LP DUMA uses the virtual memory hardware of your computer to place an inaccessible memory page immediately after (or before, at the user's option) each memory allocation. When software reads or writes this inaccessible page, the hardware issues a segmentation fault, stopping the program at the offending instruction. It is then trivial to find the erroneous statement using your favorite debugger. In a similar manner, memory that has been released by free() is made inaccessible, and any code that touches it will get a segmentation fault. .LP Simply linking your application with libduma.a will allow you to detect most, but not all, malloc buffer overruns and accesses of free memory. If you want to be reasonably sure that you've found .I all bugs of this type, you'll have to read and understand the rest of this man page. .SH USAGE Link your program with the library .B libduma.a . Make sure you are .I not linking with .B -lmalloc, .B -lmallocdebug, or with other malloc-debugger or malloc-enhancer libraries. You can only use one at a time. If your system administrator has installed DUMA for public use, you'll be able to use the .B -lduma argument to the linker, otherwise you'll have to put the path-name for .B libduma.a in the linker's command line. You can also use dynamic linking. If you're using a Bourne shell, the statement .B export LD_PRELOAD=libduma.so.0.0 will cause DUMA to be loaded to run all dynamic executables. The command .B duma .I command runs a single command under DUMA. .LP Some systems will require special arguments to the linker to assure that you are using the DUMA malloc() and not the one from your C library. .LP Run your program .I using a debugger. It's easier to work this way than to create a .B core file and post-mortem debug it. DUMA can create .I huge core files, and some operating systems will thus take minutes simply to dump core! Some operating systems will not create usable core files from programs that are linked with DUMA. If your program has one of the errors detected by DUMA, it will get a segmentation fault (SIGSEGV) at the offending instruction. Use the debugger to locate the erroneous statement, and repair it. .SH GLOBAL AND ENVIRONMENT VARIABLES DUMA has four configuration switches that can be enabled via the shell environment, or by setting the value of global integer variables using a debugger. These switches change what bugs DUMA will detect, so it's important that you know how to use them. .TP DUMA_ALIGNMENT This is an integer that specifies the alignment for any memory allocations that will be returned by malloc(), calloc(), and realloc(). The value is specified in bytes, thus a value of 4 will cause memory to be aligned to 32-bit boundaries unless your system doesn't have a 8-bit characters. DUMA_ALIGNMENT is set to sizeof(int) by default, since that is generally the word-size of your CPU. If your program requires that allocations be aligned to 64-bit boundaries and you have a 32-bit .B int you'll have to set this value to 8. This is the case when compiling with the .B -mips2 flag on MIPS-based systems such as those from SGI. The memory allocation that is returned by DUMA malloc() is aligned using the value in DUMA_ALIGNMENT, and .I its size the multiple of .I that value that is greater than or equal to the requested size. For this reason, you will sometimes want to set DUMA_ALIGNMENT to 0 (no alignment), so that you can detect overruns of less than your CPU's word size. Be sure to read the section .I WORD-ALIGNMENT AND OVERRUN DETECTION in this manual page before you try this. To change this value, set DUMA_ALIGNMENT in the shell environment to an integer value, or assign to the global integer variable DUMA_ALIGNMENT using a debugger. .TP DUMA_PROTECT_BELOW DUMA usually places an inaccessible page immediately after each memory allocation, so that software that runs past the end of the allocation will be detected. Setting DUMA_PROTECT_BELOW to 1 causes DUMA to place the inaccessible page .I before the allocation in the address space, so that under-runs will be detected instead of over-runs. When DUMA_PROTECT_BELOW is set, the DUMA_ALIGNMENT parameter is ignored. All allocations will be aligned to virtual-memory-page boundaries, and their size will be the exact size that was requested. To change this value, set DUMA_PROTECT_BELOW in the shell environment to an integer value, or assign to the global integer variable DUMA_PROTECT_BELOW using a debugger. .TP DUMA_PROTECT_FREE DUMA usually returns free memory to a pool from which it may be re-allocated. If you suspect that a program may be touching free memory, set DUMA_PROTECT_FREE to 1. This will cause DUMA to never re-allocate memory once it has been freed, so that any access to free memory will be detected. Some programs will use tremendous amounts of memory when this parameter is set. To change this value, set DUMA_PROTECT_FREE in the shell environment to an integer value, or assign to the global integer variable DUMA_PROTECT_FREE using a debugger. .TP DUMA_ALLOW_MALLOC_0 By default, DUMA traps calls to malloc() with a size of zero, because they are often the result of a software bug. If DUMA_ALLOW_MALLOC_0 is non-zero, the software will not trap calls to malloc() with a size of zero. To change this value, set DUMA_ALLOC_MALLOC_0 in the shell environment to an integer value, or assign to the global integer variable DUMA_ALLOC_MALLOC_0 using a debugger. .TP DUMA_FILL When set to a value between 0 and 255, every byte of allocated memory is initialized to that value. This can help detect reads of uninitialized memory. When set to -1, some memory is filled with zeroes (the operating system default on most systems) and some memory will retain the values written to it during its last use. .TP DUMA_MEMCPY_OVERLAP Setting this variable to 1 will make DUMA to ignore memcpy region overlapping when the destination address is less than source address. It was added as a workaround for ARM port where memmove implementation calls memcpy if the overlapping destination is safe and produces in false aborts. .SH WORD-ALIGNMENT AND OVERRUN DETECTION There is a conflict between the alignment restrictions that malloc() operates under and the debugging strategy used by DUMA. When detecting overruns, DUMA malloc() allocates two or more virtual memory pages for each allocation. The last page is made inaccessible in such a way that any read, write, or execute access will cause a segmentation fault. Then, DUMA malloc() will return an address such that the first byte after the end of the allocation is on the inaccessible page. Thus, any overrun of the allocation will cause a segmentation fault. .LP It follows that the address returned by malloc() is the address of the inaccessible page minus the size of the memory allocation. Unfortunately, malloc() is required to return .I word-aligned allocations, since many CPUs can only access a word when its address is aligned. The conflict happens when software makes a memory allocation using a size that is not a multiple of the word size, and expects to do word accesses to that allocation. The location of the inaccessible page is fixed by hardware at a word-aligned address. If DUMA malloc() is to return an aligned address, it must increase the size of the allocation to a multiple of the word size. In addition, the functions memalign() and valloc() must honor explicit specifications on the alignment of the memory allocation, and this, as well can only be implemented by increasing the size of the allocation. Thus, there will be situations in which the end of a memory allocation contains some padding space, and accesses of that padding space will not be detected, even if they are overruns. .LP DUMA provides the variable DUMA_ALIGNMENT so that the user can control the default alignment used by malloc(), calloc(), and realloc(). To debug overruns as small as a single byte, you can set DUMA_ALIGNMENT to zero. This will result in DUMA malloc() returning unaligned addresses for allocations with sizes that are not a multiple of the word size. This is not a problem in most cases, because compilers must pad the size of objects so that alignment restrictions are honored when storing those objects in arrays. The problem surfaces when software allocates odd-sized buffers for objects that must be word-aligned. One case of this is software that allocates a buffer to contain a structure and a string, and the string has an odd size (this example was in a popular TIFF library). If word references are made to un-aligned buffers, you will see a bus error (SIGBUS) instead of a segmentation fault. The only way to fix this is to re-write the offending code to make byte references or not make odd-sized allocations, or to set DUMA_ALIGNMENT to the word size. .LP Another example of software incompatible with DUMA_ALIGNMENT < word-size is the strcmp() function and other string functions on SunOS (and probably Solaris), which make word-sized accesses to character strings, and may attempt to access up to three bytes beyond the end of a string. These result in a segmentation fault (SIGSEGV). The only way around this is to use versions of the string functions that perform byte references instead of word references. .SH INSTRUCTIONS FOR DEBUGGING YOUR PROGRAM .TP 1. Link with libduma.a as explained above. .TP 2. Run your program in a debugger and fix any overruns or accesses to free memory. .TP 3. Quit the debugger. .TP 4. Set DUMA_PROTECT_BELOW = 1 in the shell environment. .TP 5. Repeat step 2, this time repairing underruns if they occur. .TP 6. Quit the debugger. .TP 7. Read the restrictions in the section on .I WORD-ALIGNMENT AND OVERRUN DETECTION. See if you can set DUMA_ALIGNMENT to 0 and repeat step 2. Sometimes this will be too much work, or there will be problems with library routines for which you don't have the source, that will prevent you from doing this. .SH MEMORY USAGE AND EXECUTION SPEED Since DUMA uses at least two virtual memory pages for each of its allocations, it's a terrible memory hog. I've sometimes found it necessary to add a swap file using swapon(8) so that the system would have enough virtual memory to debug my program. Also, the way we manipulate memory results in various cache and translation buffer entries being flushed with each call to malloc or free. The end result is that your program will be much slower and use more resources while you are debugging it with DUMA. .LP Don't leave libduma.a linked into production software! Use it only for debugging. .SH AUTHOR Hayati Ayguen .SH WARNINGS I have tried to do as good a job as I can on this software, but I doubt that it is even theoretically possible to make it bug-free. This software has no warranty. It will not detect some bugs that you might expect it to detect, and will indicate that some non-bugs are bugs. .SH LICENSE Copyright 1987-1999 Bruce Perens. All rights reserved. .br This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, Version 2, as published by the Free Software Foundation. A copy of this license is distributed with this software in the file "COPYING". This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Read the file "COPYING" for more details. .SH CONTACTING THE AUTHOR .nf Bruce Perens 1563 Solano Ave. #349 Berkeley, CA 94707 Telephone: 510-526-1165 Internet: bruce@perens.com .fi .ft .SH FILES /dev/zero: Source of memory pages (via mmap(2)). .SH SEE ALSO malloc(3), mmap(2), mprotect(2), swapon(8) .SH DIAGNOSTICS Segmentation Fault: Examine the offending statement for violation of the boundaries of a memory allocation. .br Bus Error: See the section on .I WORD-ALIGNMENT AND OVERRUN DETECTION. in this manual page. .SH BUGS My explanation of the alignment issue could be improved. .LP Some Sun systems running SunOS 4.1 were reported to signal an access to a protected page with .B SIGBUS rather than .B SIGSEGV, I suspect this is an undocumented feature of a particular Sun hardware version, not just the operating system. On these systems, dumatest will fail with a bus error until you modify the Makefile to define .B PAGE_PROTECTION_VIOLATED_SIGNAL as .B SIGBUS. .LP There are, without doubt, other bugs and porting issues. Please contact me via e-mail if you have any bug reports, ideas, etc. .SH WHAT'S BETTER .I Purify does a much more thorough job than DUMA, and does not have the huge memory overhead. .I Checkergcc, a modified version of the GNU C Compiler that instruments all memory references, is available on Linux systems and where GCC is used. It performs some of the same tasks as Purify, but only on code that it has compiled. duma-VERSION_2_5_21/duma.c000066400000000000000000002231161401225056000151700ustar00rootroot00000000000000/* * DUMA - Red-Zone memory allocator. * Copyright (C) 2006 Michael Eddington * Copyright (C) 2002-2009 Hayati Ayguen , Procitec GmbH * Copyright (C) 1987-1999 Bruce Perens * License: GNU GPL (GNU General Public License, see COPYING-GPL) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * * FILE CONTENTS: * -------------- * This is a special version of malloc() and company for debugging software * that is suspected of overrunning or underrunning the boundaries of a * malloc buffer, or touching free memory. * * It arranges for each malloc buffer to be followed (or preceded) * in the address space by an inaccessable virtual memory page, * and for free memory to be inaccessable. If software touches the * inaccessable page, it will get an immediate segmentation * fault. It is then trivial to uncover the offending code using a debugger. * * An advantage of this product over most malloc debuggers is that this one * detects reading out of bounds as well as writing, and this one stops on * the exact instruction that causes the error, rather than waiting until the * next boundary check. * * There is one product that debugs malloc buffer overruns * better than DUMA: "Purify" from Purify Systems, and that's only * a small part of what Purify does. I'm not affiliated with Purify, I just * respect a job well done. * * This version of malloc() should not be linked into production software, * since it tremendously increases the time and memory overhead of malloc(). * Each malloc buffer will consume a minimum of two virtual memory pages, * this is 16 kilobytes on many systems. On some systems it will be necessary * to increase the amount of swap space in order to debug large programs that * perform lots of allocation, because of the per-buffer overhead. */ #ifndef DUMA_NO_DUMA #include #include #include #include #include #include #include #include #ifndef WIN32 #include #include #include #include #else #define WIN32_LEAN_AND_MEAN 1 #include #include #include #ifndef __CYGWIN__ /* already defined in cygwin headers */ typedef LPVOID caddr_t; typedef unsigned u_int; #endif #endif #ifdef _MSC_VER #include #endif #include "duma.h" #include "noduma.h" #include "print.h" #include "duma_sem.h" #include "paging.h" #include "verinfo.h" #if defined(WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__MINGW64__) DUMA_EXTERN_C void StackTraceCleanup(); DUMA_EXTERN_C void printStackTrace(char* buffer, int bufferSize, char* mapFilename); #endif static const char version[] = #ifndef GIT_SOURCE_VERSION "DUMA (" #else GIT_SOURCE_VERSION #endif #ifdef DUMA_SO_LIBRARY "shared library" #elif DUMA_DLL_LIBRARY "DLL library" #elif DUMA_DETOURS "detours" #else "static library" #endif #ifdef DUMA_NO_GLOBAL_MALLOC_FREE ", NO_GLOBAL_MALLOC_FREE" #endif #ifdef DUMA_NO_THREAD_SAFETY ", NO_THREAD_SAFETY" #endif #ifdef DUMA_NO_CPP_SUPPORT ", NO_CPP_SUPPORT" #endif #ifdef DUMA_NO_LEAKDETECTION ", NO_LEAKDETECTION" #endif #ifdef DUMA_EXPLICIT_INIT ", EXPLICIT_INIT" #endif #ifdef DUMA_PREFER_ATEXIT ", PREFER_ATEXIT" #endif #ifdef DUMA_PREFER_GETENV ", PREFER_GETENV" #endif ")\n" "Copyright (C) 2006 Michael Eddington \n" "Copyright (C) 2002-2009 Hayati Ayguen , Procitec GmbH\n" "Copyright (C) 1987-1999 Bruce Perens \n\n"; static const char unknown_file[] = "UNKNOWN (use #include \"duma.h\")"; #ifndef DUMA_NO_LEAKDETECTION #define DUMA_PARAMLIST_FL , const char * filename, int lineno #define DUMA_PARAMS_FL , filename, lineno #define DUMA_PARAMS_UK , unknown_file, 0 #else #define DUMA_PARAMLIST_FL #define DUMA_PARAMS_FL #define DUMA_PARAMS_UK #endif #ifndef DUMA_PREFER_GETENV #define DUMA_GETENV duma_getenv #else #define DUMA_GETENV getenv #endif /* Variable: MEMORY_CREATION_SIZE * * MEMORY_CREATION_SIZE is the amount of memory to get from the operating * system at one time. We'll break that memory down into smaller pieces for * malloc buffers. One megabyte is probably a good value. */ #define MEMORY_CREATION_SIZE 1024 * 1024 /* Enum: _DUMA_SlotState * * State of slot values (empty, free, etc) */ enum _DUMA_SlotState { DUMAST_EMPTY /* slot not in use */ , DUMAST_FREE /* internal memory reserved, unused by user */ , DUMAST_IN_USE /* memory in use by allocator; see following enum AllocType */ , DUMAST_ALL_PROTECTED /* memory no more used by allocator; memory is not deallocated but protected */ , DUMAST_BEGIN_PROTECTED /* most memory deallocated, but not page covering userAddress: * slot holds userAddress, userSize and allocator. */ }; enum _DUMA_Slot_FileSource { DUMAFS_EMPTY /* no filename, lineno */ , DUMAFS_ALLOCATION /* filename, lineno from allocation */ , DUMAFS_DEALLOCATION /* filename, lineno from deallocation */ }; enum _DUMA_InitState { DUMAIS_UNINITIALIZED = 0x1611 /* not initialized */ , DUMAIS_IN_CONSTRUCTOR /* in constructor _duma_init() */ , DUMAIS_OUT_CONSTRUCTOR /* construction _duma_init() finished */ , DUMAIS_IN_INIT /* in initializer duma_init() */ , DUMAIS_OUT_INIT /* initialization duma_init() finished */ }; /* * Struct Slot contains all of the information about a malloc buffer except * for the contents of its memory. */ struct _DUMA_Slot { void * internalAddress; void * userAddress; void * protAddress; size_t internalSize; size_t userSize; /* save (some) space in production */ unsigned short state :16; #ifdef DUMA_NO_LEAKDETECTION unsigned short allocator :16; #else unsigned short allocator :8; unsigned short fileSource :8; #endif #ifndef DUMA_NO_LEAKDETECTION char * filename; /* filename of allocation */ int lineno; /* linenumber of allocation * -1 == memory was allocated before duma_init() * 0 == no leak information present * >0 == leak information present */ #endif /* Feature currently only works on win32 */ #if defined(WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__MINGW64__) char * stacktrace; /* stacktrace of allocation */ #endif #ifdef DUMA_EXPLICIT_INIT int slackfill; #endif }; enum _DUMA_AllocType { DUMAAT_INTERNAL , DUMAAT_MALLOC , DUMAAT_NEW_ELEM , DUMAAT_NEW_ARRAY , DUMAAT_MEMBER_NEW_ELEM , DUMAAT_MEMBER_NEW_ARRAY }; enum _DUMA_AllocStd { DUMAAS_C , DUMAAS_CPP }; static const struct _DUMA_AllocDesc { char * name; enum _DUMA_AllocType type; enum _DUMA_AllocStd std; } _duma_allocDesc[] = { { "duma allocate()" , DUMAAT_INTERNAL , DUMAAS_C } , { "duma deallocate()" , DUMAAT_INTERNAL , DUMAAS_C } , { "malloc()" , DUMAAT_MALLOC , DUMAAS_C } , { "calloc()" , DUMAAT_MALLOC , DUMAAS_C } , { "free()" , DUMAAT_MALLOC , DUMAAS_C } , { "memalign()" , DUMAAT_MALLOC , DUMAAS_C } , { "posix_memalign()" , DUMAAT_MALLOC , DUMAAS_C } , { "realloc()" , DUMAAT_MALLOC , DUMAAS_C } , { "valloc()" , DUMAAT_MALLOC , DUMAAS_C } , { "strdup()" , DUMAAT_MALLOC , DUMAAS_C } , { "scalar new" , DUMAAT_NEW_ELEM , DUMAAS_CPP } , { "scalar delete" , DUMAAT_NEW_ELEM , DUMAAS_CPP } , { "vector new[]" , DUMAAT_NEW_ARRAY , DUMAAS_CPP } , { "vector delete[]" , DUMAAT_NEW_ARRAY , DUMAAS_CPP } , { "member scalar new" , DUMAAT_MEMBER_NEW_ELEM , DUMAAS_CPP } , { "member scalar delete" , DUMAAT_MEMBER_NEW_ELEM , DUMAAS_CPP } , { "member vector new[]" , DUMAAT_MEMBER_NEW_ARRAY, DUMAAS_CPP } , { "member vector delete[]", DUMAAT_MEMBER_NEW_ARRAY, DUMAAS_CPP } }; #ifdef DUMA_EXPLICIT_INIT #define IF__DUMA_INIT_DONE if (DUMAIS_OUT_INIT == _duma_s.init_state) #else #define IF__DUMA_INIT_DONE #endif /* Collection of all global static non const variables for DUMA */ static struct _DUMA_GlobalStaticVars { /* Protection Space A */ char acSpaceA[2 * DUMA_PAGE_SIZE]; int DUMA_IN_DUMA; /* Variable: DUMA_DISABLE_BANNER * * DUMA_DISABLE_BANNER is a global variable used to control whether DUMA prints * its usual startup message. Default is 0, meaning that the startup message * gets printed. */ int DISABLE_BANNER; /* Variable: DUMA_SKIPCOUNT_INIT * * DUMA_SKIPCOUNT_INIT controls after how many DUMA allocations the full internal * initialization is done. Default is 0. */ int SKIPCOUNT_INIT; /* Variable: CHECK_FREQ * * DUMA_CHECK_FREQ controls the frequency to check all memory blocks no man's land. * The frequency counter is incremented at each memory allocation and deallocation. * Whenever the counter reaches the value of DUMA_CHECK_FREQ the check is performed. * 0 means no checks. 1 means to check always. Be careful with this value, it may * get very time consuming. * Default is 0. */ int CHECK_FREQ; /* Variable: DUMA_REPORT_ALL_LEAKS * * DUMA_REPORT_ALL_LEAKS is a global variable used to control whether DUMA should * all leaks - even without source filename/line number. Default is 0, meaning that * only leaks with source information will get reported. */ int REPORT_ALL_LEAKS; /* Variable: DUMA_SLACKFILL * * DUMA_SLACKFILL is set to 0-255. The slack / no mans land of all new allocated * memory is filled with the specified value. * default is set to initialise with 0xAA (=binary 10101010) * initialisation to 0! */ int SLACKFILL; /* Variable: DUMA_PROTECT_FREE * * DUMA_PROTECT_FREE is used to control the disposition of memory that is * released using free(). It is all-caps so that its name * matches the name of the environment variable that is used to set it. * If its value is non-zero, memory released by free is made inaccessable. * Any software that touches free memory will then get a segmentation fault. * Depending on your application and your resources you may tell * DUMA not to use this memory ever again by setting a negative * value f.e. -1. * You can tell DUMA to limit the sum of protected memory by setting * a positive value, which is interpreted in kB. * If its value is zero, freed memory will be available for reallocation, * but will still be inaccessable until it is reallocated. */ long PROTECT_FREE; /* Variable: DUMA_MAX_ALLOC * * DUMA_MAX_ALLOC is used to control the maximum memory print of the program * in total: When the sum of allocated and protected memory would exceed * this value in kB, the protected memory is freed/deleted. */ long MAX_ALLOC; /* Variable: DUMA_MALLOC_0_STRATEGY * * DUMA_MALLOC_0_STRATEGY how DUMA should behave on malloc(0). * 0 - like having former ALLOW_MALLOC_0 = 0 ==> abort program with segfault * 1 - return NULL pointer * 2 - return always the same pointer to some protected page * 3 - return unique protected page (=default) * ATTENTION: only 1 and 3 are ANSI conform. But value 1 will break most programs, * cause value 3 is the usual one, the system libraries implement */ int MALLOC_0_STRATEGY; /* Variable: DUMA_NEW_0_STRATEGY * * DUMA_NEW_0_STRATEGY how DUMA should behave on C++ operator new or new[] * with size 0 * 2 - return always the same pointer to some protected page * 3 - return unique protected page (=default) * ATTENTION: only 3 is standard conform. Value 2 may break some but will * work for most programs. With value 2 you may reduce the memory consumption. */ int NEW_0_STRATEGY; /* Variable: DUMA_MALLOC_FAILEXIT * * DUMA_MALLOC_FAILEXIT controls the behaviour of DUMA when * malloc() fails and would return NULL. But most applications don't * check the return value for errors ... so * default to Exit on Fail */ int MALLOC_FAILEXIT; /* Variable: DUMA_FREE_ACCESS * * DUMA_FREE_ACCESS is set if DUMA is to write access memory before * freeing it. This makes easier using watch expressions in debuggers as the * process is interrupted even if the memory is going to be freed. */ int FREE_ACCESS; /* Variable: DUMA_SHOW_ALLOC * * DUMA_SHOW_ALLOC is set if DUMA is to print all allocations * and deallocations to the console. Although this generates a lot * of messages, the option can be useful to detect inefficient code * containing many allocations / deallocations */ int SHOW_ALLOC; /* Variable: DUMA_SUPPRESS_ATEXIT * * DUMA_SUPPRESS_ATEXIT is set if DUMA is to suppress the installation of * an exit handler, called at the exit of the main program. This handler allows for * the detection of memory areas that have not been freed correctly before * program exit, so the handler's installation should *normally* not be * suppressed. One reason for doing so regardless are some buggy environments, * where calls to the atexit()-function hang. */ int SUPPRESS_ATEXIT; /* Variable: DUMA_MEMCPY_OVERLAP * * DUMA_MEMCPY_OVERLAP is set if the platform memcpy implementation allows copying * overlapping regions when source > destination. */ int MEMCPY_OVERLAP; /* Variable: _duma_allocListSize * * _duma_allocListSize is the size of the allocation list. This will always * be a multiple of the page size. */ size_t allocListSize; /* Variable: slotCount * * slotCount is the number of Slot structures in allocationList. */ size_t slotCount; /* Variable: unUsedSlots * * unUsedSlots is the number of Slot structures that are currently available * to represent new malloc buffers. When this number gets too low, we will * create new slots. */ size_t unUsedSlots; /* Variable: slotsPerPage * * slotsPerPage is the number of slot structures that fit in a virtual * memory page. */ size_t slotsPerPage; /* Variable: sumAllocatedMem * * internal variable: sum of allocated -freed +protected memory in kB */ long sumAllocatedMem; /* Variable: sumTotalAllocatedMem * * internal variable: sum of allocated memory in kB */ long sumTotalAllocatedMem; /* Variable: sumProtectedMem * * internal variable: sum of protected memory in kB */ long sumProtectedMem; /* Variable: numDeallocs * * internal variable: number of deallocations processed so far */ long numDeallocs; /* Variable: numAllocs * * internal variable: number of allocations processed so far */ long numAllocs; /* Variable checkFreqCounter * * number of (de)allocations since last checks */ int checkFreqCounter; /* Variable: duma_init_state * * internal variable: state of initialization */ enum _DUMA_InitState init_state; /* memory block for malloc() or new with size 0 */ void * null_block; /* Protection Space B */ char acSpaceB[2 * DUMA_PAGE_SIZE]; } _duma_s = { "Static Protection Space Front" /* Protection Space A */ , 0 /* int DUMA_IN_DUMA; */ , 0 /* Variable: DISABLE_BANNER */ , 0 /* Variable: SKIPCOUNT_INIT */ , 0 /* Variable: CHECK_FREQ */ , 0 /* Variable: REPORT_ALL_LEAKS */ , 0xAA /* Variable: SLACKFILL */ , -1L /* Variable: PROTECT_FREE */ , -1L /* Variable: MAX_ALLOC */ , 3 /* Variable: MALLOC_0_STRATEGY; see above */ , 3 /* Variable: NEW_0_STRATEGY; see above */ , 1 /* Variable: MALLOC_FAILEXIT */ , 0 /* Variable: FREE_ACCESS */ , 0 /* Variable: SHOW_ALLOC */ , 0 /* Variable: SUPPRESS_ATEXIT */ , 0 /* Variable: MEMCPY_OVERLAP */ , 0 /* Variable: allocListSize */ , 0 /* Variable: slotCount */ , 0 /* Variable: unUsedSlots */ , 0 /* Variable: slotsPerPage */ , 0L /* Variable: sumAllocatedMem */ , 0L /* Variable: sumTotalAllocatedMem */ , 0L /* Variable: sumProtectedMem */ , 0L /* Variable: numDeallocs */ , 0L /* Variable: numAllocs */ , 0 /* Variable: checkFreqCounter */ , DUMAIS_UNINITIALIZED /* Variable: duma_init_done */ , (void *)0 /* Variable: null_block */ , "Static Protection Space Back" /* Protection Space B */ }; DUMA_GLOBALVARS_T _duma_g = { "Global Protection Space Front" /* Protection Space A */ , (void*)0 /* Variable: allocList */ , (void*)0 /* Variable: null_addr */ , { DUMA_MIN_ALIGNMENT , 0 /* PROTECT_BELOW */ , 255 /* FILL */ #if !defined(DUMA_NO_CPP_SUPPORT) && !defined(DUMA_NO_LEAKDETECTION) , 0 /* Magic */ , 0 /* DelPtr */ , { 0 } , { 0 } #endif } , "Global Protection Space Back" /* Protection Space B */ }; /* Variable: DUMA_OUTPUT_DEBUG * * DUMA_OUTPUT_DEBUG is a global variable used to control if DUMA * output is printed to the win32 debugging console. Default is 0, * meaning that output is not by default sent to the debugging console. * * OS: WIN32 Only */ int DUMA_OUTPUT_DEBUG = 0; /* Variable: DUMA_OUTPUT_STDOUT * * DUMA_OUTPUT_STDOUT is a global variable used to control if DUMA * output is printed to STDOUT. Default is 0, * meaning that output is not by default sent to STDOUT. */ int DUMA_OUTPUT_STDOUT = 0; /* Variable: DUMA_OUTPUT_STDERR * * DUMA_OUTPUT_STDERR is a global variable used to control if DUMA * output is printed to STDERR. Default is 1, * meaning that output is by default sent to STDERR. */ int DUMA_OUTPUT_STDERR = 1; /* Variable: DUMA_OUTPUT_FILE * * DUMA_OUTPUT_FILE is a global variable used to control if DUMA * output is printed to a specified file. Default is NULL, * meaning that output is not by default sent to a file. */ char* DUMA_OUTPUT_FILE = NULL; /* char* DUMA_OUTPUT_FILE = "c:\\duma.txt"; */ /* Variable: DUMA_OUTPUT_STACKTRACE * * DUMA_OUTPUT_STACKTRACE is a global variable used to control if DUMA * outputs a stacktrace of the allocation that is not free'd. Default is 0, * meaning that this option is disabled. * * OS: WIN32 Only */ int DUMA_OUTPUT_STACKTRACE = 0; /* Variable: DUMA_OUTPUT_STACKTRACE_MAPFILE * * DUMA_OUTPUT_STACKTRACE_MAPFILE is a global variable used to control * what mapfile is used for stack traces. This is needed when using * detours and duma. Default is NULL, indicating the system will try * and guess. * * OS: WIN32 Only */ char* DUMA_OUTPUT_STACKTRACE_MAPFILE = NULL; /* * include helper functions */ #include "duma_hlp.h" #ifndef DUMA_NO_LEAKDETECTION /* * declare exit function */ void #if ( defined(DUMA_GNU_INIT_ATTR) && !defined(DUMA_PREFER_ATEXIT) ) __attribute ((destructor)) #endif _duma_exit(void); #endif /* Function: _duma_assert * * Print message and halt program execution in crazy way. */ void _duma_assert(const char * exprstr, const char * filename, int lineno) { int *pcAddr = 0; DUMA_Print("\nDUMA: DUMA_ASSERT(%s) failed at\n%s(%i)\n", exprstr, filename, lineno ); /* this is "really" bad, but it works. assert() from assert.h system header * stops only the current thread but the program goes on running under MS Visual C++. * This way the program definitely halts. */ while (1) *pcAddr++ = 0; } #ifndef DUMA_PREFER_GETENV extern char **environ; /* Function: duma_getenv * * replacement for standard C library function */ static const char * duma_getenv( const char * varname ) { const char * ret = NULL; int varno = 0; if ( !varname ) return ret; if ( varname[0] == '\0' ) return ret; while ( environ[varno] ) { const char * v = environ[varno++]; int idx = 0; while ( varname[idx] != '\0' && v[idx] == varname[idx] ) ++idx; if ( idx > 0 && varname[idx] == '\0' && v[idx] == '=' ) return v + (idx +1); } return ret; } #endif static void duma_getenvvars( DUMA_TLSVARS_T * duma_tls ) { const char * string; /* * Import the user's environment specification of the default * alignment for malloc(). We want that alignment to be under * user control, since smaller alignment lets us catch more bugs, * however some software will break if malloc() returns a buffer * that is not word-aligned. * * I would like * alignment to be zero so that we could catch all one-byte * overruns, however if malloc() is asked to allocate an odd-size * buffer and returns an address that is not word-aligned, or whose * size is not a multiple of the word size, software breaks. * This was the case with the Sun string-handling routines, * which can do word fetches up to three bytes beyond the end of a * string. I handle this problem in part by providing * byte-reference-only versions of the string library functions, but * there are other functions that break, too. Some in X Windows, one * in Sam Leffler's TIFF library, and doubtless many others. */ if ( (string = DUMA_GETENV("DUMA_ALIGNMENT")) != 0 ) { duma_tls->ALIGNMENT = (size_t)atoi(string); /* we could check for DUMA_MIN_ALIGNMENT. should we do so? */ if (!duma_tls->ALIGNMENT) duma_tls->ALIGNMENT = 1; } /* * See if the user wants to protect the address space below a buffer, * rather than that above a buffer. */ if ( (string = DUMA_GETENV("DUMA_PROTECT_BELOW")) != 0 ) duma_tls->PROTECT_BELOW = (atoi(string) != 0); /* Should we report all leaks? */ if ( (string = DUMA_GETENV("DUMA_REPORT_ALL_LEAKS")) != 0 ) _duma_s.REPORT_ALL_LEAKS = (atoi(string) != 0); /* * See if the user wants to protect memory that has been freed until * the program exits, rather than until it is re-allocated. * =-1 protect as much free'd memory as possible * =0 do not protect free'd memory * =N protect memory up to N kB */ if ( (string = DUMA_GETENV("DUMA_PROTECT_FREE")) != 0 ) _duma_s.PROTECT_FREE = atol(string); /* * See if the user has a memory usage limit. This controls the maximum * memory print of the program in total: The sum of allocated and protected * memory won't exceed this limit. * =-1 use as much memory as possible * =N limit total memory usage to N kB */ if ( (string = DUMA_GETENV("DUMA_MAX_ALLOC")) != 0 ) _duma_s.MAX_ALLOC = atol(string); /* * See what strategy the user wants for malloc(0). */ if ( (string = DUMA_GETENV("MALLOC_0_STRATEGY")) != 0 ) { int tmp = atoi(string); if ( tmp >= 0 && tmp <= 3 ) _duma_s.MALLOC_0_STRATEGY = tmp; } /* * See what strategy the user wants for C++ operator new with size zero. */ if ( (string = DUMA_GETENV("NEW_0_STRATEGY")) != 0 ) { int tmp = atoi(string); if ( tmp >= 2 && tmp <= 3 ) _duma_s.NEW_0_STRATEGY = tmp; } /* * See if the user wants to exit on malloc() failure */ if ( (string = DUMA_GETENV("DUMA_MALLOC_FAILEXIT")) != 0 ) _duma_s.MALLOC_FAILEXIT = (atoi(string) != 0); /* * See if the user wants to write access freed memory */ if ( (string = DUMA_GETENV("DUMA_FREE_ACCESS")) != 0 ) _duma_s.FREE_ACCESS = (atoi(string) != 0); /* * Check if we should be filling new memory with a value. */ if ( (string = DUMA_GETENV("DUMA_FILL")) != 0) { duma_tls->FILL = atoi(string); if ( -1 != duma_tls->FILL ) duma_tls->FILL &= 255; } /* * Check with which value the memories no mans land is filled */ if ( (string = DUMA_GETENV("DUMA_SLACKFILL")) != 0) _duma_s.SLACKFILL = atoi(string); _duma_s.SLACKFILL &= 255; /* * See if the user wants to see allocations / frees */ if ( (string = DUMA_GETENV("DUMA_SHOW_ALLOC")) != 0 ) _duma_s.SHOW_ALLOC = (atoi(string) != 0); /* * See if the user wants to call atexit() */ if ( (string = DUMA_GETENV("DUMA_SUPPRESS_ATEXIT")) != 0 ) _duma_s.SUPPRESS_ATEXIT = (atoi(string) != 0); /* * See if user allows memcpy region overlapping */ if ( (string = DUMA_GETENV("DUMA_MEMCPY_OVERLAP")) != 0 ) _duma_s.MEMCPY_OVERLAP = (atoi(string) != 0); /* * DUMA_OUTPUT_STACKTRACE is a global variable used to control if DUMA * outputs a stacktrace of the allocation that is not free'd. Default is 0, * meaning that this option is disabled. */ if ( (string = DUMA_GETENV("DUMA_OUTPUT_STACKTRACE")) != 0 ) DUMA_OUTPUT_STACKTRACE = (atoi(string) != 0); /* * DUMA_OUTPUT_STACKTRACE is a global variable used to control if DUMA * outputs a stacktrace of the allocation that is not free'd. Default is 0, * meaning that this option is disabled. */ if ( (string = DUMA_GETENV("DUMA_OUTPUT_STACKTRACE_MAPFILE")) != 0 ) DUMA_OUTPUT_STACKTRACE_MAPFILE = strdup(string); /* * DUMA_OUTPUT_DEBUG is a global variable used to control if DUMA * output is printed to the win32 debugging console. Default is 0, * meaning that output is not by default sent to the debugging console. */ if ( (string = DUMA_GETENV("DUMA_OUTPUT_DEBUG")) != 0 ) DUMA_OUTPUT_DEBUG = (atoi(string) != 0); /* * DUMA_OUTPUT_STDOUT is a global variable used to control if DUMA * output is printed to STDOUT. Default is 0, * meaning that output is not by default sent to STDOUT. */ if ( (string = DUMA_GETENV("DUMA_OUTPUT_STDOUT")) != 0 ) DUMA_OUTPUT_STDOUT = (atoi(string) != 0); /* * DUMA_OUTPUT_STDERR is a global variable used to control if DUMA * output is printed to STDERR. Default is 1, * meaning that output is by default sent to STDERR. */ if ( (string = DUMA_GETENV("DUMA_OUTPUT_STDERR")) != 0 ) DUMA_OUTPUT_STDERR = (atoi(string) != 0); /* * DUMA_OUTPUT_FILE is a global variable used to control if DUMA * output is printed to a specified file. Default is NULL, * meaning that output is not by default sent to a file. */ if ( (string = DUMA_GETENV("DUMA_OUTPUT_FILE")) != 0 ) DUMA_OUTPUT_FILE = strdup(string); /* Get Value for DUMA_SKIPCOUNT_INIT */ if ( (string = DUMA_GETENV("DUMA_SKIPCOUNT_INIT")) != 0 ) _duma_s.SKIPCOUNT_INIT = (atoi(string) != 0); /* Get Value for DUMA_CHECK_FREQ */ if ( (string = DUMA_GETENV("DUMA_CHECK_FREQ")) != 0 ) { int tmp = atoi(string); if ( tmp > 0 ) _duma_s.CHECK_FREQ = tmp; } /* Should we send banner? */ if ( (string = DUMA_GETENV("DUMA_DISABLE_BANNER")) != 0 ) _duma_s.DISABLE_BANNER = (atoi(string) != 0); if ( !_duma_s.DISABLE_BANNER ) DUMA_Print(version); } /* Function: duma_init * * duma_init sets configuration settings. Can sometimes cause problems * when called from _duma_init. * * duma_init is called from _duma_init unless DUMA_EXPLICIT_INIT * is defined at compile time. * * See Also: <_duma_init> */ #ifndef DUMA_EXPLICIT_INIT static #endif void duma_init(void) { void * testAlloc; DUMA_TLSVARS_T * duma_tls; /* avoid double call, when initialization already in progress */ if ( _duma_s.init_state >= DUMAIS_IN_INIT && _duma_s.init_state <= DUMAIS_OUT_INIT ) return; else { #if DUMA_DETOURS _duma_init(); #endif _duma_s.init_state = DUMAIS_IN_INIT; } duma_tls = GET_DUMA_TLSVARS(); duma_getenvvars( duma_tls ); #if ( !defined(DUMA_NO_LEAKDETECTION) && ( defined(DUMA_PREFER_ATEXIT) || !defined(DUMA_GNU_INIT_ATTR) ) ) /* * Register atexit() * a) when we have Leak Detection and atexit() is preferred over GNU_INIT_ATTR * b) when we have Leak Detection and GNU_INIT_ATTR is not set */ #ifndef DUMA_NO_HANG_MSG if (0 == _duma_s.SUPPRESS_ATEXIT) DUMA_Print("\nDUMA: Registering with atexit().\n" #ifdef WIN32 "DUMA: If this hangs, change the library initialization order with DUMA_EXPLICIT_INIT.\n"); #else "DUMA: If this hangs, change the library load/init order with DUMA_EXPLICIT_INIT or LD_PRELOAD.\n"); #endif else DUMA_Print("\nDUMA: Skipping registering with atexit(). Set DUMA_SUPPRESS_ATEXIT to 0 to register.\n"); #endif /* DUMA_NO_HANG_MSG */ if (!_duma_s.SUPPRESS_ATEXIT) { if ( atexit( _duma_exit ) ) DUMA_Abort("Cannot register exit function.\n"); #ifndef DUMA_NO_HANG_MSG DUMA_Print("DUMA: Registration was successful.\n"); #endif /* DUMA_NO_HANG_MSG */ } #endif /* ( !defined(DUMA_NO_LEAKDETECTION) && ( defined(DUMA_PREFER_ATEXIT) || !defined(DUMA_GNU_INIT_ATTR) ) ) */ /* initialize semaphoring */ DUMA_INIT_SEMAPHORE(); #ifndef DUMA_NO_GLOBAL_MALLOC_FREE /* * Check whether malloc and free is available */ testAlloc = malloc(123); if (_duma_s.numAllocs == 0) DUMA_Abort("malloc() is not bound to duma.\nDUMA Aborting: Preload lib with 'LD_PRELOAD=libduma.so '.\n"); free(testAlloc); if (_duma_s.numDeallocs == 0) DUMA_Abort("free() is not bound to duma.\nDUMA Aborting: Preload lib with 'LD_PRELOAD=libduma.so '.\n"); #endif /* initialization finished */ _duma_s.init_state = DUMAIS_OUT_INIT; } /* Function: _duma_init * * _duma_init sets up the memory allocation arena and the run-time * configuration information. We will call duma_init unless DUMA_EXPLICIT_INIT * is defined at compile time. * * See Also: */ void #ifdef DUMA_GNU_INIT_ATTR __attribute ((constructor)) #endif _duma_init(void) { size_t size = MEMORY_CREATION_SIZE; struct _DUMA_Slot * slot; int inRecursion = (_duma_s.init_state >= DUMAIS_IN_CONSTRUCTOR && _duma_s.init_state <= DUMAIS_OUT_INIT); /* constuction already done? this should not happen! */ if (_duma_s.init_state >= DUMAIS_OUT_CONSTRUCTOR && _duma_s.init_state <= DUMAIS_OUT_INIT) { #ifndef DUMA_EXPLICIT_INIT goto duma_constructor_callinit; #else return; #endif } else _duma_s.init_state = DUMAIS_IN_CONSTRUCTOR; if ( DUMA_PAGE_SIZE != Page_Size() ) DUMA_Abort("DUMA_PAGE_SIZE is not correct. Run createconf and save results as duma_config.h"); if(!inRecursion) DUMA_GET_SEMAPHORE(); /* call of DUMA_GET_SEMAPHORE() may already have done the construction recursively! */ if ( _duma_s.init_state >= DUMAIS_OUT_CONSTRUCTOR ) goto duma_constructor_relsem; /* * Allocate special memory for malloc() or C++ operator new, when size is 0 */ _duma_s.null_block = Page_Create(2*DUMA_PAGE_SIZE, 1/*=exitonfail*/, 1/*=printerror*/); if ( NULL == _duma_s.null_block) { DUMA_Abort (" MMAP failed for null block creation in init \n"); } Page_DenyAccess(_duma_s.null_block, 2*DUMA_PAGE_SIZE); _duma_g.null_addr = (void*)( (DUMA_ADDR)_duma_s.null_block + DUMA_PAGE_SIZE ); /* * Figure out how many Slot structures to allocate at one time. */ _duma_s.slotCount = _duma_s.slotsPerPage = DUMA_PAGE_SIZE / sizeof(struct _DUMA_Slot); _duma_s.allocListSize = DUMA_PAGE_SIZE; if ( size < _duma_s.allocListSize ) size = _duma_s.allocListSize; size = ( size + DUMA_PAGE_SIZE -1 ) & ~( DUMA_PAGE_SIZE -1 ); /* * Allocate memory, and break it up into two malloc buffers. The * first buffer will be used for Slot structures, the second will * be marked free. */ slot = _duma_g.allocList = (struct _DUMA_Slot *)Page_Create(size, 0/*=exitonfail*/, 0/*=printerror*/); if ( 0 == _duma_g.allocList && 0L != _duma_s.PROTECT_FREE ) { int reduce_more; do { /* reduce as much protected memory as we need - or at least try so */ reduce_more = reduceProtectedMemory( (size+1023) >>10 ); /* simply try again */ slot = _duma_g.allocList = (struct _DUMA_Slot *)Page_Create( size, 0/*=exitonfail*/, 0/*= printerror*/ ); } while ( reduce_more && 0 == _duma_g.allocList ); if ( 0 == _duma_g.allocList ) slot = _duma_g.allocList = (struct _DUMA_Slot *)Page_Create( size, 1/*=exitonfail*/, 1/*= printerror*/ ); } memset((char *)_duma_g.allocList, 0, _duma_s.allocListSize); /* enter _duma_g.allocList as slot to allow call to free() when doing allocateMoreSlots() */ slot[0].internalAddress = slot[0].userAddress = _duma_g.allocList; slot[0].internalSize = slot[0].userSize = _duma_s.allocListSize; slot[0].state = DUMAST_IN_USE; slot[0].allocator = EFA_INT_ALLOC; #ifndef DUMA_NO_LEAKDETECTION slot[0].fileSource = DUMAFS_ALLOCATION; slot[0].filename = __FILE__; slot[0].lineno = __LINE__; #endif if ( size > _duma_s.allocListSize ) { slot[1].internalAddress = slot[1].userAddress = ((char *)slot[0].internalAddress) + slot[0].internalSize; slot[1].internalSize = slot[1].userSize = size - slot[0].internalSize; slot[1].state = DUMAST_FREE; slot[1].allocator = EFA_INT_ALLOC; #ifndef DUMA_NO_LEAKDETECTION slot[1].fileSource = DUMAFS_ALLOCATION; slot[1].filename = __FILE__; slot[1].lineno = __LINE__; #endif } /* * Deny access to the free page, so that we will detect any software * that treads upon free memory. */ Page_DenyAccess(slot[1].internalAddress, slot[1].internalSize); /* * Account for the two slot structures that we've used. */ _duma_s.unUsedSlots = _duma_s.slotCount - 2; /* construction done */ if ( _duma_s.init_state < DUMAIS_OUT_CONSTRUCTOR ) _duma_s.init_state = DUMAIS_OUT_CONSTRUCTOR; duma_constructor_relsem: /***********************/ if ( !inRecursion ) DUMA_RELEASE_SEMAPHORE(0); #ifndef DUMA_EXPLICIT_INIT duma_constructor_callinit: /*************************/ if ( _duma_s.init_state < DUMAIS_OUT_INIT ) duma_init(); #elif 0 /* this output produces other problems !!! */ DUMA_Print("\nDUMA: This platform needs an explicit call of duma_init() (DUMA_EXPLICIT_INIT)."); DUMA_Print("\n Take care that duma_init() is called early in main()!\n\n"); #endif } /* Function: allocateMoreSlots * * allocateMoreSlots is called when there are only enough slot structures * left to support the allocation of a single malloc buffer. * * See Also: <_duma_allocate> */ static void allocateMoreSlots(void) { size_t newSize = _duma_s.allocListSize + DUMA_PAGE_SIZE; void * newAllocation; void * oldAllocation = _duma_g.allocList; #ifndef DUMA_NO_LEAKDETECTION newAllocation = _duma_allocate( 1 /*=alignment*/ , newSize , 0 /*=protectBelow*/ , -1 /*=fillByte*/ , 0 /*=protectAllocList*/ , EFA_INT_ALLOC , DUMA_FAIL_NULL , __FILE__, __LINE__ ); #else newAllocation = _duma_allocate( 1 /*=alignment*/ , newSize , 0 /*=protectBelow*/ , -1 /*=fillByte*/ , 0 /*=protectAllocList*/ , EFA_INT_ALLOC , DUMA_FAIL_NULL ); #endif if ( ! newAllocation ) return; memcpy(newAllocation, _duma_g.allocList, _duma_s.allocListSize); memset(&(((char *)newAllocation)[_duma_s.allocListSize]), 0, DUMA_PAGE_SIZE); _duma_g.allocList = (struct _DUMA_Slot *)newAllocation; _duma_s.allocListSize = newSize; _duma_s.slotCount += _duma_s.slotsPerPage; _duma_s.unUsedSlots += _duma_s.slotsPerPage; #ifndef DUMA_NO_LEAKDETECTION _duma_deallocate( oldAllocation, 0 /*=protectAllocList*/, EFA_INT_DEALLOC, __FILE__, __LINE__ ); #else _duma_deallocate( oldAllocation, 0 /*=protectAllocList*/, EFA_INT_DEALLOC); #endif } /* Function: duma_alloc_return * * set your conditional breakpoint here to catch a specific allocation */ void * duma_alloc_return( void * address ) { return address; } /* Function: _duma_allocate * * This is the memory allocator. When asked to allocate a buffer, allocate * it in such a way that the end of the buffer is followed by an inaccessable * memory page. If software overruns that buffer, it will touch the bad page * and get an immediate segmentation fault. It's then easy to zero in on the * offending code with a debugger. * * There are a few complications. If the user asks for an odd-sized buffer, * we would have to have that buffer start on an odd address if the byte after * the end of the buffer was to be on the inaccessable page. Unfortunately, * there is lots of software that asks for odd-sized buffers and then * requires that the returned address be word-aligned, or the size of the * buffer be a multiple of the word size. An example are the string-processing * functions on Sun systems, which do word references to the string memory * and may refer to memory up to three bytes beyond the end of the string. * For this reason, I take the alignment requests to memalign() and valloc() * seriously, and * * DUMA wastes lots of memory. * * See Also: <_duma_deallocate> */ void * _duma_allocate(size_t alignment, size_t userSize, int protectBelow, int fillByte, int protectAllocList, enum _DUMA_Allocator allocator, enum _DUMA_FailReturn fail DUMA_PARAMLIST_FL) { size_t count; struct _DUMA_Slot * slot; struct _DUMA_Slot * fullSlot; struct _DUMA_Slot * emptySlots[2]; DUMA_ADDR intAddr, userAddr, protAddr, endAddr; size_t internalSize; int allocationStrategy; #if defined(WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__MINGW64__) char stacktrace[601]; char* ptrStacktrace; #endif DUMA_TLSVARS_T * duma_tls = GET_DUMA_TLSVARS(); /* check allocation strategy to use */ switch ( _duma_allocDesc[allocator].std ) { default: case DUMAAS_C: allocationStrategy = _duma_s.MALLOC_0_STRATEGY; break; case DUMAAS_CPP: allocationStrategy = _duma_s.NEW_0_STRATEGY; break; } DUMA_ASSERT( 0 != _duma_g.allocList ); #if defined(WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__MINGW64__) /* When getting the stack trace memory will be allocated * via DUMA. In situations were additional slots must * be allocated we must do this prior to getting a pointer * to the new empty slot. For this reason please leave * this code at the top of this function. */ if(!_duma_s.DUMA_IN_DUMA && _duma_s.init_state && DUMA_OUTPUT_STACKTRACE) { _duma_s.DUMA_IN_DUMA = 1; printStackTrace(stacktrace, sizeof(stacktrace), DUMA_OUTPUT_STACKTRACE_MAPFILE); internalSize = strlen(stacktrace) * sizeof(char) + 1; ptrStacktrace = (char*) LocalAlloc(NULL, internalSize); if ( NULL != ptrStacktrace ) strcpy(ptrStacktrace, stacktrace); memset(stacktrace, 0, 600); _duma_s.DUMA_IN_DUMA = 0; } #endif /* initialize return value */ userAddr = 0; /* count and show allocation, if requested */ _duma_s.numAllocs++; if (_duma_s.SHOW_ALLOC) { #ifndef DUMA_NO_LEAKDETECTION DUMA_Print("\nDUMA: Allocating %d bytes at %s(%i).", (DUMA_SIZE)userSize, filename, lineno); #else DUMA_Print("\nDUMA: Allocating %d bytes.", (DUMA_SIZE)userSize); #endif if ( 0 == userSize ) DUMA_Print(" This is ANSI conform but probably a bug. See DUMA_ALLOW_MALLOC_0."); } /* check userSize */ if ( 0 == userSize ) { switch ( allocationStrategy ) { case 0: /* like having former ALLOW_MALLOC_0 = 0 ==> abort program with segfault */ #ifndef DUMA_NO_LEAKDETECTION DUMA_Abort("Allocating 0 bytes, probably a bug at %s(%i). See DUMA_ALLOW_MALLOC_0.", filename, lineno); #else DUMA_Abort("Allocating 0 bytes, probably a bug. See DUMA_ALLOW_MALLOC_0."); #endif return (void*)userAddr; break; case 1: /* return NULL pointer */ return (void*)userAddr; break; case 2: /* return always the same pointer to some protected page */ default: userAddr = (DUMA_ADDR)_duma_g.null_addr; return (void*)userAddr; break; case 3: /* return unique protected page */ /* continue allocation! */ break; } /* end switch () */ /* only case 3 */ internalSize = DUMA_PAGE_SIZE; } else /* if ( userSize ) */ { /* check alignment */ if ( ! alignment ) { DUMA_SIZE a = (DUMA_SIZE)duma_tls->ALIGNMENT; DUMA_SIZE s = (DUMA_SIZE)userSize; if ( s < a ) { /* to next lower power of 2 */ for (a = s; a & (a-1); a &= a-1) ; } alignment = (size_t)a; /* this is new alignment */ } if ( (int)alignment != ((int)alignment & -(int)alignment) ) { #ifndef DUMA_NO_LEAKDETECTION DUMA_Abort("Alignment (=%d) is not a power of 2 requested from %s(%i)", (DUMA_SIZE)alignment, filename, lineno); #else DUMA_Abort("Alignment (=%d) is not a power of 2", (DUMA_SIZE)alignment); #endif } /* * If protectBelow is set, all addresses returned by malloc() * and company will be page-aligned. * * The internal size of the buffer is rounded up to the next alignment and page-size * boundary, and then we add another page's worth of memory for the dead page. */ /* a bit tricky but no modulo and no if () */ internalSize = ( (userSize + DUMA_PAGE_SIZE -1) & ~(DUMA_PAGE_SIZE -1) ) + DUMA_PAGE_SIZE; if ( alignment > DUMA_PAGE_SIZE ) internalSize += alignment - DUMA_PAGE_SIZE; } /* end if ( userSize ) */ /* * These will hold the addresses of two empty Slot structures, that * can be used to hold information for any memory I create, and any * memory that I mark free. */ fullSlot = emptySlots[0] = emptySlots[1] = 0; /* * The internal memory used by the allocator is currently * inaccessable, so that errant programs won't scrawl on the * allocator's arena. I'll un-protect it here so that I can make * a new allocation. I'll re-protect it before I return. */ if ( protectAllocList ) { IF__DUMA_INIT_DONE DUMA_GET_SEMAPHORE(); Page_AllowAccess(_duma_g.allocList, _duma_s.allocListSize); } if ( _duma_s.CHECK_FREQ > 0 ) { if ( (++ _duma_s.checkFreqCounter) == _duma_s.CHECK_FREQ ) { _duma_check_all_slacks(); _duma_s.checkFreqCounter = 0; } } /* * If I'm running out of empty slots, create some more before * I don't have enough slots left to make an allocation. */ if ( DUMAAT_INTERNAL != _duma_allocDesc[allocator].type && _duma_s.unUsedSlots < 7 ) allocateMoreSlots(); /* * Iterate through all of the slot structures. Attempt to find a slot * containing free memory of the exact right size. Accept a slot with * more memory than we want, if the exact right size is not available. * Find two slot structures that are not in use. We will need one if * we split a buffer into free and allocated parts, and the second if * we have to create new memory and mark it as free. * */ for ( slot = _duma_g.allocList, count = _duma_s.slotCount ; count > 0; --count, ++slot ) { /* * Windows needs special treatment, cause Page_Delete() needs exactly * the same memory region as Page_Create()! * Thus as a quick hack no memory management is done by DUMA. */ #if !defined(WIN32) if ( DUMAST_FREE == slot->state && slot->internalSize >= internalSize ) { if ( !fullSlot || slot->internalSize < fullSlot->internalSize ) { fullSlot = slot; if ( slot->internalSize == internalSize ) break; /* All done; no empty slot needed in this case */ } } else #endif if ( DUMAST_EMPTY == slot->state ) { if(!emptySlots[0]) emptySlots[0] = slot; else if ( !emptySlots[1] ) emptySlots[1] = slot; #if defined(WIN32) break; #endif } } if ( !fullSlot ) { /* * I get here if I haven't been able to find a free buffer * with all of the memory I need. I'll have to create more * memory. I'll mark it all as free, and then split it into * free and allocated portions later. */ size_t chunkSize; long chunkSizekB; #if defined(WIN32) chunkSize = internalSize; #else chunkSize = MEMORY_CREATION_SIZE; if ( chunkSize < internalSize ) chunkSize = internalSize; chunkSize = ( chunkSize + DUMA_PAGE_SIZE -1 ) & ~( DUMA_PAGE_SIZE -1 ); #endif chunkSizekB = (long)( (chunkSize+1023) >>10 ); /* Use up one of the empty slots to make the full slot. */ if ( !emptySlots[0] ) DUMA_Abort("Internal error in allocator: No empty slot 0.\n"); #if !defined(WIN32) if ( !emptySlots[1] ) DUMA_Abort("Internal error in allocator: No empty slot 1.\n"); #endif fullSlot = emptySlots[0]; emptySlots[0] = emptySlots[1]; /* reduce protected memory when we would exceed _duma_s.MAX_ALLOC */ if ( _duma_s.MAX_ALLOC > 0L && _duma_s.sumAllocatedMem + chunkSizekB > _duma_s.MAX_ALLOC ) reduceProtectedMemory( chunkSizekB ); #ifndef SIZE_MAX #define SIZE_MAX ((size_t)(-1)) #endif size_t numChunks = SIZE_MAX; if( userSize > (SIZE_MAX) - (chunkSize - 1) ) fullSlot->internalAddress = 0; else { numChunks = ( userSize <= 0 ) ? 1 : ( userSize + (chunkSize - 1) )/chunkSize; DUMA_ASSERT( numChunks >= 1 ); fullSlot->internalAddress = Page_Create( chunkSize*numChunks, 0/*= exitonfail*/, 0/*= printerror*/ ); } if ( 0 == fullSlot->internalAddress && 0L != _duma_s.PROTECT_FREE ) { int reduce_more; do { /* reduce as much protected memory as we need - or at least try so */ reduce_more = reduceProtectedMemory( (chunkSize+1023) >>10 ); /* simply try again */ fullSlot->internalAddress = Page_Create( chunkSize*numChunks, 0/*= exitonfail*/, 0/*= printerror*/ ); } while ( reduce_more && 0 == fullSlot->internalAddress ); if ( 0 == fullSlot->internalAddress && DUMA_FAIL_ENV == fail ) fullSlot->internalAddress = Page_Create( chunkSize*numChunks, _duma_s.MALLOC_FAILEXIT, 1/*= printerror*/ ); } if ( fullSlot->internalAddress ) { _duma_s.sumAllocatedMem += ( (chunkSize +1023) >>10 )*numChunks; _duma_s.sumTotalAllocatedMem += ( (chunkSize +1023) >>10 )*numChunks; fullSlot->internalSize = chunkSize*numChunks; fullSlot->state = DUMAST_FREE; --_duma_s.unUsedSlots; } } /* end if ( !fullSlot ) */ if ( fullSlot->internalSize ) { #if !defined(WIN32) /* * If the buffer I've found is larger than I need, split it into * an allocated buffer with the exact amount of memory I need, and * a free buffer containing the surplus memory. */ if ( fullSlot->internalSize > internalSize ) { /* copy and adjust contents for free slot */ *emptySlots[0] = *fullSlot; emptySlots[0]->internalAddress = (char *)emptySlots[0]->internalAddress + internalSize; emptySlots[0]->internalSize -= internalSize; emptySlots[0]->userAddress = emptySlots[0]->internalAddress; emptySlots[0]->userSize = emptySlots[0]->internalSize; /* adjust size of fullSlot */ fullSlot->internalSize = internalSize; --_duma_s.unUsedSlots; } #endif if ( 0 == userSize ) { /* * we need just a single page * may deny any access to it * */ /* Figure out what address to give the user: mid of protected page */ intAddr = (DUMA_ADDR)fullSlot->internalAddress; endAddr = intAddr + internalSize; userAddr = intAddr + (DUMA_PAGE_SIZE >> 1); protAddr = intAddr; /* Set up the "dead" page(s). */ Page_DenyAccess( (char*)protAddr, endAddr - protAddr ); } else if ( !protectBelow ) { /* * Arrange the buffer so that it is followed by an inaccessable * memory page. A buffer overrun that touches that page will * cause a segmentation fault. * internalAddr <= userAddr < protectedAddr */ /* Figure out what address to give the user. */ intAddr = (DUMA_ADDR)fullSlot->internalAddress; endAddr = intAddr + internalSize; userAddr = ( intAddr + internalSize - DUMA_PAGE_SIZE - userSize ) & ~(alignment -1); protAddr = ( userAddr + userSize + DUMA_PAGE_SIZE -1) & ~(DUMA_PAGE_SIZE -1); /* DUMA_ASSERT(intAddr <= userAddr && intAddr < protAddr ); */ /* Set up the "live" page(s). */ Page_AllowAccess( (char*)intAddr, protAddr - intAddr ); /* Set up the "dead" page(s). */ Page_DenyAccess( (char*)protAddr, endAddr - protAddr ); } else /* if (protectBelow) */ { /* * Arrange the buffer so that it is preceded by an inaccessable * memory page. A buffer underrun that touches that page will * cause a segmentation fault. */ /* Figure out what address to give the user. */ intAddr = (DUMA_ADDR)fullSlot->internalAddress; endAddr = intAddr + internalSize; userAddr = ( intAddr + DUMA_PAGE_SIZE + alignment -1) & ~(alignment -1); protAddr = ( userAddr & ~(DUMA_PAGE_SIZE -1) ) - DUMA_PAGE_SIZE; /* DUMA_ASSERT(intAddr < userAddr && intAddr <= protAddr ); */ /* Set up the "live" page(s). userAddr == protAddr + DUMA_PAGE_SIZE ! */ Page_AllowAccess( (char*)userAddr, internalSize - (userAddr - protAddr) ); /* Set up the "dead" page(s). */ Page_DenyAccess( (char*)intAddr, userAddr - intAddr ); } /* => userAddress = internalAddress + DUMA_PAGE_SIZE */ fullSlot->userAddress = (char*)userAddr; fullSlot->protAddress = (char*)protAddr; fullSlot->userSize = userSize; fullSlot->state = DUMAST_IN_USE; fullSlot->allocator = allocator; #ifndef DUMA_NO_LEAKDETECTION fullSlot->fileSource = DUMAFS_ALLOCATION; fullSlot->filename = (char*)filename; #ifdef DUMA_EXPLICIT_INIT /* mark allocations from standard libraries * before duma_init() is finished with lineno = -1 * to allow special treatment in leak_checking */ fullSlot->lineno = (DUMAIS_OUT_INIT == _duma_s.init_state) ? lineno : -1; #else fullSlot->lineno = lineno; #endif #endif /* initialise no mans land of slot */ _duma_init_slack( fullSlot ); #if defined(WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__MINGW64__) if(!_duma_s.DUMA_IN_DUMA && _duma_s.init_state && DUMA_OUTPUT_STACKTRACE) { _duma_s.DUMA_IN_DUMA = 1; /* Get stacktrace */ if(fullSlot->stacktrace) LocalFree(fullSlot->stacktrace); fullSlot->stacktrace = ptrStacktrace; _duma_s.DUMA_IN_DUMA = 0; } else fullSlot->stacktrace = 0; #endif } /* end if ( fullSlot->internalSize ) */ /* * Make the pool's internal memory inaccessable, so that the program * being debugged can't stomp on it. */ if ( protectAllocList ) { Page_DenyAccess(_duma_g.allocList, _duma_s.allocListSize); IF__DUMA_INIT_DONE DUMA_RELEASE_SEMAPHORE(0); } /* Fill the memory if it was specified to do so. */ if ( ((char*)userAddr) && fillByte != -1 && userSize ) memset( (char*)userAddr, fillByte, userSize); return duma_alloc_return( (char*)userAddr ); } /* Function: _duma_deallocate * * Deallocate allocated memory after running some checks, then open * slot for use. Uses Page_Delete to free the underlying memory. * * See Also: <_duma_allocate> */ void _duma_deallocate(void * address, int protectAllocList, enum _DUMA_Allocator allocator DUMA_PARAMLIST_FL) { struct _DUMA_Slot * slot; long internalSizekB; if ( 0 == _duma_g.allocList ) { #ifdef DUMA_DETOURS /* Odd things happen with detours sometimes... */ DUMA_Print("DUMA_Warning: free() called before first malloc()."); return; #else DUMA_Abort("free() called before first malloc()."); #endif } if ( 0 == address || _duma_g.null_addr == address ) return; if ( protectAllocList ) { IF__DUMA_INIT_DONE DUMA_GET_SEMAPHORE(); Page_AllowAccess(_duma_g.allocList, _duma_s.allocListSize); } if ( _duma_s.CHECK_FREQ > 0 ) { if ( (++ _duma_s.checkFreqCounter) == _duma_s.CHECK_FREQ ) { _duma_check_all_slacks(); _duma_s.checkFreqCounter = 0; } } if ( !(slot = slotForUserAddress(address)) ) { if ( (slot = nearestSlotForUserAddress(address)) ) { #ifndef DUMA_NO_LEAKDETECTION if ( DUMAFS_ALLOCATION == slot->fileSource ) DUMA_Abort("free(%a): address not from DUMA or already freed. Address may be corrupted from %a allocated from %s(%i)", (DUMA_ADDR)address, (DUMA_ADDR)slot->userAddress, slot->filename, slot->lineno); else if ( DUMAFS_DEALLOCATION == slot->fileSource ) DUMA_Abort("free(%a): address not from DUMA or already freed. Address may be corrupted from %a deallocated at %s(%i)", (DUMA_ADDR)address, (DUMA_ADDR)slot->userAddress, slot->filename, slot->lineno); else #endif DUMA_Abort("free(%a): address not from DUMA or already freed. Address may be corrupted from %a.", (DUMA_ADDR)address, (DUMA_ADDR)slot->userAddress); } else { #if DUMA_DETOURS /* For Detours we need to not dump out, we get one extra free up front for some reason. */ DUMA_Print("DUMA_Warning: free(%a): address not from DUMA or already freed.", (DUMA_ADDR)address); return; #else DUMA_Abort("free(%a): address not from DUMA or already freed.", (DUMA_ADDR)address); #endif } } if ( DUMAST_ALL_PROTECTED == slot->state || DUMAST_BEGIN_PROTECTED == slot->state ) { #ifndef DUMA_NO_LEAKDETECTION if ( DUMAFS_ALLOCATION == slot->fileSource ) DUMA_Abort("free(%a): memory already freed. allocated from %s(%i)", (DUMA_ADDR)address, slot->filename, slot->lineno); else if ( DUMAFS_DEALLOCATION == slot->fileSource ) DUMA_Abort("free(%a): memory already freed at %s(%i)", (DUMA_ADDR)address, slot->filename, slot->lineno); else #endif DUMA_Abort("free(%a): memory already freed.", (DUMA_ADDR)address); } else if ( _duma_allocDesc[slot->allocator].type != _duma_allocDesc[allocator].type ) { #ifndef DUMA_NO_LEAKDETECTION if ( DUMAFS_ALLOCATION == slot->fileSource ) /* 1 2 3 4 5 6 */ DUMA_Abort("Free mismatch: allocator '%s' used at %s(%i)\n but deallocator '%s' called at %s(%i)!", _duma_allocDesc[slot->allocator].name, slot->filename, slot->lineno, _duma_allocDesc[allocator].name, filename, lineno ); else if ( DUMAFS_DEALLOCATION == slot->fileSource ) /* 1 2 3 4 */ DUMA_Abort("Free mismatch: allocator '%s' used \nbut deallocator '%s' called at %s(%i)!", _duma_allocDesc[slot->allocator].name, _duma_allocDesc[allocator].name, filename, lineno ); else #endif DUMA_Abort("Free mismatch: allocator '%s' used but deallocator '%s' called!", _duma_allocDesc[slot->allocator].name, _duma_allocDesc[allocator].name ); } /* count and show deallocation, if requested */ _duma_s.numDeallocs++; if (_duma_s.SHOW_ALLOC) #ifndef DUMA_NO_LEAKDETECTION DUMA_Print("\nDUMA: Freeing %d bytes at %s(%i) (Allocated from %s(%i)).", (DUMA_SIZE)slot->userSize, filename, lineno, slot->filename, slot->lineno); #else DUMA_Print("\nDUMA: Freeing %d bytes.", (DUMA_SIZE)slot->userSize); #endif /* CHECK INTEGRITY OF NO MANS LAND */ _duma_check_slack( slot ); if ( _duma_s.FREE_ACCESS ) { volatile char *start = slot->userAddress; volatile char *cur; for (cur = (char*)slot->userAddress+slot->userSize; --cur >= start; ) { char c = *cur; *cur = c-1; *cur = c; } } internalSizekB = (slot->internalSize+1023) >>10; /* protect memory, that nobody can access it */ /* Free as much protected memory, that we can protect this one */ /* is there need? and is there a way to free such much? */ if ( _duma_s.PROTECT_FREE > 0L && _duma_s.sumProtectedMem + internalSizekB > _duma_s.PROTECT_FREE && internalSizekB < _duma_s.PROTECT_FREE && _duma_s.sumProtectedMem >= internalSizekB) { reduceProtectedMemory( internalSizekB ); } if (( EFA_INT_ALLOC != slot->allocator ) && ( _duma_s.PROTECT_FREE < 0L || ( _duma_s.PROTECT_FREE > 0L && _duma_s.sumProtectedMem + internalSizekB <= _duma_s.PROTECT_FREE ) ) ) { slot->state = DUMAST_ALL_PROTECTED; Page_DenyAccess(slot->internalAddress, slot->internalSize); _duma_s.sumProtectedMem += internalSizekB; #ifndef DUMA_NO_LEAKDETECTION if ( lineno ) { slot->fileSource = DUMAFS_DEALLOCATION; slot->filename = (char*)filename; slot->lineno = lineno; } #endif } else { /* free all the memory */ Page_Delete(slot->internalAddress, slot->internalSize); _duma_s.sumAllocatedMem -= internalSizekB; /* free slot and userAddr */ slot->internalAddress = slot->userAddress = 0; slot->internalSize = slot->userSize = 0; slot->state = DUMAST_EMPTY; slot->allocator = EFA_INT_ALLOC; #ifndef DUMA_NO_LEAKDETECTION slot->fileSource = DUMAFS_EMPTY; slot->filename = 0; slot->lineno = 0; #endif #if defined(WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__MINGW64__) if(slot->stacktrace) { slot->stacktrace = 0; LocalFree(slot->stacktrace); } #endif ++_duma_s.unUsedSlots; } if ( protectAllocList ) { Page_DenyAccess(_duma_g.allocList, _duma_s.allocListSize); IF__DUMA_INIT_DONE DUMA_RELEASE_SEMAPHORE(0); } } /* Function: duma_check * * Check No Mans Land of a memory block. * */ void duma_check(void * address) { struct _DUMA_Slot * slot; if ( 0 == address ) return; IF__DUMA_INIT_DONE DUMA_GET_SEMAPHORE(); Page_AllowAccess(_duma_g.allocList, _duma_s.allocListSize); if ( !(slot = slotForUserAddress(address)) ) { if ( (slot = nearestSlotForUserAddress(address)) ) { #ifndef DUMA_NO_LEAKDETECTION if ( DUMAFS_ALLOCATION == slot->fileSource ) DUMA_Abort("check(%a): address not from DUMA or already freed. Address may be corrupted from %a allocated from %s(%i)", (DUMA_ADDR)address, (DUMA_ADDR)slot->userAddress, slot->filename, slot->lineno); else if ( DUMAFS_DEALLOCATION == slot->fileSource ) DUMA_Abort("check(%a): address not from DUMA or already freed. Address may be corrupted from %a deallocated at %s(%i)", (DUMA_ADDR)address, (DUMA_ADDR)slot->userAddress, slot->filename, slot->lineno); else #endif DUMA_Abort("check(%a): address not from DUMA or already freed. Address may be corrupted from %a.", (DUMA_ADDR)address, (DUMA_ADDR)slot->userAddress); } else DUMA_Abort("check(%a): address not from DUMA or already freed.", (DUMA_ADDR)address); } if ( DUMAST_ALL_PROTECTED == slot->state || DUMAST_BEGIN_PROTECTED == slot->state ) { #ifndef DUMA_NO_LEAKDETECTION if ( DUMAFS_ALLOCATION == slot->fileSource ) DUMA_Abort("check(%a): memory already freed. allocated from %s(%i)", (DUMA_ADDR)address, slot->filename, slot->lineno); else if ( DUMAFS_DEALLOCATION == slot->fileSource ) DUMA_Abort("check(%a): memory already freed at %s(%i)", (DUMA_ADDR)address, slot->filename, slot->lineno); else #endif DUMA_Abort("check(%a): memory already freed.", (DUMA_ADDR)address); } /* CHECK INTEGRITY OF NO MANS LAND */ _duma_check_slack( slot ); Page_DenyAccess(_duma_g.allocList, _duma_s.allocListSize); IF__DUMA_INIT_DONE DUMA_RELEASE_SEMAPHORE(0); } /* Function: duma_checkAll * * Check No Mans Land of all memory blocks. * */ void duma_checkAll() { IF__DUMA_INIT_DONE DUMA_GET_SEMAPHORE(); Page_AllowAccess(_duma_g.allocList, _duma_s.allocListSize); _duma_check_all_slacks(); Page_DenyAccess(_duma_g.allocList, _duma_s.allocListSize); IF__DUMA_INIT_DONE DUMA_RELEASE_SEMAPHORE(0); } /*********************************************************/ /* Function: _duma_malloc * * A version of malloc. */ void * _duma_malloc(size_t size DUMA_PARAMLIST_FL) { DUMA_TLSVARS_T * duma_tls; if ( _duma_g.allocList == 0 ) _duma_init(); /* This sets DUMA_ALIGNMENT, DUMA_PROTECT_BELOW, DUMA_FILL, ... */ duma_tls = GET_DUMA_TLSVARS(); return _duma_allocate(0, size, duma_tls->PROTECT_BELOW, duma_tls->FILL, 1 /*=protectAllocList*/, EFA_MALLOC, DUMA_FAIL_ENV DUMA_PARAMS_FL); } /* Function: _duma_calloc * * A version of calloc. */ void * _duma_calloc(size_t nelem, size_t elsize DUMA_PARAMLIST_FL) { DUMA_TLSVARS_T * duma_tls; if ( _duma_g.allocList == 0 ) _duma_init(); /* This sets DUMA_ALIGNMENT, DUMA_PROTECT_BELOW, DUMA_FILL, ... */ duma_tls = GET_DUMA_TLSVARS(); return _duma_allocate(0, nelem * elsize, duma_tls->PROTECT_BELOW, 0 /*=fillByte*/, 1 /*=protectAllocList*/, EFA_CALLOC, DUMA_FAIL_ENV DUMA_PARAMS_FL); } /* Function: _duma_free * * A version of free. */ void _duma_free(void * baseAdr DUMA_PARAMLIST_FL) { if ( _duma_g.allocList == 0 ) _duma_init(); /* This sets DUMA_ALIGNMENT, DUMA_PROTECT_BELOW, DUMA_FILL, ... */ _duma_deallocate(baseAdr, 1 /*=protectAllocList*/, EFA_FREE DUMA_PARAMS_FL); } /* Function: _duma_memalign * * A version of memalign. */ void * _duma_memalign(size_t alignment, size_t size DUMA_PARAMLIST_FL) { DUMA_TLSVARS_T * duma_tls; if ( _duma_g.allocList == 0 ) _duma_init(); /* This sets DUMA_ALIGNMENT, DUMA_PROTECT_BELOW, DUMA_FILL, ... */ duma_tls = GET_DUMA_TLSVARS(); return _duma_allocate(alignment, size, duma_tls->PROTECT_BELOW, duma_tls->FILL, 1 /*=protectAllocList*/, EFA_MEMALIGN, DUMA_FAIL_ENV DUMA_PARAMS_FL); } /* Function: _duma_posix_memalign * * A version of posix_memalign. */ int _duma_posix_memalign(void **memptr, size_t alignment, size_t size DUMA_PARAMLIST_FL) { DUMA_TLSVARS_T * duma_tls; void * retptr; if ( (alignment & (alignment -1)) || alignment < sizeof(void *) ) return EINVAL; if ( _duma_g.allocList == 0 ) _duma_init(); /* This sets DUMA_ALIGNMENT, DUMA_PROTECT_BELOW, DUMA_FILL, ... */ duma_tls = GET_DUMA_TLSVARS(); retptr = _duma_allocate(alignment, size, duma_tls->PROTECT_BELOW, duma_tls->FILL, 1 /*=protectAllocList*/, EFA_POSIX_MEMALIGN, DUMA_FAIL_ENV DUMA_PARAMS_FL); if ( retptr ) { (*(char**)memptr) = (char*)retptr; return 0; } else { (*(char**)memptr) = NULL; return ENOMEM; } } /* Function: _duma_realloc * * A version of realloc that provides extra checks based on * information we know about HEAP. */ void * _duma_realloc(void * oldBuffer, size_t newSize DUMA_PARAMLIST_FL) { void * ptr; DUMA_TLSVARS_T * duma_tls; if( _duma_g.allocList == 0 ) _duma_init(); /* This sets DUMA_ALIGNMENT, DUMA_PROTECT_BELOW, DUMA_FILL, ... */ duma_tls = GET_DUMA_TLSVARS(); IF__DUMA_INIT_DONE DUMA_GET_SEMAPHORE(); Page_AllowAccess(_duma_g.allocList, _duma_s.allocListSize); if( !oldBuffer ) { ptr = _duma_allocate(0, newSize, duma_tls->PROTECT_BELOW, duma_tls->FILL, 0 /*=protectAllocList*/, EFA_REALLOC, DUMA_FAIL_ENV DUMA_PARAMS_FL); } else if( newSize <= 0 ) { _duma_deallocate(oldBuffer, 0 /*=protectAllocList*/, EFA_REALLOC DUMA_PARAMS_FL); ptr = NULL; } else { ptr = _duma_allocate(0, newSize, duma_tls->PROTECT_BELOW, -1 /*=fillByte*/, 0 /*=protectAllocList*/, EFA_REALLOC, DUMA_FAIL_ENV DUMA_PARAMS_FL); DUMA_ASSERT( oldBuffer ); if( ptr ) { struct _DUMA_Slot * slot = slotForUserAddress(oldBuffer); if ( slot == 0 ) DUMA_Abort("realloc(%a, %d): address not from malloc().", (DUMA_ADDR)oldBuffer, (DUMA_SIZE)newSize); if ( newSize > slot->userSize ) { memcpy( ptr, oldBuffer, slot->userSize ); memset( (char*)ptr + slot->userSize, 0, newSize - slot->userSize ); } else if ( newSize > 0 ) memcpy(ptr, oldBuffer, newSize); _duma_deallocate(oldBuffer, 0 /*=protectAllocList*/, EFA_REALLOC DUMA_PARAMS_FL); } } Page_DenyAccess(_duma_g.allocList, _duma_s.allocListSize); IF__DUMA_INIT_DONE DUMA_RELEASE_SEMAPHORE(0); return ptr; } /* Function: _duma_valloc * * A version of valloc. */ void * _duma_valloc(size_t size DUMA_PARAMLIST_FL) { DUMA_TLSVARS_T * duma_tls; if ( _duma_g.allocList == 0 ) _duma_init(); /* This sets DUMA_ALIGNMENT, DUMA_PROTECT_BELOW, DUMA_FILL, ... */ duma_tls = GET_DUMA_TLSVARS(); return _duma_allocate(DUMA_PAGE_SIZE, size, duma_tls->PROTECT_BELOW, duma_tls->FILL, 1 /*=protectAllocList*/, EFA_VALLOC, DUMA_FAIL_ENV DUMA_PARAMS_FL); } /* Function: _duma_strdup * * A version of strdup. */ char * _duma_strdup(const char * str DUMA_PARAMLIST_FL) { size_t size; char * dup; DUMA_TLSVARS_T * duma_tls; unsigned i; if ( _duma_g.allocList == 0 ) _duma_init(); /* This sets DUMA_ALIGNMENT, DUMA_PROTECT_BELOW, DUMA_FILL, ... */ duma_tls = GET_DUMA_TLSVARS(); size = 0; while (str[size]) ++size; dup = _duma_allocate(0, size +1, duma_tls->PROTECT_BELOW, -1 /*=fillByte*/, 1 /*=protectAllocList*/, EFA_STRDUP, DUMA_FAIL_ENV DUMA_PARAMS_FL); if (dup) /* if successful */ for (i=0; i<=size; ++i) /* copy string */ dup[i] = str[i]; return dup; } /* Function: _duma_memcpy * * A version of memcpy that provides extra checks based on * information we know about HEAP. * * Currently the only check we perform is overlapping memory * regions. This should be expanded to include checking size * of dest to verify assumptions. */ void * _duma_memcpy(void *dest, const void *src, size_t size DUMA_PARAMLIST_FL) { char * d = (char *)dest; const char * s = (const char *)src; unsigned i; if ( (s < d && d < s + size) || (d < s && s < d + size && !_duma_s.MEMCPY_OVERLAP ) ) { #ifndef DUMA_NO_LEAKDETECTION DUMA_Abort("memcpy(%a, %a, %d): memory regions overlap at %s(%i)." , (DUMA_ADDR)dest, (DUMA_ADDR)src, (DUMA_SIZE)size, filename, lineno ); #else DUMA_Abort("memcpy(%a, %a, %d): memory regions overlap." , (DUMA_ADDR)dest, (DUMA_ADDR)src, (DUMA_SIZE)size ); #endif } for (i=0; i (const char*)src ) *--d = *--s; } return dest; } /* Function: _duma_strnlen * * like strlen() but maximum return value is size */ size_t _duma_strnlen(const char *src, size_t size) { size_t len; for ( len =0; len < size && src[len]; ++len ) ; return len; } /* Function: _duma_strcpy * * A version of strcpy that provides extra checks based on * information we know about HEAP. * * Currently the only check we perform is overlapping memory * regions. This should be expanded to include checking size * of dest to verify assumptions. */ char * _duma_strcpy(char *dest, const char *src DUMA_PARAMLIST_FL) { size_t i; size_t size = strlen(src) +1; if ( src < dest && dest < src + size ) { #ifndef DUMA_NO_LEAKDETECTION DUMA_Abort("strcpy(%a, %a): memory regions overlap at %s(%i)." , (DUMA_ADDR)dest, (DUMA_ADDR)src, filename, lineno ); #else DUMA_Abort("strcpy(%a, %a): memory regions overlap." , (DUMA_ADDR)dest, (DUMA_ADDR)src ); #endif } for (i=0; i 0 && ( ( src < dest && dest < src + srclen ) ||( dest < src && src < dest + size ) )) { #ifndef DUMA_NO_LEAKDETECTION DUMA_Abort("strncpy(%a, %a, %d): memory regions overlap at %s(%i)." , (DUMA_ADDR)dest, (DUMA_ADDR)src, (DUMA_SIZE)size, filename, lineno ); #else DUMA_Abort("strncpy(%a, %a, %d): memory regions overlap." , (DUMA_ADDR)dest, (DUMA_ADDR)src, (DUMA_SIZE)size ); #endif } /* copy src to dest - up to size or zero terminator * whatever happens first */ for (i =0; i < size && src[i]; ++i) dest[i] = src[i]; /* fill rest with '\0' character */ for ( ; i 0 */ if ( size <= 0 ) return dest; /* calculate number of characters to copy from src to dest */ destlen = strlen(dest); srclen = _duma_strnlen(src, size); /* CHECK: Verify memory regions do not overlap */ if ( src < (dest + destlen) && (dest + destlen) < (src + srclen + 1) ) { #ifndef DUMA_NO_LEAKDETECTION DUMA_Abort("strncat(%a, %a, %d): memory regions overlap at %s(%i)." , (DUMA_ADDR)dest, (DUMA_ADDR)src, (DUMA_SIZE)size, filename, lineno ); #else DUMA_Abort("strncat(%a, %a, %d): memory regions overlap." , (DUMA_ADDR)dest, (DUMA_ADDR)src, (DUMA_SIZE)size ); #endif } /* copy up to size characters from src to dest */ for (i=0; i 0; --count, ++slot ) { if ( DUMAST_IN_USE == slot->state && EFA_INT_ALLOC != slot->allocator #ifdef DUMA_EXPLICIT_INIT && -1 != slot->lineno #endif ) { if ( _duma_s.REPORT_ALL_LEAKS || slot->lineno > 0 ) { #if defined(DUMA_DLL_LIBRARY) || defined(DUMA_SO_LIBRARY) || defined(DUMA_DETOURS) DUMA_Print("\nDUMA: ptr=0x%a size=%d type='%s' not freed\n" , (DUMA_ADDR)slot->userAddress, (DUMA_SIZE)slot->userSize , _duma_allocDesc[slot->allocator].name ); #else DUMA_Print("\nDUMA: ptr=0x%a size=%d type='%s' alloced from %s(%i) not freed\n" , (DUMA_ADDR)slot->userAddress, (DUMA_SIZE)slot->userSize , _duma_allocDesc[slot->allocator].name , slot->filename, slot->lineno ); #endif #if defined(WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__MINGW64__) if(DUMA_OUTPUT_STACKTRACE) DUMA_Print("Stacktrace of allocation:\n%s\n", slot->stacktrace); #endif ++nonFreedReported; } ++nonFreedTotal; } } iExtraLeaks = nonFreedTotal - nonFreedReported; if ( nonFreedReported ) DUMA_Print("DUMA: Reported %i leaks. There are %i extra leaks without allocation information\n" , nonFreedReported, iExtraLeaks ); else if ( nonFreedReported < nonFreedTotal ) DUMA_Print("DUMA: Reported %i leaks. There are %i extra leaks without allocation information\n" , nonFreedReported, iExtraLeaks ); Page_DenyAccess(_duma_g.allocList, _duma_s.allocListSize); IF__DUMA_INIT_DONE DUMA_RELEASE_SEMAPHORE(0); if (_duma_s.SHOW_ALLOC) DUMA_Print("\nDUMA: Processed %l allocations and %l deallocations in total.\n", _duma_s.numAllocs, _duma_s.numDeallocs); } /* Function: _duma_exit * * DUMA's exit function, called atexit() or with GNU C Compiler's destructor attribute. * This function also calls DUMA_delFrame to check for still in use memory and allert * the user. */ void #if ( defined(DUMA_GNU_INIT_ATTR) && !defined(DUMA_PREFER_ATEXIT) ) __attribute ((destructor)) #endif _duma_exit(void) { #if defined(WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__MINGW64__) /* Cleanup memory owned by the stack library */ /* wouldn't do to leak memory :) */ StackTraceCleanup(); #endif DUMA_delFrame(); } #endif /* end ifndef DUMA_NO_LEAKDETECTION */ #endif /* ifndef DUMA_NO_DUMA */ duma-VERSION_2_5_21/duma.h000066400000000000000000000327131401225056000151760ustar00rootroot00000000000000/* * DUMA - Red-Zone memory allocator. * Copyright (C) 2006 Michael Eddington * Copyright (C) 2002-2005 Hayati Ayguen , Procitec GmbH * Copyright (C) 1987-1999 Bruce Perens * License: GNU GPL (GNU General Public License, see COPYING-GPL) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * * FILE CONTENTS: * header file for inclusion from YOUR application code */ /* explicitly no "#ifndef _DUMA_H_" to allow mutliple inclusions * within single source file with inclusion of noduma.h in between */ #include /* * #include * * You must include before including ! * */ /* for enabling inclusion of duma.h after inclusion of efencint.h */ /* remove previous definitions */ #define SKIP_DUMA_NO_CXX #include "noduma.h" #undef SKIP_DUMA_NO_CXX #include "duma_config.h" #ifdef __cplusplus #define DUMA_EXTERN_C extern "C" #else #define DUMA_EXTERN_C extern #endif #ifdef DUMA_NO_DUMA /* enable these macros even in release code, but do nothing */ #define DUMA_newFrame() do { } while(0) #define DUMA_delFrame() do { } while(0) #define DUMA_SET_ALIGNMENT(V) do { } while(0) #define DUMA_SET_PROTECT_BELOW(V) do { } while(0) #define DUMA_SET_FILL(V) do { } while(0) #define DUMA_ASSERT(EXPR) do { } while(0) #define DUMA_CHECK(BASEADR) do { } while(0) #define DUMA_CHECKALL() do { } while(0) #define CA_DECLARE(NAME,SIZE) do { } while(0) #define CA_DEFINE(TYPE,NAME,SIZE) TYPE NAME[SIZE] #define CA_REF(NAME,INDEX) NAME[INDEX] #else /* ifndef DUMA_NO_DUMA */ #ifndef DUMA_EXTERNS_DECLARED #define DUMA_EXTERNS_DECLARED /* global DUMA variables */ DUMA_EXTERN_C int DUMA_OUTPUT_DEBUG; DUMA_EXTERN_C int DUMA_OUTPUT_STDOUT; DUMA_EXTERN_C int DUMA_OUTPUT_STDERR; DUMA_EXTERN_C char* DUMA_OUTPUT_FILE; DUMA_EXTERN_C int DUMA_OUTPUT_STACKTRACE; #endif /* DUMA_EXTERNS_DECLARED */ /* set Maximum Delete Depth (depth of recursive destructor calls) */ #ifndef DUMA_MAX_DEL_DEPTH #define DUMA_MAX_DEL_DEPTH 256 #endif #ifndef DUMA_TLSVARTYPE_DEFINED #define DUMA_TLSVARTYPE_DEFINED /* TODO following variables should exist per thread ("thread-local") */ typedef struct { /* * ALIGNMENT is a global variable used to control the default alignment * of buffers returned by malloc(), calloc(), and realloc(). It is all-caps * so that its name matches the name of the environment variable that is used * to set it. This gives the programmer one less name to remember. */ int ALIGNMENT; /* * PROTECT_BELOW is used to modify the behavior of the allocator. When * its value is non-zero, the allocator will place an inaccessable page * immediately _before_ the malloc buffer in the address space, instead * of _after_ it. Use this to detect malloc buffer under-runs, rather than * over-runs. It won't detect both at the same time, so you should test your * software twice, once with this value clear, and once with it set. */ int PROTECT_BELOW; /* * FILL is set to 0-255 if DUMA should fill all new allocated * memory with the specified value. Set to -1 when DUMA should not * initialise allocated memory. * default is set to initialise with 255, cause many programs rely on * initialisation to 0! */ int FILL; #if !defined(DUMA_NO_CPP_SUPPORT) && !defined(DUMA_NO_LEAKDETECTION) int Magic; int DelPtr; const char * DelFile[DUMA_MAX_DEL_DEPTH]; int DelLine[DUMA_MAX_DEL_DEPTH]; #endif } DUMA_TLSVARS_T; #endif #ifndef DUMA_GLOBALS_DEFINED #define DUMA_GLOBALS_DEFINED typedef struct { /* Protection Space A */ char acSpaceA[2 * DUMA_PAGE_SIZE]; /* Variable: _duma_allocList * * _DUMA_allocList points to the array of slot structures used to manage the * malloc arena. */ struct _DUMA_Slot * allocList; /* Variable: _duma_null_addr * * _duma_null_addr is the address malloc() or C++ operator new returns, when size is 0 * two pages get reserved and protected */ void * null_addr; /* Variable */ DUMA_TLSVARS_T TLS; /* Protection Space B */ char acSpaceB[2 * DUMA_PAGE_SIZE]; } DUMA_GLOBALVARS_T; DUMA_EXTERN_C DUMA_GLOBALVARS_T _duma_g; #endif /* DUMA_GLOBALS_DEFINED */ #define GET_DUMA_TLSVARS() (&_duma_g.TLS) #ifndef DUMA_SET_ALIGNMENT #define DUMA_SET_ALIGNMENT(V) GET_DUMA_TLSVARS()->ALIGNMENT = (V) #endif #ifndef DUMA_SET_PROTECT_BELOW #define DUMA_SET_PROTECT_BELOW(V) GET_DUMA_TLSVARS()->PROTECT_BELOW = (V) #endif #ifndef DUMA_SET_FILL #define DUMA_SET_FILL(V) GET_DUMA_TLSVARS()->FILL = (V) #endif #ifndef DUMA_ENUMS_DECLARED #define DUMA_ENUMS_DECLARED /* allocator defines the type of calling allocator/deallocator function */ enum _DUMA_Allocator { EFA_INT_ALLOC , EFA_INT_DEALLOC , EFA_MALLOC , EFA_CALLOC , EFA_FREE , EFA_MEMALIGN , EFA_POSIX_MEMALIGN , EFA_REALLOC , EFA_VALLOC , EFA_STRDUP , EFA_NEW_ELEM , EFA_DEL_ELEM , EFA_NEW_ARRAY , EFA_DEL_ARRAY /* use following enums when calling _duma_allocate()/_duma_deallocate() * from user defined member operators */ , EFA_MEMBER_NEW_ELEM , EFA_MEMBER_DEL_ELEM , EFA_MEMBER_NEW_ARRAY , EFA_MEMBER_DEL_ARRAY }; enum _DUMA_FailReturn { DUMA_FAIL_NULL , DUMA_FAIL_ENV }; #endif /* DUMA_ENUMS_DECLARED */ #ifndef DUMA_FUNCTIONS_DECLARED #define DUMA_FUNCTIONS_DECLARED DUMA_EXTERN_C void _duma_init(void); DUMA_EXTERN_C void _duma_assert(const char * exprstr, const char * filename, int lineno); DUMA_EXTERN_C void duma_check(void * address); DUMA_EXTERN_C void duma_checkAll(); DUMA_EXTERN_C void * duma_alloc_return( void * address ); #ifdef DUMA_EXPLICIT_INIT DUMA_EXTERN_C void duma_init(void); #endif #ifndef DUMA_NO_LEAKDETECTION DUMA_EXTERN_C void * _duma_allocate(size_t alignment, size_t userSize, int protectBelow, int fillByte, int protectAllocList, enum _DUMA_Allocator allocator, enum _DUMA_FailReturn fail, const char * filename, int lineno); DUMA_EXTERN_C void _duma_deallocate(void * baseAdr, int protectAllocList, enum _DUMA_Allocator allocator, const char * filename, int lineno); DUMA_EXTERN_C void * _duma_malloc(size_t size, const char * filename, int lineno); DUMA_EXTERN_C void * _duma_calloc(size_t elemCount, size_t elemSize, const char * filename, int lineno); DUMA_EXTERN_C void _duma_free(void * baseAdr, const char * filename, int lineno); DUMA_EXTERN_C void * _duma_memalign(size_t alignment, size_t userSize, const char * filename, int lineno); DUMA_EXTERN_C int _duma_posix_memalign(void **memptr, size_t alignment, size_t userSize, const char * filename, int lineno); DUMA_EXTERN_C void * _duma_realloc(void * baseAdr, size_t newSize, const char * filename, int lineno); DUMA_EXTERN_C void * _duma_valloc(size_t size, const char * filename, int lineno); DUMA_EXTERN_C char * _duma_strdup(const char *str, const char * filename, int lineno); DUMA_EXTERN_C void * _duma_memcpy(void *dest, const void *src, size_t size, const char * filename, int lineno); DUMA_EXTERN_C void * _duma_memmove(void *dest, const void *src, size_t size); DUMA_EXTERN_C char * _duma_strcpy(char *dest, const char *src, const char * filename, int lineno); DUMA_EXTERN_C char * _duma_strncpy(char *dest, const char *src, size_t size, const char * filename, int lineno); DUMA_EXTERN_C char * _duma_strcat(char *dest, const char *src, const char * filename, int lineno); DUMA_EXTERN_C char * _duma_strncat(char *dest, const char *src, size_t size, const char * filename, int lineno); DUMA_EXTERN_C void DUMA_newFrame(void); DUMA_EXTERN_C void DUMA_delFrame(void); #else /* DUMA_NO_LEAKDETECTION */ DUMA_EXTERN_C void * _duma_allocate(size_t alignment, size_t userSize, int protectBelow, int fillByte, int protectAllocList, enum _DUMA_Allocator allocator, enum _DUMA_FailReturn fail); DUMA_EXTERN_C void _duma_deallocate(void * baseAdr, int protectAllocList, enum _DUMA_Allocator allocator); DUMA_EXTERN_C void * _duma_malloc(size_t size); DUMA_EXTERN_C void * _duma_calloc(size_t elemCount, size_t elemSize); DUMA_EXTERN_C void _duma_free(void * baseAdr); DUMA_EXTERN_C void * _duma_memalign(size_t alignment, size_t userSize); DUMA_EXTERN_C int _duma_posix_memalign(void **memptr, size_t alignment, size_t userSize); DUMA_EXTERN_C void * _duma_realloc(void * baseAdr, size_t newSize); DUMA_EXTERN_C void * _duma_valloc(size_t size); DUMA_EXTERN_C char * _duma_strdup(const char *str); DUMA_EXTERN_C void * _duma_memcpy(void *dest, const void *src, size_t size); DUMA_EXTERN_C void * _duma_memmove(void *dest, const void *src, size_t size); DUMA_EXTERN_C char * _duma_strcpy(char *dest, const char *src); DUMA_EXTERN_C char * _duma_strncpy(char *dest, const char *src, size_t size); DUMA_EXTERN_C char * _duma_strcat(char *dest, const char *src); DUMA_EXTERN_C char * _duma_strncat(char *dest, const char *src, size_t size); #endif /* DUMA_NO_LEAKDETECTION */ #endif /* DUMA_FUNCTIONS_DECLARED */ #ifndef DUMA_SKIP_SETUP #ifndef DUMA_NO_LEAKDETECTION #define malloc(SIZE) _duma_malloc(SIZE, __FILE__, __LINE__) #define calloc(ELEMCOUNT, ELEMSIZE) _duma_calloc(ELEMCOUNT, ELEMSIZE, __FILE__, __LINE__) #define free(BASEADR) _duma_free(BASEADR, __FILE__, __LINE__) #define memalign(ALIGNMENT, SIZE) _duma_memalign(ALIGNMENT, SIZE, __FILE__, __LINE__) #define posix_memalign(MEMPTR, ALIGNMENT, SIZE) _duma_posix_memalign(MEMPTR, ALIGNMENT, SIZE, __FILE__, __LINE__) #define realloc(BASEADR, NEWSIZE) _duma_realloc(BASEADR, NEWSIZE, __FILE__, __LINE__) #define valloc(SIZE) _duma_valloc(SIZE, __FILE__, __LINE__) #define strdup(STR) _duma_strdup(STR, __FILE__, __LINE__) #define memcpy(DEST, SRC, SIZE) _duma_memcpy(DEST, SRC, SIZE, __FILE__, __LINE__) #define memmove(DEST, SRC, SIZE) _duma_memmove(DEST, SRC, SIZE) #define strcpy(DEST, SRC) _duma_strcpy(DEST, SRC, __FILE__, __LINE__) #define strncpy(DEST, SRC, SIZE) _duma_strncpy(DEST, SRC, SIZE, __FILE__, __LINE__) #define strcat(DEST, SRC) _duma_strcat(DEST, SRC, __FILE__, __LINE__) #define strncat(DEST, SRC, SIZE) _duma_strncat(DEST, SRC, SIZE, __FILE__, __LINE__) #else /* DUMA_NO_LEAKDETECTION */ #define DUMA_newFrame() do { } while(0) #define DUMA_delFrame() do { } while(0) #endif /* DUMA_NO_LEAKDETECTION */ #endif // DUMA_SKIP_SETUP #ifndef DUMA_ASSERT #define DUMA_ASSERT(EXPR) ( (EXPR) || ( _duma_assert(#EXPR, __FILE__, __LINE__), 0 ) ) #endif #ifndef DUMA_CHECK #define DUMA_CHECK(BASEADR) duma_check(BASEADR) #endif #ifndef DUMA_CHECKALL #define DUMA_CHECKALL() duma_checkAll() #endif /* * protection of functions return address */ #ifdef __GNUC__ #define DUMA_FN_PROT_START const void * DUMA_RET_ADDR = __builtin_return_address(0); { #define DUMA_FN_PROT_END } DUMA_ASSERT( __builtin_return_address(0) == DUMA_RET_ADDR ); #define DUMA_FN_PROT_RET(EXPR) do { DUMA_ASSERT( __builtin_return_address(0) == DUMA_RET_ADDR ); return( EXPR ); } while (0) #define DUMA_FN_PROT_RET_VOID() do { DUMA_ASSERT( __builtin_return_address(0) == DUMA_RET_ADDR ); return; } while (0) #else #define DUMA_FN_PROT_START int aiDUMA_PROT[ 4 ] = { 'E', 'F', 'P', 'R' }; { #define DUMA_FN_PROT_END } DUMA_ASSERT( 'E'==aiDUMA_PROT[0] && 'F'==aiDUMA_PROT[1] && 'P'==aiDUMA_PROT[2] && 'R'==aiDUMA_PROT[3] ); #define DUMA_FN_PROT_RET(EXPR) do { DUMA_ASSERT( 'E'==aiDUMA_PROT[0] && 'F'==aiDUMA_PROT[1] && 'P'==aiDUMA_PROT[2] && 'R'==aiDUMA_PROT[3] ); return( EXPR ); } while (0) #define DUMA_FN_PROT_RET_VOID() do { DUMA_ASSERT( 'E'==aiDUMA_PROT[0] && 'F'==aiDUMA_PROT[1] && 'P'==aiDUMA_PROT[2] && 'R'==aiDUMA_PROT[3] ); return; } while (0) #endif /* declaration of an already defined array to enable checking at every reference * when using CA_REF() */ #define CA_DECLARE(NAME,SIZE) \ const unsigned long NAME ## _checkedsize = (SIZE); \ unsigned long NAME ## _checkedidx /* definition of a checked array adds definitions for its size and an extra temporary. * every array gets its own temporary to avoid problems with threading * a global temporary would have. */ #define CA_DEFINE(TYPE,NAME,SIZE) TYPE NAME[SIZE]; CA_DECLARE(NAME,SIZE) /* every access to a checked array is preceded an assert() on the index; * the index parameter is stored to a temporary to avoid double execution of index, * when index contains f.e. a "++". */ #define CA_REF(NAME,INDEX) \ NAME[ DUMA_ASSERT( (NAME ## _checkedidx = (INDEX)) < NAME ## _checkedsize ), NAME ## _checkedidx ] #endif /* end ifdef DUMA_NO_DUMA */ duma-VERSION_2_5_21/duma.sh000077500000000000000000000007021401225056000153550ustar00rootroot00000000000000#!/usr/bin/env sh # Simple script to run DUMA on stuff. # (Requires libduma.so.0.0 insalled). # Usage. if [ "$#" -lt 1 ]; then printf '%s\n' "$0: Usage: duma [optional arguments]." printf '%s\n' " Runs the executable under the DUMA malloc debugger." exit 1 fi # Set the environment to preload DUMA library. export LD_PRELOAD=libduma.so.0.0.0 export DYLD_INSERT_LIBRARIES=libduma.dylib export DYLD_FORCE_FLAT_NAMESPACE=1 exec "$@" duma-VERSION_2_5_21/duma_hlp.h000066400000000000000000000171511401225056000160400ustar00rootroot00000000000000/* * DUMA - Red-Zone memory allocator. * Copyright (C) 2002-2009 Hayati Ayguen , Procitec GmbH * License: GNU LGPL (GNU Lesser General Public License, see COPYING-GPL) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * FILE CONTENTS: * internal implementation file * contains helper functions for DUMA */ /* Function: reduceProtectedMemory * * delete reductionSizekB amount of memory, which has already * been freed but got protected * return != 0 when more memory reducable */ static int reduceProtectedMemory( size_t reductionSizekB ) { struct _DUMA_Slot * slot = _duma_g.allocList; size_t count = _duma_s.slotCount; size_t alreadyReducekB = 0; #ifndef WIN32 /* Windows VirtualFree(,,MEM_RELEASE) can only free whole allocations. not parts */ size_t delSize, newSize; /* 1- try reducing memory to just keep page(s) with userAddress */ for ( ; count > 0 && alreadyReducekB < reductionSizekB; --count, ++slot ) if ( DUMAST_ALL_PROTECTED == slot->state ) { /* free memory above userAddr; keep userAddr protected */ newSize = (char*)slot->userAddress - (char*)slot->internalAddress; newSize = (newSize + DUMA_PAGE_SIZE) & ~(DUMA_PAGE_SIZE -1); delSize = slot->internalSize - newSize; Page_Delete( (char*)slot->internalAddress + newSize, delSize ); alreadyReducekB += (delSize+1023) >>10; slot->state = DUMAST_BEGIN_PROTECTED; /* but keep the slot and userAddr */ slot->internalSize = newSize; if ( alreadyReducekB >= reductionSizekB ) { _duma_s.sumProtectedMem -= alreadyReducekB; _duma_s.sumAllocatedMem -= alreadyReducekB; return 1; } } #endif /* 2- deallocate all page(s) with userAddress, empty whole slot */ slot = _duma_g.allocList; count = _duma_s.slotCount; for ( ; count > 0 && alreadyReducekB < reductionSizekB; --count, ++slot ) if ( DUMAST_BEGIN_PROTECTED == slot->state #if defined(WIN32) || DUMAST_ALL_PROTECTED == slot->state #endif ) { /* free all the memory */ Page_Delete(slot->internalAddress, slot->internalSize); alreadyReducekB += (slot->internalSize+1023) >>10; /* free slot and userAddr */ slot->internalAddress = slot->userAddress = 0; slot->internalSize = slot->userSize = 0; slot->state = DUMAST_EMPTY; slot->allocator = EFA_INT_ALLOC; #ifndef DUMA_NO_LEAKDETECTION slot->fileSource = DUMAFS_EMPTY; slot->filename = 0; slot->lineno = 0; #endif if ( alreadyReducekB >= reductionSizekB ) { _duma_s.sumProtectedMem -= alreadyReducekB; _duma_s.sumAllocatedMem -= alreadyReducekB; return 1; } } return 0; } /* Function: slotForUserAddress * * Find the slot structure for a user address. */ static struct _DUMA_Slot * slotForUserAddress(void * address) { struct _DUMA_Slot * slot = _duma_g.allocList; size_t count = _duma_s.slotCount; for ( ; count > 0; --count, ++slot ) if ( slot->userAddress == address ) return slot; return 0; } /* Function: nearestSlotForUserAddress * * Find the nearest slot structure for a user address. */ static struct _DUMA_Slot * nearestSlotForUserAddress(void * userAddress) { struct _DUMA_Slot * slot = _duma_g.allocList; size_t count = _duma_s.slotCount; for ( ; count > 0; --count, ++slot ) if ( (char*)slot->internalAddress <= (char*)userAddress && (char*)userAddress <= (char*)slot->internalAddress + slot->internalSize ) return slot; return 0; } /* Function: _duma_init_slack * * Initialise the no mans land, for a given slot */ static void _duma_init_slack( struct _DUMA_Slot * slot ) { char * accBegAddr, * accEndAddr; char * tmpBegAddr, * tmpEndAddr; #ifdef DUMA_EXPLICIT_INIT slot->slackfill = _duma_s.SLACKFILL; #endif /* nothing to do for zero userSize */ if ( !slot->userSize ) return; /* calculate accessible non-protectable address area */ if ( (char*)slot->protAddress < (char*)slot->userAddress ) { /* DUMA_PROTECT_BELOW was 1 when allocating this piece of memory */ accBegAddr = (char*)slot->userAddress; accEndAddr = (char*)slot->internalAddress + slot->internalSize; } else { /* DUMA_PROTECT_BELOW was 0 when allocating this piece of memory */ accBegAddr = (char*)slot->internalAddress; accEndAddr = (char*)slot->protAddress; } tmpBegAddr = accBegAddr; tmpEndAddr = (char*)slot->userAddress; while (tmpBegAddr < tmpEndAddr) *tmpBegAddr++ = (char)_duma_s.SLACKFILL; tmpBegAddr = (char*)slot->userAddress + slot->userSize; tmpEndAddr = accEndAddr; while (tmpBegAddr < tmpEndAddr) *tmpBegAddr++ = (char)_duma_s.SLACKFILL; } /* Function: _duma_check_slack * * Checks the integrity of no mans land, for a given slot */ static void _duma_check_slack( struct _DUMA_Slot * slot ) { char * accBegAddr, * accEndAddr; char * tmpBegAddr, * tmpEndAddr; char slackfill; #ifdef DUMA_EXPLICIT_INIT slackfill = (char)slot->slackfill; #else slackfill = (char)_duma_s.SLACKFILL; #endif /* nothing to do for zero userSize */ if ( !slot->userSize ) return; if ( !slot->internalAddress ) return; /* calculate accessible non-protectable address area */ if ( (char*)slot->protAddress < (char*)slot->userAddress ) { /* DUMA_PROTECT_BELOW was 1 when allocating this piece of memory */ accBegAddr = (char*)slot->userAddress; accEndAddr = (char*)slot->internalAddress + slot->internalSize; } else { /* DUMA_PROTECT_BELOW was 0 when allocating this piece of memory */ accBegAddr = (char*)slot->internalAddress; accEndAddr = (char*)slot->protAddress; } tmpBegAddr = accBegAddr; tmpEndAddr = (char*)slot->userAddress; while (tmpBegAddr < tmpEndAddr) { if ( (char)slackfill != *tmpBegAddr++ ) { #ifndef DUMA_NO_LEAKDETECTION DUMA_Abort("ptr=%a: detected overwrite of ptrs no mans land below userSpace, size=%d alloced from %s(%i)", (DUMA_ADDR)slot->userAddress, (DUMA_SIZE)slot->userSize, slot->filename, slot->lineno); #else DUMA_Abort("ptr=%a: detected overwrite of ptrs no mans land below userSpace", (DUMA_ADDR)slot->userAddress); #endif } } tmpBegAddr = (char*)slot->userAddress + slot->userSize; tmpEndAddr = accEndAddr; while (tmpBegAddr < tmpEndAddr) { if ( (char)slackfill != *tmpBegAddr++ ) { #ifndef DUMA_NO_LEAKDETECTION DUMA_Abort("detected overwrite of no mans land above userSpace: ptr=%a, size=%d\nalloced from %s(%i)", (DUMA_ADDR)slot->userAddress, (DUMA_SIZE)slot->userSize, slot->filename, slot->lineno); #else DUMA_Abort("detected overwrite of no mans land above userSpace: ptr=%a", (DUMA_ADDR)slot->userAddress); #endif } } } /* Function: _duma_check_all_slacks * * Checks the integrity of all no mans land */ static void _duma_check_all_slacks( void ) { struct _DUMA_Slot * slot = _duma_g.allocList; size_t count = _duma_s.slotCount; for ( ; count > 0; --count, ++slot ) { /* CHECK INTEGRITY OF NO MANS LAND */ if ( DUMAST_IN_USE == slot->state && slot->userSize ) _duma_check_slack( slot ); } } duma-VERSION_2_5_21/duma_sem.h000066400000000000000000000031731401225056000160400ustar00rootroot00000000000000/* * DUMA - Red-Zone memory allocator. * Copyright (C) 2002-2005 Hayati Ayguen , Procitec GmbH * License: GNU LGPL (GNU Lesser General Public License, see COPYING-GPL) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * FILE CONTENTS: * internal header file */ #ifndef DUMA_SEM_INC_H #define DUMA_SEM_INC_H #ifndef DUMA_NO_THREAD_SAFETY #ifdef __cplusplus extern "C" { #endif void DUMA_init_sem(void); void DUMA_get_sem(void); int DUMA_rel_sem(int retval); #ifdef __cplusplus } /* extern "C" */ #endif #define DUMA_INIT_SEMAPHORE() DUMA_init_sem() #define DUMA_GET_SEMAPHORE() DUMA_get_sem() #define DUMA_RELEASE_SEMAPHORE(x) DUMA_rel_sem(x) #else /* DUMA_NO_THREAD_SAFETY */ #define DUMA_INIT_SEMAPHORE() do { } while (0) #define DUMA_GET_SEMAPHORE() do { } while (0) #define DUMA_RELEASE_SEMAPHORE(x) do { } while (0) #endif /* DUMA_NO_THREAD_SAFETY */ #endif /* DUMA_SEM_INC_H */ duma-VERSION_2_5_21/dumadetours/000077500000000000000000000000001401225056000164255ustar00rootroot00000000000000duma-VERSION_2_5_21/dumadetours/dumadetours.cpp000066400000000000000000000072111401225056000214660ustar00rootroot00000000000000/* * Copyright (C) 2006 Michael Eddington * * License: GNU GPL (GNU General Public License, see COPYING-GPL) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ // $Id$ #include "stdafx.h" #include #include #include #define arrayof(x) (sizeof(x)/sizeof(x[0])) int main(int argc, char **argv) { char* pszDllPath = "dumadetoursdll.dll"; if(getenv("DUMA_DETOURS_DLL")) pszDllPath = getenv("DUMA_DETOURS_DLL"); printf("\n| DUMA -- Detours DUMA Loader\n| Copyright (c) 2006 Michael Eddington\n\n"); if (argc < 2) { printf("\nSyntax: dumadetours.exe [command line]\n\n"); return 1; } ////////////////////////////////////////////////////////////////////////// STARTUPINFO si; PROCESS_INFORMATION pi; char szCommand[2048]; char szExe[1024]; char szFullExe[1024] = "\0"; char* pszFileExe = NULL; int cnt = 1; ZeroMemory(&si, sizeof(si)); ZeroMemory(&pi, sizeof(pi)); si.cb = sizeof(si); szCommand[0] = L'\0'; strcpy(szExe, argv[cnt]); for (; cnt < argc; cnt++) { if (strchr(argv[cnt], ' ') != NULL || strchr(argv[cnt], '\t') != NULL) { strcat(szCommand, "\""); strcat(szCommand, argv[cnt]); strcat(szCommand, "\""); } else strcat(szCommand, argv[cnt]); if (cnt + 1 < argc) strcat(szCommand, " "); } printf("dumadetours.exe: Starting: [%s]\n\n", szCommand); fflush(stdout); SetLastError(0); SearchPath(NULL, szExe, ".exe", arrayof(szFullExe), szFullExe, &pszFileExe); #ifdef DUMA_DUMA_DETOURS_VERSION == 2.1 if (!DetourCreateProcessWithDll( szFullExe[0] ? szFullExe : NULL // lpApplicationName , szCommand // lpCommandLine , NULL // lpProcessAttributes , NULL // lpThreadAttributes , TRUE // bInheritHandles , CREATE_DEFAULT_ERROR_MODE // dwCreationFlags , NULL // lpEnvironment , NULL // lpCurrentDirectory , &si // lpStartupInfo , &pi // lpProcessInformation , NULL // lpDetouredDllPath , pszDllPath // lpDllName , NULL ) ) // pfCreateProcessW #else if (!DetourCreateProcessWithDll( szFullExe[0] ? szFullExe : NULL , szCommand , NULL , NULL , TRUE , CREATE_DEFAULT_ERROR_MODE , NULL , NULL , &si , &pi , pszDllPath , NULL ) ) #endif { printf("dumadetours.exe: DetourCreateProcessWithDll failed: %d\n", GetLastError()); ExitProcess(2); } WaitForSingleObject(pi.hProcess, INFINITE); DWORD dwResult = 0; if (!GetExitCodeProcess(pi.hProcess, &dwResult)) { printf("dumadetours.exe: GetExitCodeProcess failed: %d\n", GetLastError()); dwResult = 3; } return dwResult; } // endduma-VERSION_2_5_21/dumadetours/stdafx.cpp000066400000000000000000000004421401225056000204220ustar00rootroot00000000000000// stdafx.cpp : source file that includes just the standard includes // dumadetours.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "stdafx.h" // TODO: reference any additional headers you need in STDAFX.H // and not in this fileduma-VERSION_2_5_21/dumadetours/stdafx.h000066400000000000000000000004311401225056000200650ustar00rootroot00000000000000// stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, but // are changed infrequently // #pragma once #include #include // TODO: reference additional headers your program requires hereduma-VERSION_2_5_21/dumadetoursdll/000077500000000000000000000000001401225056000171215ustar00rootroot00000000000000duma-VERSION_2_5_21/dumadetoursdll/dumadetoursdll.cpp000066400000000000000000000166461401225056000226720ustar00rootroot00000000000000/* * Copyright (C) 2006 Michael Eddington * * License: GNU GPL (GNU General Public License, see COPYING-GPL) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ // $Id$ // This implements a detours DLL that will take over the HeapXxxx // functions and use DUMA instead to track allocations. Other // memory functions will also be hooked in the future. // // Currently we will only intercept memory being allocated for heaps // that were created for HeapCreate calls we intercept. This is done // by always returning 1 for HeapCreate. Any other heap handle will // be passed to the real HeapXxxx functions. // // It is very usefull to have a map file when using duma + detours and // enable stacktrace output (DUMA_OUTPUT_STACKTRACE, and // DUMA_OUTPUT_STACKTRACE_MAPFILE) as you will not have filename's in // the output. #include "stdafx.h" #include #include #include "detours.h" #include "duma.h" #pragma warning(disable:4100) // Trampolines don't use formal parameters. ////////////////////////////////////////////////////////////////////////////// static BOOL bInternal = TRUE; #ifdef DUMA_DUMA_DETOURS_VERSION == 2.1 static HANDLE (WINAPI* Real_HeapCreate)(DWORD flOptions, SIZE_T dwInitialSize, SIZE_T dwMaximumSize) = HeapCreate; #else DETOUR_TRAMPOLINE(HANDLE WINAPI Real_HeapCreate(DWORD flOptions, SIZE_T dwInitialSize, SIZE_T dwMaximumSize), HeapCreate); #endif HANDLE WINAPI My_HeapCreate( DWORD flOptions, SIZE_T dwInitialSize, SIZE_T dwMaximumSize ) { return (HANDLE)1; } #ifdef DUMA_DUMA_DETOURS_VERSION == 2.1 static BOOL (WINAPI* Real_HeapDestroy)(HANDLE hHeap) = HeapDestroy; #else DETOUR_TRAMPOLINE(BOOL WINAPI Real_HeapDestroy(HANDLE hHeap), HeapDestroy); #endif BOOL WINAPI My_HeapDestroy(HANDLE hHeap) { if(hHeap != (HANDLE)1) return Real_HeapDestroy(hHeap); return TRUE; } #ifdef DUMA_DUMA_DETOURS_VERSION == 2.1 static BOOL (WINAPI* Real_HeapFree)(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem) = HeapFree; #else DETOUR_TRAMPOLINE(BOOL WINAPI Real_HeapFree(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem), HeapFree); #endif BOOL WINAPI My_HeapFree(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem) { if(hHeap != (HANDLE)1) return Real_HeapFree(hHeap, dwFlags, lpMem); _duma_free(lpMem, __FILE__, __LINE__); return TRUE; } #ifdef DUMA_DUMA_DETOURS_VERSION == 2.1 static LPVOID (WINAPI* Real_HeapAlloc)(HANDLE Heap, DWORD Flags, DWORD Bytes) = HeapAlloc; #else DETOUR_TRAMPOLINE(LPVOID WINAPI Real_HeapAlloc(HANDLE Heap, DWORD Flags, DWORD Bytes), HeapAlloc); #endif LPVOID WINAPI My_HeapAlloc(HANDLE hHeap, DWORD dwFlags, DWORD dwBytes) { if(hHeap != (HANDLE)1) return Real_HeapAlloc(hHeap, dwFlags, dwBytes); return _duma_malloc(dwBytes, __FILE__, __LINE__); } #ifdef DUMA_DUMA_DETOURS_VERSION == 2.1 static LPVOID (WINAPI* Real_HeapReAlloc)(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem, SIZE_T dwBytes) = HeapReAlloc; #else DETOUR_TRAMPOLINE(LPVOID WINAPI Real_HeapReAlloc(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem, SIZE_T dwBytes), HeapReAlloc); #endif LPVOID WINAPI My_HeapReAlloc(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem, SIZE_T dwBytes) { if(hHeap != (HANDLE)1) return Real_HeapReAlloc(hHeap, dwFlags, lpMem, dwBytes); return _duma_realloc(lpMem, dwBytes, __FILE__, __LINE__); } #ifdef DUMA_DUMA_DETOURS_VERSION == 2.1 static SIZE_T (WINAPI* Real_HeapSize)(HANDLE hHeap, DWORD dwFlags, LPCVOID lpMem) = HeapSize; #else DETOUR_TRAMPOLINE(SIZE_T WINAPI Real_HeapSize(HANDLE hHeap, DWORD dwFlags, LPCVOID lpMem), HeapSize); #endif SIZE_T WINAPI My_HeapSize(HANDLE hHeap, DWORD dwFlags, LPCVOID lpMem) { if(hHeap != (HANDLE)1) return Real_HeapSize(hHeap, dwFlags, lpMem); return sizeof(lpMem); } #ifdef DUMA_DUMA_DETOURS_VERSION == 2.1 static BOOL (WINAPI* Real_HeapValidate)(HANDLE hHeap, DWORD dwFlags, LPCVOID lpMem) = HeapValidate; #else DETOUR_TRAMPOLINE(BOOL WINAPI Real_HeapValidate(HANDLE hHeap, DWORD dwFlags, LPCVOID lpMem), HeapValidate); #endif BOOL WINAPI My_HeapValidate(HANDLE hHeap, DWORD dwFlags, LPCVOID lpMem) { if(hHeap != (HANDLE)1) return Real_HeapValidate(hHeap, dwFlags, lpMem); return true; } /////////////////////////////////////////////////////////////////////////// BOOL APIENTRY DllMain(HINSTANCE hinst, DWORD dwReason, LPVOID reserved) { if (dwReason == DLL_PROCESS_ATTACH) { // For debugging. Allows us time to attach a debugger. //fprintf(stderr, "DUMA: Press any key to continue..."); //fgetc(stdin); duma_init(); #ifdef DUMA_DUMA_DETOURS_VERSION == 2.1 DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourAttach(&(PVOID&)Real_HeapCreate, My_HeapCreate); DetourAttach(&(PVOID&)Real_HeapDestroy, My_HeapDestroy); DetourAttach(&(PVOID&)Real_HeapFree, My_HeapFree); DetourAttach(&(PVOID&)Real_HeapAlloc, My_HeapAlloc); DetourAttach(&(PVOID&)Real_HeapReAlloc, My_HeapReAlloc); DetourAttach(&(PVOID&)Real_HeapSize, My_HeapSize); DetourAttach(&(PVOID&)Real_HeapValidate, My_HeapValidate); DetourTransactionCommit(); #elif DUMA_DUMA_DETOURS_VERSION == 1.5 DetourFunctionWithTrampoline((PBYTE)Real_HeapCreate, (PBYTE)My_HeapCreate); DetourFunctionWithTrampoline((PBYTE)Real_HeapDestroy, (PBYTE)My_HeapDestroy); DetourFunctionWithTrampoline((PBYTE)Real_HeapFree, (PBYTE)My_HeapFree); DetourFunctionWithTrampoline((PBYTE)Real_HeapAlloc, (PBYTE)My_HeapAlloc); DetourFunctionWithTrampoline((PBYTE)Real_HeapReAlloc, (PBYTE)My_HeapReAlloc); DetourFunctionWithTrampoline((PBYTE)Real_HeapSize, (PBYTE)My_HeapSize); DetourFunctionWithTrampoline((PBYTE)Real_HeapValidate, (PBYTE)My_HeapValidate); #else #error "Unsupported version of detours" #endif bInternal = FALSE; } else if (dwReason == DLL_PROCESS_DETACH) { bInternal = TRUE; #ifdef DUMA_DUMA_DETOURS_VERSION == 2.1 DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); DetourDetach(&(PVOID&)Real_HeapCreate, My_HeapCreate); DetourDetach(&(PVOID&)Real_HeapDestroy, My_HeapDestroy); DetourDetach(&(PVOID&)Real_HeapFree, My_HeapFree); DetourDetach(&(PVOID&)Real_HeapAlloc, My_HeapAlloc); DetourDetach(&(PVOID&)Real_HeapReAlloc, My_HeapReAlloc); DetourDetach(&(PVOID&)Real_HeapSize, My_HeapSize); DetourDetach(&(PVOID&)Real_HeapValidate, My_HeapValidate); DetourTransactionCommit(); #elif DUMA_DUMA_DETOURS_VERSION == 1.5 DetourRemove((PBYTE)Real_HeapCreate, (PBYTE)My_HeapCreate); DetourRemove((PBYTE)Real_HeapDestroy, (PBYTE)My_HeapDestroy); DetourRemove((PBYTE)Real_HeapFree, (PBYTE)My_HeapFree); DetourRemove((PBYTE)Real_HeapAlloc, (PBYTE)My_HeapAlloc); DetourRemove((PBYTE)Real_HeapReAlloc, (PBYTE)My_HeapReAlloc); DetourRemove((PBYTE)Real_HeapSize, (PBYTE)My_HeapSize); DetourRemove((PBYTE)Real_HeapValidate, (PBYTE)My_HeapValidate); #else #error "Unsupported version of detours" #endif } return TRUE; } VOID NullExport() { } // endduma-VERSION_2_5_21/dumadetoursdll/stdafx.cpp000066400000000000000000000004451401225056000211210ustar00rootroot00000000000000// stdafx.cpp : source file that includes just the standard includes // dumadetoursdll.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "stdafx.h" // TODO: reference any additional headers you need in STDAFX.H // and not in this fileduma-VERSION_2_5_21/dumadetoursdll/stdafx.h000066400000000000000000000005601401225056000205640ustar00rootroot00000000000000// stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, but // are changed infrequently // #pragma once #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers // Windows Header Files: #include // TODO: reference additional headers your program requires hereduma-VERSION_2_5_21/dumadll/000077500000000000000000000000001401225056000155135ustar00rootroot00000000000000duma-VERSION_2_5_21/dumadll/dumadll.cpp000066400000000000000000000031721401225056000176440ustar00rootroot00000000000000// dumadll.cpp : Defines the entry point for the DLL application. // #include "stdafx.h" BOOL APIENTRY DllMain( HANDLE hModule , DWORD ul_reason_for_call , LPVOID lpReserved ) { return TRUE; } #include "duma.h" #define DUMA_PARAMS_UK , "unknown file", 0 void * duma_malloc(size_t size) { return _duma_malloc(size DUMA_PARAMS_UK); } void * duma_calloc(size_t nelem, size_t elsize) { return _duma_calloc(nelem, elsize DUMA_PARAMS_UK); } void duma_free(void * address) { _duma_free(address DUMA_PARAMS_UK); } void * duma_memalign(size_t alignment, size_t size) { return _duma_memalign(alignment, size DUMA_PARAMS_UK); } void * duma_realloc(void * oldBuffer, size_t newSize) { return _duma_realloc(oldBuffer, newSize DUMA_PARAMS_UK); } void * duma_valloc(size_t size) { return _duma_valloc(size DUMA_PARAMS_UK); } char * duma_strdup(const char * str) { return _duma_strdup(str DUMA_PARAMS_UK); } void * duma_memcpy(void *dest, const void *src, size_t size) { return _duma_memcpy(dest, src, size DUMA_PARAMS_UK); } void * duma_memmove(void *dest, const void *src, size_t size) { return _duma_memmove(dest, src, size); } char * duma_strcpy(char *dest, const char *src) { return _duma_strcpy(dest, src DUMA_PARAMS_UK); } char * duma_strncpy(char *dest, const char *src, size_t size) { return _duma_strncpy(dest, src, size DUMA_PARAMS_UK); } char * duma_strcat(char *dest, const char *src) { return _duma_strcat(dest, src DUMA_PARAMS_UK); } char * duma_strncat(char *dest, const char *src, size_t size) { return _duma_strncat(dest, src, size DUMA_PARAMS_UK); } // endduma-VERSION_2_5_21/dumadll/dumadll.def000066400000000000000000000003231401225056000176130ustar00rootroot00000000000000LIBRARY dumadll EXPORTS duma_malloc duma_calloc duma_free duma_memalign duma_realloc duma_valloc duma_strdup duma_memcpy duma_memmove duma_strcpy duma_strncpy duma_strcat duma_strncat duma-VERSION_2_5_21/dumadll/dumadll.rc000066400000000000000000000024011401225056000174600ustar00rootroot00000000000000// Microsoft Visual C++ generated resource script. // #include "resource.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 2 resource. // #include "afxres.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // English (U.S.) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) LANGUAGE 9, 1 #pragma code_page(1252) #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // TEXTINCLUDE // 1 TEXTINCLUDE BEGIN "resource.h\0" END 2 TEXTINCLUDE BEGIN "#include ""afxres.h""\r\n" "\0" END 3 TEXTINCLUDE BEGIN "\r\n" "\0" END #endif // APSTUDIO_INVOKED #endif // English (U.S.) resources ///////////////////////////////////////////////////////////////////////////// #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 3 resource. // ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED duma-VERSION_2_5_21/dumadll/resource.h000066400000000000000000000006021401225056000175110ustar00rootroot00000000000000//{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. // Used by dumadll.rc // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 101 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1001 #define _APS_NEXT_SYMED_VALUE 101 #endif #endifduma-VERSION_2_5_21/dumadll/stdafx.cpp000066400000000000000000000004361401225056000175130ustar00rootroot00000000000000// stdafx.cpp : source file that includes just the standard includes // dumadll.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "stdafx.h" // TODO: reference any additional headers you need in STDAFX.H // and not in this fileduma-VERSION_2_5_21/dumadll/stdafx.h000066400000000000000000000005601401225056000171560ustar00rootroot00000000000000// stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, but // are changed infrequently // #pragma once #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers // Windows Header Files: #include // TODO: reference additional headers your program requires hereduma-VERSION_2_5_21/dumapp.cpp000066400000000000000000000246661401225056000161010ustar00rootroot00000000000000/* * DUMA - Red-Zone memory allocator. * Copyright (C) 2002-2009 Hayati Ayguen , Procitec GmbH * Copyright (C) 1987-1999 Bruce Perens * License: GNU GPL (GNU General Public License, see COPYING-GPL) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * * FILE CONTENTS: * internal implementation file * replaces various global C++ new/delete/new[]/delete[] operators */ #ifndef DUMA_NO_CPP_SUPPORT #ifdef _MSC_VER #include #include #else #include #endif #include #include "dumapp.h" #include "noduma.h" /* define the global variables */ static const char unknown_cxx_file[] = "UNKNOWN (use #include \"dumapp.h\")"; #ifndef DUMA_NO_LEAKDETECTION /* with Leak-Detection */ #define DUMA_PARAMS_UK , unknown_cxx_file, 0 #define DUMA_PARAMS_FILELINE , filename, lineno #else /* no Leak-Detection */ #define DUMA_PARAMS_UK #define DUMA_PARAMS_FILELINE #endif /******************************************************************** ********************************************************************/ #ifdef _MSC_VER int DUMA_CDECL duma_new_handler( size_t size ) { return 0; } #else void duma_new_handler() { } #endif // declare function ; needed for attribute static #ifdef _MSC_VER __forceinline #else inline #endif void * duma_new_operator(DUMA_SIZE_T userSize, enum _DUMA_Allocator allocator, bool dothrow #ifndef DUMA_NO_LEAKDETECTION , const char * filename, int lineno #endif ) #ifdef __GNUC__ __attribute__ ((always_inline)) #endif ; /* Function: duma_new_operator * * C++ allocation function, * which is nearly C++ conform. * * Missing features are: * * - check if new_handler function hangs, return NULL or throw bad_alloc() in this case * on UNIX systems alarm() may be usable * * Following features are implemented: * * - loop is done * - alignment depends on user * - bad_alloc() exception will be thrown * - bad_alloc() is catched to return (void*)0 * - check for userSize == 0, return non-NULL in this case * implemented in new/delete operators below * */ void * duma_new_operator(DUMA_SIZE_T userSize, enum _DUMA_Allocator allocator, bool dothrow #ifndef DUMA_NO_LEAKDETECTION , const char * filename, int lineno #endif ) { void * ret = 0; #ifdef _MSC_VER int pnhret = 1; #else #define pnhret 1 #endif // initialize duma? if ( _duma_g.allocList == 0 ) _duma_init(); /* This sets DUMA_ALIGNMENT, DUMA_PROTECT_BELOW, DUMA_FILL, ... */ DUMA_TLSVARS_T * duma_tls = GET_DUMA_TLSVARS(); do { // try allocation ret = _duma_allocate( 0 /*=alignment*/ , userSize , duma_tls->PROTECT_BELOW , duma_tls->FILL , 1 /*=protectAllocList*/ , allocator , DUMA_FAIL_NULL #ifndef DUMA_NO_LEAKDETECTION , filename , lineno #endif ); // when allocation failed (and last call to new_handler didn't fail on Visual C++) if ( !ret && pnhret ) { // get the current new_handler #ifdef _MSC_VER _PNH h = _set_new_handler(duma_new_handler); _set_new_handler(h); #else std::new_handler h = std::set_new_handler(duma_new_handler); std::set_new_handler(h); #endif // is there any handler? if ( h ) { try // new_handler may throw an exception!!! { // call handler #ifdef _MSC_VER pnhret = h(userSize); #else h(); #endif } catch (std::bad_alloc) // error occured in new_handler { if (dothrow) throw; // report error via re-throwing else return ret; // report error via (void*)0 } // end try catch } else if (dothrow) // report non-existing handler via exception throw std::bad_alloc(); else // report non-existing handler via (void*)0 return ret; } } while ( !ret ); // loop until memory is claimed return ret; } /******************************************************************** ********************************************************************/ /* Function: operator new * * Single object form, no debug information * (11) = (a) ; ASW */ void * DUMA_CDECL operator new( DUMA_SIZE_T size ) NEW_THROW_SPEC { return duma_new_operator(size, EFA_NEW_ELEM, true DUMA_PARAMS_UK); } /* Function: operator new * * Single object form, no debug information * (12) = (b) ; ASN */ void * DUMA_CDECL operator new( DUMA_SIZE_T size, const std::nothrow_t & ) throw() { return duma_new_operator(size, EFA_NEW_ELEM, false DUMA_PARAMS_UK); } /* Function: operator delete * * Single object form, no debug information * (13) = ( c ) ; FSW */ void DUMA_CDECL operator delete( void *ptr ) throw() { #ifndef DUMA_NO_LEAKDETECTION DUMA_TLSVARS_T & duma_tls = * GET_DUMA_TLSVARS(); _duma_deallocate(ptr, 1 /*=protectAllocList*/, EFA_DEL_ELEM, duma_tls.DelFile[duma_tls.DelPtr], duma_tls.DelLine[duma_tls.DelPtr]); #else _duma_deallocate(ptr, 1 /*=protectAllocList*/, EFA_DEL_ELEM DUMA_PARAMS_UK); #endif } /* Function: operator delete * * Single object form, no debug information * (14) = (d) ; FSN */ void DUMA_CDECL operator delete( void * ptr, const std::nothrow_t & ) throw() { #ifndef DUMA_NO_LEAKDETECTION DUMA_TLSVARS_T & duma_tls = * GET_DUMA_TLSVARS(); _duma_deallocate(ptr, 1 /*=protectAllocList*/, EFA_DEL_ELEM, duma_tls.DelFile[duma_tls.DelPtr], duma_tls.DelLine[duma_tls.DelPtr]); #else _duma_deallocate(ptr, 1 /*=protectAllocList*/, EFA_DEL_ELEM DUMA_PARAMS_UK); #endif } /******************************************************************** ********************************************************************/ /* 2x : ARRAY OBJECT FORM - NO DEBUG INFORMATION */ /* Function: operator new[] * * Array object form, no debug information * (21) = (a) ; AAW */ void * DUMA_CDECL operator new[]( DUMA_SIZE_T size ) NEW_THROW_SPEC { return duma_new_operator(size, EFA_NEW_ARRAY, true DUMA_PARAMS_UK); } /* Function: operator new[] * * Array object form, no debug information * (22) = (b) ; AAN */ void * DUMA_CDECL operator new[]( DUMA_SIZE_T size, const std::nothrow_t & ) throw() { return duma_new_operator(size, EFA_NEW_ARRAY, false DUMA_PARAMS_UK); } /* Function: operator delete[] * * Array object form, no debug information * (23) = (c) ; FAW */ void DUMA_CDECL operator delete[]( void * ptr ) throw() { #ifndef DUMA_NO_LEAKDETECTION DUMA_TLSVARS_T & duma_tls = * GET_DUMA_TLSVARS(); _duma_deallocate(ptr, 1 /*=protectAllocList*/, EFA_DEL_ARRAY, duma_tls.DelFile[duma_tls.DelPtr], duma_tls.DelLine[duma_tls.DelPtr]); #else _duma_deallocate(ptr, 1 /*=protectAllocList*/, EFA_DEL_ARRAY DUMA_PARAMS_UK); #endif } /* Function: operator delete[] * * Array object form, no debug information * (24) = (d) ; FAN */ void DUMA_CDECL operator delete[]( void * ptr, const std::nothrow_t & ) throw() { #ifndef DUMA_NO_LEAKDETECTION DUMA_TLSVARS_T & duma_tls = * GET_DUMA_TLSVARS(); _duma_deallocate(ptr, 1 /*=protectAllocList*/, EFA_DEL_ARRAY, duma_tls.DelFile[duma_tls.DelPtr], duma_tls.DelLine[duma_tls.DelPtr]); #else _duma_deallocate(ptr, 1 /*=protectAllocList*/, EFA_DEL_ARRAY DUMA_PARAMS_UK); #endif } /******************************************************************** ********************************************************************/ #ifndef DUMA_NO_LEAKDETECTION /* 3x : SINGLE OBJECT FORM - WITH DEBUG INFORMATION */ /* Function: operator new * * Single object form with debug information * (31) = (a) ; ASW */ void * DUMA_CDECL operator new( DUMA_SIZE_T size, const char *filename, int lineno ) NEW_THROW_SPEC { return duma_new_operator(size, EFA_NEW_ELEM, true DUMA_PARAMS_FILELINE); } /* Function: operator new * * Single object form with debug information * (32) = (b) ; ASN */ void * DUMA_CDECL operator new( DUMA_SIZE_T size, const std::nothrow_t &, const char *filename, int lineno ) throw() { return duma_new_operator(size, EFA_NEW_ELEM, false DUMA_PARAMS_FILELINE); } /* Function: operator delete * * Single object form with debug information * (33) = (c) ; FSW */ void DUMA_CDECL operator delete( void *ptr, const char *filename, int lineno ) throw() { _duma_deallocate(ptr, 1 /*=protectAllocList*/, EFA_DEL_ELEM DUMA_PARAMS_FILELINE); } /* Function: operator delete * * Single object form with debug information * (34) = (d) ; FSN */ void DUMA_CDECL operator delete( void *ptr, const std::nothrow_t &, const char *filename, int lineno ) throw() { _duma_deallocate(ptr, 1 /*=protectAllocList*/, EFA_DEL_ELEM DUMA_PARAMS_FILELINE); } /******************************************************************** ********************************************************************/ /* 4x : ARRAY OBJECT FORM - WITH DEBUG INFORMATION */ /* Function: operator new[] * * Array object form with debug information * (41) = (a) ; AAW */ void * DUMA_CDECL operator new[]( DUMA_SIZE_T size, const char *filename, int lineno ) NEW_THROW_SPEC { return duma_new_operator(size, EFA_NEW_ARRAY, true DUMA_PARAMS_FILELINE); } /* Function: operator new[] * * Array object form with debug information * (42) = (b) ; AAN */ void * DUMA_CDECL operator new[]( DUMA_SIZE_T size, const std::nothrow_t &, const char *filename, int lineno ) throw() { return duma_new_operator(size, EFA_NEW_ARRAY, false DUMA_PARAMS_FILELINE); } /* Function: operator delete[] * * Array object form with debug information * (43) = (c) ; FAW */ void DUMA_CDECL operator delete[]( void *ptr, const char *filename, int lineno ) throw() { _duma_deallocate(ptr, 1 /*=protectAllocList*/, EFA_DEL_ARRAY DUMA_PARAMS_FILELINE); } /* Function: operator delete[] * * Array object form with debug information * (44) = (d) ; FAN */ void DUMA_CDECL operator delete[]( void *ptr, const std::nothrow_t &, const char *filename, int lineno ) throw() { _duma_deallocate(ptr, 1 /*=protectAllocList*/, EFA_DEL_ARRAY DUMA_PARAMS_FILELINE); } #endif /* end ifdef DUMA_NO_LEAKDETECTION */ #endif /* DUMA_NO_CPP_SUPPORT */ duma-VERSION_2_5_21/dumapp.h000066400000000000000000000210401401225056000155250ustar00rootroot00000000000000/* * DUMA - Red-Zone memory allocator. * Copyright (C) 2002-2008 Hayati Ayguen , Procitec GmbH * License: GNU LGPL (GNU Lesser General Public License, see COPYING-GPL) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * FILE CONTENTS: * header file for inclusion from YOUR C++ application code * various new/delete/new[]/delete[] declarations * you must include before including this file. */ /* explicitly no "#ifndef _DUMAPP_H_" to allow mutliple inclusions * within single source file with inclusion of noduma.h in between */ #ifndef __cplusplus /* avoid usage of C++ operator replacements in C code */ #error compile with a C++ compiler, or define DUMA_NO_CPP_SUPPORT to remove this error #endif #include "duma.h" #if __cplusplus < 201103L #define DUMA_EXCEPTION_SPECS 1 #endif /* remove previous macro definitions */ #include "noduma.h" #if ( defined(DUMA_NO_CPP_SUPPORT) || defined(DUMA_NO_LEAKDETECTION) ) /* define macros as wrapper without special functionality */ #define NEW_ELEM(TYPE) new TYPE #define NEW_ARRAY(TYPE, COUNT) new TYPE[COUNT] #define DEL_ELEM(PTR) delete PTR #define DEL_ARRAY(PTR) delete []PTR #endif /* ( defined(DUMA_NO_CPP_SUPPORT) || defined(DUMA_NO_LEAKDETECTION) ) */ #ifndef DUMA_CDECL #ifdef _MSC_VER #define DUMA_CDECL __cdecl #else #define DUMA_CDECL #endif #endif #ifndef DUMA_SIZE_T #ifdef _MSC_VER #define DUMA_SIZE_T size_t #else #define DUMA_SIZE_T std::size_t #endif #endif #if __cplusplus <= 199711L #define NEW_THROW_SPEC throw(std::bad_alloc) #else #define NEW_THROW_SPEC #endif #ifndef DUMA_NO_CPP_SUPPORT #ifndef DUMA_CPP_OPERATORS_DECLARED /* && !defined(DUMA_NO_CPP_SUPPORT) */ #define DUMA_CPP_OPERATORS_DECLARED /* * Classification * A allocation <-> F free * S single object form <-> A array form * W without nothrow <-> N with std::nothrow_t parameter */ /* 1x : SINGLE OBJECT FORM - NO DEBUG INFORMATION */ /* (11) = (a) ; ASW */ /* (12) = (b) ; ASN */ /* (13) = (c) ; FSW */ /* (14) = (d) ; FSN */ void * DUMA_CDECL operator new(DUMA_SIZE_T) NEW_THROW_SPEC; void * DUMA_CDECL operator new(DUMA_SIZE_T, const std::nothrow_t &) throw(); void DUMA_CDECL operator delete(void *) throw(); void DUMA_CDECL operator delete(void *, const std::nothrow_t &) throw(); /* 2x : ARRAY OBJECT FORM - NO DEBUG INFORMATION */ /* (21) = (a) ; AAW */ /* (22) = (b) ; AAN */ /* (23) = (c) ; FAW */ /* (24) = (d) ; FAN */ void * DUMA_CDECL operator new[](DUMA_SIZE_T) NEW_THROW_SPEC; void * DUMA_CDECL operator new[](DUMA_SIZE_T, const std::nothrow_t &) throw(); void DUMA_CDECL operator delete[](void *) throw(); void DUMA_CDECL operator delete[](void *, const std::nothrow_t &) throw(); #ifndef DUMA_NO_LEAKDETECTION /* && !defined(DUMA_CPP_OPERATORS_DECLARED) */ /* 3x : SINGLE OBJECT FORM - WITH DEBUG INFORMATION */ /* (31) = (a) ; ASW */ /* (32) = (b) ; ASN */ /* (33) = (c) ; FSW */ /* (34) = (d) ; FSN */ void * DUMA_CDECL operator new(DUMA_SIZE_T, const char *, int) NEW_THROW_SPEC; void * DUMA_CDECL operator new(DUMA_SIZE_T, const std::nothrow_t &, const char *, int) throw(); void DUMA_CDECL operator delete(void *, const char *, int) throw(); void DUMA_CDECL operator delete(void *, const std::nothrow_t &, const char *, int) throw(); /* 4x : ARRAY OBJECT FORM - WITH DEBUG INFORMATION */ /* (41) = (a) ; AAW */ /* (42) = (b) ; AAN */ /* (43) = (c) ; FAW */ /* (44) = (d) ; FAN */ void * DUMA_CDECL operator new[](DUMA_SIZE_T, const char *, int) NEW_THROW_SPEC; void * DUMA_CDECL operator new[](DUMA_SIZE_T, const std::nothrow_t &, const char *, int) throw(); void DUMA_CDECL operator delete[](void *, const char *, int) throw(); void DUMA_CDECL operator delete[](void *, const std::nothrow_t &, const char *, int) throw(); #endif /* DUMA_NO_LEAKDETECTION */ #endif /* DUMA_CPP_OPERATORS_DECLARED */ #ifndef DUMA_NO_LEAKDETECTION /* && !defined(DUMA_CPP_OPERATORS_DECLARED) */ #ifndef DUMA_NO_THREAD_SAFETY #include "duma_sem.h" #endif /* define macros as wrapper for our special operators */ #ifdef DUMA_OLD_NEW_MACRO /* throwing variants */ #define NEW_ELEM(TYPE) new(__FILE__,__LINE__) TYPE #define NEW_ARRAY(TYPE, COUNT) new(__FILE__,__LINE__) TYPE[COUNT] /* non throwing variant */ #define NEW_ELEM_NOTHROW(TYPE) new(std::nothrow,__FILE__,__LINE__) TYPE #define NEW_ARRAY_NOTHROW(TYPE, COUNT) new(std::nothrow,__FILE__,__LINE__) TYPE[COUNT] #else /* #define new_NOTHROW new(std::nothrow,__FILE__,__LINE__) */ #define new new(__FILE__, __LINE__) #endif /* DUMA_OLD_NEW_MACRO */ #ifdef DUMA_OLD_DEL_MACRO /* always use _duma_g.TLS.DelPtr/DUMA_DeleteFile/DUMA_DeleteLine * to allow best possible filename/line reports when * non-DUMA deallocations are called from destructors */ /* non-throwing */ #define DEL_ELEM(PTR) for( ++_duma_g.TLS.DelPtr, \ _duma_g.TLS.Magic = 1; \ _duma_g.TLS.Magic; \ _duma_g.TLS.Magic = 0, \ --_duma_g.TLS.DelPtr \ ) operator delete (PTR, __FILE__, __LINE__) #define DEL_ARRAY(PTR) for( ++_duma_g.TLS.DelPtr, \ _duma_g.TLS.Magic = 1; \ _duma_g.TLS.Magic; \ _duma_g.TLS.Magic = 0, \ --_duma_g.TLS.DelPtr \ ) operator delete[](PTR, __FILE__, __LINE__) /* explicitly non-throwing */ #define DEL_ELEM_NOTHROW(PTR) for( ++_duma_g.TLS.DelPtr, \ _duma_g.TLS.Magic = 1; \ _duma_g.TLS.Magic; \ _duma_g.TLS.Magic = 0, \ --_duma_g.TLS.DelPtr \ ) operator delete (PTR, std::nothrow,__FILE__, __LINE__) #define DEL_ARRAY_NOTHROW(PTR) for( ++_duma_g.TLS.DelPtr, \ _duma_g.TLS.Magic = 1; \ _duma_g.TLS.Magic; \ _duma_g.TLS.Magic = 0, \ --_duma_g.TLS.DelPtr \ ) operator delete[](PTR, std::nothrow,__FILE__, __LINE__) #else #ifndef DUMA_NO_THREAD_SAFETY /* define a thread safe delete */ #define delete for( DUMA_GET_SEMAPHORE(), \ DUMA_GET_SEMAPHORE(), \ ++_duma_g.TLS.DelPtr, \ DUMA_ASSERT(_duma_g.TLS.DelPtr < DUMA_MAX_DEL_DEPTH), \ _duma_g.TLS.Magic = 1, \ _duma_g.TLS.DelFile[_duma_g.TLS.DelPtr] = __FILE__, \ _duma_g.TLS.DelLine[_duma_g.TLS.DelPtr] = __LINE__; \ DUMA_RELEASE_SEMAPHORE(_duma_g.TLS.Magic); \ _duma_g.TLS.Magic = 0, \ --_duma_g.TLS.DelPtr \ ) delete #else /* also thread safe by using TLS variables */ #define delete for( ++_duma_g.TLS.DelPtr, \ DUMA_ASSERT(_duma_g.TLS.DelPtr < DUMA_MAX_DEL_DEPTH), \ _duma_g.TLS.Magic = 1, \ _duma_g.TLS.DelFile[_duma_g.TLS.DelPtr] = __FILE__, \ _duma_g.TLS.DelLine[_duma_g.TLS.DelPtr] = __LINE__; \ _duma_g.TLS.Magic; \ _duma_g.TLS.Magic = 0, \ --_duma_g.TLS.DelPtr \ ) delete #endif /* DUMA_NO_THREAD_SAFETY */ #endif /* DUMA_OLD_DEL_MACRO */ #endif /* end ifdef DUMA_NO_LEAKDETECTION */ #endif /* end ifdef DUMA_NO_CPP_SUPPORT */ #include "duma.h" duma-VERSION_2_5_21/example1.cpp000066400000000000000000000002731401225056000163130ustar00rootroot00000000000000#include int main() { int *pi; int i; #ifdef DUMA_EXPLICIT_INIT duma_init(); #endif pi = (int*)malloc(10*sizeof(int)); for(i=0; i<11; ++i) pi[i] = i; return 0; } duma-VERSION_2_5_21/example2.cpp000066400000000000000000000002731401225056000163140ustar00rootroot00000000000000#include int main() { int *pi; int i; #ifdef DUMA_EXPLICIT_INIT duma_init(); #endif pi = (int*)malloc(10*sizeof(int)); for(i=0; i<10; ++i) pi[i] = i; return 0; } duma-VERSION_2_5_21/example3.cpp000066400000000000000000000003151401225056000163120ustar00rootroot00000000000000#include #include int main() { int *pi; int i; #ifdef DUMA_EXPLICIT_INIT duma_init(); #endif pi = (int*)malloc(10*sizeof(int)); for(i=0; i<10; ++i) pi[i] = i; return 0; }duma-VERSION_2_5_21/example4.cpp000066400000000000000000000003751401225056000163210ustar00rootroot00000000000000#include #include #include #include int main() { int *pi; int i; #ifdef DUMA_EXPLICIT_INIT duma_init(); #endif pi = (int*)malloc(10*sizeof(int)); for(i=0; i<10; ++i) pi[i] = i; delete pi; return 0; }duma-VERSION_2_5_21/example5.cpp000066400000000000000000000003561401225056000163210ustar00rootroot00000000000000#include #include #include #include int main() { int *pi; int i; #ifdef DUMA_EXPLICIT_INIT duma_init(); #endif pi = new int[10]; for(i=0; i<10; ++i) pi[i] = i; delete []pi; return 0; }duma-VERSION_2_5_21/example6.cpp000066400000000000000000000002441401225056000163160ustar00rootroot00000000000000int main() { int *pi; int i; #ifdef DUMA_EXPLICIT_INIT duma_init(); #endif pi = new int[10]; for(i=0; i<10; ++i) pi[i] = i; delete []pi; return 0; }duma-VERSION_2_5_21/example_makes/000077500000000000000000000000001401225056000167045ustar00rootroot00000000000000duma-VERSION_2_5_21/example_makes/ex1/000077500000000000000000000000001401225056000174015ustar00rootroot00000000000000duma-VERSION_2_5_21/example_makes/ex1/Makefile000066400000000000000000000004501401225056000210400ustar00rootroot00000000000000 DUMADIR=../.. CPPFLAGS=-g -O0 -I$(DUMADIR) LFLAGS=$(DUMADIR)/libduma.a ifeq ($(OS), Windows_NT) LIBS= else LIBS=-lpthread endif CC=gcc CXX=g++ BIN=example1 OBJ=../../$(BIN).o all: $(BIN) ./$(BIN) clean: - rm -f $(OBJ) $(BIN) $(BIN): $(OBJ) $(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN) duma-VERSION_2_5_21/example_makes/ex2/000077500000000000000000000000001401225056000174025ustar00rootroot00000000000000duma-VERSION_2_5_21/example_makes/ex2/Makefile000066400000000000000000000004501401225056000210410ustar00rootroot00000000000000 DUMADIR=../.. CPPFLAGS=-g -O0 -I$(DUMADIR) LFLAGS=$(DUMADIR)/libduma.a ifeq ($(OS), Windows_NT) LIBS= else LIBS=-lpthread endif CC=gcc CXX=g++ BIN=example2 OBJ=../../$(BIN).o all: $(BIN) ./$(BIN) clean: - rm -f $(OBJ) $(BIN) $(BIN): $(OBJ) $(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN) duma-VERSION_2_5_21/example_makes/ex3/000077500000000000000000000000001401225056000174035ustar00rootroot00000000000000duma-VERSION_2_5_21/example_makes/ex3/Makefile000066400000000000000000000004501401225056000210420ustar00rootroot00000000000000 DUMADIR=../.. CPPFLAGS=-g -O0 -I$(DUMADIR) LFLAGS=$(DUMADIR)/libduma.a ifeq ($(OS), Windows_NT) LIBS= else LIBS=-lpthread endif CC=gcc CXX=g++ BIN=example3 OBJ=../../$(BIN).o all: $(BIN) ./$(BIN) clean: - rm -f $(OBJ) $(BIN) $(BIN): $(OBJ) $(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN) duma-VERSION_2_5_21/example_makes/ex4/000077500000000000000000000000001401225056000174045ustar00rootroot00000000000000duma-VERSION_2_5_21/example_makes/ex4/Makefile000066400000000000000000000004501401225056000210430ustar00rootroot00000000000000 DUMADIR=../.. CPPFLAGS=-g -O0 -I$(DUMADIR) LFLAGS=$(DUMADIR)/libduma.a ifeq ($(OS), Windows_NT) LIBS= else LIBS=-lpthread endif CC=gcc CXX=g++ BIN=example4 OBJ=../../$(BIN).o all: $(BIN) ./$(BIN) clean: - rm -f $(OBJ) $(BIN) $(BIN): $(OBJ) $(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN) duma-VERSION_2_5_21/example_makes/ex5/000077500000000000000000000000001401225056000174055ustar00rootroot00000000000000duma-VERSION_2_5_21/example_makes/ex5/Makefile000066400000000000000000000004501401225056000210440ustar00rootroot00000000000000 DUMADIR=../.. CPPFLAGS=-g -O0 -I$(DUMADIR) LFLAGS=$(DUMADIR)/libduma.a ifeq ($(OS), Windows_NT) LIBS= else LIBS=-lpthread endif CC=gcc CXX=g++ BIN=example5 OBJ=../../$(BIN).o all: $(BIN) ./$(BIN) clean: - rm -f $(OBJ) $(BIN) $(BIN): $(OBJ) $(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN) duma-VERSION_2_5_21/example_makes/ex6/000077500000000000000000000000001401225056000174065ustar00rootroot00000000000000duma-VERSION_2_5_21/example_makes/ex6/Makefile000066400000000000000000000006021401225056000210440ustar00rootroot00000000000000 DUMADIR=../.. CPPFLAGS=-g -O0 -I$(DUMADIR) -include stdlib.h -include new -include dumapp.h LFLAGS=$(DUMADIR)/libduma.a ifeq ($(OS), Windows_NT) LIBS= else LIBS=-lpthread endif CC=gcc CXX=g++ BIN=example6 OBJ=../../$(BIN).o all: $(BIN) ./$(BIN) clean: - rm -f $(OBJ) $(BIN) $(BIN): $(OBJ) $(CXX) $(OBJ) $(LFLAGS) $(LIBS) -o $(BIN) .cpp.o: $(CXX) $(CPPFLAGS) -c $< -o $@ duma-VERSION_2_5_21/gdbinit.rc000066400000000000000000000022361401225056000160420ustar00rootroot00000000000000# This is a suggested ~/.gdbinit # originally from Ray Dassen for efence, now modified for duma. # it enables you to use DUMA from within gdb, # without using DUMA for gdb itself # without having to recompile or relink the binary. # See the gdb docs for more information. define duma set environment DUMA_ALLOW_MALLOC_0 1 set environment LD_PRELOAD /usr/lib/libduma.so.0.0.0 echo Enabled DUMA\n end document duma Enable memory allocation debugging through DUMA (duma(3)). See also noduma, underduma and overduma. end define noduma unset environment LD_PRELOAD echo Disabled DUMA\n end document noduma Disable memory allocation debugging through DUMA (duma(3)). end define overduma set environment DUMA_PROTECT_BELOW 0 echo set DUMA to detect overflows\n end document overduma Set DUMA to detect buffer overflow errors (duma(3)). See also duma, noduma and underduma. end define underduma set environment DUMA_PROTECT_BELOW 1 echo set DUMA to detect underflows\n end document underduma Set DUMA to detect buffer underflow errors (duma(3)). See also duma, noduma and overduma. end duma-VERSION_2_5_21/kduma/000077500000000000000000000000001401225056000151725ustar00rootroot00000000000000duma-VERSION_2_5_21/kduma/Makefile000066400000000000000000000000001401225056000166200ustar00rootroot00000000000000duma-VERSION_2_5_21/kduma/README.txt000066400000000000000000000003501401225056000166660ustar00rootroot00000000000000This is the begining of a linux kernel model duma. Same idea as user space duma, replace kmalloc and friends instead. This effort is being drivin by: * Eric Rachner * Michael Eddington duma-VERSION_2_5_21/kduma/builddocs.bat000066400000000000000000000002441401225056000176320ustar00rootroot00000000000000 cd c:\projects\naturaldocs NaturalDocs -i c:\projects\duma\kduma -o html c:\projects\duma\kduma\docs -p c:\projects\duma\kduma\docs-data cd c:\projects\duma\kduma duma-VERSION_2_5_21/kduma/createconf.c000066400000000000000000000252371401225056000174600ustar00rootroot00000000000000 /* * KDUMA - Red-Zone memory allocator. * * Copyright (C) 2006 Michael Eddington * Copyright (C) 2002-2005 Hayati Ayguen , Procitec GmbH * Copyright (C) 1987-1999 Bruce Perens * * License: GNU GPL (GNU General Public License, see COPYING-GPL) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * * FILE CONTENTS: * -------------- * This is a small tool to generate the "duma_config.h" configuration file. * Its purpose is to allow fixed size memory allocation on stack, which can * get protected calling page protection functions. * Also its nice for the user to be able to see the page size. */ #include #include #include #include #ifdef _MSC_VER #include #endif #ifndef WIN32 #include #include #include #else #define WIN32_LEAN_AND_MEAN 1 #include #include typedef LPVOID caddr_t; typedef unsigned u_int; #endif /* * retrieve page size * size_t Page_Size(void) */ static size_t Page_Size(void) { #if defined(WIN32) SYSTEM_INFO SystemInfo; GetSystemInfo( &SystemInfo ); return (size_t)SystemInfo.dwPageSize; #elif defined(_SC_PAGESIZE) return (size_t)sysconf(_SC_PAGESIZE); #elif defined(_SC_PAGE_SIZE) return (size_t)sysconf(_SC_PAGE_SIZE); #else /* extern int getpagesize(); */ return getpagesize(); #endif } int initattr_ok = 0; void #ifdef __GNUC__ __attribute ((constructor)) #endif init_function(void) { initattr_ok = 1; } typedef struct { int id; int size; char *type; } DataType_T; DataType_T sIntTypes[] = { { 0, sizeof(char) , "char" } , { 1, sizeof(short int), "short int" } , { 2, sizeof(int) , "int" } , { 3, sizeof(long int) , "long int" } /* hier zusaetzliche compiler-spezifische datentypen hinzufuegen */ #ifdef _MSC_VER , { 4, sizeof(__int64), "__int64" } #endif #ifdef __GNUC__ , { 5, sizeof(long long int), "long long int" } #endif }; /* test access to each data type */ void testAlignment(int addrIdx, char * buffer, int alignment, int max_sizeof) { int offset; switch ( sIntTypes[addrIdx].id ) { case 0: #define TYPE unsigned char for(offset=0; offset < max_sizeof; ++offset) { TYPE addr = (TYPE)(buffer) + offset; if ( addr % alignment == 0 ) { *( (unsigned char *) addr ) = 0; *( (unsigned short int*) addr ) = 0; *( (unsigned int *) addr ) = 0; *( (unsigned long int *) addr ) = 0L; *( (float *) addr ) = 0.0F; *( (double *) addr ) = 0.0; *( (long double *) addr ) = 0.0; #ifdef _MSC_VER *( (unsigned __int64 *) addr ) = 0L; #endif #ifdef __GNUC__ *( (unsigned long long int *) addr ) = 0L; #endif } } break; case 1: #undef TYPE #define TYPE unsigned short int for(offset=0; offset < max_sizeof; ++offset) { TYPE addr = (TYPE)(buffer) + offset; if ( addr % alignment == 0 ) { *( (unsigned char *) addr ) = 0; *( (unsigned short int*) addr ) = 0; *( (unsigned int *) addr ) = 0; *( (unsigned long int *) addr ) = 0L; *( (float *) addr ) = 0.0F; *( (double *) addr ) = 0.0; *( (long double *) addr ) = 0.0; #ifdef _MSC_VER *( (unsigned __int64 *) addr ) = 0L; #endif #ifdef __GNUC__ *( (unsigned long long int *) addr ) = 0L; #endif } } break; case 2: #undef TYPE #define TYPE unsigned int for(offset=0; offset < max_sizeof; ++offset) { TYPE addr = (TYPE)(buffer) + offset; if ( addr % alignment == 0 ) { *( (unsigned char *) addr ) = 0; *( (unsigned short int*) addr ) = 0; *( (unsigned int *) addr ) = 0; *( (unsigned long int *) addr ) = 0L; *( (float *) addr ) = 0.0F; *( (double *) addr ) = 0.0; *( (long double *) addr ) = 0.0; #ifdef _MSC_VER *( (unsigned __int64 *) addr ) = 0L; #endif #ifdef __GNUC__ *( (unsigned long long int *) addr ) = 0L; #endif } } break; case 3: #undef TYPE #define TYPE unsigned long int for(offset=0; offset < max_sizeof; ++offset) { TYPE addr = (TYPE)(buffer) + offset; if ( addr % alignment == 0 ) { *( (unsigned char *) addr ) = 0; *( (unsigned short int*) addr ) = 0; *( (unsigned int *) addr ) = 0; *( (unsigned long int *) addr ) = 0L; *( (float *) addr ) = 0.0F; *( (double *) addr ) = 0.0; *( (long double *) addr ) = 0.0; #ifdef _MSC_VER *( (unsigned __int64 *) addr ) = 0L; #endif #ifdef __GNUC__ *( (unsigned long long int *) addr ) = 0L; #endif } } break; #ifdef _MSC_VER case 4: #undef TYPE #define TYPE unsigned __int64 for(offset=0; offset < max_sizeof; ++offset) { TYPE addr = (TYPE)(buffer) + offset; if ( addr % alignment == 0 ) { *( (unsigned char *) addr ) = 0; *( (unsigned short int*) addr ) = 0; *( (unsigned int *) addr ) = 0; *( (unsigned long int *) addr ) = 0L; *( (float *) addr ) = 0.0F; *( (double *) addr ) = 0.0; *( (long double *) addr ) = 0.0; #ifdef _MSC_VER *( (unsigned __int64 *) addr ) = 0L; #endif #ifdef __GNUC__ *( (unsigned long long int *) addr ) = 0L; #endif } } break; #endif #ifdef __GNUC__ case 5: #undef TYPE #define TYPE unsigned long long int for(offset=0; offset < max_sizeof; ++offset) { TYPE addr = (TYPE)(buffer) + offset; if ( addr % alignment == 0 ) { *( (unsigned char *) addr ) = 0; *( (unsigned short int*) addr ) = 0; *( (unsigned int *) addr ) = 0; *( (unsigned long int *) addr ) = 0L; *( (float *) addr ) = 0.0F; *( (double *) addr ) = 0.0; *( (long double *) addr ) = 0.0; #ifdef _MSC_VER *( (unsigned __int64 *) addr ) = 0L; #endif #ifdef __GNUC__ *( (unsigned long long int *) addr ) = 0L; #endif } } break; #endif ; } } void writeFile(const char * filename, unsigned long pagesize, int addrIdx, int sizeIdx, int alignment) { FILE * f = fopen(filename, "w"); if (!f) return; fprintf(f, "/*\n"); fprintf(f, " * WARNING: DO NOT CHANGE THIS FILE!\n"); fprintf(f, " * This file is automatically generated from createconf\n"); #if defined(WIN32) #if defined(_MSC_VER) fprintf(f, " * using Microsoft Visual C++ under MS Windows(TM) the %s\n", __DATE__ ); #else printf(f, " * under MS Windows(TM) the %s\n", __DATE__ ); #endif #elif ( defined(sgi) ) fprintf(f, " * under sgi the %s\n", __DATE__ ); #elif ( defined(_AIX) ) fprintf(f, " * under AIX the %s\n", __DATE__ ); #elif ( defined(__linux__) ) fprintf(f, " * under Linux the %s\n", __DATE__ ); #else fprintf(f, " * the %s \n", __DATE__ ); #endif fprintf(f, " */\n"); fprintf(f, "\n"); fprintf(f, "#ifndef _DUMA_CONFIG_H_\n"); fprintf(f, "#define _DUMA_CONFIG_H_\n"); fprintf(f, "\n"); fprintf(f, "\n"); fprintf(f, "/* Variable: DUMA_PAGE_SIZE\n"); fprintf(f, " *\n"); fprintf(f, " * Number of bytes per virtual-memory page, as returned by Page_Size().\n"); fprintf(f, " */\n"); fprintf(f, "#define DUMA_PAGE_SIZE %lu\n", pagesize); fprintf(f, "\n"); fprintf(f, "/* Variable: DUMA_MIN_ALIGNMENT\n"); fprintf(f, " *\n"); fprintf(f, " * Minimum required alignment by CPU.\n"); fprintf(f, " */\n"); fprintf(f, "#define DUMA_MIN_ALIGNMENT %d\n", alignment); fprintf(f, "\n"); fprintf(f, "/* Variable: DUMA_GNU_INIT_ATTR\n"); fprintf(f, " *\n"); fprintf(f, " * Build environment supports the '__attribute ((constructor))'?\n"); fprintf(f, " */\n"); if (initattr_ok) fprintf(f, "#define DUMA_GNU_INIT_ATTR 1\n"); else fprintf(f, "/* #define DUMA_GNU_INIT_ATTR 0 */\n"); fprintf(f, "\n"); fprintf(f, "/* Type: DUMA_ADDR\n"); fprintf(f, " *\n"); fprintf(f, " * An integer type with same size as 'void *'\n"); fprintf(f, " */\n"); if (addrIdx >= 0) fprintf(f, "typedef unsigned %s DUMA_ADDR;\n", sIntTypes[addrIdx].type); else fprintf(f, "/* Error: No datatype for DUMA_ADDR found! */\n"); fprintf(f, "\n"); fprintf(f, "/* Type: DUMA_SIZE\n"); fprintf(f, " *\n"); fprintf(f, " * An integer type with same size as 'size_t'\n"); fprintf(f, " */\n"); if (sizeIdx >= 0) fprintf(f, "typedef unsigned %s DUMA_SIZE;\n", sIntTypes[sizeIdx].type); else fprintf(f, "/* No datatype for DUMA_SIZE found! */\n"); fprintf(f, "\n"); fprintf(f, "#endif /* _DUMA_CONFIG_H_ */\n"); fclose(f); } int main() { int iNumIntTypes, iIt; int addrIdx, sizeIdx; int alignment, max_sizeof; char buffer[1024]; char filename[1024]; unsigned long pagesize = Page_Size(); iNumIntTypes = sizeof( sIntTypes ) / sizeof( sIntTypes[0] ); // detect compatible type for ADDRESS addrIdx = -1; for (iIt = 0; iIt < iNumIntTypes; ++iIt) { if ( sizeof(void*) == sIntTypes[iIt].size ) { addrIdx = iIt; break; } } // detect compatible type for SIZE_T sizeIdx = -1; for (iIt = 0; iIt < iNumIntTypes; ++iIt) { if ( sizeof(size_t) == sIntTypes[iIt].size ) { sizeIdx = iIt; break; } } /* detect maximum data type, which should be maximum alignment */ max_sizeof = 0; for (iIt = 0; iIt < iNumIntTypes; ++iIt) { if ( max_sizeof < sIntTypes[iIt].size ) max_sizeof = sIntTypes[iIt].size; } if ( max_sizeof < sizeof(float) ) max_sizeof = sizeof(float); if ( max_sizeof < sizeof(double) ) max_sizeof = sizeof(double); if ( max_sizeof < sizeof(long double) ) max_sizeof = sizeof(long double); #ifdef _MSC_VER { /* fix output path when started form Visual C++ IDE */ char directory[1024]; char * start; _getcwd( directory, 1024 ); /* get current directory */ if ( ( start = strstr( directory, "win32-msvc" ) ) ) { *start = 0; strcpy(filename, directory); strcat(filename, "duma_config.h"); } else strcpy( filename, "duma_config.h" ); } #else strcpy( filename, "duma_config.h" ); #endif /* detect minimum alignment */ alignment = max_sizeof; do { /* do the alignment access tests */ testAlignment(addrIdx, buffer, alignment, max_sizeof); /* write whole config file. next test may crash ! */ writeFile(filename, pagesize, addrIdx, sizeIdx, alignment); /* try next lower alignment */ alignment >>= 1; } while ( alignment > 0 ); return 0; } duma-VERSION_2_5_21/kduma/docs-data/000077500000000000000000000000001401225056000170315ustar00rootroot00000000000000duma-VERSION_2_5_21/kduma/docs-data/Data/000077500000000000000000000000001401225056000177025ustar00rootroot00000000000000duma-VERSION_2_5_21/kduma/docs-data/Data/ClassHierarchy.nd000066400000000000000000000000661401225056000231330ustar00rootroot00000000000000# _DUMA_SlotC:\projects\duma\kduma\kduma.cduma-VERSION_2_5_21/kduma/docs-data/Data/ConfigFileInfo.nd000066400000000000000000000000271401225056000230450ustar00rootroot00000000000000#EXÁEX«EX«EX«EX«duma-VERSION_2_5_21/kduma/docs-data/Data/FileInfo.nd000066400000000000000000000010311401225056000217130ustar00rootroot000000000000001.35 C/C++ C:\projects\duma\kduma\paging.h 1163402083 1 C:\projects\duma\kduma\paging.h C:\projects\duma\kduma\kduma.c 1163402083 1 C:\projects\duma\kduma\kduma.c C:\projects\duma\kduma\README.txt 1163403257 1 00README C:\projects\duma\kduma\log.h 1163403163 1 C:\projects\duma\kduma\log.h C:\projects\duma\kduma\kduma.h 1163403091 1 C:\projects\duma\kduma\kduma.h C:\projects\duma\kduma\createconf.c 1163402258 0 C:\projects\duma\kduma\createconf.c C:\projects\duma\kduma\duma_config.h 1163402179 1 C:\projects\duma\kduma\duma_config.h duma-VERSION_2_5_21/kduma/docs-data/Data/PreviousMenuState.nd000066400000000000000000000006131401225056000236670ustar00rootroot00000000000000#00README!C:\projects\duma\kduma\README.txt duma_config.h$C:\projects\duma\kduma\duma_config.hkduma.cC:\projects\duma\kduma\kduma.ckduma.hC:\projects\duma\kduma\kduma.hlog.hC:\projects\duma\kduma\log.hpaging.hC:\projects\duma\kduma\paging.hIndex EverythinggeneralClassesclassFilesfile FunctionsfunctionTypestype Variablesvariableduma-VERSION_2_5_21/kduma/docs-data/Data/PreviousSettings.nd000066400000000000000000000001101401225056000235520ustar00rootroot00000000000000#C:\projects\duma\kduma1C:\projects\duma\kduma\docsHTMLduma-VERSION_2_5_21/kduma/docs-data/Data/SymbolTable.nd000066400000000000000000000221511401225056000224430ustar00rootroot00000000000000# _DUMA_Slot VariablesC:\projects\duma\kduma\kduma.cgroup _DUMA_SlotDUMA_PROTECT_FREEC:\projects\duma\kduma\kduma.cvariablestatic long DUMA_PROTECT_FREE^DUMA_PROTECT_FREE is used to control the disposition of memory that is released using free().  _DUMA_Slot_duma_allocListC:\projects\duma\kduma\kduma.cvariable#struct _DUMA_Slot * _duma_allocListW_DUMA_allocList points to the array of slot structures used to manage the malloc arena.MEMORY_CREATION_SIZEC:\projects\duma\kduma\kduma.cvariable[MEMORY_CREATION_SIZE is the amount of memory to get from the operating system at one time. _DUMA_InitStateC:\projects\duma\kduma\kduma.ctypeWhats are initialization start EnumerationsC:\projects\duma\kduma\kduma.cgroupC:\projects\duma\kduma\kduma.hgroup _DUMA_SlotDUMA_FREE_ACCESSC:\projects\duma\kduma\kduma.cvariablestatic int DUMA_FREE_ACCESSMDUMA_FREE_ACCESS is set if DUMA is to write access memory before freeing it. _DUMA_MemRegionC:\projects\duma\kduma\kduma.ctypeMemory region of slot.  _DUMA_SlotC:\projects\duma\kduma\kduma.cclasshStruct Slot contains all of the information about a malloc buffer except for the contents of its memory. _DUMA_SlotDUMA_ALIGNMENTC:\projects\duma\kduma\kduma.cvariablesize_t DUMA_ALIGNMENT„DUMA_ALIGNMENT is a global variable used to control the default alignment of buffers returned by malloc(), calloc(), and realloc(). ilog2C:\projects\duma\kduma\log.hfunction static inline int ilog2(int val)Base 2 log computation.  Page_SizeC:\projects\duma\kduma\paging.hfunctionstatic size_t Page_Size(void)Retrieve page size.noneC:\projects\duma\kduma\log.hvariable(Fake variable to make docs work right :( _DUMA_SlotDUMA_PROTECT_BELOWC:\projects\duma\kduma\kduma.cvariableint DUMA_PROTECT_BELOWDDUMA_PROTECT_BELOW is used to modify the behavior of the allocator.  _DUMA_SlotDUMA_MALLOC_FAILEXITC:\projects\duma\kduma\kduma.cvariablestatic int DUMA_MALLOC_FAILEXIT_DUMA_MALLOC_FAILEXIT controls the behaviour of DUMA when malloc() fails and would return NULL.  _DUMA_SlotDUMA_SHOW_ALLOCC:\projects\duma\kduma\kduma.cvariablestatic int DUMA_SHOW_ALLOC]DUMA_SHOW_ALLOC is set if DUMA is to print all allocations and deallocations to the console. kdumacC:\projects\duma\kduma\kduma.cfile Page_CreateC:\projects\duma\kduma\paging.hfunctionQstatic void * Page_Create(size_t size, int exitonfail, int printerror, int flags)Create memory. paginghC:\projects\duma\kduma\paging.hfileversionC:\projects\duma\kduma\kduma.cvariablestatic const char version[]KDUMA version string _DUMA_Slot numAllocsC:\projects\duma\kduma\kduma.cvariablestatic long numAllocs9internal variable: number of allocations processed so far duma_configh$C:\projects\duma\kduma\duma_config.hfile _DUMA_SlotDUMA_MAX_ALLOCC:\projects\duma\kduma\kduma.cvariablestatic long DUMA_MAX_ALLOCÈDUMA_MAX_ALLOC is used to control the maximum memory print of the program in total: When the sum of allocated and protected memory would exceed this value in kB, the protected memory is freed/deleted. _DUMA_Slot duma_initC:\projects\duma\kduma\kduma.cfunctionvoid duma_init(void)'duma_init sets configuration settings.  _DUMA_SlotDUMA_ALLOW_MALLOC_0C:\projects\duma\kduma\kduma.cvariablestatic int DUMA_ALLOW_MALLOC_0:DUMA_ALLOW_MALLOC_0 is set if DUMA is to allow malloc(0).  _DUMA_Slot slotsPerPageC:\projects\duma\kduma\kduma.cvariablestatic size_t slotsPerPagePslotsPerPage is the number of slot structures that fit in a virtual memory page. _DUMA_Slot _duma_kmallocC:\projects\duma\kduma\kduma.cfunction>void * _duma_kmalloc(size_t size, int flags DUMA_PARAMLIST_FL)A version of kmalloc.kdumahC:\projects\duma\kduma\kduma.hfile _DUMA_Slot _duma_assertC:\projects\duma\kduma\kduma.cfunctionJvoid _duma_assert(const char * exprstr, const char * filename, int lineno)6Print message and halt program execution in crazy way.Types$C:\projects\duma\kduma\duma_config.hgroup _DUMA_SlotDUMA_SLACKFILLC:\projects\duma\kduma\kduma.cvariablestatic int DUMA_SLACKFILL DUMA_SLACKFILL is set to 0-255. _DUMA_AllocatorC:\projects\duma\kduma\kduma.htype;Passed to duma allocator such as we know who is calling us. Page_DeleteC:\projects\duma\kduma\paging.hfunction4static void Page_Delete(void * address, size_t size)Free's DUMA allocated memory.  VariablesC:\projects\duma\kduma\kduma.cgroupC:\projects\duma\kduma\log.hgroup$C:\projects\duma\kduma\duma_config.hgroup00README!C:\projects\duma\kduma\README.txtsection3This is the begining of a linux kernel model duma.  DUMA_SIZE$C:\projects\duma\kduma\duma_config.htype*An integer type with same size as 'size_t'loghC:\projects\duma\kduma\log.hfile _DUMA_Slot numDeallocsC:\projects\duma\kduma\kduma.cvariablestatic long numDeallocs;internal variable: number of deallocations processed so farDUMA_PAGE_SIZE$C:\projects\duma\kduma\duma_config.hvariableDNumber of bytes per virtual-memory page, as returned by Page_Size().DUMA_MIN_ALIGNMENT$C:\projects\duma\kduma\duma_config.hvariable"Minimum required alignment by CPU. _DUMA_Slot_duma_allocateC:\projects\duma\kduma\kduma.cfunction¼void * _duma_allocate(size_t alignment, size_t userSize, int protectBelow, int fillByte, int protectAllocList, enum _DUMA_Allocator allocator, enum _DUMA_FailReturn fail DUMA_PARAMLIST_FL)This is the memory allocator. _DUMA_SlotStateC:\projects\duma\kduma\kduma.ctype'State of slot values (empty, free, etc) DUMA_ADDR$C:\projects\duma\kduma\duma_config.htype*An integer type with same size as 'void *' _DUMA_Slotduma_init_doneC:\projects\duma\kduma\kduma.cvariable*internal variable: state of initialization _DUMA_Slot FunctionsC:\projects\duma\kduma\kduma.cgroup _DUMA_SlotallocateMoreSlotsC:\projects\duma\kduma\kduma.cfunction#static void allocateMoreSlots(void)€allocateMoreSlots is called when there are only enough slot structures left to support the allocation of a single malloc buffer.Page_AllowAccessC:\projects\duma\kduma\paging.hfunction2void Page_AllowAccess(void * address, size_t size)(Allow memory access to allocated memory.Page_DenyAccessC:\projects\duma\kduma\paging.hfunction8static void Page_DenyAccess(void * address, size_t size)'Deny access to allocated memory region. _DUMA_SlotsumProtectedMemC:\projects\duma\kduma\kduma.cvariablestatic long sumProtectedMem0internal variable: sum of protected memory in kB _DUMA_Slot_duma_allocListSizeC:\projects\duma\kduma\kduma.cvariable!static size_t _duma_allocListSize8_duma_allocListSize is the size of the allocation list. mprotectFailedC:\projects\duma\kduma\paging.hfunction static void mprotectFailed(void)JReport that VirtualProtect or mprotect failed and abort program execution. _DUMA_Slot DUMA_FILLC:\projects\duma\kduma\kduma.cvariable int DUMA_FILLaDUMA_FILL is set to 0-255 if DUMA should fill all new allocated memory with the specified value.  _DUMA_Slot_duma_deallocateC:\projects\duma\kduma\kduma.cfunctionmvoid _duma_deallocate(void * address, int protectAllocList, enum _DUMA_Allocator allocator DUMA_PARAMLIST_FL)ODeallocate allocated memory after running some checks, then open slot for use. _DUMA_FailReturnC:\projects\duma\kduma\kduma.htype Unknown use. _DUMA_SlotsumAllocatedMemC:\projects\duma\kduma\kduma.cvariablestatic long sumAllocatedMemBinternal variable: sum of allocated -freed +protected memory in kB_DUMA_Slot_FileSourceC:\projects\duma\kduma\kduma.ctypeWhere did we get file info FunctionsC:\projects\duma\kduma\paging.hgroupC:\projects\duma\kduma\log.hgroup _DUMA_SlotsumTotalAllocatedMemC:\projects\duma\kduma\kduma.cvariable static long sumTotalAllocatedMem0internal variable: sum of allocated memory in kB _DUMA_Slot _duma_initC:\projects\duma\kduma\kduma.cfunctionvoid _duma_init(void)[_duma_init sets up the memory allocation arena and the run-time configuration information.  _DUMA_Slot slotCountC:\projects\duma\kduma\kduma.cvariablestatic size_t slotCount=slotCount is the number of Slot structures in allocationList. _DUMA_Slot unUsedSlotsC:\projects\duma\kduma\kduma.cvariablestatic size_t unUsedSlotskunUsedSlots is the number of Slot structures that are currently available to represent new malloc buffers. Page_DenyAccessC:\projects\duma\kduma\paging.h Page_CreateC:\projects\duma\kduma\paging.h Page_DeleteC:\projects\duma\kduma\paging.h Page_Delete _DUMA_SlotC:\projects\duma\kduma\kduma.c _duma_init _DUMA_SlotC:\projects\duma\kduma\kduma.c_duma_allocate _DUMA_SlotC:\projects\duma\kduma\kduma.cPage_AllowAccessC:\projects\duma\kduma\paging.h duma_init _DUMA_SlotC:\projects\duma\kduma\kduma.c_duma_deallocate _DUMA_SlotC:\projects\duma\kduma\kduma.cduma-VERSION_2_5_21/kduma/docs-data/Languages.txt000066400000000000000000000115011401225056000214760ustar00rootroot00000000000000Format: 1.35 # This is the Natural Docs languages file for this project. If you change # anything here, it will apply to THIS PROJECT ONLY. If you'd like to change # something for all your projects, edit the Languages.txt in Natural Docs' # Config directory instead. # You can prevent certain file extensions from being scanned like this: # Ignore Extensions: [extension] [extension] ... #------------------------------------------------------------------------------- # SYNTAX: # # Unlike other Natural Docs configuration files, in this file all comments # MUST be alone on a line. Some languages deal with the # character, so you # cannot put comments on the same line as content. # # Also, all lists are separated with spaces, not commas, again because some # languages may need to use them. # # Language: [name] # Alter Language: [name] # Defines a new language or alters an existing one. Its name can use any # characters. If any of the properties below have an add/replace form, you # must use that when using Alter Language. # # The language Shebang Script is special. It's entry is only used for # extensions, and files with those extensions have their shebang (#!) lines # read to determine the real language of the file. Extensionless files are # always treated this way. # # The language Text File is also special. It's treated as one big comment # so you can put Natural Docs content in them without special symbols. Also, # if you don't specify a package separator, ignored prefixes, or enum value # behavior, it will copy those settings from the language that is used most # in the source tree. # # Extensions: [extension] [extension] ... # [Add/Replace] Extensions: [extension] [extension] ... # Defines the file extensions of the language's source files. You can # redefine extensions found in the main languages file. You can use * to # mean any undefined extension. # # Shebang Strings: [string] [string] ... # [Add/Replace] Shebang Strings: [string] [string] ... # Defines a list of strings that can appear in the shebang (#!) line to # designate that it's part of the language. You can redefine strings found # in the main languages file. # # Ignore Prefixes in Index: [prefix] [prefix] ... # [Add/Replace] Ignored Prefixes in Index: [prefix] [prefix] ... # # Ignore [Topic Type] Prefixes in Index: [prefix] [prefix] ... # [Add/Replace] Ignored [Topic Type] Prefixes in Index: [prefix] [prefix] ... # Specifies prefixes that should be ignored when sorting symbols in an # index. Can be specified in general or for a specific topic type. # #------------------------------------------------------------------------------ # For basic language support only: # # Line Comments: [symbol] [symbol] ... # Defines a space-separated list of symbols that are used for line comments, # if any. # # Block Comments: [opening sym] [closing sym] [opening sym] [closing sym] ... # Defines a space-separated list of symbol pairs that are used for block # comments, if any. # # Package Separator: [symbol] # Defines the default package separator symbol. The default is a dot. # # [Topic Type] Prototype Enders: [symbol] [symbol] ... # When defined, Natural Docs will attempt to get a prototype from the code # immediately following the topic type. It stops when it reaches one of # these symbols. Use \n for line breaks. # # Line Extender: [symbol] # Defines the symbol that allows a prototype to span multiple lines if # normally a line break would end it. # # Enum Values: [global|under type|under parent] # Defines how enum values are referenced. The default is global. # global - Values are always global, referenced as 'value'. # under type - Values are under the enum type, referenced as # 'package.enum.value'. # under parent - Values are under the enum's parent, referenced as # 'package.value'. # # Perl Package: [perl package] # Specifies the Perl package used to fine-tune the language behavior in ways # too complex to do in this file. # #------------------------------------------------------------------------------ # For full language support only: # # Full Language Support: [perl package] # Specifies the Perl package that has the parsing routines necessary for full # language support. # #------------------------------------------------------------------------------- # The following languages are defined in the main file, if you'd like to alter # them: # # Text File, Shebang Script, C/C++, C#, Java, JavaScript, Perl, Python, # PHP, SQL, Visual Basic, Pascal, Assembly, Ada, Tcl, Ruby, Makefile, # ActionScript, ColdFusion, R, Fortran # If you add a language that you think would be useful to other developers # and should be included in Natural Docs by default, please e-mail it to # languages [at] naturaldocs [dot] org. duma-VERSION_2_5_21/kduma/docs-data/Menu.txt000066400000000000000000000027241401225056000205030ustar00rootroot00000000000000Format: 1.35 # You can add a title and sub-title to your menu like this: # Title: [project name] # SubTitle: [subtitle] # You can add a footer to your documentation like this: # Footer: [text] # If you want to add a copyright notice, this would be the place to do it. # -------------------------------------------------------------------------- # # Cut and paste the lines below to change the order in which your files # appear on the menu. Don't worry about adding or removing files, Natural # Docs will take care of that. # # You can further organize the menu by grouping the entries. Add a # "Group: [name] {" line to start a group, and add a "}" to end it. # # You can add text and web links to the menu by adding "Text: [text]" and # "Link: [name] ([URL])" lines, respectively. # # The formatting and comments are auto-generated, so don't worry about # neatness when editing the file. Natural Docs will clean it up the next # time it is run. When working with groups, just deal with the braces and # forget about the indentation and comments. # # -------------------------------------------------------------------------- File: 00README (README.txt) File: duma_config.h (duma_config.h) File: kduma.c (kduma.c) File: kduma.h (kduma.h) File: log.h (log.h) File: paging.h (paging.h) Group: Index { Index: Everything Class Index: Classes File Index: Files Function Index: Functions Type Index: Types Variable Index: Variables } # Group: Index duma-VERSION_2_5_21/kduma/docs-data/Topics.txt000066400000000000000000000062341401225056000210400ustar00rootroot00000000000000Format: 1.35 # This is the Natural Docs topics file for this project. If you change anything # here, it will apply to THIS PROJECT ONLY. If you'd like to change something # for all your projects, edit the Topics.txt in Natural Docs' Config directory # instead. # If you'd like to prevent keywords from being recognized by Natural Docs, you # can do it like this: # Ignore Keywords: [keyword], [keyword], ... # # Or you can use the list syntax like how they are defined: # Ignore Keywords: # [keyword] # [keyword], [plural keyword] # ... #------------------------------------------------------------------------------- # SYNTAX: # # Topic Type: [name] # Alter Topic Type: [name] # Creates a new topic type or alters one from the main file. Each type gets # its own index and behavior settings. Its name can have letters, numbers, # spaces, and these charaters: - / . ' # # Plural: [name] # Sets the plural name of the topic type, if different. # # Keywords: # [keyword] # [keyword], [plural keyword] # ... # Defines or adds to the list of keywords for the topic type. They may only # contain letters, numbers, and spaces and are not case sensitive. Plural # keywords are used for list topics. You can redefine keywords found in the # main topics file. # # Index: [yes|no] # Whether the topics get their own index. Defaults to yes. Everything is # included in the general index regardless of this setting. # # Scope: [normal|start|end|always global] # How the topics affects scope. Defaults to normal. # normal - Topics stay within the current scope. # start - Topics start a new scope for all the topics beneath it, # like class topics. # end - Topics reset the scope back to global for all the topics # beneath it. # always global - Topics are defined as global, but do not change the scope # for any other topics. # # Class Hierarchy: [yes|no] # Whether the topics are part of the class hierarchy. Defaults to no. # # Variable Type: [yes|no] # Whether the topics can be a variable type. Defaults to no. # # Page Title If First: [yes|no] # Whether the topic's title becomes the page title if it's the first one in # a file. Defaults to no. # # Break Lists: [yes|no] # Whether list topics should be broken into individual topics in the output. # Defaults to no. # # Can Group With: [type], [type], ... # Defines a list of topic types that this one can possibly be grouped with. # Defaults to none. #------------------------------------------------------------------------------- # The following topics are defined in the main file, if you'd like to alter # their behavior or add keywords: # # Generic, Class, Interface, Section, File, Group, Function, Variable, # Property, Type, Constant, Enumeration, Event, Delegate, Macro, # Database, Database Table, Database View, Database Index, Database # Cursor, Database Trigger, Cookie, Build Target # If you add something that you think would be useful to other developers # and should be included in Natural Docs by default, please e-mail it to # topics [at] naturaldocs [dot] org. duma-VERSION_2_5_21/kduma/docs/000077500000000000000000000000001401225056000161225ustar00rootroot00000000000000duma-VERSION_2_5_21/kduma/docs/files/000077500000000000000000000000001401225056000172245ustar00rootroot00000000000000duma-VERSION_2_5_21/kduma/docs/files/README-txt.html000066400000000000000000000122401401225056000216630ustar00rootroot00000000000000 00README

00README

This is the begining of a linux kernel model duma.  Same idea as user space duma, replace kmalloc and friends instead.

This effort is being drivin by

duma-VERSION_2_5_21/kduma/docs/files/duma_config-h.html000066400000000000000000000262201401225056000226140ustar00rootroot00000000000000 C:\projects\duma\kduma\duma_config.h

duma_config.h

Summary
Number of bytes per virtual-memory page, as returned by Page_Size().
Minimum required alignment by CPU.
An integer type with same size as ‘void *’
An integer type with same size as ‘size_t’

Variables

DUMA_PAGE_SIZE

Number of bytes per virtual-memory page, as returned by Page_Size().

DUMA_MIN_ALIGNMENT

Minimum required alignment by CPU.

Types

DUMA_ADDR

An integer type with same size as ‘void *’

DUMA_SIZE

An integer type with same size as ‘size_t’

duma-VERSION_2_5_21/kduma/docs/files/kduma-c.html000066400000000000000000004307771401225056000214550ustar00rootroot00000000000000 C:\projects\duma\kduma\kduma.c

kduma.c

Summary
KDUMA version string
MEMORY_CREATION_SIZE is the amount of memory to get from the operating system at one time.
State of slot values (empty, free, etc)
Where did we get file info
Whats are initialization start
Memory region of slot.
Struct Slot contains all of the information about a malloc buffer except for the contents of its memory.
DUMA_ALIGNMENT is a global variable used to control the default alignment of buffers returned by malloc(), calloc(), and realloc().
DUMA_PROTECT_BELOW is used to modify the behavior of the allocator.
DUMA_FILL is set to 0-255 if DUMA should fill all new allocated memory with the specified value.
DUMA_SLACKFILL is set to 0-255.
DUMA_PROTECT_FREE is used to control the disposition of memory that is released using free().
DUMA_MAX_ALLOC is used to control the maximum memory print of the program in total: When the sum of allocated and protected memory would exceed this value in kB, the protected memory is freed/deleted.
DUMA_ALLOW_MALLOC_0 is set if DUMA is to allow malloc(0).
DUMA_MALLOC_FAILEXIT controls the behaviour of DUMA when malloc() fails and would return NULL.
DUMA_FREE_ACCESS is set if DUMA is to write access memory before freeing it.
DUMA_SHOW_ALLOC is set if DUMA is to print all allocations and deallocations to the console.
_DUMA_allocList points to the array of slot structures used to manage the malloc arena.
_duma_allocListSize is the size of the allocation list.
slotCount is the number of Slot structures in allocationList.
unUsedSlots is the number of Slot structures that are currently available to represent new malloc buffers.
slotsPerPage is the number of slot structures that fit in a virtual memory page.
internal variable: sum of allocated -freed +protected memory in kB
internal variable: sum of allocated memory in kB
internal variable: sum of protected memory in kB
internal variable: number of deallocations processed so far
internal variable: number of allocations processed so far
internal variable: state of initialization
Print message and halt program execution in crazy way.
duma_init sets configuration settings.
_duma_init sets up the memory allocation arena and the run-time configuration information.
allocateMoreSlots is called when there are only enough slot structures left to support the allocation of a single malloc buffer.
This is the memory allocator.
Deallocate allocated memory after running some checks, then open slot for use.
A version of kmalloc.

Variables

version

static const char version[]

KDUMA version string

MEMORY_CREATION_SIZE

MEMORY_CREATION_SIZE is the amount of memory to get from the operating system at one time.  We’ll break that memory down into smaller pieces for malloc buffers.  One megabyte is probably a good value.

Enumerations

_DUMA_SlotState

State of slot values (empty, free, etc)

_DUMA_Slot_FileSource

Where did we get file info

_DUMA_InitState

Whats are initialization start

_DUMA_MemRegion

Memory region of slot.  Really we should only hang onto NORMAL memory.  DMA should be released fast.

_DUMA_Slot

Struct Slot contains all of the information about a malloc buffer except for the contents of its memory.

Summary
DUMA_ALIGNMENT is a global variable used to control the default alignment of buffers returned by malloc(), calloc(), and realloc().
DUMA_PROTECT_BELOW is used to modify the behavior of the allocator.
DUMA_FILL is set to 0-255 if DUMA should fill all new allocated memory with the specified value.
DUMA_SLACKFILL is set to 0-255.
DUMA_PROTECT_FREE is used to control the disposition of memory that is released using free().
DUMA_MAX_ALLOC is used to control the maximum memory print of the program in total: When the sum of allocated and protected memory would exceed this value in kB, the protected memory is freed/deleted.
DUMA_ALLOW_MALLOC_0 is set if DUMA is to allow malloc(0).
DUMA_MALLOC_FAILEXIT controls the behaviour of DUMA when malloc() fails and would return NULL.
DUMA_FREE_ACCESS is set if DUMA is to write access memory before freeing it.
DUMA_SHOW_ALLOC is set if DUMA is to print all allocations and deallocations to the console.
_DUMA_allocList points to the array of slot structures used to manage the malloc arena.
_duma_allocListSize is the size of the allocation list.
slotCount is the number of Slot structures in allocationList.
unUsedSlots is the number of Slot structures that are currently available to represent new malloc buffers.
slotsPerPage is the number of slot structures that fit in a virtual memory page.
internal variable: sum of allocated -freed +protected memory in kB
internal variable: sum of allocated memory in kB
internal variable: sum of protected memory in kB
internal variable: number of deallocations processed so far
internal variable: number of allocations processed so far
internal variable: state of initialization
Print message and halt program execution in crazy way.
duma_init sets configuration settings.
_duma_init sets up the memory allocation arena and the run-time configuration information.
allocateMoreSlots is called when there are only enough slot structures left to support the allocation of a single malloc buffer.
This is the memory allocator.
Deallocate allocated memory after running some checks, then open slot for use.
A version of kmalloc.

Variables

DUMA_ALIGNMENT

size_t DUMA_ALIGNMENT

DUMA_ALIGNMENT is a global variable used to control the default alignment of buffers returned by malloc(), calloc(), and realloc().  It is all-caps so that its name matches the name of the environment variable that is used to set it.  This gives the programmer one less name to remember.

DUMA_PROTECT_BELOW

int DUMA_PROTECT_BELOW

DUMA_PROTECT_BELOW is used to modify the behavior of the allocator.  When its value is non-zero, the allocator will place an inaccessable page immediately before the malloc buffer in the address space, instead of after it.  Use this to detect malloc buffer under-runs, rather than over-runs.  It won’t detect both at the same time, so you should test your software twice, once with this value clear, and once with it set.

DUMA_FILL

int DUMA_FILL

DUMA_FILL is set to 0-255 if DUMA should fill all new allocated memory with the specified value.  Set to -1 when DUMA should not initialise allocated memory. default is set to initialise with 255, cause many programs rely on initialisation to 0!

DUMA_SLACKFILL

static int DUMA_SLACKFILL

DUMA_SLACKFILL is set to 0-255.  The slack / no mans land of all new allocated memory is filled with the specified value. default is set to initialise with 0xAA (=binary 10101010) initialisation to 0!

DUMA_PROTECT_FREE

static long DUMA_PROTECT_FREE

DUMA_PROTECT_FREE is used to control the disposition of memory that is released using free().  It is all-caps so that its name matches the name of the environment variable that is used to set it.  If its value is non-zero, memory released by free is made inaccessable.  Any software that touches free memory will then get a segmentation fault.  Depending on your application and your resources you may tell DUMA not to use this memory ever again by setting a negative value f.e.  -1.  You can tell DUMA to limit the sum of protected memory by setting a positive value, which is interpreted in kB.  If its value is zero, freed memory will be available for reallocation, but will still be inaccessable until it is reallocated.

DUMA_MAX_ALLOC

static long DUMA_MAX_ALLOC

DUMA_MAX_ALLOC is used to control the maximum memory print of the program in total: When the sum of allocated and protected memory would exceed this value in kB, the protected memory is freed/deleted.

DUMA_ALLOW_MALLOC_0

static int DUMA_ALLOW_MALLOC_0

DUMA_ALLOW_MALLOC_0 is set if DUMA is to allow malloc(0).  I trap malloc(0) by default because it is a common source of bugs.  But you should know the allocation with size 0 is ANSI conform.

DUMA_MALLOC_FAILEXIT

static int DUMA_MALLOC_FAILEXIT

DUMA_MALLOC_FAILEXIT controls the behaviour of DUMA when malloc() fails and would return NULL.  But most applications don’t check the return value for errors ... so default to Exit on Fail

DUMA_FREE_ACCESS

static int DUMA_FREE_ACCESS

DUMA_FREE_ACCESS is set if DUMA is to write access memory before freeing it.  This makes easier using watch expressions in debuggers as the process is interrupted even if the memory is going to be freed.

DUMA_SHOW_ALLOC

static int DUMA_SHOW_ALLOC

DUMA_SHOW_ALLOC is set if DUMA is to print all allocations and deallocations to the console.  Although this generates a lot of messages, the option can be useful to detect inefficient code containing many allocations / deallocations

_duma_allocList

struct _DUMA_Slot * _duma_allocList

_DUMA_allocList points to the array of slot structures used to manage the malloc arena.

_duma_allocListSize

static size_t _duma_allocListSize

_duma_allocListSize is the size of the allocation list.  This will always be a multiple of the page size.

slotCount

static size_t slotCount

slotCount is the number of Slot structures in allocationList.

unUsedSlots

static size_t unUsedSlots

unUsedSlots is the number of Slot structures that are currently available to represent new malloc buffers.  When this number gets too low, we will create new slots.

slotsPerPage

static size_t slotsPerPage

slotsPerPage is the number of slot structures that fit in a virtual memory page.

sumAllocatedMem

static long sumAllocatedMem

internal variable: sum of allocated -freed +protected memory in kB

sumTotalAllocatedMem

static long sumTotalAllocatedMem

internal variable: sum of allocated memory in kB

sumProtectedMem

static long sumProtectedMem

internal variable: sum of protected memory in kB

numDeallocs

static long numDeallocs

internal variable: number of deallocations processed so far

numAllocs

static long numAllocs

internal variable: number of allocations processed so far

duma_init_done

internal variable: state of initialization

Functions

_duma_assert

void _duma_assert( const  char  * exprstr,
const  char  * filename,
int  lineno )

Print message and halt program execution in crazy way.

duma_init

void duma_init( void )

duma_init sets configuration settings.  Can sometimes cause problems when called from _duma_init.

See Also: _duma_init

_duma_init

void _duma_init( void )

_duma_init sets up the memory allocation arena and the run-time configuration information.  We will call duma_init unless DUMA_EXPLICIT_INIT is defined at compile time.

See Also: duma_init

allocateMoreSlots

static void allocateMoreSlots( void )

allocateMoreSlots is called when there are only enough slot structures left to support the allocation of a single malloc buffer.

See Also: _duma_allocate

_duma_allocate

void * _duma_allocate( size_t  alignment,
size_t  userSize,
int  protectBelow,
int  fillByte,
int  protectAllocList,
enum  _DUMA_Allocator  allocator,
enum _DUMA_FailReturn  fail  DUMA_PARAMLIST_FL )

This is the memory allocator.  When asked to allocate a buffer, allocate it in such a way that the end of the buffer is followed by an inaccessable memory page.  If software overruns that buffer, it will touch the bad page and get an immediate segmentation fault.  It’s then easy to zero in on the offending code with a debugger.

There are a few complications.  If the user asks for an odd-sized buffer, we would have to have that buffer start on an odd address if the byte after the end of the buffer was to be on the inaccessable page.  Unfortunately, there is lots of software that asks for odd-sized buffers and then requires that the returned address be word-aligned, or the size of the buffer be a multiple of the word size.  An example are the string-processing functions on Sun systems, which do word references to the string memory and may refer to memory up to three bytes beyond the end of the string.  For this reason, I take the alignment requests to memalign() and valloc() seriously, and

DUMA wastes lots of memory.

See Also: _duma_deallocate

_duma_deallocate

void _duma_deallocate( void  * address,
int  protectAllocList,
enum _DUMA_Allocator  allocator  DUMA_PARAMLIST_FL )

Deallocate allocated memory after running some checks, then open slot for use.  Uses Page_Delete to free the underlying memory.

See Also: Page_Delete _duma_allocate

_duma_kmalloc

void * _duma_kmalloc( size_t  size,
int  flags  DUMA_PARAMLIST_FL )

A version of kmalloc.

static const char version[]
KDUMA version string
size_t DUMA_ALIGNMENT
DUMA_ALIGNMENT is a global variable used to control the default alignment of buffers returned by malloc(), calloc(), and realloc().
int DUMA_PROTECT_BELOW
DUMA_PROTECT_BELOW is used to modify the behavior of the allocator.
int DUMA_FILL
DUMA_FILL is set to 0-255 if DUMA should fill all new allocated memory with the specified value.
static int DUMA_SLACKFILL
DUMA_SLACKFILL is set to 0-255.
static long DUMA_PROTECT_FREE
DUMA_PROTECT_FREE is used to control the disposition of memory that is released using free().
static long DUMA_MAX_ALLOC
DUMA_MAX_ALLOC is used to control the maximum memory print of the program in total: When the sum of allocated and protected memory would exceed this value in kB, the protected memory is freed/deleted.
static int DUMA_ALLOW_MALLOC_0
DUMA_ALLOW_MALLOC_0 is set if DUMA is to allow malloc(0).
static int DUMA_MALLOC_FAILEXIT
DUMA_MALLOC_FAILEXIT controls the behaviour of DUMA when malloc() fails and would return NULL.
static int DUMA_FREE_ACCESS
DUMA_FREE_ACCESS is set if DUMA is to write access memory before freeing it.
static int DUMA_SHOW_ALLOC
DUMA_SHOW_ALLOC is set if DUMA is to print all allocations and deallocations to the console.
struct _DUMA_Slot * _duma_allocList
_DUMA_allocList points to the array of slot structures used to manage the malloc arena.
static size_t _duma_allocListSize
_duma_allocListSize is the size of the allocation list.
static size_t slotCount
slotCount is the number of Slot structures in allocationList.
static size_t unUsedSlots
unUsedSlots is the number of Slot structures that are currently available to represent new malloc buffers.
static size_t slotsPerPage
slotsPerPage is the number of slot structures that fit in a virtual memory page.
static long sumAllocatedMem
internal variable: sum of allocated -freed +protected memory in kB
static long sumTotalAllocatedMem
internal variable: sum of allocated memory in kB
static long sumProtectedMem
internal variable: sum of protected memory in kB
static long numDeallocs
internal variable: number of deallocations processed so far
static long numAllocs
internal variable: number of allocations processed so far
void _duma_assert( const  char  * exprstr,
const  char  * filename,
int  lineno )
Print message and halt program execution in crazy way.
void duma_init( void )
duma_init sets configuration settings.
void _duma_init( void )
_duma_init sets up the memory allocation arena and the run-time configuration information.
static void allocateMoreSlots( void )
allocateMoreSlots is called when there are only enough slot structures left to support the allocation of a single malloc buffer.
void * _duma_allocate( size_t  alignment,
size_t  userSize,
int  protectBelow,
int  fillByte,
int  protectAllocList,
enum  _DUMA_Allocator  allocator,
enum _DUMA_FailReturn  fail  DUMA_PARAMLIST_FL )
This is the memory allocator.
void _duma_deallocate( void  * address,
int  protectAllocList,
enum _DUMA_Allocator  allocator  DUMA_PARAMLIST_FL )
Deallocate allocated memory after running some checks, then open slot for use.
void * _duma_kmalloc( size_t  size,
int  flags  DUMA_PARAMLIST_FL )
A version of kmalloc.
static void Page_Delete( void  * address,
size_t  size )
Free’s DUMA allocated memory.
duma-VERSION_2_5_21/kduma/docs/files/kduma-h.html000066400000000000000000000176141401225056000214510ustar00rootroot00000000000000 C:\projects\duma\kduma\kduma.h

kduma.h

Summary
Passed to duma allocator such as we know who is calling us.
Unknown use.

Enumerations

_DUMA_Allocator

Passed to duma allocator such as we know who is calling us.

_DUMA_FailReturn

Unknown use.

duma-VERSION_2_5_21/kduma/docs/files/log-h.html000066400000000000000000000247351401225056000211330ustar00rootroot00000000000000 C:\projects\duma\kduma\log.h

log.h

Summary
Base 2 log computation.
Fake variable to make docs work right :(

Functions

ilog2

static inline int ilog2( int  val )

Base 2 log computation.  Used to calculate order parameters for kernel page allocations.

Variables

none

Fake variable to make docs work right :(

static inline int ilog2( int  val )
Base 2 log computation.
duma-VERSION_2_5_21/kduma/docs/files/paging-h.html000066400000000000000000000733451401225056000216200ustar00rootroot00000000000000 C:\projects\duma\kduma\paging.h

paging.h

Summary
Report that VirtualProtect or mprotect failed and abort program execution.
Create memory.
Allow memory access to allocated memory.
Deny access to allocated memory region.
Free’s DUMA allocated memory.
Retrieve page size.

Functions

mprotectFailed

static void mprotectFailed( void )

Report that VirtualProtect or mprotect failed and abort program execution.

Page_Create

static void * Page_Create( size_t  size,
int  exitonfail,
int  printerror,
int  flags )

Create memory.  Allocates actual memory.  Uses VirtualAlloc on windows and mmap on unix.

flags Passed along from kmalloc (GFP_ATOMIC and the like)

See Also

Page_Delete

Page_AllowAccess

void Page_AllowAccess( void  * address,
size_t  size )

Allow memory access to allocated memory.

See Also

Page_DenyAccess

Page_DenyAccess

static void Page_DenyAccess( void  * address,
size_t  size )

Deny access to allocated memory region.

See Also

Page_AllowAccess

Page_Delete

static void Page_Delete( void  * address,
size_t  size )

Free’s DUMA allocated memory.  This is the real deal, make sure the page is no longer in our slot list first!

See Also

Page_Create

Page_Size

static size_t Page_Size( void )

Retrieve page size.

static void mprotectFailed( void )
Report that VirtualProtect or mprotect failed and abort program execution.
static void * Page_Create( size_t  size,
int  exitonfail,
int  printerror,
int  flags )
Create memory.
void Page_AllowAccess( void  * address,
size_t  size )
Allow memory access to allocated memory.
static void Page_DenyAccess( void  * address,
size_t  size )
Deny access to allocated memory region.
static void Page_Delete( void  * address,
size_t  size )
Free’s DUMA allocated memory.
static size_t Page_Size( void )
Retrieve page size.
duma-VERSION_2_5_21/kduma/docs/index.html000066400000000000000000000001531401225056000201160ustar00rootroot00000000000000 duma-VERSION_2_5_21/kduma/docs/index/000077500000000000000000000000001401225056000172315ustar00rootroot00000000000000duma-VERSION_2_5_21/kduma/docs/index/Classes.html000066400000000000000000000116531401225056000215220ustar00rootroot00000000000000 Class Index
Class Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
$#!
  _DUMA_Slot
Struct Slot contains all of the information about a malloc buffer except for the contents of its memory.
duma-VERSION_2_5_21/kduma/docs/index/Files.html000066400000000000000000000143021401225056000211610ustar00rootroot00000000000000 File Index
File Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
D
  duma_config.h
K
  kduma.c
  kduma.h
L
  log.h
P
  paging.h
duma-VERSION_2_5_21/kduma/docs/index/Functions.html000066400000000000000000000773471401225056000221110ustar00rootroot00000000000000 Function Index
Function Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
$#!
  _duma_allocate, _DUMA_Slot
  _duma_assert, _DUMA_Slot
  _duma_deallocate, _DUMA_Slot
  _duma_init, _DUMA_Slot
  _duma_kmalloc, _DUMA_Slot
A
  allocateMoreSlots, _DUMA_Slot
D
  duma_init, _DUMA_Slot
I
  ilog2
M
  mprotectFailed
P
  Page_AllowAccess
  Page_Create
  Page_Delete
  Page_DenyAccess
  Page_Size
void * _duma_allocate( size_t  alignment,
size_t  userSize,
int  protectBelow,
int  fillByte,
int  protectAllocList,
enum  _DUMA_Allocator  allocator,
enum _DUMA_FailReturn  fail  DUMA_PARAMLIST_FL )
This is the memory allocator.
void _duma_assert( const  char  * exprstr,
const  char  * filename,
int  lineno )
Print message and halt program execution in crazy way.
void _duma_deallocate( void  * address,
int  protectAllocList,
enum _DUMA_Allocator  allocator  DUMA_PARAMLIST_FL )
Deallocate allocated memory after running some checks, then open slot for use.
void _duma_init( void )
_duma_init sets up the memory allocation arena and the run-time configuration information.
void * _duma_kmalloc( size_t  size,
int  flags  DUMA_PARAMLIST_FL )
A version of kmalloc.
static void allocateMoreSlots( void )
allocateMoreSlots is called when there are only enough slot structures left to support the allocation of a single malloc buffer.
void duma_init( void )
duma_init sets configuration settings.
static inline int ilog2( int  val )
Base 2 log computation.
static void mprotectFailed( void )
Report that VirtualProtect or mprotect failed and abort program execution.
void Page_AllowAccess( void  * address,
size_t  size )
Allow memory access to allocated memory.
static void * Page_Create( size_t  size,
int  exitonfail,
int  printerror,
int  flags )
Create memory.
static void Page_Delete( void  * address,
size_t  size )
Free’s DUMA allocated memory.
static void Page_DenyAccess( void  * address,
size_t  size )
Deny access to allocated memory region.
static size_t Page_Size( void )
Retrieve page size.
duma-VERSION_2_5_21/kduma/docs/index/General.html000066400000000000000000002121671401225056000215050ustar00rootroot00000000000000 Index
Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
$#!
  _duma_allocate, _DUMA_Slot
  _DUMA_Allocator
  _duma_allocList, _DUMA_Slot
  _duma_allocListSize, _DUMA_Slot
  _duma_assert, _DUMA_Slot
  _duma_deallocate, _DUMA_Slot
  _DUMA_FailReturn
  _duma_init, _DUMA_Slot
  _DUMA_InitState
  _duma_kmalloc, _DUMA_Slot
  _DUMA_MemRegion
  _DUMA_Slot
  _DUMA_Slot_FileSource
  _DUMA_SlotState
0-9
  00README
A
  allocateMoreSlots, _DUMA_Slot
D
  DUMA_ADDR
  DUMA_ALIGNMENT, _DUMA_Slot
  DUMA_ALLOW_MALLOC_0, _DUMA_Slot
  duma_config.h
  DUMA_FILL, _DUMA_Slot
  DUMA_FREE_ACCESS, _DUMA_Slot
  duma_init, _DUMA_Slot
  duma_init_done, _DUMA_Slot
  DUMA_MALLOC_FAILEXIT, _DUMA_Slot
  DUMA_MAX_ALLOC, _DUMA_Slot
  DUMA_MIN_ALIGNMENT
  DUMA_PAGE_SIZE
  DUMA_PROTECT_BELOW, _DUMA_Slot
  DUMA_PROTECT_FREE, _DUMA_Slot
  DUMA_SHOW_ALLOC, _DUMA_Slot
  DUMA_SIZE
  DUMA_SLACKFILL, _DUMA_Slot
E
  Enumerations
F
  Functions
I
  ilog2
K
  kduma.c
  kduma.h
L
  log.h
M
  MEMORY_CREATION_SIZE
  mprotectFailed
N
  none
  numAllocs, _DUMA_Slot
  numDeallocs, _DUMA_Slot
P
  Page_AllowAccess
  Page_Create
  Page_Delete
  Page_DenyAccess
  Page_Size
  paging.h
S
  slotCount, _DUMA_Slot
  slotsPerPage, _DUMA_Slot
  sumAllocatedMem, _DUMA_Slot
  sumProtectedMem, _DUMA_Slot
  sumTotalAllocatedMem, _DUMA_Slot
T
  Types
U
  unUsedSlots, _DUMA_Slot
V
  Variables
  version
void * _duma_allocate( size_t  alignment,
size_t  userSize,
int  protectBelow,
int  fillByte,
int  protectAllocList,
enum  _DUMA_Allocator  allocator,
enum _DUMA_FailReturn  fail  DUMA_PARAMLIST_FL )
This is the memory allocator.
Passed to duma allocator such as we know who is calling us.
struct _DUMA_Slot * _duma_allocList
_DUMA_allocList points to the array of slot structures used to manage the malloc arena.
static size_t _duma_allocListSize
_duma_allocListSize is the size of the allocation list.
void _duma_assert( const  char  * exprstr,
const  char  * filename,
int  lineno )
Print message and halt program execution in crazy way.
void _duma_deallocate( void  * address,
int  protectAllocList,
enum _DUMA_Allocator  allocator  DUMA_PARAMLIST_FL )
Deallocate allocated memory after running some checks, then open slot for use.
Unknown use.
void _duma_init( void )
_duma_init sets up the memory allocation arena and the run-time configuration information.
Whats are initialization start
void * _duma_kmalloc( size_t  size,
int  flags  DUMA_PARAMLIST_FL )
A version of kmalloc.
Memory region of slot.
Struct Slot contains all of the information about a malloc buffer except for the contents of its memory.
Where did we get file info
State of slot values (empty, free, etc)
This is the begining of a linux kernel model duma.
static void allocateMoreSlots( void )
allocateMoreSlots is called when there are only enough slot structures left to support the allocation of a single malloc buffer.
An integer type with same size as ‘void *’
size_t DUMA_ALIGNMENT
DUMA_ALIGNMENT is a global variable used to control the default alignment of buffers returned by malloc(), calloc(), and realloc().
static int DUMA_ALLOW_MALLOC_0
DUMA_ALLOW_MALLOC_0 is set if DUMA is to allow malloc(0).
int DUMA_FILL
DUMA_FILL is set to 0-255 if DUMA should fill all new allocated memory with the specified value.
static int DUMA_FREE_ACCESS
DUMA_FREE_ACCESS is set if DUMA is to write access memory before freeing it.
void duma_init( void )
duma_init sets configuration settings.
internal variable: state of initialization
static int DUMA_MALLOC_FAILEXIT
DUMA_MALLOC_FAILEXIT controls the behaviour of DUMA when malloc() fails and would return NULL.
static long DUMA_MAX_ALLOC
DUMA_MAX_ALLOC is used to control the maximum memory print of the program in total: When the sum of allocated and protected memory would exceed this value in kB, the protected memory is freed/deleted.
Minimum required alignment by CPU.
Number of bytes per virtual-memory page, as returned by Page_Size().
int DUMA_PROTECT_BELOW
DUMA_PROTECT_BELOW is used to modify the behavior of the allocator.
static long DUMA_PROTECT_FREE
DUMA_PROTECT_FREE is used to control the disposition of memory that is released using free().
static int DUMA_SHOW_ALLOC
DUMA_SHOW_ALLOC is set if DUMA is to print all allocations and deallocations to the console.
An integer type with same size as ‘size_t’
static int DUMA_SLACKFILL
DUMA_SLACKFILL is set to 0-255.
static inline int ilog2( int  val )
Base 2 log computation.
MEMORY_CREATION_SIZE is the amount of memory to get from the operating system at one time.
static void mprotectFailed( void )
Report that VirtualProtect or mprotect failed and abort program execution.
Fake variable to make docs work right :(
static long numAllocs
internal variable: number of allocations processed so far
static long numDeallocs
internal variable: number of deallocations processed so far
void Page_AllowAccess( void  * address,
size_t  size )
Allow memory access to allocated memory.
static void * Page_Create( size_t  size,
int  exitonfail,
int  printerror,
int  flags )
Create memory.
static void Page_Delete( void  * address,
size_t  size )
Free’s DUMA allocated memory.
static void Page_DenyAccess( void  * address,
size_t  size )
Deny access to allocated memory region.
static size_t Page_Size( void )
Retrieve page size.
static size_t slotCount
slotCount is the number of Slot structures in allocationList.
static size_t slotsPerPage
slotsPerPage is the number of slot structures that fit in a virtual memory page.
static long sumAllocatedMem
internal variable: sum of allocated -freed +protected memory in kB
static long sumProtectedMem
internal variable: sum of protected memory in kB
static long sumTotalAllocatedMem
internal variable: sum of allocated memory in kB
static size_t unUsedSlots
unUsedSlots is the number of Slot structures that are currently available to represent new malloc buffers.
static const char version[]
KDUMA version string
duma-VERSION_2_5_21/kduma/docs/index/Types.html000066400000000000000000000222721401225056000212300ustar00rootroot00000000000000 Type Index
Type Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
$#!
  _DUMA_Allocator
  _DUMA_FailReturn
  _DUMA_InitState
  _DUMA_MemRegion
  _DUMA_Slot_FileSource
  _DUMA_SlotState
D
  DUMA_ADDR
  DUMA_SIZE
Passed to duma allocator such as we know who is calling us.
Unknown use.
Whats are initialization start
Memory region of slot.
Where did we get file info
State of slot values (empty, free, etc)
An integer type with same size as ‘void *’
An integer type with same size as ‘size_t’
duma-VERSION_2_5_21/kduma/docs/index/Variables.html000066400000000000000000000755711401225056000220460ustar00rootroot00000000000000 Variable Index
Variable Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
$#!
  _duma_allocList, _DUMA_Slot
  _duma_allocListSize, _DUMA_Slot
D
  DUMA_ALIGNMENT, _DUMA_Slot
  DUMA_ALLOW_MALLOC_0, _DUMA_Slot
  DUMA_FILL, _DUMA_Slot
  DUMA_FREE_ACCESS, _DUMA_Slot
  duma_init_done, _DUMA_Slot
  DUMA_MALLOC_FAILEXIT, _DUMA_Slot
  DUMA_MAX_ALLOC, _DUMA_Slot
  DUMA_MIN_ALIGNMENT
  DUMA_PAGE_SIZE
  DUMA_PROTECT_BELOW, _DUMA_Slot
  DUMA_PROTECT_FREE, _DUMA_Slot
  DUMA_SHOW_ALLOC, _DUMA_Slot
  DUMA_SLACKFILL, _DUMA_Slot
M
  MEMORY_CREATION_SIZE
N
  none
  numAllocs, _DUMA_Slot
  numDeallocs, _DUMA_Slot
S
  slotCount, _DUMA_Slot
  slotsPerPage, _DUMA_Slot
  sumAllocatedMem, _DUMA_Slot
  sumProtectedMem, _DUMA_Slot
  sumTotalAllocatedMem, _DUMA_Slot
U
  unUsedSlots, _DUMA_Slot
V
  version
struct _DUMA_Slot * _duma_allocList
_DUMA_allocList points to the array of slot structures used to manage the malloc arena.
static size_t _duma_allocListSize
_duma_allocListSize is the size of the allocation list.
size_t DUMA_ALIGNMENT
DUMA_ALIGNMENT is a global variable used to control the default alignment of buffers returned by malloc(), calloc(), and realloc().
static int DUMA_ALLOW_MALLOC_0
DUMA_ALLOW_MALLOC_0 is set if DUMA is to allow malloc(0).
int DUMA_FILL
DUMA_FILL is set to 0-255 if DUMA should fill all new allocated memory with the specified value.
static int DUMA_FREE_ACCESS
DUMA_FREE_ACCESS is set if DUMA is to write access memory before freeing it.
internal variable: state of initialization
static int DUMA_MALLOC_FAILEXIT
DUMA_MALLOC_FAILEXIT controls the behaviour of DUMA when malloc() fails and would return NULL.
static long DUMA_MAX_ALLOC
DUMA_MAX_ALLOC is used to control the maximum memory print of the program in total: When the sum of allocated and protected memory would exceed this value in kB, the protected memory is freed/deleted.
Minimum required alignment by CPU.
Number of bytes per virtual-memory page, as returned by Page_Size().
int DUMA_PROTECT_BELOW
DUMA_PROTECT_BELOW is used to modify the behavior of the allocator.
static long DUMA_PROTECT_FREE
DUMA_PROTECT_FREE is used to control the disposition of memory that is released using free().
static int DUMA_SHOW_ALLOC
DUMA_SHOW_ALLOC is set if DUMA is to print all allocations and deallocations to the console.
static int DUMA_SLACKFILL
DUMA_SLACKFILL is set to 0-255.
MEMORY_CREATION_SIZE is the amount of memory to get from the operating system at one time.
Fake variable to make docs work right :(
static long numAllocs
internal variable: number of allocations processed so far
static long numDeallocs
internal variable: number of deallocations processed so far
static size_t slotCount
slotCount is the number of Slot structures in allocationList.
static size_t slotsPerPage
slotsPerPage is the number of slot structures that fit in a virtual memory page.
static long sumAllocatedMem
internal variable: sum of allocated -freed +protected memory in kB
static long sumProtectedMem
internal variable: sum of protected memory in kB
static long sumTotalAllocatedMem
internal variable: sum of allocated memory in kB
static size_t unUsedSlots
unUsedSlots is the number of Slot structures that are currently available to represent new malloc buffers.
static const char version[]
KDUMA version string
duma-VERSION_2_5_21/kduma/docs/javascript/000077500000000000000000000000001401225056000202705ustar00rootroot00000000000000duma-VERSION_2_5_21/kduma/docs/javascript/main.js000066400000000000000000000142471401225056000215620ustar00rootroot00000000000000// This file is part of Natural Docs, which is Copyright (C) 2003-2005 Greg Valure // Natural Docs is licensed under the GPL // // Browser Styles // ____________________________________________________________________________ const agt = navigator.userAgent.toLowerCase(); let browserType; let browserVer; if (agt.indexOf("opera") != -1) { browserType = "Opera"; if (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1) { browserVer = "Opera5"; } else if (agt.indexOf("opera 6") != -1 || agt.indexOf("opera/6") != -1) { browserVer = "Opera6"; } else if (agt.indexOf("opera 7") != -1 || agt.indexOf("opera/7") != -1) { browserVer = "Opera7"; } } else if ( agt.indexOf("khtml") != -1 || agt.indexOf("konq") != -1 || agt.indexOf("safari") != -1 ) { browserType = "KHTML"; } else if (agt.indexOf("msie") != -1) { browserType = "IE"; if (agt.indexOf("msie 4") != -1) { browserVer = "IE4"; } else if (agt.indexOf("msie 5") != -1) { browserVer = "IE5"; } else if (agt.indexOf("msie 6") != -1) { browserVer = "IE6"; } } else if (agt.indexOf("gecko") != -1) { browserType = "Gecko"; } // Opera already taken care of. else if ( agt.indexOf("mozilla") != -1 && agt.indexOf("compatible") == -1 && agt.indexOf("spoofer") == -1 && agt.indexOf("webtv") == -1 && agt.indexOf("hotjava") == -1 ) { browserType = "Netscape"; if (agt.indexOf("mozilla/4") != -1) { browserVer = "Netscape4"; } } // // Menu // ____________________________________________________________________________ function ToggleMenu(id) { if (!window.document.getElementById) { return; } let display = window.document.getElementById(id).style.display; if (display == "none") { display = "block"; } else { display = "none"; } window.document.getElementById(id).style.display = display; } // // Tooltips // ____________________________________________________________________________ let tooltipTimer = 0; function ShowTip(event, tooltipID, linkID) { if (tooltipTimer) { clearTimeout(tooltipTimer); } const docX = event.clientX + window.pageXOffset; const docY = event.clientY + window.pageYOffset; const showCommand = "ReallyShowTip('" + tooltipID + "', '" + linkID + "', " + docX + ", " + docY + ")"; // KHTML cant handle showing on a timer right now. if (browserType != "KHTML") { tooltipTimer = setTimeout(showCommand, 1000); } else { eval(showCommand); } } function ReallyShowTip(tooltipID, linkID, docX, docY) { tooltipTimer = 0; let tooltip; let link; if (document.getElementById) { tooltip = document.getElementById(tooltipID); link = document.getElementById(linkID); } else if (document.all) { tooltip = eval("document.all['" + tooltipID + "']"); link = eval("document.all['" + linkID + "']"); } if (tooltip) { let left = 0; let top = 0; // Not everything supports offsetTop/Left/Width, and some, like Konqueror and Opera 5, think they do but do it badly. if ( link && link.offsetWidth != null && browserType != "KHTML" && browserVer != "Opera5" ) { let item = link; while (item != document.body) { left += item.offsetLeft; item = item.offsetParent; } item = link; while (item != document.body) { top += item.offsetTop; item = item.offsetParent; } top += link.offsetHeight; } // The fallback method is to use the mouse X and Y relative to the document. We use a separate if and test if its a number // in case some browser snuck through the above if statement but didn't support everything. if (!isFinite(top) || top == 0) { left = docX; top = docY; } // Some spacing to get it out from under the cursor. top += 10; // Make sure the tooltip doesnt get smushed by being too close to the edge, or in some browsers, go off the edge of the // page. We do it here because Konqueror does get offsetWidth right even if it doesnt get the positioning right. if (tooltip.offsetWidth != null) { const width = tooltip.offsetWidth; const docWidth = document.body.clientWidth; if (left + width > docWidth) { left = docWidth - width - 1; } } // Opera 5 chokes on the px extension, so it can use the Microsoft one instead. if (tooltip.style.left != null && browserVer != "Opera5") { tooltip.style.left = left + "px"; tooltip.style.top = top + "px"; } else if (tooltip.style.pixelLeft != null) { tooltip.style.pixelLeft = left; tooltip.style.pixelTop = top; } tooltip.style.visibility = "visible"; } } function HideTip(tooltipID) { if (tooltipTimer) { clearTimeout(tooltipTimer); tooltipTimer = 0; } let tooltip; if (document.getElementById) { tooltip = document.getElementById(tooltipID); } else if (document.all) { tooltip = eval("document.all['" + tooltipID + "']"); } if (tooltip) { tooltip.style.visibility = "hidden"; } } // // Event Handlers // ____________________________________________________________________________ function NDOnLoad() { if (browserType == "IE") { const scrollboxes = document.getElementsByTagName("blockquote"); if (scrollboxes.item(0)) { const width = scrollboxes.item(0).parentNode.offsetWidth - scrollboxes.item(0).offsetLeft; let i = 0; let item; while ((item = scrollboxes.item(i))) { item.style.width = width; i++; } window.onresize = NDOnResize; } } } let resizeTimer = 0; function NDOnResize() { if (browserType == "IE") { if (resizeTimer != 0) { clearTimeout(resizeTimer); } resizeTimer = setTimeout(NDDoResize, 500); } } function NDDoResize() { const scrollboxes = document.getElementsByTagName("blockquote"); let i; let item; i = 0; while ((item = scrollboxes.item(i))) { item.style.width = "100px"; i++; } const width = scrollboxes.item(0).parentNode.offsetWidth - scrollboxes.item(0).offsetLeft; i = 0; while ((item = scrollboxes.item(i))) { item.style.width = width; i++; } clearTimeout(resizeTimer); resizeTimer = 0; } duma-VERSION_2_5_21/kduma/docs/styles/000077500000000000000000000000001401225056000174455ustar00rootroot00000000000000duma-VERSION_2_5_21/kduma/docs/styles/main.css000066400000000000000000000273061401225056000211130ustar00rootroot00000000000000/* IMPORTANT: If you're editing this file in the output directory of one of your projects, your changes will be overwritten the next time you run Natural Docs. Instead, copy this file to your project directory, make your changes, and you can use it with -s. Even better would be to make a CSS file in your project directory with only your changes, which you can then use with -s [original style] [your changes]. On the other hand, if you're editing this file in the Natural Docs styles directory, the changes will automatically be applied to all your projects that use this style the next time Natural Docs is run on them. This file is part of Natural Docs, which is Copyright (C) 2003-2005 Greg Valure Natural Docs is licensed under the GPL */ body { font-family: Verdana, Arial, sans-serif; color: #000000; margin: 0px; padding: 0px; } body.UnframedPage { background-color: #e8e8e8; } a:link, a:visited { color: #900000; text-decoration: none; } a:hover { color: #900000; text-decoration: underline; } a:active { color: #ff0000; text-decoration: underline; } td { vertical-align: top; } /* Comment out this line to use web-style paragraphs (blank line between paragraphs, no indent) instead of print-style paragraphs (no blank line, indented.) */ p { text-indent: 5ex; margin: 0; } /* Can't use something like display: none or it won't break. */ .HB { font-size: 1px; visibility: hidden; } /* Blockquotes are used as containers for things that may need to scroll. */ blockquote { padding: 0; margin: 0; overflow: auto; } /* This will be fixed in JavaScript. We just need a default if it's turned off. */ .IE blockquote { width: 400px; } .Gecko blockquote { padding-bottom: 0.5em; } /* Turn off scrolling when printing. */ @media print { blockquote { overflow: visible; } .IE blockquote { width: auto; } } body.FramedMenuPage, .MenuSection { font-size: 9pt; background-color: #e8e8e8; padding: 10px 0 0 0; } .MenuSection { width: 27ex; } .MTitle { font-size: 16pt; font-weight: bold; font-variant: small-caps; text-align: center; padding: 5px 10px 15px 10px; border-bottom: 1px dotted #000000; margin-bottom: 15px; } .MSubTitle { font-size: 9pt; font-weight: normal; font-variant: normal; margin-top: 1ex; margin-bottom: 5px; } .MEntry a:link, .MEntry a:hover, .MEntry a:visited { color: #606060; margin-right: 0; } .MEntry a:active { color: #a00000; margin-right: 0; } .MGroup { font-variant: small-caps; font-weight: bold; margin: 1em 0 1em 10px; } /* Konqueror just can't do margins. */ .KHTML .MGroup { margin-bottom: 0; padding-bottom: 1em; } .MGroupContent { font-variant: normal; font-weight: normal; } .MGroup a:link, .MGroup a:hover, .MGroup a:visited { color: #545454; margin-right: 10px; } .MGroup a:active { color: #a00000; margin-right: 10px; } .MFile, .MText, .MLink, .MIndex { padding: 1px 17px 2px 10px; margin: 0.25em 0 0.25em 0; } .MText { font-size: 8pt; font-style: italic; } .MLink { font-style: italic; } #MSelected { color: #000000; background-color: #ffffff; /* Replace padding with border. */ padding: 0 10px 0 10px; border-width: 1px 2px 2px 0; border-style: solid; border-color: #000000; margin-right: 5px; } /* Close off the left side when its in a group. */ .MGroup #MSelected { padding-left: 9px; border-left-width: 1px; } /* A treat for Mozilla users. Blatantly non-standard. Will be replaced with CSS 3 attributes when finalized/supported. */ .Gecko #MSelected { -moz-border-radius-topright: 10px; -moz-border-radius-bottomright: 10px; } .Gecko .MGroup #MSelected { -moz-border-radius-topleft: 10px; -moz-border-radius-bottomleft: 10px; } body.FramedContentPage, .ContentSection { background-color: #ffffff; padding-bottom: 15px; } .ContentSection { border-width: 0 0 1px 1px; border-style: solid; border-color: #000000; } .CTopic { font-size: 10pt; /* This should be a margin but Konq 3.1.1 sucks. */ padding-bottom: 3em; } .CTitle { font-size: 12pt; font-weight: bold; border-width: 0 0 1px 0; border-style: solid; border-color: #a0a0a0; margin: 0 15px 0.5em 15px; } .CGroup .CTitle { font-size: 16pt; font-variant: small-caps; padding-left: 15px; padding-right: 15px; border-width: 0 0 2px 0; border-color: #000000; margin-left: 0; margin-right: 0; } .CClass .CTitle, .CInterface .CTitle, .CDatabase .CTitle, .CDatabaseTable .CTitle, .CSection .CTitle { font-size: 18pt; color: #ffffff; background-color: #a0a0a0; padding: 10px 15px 10px 15px; border-width: 2px 0; border-color: #000000; margin-left: 0; margin-right: 0; } #MainTopic .CTitle { font-size: 20pt; color: #ffffff; background-color: #7070c0; padding: 10px 15px 10px 15px; border-width: 0 0 3px 0; border-color: #000000; margin-left: 0; margin-right: 0; } .CBody { margin-left: 15px; margin-right: 15px; } .CToolTip { position: absolute; visibility: hidden; left: 0; top: 0; max-width: 50%; background-color: #ffffe0; padding: 5px; border-width: 1px 2px 2px 1px; border-style: solid; border-color: #000000; font-size: 8pt; } /* Opera 6 gives it a huge height otherwise. */ .Opera6 .CTooltip, .Opera5 .CTooltip { max-width: 100%; } /* Scrollbars would be useless. */ .CToolTip blockquote { overflow: hidden; } .CHeading { font-weight: bold; font-size: 10pt; margin-top: 1.5em; margin-bottom: 0.5em; } .CCode { font: 10pt "Courier New", Courier, monospace; } .CBulletList { /* I don't know why CBody's margin doesn't apply, but it's consistent across browsers so whatever. Reapply it here as padding. */ padding-left: 15px; padding-right: 15px; margin: 0.5em 5ex 0.5em 5ex; } .CDescriptionList { margin: 0.5em 5ex 0 5ex; } /* IE 4 and Konqueror always makes it too long. */ .IE4 .CDescriptionList, .KHTML .CDescriptionList { width: 85%; } .CDLEntry { font: 10pt "Courier New", Courier, monospace; color: #808080; padding-bottom: 0.25em; white-space: nowrap; } .CDLDescription { font-size: 10pt; /* For browsers that don't inherit correctly, like Opera 5. */ padding-bottom: 0.5em; padding-left: 5ex; } .Prototype { font: 10pt "Courier New", Courier, monospace; padding: 5px 3ex; border-width: 1px; border-style: solid; margin: 0 5ex 1.5em 5ex; } .Prototype td { font-size: 10pt; } .PDefaultValue, .PDefaultValuePrefix, .PTypePrefix { color: #8f8f8f; } .PTypePrefix { text-align: right; } .PAfterParameters { vertical-align: bottom; } .IE .Prototype table { padding: 0; } .CFunction .Prototype { background-color: #f4f4f4; border-color: #d0d0d0; } .CProperty .Prototype { background-color: #f4f4ff; border-color: #c0c0e8; } .CVariable .Prototype { background-color: #fffff0; border-color: #e0e0a0; } .CDatabaseIndex .Prototype, .CConstant .Prototype { background-color: #d0d0d0; border-color: #000000; } .CType .Prototype { background-color: #fff8f8; border-color: #e8c8c8; } .CDatabaseTrigger .Prototype, .CEvent .Prototype, .CDelegate .Prototype { background-color: #f0fcf0; border-color: #b8e4b8; } .CToolTip .Prototype { margin: 0 0 0.5em 0; white-space: nowrap; } .Summary { margin: 1.5em 5ex 0 5ex; } .STitle { font-size: 12pt; font-weight: bold; margin-bottom: 0.5em; } .SBorder { background-color: #fffff0; padding: 15px; border: 1px solid #c0c060; } /* Let's observe the evolution of IE's brokeness, shall we? IE 4 always makes them too long, there's no way around it. */ .IE4 .SBorder { width: 85%; } /* IE 5 will make them too long unless you set the width to 100%. Isn't this implied for a div? */ .IE5 .SBorder { width: 100%; } /* IE 6 behaves like 5 when it's in a frame, but without frames it will be correct without a width or slightly too long (but not enough to scroll) with a width. This arbitrary weirdness simply astounds me. */ body.FramedContentPage .IE6 .SBorder { width: 100%; } /* A treat for Mozilla users. Blatantly non-standard. Will be replaced with CSS 3 attributes when finalized/supported. */ .Gecko .SBorder { -moz-border-radius: 20px; } .STable { font-size: 9pt; width: 100%; } .SEntrySize { width: 30%; } .SDescriptionSize { width: 70%; } .SMarked { background-color: #f8f8d8; } .SEntry .SIndent1 { margin-left: 1.5ex; } .SEntry .SIndent2 { margin-left: 3ex; } .SEntry .SIndent3 { margin-left: 4.5ex; } .SEntry .SIndent4 { margin-left: 6ex; } .SEntry .SIndent5 { margin-left: 7.5ex; } .SDescription { padding-left: 3ex; } .SDescription a { color: #800000; } .SDescription a:active { color: #a00000; } .SGroup { margin-top: 0.5em; margin-bottom: 0.25em; } .SGroup .SEntry { font-weight: bold; font-variant: small-caps; } .SGroup .SEntry a { color: #800000; } .SGroup .SEntry a:active { color: #f00000; } .SMain .SEntry, .SClass .SEntry, .SDatabase .SEntry, .SDatabaseTable .SEntry, .SSection .SEntry { font-weight: bold; font-size: 10pt; margin-bottom: 0.25em; } .SClass, .SDatabase, .SDatabaseTable, .SSection { margin-top: 1em; } .SMain .SEntry a, .SClass .SEntry a, .SDatabase .SEntry a, .SDatabaseTable .SEntry a, .SSection .SEntry a { color: #000000; } .SMain .SEntry a:active, .SClass .SEntry a:active, .SDatabase .SEntry a:active, .SDatabaseTable .SEntry a:active, .SSection .SEntry a:active { color: #a00000; } .ClassHierarchy { margin: 0 15px 1em 15px; } .CHEntry { border-width: 1px 2px 2px 1px; border-style: solid; border-color: #a0a0a0; margin-bottom: 3px; padding: 2px 2ex; font-size: 10pt; background-color: #f4f4f4; color: #606060; } .Gecko .CHEntry { -moz-border-radius: 4px; } .CHCurrent .CHEntry { font-weight: bold; border-color: #000000; color: #000000; } .CHChildNote .CHEntry { font-style: italic; font-size: 8pt; } .CHIndent { margin-left: 3ex; } .CHEntry a:link, .CHEntry a:visited, .CHEntry a:hover { color: #606060; } .CHEntry a:active { color: #800000; } body.FramedIndexPage, .IndexSection { background-color: #ffffff; font-size: 10pt; padding: 15px; } .IndexSection { border-width: 0 0 1px 1px; border-style: solid; border-color: #000000; } .IPageTitle { font-size: 20pt; font-weight: bold; color: #ffffff; background-color: #7070c0; padding: 10px 15px 10px 15px; border-width: 0 0 3px 0; border-color: #000000; border-style: solid; margin: -15px -15px 0 -15px; } .INavigationBar { text-align: center; background-color: #fffff0; padding: 5px; border-bottom: solid 1px black; margin: 0 -15px 15px -15px; } .INavigationBar a { font-weight: bold; } .IHeading { font-size: 16pt; font-weight: bold; padding: 2.5em 0 0.5em 0; text-align: center; width: 3.5ex; } #IFirstHeading { padding-top: 0; } .IEntry { padding-left: 1ex; } .ISubIndex { padding-left: 3ex; padding-bottom: 0.5em; } /* While it may cause some entries to look like links when they aren't, I found it's much easier to read the index if everything's the same color. */ .ISymbol { font-weight: bold; color: #900000; } .ISymbolPrefix { text-align: right; color: #c47c7c; background-color: #f8f8f8; border-right: 3px solid #e0e0e0; border-left: 1px solid #e0e0e0; padding: 0 1px 0 2px; } #IFirstSymbolPrefix { border-top: 1px solid #e0e0e0; } #ILastSymbolPrefix { border-bottom: 1px solid #e0e0e0; } #IOnlySymbolPrefix { border-top: 1px solid #e0e0e0; border-bottom: 1px solid #e0e0e0; } a.IParent, a.IFile { display: block; } .Footer { font-size: 8pt; color: #909090; } body.UnframedPage .Footer { text-align: right; margin: 2px; } body.FramedMenuPage .Footer { text-align: center; margin: 5em 10px 0 10px; } .Footer a:link, .Footer a:hover, .Footer a:visited { color: #909090; } .Footer a:active { color: #a00000; } duma-VERSION_2_5_21/kduma/kduma.c000066400000000000000000001150461401225056000164460ustar00rootroot00000000000000 /* * KDUMA - Kernel Mode Red-Zone memory allocator. * Copyright (C) 2006 Michael Eddington * Copyright (C) 2006 Eric Rachner * Copyright (C) 2002-2005 Hayati Ayguen , Procitec GmbH * Copyright (C) 1987-1999 Bruce Perens * License: GNU GPL (GNU General Public License, see COPYING-GPL) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ /* $Id$ */ /* Variable: version * * KDUMA version string */ static const char version[] = "KDUMA v0.1 -- Kernel Mode Red-Zone Memory Allocator\n" " Copyright (C) 2006 Michael Eddington\n" " Copyright (C) 2006 Eric Rachner\n" " Copyright (C) 2002-2005 Hayati Ayguen , Procitec GmbH\n" " Copyright (C) 1987-1999 Bruce Perens \n" " License: GNU GPL (GNU General Public License, see COPYING-GPL)\n"; /* Variable: MEMORY_CREATION_SIZE * * MEMORY_CREATION_SIZE is the amount of memory to get from the operating * system at one time. We'll break that memory down into smaller pieces for * malloc buffers. One megabyte is probably a good value. */ #define MEMORY_CREATION_SIZE 1024 * 1024 /* Enum: _DUMA_SlotState * * State of slot values (empty, free, etc) */ enum _DUMA_SlotState { DUMAST_EMPTY /* slot not in use */ , DUMAST_FREE /* internal memory reserved, unused by user */ , DUMAST_IN_USE /* memory in use by allocator; see following enum AllocType */ , DUMAST_ALL_PROTECTED /* memory no more used by allocator; memory is not deallocated but protected */ , DUMAST_BEGIN_PROTECTED /* most memory deallocated, but not page covering userAddress: * slot holds userAddress, userSize and allocator. */ }; /* Enum: _DUMA_Slot_FileSource * * Where did we get file info */ enum _DUMA_Slot_FileSource { DUMAFS_EMPTY /* no filename, lineno */ , DUMAFS_ALLOCATION /* filename, lineno from allocation */ , DUMAFS_DEALLOCATION /* filename, lineno from deallocation */ }; /* Enum: _DUMA_InitState * * Whats are initialization start */ enum _DUMA_InitState { DUMAIS_UNINITIALIZED = 0x1611 /* not initialized */ , DUMAIS_IN_CONSTRUCTOR /* in constructor _duma_init() */ , DUMAIS_OUT_CONSTRUCTOR /* construction _duma_init() finished */ , DUMAIS_IN_INIT /* in initializer duma_init() */ , DUMAIS_OUT_INIT /* initialization duma_init() finished */ }; /* Enum: _DUMA_MemRegion * * Memory region of slot. Really we should only * hang onto NORMAL memory. DMA should be released * fast. */ enum _DUMA_MemRegion { DUMAMR_DMA, DUMAMR_NORMAL, DUMAMR_HIGH } /* Struct: _DUMA_Slot * * Struct Slot contains all of the information about a malloc buffer except * for the contents of its memory. */ struct _DUMA_Slot { void *internalAddress; void *userAddress; void *protAddress; size_t internalSize; size_t userSize; /* save (some) space in production */ unsigned short state :16; unsigned short allocator :8; unsigned short fileSource :8; #ifdef DUMA_USE_FRAMENO int frame; #endif char *filename; /* filename of allocation */ int lineno; /* linenumber of allocation */ #endif #ifdef DUMA_EXPLICIT_INIT int slackfill; #endif }; /* Variable: DUMA_ALIGNMENT * * DUMA_ALIGNMENT is a global variable used to control the default alignment * of buffers returned by malloc(), calloc(), and realloc(). It is all-caps * so that its name matches the name of the environment variable that is used * to set it. This gives the programmer one less name to remember. */ size_t DUMA_ALIGNMENT = DUMA_MIN_ALIGNMENT; /* Variable: DUMA_PROTECT_BELOW * * DUMA_PROTECT_BELOW is used to modify the behavior of the allocator. When * its value is non-zero, the allocator will place an inaccessable page * immediately _before_ the malloc buffer in the address space, instead * of _after_ it. Use this to detect malloc buffer under-runs, rather than * over-runs. It won't detect both at the same time, so you should test your * software twice, once with this value clear, and once with it set. */ int DUMA_PROTECT_BELOW = 0; /* Variable: DUMA_FILL * * DUMA_FILL is set to 0-255 if DUMA should fill all new allocated * memory with the specified value. Set to -1 when DUMA should not * initialise allocated memory. * default is set to initialise with 255, cause many programs rely on * initialisation to 0! */ int DUMA_FILL = 255; /* Variable: DUMA_SLACKFILL * * DUMA_SLACKFILL is set to 0-255. The slack / no mans land of all new allocated * memory is filled with the specified value. * default is set to initialise with 0xAA (=binary 10101010) * initialisation to 0! */ static int DUMA_SLACKFILL = 0xAA; /* Variable: DUMA_PROTECT_FREE * * DUMA_PROTECT_FREE is used to control the disposition of memory that is * released using free(). It is all-caps so that its name * matches the name of the environment variable that is used to set it. * If its value is non-zero, memory released by free is made inaccessable. * Any software that touches free memory will then get a segmentation fault. * Depending on your application and your resources you may tell * DUMA not to use this memory ever again by setting a negative * value f.e. -1. * You can tell DUMA to limit the sum of protected memory by setting * a positive value, which is interpreted in kB. * If its value is zero, freed memory will be available for reallocation, * but will still be inaccessable until it is reallocated. */ static long DUMA_PROTECT_FREE = -1L; /* Variable: DUMA_MAX_ALLOC * * DUMA_MAX_ALLOC is used to control the maximum memory print of the program * in total: When the sum of allocated and protected memory would exceed * this value in kB, the protected memory is freed/deleted. */ static long DUMA_MAX_ALLOC = -1L; /* Variable: DUMA_ALLOW_MALLOC_0 * * DUMA_ALLOW_MALLOC_0 is set if DUMA is to allow malloc(0). I * trap malloc(0) by default because it is a common source of bugs. * But you should know the allocation with size 0 is ANSI conform. */ static int DUMA_ALLOW_MALLOC_0 = 1; /* Variable: DUMA_MALLOC_FAILEXIT * * DUMA_MALLOC_FAILEXIT controls the behaviour of DUMA when * malloc() fails and would return NULL. But most applications don't * check the return value for errors ... so * default to Exit on Fail */ static int DUMA_MALLOC_FAILEXIT = 1; /* Variable: DUMA_FREE_ACCESS * * DUMA_FREE_ACCESS is set if DUMA is to write access memory before * freeing it. This makes easier using watch expressions in debuggers as the * process is interrupted even if the memory is going to be freed. */ static int DUMA_FREE_ACCESS = 0; /* Variable: DUMA_SHOW_ALLOC * * DUMA_SHOW_ALLOC is set if DUMA is to print all allocations * and deallocations to the console. Although this generates a lot * of messages, the option can be useful to detect inefficient code * containing many allocations / deallocations */ static int DUMA_SHOW_ALLOC = 0; /* Variable: _duma_allocList * * _DUMA_allocList points to the array of slot structures used to manage the * malloc arena. */ struct _DUMA_Slot * _duma_allocList = 0; /* Variable: _duma_allocListSize * * _duma_allocListSize is the size of the allocation list. This will always * be a multiple of the page size. */ static size_t _duma_allocListSize = 0; /* Variable: slotCount * * slotCount is the number of Slot structures in allocationList. */ static size_t slotCount = 0; /* Variable: unUsedSlots * * unUsedSlots is the number of Slot structures that are currently available * to represent new malloc buffers. When this number gets too low, we will * create new slots. */ static size_t unUsedSlots = 0; /* Variable: slotsPerPage * * slotsPerPage is the number of slot structures that fit in a virtual * memory page. */ static size_t slotsPerPage = 0; /* Variable: sumAllocatedMem * * internal variable: sum of allocated -freed +protected memory in kB */ static long sumAllocatedMem = 0; /* Variable: sumTotalAllocatedMem * * internal variable: sum of allocated memory in kB */ static long sumTotalAllocatedMem = 0; /* Variable: sumProtectedMem * * internal variable: sum of protected memory in kB */ static long sumProtectedMem = 0; /* Variable: numDeallocs * * internal variable: number of deallocations processed so far */ static long numDeallocs = 0; /* Variable: numAllocs * * internal variable: number of allocations processed so far */ static long numAllocs = 0; /* Variable: duma_init_done * * internal variable: state of initialization */ static enum _DUMA_InitState duma_init_state = DUMAIS_UNINITIALIZED; /* Function: _duma_assert * * Print message and halt program execution in crazy way. */ void _duma_assert(const char * exprstr, const char * filename, int lineno) { // !!!! Needs to be re implemented for KDUMA int *pcAddr = 0; DUMA_Print("\nDUMA: DUMA_ASSERT(%s) failed at\n%s(%i)\n", exprstr, filename, lineno ); /* this is "really" bad, but it works. assert() from assert.h system header * stops only the current thread but the program goes on running under MS Visual C++. * This way the program definitely halts. */ while (1) *pcAddr++ = 0; } /* Function: duma_init * * duma_init sets configuration settings. Can sometimes cause problems * when called from _duma_init. * * See Also: <_duma_init> */ void duma_init(void) { char * string; void * testAlloc; /* avoid double call, when initialization already in progress */ if ( duma_init_state >= DUMAIS_IN_INIT && duma_init_state <= DUMAIS_OUT_INIT ) return; else duma_init_state = DUMAIS_IN_INIT; DUMA_Print(version); DUMA_Print("DUMA: Registration was successful.\n"); /* initialize semaphoring */ DUMA_INIT_SEMAPHORE(); /* * Check whether malloc and free is available */ testAlloc = kmalloc(123); if (numAllocs == 0) DUMA_Abort("kmalloc() is not bound to kduma.\nKDUMA Aborting.\n"); kfree(testAlloc); if (numDeallocs == 0) DUMA_Abort("kfree() is not bound to kduma.\nKDUMA Aborting.\n"); /* initialization finished */ duma_init_state = DUMAIS_OUT_INIT; } /* Function: _duma_init * * _duma_init sets up the memory allocation arena and the run-time * configuration information. We will call duma_init unless DUMA_EXPLICIT_INIT * is defined at compile time. * * See Also: */ void _duma_init(void) { size_t size = MEMORY_CREATION_SIZE; struct _DUMA_Slot * slot; int inRecursion = (duma_init_state >= DUMAIS_IN_CONSTRUCTOR && duma_init_state <= DUMAIS_OUT_INIT); /* constuction already done? this should not happen! */ if (duma_init_state >= DUMAIS_OUT_CONSTRUCTOR && duma_init_state <= DUMAIS_OUT_INIT) goto duma_constructor_callinit; else duma_init_state = DUMAIS_IN_CONSTRUCTOR; if ( DUMA_PAGE_SIZE != Page_Size() ) DUMA_Abort("DUMA_PAGE_SIZE is not correct. Run createconf and save results as duma_config.h"); if(!inRecursion) DUMA_GET_SEMAPHORE(); /* call of DUMA_GET_SEMAPHORE() may already have done the construction recursively! */ if ( duma_init_state >= DUMAIS_OUT_CONSTRUCTOR ) goto duma_constructor_relsem; /* * Figure out how many Slot structures to allocate at one time. */ slotCount = slotsPerPage = DUMA_PAGE_SIZE / sizeof(struct _DUMA_Slot); _duma_allocListSize = DUMA_PAGE_SIZE; if ( size < _duma_allocListSize ) size = _duma_allocListSize; size = ( size + DUMA_PAGE_SIZE -1 ) & ~( DUMA_PAGE_SIZE -1 ); /* * Allocate memory, and break it up into two malloc buffers. The * first buffer will be used for Slot structures, the second will * be marked free. */ slot = _duma_allocList = (struct _DUMA_Slot *)Page_Create(size, 0/*=exitonfail*/, 0/*=printerror*/); if ( 0 == _duma_allocList && 0L != DUMA_PROTECT_FREE ) { int reduce_more; do { /* reduce as much protected memory as we need - or at least try so */ reduce_more = reduceProtectedMemory( (size+1023) >>10 ); /* simply try again */ slot = _duma_allocList = (struct _DUMA_Slot *)Page_Create( size, 0/*=exitonfail*/, 0/*= printerror*/ ); } while ( reduce_more && 0 == _duma_allocList ); if ( 0 == _duma_allocList ) slot = _duma_allocList = (struct _DUMA_Slot *)Page_Create( size, 1/*=exitonfail*/, 1/*= printerror*/ ); } memset((char *)_duma_allocList, 0, _duma_allocListSize); /* enter _duma_allocList as slot to allow call to free() when doing allocateMoreSlots() */ slot[0].internalAddress = slot[0].userAddress = _duma_allocList; slot[0].internalSize = slot[0].userSize = _duma_allocListSize; slot[0].state = DUMAST_IN_USE; slot[0].allocator = EFA_INT_ALLOC; slot[0].fileSource = DUMAFS_ALLOCATION; #ifdef DUMA_USE_FRAMENO slot[0].frame = 0; #endif slot[0].filename = __FILE__; slot[0].lineno = __LINE__; #endif if ( size > _duma_allocListSize ) { slot[1].internalAddress = slot[1].userAddress = ((char *)slot[0].internalAddress) + slot[0].internalSize; slot[1].internalSize = slot[1].userSize = size - slot[0].internalSize; slot[1].state = DUMAST_FREE; slot[1].allocator = EFA_INT_ALLOC; slot[1].fileSource = DUMAFS_ALLOCATION; #ifdef DUMA_USE_FRAMENO slot[1].frame = 0; #endif slot[1].filename = __FILE__; slot[1].lineno = __LINE__; #endif } /* * Deny access to the free page, so that we will detect any software * that treads upon free memory. */ Page_DenyAccess(slot[1].internalAddress, slot[1].internalSize); /* * Account for the two slot structures that we've used. */ unUsedSlots = slotCount - 2; /* construction done */ if ( duma_init_state < DUMAIS_OUT_CONSTRUCTOR ) duma_init_state = DUMAIS_OUT_CONSTRUCTOR; /***********************/ duma_constructor_relsem: if ( !inRecursion ) DUMA_RELEASE_SEMAPHORE(); /*************************/ duma_constructor_callinit: if ( duma_init_state < DUMAIS_OUT_INIT ) duma_init(); } /* Function: allocateMoreSlots * * allocateMoreSlots is called when there are only enough slot structures * left to support the allocation of a single malloc buffer. * * See Also: <_duma_allocate> */ static void allocateMoreSlots(void) { size_t newSize = _duma_allocListSize + DUMA_PAGE_SIZE; void * newAllocation; void * oldAllocation = _duma_allocList; newAllocation = _duma_allocate( 1 /*=alignment*/, newSize, 0 /*=protectBelow*/, -1 /*=fillByte*/, 0 /*=protectAllocList*/, EFA_INT_ALLOC, DUMA_FAIL_NULL, __FILE__, __LINE__ ); if ( ! newAllocation ) return; memcpy(newAllocation, _duma_allocList, _duma_allocListSize); memset(&(((char *)newAllocation)[_duma_allocListSize]), 0, DUMA_PAGE_SIZE); _duma_allocList = (struct _DUMA_Slot *)newAllocation; _duma_allocListSize = newSize; slotCount += slotsPerPage; unUsedSlots += slotsPerPage; #ifndef DUMA_NO_LEAKDETECTION _duma_deallocate( oldAllocation, 0 /*=protectAllocList*/, EFA_INT_DEALLOC, __FILE__, __LINE__ ); #else _duma_deallocate( oldAllocation, 0 /*=protectAllocList*/, EFA_INT_DEALLOC); #endif } /* Function: _duma_allocate * * This is the memory allocator. When asked to allocate a buffer, allocate * it in such a way that the end of the buffer is followed by an inaccessable * memory page. If software overruns that buffer, it will touch the bad page * and get an immediate segmentation fault. It's then easy to zero in on the * offending code with a debugger. * * There are a few complications. If the user asks for an odd-sized buffer, * we would have to have that buffer start on an odd address if the byte after * the end of the buffer was to be on the inaccessable page. Unfortunately, * there is lots of software that asks for odd-sized buffers and then * requires that the returned address be word-aligned, or the size of the * buffer be a multiple of the word size. An example are the string-processing * functions on Sun systems, which do word references to the string memory * and may refer to memory up to three bytes beyond the end of the string. * For this reason, I take the alignment requests to memalign() and valloc() * seriously, and * * DUMA wastes lots of memory. * * See Also: <_duma_deallocate> */ void * _duma_allocate(size_t alignment, size_t userSize, int protectBelow, int fillByte, int protectAllocList, enum _DUMA_Allocator allocator, enum _DUMA_FailReturn fail DUMA_PARAMLIST_FL) { size_t count; struct _DUMA_Slot *slot; struct _DUMA_Slot *fullSlot; struct _DUMA_Slot *emptySlots[2]; DUMA_ADDR intAddr, userAddr, protAddr, endAddr; size_t internalSize; char stacktrace[601]; char* ptrStacktrace; DUMA_ASSERT( 0 != _duma_allocList ); /* initialize return value */ userAddr = 0; /* check userSize */ if ( 0 == userSize ) { if ( !DUMA_ALLOW_MALLOC_0 ) { DUMA_Abort("Allocating 0 bytes, probably a bug: %s(%i)", filename, lineno); } else return (void*)userAddr; } /* check alignment */ if ( ! alignment ) { DUMA_SIZE a = (DUMA_SIZE)DUMA_ALIGNMENT; DUMA_SIZE s = (DUMA_SIZE)userSize; if ( s < a ) { /* to next lower power of 2 */ for (a = s; a & (a-1); a &= a-1) ; } alignment = (size_t)a; /* this is new alignment */ } if ( (int)alignment != ((int)alignment & -(int)alignment) ) { #ifndef DUMA_NO_LEAKDETECTION DUMA_Abort("Alignment (=%d) is not a power of 2 requested from %s(%i)", (DUMA_SIZE)alignment, filename, lineno); #else DUMA_Abort("Alignment (=%d) is not a power of 2", (DUMA_SIZE)alignment); #endif } /* count and show allocation, if requested */ numAllocs++; if (DUMA_SHOW_ALLOC) { #ifndef DUMA_NO_LEAKDETECTION DUMA_Print("\nDUMA: Allocating %d bytes at %s(%i).", (DUMA_SIZE)userSize, filename, lineno); #else DUMA_Print("\nDUMA: Allocating %d bytes.", (DUMA_SIZE)userSize); #endif } /* * If protectBelow is set, all addresses returned by malloc() * and company will be page-aligned. * * The internal size of the buffer is rounded up to the next alignment and page-size * boundary, and then we add another page's worth of memory for the dead page. */ /* a bit tricky but no modulo and no if () */ internalSize = ( (userSize + DUMA_PAGE_SIZE -1) & ~(DUMA_PAGE_SIZE -1) ) + DUMA_PAGE_SIZE; if ( alignment > DUMA_PAGE_SIZE ) internalSize += alignment - DUMA_PAGE_SIZE; /* * These will hold the addresses of two empty Slot structures, that * can be used to hold information for any memory I create, and any * memory that I mark free. */ fullSlot = emptySlots[0] = emptySlots[1] = 0; /* * The internal memory used by the allocator is currently * inaccessable, so that errant programs won't scrawl on the * allocator's arena. I'll un-protect it here so that I can make * a new allocation. I'll re-protect it before I return. */ if ( protectAllocList ) { IF__DUMA_INIT_DONE DUMA_GET_SEMAPHORE(); Page_AllowAccess(_duma_allocList, _duma_allocListSize); } /* * If I'm running out of empty slots, create some more before * I don't have enough slots left to make an allocation. */ if ( DUMAAT_INTERNAL != _duma_allocDesc[allocator].type && unUsedSlots < 7 ) allocateMoreSlots(); /* * Iterate through all of the slot structures. Attempt to find a slot * containing free memory of the exact right size. Accept a slot with * more memory than we want, if the exact right size is not available. * Find two slot structures that are not in use. We will need one if * we split a buffer into free and allocated parts, and the second if * we have to create new memory and mark it as free. * */ for ( slot = _duma_allocList, count = slotCount ; count > 0; --count, ++slot ) { /* * Windows needs special treatment, cause Page_Delete() needs exactly * the same memory region as Page_Create()! * Thus as a quick hack no memory management is done by DUMA. */ #if !defined(WIN32) if ( DUMAST_FREE == slot->state && slot->internalSize >= internalSize ) { if ( !fullSlot || slot->internalSize < fullSlot->internalSize ) { fullSlot = slot; if ( slot->internalSize == internalSize ) break; /* All done; no empty slot needed in this case */ } } else #endif if ( DUMAST_EMPTY == slot->state ) { if(!emptySlots[0]) emptySlots[0] = slot; else if ( !emptySlots[1] ) emptySlots[1] = slot; #if defined(WIN32) break; #endif } } if ( !fullSlot ) { /* * I get here if I haven't been able to find a free buffer * with all of the memory I need. I'll have to create more * memory. I'll mark it all as free, and then split it into * free and allocated portions later. */ size_t chunkSize; size_t chunkSizekB; #if defined(WIN32) chunkSize = internalSize; #else chunkSize = MEMORY_CREATION_SIZE; if ( chunkSize < internalSize ) chunkSize = internalSize; chunkSize = ( chunkSize + DUMA_PAGE_SIZE -1 ) & ~( DUMA_PAGE_SIZE -1 ); #endif chunkSizekB = (chunkSize+1023) >>10; /* Use up one of the empty slots to make the full slot. */ if ( !emptySlots[0] ) DUMA_Abort("Internal error in allocator: No empty slot 0.\n"); #if !defined(WIN32) if ( !emptySlots[1] ) DUMA_Abort("Internal error in allocator: No empty slot 1.\n"); #endif fullSlot = emptySlots[0]; emptySlots[0] = emptySlots[1]; /* reduce protected memory when we would exceed DUMA_MAX_ALLOC */ if ( DUMA_MAX_ALLOC > 0 && sumAllocatedMem + chunkSizekB > DUMA_MAX_ALLOC ) reduceProtectedMemory( chunkSizekB ); fullSlot->internalAddress = Page_Create( chunkSize, 0/*= exitonfail*/, 0/*= printerror*/ ); if ( 0 == fullSlot->internalAddress && 0L != DUMA_PROTECT_FREE ) { int reduce_more; do { /* reduce as much protected memory as we need - or at least try so */ reduce_more = reduceProtectedMemory( (chunkSize+1023) >>10 ); /* simply try again */ fullSlot->internalAddress = Page_Create( chunkSize, 0/*= exitonfail*/, 0/*= printerror*/ ); } while ( reduce_more && 0 == fullSlot->internalAddress ); if ( 0 == fullSlot->internalAddress && DUMA_FAIL_ENV == fail ) fullSlot->internalAddress = Page_Create( chunkSize, DUMA_MALLOC_FAILEXIT, 1/*= printerror*/ ); } if ( fullSlot->internalAddress ) { sumAllocatedMem += ( (chunkSize +1023) >>10 ); sumTotalAllocatedMem += ( (chunkSize +1023) >>10 ); fullSlot->internalSize = chunkSize; fullSlot->state = DUMAST_FREE; --unUsedSlots; } } /* end if ( !fullSlot ) */ if ( fullSlot->internalSize ) { if ( !protectBelow ) { /* * Arrange the buffer so that it is followed by an inaccessable * memory page. A buffer overrun that touches that page will * cause a segmentation fault. * internalAddr <= userAddr < protectedAddr */ /* Figure out what address to give the user. */ intAddr = (DUMA_ADDR)fullSlot->internalAddress; endAddr = intAddr + internalSize; userAddr = ( intAddr + internalSize - DUMA_PAGE_SIZE - userSize ) & ~(alignment -1); protAddr = ( userAddr + userSize + DUMA_PAGE_SIZE -1) & ~(DUMA_PAGE_SIZE -1); /* DUMA_ASSERT(intAddr <= userAddr && intAddr < protAddr ); */ /* Set up the "live" page(s). */ Page_AllowAccess( (char*)intAddr, protAddr - intAddr ); /* Set up the "dead" page(s). */ Page_DenyAccess( (char*)protAddr, endAddr - protAddr ); } else /* if (protectBelow) */ { /* * Arrange the buffer so that it is preceded by an inaccessable * memory page. A buffer underrun that touches that page will * cause a segmentation fault. */ /* Figure out what address to give the user. */ intAddr = (DUMA_ADDR)fullSlot->internalAddress; endAddr = intAddr + internalSize; userAddr = ( intAddr + DUMA_PAGE_SIZE + alignment -1) & ~(alignment -1); protAddr = ( userAddr & ~(DUMA_PAGE_SIZE -1) ) - DUMA_PAGE_SIZE; /* DUMA_ASSERT(intAddr < userAddr && intAddr <= protAddr ); */ /* Set up the "live" page(s). userAddr == protAddr + DUMA_PAGE_SIZE ! */ Page_AllowAccess( (char*)userAddr, internalSize - (userAddr - protAddr) ); /* Set up the "dead" page(s). */ Page_DenyAccess( (char*)intAddr, userAddr - intAddr ); } /* => userAddress = internalAddress + DUMA_PAGE_SIZE */ fullSlot->userAddress = (char*)userAddr; fullSlot->protAddress = (char*)protAddr; fullSlot->userSize = userSize; fullSlot->state = DUMAST_IN_USE; fullSlot->allocator = allocator; #ifndef DUMA_NO_LEAKDETECTION fullSlot->fileSource = DUMAFS_ALLOCATION; #ifdef DUMA_USE_FRAMENO fullSlot->frame = frameno; #endif fullSlot->filename = (char*)filename; #ifdef DUMA_EXPLICIT_INIT /* mark allocations from standard libraries * before duma_init() is finished with lineno = -1 * to allow special treatment in leak_checking */ fullSlot->lineno = (DUMAIS_OUT_INIT == duma_init_state) ? lineno : -1; #else fullSlot->lineno = lineno; #endif #endif /* initialise no mans land of slot */ _duma_init_slack( fullSlot ); } /* end if ( fullSlot->internalSize ) */ /* * Make the pool's internal memory inaccessable, so that the program * being debugged can't stomp on it. */ if ( protectAllocList ) { Page_DenyAccess(_duma_allocList, _duma_allocListSize); IF__DUMA_INIT_DONE DUMA_RELEASE_SEMAPHORE(); } /* Fill the memory if it was specified to do so. */ if ( ((char*)userAddr) && fillByte != -1 ) memset( (char*)userAddr, fillByte, userSize); return (char*)userAddr; } /* Function: _duma_deallocate * * Deallocate allocated memory after running some checks, then open * slot for use. Uses Page_Delete to free the underlying memory. * * See Also: <_duma_allocate> */ void _duma_deallocate(void * address, int protectAllocList, enum _DUMA_Allocator allocator DUMA_PARAMLIST_FL) { struct _DUMA_Slot * slot; long internalSizekB; if ( 0 == _duma_allocList ) { DUMA_Abort("free() called before first malloc()."); } if ( 0 == address ) return; if ( protectAllocList ) { IF__DUMA_INIT_DONE DUMA_GET_SEMAPHORE(); Page_AllowAccess(_duma_allocList, _duma_allocListSize); } if ( !(slot = slotForUserAddress(address)) ) { if ( (slot = nearestSlotForUserAddress(address)) ) { if ( DUMAFS_ALLOCATION == slot->fileSource ) DUMA_Abort("free(%a): address not from DUMA or already freed. Address may be corrupted from %a allocated from %s(%i)", (DUMA_ADDR)address, (DUMA_ADDR)slot->userAddress, slot->filename, slot->lineno); else if ( DUMAFS_DEALLOCATION == slot->fileSource ) DUMA_Abort("free(%a): address not from DUMA or already freed. Address may be corrupted from %a deallocated at %s(%i)", (DUMA_ADDR)address, (DUMA_ADDR)slot->userAddress, slot->filename, slot->lineno); else } else { DUMA_Abort("free(%a): address not from DUMA or already freed.", (DUMA_ADDR)address); } } if ( DUMAST_ALL_PROTECTED == slot->state || DUMAST_BEGIN_PROTECTED == slot->state ) { if ( DUMAFS_ALLOCATION == slot->fileSource ) DUMA_Abort("free(%a): memory already freed. allocated from %s(%i)", (DUMA_ADDR)address, slot->filename, slot->lineno); else if ( DUMAFS_DEALLOCATION == slot->fileSource ) DUMA_Abort("free(%a): memory already freed at %s(%i)", (DUMA_ADDR)address, slot->filename, slot->lineno); else DUMA_Abort("free(%a): memory already freed.", (DUMA_ADDR)address); } else if ( _duma_allocDesc[slot->allocator].type != _duma_allocDesc[allocator].type ) { if ( DUMAFS_ALLOCATION == slot->fileSource ) DUMA_Abort("Free mismatch: allocator '%s' used at %s(%i)\n but deallocator '%s' called at %s(%i)!", _duma_allocDesc[slot->allocator].name, slot->filename, slot->lineno, _duma_allocDesc[allocator].name, filename, lineno ); else if ( DUMAFS_DEALLOCATION == slot->fileSource ) DUMA_Abort("Free mismatch: allocator '%s' used \nbut deallocator '%s' called at %s(%i)!", _duma_allocDesc[slot->allocator].name, _duma_allocDesc[allocator].name, filename, lineno ); else DUMA_Abort("Free mismatch: allocator '%s' used but deallocator '%s' called!", _duma_allocDesc[slot->allocator].name, _duma_allocDesc[allocator].name ); } /* count and show deallocation, if requested */ numDeallocs++; if (DUMA_SHOW_ALLOC) DUMA_Print("\nDUMA: Freeing %d bytes at %s(%i) (Allocated from %s(%i)).", (DUMA_SIZE)slot->userSize, filename, lineno, slot->filename, slot->lineno); /* CHECK INTEGRITY OF NO MANS LAND */ _duma_check_slack( slot ); if ( DUMA_FREE_ACCESS ) { volatile char *start = slot->userAddress; volatile char *cur; for (cur = (char*)slot->userAddress+slot->userSize; --cur >= start; ) { char c = *cur; *cur = c-1; *cur = c; } } internalSizekB = (slot->internalSize+1023) >>10; /* protect memory, that nobody can access it */ /* Free as much protected memory, that we can protect this one */ /* is there need? and is there a way to free such much? */ if ( DUMA_PROTECT_FREE > 0L && sumProtectedMem + internalSizekB > DUMA_PROTECT_FREE && internalSizekB < DUMA_PROTECT_FREE && sumProtectedMem >= internalSizekB) { reduceProtectedMemory( internalSizekB ); } if (( EFA_INT_ALLOC != slot->allocator ) && ( DUMA_PROTECT_FREE < 0L || ( DUMA_PROTECT_FREE > 0L && sumProtectedMem + internalSizekB <= DUMA_PROTECT_FREE ) ) ) { slot->state = DUMAST_ALL_PROTECTED; Page_DenyAccess(slot->internalAddress, slot->internalSize); sumProtectedMem += internalSizekB; if ( lineno ) { slot->fileSource = DUMAFS_DEALLOCATION; slot->filename = (char*)filename; slot->lineno = lineno; } } else { /* free all the memory */ Page_Delete(slot->internalAddress, slot->internalSize); sumAllocatedMem -= internalSizekB; /* free slot and userAddr */ slot->internalAddress = slot->userAddress = 0; slot->internalSize = slot->userSize = 0; slot->state = DUMAST_EMPTY; slot->allocator = EFA_INT_ALLOC; slot->fileSource = DUMAFS_EMPTY; #ifdef DUMA_USE_FRAMENO slot->frame = 0; #endif slot->filename = 0; slot->lineno = 0; } if ( protectAllocList ) { Page_DenyAccess(_duma_allocList, _duma_allocListSize); IF__DUMA_INIT_DONE DUMA_RELEASE_SEMAPHORE(); } } /*********************************************************/ /* Function: _duma_kmalloc * * A version of kmalloc. */ void * _duma_kmalloc(size_t size, int flags DUMA_PARAMLIST_FL) { if ( _duma_allocList == 0 ) _duma_init(); /* This sets DUMA_ALIGNMENT, DUMA_PROTECT_BELOW, DUMA_FILL, ... */ return _duma_allocate(0, size, flags, DUMA_PROTECT_BELOW, DUMA_FILL, 1 /*=protectAllocList*/, EFA_MALLOC, DUMA_FAIL_ENV DUMA_PARAMS_FL); } /* Function: _duma_kfree * * A version of free. */ void _duma_kfree(void * baseAdr DUMA_PARAMLIST_FL) { if ( _duma_allocList == 0 ) _duma_init(); /* This sets DUMA_ALIGNMENT, DUMA_PROTECT_BELOW, DUMA_FILL, ... */ _duma_deallocate(baseAdr, 1 /*=protectAllocList*/, EFA_FREE DUMA_PARAMS_FL); } /* Function: _duma_valloc * * A version of valloc. */ void * _duma_valloc(size_t size DUMA_PARAMLIST_FL) { if ( _duma_allocList == 0 ) _duma_init(); /* This sets DUMA_ALIGNMENT, DUMA_PROTECT_BELOW, DUMA_FILL, ... */ return _duma_allocate(DUMA_PAGE_SIZE, size, DUMA_PROTECT_BELOW, DUMA_FILL, 1 /*=protectAllocList*/, EFA_VALLOC, DUMA_FAIL_ENV DUMA_PARAMS_FL); } /* Function: _duma_vfree * * A version of free. */ void _duma_vfree(void * baseAdr DUMA_PARAMLIST_FL) { if ( _duma_allocList == 0 ) _duma_init(); /* This sets DUMA_ALIGNMENT, DUMA_PROTECT_BELOW, DUMA_FILL, ... */ _duma_deallocate(baseAdr, 1 /*=protectAllocList*/, EFA_FREE DUMA_PARAMS_FL); } /* Function: _duma_strdup * * A version of strdup. */ char * _duma_strdup(const char * str DUMA_PARAMLIST_FL) { size_t size; char * dup; unsigned i; if ( _duma_allocList == 0 ) _duma_init(); /* This sets DUMA_ALIGNMENT, DUMA_PROTECT_BELOW, DUMA_FILL, ... */ size = 0; while (str[size]) ++size; dup = _duma_allocate(0, size +1, DUMA_PROTECT_BELOW, -1 /*=fillByte*/, 1 /*=protectAllocList*/, EFA_STRDUP, DUMA_FAIL_ENV DUMA_PARAMS_FL); if (dup) /* if successful */ for (i=0; i<=size; ++i) /* copy string */ dup[i] = str[i]; return dup; } /* Function: _duma_memcpy * * A version of memcpy that provides extra checks based on * information we know about HEAP. * * Currently the only check we perform is overlapping memory * regions. This should be expanded to include checking size * of dest to verify assumptions. */ void * _duma_memcpy(void *dest, const void *src, size_t size DUMA_PARAMLIST_FL) { char * d = (char *)dest; const char * s = (const char *)src; unsigned i; if ( (s < d && d < s + size) || (d < s && s < d + size && !_duma_s.MEMCPY_OVERLAP) ) DUMA_Abort("memcpy(%a, %a, %d): memory regions overlap.", (DUMA_ADDR)dest, (DUMA_ADDR)src, (DUMA_SIZE)size); for (i=0; i (const char*)src) { *--d = *--s; } } return dest; } /* Function: _duma_strcpy * * A version of strcpy that provides extra checks based on * information we know about HEAP. * * Currently the only check we perform is overlapping memory * regions. This should be expanded to include checking size * of dest to verify assumptions. */ char * _duma_strcpy(char *dest, const char *src DUMA_PARAMLIST_FL) { unsigned i; size_t size = strlen(src) +1; if ( src < dest && dest < src + size ) DUMA_Abort("strcpy(%a, %a): memory regions overlap.", (DUMA_ADDR)dest, (DUMA_ADDR)src); for (i=0; i 0 && src < dest && dest < src + size ) DUMA_Abort("strncpy(%a, %a, %d): memory regions overlap.", (DUMA_ADDR)dest, (DUMA_ADDR)src, (DUMA_SIZE)size); /* calculate number of characters to copy from src to dest */ srcsize = strlen(src) + 1; if ( srcsize > size ) srcsize = size; /* copy src to dest */ for (i=0; i 0 */ if ( size <= 0 ) return dest; /* calculate number of characters to copy from src to dest */ destlen = strlen(dest); srclen = strlen(src); if ( srclen > size ) srclen = size; /* CHECK: Verify memory regions do not overlap */ if ( src < (dest + destlen) && (dest + destlen) < (src + srclen + 1) ) DUMA_Abort("strncat(%a, %a, %d): memory regions overlap.", (DUMA_ADDR)dest, (DUMA_ADDR)src, (DUMA_SIZE)size); /* copy up to size characters from src to dest */ for (i=0; i 0; --count, ++slot ) { if ( DUMAST_IN_USE == slot->state #ifdef DUMA_USE_FRAMENO && frameno == slot->frame #endif && EFA_INT_ALLOC != slot->allocator #ifdef DUMA_EXPLICIT_INIT && -1 != slot->lineno #endif ) { DUMA_Print("\nDUMA: ptr=0x%a size=%d alloced from %s(%i) not freed\n", (DUMA_ADDR)slot->userAddress, (DUMA_SIZE)slot->userSize, slot->filename, slot->lineno); ++nonFreed; } } if (nonFreed) DUMA_Abort("DUMA_delFrame(): Found non free'd pointers.\n"); Page_DenyAccess(_duma_allocList, _duma_allocListSize); IF__DUMA_INIT_DONE DUMA_RELEASE_SEMAPHORE(); --frameno; } if (DUMA_SHOW_ALLOC) DUMA_Print("\nDUMA: DUMA_delFrame(): Processed %l allocations and %l deallocations in total.\n", numAllocs, numDeallocs); } /* Function: _duma_exit * * DUMA's exit function, called atexit() or with GNU C Compiler's destructor attribute. * This function also calls DUMA_delFrame to check for still in use memory and allert * the user. */ void _duma_exit(void) { /* DUMA_ASSERT(0); */ while (-1 != frameno) DUMA_delFrame(); } /* end */duma-VERSION_2_5_21/kduma/kduma.h000066400000000000000000000156071401225056000164550ustar00rootroot00000000000000 /* * KDUMA - Kernel Mode Red-Zone memory allocator. * Copyright (C) 2006 Michael Eddington * Copyright (C) 2006 Eric Rachner * License: GNU GPL (GNU General Public License, see COPYING-GPL) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ /* $Id$ */ /* * #include * * You must include before including ! * */ /* for enabling inclusion of duma.h after inclusion of efencint.h */ /* remove previous definitions */ #include "noduma.h" #ifndef __KDUMA_H__ #define __KDUMA_H__ #include "duma_config.h" #ifdef __cplusplus #define DUMA_EXTERN_C extern "C" #else #define DUMA_EXTERN_C extern #endif /* global DUMA variables */ DUMA_EXTERN_C int DUMA_OUTPUT_DEBUG; DUMA_EXTERN_C int DUMA_OUTPUT_STDOUT; DUMA_EXTERN_C int DUMA_OUTPUT_STDERR; DUMA_EXTERN_C char* DUMA_OUTPUT_FILE; DUMA_EXTERN_C int DUMA_OUTPUT_STACKTRACE; DUMA_EXTERN_C int DUMA_PROTECT_BELOW; DUMA_EXTERN_C size_t DUMA_ALIGNMENT; DUMA_EXTERN_C int DUMA_FILL; DUMA_EXTERN_C struct _DUMA_Slot * _duma_allocList; #ifndef DUMA_NO_CPP_SUPPORT DUMA_EXTERN_C void * _duma_cxx_null_addr; #endif #endif /* DUMA_EXTERNS_DECLARED */ /* Enum: _DUMA_Allocator * * Passed to duma allocator such as we know who * is calling us. */ enum _DUMA_Allocator { EFA_INT_ALLOC , EFA_INT_DEALLOC , EFA_MALLOC , EFA_CALLOC , EFA_FREE , EFA_MEMALIGN , EFA_REALLOC , EFA_VALLOC , EFA_STRDUP , EFA_NEW_ELEM , EFA_DEL_ELEM , EFA_NEW_ARRAY , EFA_DEL_ARRAY /* use following enums when calling _duma_allocate()/_duma_deallocate() * from user defined member operators */ , EFA_MEMBER_NEW_ELEM , EFA_MEMBER_DEL_ELEM , EFA_MEMBER_NEW_ARRAY , EFA_MEMBER_DEL_ARRAY }; /* Enum: _DUMA_FailReturn * * Unknown use. */ enum _DUMA_FailReturn { DUMA_FAIL_NULL , DUMA_FAIL_ENV }; DUMA_EXTERN_C void _duma_init(void); DUMA_EXTERN_C void _duma_assert(const char * exprstr, const char * filename, int lineno); DUMA_EXTERN_C void duma_init(void); DUMA_EXTERN_C void * _duma_allocate(size_t alignment, size_t userSize, int protectBelow, int fillByte, int protectAllocList, enum _DUMA_Allocator allocator, enum _DUMA_FailReturn fail, const char * filename, int lineno); DUMA_EXTERN_C void _duma_deallocate(void * baseAdr, int protectAllocList, enum _DUMA_Allocator allocator, const char * filename, int lineno); DUMA_EXTERN_C void * _duma_kalloc(size_t size, int flags, const char * filename, int lineno); DUMA_EXTERN_C void _duma_kfree(void *baseAdr, const char * filename, int lineno); DUMA_EXTERN_C void * _duma_valloc(size_t size, const char * filename, int lineno); DUMA_EXTERN_C void * _duma_vfree(void *baseAdr, const char * filename, int lineno); DUMA_EXTERN_C char * _duma_strdup(const char *str, const char * filename, int lineno); DUMA_EXTERN_C void * _duma_memcpy(void *dest, const void *src, size_t size, const char * filename, int lineno); DUMA_EXTERN_C void * _duma_memmove(void *dest, const void *src, size_t size); DUMA_EXTERN_C char * _duma_strcpy(char *dest, const char *src, const char * filename, int lineno); DUMA_EXTERN_C char * _duma_strncpy(char *dest, const char *src, size_t size, const char * filename, int lineno); DUMA_EXTERN_C char * _duma_strcat(char *dest, const char *src, const char * filename, int lineno); DUMA_EXTERN_C char * _duma_strncat(char *dest, const char *src, size_t size, const char * filename, int lineno); DUMA_EXTERN_C void DUMA_newFrame(void); DUMA_EXTERN_C void DUMA_delFrame(void); #define kalloc(SIZE, FLAGS) _duma_kalloc(SIZE, FLAGS, __FILE__, __LINE__) #define kfree(BASEADR) _duma_kfree(BASEADR, __FILE__, __LINE__) #define valloc(SIZE) _duma_valloc(SIZE, __FILE__, __LINE__) #define vfree(BASEADR) _duma_vfree(BASEADR, __FILE__, __LINE__) #define strdup(STR) _duma_strdup(STR, __FILE__, __LINE__) #define memcpy(DEST, SRC, SIZE) _duma_memcpy(DEST, SRC, SIZE, __FILE__, __LINE__) #define memmove(DEST, SRC, SIZE) _duma_memmove(DEST, SRC, SIZE) #define strcpy(DEST, SRC) _duma_strcpy(DEST, SRC, __FILE__, __LINE__) #define strncpy(DEST, SRC, SIZE) _duma_strncpy(DEST, SRC, SIZE, __FILE__, __LINE__) #define strcat(DEST, SRC) _duma_strcat(DEST, SRC, __FILE__, __LINE__) #define strncat(DEST, SRC, SIZE) _duma_strncat(DEST, SRC, SIZE, __FILE__, __LINE__) #ifndef DUMA_ASSERT #define DUMA_ASSERT(EXPR) ( (EXPR) || ( _duma_assert(#EXPR, __FILE__, __LINE__), 0 ) ) #endif /* * protection of functions return address */ #ifdef __GNUC__ #define DUMA_FN_PROT_START const void * DUMA_RET_ADDR = __builtin_return_address(0); { #define DUMA_FN_PROT_END } DUMA_ASSERT( __builtin_return_address(0) == DUMA_RET_ADDR ); #define DUMA_FN_PROT_RET(EXPR) do { DUMA_ASSERT( __builtin_return_address(0) == DUMA_RET_ADDR ); return( EXPR ); } while (0) #define DUMA_FN_PROT_RET_VOID() do { DUMA_ASSERT( __builtin_return_address(0) == DUMA_RET_ADDR ); return; } while (0) #else #define DUMA_FN_PROT_START int aiDUMA_PROT[ 4 ] = { 'E', 'F', 'P', 'R' }; { #define DUMA_FN_PROT_END } DUMA_ASSERT( 'E'==aiDUMA_PROT[0] && 'F'==aiDUMA_PROT[1] && 'P'==aiDUMA_PROT[2] && 'R'==aiDUMA_PROT[3] ); #define DUMA_FN_PROT_RET(EXPR) do { DUMA_ASSERT( 'E'==aiDUMA_PROT[0] && 'F'==aiDUMA_PROT[1] && 'P'==aiDUMA_PROT[2] && 'R'==aiDUMA_PROT[3] ); return( EXPR ); } while (0) #define DUMA_FN_PROT_RET_VOID() do { DUMA_ASSERT( 'E'==aiDUMA_PROT[0] && 'F'==aiDUMA_PROT[1] && 'P'==aiDUMA_PROT[2] && 'R'==aiDUMA_PROT[3] ); return; } while (0) #endif /* declaration of an already defined array to enable checking at every reference * when using CA_REF() */ #define CA_DECLARE(NAME,SIZE) \ const unsigned long NAME ## _checkedsize = (SIZE); \ unsigned long NAME ## _checkedidx /* definition of a checked array adds definitions for its size and an extra temporary. * every array gets its own temporary to avoid problems with threading * a global temporary would have. */ #define CA_DEFINE(TYPE,NAME,SIZE) TYPE NAME[SIZE]; CA_DECLARE(NAME,SIZE) /* every access to a checked array is preceded an assert() on the index; * the index parameter is stored to a temporary to avoid double execution of index, * when index contains f.e. a "++". */ #define CA_REF(NAME,INDEX) \ NAME[ DUMA_ASSERT( (NAME ## _checkedidx = (INDEX)) < NAME ## _checkedsize ), NAME ## _checkedidx ] #endif /* end ifdef __KDUMA_H__ */ // endduma-VERSION_2_5_21/kduma/log.h000066400000000000000000000032651401225056000161320ustar00rootroot00000000000000/* * log2comp.h - various base 2 log computation versions * * Asterisk -- A telephony toolkit for Linux. * * Alex Volkov * * Copyright (c) 2004 - 2005, Digium Inc. * * This program is free software, distributed under the terms of * the GNU General Public License * * Define WANT_ASM before including this file to use assembly * whenever possible */ /* $Id$ */ #if defined(_MSC_VER) # define inline __inline #elif defined(__GNUC__) # define inline __inline__ #else # define inline #endif #if defined(WANT_ASM) && defined(_MSC_VER) && defined(_M_IX86) /* MS C Inline Asm */ # pragma warning( disable : 4035 ) static inline int ilog2(int val) { __asm { xor eax, eax dec eax bsr eax, val }} # pragma warning( default : 4035 ) #elif defined(WANT_ASM) && defined(__GNUC__) && (defined(__i386__) || defined(i386)) /* GNU Inline Asm */ /* Function: ilog2 * * Base 2 log computation. Used to calculate order * parameters for kernel page allocations. */ static inline int ilog2(int val) { int a; __asm__ ("\ xorl %0, %0 ;\ decl %0 ;\ bsrl %1, %0 ;\ " : "=r" (a) : "mr" (val) : "cc" ); return a; } #elif defined(WANT_ASM) && defined(__GNUC__) && defined(__powerpc__) static inline int ilog2(int val) { int a; __asm__ ("cntlzw %0,%1" : "=r" (a) : "r" (val) ); return 31-a; } #else /* no ASM for this compiler and/or platform */ /* rather slow base 2 log computation * Using looped shift. */ static inline int ilog2(int val) { int i; for (i = -1; val; ++i, val >>= 1) ; return (i); } #endif /* Variable: none * * Fake variable to make docs work right :( */ // endduma-VERSION_2_5_21/kduma/paging.h000066400000000000000000000066501401225056000166170ustar00rootroot00000000000000 /* * KDUMA - Kernel Mode Red-Zone memory allocator. * Copyright (C) 2006 Michael Eddington * Copyright (C) 2006 Eric Rachner * Copyright (C) 2002-2005 Hayati Ayguen , Procitec GmbH * Copyright (C) 1987-1999 Bruce Perens * License: GNU GPL (GNU General Public License, see COPYING-GPL) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ /* $Id$ */ #ifndef DUMA_PAGING_H #define DUMA_PAGING_H #include "log.h" /* * Lots of systems are missing the definition of PROT_NONE. */ #ifndef PROT_NONE #define PROT_NONE 0 #endif #ifndef size_t #define size_t unsigned long #endif static caddr_t startAddr = (caddr_t) 0; /* Function: mprotectFailed * * Report that VirtualProtect or mprotect failed and abort * program execution. */ static void mprotectFailed(void) { DUMA_Abort("mprotect() failed: %s", stringErrorReport()); } /* Function: Page_Create * * Create memory. Allocates actual memory. Uses * VirtualAlloc on windows and mmap on unix. * * flags - Passed along from kmalloc (GFP_ATOMIC and the like) * * See Also: * */ static void * Page_Create(size_t size, int exitonfail, int printerror, int flags) { caddr_t allocation; unsigned long numPages = size/DUMA_PAGE_SIZE; if( size % DUMA_AGE_SIZE ) numPages++; unsigned long order = ilog2(numPages); allocation = __get_free_pages(flags, order); if ( allocation == 0 ) { if ( exitonfail ) DUMA_Abort("__get_fre_pages(%d, %d) failed: %s", flags, order, stringErrorReport()); else if ( printerror ) DUMA_Print("\nDUMA warning: __get_fre_pages(%d, %d) failed: %s", flags, order, stringErrorReport()); } return (void *)allocation; } /* Function: Page_AllowAccess * * Allow memory access to allocated memory. * * See Also: * */ void Page_AllowAccess(void * address, size_t size) { if ( mprotect((caddr_t)address, size, PROT_READ|PROT_WRITE) < 0 ) mprotectFailed(); #endif } /* Function: Page_DenyAccess * * Deny access to allocated memory region. * * See Also: * */ static void Page_DenyAccess(void * address, size_t size) { if ( mprotect((caddr_t)address, size, PROT_NONE) < 0 ) mprotectFailed(); } extern struct _DUMA_Slot; /* Function: Page_Delete * * Free's DUMA allocated memory. This is the real deal, make sure * the page is no longer in our slot list first! * * See Also: * */ static void Page_Delete(void * address, size_t size) { unsigned long numPages = size/DUMA_PAGE_SIZE; if( size % DUMA_AGE_SIZE ) numPages++; unsigned long order = ilog2(numPages); __free_pages(address, size); } /* Function: Page_Size * * Retrieve page size. */ static size_t Page_Size(void) { return getpagesize(); } #endif /* DUMA_PAGING_H */duma-VERSION_2_5_21/make_git_source_version.sh000077500000000000000000000034651401225056000213450ustar00rootroot00000000000000#!/usr/bin/env sh if [ -f "./.release" ]; then export RELEASED=1 export RELENG="prepared" else export RELENG="built" fi rm -f ./.release 2> /dev/null get_git_info() { if command command true 2> /dev/null 1>&2; then if command git version 2> /dev/null 1>&2; then GITTEST=$(git version 2> /dev/null) # shellcheck disable=SC2236 if [ -n "${GITTEST}" ] && [ ! -z "${GITTEST}" ]; then BRANCH=$(git branch --show-current 2> /dev/null) if [ -n "${RELEASED}" ] && [ ! -z "${RELEASED}" ]; then GITVER=$(git describe --tags --always 2> /dev/null \ | cut -d "-" -f 1 2> /dev/null) else GITVER=$(git describe --tags --dirty --broken --long --always \ 2> /dev/null) fi if [ ! -n "${BRANCH}" ] || [ -z "${BRANCH}" ]; then BRANCH="nobranch" fi if [ ! -n "${RELEASED}" ] && [ -z "${RELEASED}" ]; then if [ -n "${GITVER}" ] && [ ! -z "${GITVER}" ]; then GIT_OUT=" ${GITVER}-${BRANCH}" fi fi if [ -n "${GITVER}" ] && [ ! -z "${GITVER}" ]; then GIT_OUT=" ${GITVER}" fi fi fi fi GIT_SOURCE_INFO="DUMA${GIT_OUT}" GIT_SOURCE_XFRM=$(printf '%s\n' "${GIT_SOURCE_INFO}" \ | sed -e 's/\VERSION_//' -e 's/_/\./g' 2> /dev/null) # shellcheck disable=SC2236 if [ -n "${GIT_SOURCE_XFRM}" ] && [ ! -z "${GIT_SOURCE_XFRM}" ]; then printf '%s\n' "${GIT_SOURCE_XFRM}" else printf '%s\n' "${GIT_SOURCE_INFO}" fi } get_utc_date() { UTC_DATE=$(TZ=UTC date -u "+%D %T" 2> /dev/null) # shellcheck disable=SC2236 if [ -n "${UTC_DATE}" ] && [ ! -z "${UTC_DATE}" ]; then UTC_DATE_INFO=", ${RELENG} ${UTC_DATE}" else UTC_DATE_INFO="" fi printf '%s\n' "${UTC_DATE_INFO}" } BUILD_VER=$(get_git_info) BUILD_UTC=$(get_utc_date) printf '%s\n' "// Auto-generated git information." printf '%s\n' "#define GIT_SOURCE_VERSION \"${BUILD_VER}${BUILD_UTC} (\"" duma-VERSION_2_5_21/mkclean.bat000066400000000000000000000001401401225056000161660ustar00rootroot00000000000000@echo off del *.ncb del *.opt del *.plg del debug\*.* del release\*.* rmdir debug rmdir release duma-VERSION_2_5_21/noduma.h000066400000000000000000000064021401225056000155270ustar00rootroot00000000000000/* * DUMA - Red-Zone memory allocator. * Copyright (C) 2002-2009 Hayati Ayguen , Procitec GmbH * Copyright (C) 1987-1999 Bruce Perens * License: GNU GPL (GNU General Public License, see COPYING-GPL) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * * FILE CONTENTS: * header file for inclusion from YOUR application code. * Include this header before including foreign includes * from inside your own headers files. */ /* remove previous DUMA definitions */ #ifdef DUMA_newFrame #undef DUMA_newFrame #endif #ifdef DUMA_delFrame #undef DUMA_delFrame #endif #ifdef DUMA_SET_ALIGNMENT #undef DUMA_SET_ALIGNMENT #endif #ifdef DUMA_SET_PROTECT_BELOW #undef DUMA_SET_PROTECT_BELOW #endif #ifdef DUMA_SET_FILL #undef DUMA_SET_FILL #endif /* remove previous wrappers to standard C functions */ #ifdef malloc #undef malloc #endif #ifdef calloc #undef calloc #endif #ifdef free #undef free #endif #ifdef memalign #undef memalign #endif #ifdef posix_memalign #undef posix_memalign #endif #ifdef realloc #undef realloc #endif #ifdef valloc #undef valloc #endif #ifdef strdup #undef strdup #endif #ifdef memcpy #undef memcpy #endif #ifdef memmove #undef memmove #endif #ifdef strcpy #undef strcpy #endif #ifdef strncpy #undef strncpy #endif #ifdef strcat #undef strcat #endif #ifdef strncat #undef strncat #endif #ifndef SKIP_DUMA_NO_CXX /* remove previous wrappers to standard C++ functions / operators */ #ifdef new #undef new #endif #ifdef delete #undef delete #endif #ifdef new_NOTHROW #undef new_NOTHROW #endif /* remove previous DUMA C++ definitions */ #ifdef NEW_ELEM #undef NEW_ELEM #endif #ifdef NEW_ARRAY #undef NEW_ARRAY #endif #ifdef NEW_ELEM_NOTHROW #undef NEW_ELEM_NOTHROW #endif #ifdef NEW_ARRAY_NOTHROW #undef NEW_ARRAY_NOTHROW #endif #ifdef DEL_ELEM #undef DEL_ELEM #endif #ifdef DEL_ARRAY #undef DEL_ARRAY #endif #ifdef DEL_ELEM_NOTHROW #undef DEL_ELEM_NOTHROW #endif #ifdef DEL_ARRAY_NOTHROW #undef DEL_ARRAY_NOTHROW #endif #endif /* SKIP_DUMA_NO_CXX */ /* remove definitions for protection of functions return address */ #ifdef DUMA_FN_PROT_START #undef DUMA_FN_PROT_START #endif #ifdef DUMA_FN_PROT_END #undef DUMA_FN_PROT_END #endif #ifdef DUMA_FN_PROT_RET #undef DUMA_FN_PROT_RET #endif #ifdef DUMA_FN_PROT_RET_VOID #undef DUMA_FN_PROT_RET_VOID #endif /* remove (C)hecked (A)rray definitions */ #ifdef CA_DECLARE #undef CA_DECLARE #endif #ifdef CA_DEFINE #undef CA_DEFINE #endif #ifdef CA_REF #undef CA_REF #endif /* Following defines are kept: * * DUMA_ASSERT * DUMA_CHECK * DUMA_CHECKALL * DUMA_CDECL * DUMA_SIZE_T * DUMA_MAX_DEL_DEPTH * */ duma-VERSION_2_5_21/paging.h000066400000000000000000000242241401225056000155130ustar00rootroot00000000000000/* * DUMA - Red-Zone memory allocator. * Copyright (C) 2002-2009 Hayati Ayguen , Procitec GmbH * Copyright (C) 2006 Michael Eddington * Copyright (C) 1987-1999 Bruce Perens * License: GNU GPL (GNU General Public License, see COPYING-GPL) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * * FILE CONTENTS: * internal implementation file * contains system/platform dependent paging functions */ #ifndef DUMA_PAGING_H #define DUMA_PAGING_H /* * Lots of systems are missing the definition of PROT_NONE. */ #ifndef PROT_NONE #define PROT_NONE 0 #endif /* * 386 BSD has MAP_ANON instead of MAP_ANONYMOUS. */ #if ( !defined(MAP_ANONYMOUS) && defined(MAP_ANON) ) #define MAP_ANONYMOUS MAP_ANON #endif /* * For some reason, I can't find mprotect() in any of the headers on * IRIX or SunOS 4.1.2 */ /* extern C_LINKAGE int mprotect(void * addr, size_t len, int prot); */ #if !defined(WIN32) static caddr_t startAddr = (caddr_t) 0; #endif /* Function: stringErrorReport * * Get formatted error string and return. For WIN32 * FormatMessage is used, strerror all else. */ static const char * stringErrorReport(void) { #if defined(WIN32) DWORD LastError; LPVOID lpMsgBuf; LastError = GetLastError(); FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS , NULL , LastError , MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT) /* Default language */ , (LPTSTR) &lpMsgBuf , 0 , NULL ); return (char*)lpMsgBuf; /* "Unknown error.\n"; */ #else # ifndef DUMA_NO_STRERROR static int failing; if ( !failing ) { const char *str; failing++; str = strerror(errno); failing--; if ( str != NULL ) return str; } # endif return DUMA_strerror(errno); #endif } /* Function: mprotectFailed * * Report that VirtualProtect or mprotect failed and abort * program execution. */ static void mprotectFailed(void) { #if defined(WIN32) DUMA_Abort("VirtualProtect() failed: %s", stringErrorReport()); #else DUMA_Abort("mprotect() failed: %s.\nCheck README section 'MEMORY USAGE AND EXECUTION SPEED'\n your (Linux) system may limit the number of different page mappings per process", stringErrorReport()); #endif } /* Function: Page_Create * * Create memory. Allocates actual memory. Uses * VirtualAlloc on windows and mmap on unix. * * See Also: * */ static void * Page_Create(size_t size, int exitonfail, int printerror) { caddr_t allocation; #if defined(WIN32) allocation = VirtualAlloc( NULL /* address of region to reserve or commit */ , (DWORD) size /* size of region */ , (DWORD) MEM_COMMIT /* type of allocation */ , (DWORD) PAGE_READWRITE /* type of access protection */ ); if ( (caddr_t)0 == allocation ) { if ( exitonfail ) DUMA_Abort("VirtualAlloc(%d) failed: %s", (DUMA_SIZE)size, stringErrorReport()); else if ( printerror ) DUMA_Print("\nDUMA warning: VirtualAlloc(%d) failed: %s", (DUMA_SIZE)size, stringErrorReport()); } #elif defined(MAP_ANONYMOUS) /* * In this version, "startAddr" is a _hint_, not a demand. * When the memory I map here is contiguous with other * mappings, the allocator can coalesce the memory from two * or more mappings into one large contiguous chunk, and thus * might be able to find a fit that would not otherwise have * been possible. I could _force_ it to be contiguous by using * the MMAP_FIXED flag, but I don't want to stomp on memory mappings * generated by other software, etc. */ allocation = (caddr_t) mmap( startAddr , (int)size , PROT_READ|PROT_WRITE , MAP_PRIVATE|MAP_ANONYMOUS , -1 , 0 ); #ifndef __hpux /* * Set the "address hint" for the next mmap() so that it will abut * the mapping we just created. * * HP/UX 9.01 has a kernel bug that makes mmap() fail sometimes * when given a non-zero address hint, so we'll leave the hint set * to zero on that system. HP recently told me this is now fixed. * Someone please tell me when it is probable to assume that most * of those systems that were running 9.01 have been upgraded. */ startAddr = allocation + size; #endif if ( allocation == (caddr_t)-1 ) { allocation = (caddr_t)0; if ( exitonfail ) DUMA_Abort("mmap(%d) failed: %s", (DUMA_SIZE)size, stringErrorReport()); else if ( printerror ) DUMA_Print("\nDUMA warning: mmap(%d) failed: %s", (DUMA_SIZE)size, stringErrorReport()); } #else static int devZeroFd = -1; if ( devZeroFd == -1 ) { devZeroFd = open("/dev/zero", O_RDWR); if ( devZeroFd < 0 ) DUMA_Abort( "open() on /dev/zero failed: %s", stringErrorReport() ); } /* * In this version, "startAddr" is a _hint_, not a demand. * When the memory I map here is contiguous with other * mappings, the allocator can coalesce the memory from two * or more mappings into one large contiguous chunk, and thus * might be able to find a fit that would not otherwise have * been possible. I could _force_ it to be contiguous by using * the MMAP_FIXED flag, but I don't want to stomp on memory mappings * generated by other software, etc. */ allocation = (caddr_t) mmap( startAddr , (int)size , PROT_READ|PROT_WRITE , MAP_PRIVATE , devZeroFd , 0 ); startAddr = allocation + size; if ( allocation == (caddr_t)-1 ) { allocation = (caddr_t)0; if ( exitonfail ) DUMA_Abort("mmap(%d) failed: %s", (DUMA_SIZE)size, stringErrorReport()); else if ( printerror ) DUMA_Print("\nDUMA warning: mmap(%d) failed: %s", (DUMA_SIZE)size, stringErrorReport()); } #endif // TESTING // memset((void*)allocation, 0, startAddr); return (void *)allocation; } /* Function: Page_AllowAccess * * Allow memory access to allocated memory. * * See Also: * */ void Page_AllowAccess(void * address, size_t size) { #if defined(WIN32) SIZE_T OldProtect, retQuery; MEMORY_BASIC_INFORMATION MemInfo; size_t tail_size; BOOL ret; while (size >0) { retQuery = VirtualQuery(address, &MemInfo, sizeof(MemInfo)); if (retQuery < sizeof(MemInfo)) DUMA_Abort("VirtualQuery() failed\n"); tail_size = (size > MemInfo.RegionSize) ? MemInfo.RegionSize : size; ret = VirtualProtect( (LPVOID) address /* address of region of committed pages */ , (DWORD) tail_size /* size of the region */ , (DWORD) PAGE_READWRITE /* desired access protection */ , (PDWORD) &OldProtect /* address of variable to get old protection */ ); if (0 == ret) mprotectFailed(); address = ((char *)address) + tail_size; size -= tail_size; } #else if ( mprotect((caddr_t)address, size, PROT_READ|PROT_WRITE) < 0 ) mprotectFailed(); #endif } /* Function: Page_DenyAccess * * Deny access to allocated memory region. * * See Also: * */ static void Page_DenyAccess(void * address, size_t size) { #if defined(WIN32) SIZE_T OldProtect, retQuery; MEMORY_BASIC_INFORMATION MemInfo; size_t tail_size; BOOL ret; while (size >0) { retQuery = VirtualQuery(address, &MemInfo, sizeof(MemInfo)); if (retQuery < sizeof(MemInfo)) DUMA_Abort("VirtualQuery() failed\n"); tail_size = (size > MemInfo.RegionSize) ? MemInfo.RegionSize : size; ret = VirtualProtect( (LPVOID) address /* address of region of committed pages */ , (DWORD) tail_size /* size of the region */ , (DWORD) PAGE_NOACCESS /* desired access protection */ , (PDWORD) &OldProtect /* address of variable to get old protection */ ); if (0 == ret) mprotectFailed(); address = ((char *)address) + tail_size; size -= tail_size; } #else if ( mprotect((caddr_t)address, size, PROT_NONE) < 0 ) mprotectFailed(); #endif } /* Function: Page_Delete * * Free's DUMA allocated memory. This is the real deal, make sure * the page is no longer in our slot list first! * * See Also: * */ static void Page_Delete(void * address, size_t size) { #if defined(WIN32) void * alloc_address = address; SIZE_T retQuery; MEMORY_BASIC_INFORMATION MemInfo; BOOL ret; /* release physical memory commited to virtual address space */ while (size >0) { retQuery = VirtualQuery(address, &MemInfo, sizeof(MemInfo)); if (retQuery < sizeof(MemInfo)) DUMA_Abort("VirtualQuery() failed\n"); if ( MemInfo.State == MEM_COMMIT ) { ret = VirtualFree( (LPVOID) MemInfo.BaseAddress /* base of committed pages */ , (DWORD) MemInfo.RegionSize /* size of the region */ , (DWORD) MEM_DECOMMIT /* type of free operation */ ); if (0 == ret) DUMA_Abort("VirtualFree(,,MEM_DECOMMIT) failed: %s", stringErrorReport()); } address = ((char *)address) + MemInfo.RegionSize; size -= MemInfo.RegionSize; } /* release virtual address space */ ret = VirtualFree( (LPVOID) alloc_address , (DWORD) 0 , (DWORD) MEM_RELEASE ); if (0 == ret) DUMA_Abort("VirtualFree(,,MEM_RELEASE) failed: %s", stringErrorReport()); #else if ( munmap((caddr_t)address, size) < 0 ) Page_DenyAccess(address, size); #endif } /* Function: Page_Size * * Retrieve page size. */ static size_t Page_Size(void) { #if defined(WIN32) SYSTEM_INFO SystemInfo; GetSystemInfo( &SystemInfo ); return (size_t)SystemInfo.dwPageSize; #elif defined(_SC_PAGESIZE) return (size_t)sysconf(_SC_PAGESIZE); #elif defined(_SC_PAGE_SIZE) return (size_t)sysconf(_SC_PAGE_SIZE); #else return getpagesize(); #endif } #endif /* DUMA_PAGING_H */ duma-VERSION_2_5_21/print.c000066400000000000000000000221061401225056000153720ustar00rootroot00000000000000/* * DUMA - Red-Zone memory allocator. * Copyright (C) 2006 Michael Eddington * Copyright (C) 2002-2008 Hayati Ayguen , Procitec GmbH * Copyright (C) 1987-1999 Bruce Perens * License: GNU GPL (GNU General Public License, see COPYING-GPL) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * * FILE CONTENTS: * internal implementation file * contains aborting, printing functions with minor system/platform dependencies */ #include #include #include #include #ifndef WIN32 #include #include #include #include #else #define WIN32_LEAN_AND_MEAN 1 #include #include #include #include #endif #if(defined(__MINGW32__) || defined(__MINGW64__) || defined(__CYGWIN__)) /* use these for mingw */ #include #include #else /* already defined in cygwin headers */ #ifndef LPVOID typedef void *LPVOID; #endif #if(defined(caddr_t) && defined(daddr_t)) #ifndef __USE_MISC typedef LPVOID caddr_t; #endif // __USE_MISC #endif // (defined(caddr_t) && defined(daddr_t)) #endif // (defined(__MINGW32__) || defined(__MINGW64__) || defined(__CYGWIN__)) #ifdef _MSC_VER #include #endif #include "duma.h" #include "noduma.h" #include "print.h" /* * NBBY is the number of bits per byte. Some systems define it in */ #ifndef NBBY #define NBBY 8 #endif /* * These routines do their printing without using stdio. Stdio can't * be used because it calls malloc(). Internal routines of a malloc() * debugger should not re-enter malloc(), so stdio is out. */ /* define prototypes / forward declarations */ static int sprintAddr(char* dest, DUMA_ADDR addr, DUMA_ADDR base); static int sprintLong(char* dest, long number, long base); static int DUMA_vsprintf(char* buffer, const char *pattern, va_list args); /* * NUMBER_BUFFER_SIZE is the longest character string that could be needed * to represent an unsigned integer, assuming we might print in base 2. * Any other representation (base 10 or 16) will need less characters. */ #define NUMBER_BUFFER_SIZE (sizeof(DUMA_ADDR) * NBBY) #define STRING_BUFFER_SIZE 4096 /* Function: sprintAddr * * internal function to print a DUMA_ADDR into a buffer */ static int sprintAddr(char* dest, DUMA_ADDR value, DUMA_ADDR base) { char buffer[NUMBER_BUFFER_SIZE+1]; char * s = &buffer[NUMBER_BUFFER_SIZE]; int size; DUMA_ADDR digit; do { if ( --s == buffer ) DUMA_Abort("Internal error printing number."); digit = value % base; *s = (char)( (digit < 10) ? ('0' + digit) : ('a' + digit -10) ); } while ( (value /= base) > 0 ); size = &buffer[NUMBER_BUFFER_SIZE] - s; buffer[NUMBER_BUFFER_SIZE] = '\0'; strcpy(dest, s); return size; } /* Function: sprintLong * * internal function to print a int into a buffer */ static int sprintLong(char* dest, long value, long base) { char buffer[NUMBER_BUFFER_SIZE+1]; char * s = &buffer[NUMBER_BUFFER_SIZE]; long size; long digit; do { if ( --s == buffer ) DUMA_Abort("Internal error printing number."); digit = value % base; *s = (char)( (digit < 10) ? ('0' + digit) : ('a' + digit -10) ); } while ( (value /= base) > 0 ); size = &buffer[NUMBER_BUFFER_SIZE] - s; buffer[NUMBER_BUFFER_SIZE] = '\0'; strcpy(dest, s); return size; } /* Function: DUMA_vsprintf * * internal function to print a formatted string into a buffer * int sprintf(char* buffer, const char *pattern, va_list args) * allowed format specifier are: * * %a = adress of type DUMA_ADDR * %x = adress of type DUMA_ADDR * %d = unsigned of type DUMA_SIZE * %i = int * %l = long * %s = string teminated with '\0' * %c = char */ static int DUMA_vsprintf(char* buffer, const char *pattern, va_list args) { char c; static const char bad_pattern[] = "\nDUMA: Bad pattern specifier %%%c in DUMA_Print().\n"; const char * s = pattern; int len = 0; DUMA_ADDR n; c = *s++; while ( c ) { if ( c == '%' ) { c = *s++; switch ( c ) { case '%': buffer[len++] = c; break; case 'a': /* DUMA_ADDR */ case 'x': /* DUMA_ADDR */ /* * Print an address passed as a void pointer. * The type of DUMA_ADDR must be set so that * it is large enough to contain all of the * bits of a void pointer. */ n = va_arg(args, DUMA_ADDR); len += sprintAddr(&buffer[len], n, 16); break; case 'd': /* DUMA_SIZE */ n = va_arg(args, DUMA_SIZE); len += sprintAddr(&buffer[len], n, 10); break; case 'i': /* int */ { long n = (long)va_arg(args, int); if ( n < 0 ) { buffer[len++] = '-'; n = -n; } len += sprintLong(&buffer[len], n, 10); break; } case 'l': /* long */ { long n = va_arg(args, long); if ( n < 0 ) { buffer[len++] = '-'; n = -n; } len += sprintLong(&buffer[len], n, 10); break; } case 's': /* string */ { const char * string; size_t length; string = va_arg(args, char *); if (string) { length = strlen(string); strcpy(&buffer[len], string); } else { length = 4; /* = strlen("NULL") */ strcpy(&buffer[len], "NULL"); } len += length; break; } case 'c': /* char */ /* characters are passed as int ! */ buffer[len++] = (char)va_arg(args, int); break; default: DUMA_Print(bad_pattern, c); } } else /* if ( c != '%' ) */ buffer[len++] = c; c = *s++; } /* end while (c) */ buffer[len] = '\0'; return len; } /* Function: DUMA_Abort * * external abort function * on Visual C++ it additionally prints to Debug Output of the IDE * void DUMA_Abort(const char * pattern, ...) */ void DUMA_Abort(const char * pattern, ...) { char buffer[STRING_BUFFER_SIZE]; int lena, lenb; va_list args; va_start(args, pattern); strcpy(buffer, "\nDUMA Aborting: "); lena = strlen(buffer); lenb = DUMA_vsprintf(&buffer[lena], pattern, args); strcat(buffer, "\n"); DUMA_Print("%s", buffer); va_end(args); #ifndef WIN32 /* * I use kill(getpid(), SIGILL) instead of abort() because some * mis-guided implementations of abort() flush stdio, which can * cause malloc() or free() to be called. */ kill(getpid(), SIGILL); #else /* Windows doesn't have a kill() */ abort(); #endif /* Just in case something handles SIGILL and returns, exit here. */ _exit(-1); } /* Function: DUMA_Print * * external print function * on Visual C++ it additionally prints to Debug Output of the IDE * void DUMA_Print(const char * pattern, ...) */ void DUMA_Print(const char * pattern, ...) { char buffer[STRING_BUFFER_SIZE]; int len, fd; va_list args; va_start(args, pattern); len = DUMA_vsprintf(buffer, pattern, args); va_end(args); #ifdef WIN32 if(DUMA_OUTPUT_DEBUG) OutputDebugString(buffer); #endif if(DUMA_OUTPUT_STDOUT) write(1, buffer, len); if(DUMA_OUTPUT_STDERR) write(2, buffer, len); if(DUMA_OUTPUT_FILE != NULL) { #if defined(WIN32) && !defined(__CYGWIN__) fd = _open(DUMA_OUTPUT_FILE, _O_APPEND|_O_CREAT|_O_WRONLY, 0600); #else fd = open(DUMA_OUTPUT_FILE, O_APPEND|O_CREAT|O_WRONLY, 0600); #endif if ( fd >= 0 ) { write(fd, buffer, len); #if defined(WIN32) && !defined(__CYGWIN__) _close(fd); #else close(fd); #endif } } } /* Function: DUMA_Exit * * external exit function * on Visual C++ it additionally prints to Debug Output of the IDE * void DUMA_Exit(const char * pattern, ...) */ void DUMA_Exit(const char * pattern, ...) { char buffer[STRING_BUFFER_SIZE]; int lena, lenb; va_list args; va_start(args, pattern); strcpy(buffer, "\nDUMA Exiting: "); lena = strlen(buffer); lenb = DUMA_vsprintf(&buffer[lena], pattern, args); strcat(buffer, "\n"); DUMA_Print("%s", buffer); #ifdef WIN32 if(DUMA_OUTPUT_DEBUG) OutputDebugString(buffer); #endif va_end(args); /* * I use _exit() because the regular exit() flushes stdio, * which may cause malloc() or free() to be called. */ _exit(-1); } /* Function: DUMA_sprintf */ void DUMA_sprintf(char* buffer, const char * pattern, ...) { int len; va_list args; va_start(args, pattern); len = DUMA_vsprintf(buffer, pattern, args); va_end(args); if (len <= 0) buffer[0] = 0; } const char * DUMA_strerror(int duma_errno) { static char acStrError[STRING_BUFFER_SIZE]; DUMA_sprintf(acStrError, "System Error Number 'errno' from Standard C Library is %i\n", duma_errno); return acStrError; } /* end */ duma-VERSION_2_5_21/print.h000066400000000000000000000032261401225056000154010ustar00rootroot00000000000000/* * DUMA - Red-Zone memory allocator. * Copyright (C) 2002-2008 Hayati Ayguen , Procitec GmbH * Copyright (C) 1987-1999 Bruce Perens * License: GNU GPL (GNU General Public License, see COPYING-GPL) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * * FILE CONTENTS: * internal header file * contains aborting, printing functions with minor system/platform dependencies */ #ifndef DUMA_PRINT_H #define DUMA_PRINT_H /* * These routines do their printing without using stdio. Stdio can't * be used because it calls malloc(). Internal routines of a malloc() * debugger should not re-enter malloc(), so stdio is out. */ #ifdef __cplusplus extern "C" { #endif void DUMA_Abort(const char * pattern, ...); void DUMA_Print(const char * pattern, ...); void DUMA_Exit(const char * pattern, ...); void DUMA_sprintf(char* buffer, const char * pattern, ...); const char * DUMA_strerror(int duma_errno); #ifdef __cplusplus } /* extern "C" */ #endif #endif /* DUMA_PRINT_H */ duma-VERSION_2_5_21/prj/000077500000000000000000000000001401225056000146645ustar00rootroot00000000000000duma-VERSION_2_5_21/prj/codeblocks/000077500000000000000000000000001401225056000167745ustar00rootroot00000000000000duma-VERSION_2_5_21/prj/codeblocks/duma_shared/000077500000000000000000000000001401225056000212505ustar00rootroot00000000000000duma-VERSION_2_5_21/prj/codeblocks/duma_shared/duma_shared.cbp000066400000000000000000000036121401225056000242140ustar00rootroot00000000000000 duma-VERSION_2_5_21/prj/codeblocks/duma_static/000077500000000000000000000000001401225056000212715ustar00rootroot00000000000000duma-VERSION_2_5_21/prj/codeblocks/duma_static/duma_static.cbp000066400000000000000000000035201401225056000242540ustar00rootroot00000000000000 duma-VERSION_2_5_21/refactoring.sh000077500000000000000000000040761401225056000167420ustar00rootroot00000000000000#!/bin/sh # Script to do refactoring of duma.. (put all files in extra subfolders to # make it somewhat more organized ;-) # planned folder structure: # # contrib/ <-- contribution: serveral bash/gdb scripts # contrib/debian <-- debian files? outdated! # contrib/ebuild <-- gentoo files? # contrib/rpm <-- rpm spec file? # # doc/ <-- documentation goes here # doc/comparisons/ <-- copy of JP Martin's site # # include/ <-- headers go in here # include/duma/ <-- duma headers go in here # include/dumadetours/ <-- dumadetours headers go in here # # lib/ <-- compiled (shared) libs # obj/ <-- compiled objects # # src/ <-- sources go in here # src/libduma/ <-- duma sources go in here #### src/dumadetours/ <-- dumadetours sources go in here. --- not necessary # test/ <-- test programs used to check the integrity of duma # go in here # examples/ <-- example code # examples/cpp <-- C++ examples # examples/C <-- C examples (TODO ?) # prj/ <-- project files # win32-*, codeblocks, later: eclipse # mkdir contrib mv gdbinit.rc contrib/ mv duma.sh contrib/ mv builddocs.bat contrib/ mv mkclean.bat contrib/ mkdir doc mv README.txt doc/ mv INSTALL doc/ mv CHANGELOG doc/ mv TODO doc/ mv duma.3 doc/ mv WIN32_DETOURS_HOWTO.txt doc/ mv comparisons doc/ mkdir include mkdir include/duma mv noduma.h include/duma/ mv duma.h include/duma/ mv dumapp.h include/duma/ mv duma_sem.h include/duma/ mv duma_config.h include/duma/ # mkdir include/dumadetours mkdir lib mkdir obj mkdir src mkdir src/libduma mv duma.c src/libduma/ mv duma_hlp.h src/libduma/ mv paging.h src/libduma/ mv print.h src/libduma/ mv print.c src/libduma/ mv sem_inc.c src/libduma/ mv dumapp.cpp src/libduma/ mkdir src/conf mv createconf.c src/conf/ mv stacktrace src/ mkdir examples mkdir examples/cpp mv example*cpp examples/cpp/ mkdir prj mv win32-* prj/ mv codeblocks prj/ duma-VERSION_2_5_21/renovate.json000066400000000000000000000000411401225056000166020ustar00rootroot00000000000000{ "extends": ["config:base"] } duma-VERSION_2_5_21/sem_inc.c000066400000000000000000000174311401225056000156600ustar00rootroot00000000000000/* * DUMA - Red-Zone memory allocator. * Copyright (C) 2002-2008 Hayati Ayguen , Procitec GmbH * License: GNU LGPL (GNU Lesser General Public License, see COPYING-GPL) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * FILE CONTENTS: * internal implementation file * contains thread safety functions (semaphore lock/release) */ #include "duma_config.h" #include "duma_sem.h" #include "print.h" #ifndef DUMA_NO_THREAD_SAFETY /* check for pthread library */ /* use WIN32_SEMAPHORES on Win32-Cygwin, * with this configuration testmt.c works either with pthreads and with the Win32 API */ #if (!defined(WIN32)) #define HAVE_PTHREADS 1 #define USE_WIN32_SEMAPHORES 0 #define USE_WIN32_CRIT_SECT 0 #elif ( defined(__MINGW32__) || defined(__MINGW64__) || defined(__CYGWIN__) || defined(__CYGWIN32__) || defined(__CYGWIN64__) ) #define HAVE_PTHREADS 0 #define USE_WIN32_SEMAPHORES 0 #define USE_WIN32_CRIT_SECT 1 #else #define HAVE_PTHREADS 0 #define USE_WIN32_SEMAPHORES 0 #define USE_WIN32_CRIT_SECT 1 #endif #if HAVE_PTHREADS #include #include #elif USE_WIN32_SEMAPHORES || USE_WIN32_CRIT_SECT #define WIN32_LEAN_AND_MEAN 1 #include #include #endif /* * DUMA_sem is a semaphore used to allow one thread at a time into * these routines. * Also, we use semInited as a boolean to see if we should be * using the semaphore. * semThread is set to the thread id of the thread that currently * has the semaphore so that when/if it tries to get the semaphore * again (realloc calling malloc/free) - nothing will happen to the * semaphore. * semDepth is used to keep track of how many times the same thread * gets the semaphore - so we know when it is actually freed. */ #if HAVE_PTHREADS #define DUMA_thread_self() pthread_self() #ifndef DUMA_SEMAPHORES static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; static pthread_t mutextid=0; static int locknr=0; #else static sem_t DUMA_sem = { 0 }; static pthread_t semThread = (pthread_t) 0; #endif #elif USE_WIN32_SEMAPHORES #define DUMA_thread_self() GetCurrentThreadId() #ifndef UNICODE #define SEM_NAME_TYPE char #define SEM_STRCPY strcpy #define SEM_STRCAT strcat static char semObjectName[] = "DUMA_"; #else #define SEM_NAME_TYPE wchar_t #define SEM_STRCPY wcscpy #define SEM_STRCAT wcscat static wchar_t semObjectName[] = L"DUMA_"; #endif static SECURITY_ATTRIBUTES semSecAttr; static DWORD semThread = 0; static HANDLE semHandle = 0; #elif USE_WIN32_CRIT_SECT /* see http://msdn.microsoft.com/en-us/library/ms682530(VS.85).aspx */ static CRITICAL_SECTION critsect; #endif static int semInInit = 0; #if HAVE_PTHREADS && !defined(DUMA_SEMAPHORES) static int semInited = 1; static int semDepth = 0; #elif USE_WIN32_SEMAPHORES static int semInited = 0; static int semDepth = 0; #elif USE_WIN32_CRIT_SECT static int semInited = 0; static int semDepth = 0; /* not really used, but avoids more ifdefs below */ #endif #if HAVE_PTHREADS #ifndef DUMA_SEMAPHORES static void lock() { if (pthread_mutex_trylock(&mutex)) { if ( mutextid==pthread_self() ) { ++locknr; return; } else { pthread_mutex_lock(&mutex); } } mutextid=pthread_self(); locknr=1; } static void unlock() { --locknr; if (!locknr) { mutextid=0; pthread_mutex_unlock(&mutex); } } #endif #endif void DUMA_init_sem(void) { #if USE_WIN32_SEMAPHORES SEM_NAME_TYPE semLocalName[32]; SEM_NAME_TYPE acPID[16]; DWORD pid; #endif /* avoid recursive call to sem_init(), * when sem_init() calls malloc() or other allocation function */ if (semInited || semInInit) return; semInInit = 1; #if HAVE_PTHREADS #ifndef DUMA_SEMAPHORES pthread_mutex_init(&mutex, NULL); semInited = 1; #else if (sem_init(&DUMA_sem, 0, 1) >= 0) semInited = 1; #endif #elif USE_WIN32_SEMAPHORES pid = GetCurrentProcessId(); SEM_STRCPY(semLocalName, semObjectName); /* append ProcessId() to get inter-process unique semaphore name */ acPID[0] = 'A' + (SEM_NAME_TYPE)( (pid >> 28) & 0x0F ); acPID[1] = 'A' + (SEM_NAME_TYPE)( (pid >> 24) & 0x0F ); acPID[2] = 'A' + (SEM_NAME_TYPE)( (pid >> 20) & 0x0F ); acPID[3] = 'A' + (SEM_NAME_TYPE)( (pid >> 16) & 0x0F ); acPID[4] = 'A' + (SEM_NAME_TYPE)( (pid >> 12) & 0x0F ); acPID[5] = 'A' + (SEM_NAME_TYPE)( (pid >> 8) & 0x0F ); acPID[6] = 'A' + (SEM_NAME_TYPE)( (pid >> 4) & 0x0F ); acPID[7] = 'A' + (SEM_NAME_TYPE)( (pid ) & 0x0F ); acPID[8] = 0; SEM_STRCAT( semLocalName, acPID ); semSecAttr.nLength = sizeof(semSecAttr); semSecAttr.lpSecurityDescriptor = NULL; semSecAttr.bInheritHandle = FALSE; semHandle = CreateSemaphore( &semSecAttr /* pointer to security attributes */ , 1 /* initial count */ , 1 /* maximum count */ , semLocalName /* pointer to semaphore-object name */ ); semInited = 1; #elif USE_WIN32_CRIT_SECT InitializeCriticalSection(&critsect); semInited = 1; #endif semInInit = 0; if (!semInited) DUMA_Abort("\nCouldn't initialise semaphore"); } void DUMA_get_sem(void) { if (semInInit) return; /* avoid recursion */ if (!semInited) DUMA_init_sem(); /* initialize if necessary */ #if HAVE_PTHREADS #ifndef DUMA_SEMAPHORES lock(); #else if (semThread != DUMA_thread_self()) { while (sem_wait(&DUMA_sem) < 0); /* wait for the semaphore. */ semThread = DUMA_thread_self(); /* let everyone know who has the semaphore. */ } #endif ++semDepth; /* increment semDepth - push one stack level */ #elif USE_WIN32_SEMAPHORES if (semThread != DUMA_thread_self()) { while (WaitForSingleObject(semHandle, 1000) != WAIT_OBJECT_0) ; /* wait for the semaphore. */ semThread = DUMA_thread_self(); /* let everyone know who has the semaphore. */ } ++semDepth; /* increment semDepth - push one stack level */ #elif USE_WIN32_CRIT_SECT EnterCriticalSection(&critsect); #endif } int DUMA_rel_sem(int retval) { if (semInInit) return retval; /* avoid recursion */ if (!semInited) DUMA_Abort("\nSemaphore isn't initialised"); #ifdef DUMA_SEMAPHORES if (!semThread) DUMA_Abort("\nSemaphore isn't owned by this thread"); #endif #if HAVE_PTHREADS || USE_WIN32_SEMAPHORES if (semDepth <= 0) DUMA_Abort("\nSemaphore isn't locked"); #endif --semDepth; /* decrement semDepth - popping one stack level */ #if HAVE_PTHREADS #ifndef DUMA_SEMAPHORES unlock(); #else semThread = (pthread_t) 0; /* zero this before actually free'ing the semaphore. */ if (sem_post(&DUMA_sem) < 0) DUMA_Abort("Failed to post the semaphore."); #endif #elif USE_WIN32_SEMAPHORES semThread = 0; /* zero this before actually free'ing the semaphore. */ if (0 == ReleaseSemaphore(semHandle, 1 /* amount to add to current count */, NULL) ) DUMA_Abort("Failed to post the semaphore."); #elif USE_WIN32_CRIT_SECT LeaveCriticalSection(&critsect); #endif return retval; } #else /* for not having an empty file */ static int dummy = 0; #endif /* DUMA_NO_THREAD_SAFETY */ duma-VERSION_2_5_21/stacktrace/000077500000000000000000000000001401225056000162155ustar00rootroot00000000000000duma-VERSION_2_5_21/stacktrace/doc/000077500000000000000000000000001401225056000167625ustar00rootroot00000000000000duma-VERSION_2_5_21/stacktrace/doc/printStackTrace.html000066400000000000000000000072171401225056000227600ustar00rootroot00000000000000 printStackTrace

void printStackTrace( char* buffer, int bufferSize )

(printStackTrace.h)

Motivation

Assertion failed in some string function while your client was testing the application. Well, the string function got some wrong input. The function is used in couple of other functions, which, in turn, are used in couple of other functions... At the end you have no idea what caused the problem without the help of debugger. Which isnt always available, especially while beta testing something.

Description

printStackTrace prints formatted call stack to the user defined buffer, always terminating the buffer with 0. Uses stack frame to find out the caller function address and the map file to find out the function name.

Install

MSVC: Just open the stacktrace.dsw and compile the test project. The test project shows how the library can be used to boost simple assert macro. To use the library in a new project, create a workspace and insert stacktrace.dsp to the workspace. Be sure to use (Debug) Multithreaded DLL runtime (or just modify the library options if you prefer Single-Threaded or plain Multithreaded runtimes)

Map Files

Library requires that the executable has proper map file. The map file must be in the same directory as the exe and the map file must have .map extension. From MS Visual Studio map file creation can be enabled by checking 'Generate mapfile' box from 'Link' tab of 'Project Settings' dialog (ALT+F7).

About Output

The output is printed only in debug build (_DEBUG is defined). In release build the user buffer receives only terminating 0, or error message if the map file is missing. The library could be used also in release build, but as it requires special options (frame pointer omission optimization must be disabled) the release build usage is not currently enabled.

Namespaces and other scopes get printed as they appear in a map file (a bit cleanup is done tho), so for example class name and namespaces get printed after the function name.

Example output:

 _mainCRTStartup (403fa9)
  _main (4011ff)
   testfunc1 (4011b1)
    testfunc2.nspace (401161)
     testfunc3.MyClass.nspace (40110a)
      internalError (40105f)
       printStackTrace (401360)

Known issues

  • Local functions dont get reported correctly. Local functions are not listed in the map file and the end points of the functions are not known, so the preceding public function will be reported when the stack is printed.
  • Template name output formatting isnt too pretty. If you happen to implement proper MSVC mangled name parser feel free put it in this library. :)

Copyright (c) 2001 Jani Kajala
Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. Jani Kajala makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.

duma-VERSION_2_5_21/stacktrace/internal/000077500000000000000000000000001401225056000200315ustar00rootroot00000000000000duma-VERSION_2_5_21/stacktrace/internal/Array.h000066400000000000000000000042721401225056000212650ustar00rootroot00000000000000/* * Copyright (c) 2001 Jani Kajala * * Permission to use, copy, modify, distribute and sell this * software and its documentation for any purpose is hereby * granted without fee, provided that the above copyright notice * appear in all copies and that both that copyright notice and * this permission notice appear in supporting documentation. * Jani Kajala makes no representations about the suitability * of this software for any purpose. It is provided "as is" * without express or implied warranty. */ #ifndef _DEV_ARRAY_H #define _DEV_ARRAY_H namespace dev { /** Very simple dynamic array. */ template class Array { public: /** Creates an empty array. */ Array() : m_data(0), m_len(0), m_cap(0) { } /** Creates an array of specified size. */ explicit Array( int size ) : m_data(0), m_len(0), m_cap(0) { setSize( size ); } /// ~Array() { delete[] m_data; } /** Appends an item at the end of the array. */ void add( const T& item ) { if ( m_len+1 > m_cap ) setCapacity( m_len + 1 ); m_data[m_len++] = item; } /** Resizes the array. */ void setSize( int size ) { if ( size > m_cap ) setCapacity( size ); m_len = size; } /** Returns ith item. */ T& operator[]( int i ) { return m_data[i]; } /** Returns pointer to the first element in the vector. */ T* begin() { return m_data; } /** Returns pointer to one beyond the last element in the vector. */ T* end() { return m_data + m_len; } /** Returns number of items in the array. */ int size() const { return m_len; } /** Returns ith item. */ const T& operator[]( int i ) const { return m_data[i]; } /** Returns pointer to the first element in the vector. */ const T* begin() const { return m_data; } /** Returns pointer to one beyond the last element in the vector. */ const T* end() const { return m_data + m_len; } private: T* m_data; int m_len; int m_cap; void setCapacity( int cap ) { ++cap; if ( cap < 8 ) cap = 8; else if ( cap < m_cap*2 ) cap = m_cap*2; m_cap = cap; T* data = new T[cap]; for ( int i = 0 ; i < m_len ; ++i ) data[i] = m_data[i]; delete[] m_data; m_data = data; } }; } // dev #endif // _DEV_ARRAY_Hduma-VERSION_2_5_21/stacktrace/internal/MapFile.cpp000066400000000000000000000135151401225056000220570ustar00rootroot00000000000000/* * Copyright (c) 2006 Michael Eddington * Copyright (c) 2001 Jani Kajala * * Permission to use, copy, modify, distribute and sell this * software and its documentation for any purpose is hereby * granted without fee, provided that the above copyright notice * appear in all copies and that both that copyright notice and * this permission notice appear in supporting documentation. * Jani Kajala makes no representations about the suitability * of this software for any purpose. It is provided "as is" * without express or implied warranty. */ // $Id$ #include "MapFile.h" #include "MapFileEntry.h" #include "TextFile.h" #include "Array.h" #include #include #include #ifdef WIN32 #include #endif //----------------------------------------------------------------------------- namespace dev { // Lots of changes from origional to fix bugs // improve spead, and clean things up. // We are only parsing function entries now, but // should add support for line numbers. class MapFile::MapFileImpl { public: long loadAddr; char name[256]; Array entries; MapFileImpl( const char* filename ) : loadAddr(0), m_file( filename ), m_err( MapFile::ERROR_NONE ) { m_file.readString( name, sizeof(name) ); char buf[1024]; while ( m_file.readString(buf,sizeof(buf)) ) { if ( !strcmp("Address",buf) ) parseEntries(); else m_file.skipLine(); } std::sort( entries.begin(), entries.end() ); } ~MapFileImpl() { for(int i = entries.size(); i; i--) delete entries[i]; } ErrorType error() const { if ( m_err != MapFile::ERROR_NONE ) return m_err; switch ( m_file.error() ) { case TextFile::ERROR_OPEN: return MapFile::ERROR_OPEN; case TextFile::ERROR_READ: return MapFile::ERROR_READ; case TextFile::ERROR_PARSE: return MapFile::ERROR_PARSE; default: return MapFile::ERROR_NONE; } } int line() const { if ( m_err != MapFile::ERROR_NONE ) return m_errLine; return m_file.line(); } private: TextFile m_file; MapFile::ErrorType m_err; int m_errLine; /** * Returns true if the next line is empty. */ bool nextLineEmpty() { m_file.skipLine(); char ch; while ( m_file.peekChar(&ch) && isspace(ch) && ch != '\n' ) m_file.readChar( &ch ); if ( m_file.peekChar(&ch) && ch == '\n' ) return true; return false; } /** * Parses specified string. * Sets error if parsed string doesnt match. */ void parse( const char* str ) { char buf[256]; m_file.readString( buf, sizeof(buf) ); if ( strcmp(str,buf) ) { m_err = MapFile::ERROR_PARSE; m_errLine = m_file.line(); } } /** * Parses specified character. * Sets error if parsed character doesnt match. */ void parse( char ch ) { char ch2; if ( !m_file.readChar(&ch2) || ch2 != ch ) { m_err = MapFile::ERROR_PARSE; m_errLine = m_file.line(); } } /** * Example: * (Preferred) load address is 00400000 */ void parseLoadAddress() { parse( "load" ); parse( "address" ); parse( "is" ); loadAddr = m_file.readHex(); } /** * Example: * (Address) Publics by Value Rva+Base Lib:Object * 0001:000001a0 ?stackTrace@@YAXXZ 004011a0 f main.obj */ void parseEntries() { unsigned int seg; unsigned int offs; unsigned int rvabase; char buf[256]; char* entryname; char lib[256]; char* str; parse( "Publics" ); parse( "by" ); parse( "Value" ); parse( "Rva+Base" ); parse( "Lib:Object" ); m_file.skipWhitespace(); while ( !error() ) { seg = m_file.readHex(); parse( ':' ); offs = m_file.readHex(); m_file.readString( buf, sizeof(buf) ); entryname = buf; rvabase = m_file.readHex(); m_file.readString( lib, sizeof(lib) ); if(!strcmp(lib, "f")) m_file.readString( lib, sizeof(lib) ); // chop entry name at @@ str = strstr( entryname, "@@" ); if ( str ) *str = 0; // skip preceding ?01.. while ( isdigit(*entryname) || *entryname == '?' || *entryname == '$' ) ++entryname; // conv @ -> . for ( str = entryname ; *str ; ++str ) if ( *str == '@' ) *str = '.'; entries.add( new MapFileEntry(seg,offs,0,entryname, rvabase, lib) ); // break at empty line if ( nextLineEmpty() ) break; } } }; //----------------------------------------------------------------------------- MapFile::MapFile( const char* filename ) { m_this = new MapFileImpl( filename ); } MapFile::~MapFile() { delete m_this; } long MapFile::loadAddress() const { return m_this->loadAddr; } MapFileEntry* MapFile::getEntry( int i ) const { return m_this->entries[i]; } int MapFile::entries() const { return m_this->entries.size(); } MapFile::ErrorType MapFile::error() const { return m_this->error(); } int MapFile::line() const { return m_this->line(); } int MapFile::findEntry( long addr ) const { // Changed this to use the rvabase instead // of calculating things based on segment. // Addresses of zero are bogus if(addr == 0) return -1; // Check and see if our addr is way larger then // the highest rva+base address we have. if(addr > (getEntry(entries()-1)->rvabase() + 10000)) return -1; // Entries are sorted, so searching from last // to first will work well for ( int i = entries()-1 ; i >= 0 ; --i ) { if(getEntry( i )->rvabase() <= addr) return i; } return -1; } void MapFile::getModuleMapFilename( char* buffer, int bufferSize ) { int len = 0; buffer[len] = 0; #ifdef WIN32 // get name of the exe/dll len = GetModuleFileName( GetModuleHandle(0), buffer, bufferSize-1 ); buffer[len] = 0; #endif // remove .exe or .dll extension if ( len > 3 && (!strcmp(buffer+len-4,".exe") || !strcmp(buffer+len-4,".EXE") || !strcmp(buffer+len-4,".DLL") || !strcmp(buffer+len-4,".dll")) ) { buffer[len-4] = 0; } // append .map extension if ( (int)strlen(buffer)+4 < bufferSize ) { strcat( buffer, ".map" ); } } } // devduma-VERSION_2_5_21/stacktrace/internal/MapFile.h000066400000000000000000000035701401225056000215240ustar00rootroot00000000000000/* * Copyright (c) 2006 Michael Eddington * Copyright (c) 2001 Jani Kajala * * Permission to use, copy, modify, distribute and sell this * software and its documentation for any purpose is hereby * granted without fee, provided that the above copyright notice * appear in all copies and that both that copyright notice and * this permission notice appear in supporting documentation. * Jani Kajala makes no representations about the suitability * of this software for any purpose. It is provided "as is" * without express or implied warranty. */ // $Id$ #ifndef _DEV_MAPFILE_H #define _DEV_MAPFILE_H namespace dev { class MapFileEntry; /** * Linker generated module map file parser. */ class MapFile { public: /** Error code. */ enum ErrorType { /** No error. */ ERROR_NONE, /** File open failed. */ ERROR_OPEN, /** File reading failed. */ ERROR_READ, /** Syntax error. */ ERROR_PARSE }; /** Reads a map file. */ explicit MapFile( const char* filename ); /// ~MapFile(); /** Returns preferred load address. */ long loadAddress() const; /** Returns ith entry from the map file. */ MapFileEntry* getEntry( int i ) const; /** Returns number of entries in the map file. */ int entries() const; /** Returns error code or 0 (ERROR_NONE) if no error. */ ErrorType error() const; /** Returns line number of last successful read character. */ int line() const; /** * Finds entry which contains specified address. * @return Entry index or -1 if not found. */ int findEntry( long addr ) const; /** * Returns current module name, with map extension. * The output buffer is always 0-terminated. */ static void getModuleMapFilename( char* buffer, int bufferSize ); private: class MapFileImpl; MapFileImpl* m_this; MapFile( const MapFile& ); MapFile& operator=( const MapFile& ); }; } // dev #endif // _DEV_MAPFILE_Hduma-VERSION_2_5_21/stacktrace/internal/MapFileEntry.cpp000066400000000000000000000031471401225056000231010ustar00rootroot00000000000000/* * Copyright (c) 2006 Michael Eddington * Copyright (c) 2001 Jani Kajala * * Permission to use, copy, modify, distribute and sell this * software and its documentation for any purpose is hereby * granted without fee, provided that the above copyright notice * appear in all copies and that both that copyright notice and * this permission notice appear in supporting documentation. * Jani Kajala makes no representations about the suitability * of this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "MapFileEntry.h" #include //----------------------------------------------------------------------------- namespace dev { MapFileEntry::MapFileEntry() { m_sec = 0; m_addr = 0; m_len = 0; m_name[0] = 0; } MapFileEntry::MapFileEntry( long section, long offset, long length, const char* name, long rvabase, const char* lib ) { m_sec = section; m_addr = offset; m_len = length; m_rvabase = rvabase; strncpy( m_name, name, MAX_NAME ); m_name[MAX_NAME] = 0; if(lib) strncpy( m_lib, lib, MAX_NAME ); m_name[MAX_NAME] = 0; } long MapFileEntry::section() const { return m_sec; } long MapFileEntry::offset() const { return m_addr; } long MapFileEntry::length() const { return m_len; } const char* MapFileEntry::name() const { return m_name; } /** Returns rva+base */ long MapFileEntry::rvabase() const { return m_rvabase; } /** Returns name of the library */ const char* MapFileEntry::lib() const { return m_lib; } bool MapFileEntry::operator<( const MapFileEntry& other ) const { return m_rvabase < other.m_rvabase; } } // devduma-VERSION_2_5_21/stacktrace/internal/MapFileEntry.h000066400000000000000000000032671401225056000225510ustar00rootroot00000000000000/* * Copyright (c) 2006 Michael Eddington * Copyright (c) 2001 Jani Kajala * * Permission to use, copy, modify, distribute and sell this * software and its documentation for any purpose is hereby * granted without fee, provided that the above copyright notice * appear in all copies and that both that copyright notice and * this permission notice appear in supporting documentation. * Jani Kajala makes no representations about the suitability * of this software for any purpose. It is provided "as is" * without express or implied warranty. */ // $Id$ #ifndef _DEV_MAPFILEENTRY_H #define _DEV_MAPFILEENTRY_H namespace dev { /** An entry in the map file. */ class MapFileEntry { public: /** Class constants. */ enum Constants { /** Maximum number of characters in map file entry name. */ MAX_NAME = 256 }; /// MapFileEntry(); /** Creates an entry with specified section, offset, length and name. */ MapFileEntry( long section, long offset, long length, const char* name, long rvabase, const char* lib); /** Returns section of the entry. */ long section() const; /** Returns offset of the entry. */ long offset() const; /** Returns length of the entry (only defined for segments). */ long length() const; /** Returns name of the entry. */ const char* name() const; /** Returns rva+base */ long rvabase() const; /** Returns name of the library */ const char* lib() const; /** Returns true if the offset of this entry is before the other one. */ bool operator<( const MapFileEntry& other ) const; private: long m_sec; long m_addr; long m_len; char m_name[MAX_NAME+1]; char m_lib[MAX_NAME+1]; long m_rvabase; }; } // dev #endif // _DEV_MAPFILEENTRY_Hduma-VERSION_2_5_21/stacktrace/internal/StackTrace.cpp000066400000000000000000000100141401225056000225550ustar00rootroot00000000000000/* * Copyright (c) 2006 Michael Eddington * Copyright (c) 2001 Jani Kajala * * Permission to use, copy, modify, distribute and sell this * software and its documentation for any purpose is hereby * granted without fee, provided that the above copyright notice * appear in all copies and that both that copyright notice and * this permission notice appear in supporting documentation. * Jani Kajala makes no representations about the suitability * of this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "StackTrace.h" #include "MapFile.h" #include "MapFileEntry.h" #include #include //----------------------------------------------------------------------------- static const char* internalFunctions[] = { "__duma_malloc", "__duma_calloc", "__duma_realloc", "__duma_valloc", "__duma_allocate", "_printStackTrace", 0 }; #define MAX_DEPTH 32 //----------------------------------------------------------------------------- namespace dev { static int IsInternalFunction(const char* func) { for(int i=0; internalFunctions[i]; i++) { if(!strcmp(func, internalFunctions[i])) return 1; } return 0; } /* EBP points to stack frame (at least 2 DWORDs) which looks something like this: DWORD[EBP+4] = return address (=calling function) DWORD[EBP+0] = calling function stack frame So we 1) get the EBP to EBX 2) take calling function address to EAX 3) parent stack frame to EBX and 4) loop 2,3,4 until desired level in calling stack is reached. Beware that compiler does not always make stack frame (at least if s.c. "omit stack frame" optimization is enabled), so at least I'd use this code only in debug build. */ static long getCaller( int index ) { #if defined(_DEBUG) && defined(_MSC_VER) && defined(_M_IX86) // Changed a couple things here to prevent some // access violations, esp with release code that // doesn't always have a stack frame. // // 1. Check next frame to see if we are below 10000 // 2. If we are forcing a stop make the return addr 0 long caller = 0; __asm { mov ebx, ebp mov ecx, index inc ecx xor eax, eax StackTrace_getCaller_next: mov eax, [ebx+4] mov ebx, [ebx] cmp ebx, 10000 jb StackTrace_getCaller_stop dec ecx jnz StackTrace_getCaller_next jmp StackTrace_getCaller_end StackTrace_getCaller_stop: mov eax, 0 StackTrace_getCaller_end: mov caller, eax } return caller; #else return 0; #endif } int StackTrace::printStackTrace( MapFile** map, int maps, int initLevel, int maxDepth, char* buffer, int bufferSize ) { if ( maxDepth > MAX_DEPTH ) maxDepth = MAX_DEPTH; // list callers long callersAddr[MAX_DEPTH]; MapFileEntry* callersEntry[MAX_DEPTH]; int callers; int i; int entry; long addr = -1; int flag = 0; int j; for (callers = 0, i = initLevel ; i < maxDepth && addr ; i++) { addr = getCaller( i ); callersEntry[callers] = NULL; for (entry = -1, j = 0 ; j < maps ; ++j ) { entry = map[j]->findEntry( addr ); if ( entry != -1 ) { callersEntry[callers] = map[j]->getEntry(entry); break; } } if(entry == -1) continue; callersAddr[callers] = addr; callers++; } // output call stack if ( bufferSize > 0 ) *buffer = 0; int needed = 0; for ( i = 1 ; i <= callers ; ++i ) { addr = callersAddr[callers-i]; if(IsInternalFunction(callersEntry[callers-i]->name())) continue; // format entry to tempory buf char buf[MapFileEntry::MAX_NAME+MAX_DEPTH+20]; // name + margin + hex number buf[0] = 0; for ( int k = initLevel-1 ; k < i ; ++k ) strcat( buf, " " ); if ( callersEntry[callers-i] == NULL ) sprintf( buf+strlen(buf), "0x%x\n", addr ); else sprintf( buf+strlen(buf), "%s (%x)\n", callersEntry[callers-i]->name(), addr ); // append temporary buf to output buffer if space left needed += (int)strlen( buf ); if ( needed < bufferSize ) strcat( buffer, buf ); } // terminate output buffer if ( needed < bufferSize ) buffer[needed] = 0; else if ( bufferSize > 0 ) buffer[bufferSize-1] = 0; return needed; } } // devduma-VERSION_2_5_21/stacktrace/internal/StackTrace.h000066400000000000000000000024511401225056000222300ustar00rootroot00000000000000/* * Copyright (c) 2001 Jani Kajala * * Permission to use, copy, modify, distribute and sell this * software and its documentation for any purpose is hereby * granted without fee, provided that the above copyright notice * appear in all copies and that both that copyright notice and * this permission notice appear in supporting documentation. * Jani Kajala makes no representations about the suitability * of this software for any purpose. It is provided "as is" * without express or implied warranty. */ #ifndef _DEV_STACKTRACE_H #define _DEV_STACKTRACE_H namespace dev { class MapFile; /** Stack tracing utility. */ class StackTrace { public: /** * Prints formatted call stack to the user buffer. * Always terminates the user buffer with 0. * * @param map Array of pointers to map files. * @param maps Number of map files. * @param initLevel Number of functions to skip before starting the tracing. * @param maxDepth Maximum number of levels in the stack trace. * @param buffer [out] Output buffer for the formatted stack trace. * @param bufferSize Size of the output buffer. * @return Needed buffer size. */ static int printStackTrace( MapFile** map, int maps, int initLevel, int maxDepth, char* buffer, int bufferSize ); }; } // dev #endif // _DEV_STACKTRACE_Hduma-VERSION_2_5_21/stacktrace/internal/TextFile.cpp000066400000000000000000000103051401225056000222600ustar00rootroot00000000000000/* * Copyright (c) 2001 Jani Kajala * * Permission to use, copy, modify, distribute and sell this * software and its documentation for any purpose is hereby * granted without fee, provided that the above copyright notice * appear in all copies and that both that copyright notice and * this permission notice appear in supporting documentation. * Jani Kajala makes no representations about the suitability * of this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "TextFile.h" #include #include //----------------------------------------------------------------------------- namespace dev { class TextFile::TextFileImpl { public: TextFile::ErrorType err; int line; explicit TextFileImpl( const char* filename ) { err = TextFile::ERROR_NONE; line = 1; m_peeked = false; m_peekedChar = 0; m_file = fopen( filename, "rt" ); if ( !m_file ) err = TextFile::ERROR_OPEN; } ~TextFileImpl() { if ( m_file ) { fclose( m_file ); m_file = 0; } } bool eof() const { if ( err ) return true; return 0 != feof(m_file); } bool peekChar( char* ch ) { if ( err ) return false; if ( !m_peeked ) { int c = getc( m_file ); if ( EOF != c ) { m_peeked = true; m_peekedChar = (char)c; } else { if ( ferror(m_file) ) err = TextFile::ERROR_READ; } } if ( m_peeked ) *ch = m_peekedChar; return m_peeked; } bool readChar( char* ch ) { if ( err ) return false; bool more = peekChar( ch ); m_peeked = false; if ( more && *ch == '\n' ) ++line; return more; } bool skipWhitespace() { if ( err ) return false; char ch; while ( peekChar(&ch) ) { if ( !isspace(ch) ) break; readChar( &ch ); } return !eof(); } bool readString( char* buf, int size ) { if ( err ) return false; skipWhitespace(); int count = 0; char ch; while ( peekChar(&ch) ) { if ( isspace(ch) ) break; if ( count+1 < size ) buf[count++] = ch; readChar( &ch ); } if ( size > 0 ) buf[count] = 0; return count > 0; } void skipLine() { if ( err ) return; char ch; while ( readChar(&ch) ) { if ( ch == '\n' ) break; } } long readHex() { if ( err ) return 0; skipWhitespace(); // hex must start with alphanumeric character char ch; if ( !peekChar(&ch) || !isalnum(ch) ) { err = TextFile::ERROR_PARSE; return 0; } long x = 0; while ( peekChar(&ch) ) { switch ( ch ) { case '0': x <<= 4; x += 0; break; case '1': x <<= 4; x += 1; break; case '2': x <<= 4; x += 2; break; case '3': x <<= 4; x += 3; break; case '4': x <<= 4; x += 4; break; case '5': x <<= 4; x += 5; break; case '6': x <<= 4; x += 6; break; case '7': x <<= 4; x += 7; break; case '8': x <<= 4; x += 8; break; case '9': x <<= 4; x += 9; break; case 'a': case 'A': x <<= 4; x += 0xA; break; case 'b': case 'B': x <<= 4; x += 0xB; break; case 'c': case 'C': x <<= 4; x += 0xC; break; case 'd': case 'D': x <<= 4; x += 0xD; break; case 'e': case 'E': x <<= 4; x += 0xE; break; case 'f': case 'F': x <<= 4; x += 0xF; break; default: return x; } readChar( &ch ); } return x; } private: bool m_peeked; char m_peekedChar; FILE* m_file; TextFileImpl( const TextFileImpl& ); TextFileImpl& operator=( const TextFileImpl& ); }; //----------------------------------------------------------------------------- TextFile::TextFile( const char* filename ) { m_this = new TextFileImpl( filename ); } TextFile::~TextFile() { delete m_this; } bool TextFile::readString( char* buf, int size ) { return m_this->readString( buf, size ); } void TextFile::skipLine() { m_this->skipLine(); } long TextFile::readHex() { return m_this->readHex(); } bool TextFile::skipWhitespace() { return m_this->skipWhitespace(); } TextFile::ErrorType TextFile::error() const { return m_this->err; } bool TextFile::readChar( char* ch ) { return m_this->readChar( ch ); } bool TextFile::peekChar( char* ch ) { return m_this->peekChar( ch ); } bool TextFile::eof() const { return m_this->eof(); } int TextFile::line() const { return m_this->line; } } // devduma-VERSION_2_5_21/stacktrace/internal/TextFile.h000066400000000000000000000042331401225056000217300ustar00rootroot00000000000000/* * Copyright (c) 2001 Jani Kajala * * Permission to use, copy, modify, distribute and sell this * software and its documentation for any purpose is hereby * granted without fee, provided that the above copyright notice * appear in all copies and that both that copyright notice and * this permission notice appear in supporting documentation. * Jani Kajala makes no representations about the suitability * of this software for any purpose. It is provided "as is" * without express or implied warranty. */ #ifndef _DEV_TEXTFILE_H #define _DEV_TEXTFILE_H namespace dev { /** * ASCII-7 text file parser. Doesnt throw exceptions. */ class TextFile { public: /** Error code. */ enum ErrorType { /** No error. */ ERROR_NONE, /** File open failed. */ ERROR_OPEN, /** File reading failed. */ ERROR_READ, /** Syntax error. */ ERROR_PARSE }; /** Opens a file. */ explicit TextFile( const char* filename ); /// ~TextFile(); /** * Reads a single character. * @return true if read ok. */ bool readChar( char* ch ); /** * Peeks a single character. * @return true if peek ok. */ bool peekChar( char* ch ); /** * Reads whitespace delimited string. * If the string doesnt fit to the buffer then * the rest of the string is skipped. Buffer * is always 0-terminated. * @param buf [out] Pointer to string buffer. * @param size String buffer size. Must be larger than 0. * @return false if end-of-file reached before any characters was read. */ bool readString( char* buf, int size ); /** Skips the rest of the line. */ void skipLine(); /** Reads hex integer. Skips preceding whitespace. */ long readHex(); /** * Skips whitespace characters. * @return false if end-of-file reached. */ bool skipWhitespace(); /** Returns true if end-of-file have been reached. */ bool eof() const; /** Returns error code or 0 (ERROR_NONE) if no error. */ ErrorType error() const; /** Returns line number of last successful read character. */ int line() const; private: class TextFileImpl; TextFileImpl* m_this; TextFile( const TextFile& ); TextFile& operator=( const TextFile& ); }; } // dev #endif // _DEV_TEXTFILE_Hduma-VERSION_2_5_21/stacktrace/linux-i386/000077500000000000000000000000001401225056000200435ustar00rootroot00000000000000duma-VERSION_2_5_21/stacktrace/linux-i386/printStackTrace.c000066400000000000000000000013231401225056000233070ustar00rootroot00000000000000 // Print a stacktrace on i386 with // signal support (on Linux at least) // Does not do symbol lookup. // need to write binutils map file // parser, or steal code from // addr2line void printStackTrace(void) { volatile void *firstvar; char *frame, *pf, *eip; frame = ((char *)(&firstvar)) + 4; while(1) { eip = (char *)(*(int *)(frame + 4)); if(!memcmp(eip, "\x58\xb8\x77\x00\x00\x00\xcd\x80", 8)) { printf("Signal hander for signal %i\n", *(int *)(frame + 8)); pf = (char *)(*(int *)(frame + 36)); eip = (char *)(*(int *)(frame + 68)); } else { pf = (char *)(*(int *)frame); } printf("Prev frame: %p, Prev EIP: %p\n", pf, eip); frame = pf; if(frame == NULL) break; } } // endduma-VERSION_2_5_21/stacktrace/printStackTrace.cpp000066400000000000000000000050161401225056000220240ustar00rootroot00000000000000/* * Copyright (c) 2006 Michael Eddington * Copyright (c) 2001 Jani Kajala * * Permission to use, copy, modify, distribute and sell this * software and its documentation for any purpose is hereby * granted without fee, provided that the above copyright notice * appear in all copies and that both that copyright notice and * this permission notice appear in supporting documentation. * Jani Kajala makes no representations about the suitability * of this software for any purpose. It is provided "as is" * without express or implied warranty. */ // $Id$ #include "printStackTrace.h" #include "StackTrace.h" #include "MapFile.h" #include #include //----------------------------------------------------------------------------- using namespace dev; //----------------------------------------------------------------------------- // We will keep the parsed map file around // after we create it. static MapFile* map = NULL; /* Function: StackTraceCleanup * * Cleanup memory used by stacktrace library. * * See Also: * * */ extern "C" void StackTraceCleanup() { if(map) delete map; map = NULL; } /* Function: printStackTrace * * Prints stack trace to user defined buffer. * Always terminates the buffer with 0. * * Must call to free used memory. * * TODO: Support for multiple map files in func def. * already supported by core code. * * Parameters: * * buffer - Buffer to recieve stacktrace, at least 600 bytes * bufferSize - Size of buffer * mapFilename - [Optional] Location of map file to use * * See Also: * * */ extern "C" void printStackTrace( char* buffer, int bufferSize, char* mapFilename ) { if(map == NULL) { // find out map file name char modname[500]; if(mapFilename == NULL) MapFile::getModuleMapFilename( modname, sizeof(modname) ); else strncpy(modname, mapFilename, sizeof(modname)/sizeof(char)); // parse map file map = new MapFile( modname ); switch ( map->error() ) { case MapFile::ERROR_OPEN: sprintf( buffer, "Failed to open map file %s\n", modname ); break; case MapFile::ERROR_READ: sprintf( buffer, "Error while reading map file %s(%i)\n", modname, map->line() ); break; case MapFile::ERROR_PARSE: sprintf( buffer, "Parse error in map file %s(%i)\n", modname, map->line() ); break; default: break; } } // print stack trace to buffer if ( !map->error() ) { MapFile* maps[] = {map}; StackTrace::printStackTrace( maps, 1, 1, 16, buffer, bufferSize); } }duma-VERSION_2_5_21/stacktrace/printStackTrace.h000066400000000000000000000017321401225056000214720ustar00rootroot00000000000000/* * Copyright (c) 2006 Michael Eddington * Copyright (c) 2001 Jani Kajala * * Permission to use, copy, modify, distribute and sell this * software and its documentation for any purpose is hereby * granted without fee, provided that the above copyright notice * appear in all copies and that both that copyright notice and * this permission notice appear in supporting documentation. * Jani Kajala makes no representations about the suitability * of this software for any purpose. It is provided "as is" * without express or implied warranty. */ #ifndef _PRINTSTACKTRACE_H #define _PRINTSTACKTRACE_H /** * Prints formatted call stack to the user defined buffer, * always terminating the buffer with 0. * Uses stack frame to find out the caller function address and * the map file to find out the function name. */ extern "C" void printStackTrace( char* buffer, int bufferSize, char* mapFilename ); extern "C" void StackTraceCleanup(); #endif // _PRINTSTACKTRACE_Hduma-VERSION_2_5_21/tests/000077500000000000000000000000001401225056000152335ustar00rootroot00000000000000duma-VERSION_2_5_21/tests/dumatest.c000066400000000000000000000172311401225056000172310ustar00rootroot00000000000000 /* * DUMA - Red-Zone memory allocator. * Copyright (C) 2002-2008 Hayati Ayguen , Procitec GmbH * Copyright (C) 1987-1999 Bruce Perens * License: GNU GPL (GNU General Public License, see COPYING-GPL) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * * FILE CONTENTS: * DUMA confidence tests. * Make sure all of the various functions of DUMA work correctly. */ #include #include #include #if !defined(WIN32) || defined(__CYGWIN__) #include #else #include #endif #include #include #include "../duma.h" #ifndef PAGE_PROTECTION_VIOLATED_SIGNAL /* changed default in code below to use two signals: SIGSEGV and SIGBUS */ /* #define PAGE_PROTECTION_VIOLATED_SIGNAL SIGSEGV */ #endif struct diagnostic { int (*test)(void); /* pointer to some test function returning int */ int expectedStatus; /* expected return value/status */ const char * explanation; /* explanation of that test */ }; #if !defined(WIN32) || defined(__CYGWIN__) static sigjmp_buf env; #else static jmp_buf env; #endif /* * There is still too little standardization of the arguments and return * type of signal handler functions. */ static void segmentationFaultHandler( int signalNumber #if ( defined(_AIX) ) , ... #endif ) { (void)signalNumber; #if !defined(WIN32) || defined(__CYGWIN__) siglongjmp(env, 1); #else longjmp(env, 1); #endif } static int gotSegmentationFault(int (*test)(void)) { #if !defined(WIN32) || defined(__CYGWIN__) sigset_t newmask, oldmask; int savemask; #endif #ifdef PAGE_PROTECTION_VIOLATED_SIGNAL void (*oldhandler)(int) = SIG_ERR; #else void (*oldSIGSEGVhandler)(int) = SIG_ERR; #if !defined(WIN32) || defined(__CYGWIN__) void (*oldSIGBUShandler)(int) = SIG_ERR; #endif #endif int status; #if !defined(WIN32) || defined(__CYGWIN__) if ( 0 == sigsetjmp(env, savemask) ) #else if ( 0 == setjmp(env) ) #endif { #if !defined(WIN32) || defined(__CYGWIN__) /* unblock signal and save previous signal mask */ sigemptyset(&newmask); #ifdef PAGE_PROTECTION_VIOLATED_SIGNAL sigaddset(&newmask, PAGE_PROTECTION_VIOLATED_SIGNAL); #else sigaddset(&newmask, SIGSEGV); sigaddset(&newmask, SIGBUS); #endif sigprocmask(SIG_UNBLOCK, &newmask, &oldmask); #endif #ifdef PAGE_PROTECTION_VIOLATED_SIGNAL oldhandler = signal(PAGE_PROTECTION_VIOLATED_SIGNAL, segmentationFaultHandler); #else oldSIGSEGVhandler = signal(SIGSEGV, segmentationFaultHandler); #if !defined(WIN32) || defined(__CYGWIN__) oldSIGBUShandler = signal(SIGBUS, segmentationFaultHandler); #endif #endif status = (*test)(); } else status = 1; /* install previous signal handler */ #ifdef PAGE_PROTECTION_VIOLATED_SIGNAL if (SIG_ERR != oldhandler) signal(PAGE_PROTECTION_VIOLATED_SIGNAL, oldhandler); #else if (SIG_ERR != oldSIGSEGVhandler) signal(SIGSEGV, oldSIGSEGVhandler); #if !defined(WIN32) || defined(__CYGWIN__) if (SIG_ERR != oldSIGBUShandler) signal(SIGBUS, oldSIGBUShandler); #endif #endif #if !defined(WIN32) || defined(__CYGWIN__) /* restore signal mask */ sigprocmask(SIG_SETMASK, &oldmask, NULL); #endif return status; } static char * allocation = (char*)0; /* c is global so that assignments to it won't be optimized out. */ char c; static int testSizes(void) { /* * If DUMA_ADDR can't hold all of the bits of a void *, * have the user call createconf. */ size_t sd = sizeof(DUMA_ADDR); size_t sv = sizeof(void *); return ( sd < sv ); } static int allocateMemory(void) { allocation = (char *)malloc(1); if ( allocation != (char*)0 ) return 0; else return 1; } static int freeMemory(void) { free(allocation); allocation = (char*)0; return 0; } static int protectBelow(void) { DUMA_SET_PROTECT_BELOW(1); return 0; } static int protectAbove(void) { DUMA_SET_PROTECT_BELOW(0); return 0; } static int read0(void) { c = *allocation; return 0; } static int write0(void) { *allocation = 1; return 0; } static int read1(void) { c = allocation[1]; return 0; } static int readMinus1(void) { c = allocation[-1]; return 0; } static struct diagnostic diagnostics[] = { { testSizes, 0, "Please add -DLONG_LONG to the compiler flags and recompile." }, #if 1 { protectAbove, 0, "Protect above: This sets DUMA to protect\n" "the upper boundary of a malloc buffer, rather than the lower boundary." }, { allocateMemory, 0, "Allocation 1: This test allocates a single byte of memory." }, { read0, 0, "Read valid memory 1: This test reads the allocated memory." }, { write0, 0, "Write valid memory 1: This test writes the allocated memory." }, { readMinus1, 0, "Read underrun: This test reads before the beginning of the buffer." }, { read1, 1, "Read overrun: This test reads beyond the end of the buffer." }, { freeMemory, 0, "Free memory 1: This test frees the allocated memory." }, #endif #if 1 { protectBelow, 0, "Protect below: This sets DUMA to protect\n" "the lower boundary of a malloc buffer, rather than the upper boundary." }, { allocateMemory, 0, "Allocation 2: This allocates memory with the lower boundary protected." }, { read0, 0, "Read valid memory 2: This test reads the allocated memory." }, { write0, 0, "Write valid memory 2: This test writes the allocated memory." }, { readMinus1, 1, "Read underrun: This test reads before the beginning of the buffer." }, { freeMemory, 0, "Free memory 2: This test frees the allocated memory." }, #endif { 0, 0, 0 } }; static const char failedTest[] = "DUMA confidence test failed.\n"; static const char newline = '\n'; int main(int argc, char * * argv) { static const struct diagnostic * diag = diagnostics; int testno; (void)argc; (void)argv; #ifdef DUMA_EXPLICIT_INIT duma_init(); #endif DUMA_SET_PROTECT_BELOW(0); DUMA_SET_ALIGNMENT(DUMA_MIN_ALIGNMENT); allocation = 0; for (testno=0; diag->explanation != 0; ++testno, ++diag) { int status; #if 0 write(0, diag->explanation, strlen(diag->explanation)); write(0, &newline, 1); #endif status = gotSegmentationFault(diag->test); if ( status != diag->expectedStatus ) { /* * Don't use stdio to print here, because stdio * uses malloc() and we've just proven that malloc() * is broken. Also, use _exit() instead of exit(), * because _exit() doesn't flush stdio. */ write(2, failedTest, sizeof(failedTest) - 1); write(2, diag->explanation, strlen(diag->explanation)); write(2, &newline, 1); _exit(-1); } } /* avoid memory leak */ if (allocation) freeMemory(); #if 0 { char * dynmemA; char * dynmemB; /* test for DUMA_CHECK_FREQ */ printf("0\n"); protectAbove(); printf("1\n"); dynmemA = (char*)malloc( 10 * sizeof(char) ); printf("2\n"); dynmemA[-1 ] = 0; printf("3\n"); dynmemB = (char*)malloc( 11 * sizeof(char) ); printf("4\n"); free( dynmemB ); printf("5\n"); free( dynmemA ); printf("6\n"); } #endif return 0; }duma-VERSION_2_5_21/tests/dumatestpp.cpp000066400000000000000000000037301401225056000201300ustar00rootroot00000000000000 #include #include #include #ifndef DUMA_SO_LIBRARY #include "../dumapp.h" #endif #if 0 class test { public: test() { x = 0; } test(int m) { x = m; } ~test() { x = 0; } int x; }; class testtest { public: testtest() { y = new test; //NEW_ELEM( test ); //new test(); } testtest(int m) { y = new test(m); //NEW_ELEM( test(m) ); //new test(m); } ~testtest() { delete y; } test *y; }; #endif int main( int argc, char ** argv ) { (void)argc; (void)argv; #if 0 int * x = 0; int ret; ret = posix_memalign(&x, 2048, sizeof(int) ); if ( !ret ) *x = 1; free(x); #elif 0 #include "noduma.h" int * x = 0; x = new int[10]; x[0] = 0; delete x; #elif 0 std::fstream *f = new std::fstream(); delete f; #elif 0 /* this test should fail */ int i; CA_DEFINE(int,acTest,20); for (i=0; i<100; ++i) CA_REF(acTest,i) = i; #elif 0 /* this test should not fail */ int *y, *z; y = new int; z = new int[2]; DEL_ARRAY( z ); DEL_ARRAY( z ); DEL_ELEM( y ); DEL_ELEM( y ); #elif 1 int *y, *z; y = new int; z = new int[2]; delete []z; delete y; #elif 0 int *y, *z; y = new int; z = new int[2]; DEL_ARRAY(z); DEL_ELEM(y); //y = new int; //DEL_ELEM(y); //DEL_ELEM(y); //y = new(__FILE__,__LINE__) int; //delete (__FILE__, __LINE__, y); //y = new(std::nothrow) int; //delete (std::nothrow, y); //y = new(std::nothrow, __FILE__, __LINE__) int; //delete (std::nothrow, __FILE__, __LINE__, y); #elif 0 /* this test should not fail */ int *y; y = NEW_ARRAY( int, 2 ); DEL_ARRAY( y ); #elif 0 /* this test should not fail */ int * x, *y; test *z; x = (int*)malloc( sizeof(int) ); y = new int; z = new test[2]; free( x ); delete y; delete []z; #elif 0 /* this test should not fail */ test * x = new test(10); test *ax = new test[2]; testtest *y = new testtest; delete y; delete []ax; delete x; #endif return 0; } duma-VERSION_2_5_21/tests/experimental/000077500000000000000000000000001401225056000177305ustar00rootroot00000000000000duma-VERSION_2_5_21/tests/experimental/test-sysconf-availpages.c000066400000000000000000000034751401225056000246600ustar00rootroot00000000000000 #include #include #include #include #ifndef WIN32 #include #include #include #else #error #endif #include "duma_config.h" #include "paging.h" int main(int argc, char *argv[]) { long int pagesize; long int pre_phys_pages, pre_avail_pages; long int post_phys_pages, post_avail_pages; long int alloccount = 1024; char * block; long int i; pagesize = sysconf(_SC_PAGESIZE); printf("page size: %ld\n", pagesize); if ( argc >= 1 ) { int tmp = atoi( argv[1] ); if ( tmp >= 0 && tmp <= ((1 << 31)/pagesize) ) alloccount = tmp; } pre_phys_pages = sysconf(_SC_PHYS_PAGES); pre_avail_pages = sysconf(_SC_AVPHYS_PAGES); printf("before allocation: %ld available of %ld pages\n", pre_avail_pages, pre_phys_pages); printf(" %ld available of %ld kB\n" , ((pre_avail_pages*pagesize)/1024) , ((pre_phys_pages *pagesize)/1024) ); #if 0 block = valloc( alloccount * pagesize ); #else block = Page_Create( alloccount * pagesize, 0 /*exitonfail*/, 1 /*printerror*/ ); #endif for ( i = 0; i < alloccount * pagesize; ++i ) block[i] = (char)(i & 1); post_phys_pages = sysconf(_SC_PHYS_PAGES); post_avail_pages = sysconf(_SC_AVPHYS_PAGES); printf("\nallocated and used %d pages (=%ld kB)\n\n", alloccount , ((alloccount*pagesize)/1024) ); printf("after allocation: %ld available of %ld pages\n", post_avail_pages, post_phys_pages); printf(" %ld available of %ld kB\n" , ((post_avail_pages*pagesize)/1024) , ((post_phys_pages *pagesize)/1024) ); printf("difference: %ld less available pages\n" , (pre_avail_pages - post_avail_pages) ); printf(" %ld less available kB\n" , (((pre_avail_pages - post_avail_pages)*pagesize)/1024) ); return 0; } duma-VERSION_2_5_21/tests/experimental/test-sysconf-availpages.sh000077500000000000000000000003211401225056000250360ustar00rootroot00000000000000#!/bin/bash export DUMA_DISABLE_BANNER=1 gcc test-sysconf-availpages.c -o test-sysconf-availpages echo tests ./test-sysconf-availpages 64000 ./test-sysconf-availpages 128000 ./test-sysconf-availpages 256000 duma-VERSION_2_5_21/tests/experimental/test-sysconf.c000066400000000000000000000020561401225056000225400ustar00rootroot00000000000000 #include #include #include void sc_print() { long sc_memprot = sysconf(_SC_MEMORY_PROTECTION); long sc_shell = sysconf(_SC_SHELL); long sc_page_size = sysconf(_SC_PAGE_SIZE); long sc_pagesize = sysconf(_SC_PAGESIZE); long sc_physpages = sysconf(_SC_PHYS_PAGES); long sc_avpages = sysconf(_SC_AVPHYS_PAGES); printf("sysconf(_SC_MEMORY_PROTECTION) = %ld\n", sc_memprot); printf("sysconf(_SC_SHELL) = %ld\n", sc_shell); printf("sysconf(_SC_PAGE_SIZE) = %ld\n", sc_page_size); printf("sysconf(_SC_PAGESIZE) = %ld\n", sc_pagesize); printf("sysconf(_SC_PHYS_PAGES) = %ld\n", sc_physpages); printf("sysconf(_SC_AVPHYS_PAGES) = %ld\n", sc_avpages); } int main( int argc, char *argv[] ) { int * p; int i; sc_print(); printf("\nallocated %d kB\n", 4096*sizeof(int) ); p = (int*)malloc( 1024 * 4096 * sizeof(int) ); sc_print(); printf("\ninitialized memory\n"); for (i=0; i<1024*4096; ++i) p[i] = 0; sc_print(); if ( p ) free( p ); return 0; } duma-VERSION_2_5_21/tests/experimental/testalloc0.cpp000066400000000000000000000033351401225056000225120ustar00rootroot00000000000000 #include #include #include int get_new0strategy(void) { /* test for behaviour of operator new with size 0 */ int op_new_0_strategy; int * piNullPtrA; int * piNullPtrB; piNullPtrA = (int*) operator new(0); piNullPtrB = (int*) operator new(0); if ( !piNullPtrA ) op_new_0_strategy = 1; else if ( piNullPtrA == piNullPtrB ) op_new_0_strategy = 2; else op_new_0_strategy = 3; delete piNullPtrA; delete piNullPtrB; return op_new_0_strategy; } int get_newVec0strategy(void) { /* test for behaviour of operator new with size 0 */ int op_new_0_strategy; int * piNullPtrA; int * piNullPtrB; piNullPtrA = new int[0]; piNullPtrB = new int[0]; if ( !piNullPtrA ) op_new_0_strategy = 1; else if ( piNullPtrA == piNullPtrB ) op_new_0_strategy = 2; else op_new_0_strategy = 3; delete []piNullPtrA; delete []piNullPtrB; return op_new_0_strategy; } int get_malloc0strategy(void) { int op_new_0_strategy; int * piNullPtrA; int * piNullPtrB; piNullPtrA = (int*)malloc(0); piNullPtrB = (int*)malloc(0); if ( !piNullPtrA ) op_new_0_strategy = 1; else if ( piNullPtrA == piNullPtrB ) op_new_0_strategy = 2; else op_new_0_strategy = 3; free(piNullPtrA); free(piNullPtrB); return op_new_0_strategy; } int main(int argc, char *argv[]) { int test = 0; int strategy; if ( argc >= 1 ) test = atoi( argv[1] ); switch (test) { default: case 0: printf("testing malloc(0) .. "); strategy = get_malloc0strategy(); break; case 1: printf("testing new(0) .. "); strategy = get_new0strategy(); break; case 2: printf("testing new[0] .. "); strategy = get_newVec0strategy(); break; } printf("result is %d\n", strategy); return 0; } duma-VERSION_2_5_21/tests/experimental/testalloc0.sh000077500000000000000000000005111401225056000223360ustar00rootroot00000000000000#!/bin/bash export DUMA_DISABLE_BANNER=1 g++ testalloc0.cpp -o testalloc0 echo tests without duma ./testalloc0 0 ./testalloc0 1 ./testalloc0 2 echo tests with duma export LD_PRELOAD=./libduma.so.0.0.0 export DYLD_INSERT_LIBRARIES=./libduma.dylib export DYLD_FORCE_FLAT_NAMESPACE=1 ./testalloc0 0 ./testalloc0 1 ./testalloc0 2 duma-VERSION_2_5_21/tests/experimental/testenv.c000066400000000000000000000017021401225056000215640ustar00rootroot00000000000000 #include extern char **environ; static const char * duma_getenv( const char * varname ) { const char * ret = NULL; int varno = 0; if ( !varname ) return ret; if ( varname[0] == '\0' ) return ret; while ( environ[varno] ) { const char * v = environ[varno++]; int idx = 0; while ( varname[idx] != '\0' && v[idx] == varname[idx] ) ++idx; if ( idx > 0 && varname[idx] == '\0' && v[idx] == '=' ) return v + (idx +1); } return ret; } int main(int argc, const char * argv[] ) { int i = 0; const char * v; const char * varname; #if 0 printf("environment variables:\n"); while ( environ[i] ) { const char * v = environ[i]; printf("%d: %s\n", i, v); ++i; } #endif if ( argc < 2 ) { fprintf(stderr, "Usage: testenv #include #include #include char *res = "^[[:space:]]*([[:alpha:]]+)[[:space:]]*=[[:space:]]*((\"([^\"]*)\")|([^[:space:]]+))([[:space:]]|$)"; int main() { regex_t rec; int result; result = regcomp(&rec, res, REG_EXTENDED); if (result != 0) printf("Error %d\n",result); return 0; } duma-VERSION_2_5_21/tests/experimental/testmemlimit.c000066400000000000000000000016211401225056000226110ustar00rootroot00000000000000 #include #include /* #include "duma.h" */ int main( int argc, char** argv ) { int* ptr1 = NULL; int* ptr2 = NULL; int* ptr3 = NULL; int* ptr4 = NULL; int* ptr5 = NULL; int* ptr6 = NULL; int i; ptr1 = (int*) malloc( 100000 * sizeof(int) ); for( i = 0; i < 100000; ++i ) ptr1[i] = i; ptr2 = (int*) malloc( 100000 * sizeof(int) ); for( i = 0; i < 100000; ++i ) ptr2[i] = i; ptr3 = (int*) malloc( 1000000 * sizeof(int) ); for( i = 0; i < 1000000; ++i ) ptr3[i] = i; ptr4 = (int*) malloc( 1000000 * sizeof(int) ); for( i = 0; i < 1000000; ++i ) ptr4[i] = i; ptr5 = (int*) malloc( 10000000 * sizeof(int) ); for( i = 0; i < 10000000; ++i ) ptr5[i] = i; ptr6 = (int*) malloc( 10000000 * sizeof(int) ); for( i = 0; i < 10000000; ++i ) ptr6[i] = i; free(ptr1); free(ptr2); free(ptr3); free(ptr4); free(ptr5); free(ptr6); return 0; } duma-VERSION_2_5_21/tests/experimental/testmemlimit.sh000077500000000000000000000001131401225056000227770ustar00rootroot00000000000000#!/bin/sh DUMA_MAX_ALLOC=100 DUMA_SHOW_ALLOC=1 ./duma.sh ./testmemlimit_so duma-VERSION_2_5_21/tests/experimental/testsems.cpp000066400000000000000000000016771401225056000223160ustar00rootroot00000000000000/* Test program for duma. Compile it like this: g++ foo.cpp -o foo -pthread -ggdb -I /home/andrel/Desktop/duma_2_5_14_x86/ -L /home/andrel/Desktop/duma_2_5_14_x86 -l duma -lpthread */ #include #include #include #include #include #include static void *threadfunc( void *null ) { for( int i=0; true; i++ ) { unsigned char *foo = new unsigned char[60]; if( foo ) { void *copy = foo; fprintf(stdout, "%d: before delete of %p\n", pthread_self(), copy); fflush(stdout); delete[] foo; fprintf(stdout, "%d: after delete of %p\n", pthread_self(), copy); fflush(stdout); } } } int main( int argc, char *argv[] ) { pthread_t t1, t2, t3; pthread_create( &t1, NULL, threadfunc, NULL ); pthread_create( &t2, NULL, threadfunc, NULL ); pthread_create( &t3, NULL, threadfunc, NULL ); pthread_join( t1, NULL ); pthread_join( t2, NULL ); pthread_join( t3, NULL ); return 0; }duma-VERSION_2_5_21/tests/testmt.c000066400000000000000000000111201401225056000167120ustar00rootroot00000000000000 /* * test program from * Debian Bug report logs - #241156 * electric-fence (2.1.13-0.1) breaks with 2.6.x kernel * * changed to compile on Windows by Hayati Ayguen */ /* $Id$ */ /* gcc foo.c -pthread -lefence -g -ggdb -o foo */ /* (defined(WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__)) */ /* remove "|| defined(__CYGWIN__)" in following line * to test with pthread library on Win32-Cygwin */ #if ( defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__) ) #include #else #include #include #include #define HAVE_PTHREADS #endif #include #include #include #include "../duma.h" volatile int iKillThreads = 0; #define MAX_NUM_THREADS 32 volatile int aiCounter[MAX_NUM_THREADS]; /* thread function * permanently allocate, initialize and deallocate in a loop */ #ifdef HAVE_PTHREADS void* poster(void* arg) #else DWORD WINAPI poster( LPVOID arg ) #endif { char* foo = NULL; int iThreadNo = *((int*)arg); #if 0 /* sleep a bit, that other threads can get started * before producing high load */ #ifdef HAVE_PTHREADS sleep(1); /* wait 1 sec */ #else Sleep(1000); #endif #endif for( ; !iKillThreads; ) { foo = (char*)malloc(4096); if (foo) { memset(foo, 0, 4096); free(foo); } ++ aiCounter[iThreadNo]; } #ifdef HAVE_PTHREADS pthread_exit(NULL); #endif return 0; } #define MAX_NUM_THREADS 32 int main(int argc, char *argv[]) { int iSleepTime = 60; /* in seconds; default = 30 sec */ int iNumThreads = 4; int i; #ifdef HAVE_PTHREADS pthread_t tId[MAX_NUM_THREADS]; #else HANDLE tId[MAX_NUM_THREADS]; #endif int tArg[MAX_NUM_THREADS]; #ifdef DUMA_EXPLICIT_INIT /* necessary on some platforms! * like on Win32-Cygwin */ duma_init(); #endif if ( argc > 1 ) { i = atoi(argv[1]); if ( i > 0 ) iSleepTime = i; } if ( argc > 2 ) { i = atoi(argv[2]); if ( i > 0 ) iNumThreads = i; if ( iNumThreads > MAX_NUM_THREADS ) iNumThreads = MAX_NUM_THREADS; } fprintf(stdout, "running %d threads for %d secs ..", iNumThreads, iSleepTime); fflush(stdout); for ( i = 0; i < iNumThreads; ++i ) { tArg[i] = i; aiCounter[i] = 0; } #ifdef HAVE_PTHREADS fprintf(stdout, "creating threads with pthread library .. \n"); fflush(stdout); for ( i = 0; i < iNumThreads; ++i ) { pthread_t *pt = &tId[i]; int r = pthread_create( pt, NULL, poster, &tArg[i] ); if ( r ) { fprintf(stderr, "\nerror in pthread_create() for thread %d: ", i); switch(r) { case EAGAIN: fprintf(stderr, "EAGAIN"); break; case EINVAL: fprintf(stderr, "EINVAL"); break; case EPERM: fprintf(stderr, "EPERM"); break; default: fprintf(stderr, "unexpected!"); break; } } } fprintf(stdout, ".. creating done\n"); fflush(stdout); /* sleep(iSleepTime); */ for ( i = 0; i < iSleepTime; ++i ) { sleep(1); /* wait 1 sec */ fprintf(stdout, "."); fflush(stdout); } #else fprintf(stdout, "creating threads with Win32 API calls\n"); fflush(stdout); for ( i = 0; i < iNumThreads; ++i ) { tId[i] = CreateThread( NULL /* default security attributes */ , 0 /* use default stack size */ , poster /* thread function name */ , &tArg[i]/* argument to thread function */ , 0 /* use default creation flags */ , NULL /* returns the thread identifier */ ); if ( NULL == tId[i] ) fprintf(stderr, "\nerror in CreateThread() for thread %d: ", i); } /* Sleep(iSleepTime*1000); */ for ( i =0; i < iSleepTime; ++i ) { Sleep(1000); /* wait 1000 ms */ fprintf(stdout, "."); fflush(stdout); } #endif fprintf(stdout, "..done\n"); iKillThreads = 1; fprintf(stdout, "wating threads to end .."); fflush(stdout); #ifdef HAVE_PTHREADS for ( i = 0; i < iNumThreads; ++i ) { pthread_t *pt = &tId[i]; int r = pthread_join( *pt, NULL ); if ( r ) { fprintf(stderr, "\nerror in pthread_join() for thread %d: ", i); switch(r) { case EINVAL: fprintf(stderr, "EINVAL"); break; case ESRCH: fprintf(stderr, "ESRCH"); break; case EDEADLK: fprintf(stderr, "EDEADLK"); break; default: fprintf(stderr, "unexpected!"); break; } } } #else // Wait until all threads have terminated. WaitForMultipleObjects( iNumThreads, tId, TRUE, INFINITE); for ( i = 0; i < iNumThreads; ++i ) CloseHandle(tId[i]); #endif fprintf(stdout, "..done\n"); fprintf(stdout, "state:\n"); for ( i = 0; i < iNumThreads; ++i ) fprintf(stdout, "Thread %d did %d (de)allocations\n", i, aiCounter[i]); fflush(stdout); return 0; } duma-VERSION_2_5_21/tests/testoperators.cpp000066400000000000000000000146141401225056000206630ustar00rootroot00000000000000 /* * DUMA - Red-Zone memory allocator. * Copyright (C) 2002-2008 Hayati Ayguen , Procitec GmbH * License: GNU LGPL (GNU Lesser General Public License, see COPYING-GPL) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * FILE CONTENTS: * example showing how to implement member new/delete operators * the implementation might not be the best, but you get a clou which * operators need to be written. * */ #include #include #include "../dumapp.h" #include "../noduma.h" class optest { public: /* 1x : SINGLE OBJECT FORM - NO DEBUG INFORMATION */ void * operator new( DUMA_SIZE_T ) throw(std::bad_alloc); void * operator new( DUMA_SIZE_T , const std::nothrow_t & ) throw(); void operator delete( void * ) throw(); void operator delete( void * , const std::nothrow_t & ) throw(); /* 2x : ARRAY OBJECT FORM - NO DEBUG INFORMATION */ void * operator new[]( DUMA_SIZE_T ) throw(std::bad_alloc); void * operator new[]( DUMA_SIZE_T , const std::nothrow_t & ) throw(); void operator delete[]( void * ) throw(); void operator delete[]( void *, const std::nothrow_t & ) throw(); #ifndef DUMA_NO_LEAKDETECTION /* 3x : SINGLE OBJECT FORM - WITH DEBUG INFORMATION */ void * operator new( DUMA_SIZE_T, const char *, int ) throw( std::bad_alloc ); void * operator new( DUMA_SIZE_T, const std::nothrow_t &, const char *, int ) throw(); void operator delete( void *, const char *, int ) throw(); void operator delete( void *, const std::nothrow_t &, const char *, int ) throw(); /* 4x : ARRAY OBJECT FORM - WITH DEBUG INFORMATION */ void * operator new[]( DUMA_SIZE_T, const char *, int ) throw( std::bad_alloc ); void * operator new[]( DUMA_SIZE_T, const std::nothrow_t &, const char *, int ) throw(); void operator delete[]( void *, const char *, int ) throw(); void operator delete[]( void *, const std::nothrow_t &, const char *, int ) throw(); #endif private: int dummy; }; /* 1x : SINGLE OBJECT FORM - NO DEBUG INFORMATION */ void * optest::operator new( DUMA_SIZE_T s ) throw(std::bad_alloc) { (void)s; return ::new optest; } void * optest::operator new( DUMA_SIZE_T s, const std::nothrow_t & n ) throw() { (void)s; return ::new(n) optest; } void optest::operator delete( void * p ) throw() { ::operator delete ((optest*)p); } void optest::operator delete( void * p, const std::nothrow_t & n ) throw() { ::operator delete((optest*)p, n); } /* 2x : ARRAY OBJECT FORM - NO DEBUG INFORMATION */ void * optest::operator new[]( DUMA_SIZE_T s ) throw(std::bad_alloc) { return ::new optest[ s / sizeof(optest) ]; // "s / sizeof()" not correct but works for this test } void * optest::operator new[]( DUMA_SIZE_T s, const std::nothrow_t & n ) throw() { return ::new(n) optest[ s / sizeof(optest) ]; // "s / sizeof()" not correct but works for this test } void optest::operator delete[]( void * p ) throw() { ::operator delete []((optest*)p); } void optest::operator delete[]( void * p, const std::nothrow_t & n ) throw() { ::operator delete[]((optest*)p, n); } #ifndef DUMA_NO_LEAKDETECTION /* 3x : SINGLE OBJECT FORM - WITH DEBUG INFORMATION */ void * optest::operator new( DUMA_SIZE_T s, const char * f, int l ) throw( std::bad_alloc ) { (void)s; return ::new(f,l) optest; } void * optest::operator new( DUMA_SIZE_T s, const std::nothrow_t & n, const char * f, int l ) throw() { (void)s; return ::new(n,f,l) optest; } void optest::operator delete( void * p, const char * f, int l ) throw() { ::operator delete((optest*)p, f,l); } void optest::operator delete( void * p, const std::nothrow_t & n, const char * f, int l ) throw() { ::operator delete((optest*)p, n, f,l); } /* 4x : ARRAY OBJECT FORM - WITH DEBUG INFORMATION */ void * optest::operator new[]( DUMA_SIZE_T s, const char * f, int l ) throw( std::bad_alloc ) { return ::new(f,l) optest[s / sizeof(optest)]; // "s / sizeof()" not correct but works for this test } void * optest::operator new[]( DUMA_SIZE_T s, const std::nothrow_t & n, const char * f, int l ) throw() { return ::new(n, f,l) optest[s / sizeof(optest)]; // "s / sizeof()" not correct but works for this test } void optest::operator delete[]( void * p, const char * f, int l ) throw() { ::operator delete[]((optest*)p, f,l); } void optest::operator delete[]( void * p, const std::nothrow_t & n, const char * f, int l ) throw() { ::operator delete[]((optest*)p, n, f,l); } #endif /* DUMA_NO_LEAKDETECTION */ void pure_test() { /* how to call the operators without any DUMA macros defined */ #include "../noduma.h" optest * s, * v; s = new optest; delete s; s = new(std::nothrow) optest; delete s; v = new optest[0]; delete []v; v = new optest[10]; delete []v; v = new(std::nothrow) optest[10]; delete []v; } void rich_test() { /* how to call the operators with having DUMA macros defined */ #include "../dumapp.h" optest * s, * v; s = new optest; delete s; #include "../noduma.h" #ifndef DUMA_NO_LEAKDETECTION s = new(std::nothrow,__FILE__,__LINE__) optest; #else s = new(std::nothrow) optest; #endif #include "../dumapp.h" delete s; v = new optest[0]; delete []v; v = new optest[10]; delete []v; #include "../noduma.h" #ifndef DUMA_NO_LEAKDETECTION v = new(std::nothrow,__FILE__,__LINE__) optest[10]; #else v = new(std::nothrow) optest[10]; #endif #include "../dumapp.h" delete []v; } int main( int argc, char *argv[] ) { (void)argc; (void)argv; #ifdef DUMA_EXPLICIT_INIT duma_init(); #endif pure_test(); rich_test(); return 0; } duma-VERSION_2_5_21/tests/thread-test.c000066400000000000000000000052021401225056000176220ustar00rootroot00000000000000/* * source URL: * http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=67838 */ /* * Author: Petter Reinholdtsen * Date: 2002-02-13 * Lisence: GPL * * Small test program to demonstrate efence crashing on multithreaded * programs. * Link it like this, and it crashes with segfault. * cc -o efence-thread-test efence-thread-test.c -lpthread -lefence * Remove the -lefence, and it work as it should. * The output from gdb when it fails: * * Program received signal SIGSEGV, Segmentation fault. * [Switching to Thread 1026 (LWP 1189)] * 0x400382c7 in memalign () from /usr/lib/libefence.so.0 * (gdb) bt * #0 0x400382c7 in memalign () from /usr/lib/libefence.so.0 * #1 0x4003873c in malloc () from /usr/lib/libefence.so.0 * #2 0x400a0811 in fopen () from /lib/libc.so.6 * #3 0x080488e8 in thread_func () * #4 0x40027f0a in pthread_start_thread () from /lib/libpthread.so.0 * #5 0x40027f51 in pthread_start_thread_event () from /lib/libpthread.so.0 */ /* check for pthread library */ #if (!defined(WIN32) || defined(__CYGWIN__)) #define HAVE_PTHREADS 1 #else #define HAVE_PTHREADS 0 #endif #include #include #if HAVE_PTHREADS #include #include "../duma.h" static pthread_mutex_t mutex; static volatile int threads_left = 2; static void* thread_func(void *arg) { int i = 2000; char *name = (char*)arg; while (--i) { if (pthread_mutex_lock(&mutex)) { fprintf(stderr, "error: %s failed to lock mutex.\n", name); exit(1); } printf ("%s : %d\n", name, i); if (pthread_mutex_unlock(&mutex)) { fprintf(stderr, "error: %s failed to unlock mutex.\n", name); exit(1); } { /* Try to trigger efence error */ FILE *fp = fopen("/etc/resolv.conf", "r"); if (NULL != fp) { char buf[1024]; fread(buf, sizeof(buf), 1, fp); fclose(fp); } } } --threads_left; return NULL; } static void* idle_func(void* arg) { (void)arg; while (threads_left) ; /* NOTREACHED */ return NULL; } int main(int argc, char **argv) { pthread_t hello_thread, goodbye_thread; (void)argc; (void)argv; pthread_mutex_init(&mutex, NULL); if (pthread_create(&hello_thread, NULL, thread_func, (void*)"hello")) { fprintf(stderr, "Failed to create hello thread\n"); exit(1); } if (pthread_create(&goodbye_thread, NULL, thread_func, (void*)"goodbye")) { fprintf(stderr, "Failed to create goodbye thread\n"); exit(1); } idle_func(NULL); pthread_mutex_destroy(&mutex); /* NOTREACHED */ return 0; } #else int main(int argc, char **argv) { (void)argc; (void)argv; printf("Test not implemented for Win32 and Mingw\n"); return 0; } #endif duma-VERSION_2_5_21/tests/tstheap.c000066400000000000000000000047701401225056000170570ustar00rootroot00000000000000#include #include #include #include #include #ifndef DUMA_SO_LIBRARY #include "../duma.h" #endif /* * This is a simple program to exercise the allocator. It allocates and frees * memory in a pseudo-random fashion. It should run silently, using up time * and resources on your system until you stop it or until it has gone * through TEST_DURATION (or the argument) iterations of the loop. */ #ifdef __cplusplus extern "C" #else extern #endif double drand48(void); /* For pre-ANSI C systems */ #ifdef WIN32 #define FAKE_DRAND48 #endif #define ALIGNMENT 8192 #undef ALIGNMENT #define POOL_SIZE 1024 #define LARGEST_BUFFER 30000 #define TEST_DURATION 1000000 struct POOL_ELEM { void * addr; size_t size; } pool[POOL_SIZE]; #ifdef FAKE_DRAND48 /* * Add -DFAKE_DRAND48 to your compile flags if your system doesn't * provide drand48(). */ #ifndef ULONG_MAX #define ULONG_MAX ~(1L) #endif double drand48(void) { #ifdef WIN32 return (double)rand()/((double)RAND_MAX); #else return (random() / (double)ULONG_MAX); #endif } #endif int main(int argc, char * * argv) { int count; int duration = TEST_DURATION; #ifdef DUMA_EXPLICIT_INIT duma_init(); #endif if ( argc >= 2 ) duration = atoi(argv[1]); for ( count = 0; count < POOL_SIZE; count++ ) { pool[count].addr = (void*)0; pool[count].size = (size_t)0; } for ( count = 0; count < duration; count++ ) { int pool_idx; struct POOL_ELEM * element; size_t size; pool_idx =(int)(drand48() * POOL_SIZE); if (pool_idx >=0 && pool_idxaddr ) { /* check if memory is accessible */ memset( element->addr, 0, element->size ); free( element->addr ); element->addr = (void*)0; } if ( size > 0 ) { #ifdef ALIGNMENT element->addr = memalign(ALIGNMENT,size); #else element->addr = malloc(size); #endif element->size = size; /* really use it, so that the system has to use real memory */ memset( element->addr, -1, size ); } } } #if 1 /* don't forget to free the allocated memory, else the confidence test won't pass - without having set "EF_NO_LEAKDETECTION" preprocessor definition */ for ( count = 0; count < POOL_SIZE; count++ ) { if ( pool[count].addr ) { /* check if memory is accessible */ memset( pool[count].addr, 0, pool[count].size ); free( pool[count].addr ); } } #endif return 0; }duma-VERSION_2_5_21/win32-devcpp/000077500000000000000000000000001401225056000163125ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-devcpp/createconf.dev000066400000000000000000000015011401225056000211200ustar00rootroot00000000000000[Project] FileName=createconf.dev Name=createconf UnitCount=1 Type=1 Ver=1 ObjFiles= Includes= Libs= PrivateResource= ResourceIncludes= MakeIncludes= Compiler= CppCompiler= Linker= IsCpp=1 Icon= ExeOutput=../ ObjectOutput= OverrideOutput=1 OverrideOutputName=createconf.exe HostApplication= Folders= CommandLine= UseCustomMakefile=0 CustomMakefile= IncludeVersionInfo=0 SupportXPThemes=0 CompilerSet=0 CompilerSettings=0000000000000000000000 [Unit1] FileName=..\createconf.c CompileCpp=1 Folder=createconf Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [VersionInfo] Major=0 Minor=1 Release=1 Build=1 LanguageID=1033 CharsetID=1252 CompanyName= FileVersion= FileDescription=Developed using the Dev-C++ IDE InternalName= LegalCopyright= LegalTrademarks= OriginalFilename= ProductName= ProductVersion= AutoIncBuildNr=0 duma-VERSION_2_5_21/win32-devcpp/dumalib.dev000066400000000000000000000043501401225056000204310ustar00rootroot00000000000000[Project] FileName=dumalib.dev Name=DUMA UnitCount=13 Type=2 Ver=1 ObjFiles= Includes= Libs= PrivateResource= ResourceIncludes= MakeIncludes= Compiler= Linker= IsCpp=0 Icon= ExeOutput= ObjectOutput= OverrideOutput=0 OverrideOutputName=dumalib.a Folders= CommandLine= CppCompiler= HostApplication= UseCustomMakefile=0 CustomMakefile= IncludeVersionInfo=0 SupportXPThemes=0 CompilerSet=0 CompilerSettings=0000000000000000000000 [Unit1] FileName=..\duma.h Folder= CompileCpp=0 Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit2] FileName=..\dumapp.cpp Folder= CompileCpp=0 Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd=$(CC) -c dumapp.cpp -o dumapp.o $(CFLAGS) [Unit3] FileName=..\dumapp.h Folder= CompileCpp=0 Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit4] FileName=..\duma.c Folder= CompileCpp=0 Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit5] FileName=..\noduma.h Folder=EFence CompileCpp=0 Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Views] ProjectView=1 [Unit6] FileName=..\paging.h CompileCpp=0 Folder=EFence Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit7] FileName=..\print.h CompileCpp=0 Folder=EFence Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit8] FileName=..\duma_sem.h CompileCpp=0 Folder=EFence Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit9] FileName=..\duma_hlp.h CompileCpp=0 Folder=EFence Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit10] FileName=..\duma_config.h CompileCpp=0 Folder=EFence Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit11] FileName=..\print.c CompileCpp=0 Folder=DUMA Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [VersionInfo] Major=0 Minor=1 Release=1 Build=1 LanguageID=1033 CharsetID=1252 CompanyName= FileVersion=0.1 FileDescription=Developed using the Dev-C++ IDE InternalName= LegalCopyright= LegalTrademarks= OriginalFilename=dumalib.a ProductName=DUMA ProductVersion=0.1 AutoIncBuildNr=0 [Unit12] FileName=..\sem_inc.c CompileCpp=0 Folder=DUMA Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Unit13] FileName=..\createconf.c CompileCpp=0 Folder=DUMA Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= duma-VERSION_2_5_21/win32-devcpp/dumatest.dev000066400000000000000000000016401401225056000206410ustar00rootroot00000000000000[Project] FileName=dumatest.dev Name=dumatest UnitCount=1 Type=1 Ver=1 ObjFiles= Includes= Libs= PrivateResource= ResourceIncludes= MakeIncludes= Compiler=-I.._@@_ Linker=dumalib.a_@@_ IsCpp=0 Icon= ExeOutput= ObjectOutput= OverrideOutput=0 OverrideOutputName= Folders= CommandLine= CppCompiler= HostApplication= UseCustomMakefile=0 CustomMakefile= IncludeVersionInfo=0 SupportXPThemes=0 CompilerSet=0 CompilerSettings=0000000000000000000000 [Views] ProjectView=1 [Unit1] FileName=..\dumatest.c Open=0 Folder= Top=0 CursorCol=1 CursorRow=1 TopLine=1 LeftChar=1 CompileCpp=0 Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [VersionInfo] Major=0 Minor=1 Release=1 Build=1 LanguageID=1033 CharsetID=1252 CompanyName= FileVersion=0.1 FileDescription=Developed using the Dev-C++ IDE InternalName= LegalCopyright= LegalTrademarks= OriginalFilename=dumatest.exe ProductName=dumatest ProductVersion=0.1 AutoIncBuildNr=0 duma-VERSION_2_5_21/win32-devcpp/tstheap.dev000066400000000000000000000016461401225056000204710ustar00rootroot00000000000000[Project] FileName=tstheap.dev Name=tstheap UnitCount=1 Type=1 Ver=1 ObjFiles= Includes= Libs= PrivateResource= ResourceIncludes= MakeIncludes= Compiler=-I.._@@_ Linker=dumalib.a_@@_ IsCpp=0 Icon= ExeOutput= ObjectOutput= OverrideOutput=0 OverrideOutputName=tstheap.exe Folders= CommandLine= CppCompiler= HostApplication= UseCustomMakefile=0 CustomMakefile= IncludeVersionInfo=0 SupportXPThemes=0 CompilerSet=0 CompilerSettings=0000000000000000000000 [Unit1] FileName=..\tstheap.c Open=0 Folder= Top=0 CursorCol=1 CursorRow=1 TopLine=1 LeftChar=1 CompileCpp=0 Compile=1 Link=1 Priority=1000 OverrideBuildCmd=0 BuildCmd= [Views] ProjectView=1 [VersionInfo] Major=0 Minor=1 Release=1 Build=1 LanguageID=1033 CharsetID=1252 CompanyName= FileVersion=0.1 FileDescription=Developed using the Dev-C++ IDE InternalName= LegalCopyright= LegalTrademarks= OriginalFilename=tstheap.exe ProductName=tstheap ProductVersion=0.1 AutoIncBuildNr=0 duma-VERSION_2_5_21/win32-msvc.2005/000077500000000000000000000000001401225056000163665ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.2005/createconf/000077500000000000000000000000001401225056000204775ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.2005/createconf/createconf.vcproj000066400000000000000000000154461401225056000240470ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.2005/detoursexample1/000077500000000000000000000000001401225056000215105ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.2005/detoursexample1/detoursexample1.sln000066400000000000000000000015661401225056000253600ustar00rootroot00000000000000Microsoft Visual Studio Solution File, Format Version 9.00 # Visual Studio 2005 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "detoursexample1", "detoursexample1\detoursexample1.vcproj", "{AA0D62FE-91EA-4F4B-A372-687F01F85126}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {AA0D62FE-91EA-4F4B-A372-687F01F85126}.Debug|Win32.ActiveCfg = Debug|Win32 {AA0D62FE-91EA-4F4B-A372-687F01F85126}.Debug|Win32.Build.0 = Debug|Win32 {AA0D62FE-91EA-4F4B-A372-687F01F85126}.Release|Win32.ActiveCfg = Release|Win32 {AA0D62FE-91EA-4F4B-A372-687F01F85126}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal duma-VERSION_2_5_21/win32-msvc.2005/detoursexample1/detoursexample1/000077500000000000000000000000001401225056000246325ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.2005/detoursexample1/detoursexample1/detoursexample1.vcproj000066400000000000000000000110331401225056000311770ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.2005/duma.sln000066400000000000000000000201051401225056000200300ustar00rootroot00000000000000Microsoft Visual Studio Solution File, Format Version 9.00 # Visual Studio 2005 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "createconf", "createconf\createconf.vcproj", "{416528B5-9B1B-4DC1-A899-623C8F32ED13}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dumalib", "dumalib\dumalib.vcproj", "{31A93E3A-962A-4769-812A-45A3803B6127}" ProjectSection(ProjectDependencies) = postProject {56ABCE73-B688-4BC4-8D94-8ED6EC9083FB} = {56ABCE73-B688-4BC4-8D94-8ED6EC9083FB} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dumatest", "dumatest\dumatest.vcproj", "{CDD36623-87AF-4CDE-861E-31A9AB1B1D63}" ProjectSection(ProjectDependencies) = postProject {31A93E3A-962A-4769-812A-45A3803B6127} = {31A93E3A-962A-4769-812A-45A3803B6127} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dumatestpp", "dumatestpp\dumatestpp.vcproj", "{C67F03DD-E18F-44D9-8250-78BD411C5F01}" ProjectSection(ProjectDependencies) = postProject {31A93E3A-962A-4769-812A-45A3803B6127} = {31A93E3A-962A-4769-812A-45A3803B6127} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tstheap", "tstheap\tstheap.vcproj", "{5404C919-56FD-41A9-BB75-DB96201E08A1}" ProjectSection(ProjectDependencies) = postProject {31A93E3A-962A-4769-812A-45A3803B6127} = {31A93E3A-962A-4769-812A-45A3803B6127} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dumadetours", "dumadetours\dumadetours.vcproj", "{E6C785A7-4412-485F-AFA0-B4FC69976E05}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dumadetoursdll", "dumadetoursdll\dumadetoursdll.vcproj", "{37A06F53-EBA8-410C-A0BC-DC0A505EA205}" ProjectSection(ProjectDependencies) = postProject {31A93E3A-962A-4769-812A-45A3803B6127} = {31A93E3A-962A-4769-812A-45A3803B6127} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dumadll", "dumadll\dumadll.vcproj", "{B46EFEB6-2148-4FCA-9CEC-40CC261D1840}" ProjectSection(ProjectDependencies) = postProject {31A93E3A-962A-4769-812A-45A3803B6127} = {31A93E3A-962A-4769-812A-45A3803B6127} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stacktrace", "stacktrace\stacktrace.vcproj", "{56ABCE73-B688-4BC4-8D94-8ED6EC9083FB}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "quicktest", "quicktest\quicktest.vcproj", "{51E21787-88AF-4FE4-880D-D3C4E79B8990}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Detours1.5|Win32 = Detours1.5|Win32 Detours2.1|Win32 = Detours2.1|Win32 Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {416528B5-9B1B-4DC1-A899-623C8F32ED13}.Debug|Win32.ActiveCfg = Debug|Win32 {416528B5-9B1B-4DC1-A899-623C8F32ED13}.Debug|Win32.Build.0 = Debug|Win32 {416528B5-9B1B-4DC1-A899-623C8F32ED13}.Detours1.5|Win32.ActiveCfg = Detours1.5|Win32 {416528B5-9B1B-4DC1-A899-623C8F32ED13}.Detours1.5|Win32.Build.0 = Detours1.5|Win32 {416528B5-9B1B-4DC1-A899-623C8F32ED13}.Detours2.1|Win32.ActiveCfg = Detours2.1|Win32 {416528B5-9B1B-4DC1-A899-623C8F32ED13}.Detours2.1|Win32.Build.0 = Detours2.1|Win32 {416528B5-9B1B-4DC1-A899-623C8F32ED13}.Release|Win32.ActiveCfg = Release|Win32 {416528B5-9B1B-4DC1-A899-623C8F32ED13}.Release|Win32.Build.0 = Release|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Debug|Win32.ActiveCfg = Debug|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Debug|Win32.Build.0 = Debug|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Detours1.5|Win32.ActiveCfg = Detours1.5|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Detours1.5|Win32.Build.0 = Detours1.5|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Detours2.1|Win32.ActiveCfg = Detours2.1|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Detours2.1|Win32.Build.0 = Detours2.1|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Release|Win32.ActiveCfg = Release|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Release|Win32.Build.0 = Release|Win32 {CDD36623-87AF-4CDE-861E-31A9AB1B1D63}.Debug|Win32.ActiveCfg = Debug|Win32 {CDD36623-87AF-4CDE-861E-31A9AB1B1D63}.Debug|Win32.Build.0 = Debug|Win32 {CDD36623-87AF-4CDE-861E-31A9AB1B1D63}.Detours1.5|Win32.ActiveCfg = Detours|Win32 {CDD36623-87AF-4CDE-861E-31A9AB1B1D63}.Detours2.1|Win32.ActiveCfg = Detours2.1|Win32 {CDD36623-87AF-4CDE-861E-31A9AB1B1D63}.Release|Win32.ActiveCfg = Release|Win32 {CDD36623-87AF-4CDE-861E-31A9AB1B1D63}.Release|Win32.Build.0 = Release|Win32 {C67F03DD-E18F-44D9-8250-78BD411C5F01}.Debug|Win32.ActiveCfg = Debug|Win32 {C67F03DD-E18F-44D9-8250-78BD411C5F01}.Debug|Win32.Build.0 = Debug|Win32 {C67F03DD-E18F-44D9-8250-78BD411C5F01}.Detours1.5|Win32.ActiveCfg = Detours|Win32 {C67F03DD-E18F-44D9-8250-78BD411C5F01}.Detours2.1|Win32.ActiveCfg = Detours2.1|Win32 {C67F03DD-E18F-44D9-8250-78BD411C5F01}.Release|Win32.ActiveCfg = Release|Win32 {C67F03DD-E18F-44D9-8250-78BD411C5F01}.Release|Win32.Build.0 = Release|Win32 {5404C919-56FD-41A9-BB75-DB96201E08A1}.Debug|Win32.ActiveCfg = Debug|Win32 {5404C919-56FD-41A9-BB75-DB96201E08A1}.Debug|Win32.Build.0 = Debug|Win32 {5404C919-56FD-41A9-BB75-DB96201E08A1}.Detours1.5|Win32.ActiveCfg = Detours|Win32 {5404C919-56FD-41A9-BB75-DB96201E08A1}.Detours2.1|Win32.ActiveCfg = Detours2.1|Win32 {5404C919-56FD-41A9-BB75-DB96201E08A1}.Release|Win32.ActiveCfg = Release|Win32 {5404C919-56FD-41A9-BB75-DB96201E08A1}.Release|Win32.Build.0 = Release|Win32 {E6C785A7-4412-485F-AFA0-B4FC69976E05}.Debug|Win32.ActiveCfg = Debug|Win32 {E6C785A7-4412-485F-AFA0-B4FC69976E05}.Detours1.5|Win32.ActiveCfg = Detours1.5|Win32 {E6C785A7-4412-485F-AFA0-B4FC69976E05}.Detours1.5|Win32.Build.0 = Detours1.5|Win32 {E6C785A7-4412-485F-AFA0-B4FC69976E05}.Detours2.1|Win32.ActiveCfg = Detours2.1|Win32 {E6C785A7-4412-485F-AFA0-B4FC69976E05}.Detours2.1|Win32.Build.0 = Detours2.1|Win32 {E6C785A7-4412-485F-AFA0-B4FC69976E05}.Release|Win32.ActiveCfg = Release|Win32 {37A06F53-EBA8-410C-A0BC-DC0A505EA205}.Debug|Win32.ActiveCfg = Debug|Win32 {37A06F53-EBA8-410C-A0BC-DC0A505EA205}.Detours1.5|Win32.ActiveCfg = Detours1.5|Win32 {37A06F53-EBA8-410C-A0BC-DC0A505EA205}.Detours1.5|Win32.Build.0 = Detours1.5|Win32 {37A06F53-EBA8-410C-A0BC-DC0A505EA205}.Detours2.1|Win32.ActiveCfg = Detours2.1|Win32 {37A06F53-EBA8-410C-A0BC-DC0A505EA205}.Detours2.1|Win32.Build.0 = Detours2.1|Win32 {37A06F53-EBA8-410C-A0BC-DC0A505EA205}.Release|Win32.ActiveCfg = Release|Win32 {B46EFEB6-2148-4FCA-9CEC-40CC261D1840}.Debug|Win32.ActiveCfg = Debug|Win32 {B46EFEB6-2148-4FCA-9CEC-40CC261D1840}.Debug|Win32.Build.0 = Debug|Win32 {B46EFEB6-2148-4FCA-9CEC-40CC261D1840}.Detours1.5|Win32.ActiveCfg = Detours|Win32 {B46EFEB6-2148-4FCA-9CEC-40CC261D1840}.Detours2.1|Win32.ActiveCfg = Detours2.1|Win32 {B46EFEB6-2148-4FCA-9CEC-40CC261D1840}.Release|Win32.ActiveCfg = Release|Win32 {B46EFEB6-2148-4FCA-9CEC-40CC261D1840}.Release|Win32.Build.0 = Release|Win32 {56ABCE73-B688-4BC4-8D94-8ED6EC9083FB}.Debug|Win32.ActiveCfg = Debug|Win32 {56ABCE73-B688-4BC4-8D94-8ED6EC9083FB}.Debug|Win32.Build.0 = Debug|Win32 {56ABCE73-B688-4BC4-8D94-8ED6EC9083FB}.Detours1.5|Win32.ActiveCfg = Detours1.5|Win32 {56ABCE73-B688-4BC4-8D94-8ED6EC9083FB}.Detours1.5|Win32.Build.0 = Detours1.5|Win32 {56ABCE73-B688-4BC4-8D94-8ED6EC9083FB}.Detours2.1|Win32.ActiveCfg = Detours2.1|Win32 {56ABCE73-B688-4BC4-8D94-8ED6EC9083FB}.Detours2.1|Win32.Build.0 = Detours2.1|Win32 {56ABCE73-B688-4BC4-8D94-8ED6EC9083FB}.Release|Win32.ActiveCfg = Release|Win32 {56ABCE73-B688-4BC4-8D94-8ED6EC9083FB}.Release|Win32.Build.0 = Release|Win32 {51E21787-88AF-4FE4-880D-D3C4E79B8990}.Debug|Win32.ActiveCfg = Debug|Win32 {51E21787-88AF-4FE4-880D-D3C4E79B8990}.Debug|Win32.Build.0 = Debug|Win32 {51E21787-88AF-4FE4-880D-D3C4E79B8990}.Detours1.5|Win32.ActiveCfg = Debug|Win32 {51E21787-88AF-4FE4-880D-D3C4E79B8990}.Detours2.1|Win32.ActiveCfg = Detours2.1|Win32 {51E21787-88AF-4FE4-880D-D3C4E79B8990}.Release|Win32.ActiveCfg = Release|Win32 {51E21787-88AF-4FE4-880D-D3C4E79B8990}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal duma-VERSION_2_5_21/win32-msvc.2005/dumadetours/000077500000000000000000000000001401225056000207225ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.2005/dumadetours/dumadetours.vcproj000066400000000000000000000204121401225056000245020ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.2005/dumadetoursdll/000077500000000000000000000000001401225056000214165ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.2005/dumadetoursdll/dumadetoursdll.vcproj000066400000000000000000000234101401225056000256730ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.2005/dumadetoursdll/test.bat000066400000000000000000000006221401225056000230650ustar00rootroot00000000000000@echo off rem Run a quick test set DUMA_OUTPUT_STACKTRACE=1 set DUMA_OUTPUT_STACKTRACE_MAPFILE=C:\Projects\duma\duma-head\win32-msvc.2005\detoursexample1\detoursexample1\Debug\detoursexample1.map set DUMA_DETOURS_DLL=detours2.1\dumadetoursdll.dll ..\dumadetours\detours2.1\dumadetours.exe C:\Projects\duma\duma-head\win32-msvc.2005\detoursexample1\detoursexample1\Debug\detoursexample1.exe rem end duma-VERSION_2_5_21/win32-msvc.2005/dumadll/000077500000000000000000000000001401225056000200105ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.2005/dumadll/dumadll.aps000066400000000000000000000422341401225056000221440ustar00rootroot00000000000000 ÿÿÿÿ>$HWBÿÿ LCc:\Projects\duma_2_4_26\win32-msvc.net\dumadll\dumadll.rc 4TEXTINCLUDEÿÿ0 resource.h4TEXTINCLUDEÿÿ0 #include "afxres.h" 4TEXTINCLUDEÿÿ0  ?$HWBÿÿÈ0 !!resource.h_APS_NEXT_RESOURCE_VALUE101 _APS_NEXT_COMMAND_VALUE40001 _APS_NEXT_CONTROL_VALUE1001 _APS_NEXT_SYMED_VALUE101 !!afxres.h!winres.hVS_VERSION_INFO1IDC_STATIC(-1))!CBRS_ALIGN_LEFT0x1000L/CBRS_ALIGN_TOP0x2000L0CBRS_ALIGN_RIGHT0x4000L1CBRS_ALIGN_BOTTOM0x8000L2CBRS_ALIGN_ANY0xF000L3CBRS_BORDER_LEFT0x0100L5CBRS_BORDER_TOP0x0200L6CBRS_BORDER_RIGHT0x0400L7CBRS_BORDER_BOTTOM0x0800L8CBRS_BORDER_ANY0x0F00L9CBRS_TOOLTIPS0x0010L;CBRS_FLYBY0x0020L<CBRS_FLOAT_MULTI0x0040L=CBRS_BORDER_3D0x0080L>CBRS_HIDE_INPLACE0x0008L?CBRS_SIZE_DYNAMIC0x0004L@CBRS_SIZE_FIXED0x0002LACBRS_FLOATING0x0001LBCBRS_GRIPPER0x00400000LDCBRS_ORIENT_HORZ(CBRS_ALIGN_TOP|CBRS_ALIGN_BOTTOM)FCBRS_ORIENT_VERT(CBRS_ALIGN_LEFT|CBRS_ALIGN_RIGHT)GCBRS_ORIENT_ANY(CBRS_ORIENT_HORZ|CBRS_ORIENT_VERT)HCBRS_ALL0x0040FFFFLJCBRS_NOALIGN0x00000000LOCBRS_LEFT(CBRS_ALIGN_LEFT|CBRS_BORDER_RIGHT)PCBRS_TOP(CBRS_ALIGN_TOP|CBRS_BORDER_BOTTOM)QCBRS_RIGHT(CBRS_ALIGN_RIGHT|CBRS_BORDER_LEFT)RCBRS_BOTTOM(CBRS_ALIGN_BOTTOM|CBRS_BORDER_TOP)SID_INDICATOR_EXT0xE700YID_INDICATOR_CAPS0xE701ZID_INDICATOR_NUM0xE702[ID_INDICATOR_SCRL0xE703\ID_INDICATOR_OVR0xE704]ID_INDICATOR_REC0xE705^ID_INDICATOR_KANA0xE706_ID_SEPARATOR0aAFX_IDS_APP_TITLE0xE000“AFX_IDS_IDLEMESSAGE0xE001•AFX_IDS_HELPMODEMESSAGE0xE002—AFX_IDS_APP_TITLE_EMBEDDING0xE003™AFX_IDS_COMPANY_NAME0xE004›AFX_IDS_OBJ_TITLE_INPLACE0xE005ID_FILE_NEW0xE100£ID_FILE_OPEN0xE101¤ID_FILE_CLOSE0xE102¥ID_FILE_SAVE0xE103¦ID_FILE_SAVE_AS0xE104§ID_FILE_PAGE_SETUP0xE105¨ID_FILE_PRINT_SETUP0xE106©ID_FILE_PRINT0xE107ªID_FILE_PRINT_DIRECT0xE108«ID_FILE_PRINT_PREVIEW0xE109¬ID_FILE_UPDATE0xE10A­ID_FILE_SAVE_COPY_AS0xE10B®ID_FILE_SEND_MAIL0xE10C¯ID_FILE_NEW_FRAME0xE10D°ID_FILE_MRU_FIRST0xE110²ID_FILE_MRU_FILE10xE110³ID_FILE_MRU_FILE20xE111´ID_FILE_MRU_FILE30xE112µID_FILE_MRU_FILE40xE113¶ID_FILE_MRU_FILE50xE114·ID_FILE_MRU_FILE60xE115¸ID_FILE_MRU_FILE70xE116¹ID_FILE_MRU_FILE80xE117ºID_FILE_MRU_FILE90xE118»ID_FILE_MRU_FILE100xE119¼ID_FILE_MRU_FILE110xE11A½ID_FILE_MRU_FILE120xE11B¾ID_FILE_MRU_FILE130xE11C¿ID_FILE_MRU_FILE140xE11DÀID_FILE_MRU_FILE150xE11EÁID_FILE_MRU_FILE160xE11FÂID_FILE_MRU_LAST0xE11FÃID_EDIT_CLEAR0xE120ÆID_EDIT_CLEAR_ALL0xE121ÇID_EDIT_COPY0xE122ÈID_EDIT_CUT0xE123ÉID_EDIT_FIND0xE124ÊID_EDIT_PASTE0xE125ËID_EDIT_PASTE_LINK0xE126ÌID_EDIT_PASTE_SPECIAL0xE127ÍID_EDIT_REPEAT0xE128ÎID_EDIT_REPLACE0xE129ÏID_EDIT_SELECT_ALL0xE12AÐID_EDIT_UNDO0xE12BÑID_EDIT_REDO0xE12CÒID_WINDOW_NEW0xE130ÕID_WINDOW_ARRANGE0xE131ÖID_WINDOW_CASCADE0xE132×ID_WINDOW_TILE_HORZ0xE133ØID_WINDOW_TILE_VERT0xE134ÙID_WINDOW_SPLIT0xE135ÚID_APP_ABOUT0xE140âID_APP_EXIT0xE141ãID_HELP_INDEX0xE142äID_HELP_FINDER0xE143åID_HELP_USING0xE144æID_CONTEXT_HELP0xE145çID_HELP0xE146éID_DEFAULT_HELP0xE147êID_NEXT_PANE0xE150íID_PREV_PANE0xE151îID_FORMAT_FONT0xE160ñID_OLE_INSERT_NEW0xE200ôID_OLE_EDIT_LINKS0xE201õID_OLE_EDIT_CONVERT0xE202öID_OLE_EDIT_CHANGE_ICON0xE203÷ID_OLE_EDIT_PROPERTIES0xE204øID_OLE_VERB_FIRST0xE210ùAFX_ID_PREVIEW_CLOSE0xE300ÿAFX_ID_PREVIEW_NUMPAGE0xE301AFX_ID_PREVIEW_NEXT0xE302AFX_ID_PREVIEW_PREV0xE303AFX_ID_PREVIEW_PRINT0xE304AFX_ID_PREVIEW_ZOOMIN0xE305AFX_ID_PREVIEW_ZOOMOUT0xE306ID_VIEW_TOOLBAR0xE800ID_VIEW_STATUS_BAR0xE801 ID_VIEW_REBAR0xE804 ID_VIEW_AUTOARRANGE0xE805 ID_VIEW_SMALLICON0xE810 ID_VIEW_LARGEICON0xE811ID_VIEW_LIST0xE812ID_VIEW_DETAILS0xE813ID_VIEW_LINEUP0xE814ID_VIEW_BYNAME0xE815AFX_ID_VIEW_MINIMUMID_VIEW_SMALLICONAFX_ID_VIEW_MAXIMUMID_VIEW_BYNAMEID_RECORD_FIRST0xE900ID_RECORD_LAST0xE901ID_RECORD_NEXT0xE902ID_RECORD_PREV0xE903IDC_STATIC(-1)#AFX_IDS_SCSIZE0xEF00,AFX_IDS_SCMOVE0xEF01-AFX_IDS_SCMINIMIZE0xEF02.AFX_IDS_SCMAXIMIZE0xEF03/AFX_IDS_SCNEXTWINDOW0xEF040AFX_IDS_SCPREVWINDOW0xEF051AFX_IDS_SCCLOSE0xEF062AFX_IDS_SCRESTORE0xEF123AFX_IDS_SCTASKLIST0xEF134AFX_IDS_MDICHILD0xEF1F6AFX_IDS_DESKACCESSORY0xEFDA8AFX_IDS_OPENFILE0xF000;AFX_IDS_SAVEFILE0xF001<AFX_IDS_ALLFILTER0xF002=AFX_IDS_UNTITLED0xF003>AFX_IDS_SAVEFILECOPY0xF004?AFX_IDS_PREVIEW_CLOSE0xF005@AFX_IDS_UNNAMED_FILE0xF006AAFX_IDS_HIDE0xF011BAFX_IDP_NO_ERROR_AVAILABLE0xF020EAFX_IDS_NOT_SUPPORTED_EXCEPTION0xF021FAFX_IDS_RESOURCE_EXCEPTION0xF022GAFX_IDS_MEMORY_EXCEPTION0xF023HAFX_IDS_USER_EXCEPTION0xF024IAFX_IDS_INVALID_ARG_EXCEPTION0xF025JAFX_IDS_PRINTONPORT0xF040MAFX_IDS_ONEPAGE0xF041NAFX_IDS_TWOPAGE0xF042OAFX_IDS_PRINTPAGENUM0xF043PAFX_IDS_PREVIEWPAGEDESC0xF044QAFX_IDS_PRINTDEFAULTEXT0xF045RAFX_IDS_PRINTDEFAULT0xF046SAFX_IDS_PRINTFILTER0xF047TAFX_IDS_PRINTCAPTION0xF048UAFX_IDS_PRINTTOFILE0xF049VAFX_IDS_OBJECT_MENUITEM0xF080ZAFX_IDS_EDIT_VERB0xF081[AFX_IDS_ACTIVATE_VERB0xF082\AFX_IDS_CHANGE_LINK0xF083]AFX_IDS_AUTO0xF084^AFX_IDS_MANUAL0xF085_AFX_IDS_FROZEN0xF086`AFX_IDS_ALL_FILES0xF087aAFX_IDS_SAVE_MENU0xF088cAFX_IDS_UPDATE_MENU0xF089dAFX_IDS_SAVE_AS_MENU0xF08AeAFX_IDS_SAVE_COPY_AS_MENU0xF08BfAFX_IDS_EXIT_MENU0xF08CgAFX_IDS_UPDATING_ITEMS0xF08DhAFX_IDS_METAFILE_FORMAT0xF08EjAFX_IDS_DIB_FORMAT0xF08FkAFX_IDS_BITMAP_FORMAT0xF090lAFX_IDS_LINKSOURCE_FORMAT0xF091mAFX_IDS_EMBED_FORMAT0xF092nAFX_IDS_PASTELINKEDTYPE0xF094pAFX_IDS_UNKNOWNTYPE0xF095qAFX_IDS_RTF_FORMAT0xF096rAFX_IDS_TEXT_FORMAT0xF097sAFX_IDS_INVALID_CURRENCY0xF098uAFX_IDS_INVALID_DATETIME0xF099vAFX_IDS_INVALID_DATETIMESPAN0xF09AwAFX_IDP_INVALID_FILENAME0xF100zAFX_IDP_FAILED_TO_OPEN_DOC0xF101{AFX_IDP_FAILED_TO_SAVE_DOC0xF102|AFX_IDP_ASK_TO_SAVE0xF103}AFX_IDP_FAILED_TO_CREATE_DOC0xF104~AFX_IDP_FILE_TOO_LARGE0xF105AFX_IDP_FAILED_TO_START_PRINT0xF106€AFX_IDP_FAILED_TO_LAUNCH_HELP0xF107AFX_IDP_INTERNAL_FAILURE0xF108‚AFX_IDP_COMMAND_FAILURE0xF109ƒAFX_IDP_FAILED_MEMORY_ALLOC0xF10A„AFX_IDP_UNREG_DONE0xF10B…AFX_IDP_UNREG_FAILURE0xF10C†AFX_IDP_DLL_LOAD_FAILED0xF10D‡AFX_IDP_DLL_BAD_VERSION0xF10EˆAFX_IDP_PARSE_INT0xF110‹AFX_IDP_PARSE_REAL0xF111ŒAFX_IDP_PARSE_INT_RANGE0xF112AFX_IDP_PARSE_REAL_RANGE0xF113ŽAFX_IDP_PARSE_STRING_SIZE0xF114AFX_IDP_PARSE_RADIO_BUTTON0xF115AFX_IDP_PARSE_BYTE0xF116‘AFX_IDP_PARSE_UINT0xF117’AFX_IDP_PARSE_DATETIME0xF118“AFX_IDP_PARSE_CURRENCY0xF119”AFX_IDP_PARSE_GUID0xF11A•AFX_IDP_PARSE_TIME0xF11B–AFX_IDP_PARSE_DATE0xF11C—AFX_IDP_FAILED_INVALID_FORMAT0xF120šAFX_IDP_FAILED_INVALID_PATH0xF121›AFX_IDP_FAILED_DISK_FULL0xF122œAFX_IDP_FAILED_ACCESS_READ0xF123AFX_IDP_FAILED_ACCESS_WRITE0xF124žAFX_IDP_FAILED_IO_ERROR_READ0xF125ŸAFX_IDP_FAILED_IO_ERROR_WRITE0xF126 AFX_IDP_SCRIPT_ERROR0xF130£AFX_IDP_SCRIPT_DISPATCH_EXCEPTION0xF131¤AFX_IDP_STATIC_OBJECT0xF180§AFX_IDP_FAILED_TO_CONNECT0xF181¨AFX_IDP_SERVER_BUSY0xF182©AFX_IDP_BAD_VERB0xF183ªAFX_IDS_NOT_DOCOBJECT0xF184«AFX_IDP_FAILED_TO_NOTIFY0xF185¬AFX_IDP_FAILED_TO_LAUNCH0xF186­AFX_IDP_ASK_TO_UPDATE0xF187®AFX_IDP_FAILED_TO_UPDATE0xF188¯AFX_IDP_FAILED_TO_REGISTER0xF189°AFX_IDP_FAILED_TO_AUTO_REGISTER0xF18A±AFX_IDP_FAILED_TO_CONVERT0xF18B²AFX_IDP_GET_NOT_SUPPORTED0xF18C³AFX_IDP_SET_NOT_SUPPORTED0xF18D´AFX_IDP_ASK_TO_DISCARD0xF18EµAFX_IDP_FAILED_TO_CREATE0xF18F¶AFX_IDP_FAILED_MAPI_LOAD0xF190¹AFX_IDP_INVALID_MAPI_DLL0xF191ºAFX_IDP_FAILED_MAPI_SEND0xF192»AFX_IDP_FILE_NONE0xF1A0½AFX_IDP_FILE_GENERIC0xF1A1¾AFX_IDP_FILE_NOT_FOUND0xF1A2¿AFX_IDP_FILE_BAD_PATH0xF1A3ÀAFX_IDP_FILE_TOO_MANY_OPEN0xF1A4ÁAFX_IDP_FILE_ACCESS_DENIED0xF1A5ÂAFX_IDP_FILE_INVALID_FILE0xF1A6ÃAFX_IDP_FILE_REMOVE_CURRENT0xF1A7ÄAFX_IDP_FILE_DIR_FULL0xF1A8ÅAFX_IDP_FILE_BAD_SEEK0xF1A9ÆAFX_IDP_FILE_HARD_IO0xF1AAÇAFX_IDP_FILE_SHARING0xF1ABÈAFX_IDP_FILE_LOCKING0xF1ACÉAFX_IDP_FILE_DISKFULL0xF1ADÊAFX_IDP_FILE_EOF0xF1AEËAFX_IDP_ARCH_NONE0xF1B0ÍAFX_IDP_ARCH_GENERIC0xF1B1ÎAFX_IDP_ARCH_READONLY0xF1B2ÏAFX_IDP_ARCH_ENDOFFILE0xF1B3ÐAFX_IDP_ARCH_WRITEONLY0xF1B4ÑAFX_IDP_ARCH_BADINDEX0xF1B5ÒAFX_IDP_ARCH_BADCLASS0xF1B6ÓAFX_IDP_ARCH_BADSCHEMA0xF1B7ÔAFX_IDS_OCC_SCALEUNITS_PIXELS0xF1C0ÖAFX_IDS_STATUS_FONT0xF230ÛAFX_IDS_TOOLTIP_FONT0xF231ÜAFX_IDS_UNICODE_FONT0xF232ÝAFX_IDS_MINI_FONT0xF233ÞAFX_IDP_SQL_CONNECT_FAIL0xF281äAFX_IDP_SQL_RECORDSET_FORWARD_ONLY0xF282åAFX_IDP_SQL_EMPTY_COLUMN_LIST0xF283æAFX_IDP_SQL_FIELD_SCHEMA_MISMATCH0xF284çAFX_IDP_SQL_ILLEGAL_MODE0xF285èAFX_IDP_SQL_MULTIPLE_ROWS_AFFECTED0xF286éAFX_IDP_SQL_NO_CURRENT_RECORD0xF287êAFX_IDP_SQL_NO_ROWS_AFFECTED0xF288ëAFX_IDP_SQL_RECORDSET_READONLY0xF289ìAFX_IDP_SQL_SQL_NO_TOTAL0xF28AíAFX_IDP_SQL_ODBC_LOAD_FAILED0xF28BîAFX_IDP_SQL_DYNASET_NOT_SUPPORTED0xF28CïAFX_IDP_SQL_SNAPSHOT_NOT_SUPPORTED0xF28DðAFX_IDP_SQL_API_CONFORMANCE0xF28EñAFX_IDP_SQL_SQL_CONFORMANCE0xF28FòAFX_IDP_SQL_NO_DATA_FOUND0xF290óAFX_IDP_SQL_ROW_UPDATE_NOT_SUPPORTED0xF291ôAFX_IDP_SQL_ODBC_V2_REQUIRED0xF292õAFX_IDP_SQL_NO_POSITIONED_UPDATES0xF293öAFX_IDP_SQL_LOCK_MODE_NOT_SUPPORTED0xF294÷AFX_IDP_SQL_DATA_TRUNCATED0xF295øAFX_IDP_SQL_ROW_FETCH0xF296ùAFX_IDP_SQL_INCORRECT_ODBC0xF297úAFX_IDP_SQL_UPDATE_DELETE_FAILED0xF298ûAFX_IDP_SQL_DYNAMIC_CURSOR_NOT_SUPPORTED0xF299üAFX_IDP_SQL_FIELD_NOT_FOUND0xF29AýAFX_IDP_SQL_BOOKMARKS_NOT_SUPPORTED0xF29BþAFX_IDP_SQL_BOOKMARKS_NOT_ENABLED0xF29CÿAFX_IDS_DELETED0xF29DAFX_IDP_DAO_ENGINE_INITIALIZATION0xF2B0AFX_IDP_DAO_DFX_BIND0xF2B1 AFX_IDP_DAO_OBJECT_NOT_OPEN0xF2B2 AFX_IDP_DAO_ROWTOOSHORT0xF2B3AFX_IDP_DAO_BADBINDINFO0xF2B4AFX_IDP_DAO_COLUMNUNAVAILABLE0xF2B5AFX_IDS_HTTP_TITLE0xF2D1AFX_IDS_HTTP_NO_TEXT0xF2D2AFX_IDS_HTTP_BAD_REQUEST0xF2D3AFX_IDS_HTTP_AUTH_REQUIRED0xF2D4AFX_IDS_HTTP_FORBIDDEN0xF2D5AFX_IDS_HTTP_NOT_FOUND0xF2D6AFX_IDS_HTTP_SERVER_ERROR0xF2D7AFX_IDS_HTTP_NOT_IMPLEMENTED0xF2D8AFX_IDS_CHECKLISTBOX_UNCHECK0xF2E1!AFX_IDS_CHECKLISTBOX_CHECK0xF2E2"AFX_IDS_CHECKLISTBOX_MIXED0xF2E3#AFX_IDC_LISTBOX100)AFX_IDC_CHANGE101*AFX_IDC_BROWSER102+AFX_IDC_PRINT_DOCNAME201.AFX_IDC_PRINT_PRINTERNAME202/AFX_IDC_PRINT_PORTNAME2030AFX_IDC_PRINT_PAGENUM2041ID_APPLY_NOW0x30214ID_WIZBACK0x30235ID_WIZNEXT0x30246ID_WIZFINISH0x30257AFX_IDC_TAB_CONTROL0x30208AFX_IDD_NEWTYPEDLG30721KAFX_IDD_PRINTDLG30722LAFX_IDD_PREVIEW_TOOLBAR30723MAFX_IDD_INSERTOBJECT30724PAFX_IDD_CHANGEICON30725QAFX_IDD_CONVERT30726RAFX_IDD_PASTESPECIAL30727SAFX_IDD_EDITLINKS30728TAFX_IDD_FILEBROWSE30729UAFX_IDD_BUSY30730VAFX_IDD_OBJECTPROPERTIES30732XAFX_IDD_CHANGESOURCE30733YAFX_IDC_CONTEXTHELP30977]AFX_IDC_MAGNIFY30978^AFX_IDC_SMALLARROWS30979_AFX_IDC_HSPLITBAR30980`AFX_IDC_VSPLITBAR30981aAFX_IDC_NODROPCRSR30982bAFX_IDC_TRACKNWSE30983cAFX_IDC_TRACKNESW30984dAFX_IDC_TRACKNS30985eAFX_IDC_TRACKWE30986fAFX_IDC_TRACK4WAY30987gAFX_IDC_MOVE4WAY30988hAFX_IDC_MOUSE_PAN_NW30998lAFX_IDC_MOUSE_PAN_N30999mAFX_IDC_MOUSE_PAN_NE31000nAFX_IDC_MOUSE_PAN_W31001oAFX_IDC_MOUSE_PAN_HV31002pAFX_IDC_MOUSE_PAN_E31003qAFX_IDC_MOUSE_PAN_SW31004rAFX_IDC_MOUSE_PAN_S31005sAFX_IDC_MOUSE_PAN_SE31006tAFX_IDC_MOUSE_PAN_HORZ31007uAFX_IDC_MOUSE_PAN_VERT31008vAFX_IDC_MOUSE_ORG_HORZ31009yAFX_IDC_MOUSE_ORG_VERT31010zAFX_IDC_MOUSE_ORG_HV31011{AFX_IDC_MOUSE_MASK31012|AFX_IDB_MINIFRAME_MENU30994AFX_IDB_CHECKLISTBOX_9530996‚AFX_IDR_PREVIEW_ACCEL30997…AFX_IDI_STD_MDIFRAME31233ˆAFX_IDI_STD_FRAME31234‰AFX_IDC_FONTPROP1000AFX_IDC_FONTNAMES1001AFX_IDC_FONTSTYLES1002‘AFX_IDC_FONTSIZES1003’AFX_IDC_STRIKEOUT1004“AFX_IDC_UNDERLINE1005”AFX_IDC_SAMPLEBOX1006•AFX_IDC_COLOR_BLACK1100˜AFX_IDC_COLOR_WHITE1101™AFX_IDC_COLOR_RED1102šAFX_IDC_COLOR_GREEN1103›AFX_IDC_COLOR_BLUE1104œAFX_IDC_COLOR_YELLOW1105AFX_IDC_COLOR_MAGENTA1106žAFX_IDC_COLOR_CYAN1107ŸAFX_IDC_COLOR_GRAY1108 AFX_IDC_COLOR_LIGHTGRAY1109¡AFX_IDC_COLOR_DARKRED1110¢AFX_IDC_COLOR_DARKGREEN1111£AFX_IDC_COLOR_DARKBLUE1112¤AFX_IDC_COLOR_LIGHTBROWN1113¥AFX_IDC_COLOR_DARKMAGENTA1114¦AFX_IDC_COLOR_DARKCYAN1115§AFX_IDC_COLORPROP1116¨AFX_IDC_SYSTEMCOLORS1117©AFX_IDC_PROPNAME1201¬AFX_IDC_PICTURE1202­AFX_IDC_BROWSE1203®AFX_IDC_CLEAR1204¯AFX_IDD_PROPPAGE_COLOR32257µAFX_IDD_PROPPAGE_FONT32258¶AFX_IDD_PROPPAGE_PICTURE32259·AFX_IDB_TRUETYPE32384¹AFX_IDS_PROPPAGE_UNKNOWN0xFE01¿AFX_IDS_COLOR_DESKTOP0xFE04ÀAFX_IDS_COLOR_APPWORKSPACE0xFE05ÁAFX_IDS_COLOR_WNDBACKGND0xFE06ÂAFX_IDS_COLOR_WNDTEXT0xFE07ÃAFX_IDS_COLOR_MENUBAR0xFE08ÄAFX_IDS_COLOR_MENUTEXT0xFE09ÅAFX_IDS_COLOR_ACTIVEBAR0xFE0AÆAFX_IDS_COLOR_INACTIVEBAR0xFE0BÇAFX_IDS_COLOR_ACTIVETEXT0xFE0CÈAFX_IDS_COLOR_INACTIVETEXT0xFE0DÉAFX_IDS_COLOR_ACTIVEBORDER0xFE0EÊAFX_IDS_COLOR_INACTIVEBORDER0xFE0FËAFX_IDS_COLOR_WNDFRAME0xFE10ÌAFX_IDS_COLOR_SCROLLBARS0xFE11ÍAFX_IDS_COLOR_BTNFACE0xFE12ÎAFX_IDS_COLOR_BTNSHADOW0xFE13ÏAFX_IDS_COLOR_BTNTEXT0xFE14ÐAFX_IDS_COLOR_BTNHIGHLIGHT0xFE15ÑAFX_IDS_COLOR_DISABLEDTEXT0xFE16ÒAFX_IDS_COLOR_HIGHLIGHT0xFE17ÓAFX_IDS_COLOR_HIGHLIGHTTEXT0xFE18ÔAFX_IDS_REGULAR0xFE19ÕAFX_IDS_BOLD0xFE1AÖAFX_IDS_ITALIC0xFE1B×AFX_IDS_BOLDITALIC0xFE1CØAFX_IDS_SAMPLETEXT0xFE1DÙAFX_IDS_DISPLAYSTRING_FONT0xFE1EÚAFX_IDS_DISPLAYSTRING_COLOR0xFE1FÛAFX_IDS_DISPLAYSTRING_PICTURE0xFE20ÜAFX_IDS_PICTUREFILTER0xFE21ÝAFX_IDS_PICTYPE_UNKNOWN0xFE22ÞAFX_IDS_PICTYPE_NONE0xFE23ßAFX_IDS_PICTYPE_BITMAP0xFE24àAFX_IDS_PICTYPE_METAFILE0xFE25áAFX_IDS_PICTYPE_ICON0xFE26âAFX_IDS_COLOR_PPG0xFE28ãAFX_IDS_COLOR_PPG_CAPTION0xFE29äAFX_IDS_FONT_PPG0xFE2AåAFX_IDS_FONT_PPG_CAPTION0xFE2BæAFX_IDS_PICTURE_PPG0xFE2CçAFX_IDS_PICTURE_PPG_CAPTION0xFE2DèAFX_IDS_PICTUREBROWSETITLE0xFE30éAFX_IDS_BORDERSTYLE_00xFE31êAFX_IDS_BORDERSTYLE_10xFE32ëAFX_IDS_VERB_EDIT0xFE40îAFX_IDS_VERB_PROPERTIES0xFE41ïAFX_IDP_PICTURECANTOPEN0xFE83òAFX_IDP_PICTURECANTLOAD0xFE84óAFX_IDP_PICTURETOOLARGE0xFE85ôAFX_IDP_PICTUREREADFAILED0xFE86õAFX_IDP_E_ILLEGALFUNCTIONCALL0xFEA0øAFX_IDP_E_OVERFLOW0xFEA1ùAFX_IDP_E_OUTOFMEMORY0xFEA2úAFX_IDP_E_DIVISIONBYZERO0xFEA3ûAFX_IDP_E_OUTOFSTRINGSPACE0xFEA4üAFX_IDP_E_OUTOFSTACKSPACE0xFEA5ýAFX_IDP_E_BADFILENAMEORNUMBER0xFEA6þAFX_IDP_E_FILENOTFOUND0xFEA7ÿAFX_IDP_E_BADFILEMODE0xFEA8AFX_IDP_E_FILEALREADYOPEN0xFEA9AFX_IDP_E_DEVICEIOERROR0xFEAAAFX_IDP_E_FILEALREADYEXISTS0xFEABAFX_IDP_E_BADRECORDLENGTH0xFEACAFX_IDP_E_DISKFULL0xFEADAFX_IDP_E_BADRECORDNUMBER0xFEAEAFX_IDP_E_BADFILENAME0xFEAFAFX_IDP_E_TOOMANYFILES0xFEB0AFX_IDP_E_DEVICEUNAVAILABLE0xFEB1 AFX_IDP_E_PERMISSIONDENIED0xFEB2 AFX_IDP_E_DISKNOTREADY0xFEB3 AFX_IDP_E_PATHFILEACCESSERROR0xFEB4 AFX_IDP_E_PATHNOTFOUND0xFEB5 AFX_IDP_E_INVALIDPATTERNSTRING0xFEB6AFX_IDP_E_INVALIDUSEOFNULL0xFEB7AFX_IDP_E_INVALIDFILEFORMAT0xFEB8AFX_IDP_E_INVALIDPROPERTYVALUE0xFEB9AFX_IDP_E_INVALIDPROPERTYARRAYINDEX0xFEBAAFX_IDP_E_SETNOTSUPPORTEDATRUNTIME0xFEBBAFX_IDP_E_SETNOTSUPPORTED0xFEBCAFX_IDP_E_NEEDPROPERTYARRAYINDEX0xFEBDAFX_IDP_E_SETNOTPERMITTED0xFEBEAFX_IDP_E_GETNOTSUPPORTEDATRUNTIME0xFEBFAFX_IDP_E_GETNOTSUPPORTED0xFEC0AFX_IDP_E_PROPERTYNOTFOUND0xFEC1AFX_IDP_E_INVALIDCLIPBOARDFORMAT0xFEC2AFX_IDP_E_INVALIDPICTURE0xFEC3AFX_IDP_E_PRINTERERROR0xFEC4AFX_IDP_E_CANTSAVEFILETOTEMP0xFEC5AFX_IDP_E_SEARCHTEXTNOTFOUND0xFEC6AFX_IDP_E_REPLACEMENTSTOOLONG0xFEC7!!ãÿÎ$HWBÿÿÉ0 ÿÿÿÿÿÿÿÿ c:\Projects\duma_2_4_26\win32-msvc.net\dumadll\resource.hÿÿÿÿÿÿÿÿ C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include/afxres.hÿÿÿÿÿÿÿÿ C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include/winres.hF$HWBÿÿÊ0 TEXTINCLUDE1$ÿÿTEXTINCLUDE2$ÿÿTEXTINCLUDE3$ÿÿ$ÿÿ,$HWBÿÿ0 >DHWBÿÿ  ¸TEXTINCLUDEÿÿ0 øTEXTINCLUDEÿÿ0 DTEXTINCLUDEÿÿ0 ?lHWBÿÿÈ0 ÎAHWBÿÿÉ0 FCHWBÿÿÊ0 duma-VERSION_2_5_21/win32-msvc.2005/dumadll/dumadll.vcproj000066400000000000000000000221021401225056000226540ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.2005/dumalib/000077500000000000000000000000001401225056000200035ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.2005/dumalib/dumalib.vcproj000066400000000000000000000155741401225056000226610ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.2005/dumatest/000077500000000000000000000000001401225056000202145ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.2005/dumatest/dumatest.vcproj000066400000000000000000000156241401225056000232770ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.2005/dumatestpp/000077500000000000000000000000001401225056000205545ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.2005/dumatestpp/dumatestpp.vcproj000066400000000000000000000163261401225056000241770ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.2005/example1/000077500000000000000000000000001401225056000201025ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.2005/example1/example1.sln000066400000000000000000000034241401225056000223370ustar00rootroot00000000000000Microsoft Visual Studio Solution File, Format Version 9.00 # Visual Studio 2005 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example1", "example1.vcproj", "{7767D2B3-B7AE-4DE7-B6AD-F8BBA268E956}" ProjectSection(ProjectDependencies) = postProject {31A93E3A-962A-4769-812A-45A3803B6127} = {31A93E3A-962A-4769-812A-45A3803B6127} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dumalib", "..\dumalib\dumalib.vcproj", "{31A93E3A-962A-4769-812A-45A3803B6127}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Detours|Win32 = Detours|Win32 Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {7767D2B3-B7AE-4DE7-B6AD-F8BBA268E956}.Debug|Win32.ActiveCfg = Debug|Win32 {7767D2B3-B7AE-4DE7-B6AD-F8BBA268E956}.Debug|Win32.Build.0 = Debug|Win32 {7767D2B3-B7AE-4DE7-B6AD-F8BBA268E956}.Detours|Win32.ActiveCfg = Debug|Win32 {7767D2B3-B7AE-4DE7-B6AD-F8BBA268E956}.Detours|Win32.Build.0 = Debug|Win32 {7767D2B3-B7AE-4DE7-B6AD-F8BBA268E956}.Release|Win32.ActiveCfg = Release|Win32 {7767D2B3-B7AE-4DE7-B6AD-F8BBA268E956}.Release|Win32.Build.0 = Release|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Debug|Win32.ActiveCfg = Debug|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Debug|Win32.Build.0 = Debug|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Detours|Win32.ActiveCfg = Detours|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Detours|Win32.Build.0 = Detours|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Release|Win32.ActiveCfg = Release|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal duma-VERSION_2_5_21/win32-msvc.2005/example1/example1.suo000066400000000000000000000260001401225056000223440ustar00rootroot00000000000000ÐÏࡱá>þÿ þÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿýÿÿÿþÿÿÿ þÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿRoot EntryÿÿÿÿÿÿÿÿЊÌLïÆÀProjInfoExÿÿÿÿÿÿÿÿÿÿÿÿTaskListUserTasks$ÿÿÿÿIToolboxService ÿÿÿÿRþÿÿÿþÿÿÿþÿÿÿþÿÿÿ þÿÿÿþÿÿÿ þÿÿÿþÿÿÿþÿÿÿþÿÿÿ !"#$%&'()*+,-þÿÿÿ/þÿÿÿ12345þÿÿÿR89:;<=>?@þÿÿÿBCDEFGHIJþÿÿÿþÿÿÿþÿÿÿNþÿÿÿPQþÿÿÿþÿÿÿþÿÿÿUVþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¹Yà ç¤ÒJ³õ§KôCðC  UML Class UML ComponentUML Deployment UML Use Case UML ActivityUML StatechartUML Collaboration UML SequenceGeometric ShapesDevice ControlsData XML Schema Dialog EditorMobile Web Forms Web Forms Components Windows FormsHTMLClipboard RingGeneralIVSMDPropertyBrowser*ÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿDebuggerWatches ÿÿÿÿÿÿÿÿÿÿÿÿDebuggerBreakpoints( ÿÿÿÿ zDebuggerExceptions&ÿÿÿÿ nC:\Projects\duma-dd-unstable\win32-msvc.2005\example1\€C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\crt\src\ŽC:\Program Files\Microsoft Visual Studio .NET 2003\Vc7DebuggerFindSource&ÿÿÿÿ ÿÿÿÿ ¼DebuggerFindSymbol&ÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿDebuggerMemoryWindows,ÿÿÿÿnExternalFilesProjectContents: ÿÿÿÿÿÿÿÿþÿÿÿ\atlmfc\src\mfc\ŽC:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\src\atl\0x000000000d / ÿÿLz°KzÈLz{7767D2B3-B7AE-4DE7-B6AD-F8BBA268E956}|example1.vcproj|c:\PrDocumentWindowPositions0ÿÿÿÿÿÿÿÿÿÿÿÿ_DocumentWindowUserData. ÿÿÿÿSolutionConfiguration,ÿÿÿÿÿÿÿÿÿÿÿÿ€ObjMgrContentsÿÿÿÿ.Zojects\duma-dd-unstable\example1.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}1234ple1.cpp||{D0E1A5 Í«4ïþîÿB60-3365922C2A22}MultiStartupProj=;4{7767D2B3-B7AE-4DE7-B6AD-F8BBA268E956}.dwStartupOpt=;StartupProject=&{7767D2B3-B7AE-4DE7-B6AD-F8BBA268E956};?{7767D2B3-B7AE-4DE7-B6AD-F8BBA268E956}.Release|Win32.fBatchBld=;={7767D2B3-B7AE-4DE7-B6AD-F8BBA268E956}.Debug|Win32.fBatchBld=;4{31A93E3A-962A-4769-812A-45A3803B6127}.dwStartupOpt=;?{31A93E3A-962A-4769-812A-45A3803B6127}.Detours|Win32.fBatchBld=;?{31A93E3A-962A-4769-812A-45A3803B6127}.Release|Win32.fBatchBld=;={31A93E3A-962A-4769-812A-45A3803B6127}.Debug|Win32.fBatchBld=; ActiveCfg= Debug|Win32;ç%Ò¯##G¶åá}'bm4Élü #Oÿ‡øÏ¤Eexample1ëdumalibÓClassViewContents$ÿÿÿÿÿÿÿÿþÿÿÿProjExplorerState$ÿÿÿÿ0JUnloadedProjects"ÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿexample1ÿÿÿÿ7lQ ˆC:\Projects\duma-dd-unstable\win32-msvc.2005\dumalib\dumalib.vcprojŒC:\Projects\duma-dd-unstable\win32-msvc.2005\example1\example1.vcprojQuelldateien-msvc.net\example1\example1Tc:\Projects\duma-dd-unstable\Debug|Win32DebugSettingsô.õ.ö. ø.÷.ù.ú.û.ü.ý. ÿ.,GeneralConfigSettingsVCBscMakeTool(EndConfigPropertiesRelease|Win32DebugSettingsô.õ.ö. ø.÷.ù.ú.û.ü.ý. ÿ.,GeneralConfigSettingsVCBscMakeTool(EndConfigPropertiesDebug|Win32DebugSettingsô.õ.ö. ø.÷.ù.ú.û.ü.ý. ÿ.,GeneralConfigSettingsVCBscMakeTool(EndConfigPropertiesRelease|Win32DebugSettingsô.õ.ö. ø.÷.ù.ú.dumalibÿÿÿÿÿÿÿÿÿÿÿÿAlTaskListShortcuts$ÿÿÿÿÿÿÿÿÿÿÿÿKVsToolboxService"ÿÿÿÿLXmlPackageOptions$ÿÿÿÿÿÿÿÿÿÿÿÿMpû.ü.ý. ÿ.,GeneralConfigSettingsVCBscMakeTool(EndConfigPropertiesXÏ >C:\Projects\duma-dd-unstable\win32-msvc.2005\example1\example1example1S$ ýA+ÁH±ÚªÏ¥WLÉlü #Oÿ‡øÏ¤ELç%Ò¯##G¶åá}'bm4ObjMgrContentsV8"ÿÿÿÿO‚HiddenSlnFolders"ÿÿÿÿÿÿÿÿþÿÿÿOutliningStateDir$ÿÿÿÿÿÿÿÿÿÿÿÿ6`BookmarkStateÿÿÿÿÿÿÿÿS(S8fÂþÂL¤d®—ï9LÉlü #Oÿ‡øÏ¤ELç%Ò¯##G¶åá}'bm4example1.cpp$Bookmarks V001.01Tc:\Projects\duma-dd-unstable\example1.cpp)£  ÿÿÿÿOutliningState1 ÿÿÿÿÿÿÿÿÿÿÿÿTŒÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿduma-VERSION_2_5_21/win32-msvc.2005/example1/example1.vcproj000066400000000000000000000102021401225056000230360ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.2005/example2/000077500000000000000000000000001401225056000201035ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.2005/example2/example2.sln000066400000000000000000000034241401225056000223410ustar00rootroot00000000000000Microsoft Visual Studio Solution File, Format Version 9.00 # Visual Studio 2005 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example2", "example2.vcproj", "{1757BA1C-E0B4-42AB-A1E0-B9575607732D}" ProjectSection(ProjectDependencies) = postProject {31A93E3A-962A-4769-812A-45A3803B6127} = {31A93E3A-962A-4769-812A-45A3803B6127} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dumalib", "..\dumalib\dumalib.vcproj", "{31A93E3A-962A-4769-812A-45A3803B6127}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Detours|Win32 = Detours|Win32 Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {1757BA1C-E0B4-42AB-A1E0-B9575607732D}.Debug|Win32.ActiveCfg = Debug|Win32 {1757BA1C-E0B4-42AB-A1E0-B9575607732D}.Debug|Win32.Build.0 = Debug|Win32 {1757BA1C-E0B4-42AB-A1E0-B9575607732D}.Detours|Win32.ActiveCfg = Debug|Win32 {1757BA1C-E0B4-42AB-A1E0-B9575607732D}.Detours|Win32.Build.0 = Debug|Win32 {1757BA1C-E0B4-42AB-A1E0-B9575607732D}.Release|Win32.ActiveCfg = Release|Win32 {1757BA1C-E0B4-42AB-A1E0-B9575607732D}.Release|Win32.Build.0 = Release|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Debug|Win32.ActiveCfg = Debug|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Debug|Win32.Build.0 = Debug|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Detours|Win32.ActiveCfg = Detours|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Detours|Win32.Build.0 = Detours|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Release|Win32.ActiveCfg = Release|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal duma-VERSION_2_5_21/win32-msvc.2005/example2/example2.suo000066400000000000000000000240001401225056000223440ustar00rootroot00000000000000ÐÏࡱá>þÿ þÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿýÿÿÿþÿÿÿ þÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿRoot Entryÿÿÿÿÿÿÿÿ`¥0MïÆProjInfoExÿÿÿÿÿÿÿÿTaskListUserTasks$ÿÿÿÿIToolboxService ÿÿÿÿRþÿÿÿþÿÿÿþÿÿÿþÿÿÿ þÿÿÿþÿÿÿ þÿÿÿþÿÿÿþÿÿÿþÿÿÿ !"#$%&'(F*þÿÿÿ,-./þÿÿÿ123456789þÿÿÿ;<=>?@ABCþÿÿÿþÿÿÿþÿÿÿþÿÿÿHIþÿÿÿþÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¹Yà ç¤ÒJ³õ§KôCðC  UML Class UML ComponentUML Deployment UML Use Case UML ActivityUML StatechartUML Collaboration UML SequenceGeometric ShapesDevice ControlsData XML Schema Dialog EditorMobile Web Forms Web Forms Components Windows FormsHTMLClipboard RingGeneralIVSMDPropertyBrowser*ÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿDebuggerWatches ÿÿÿÿÿÿÿÿÿÿÿÿDebuggerBreakpoints( ÿÿÿÿ zDebuggerExceptions&ÿÿÿÿÿÿÿÿÿÿÿÿ nC:\Projects\duma-dd-unstable\win32-msvc.2005\example2\€C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\crt\src\ŽC:\Program Files\Microsoft Visual Studio .NET 2003\Vc7DebuggerFindSource& ÿÿÿÿ ¼DebuggerFindSymbol&ÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿDebuggerMemoryWindows,ÿÿÿÿnExternalFilesProjectContents: ÿÿÿÿÿÿÿÿþÿÿÿ\atlmfc\src\mfc\ŽC:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\src\atl\0x000000000dMultiStartupProj=;4{1757BDocumentWindowPositions0ÿÿÿÿÿÿÿÿÿÿÿÿ DocumentWindowUserData. ÿÿÿÿSolutionConfiguration,ÿÿÿÿÿÿÿÿÿÿÿÿ„ObjMgrContentsÿÿÿÿ)qA1C-E0B4-42AB-A1E0-B9575607732D}.dwStartupOpt=;StartupProject=&{1757BA1C-E0B4-42AB-A1E0-B9575607732D};?{1757BA1C-E0B4-42AB-A1E0-B9575607732D}.Release|Win32.fBatchBld=;={1757BA1C-E0B4-42AB-A1E0-B9575607732D}.Debug|Win32.fBatchBld=;4{31A93E3A-962A-4769-812A-45A3803B6127}.dwStartupOpt=;?{31A93E3A-962A-4769-812A-45A3803B6127}.Detours|Win32.fBatchBld=;?{31A93E3A-962A-4769-812A-45A3803B6127}.Release|Win32.fBatchBld=;={31A93E3A-962A-4769-812A-45A3803B6127}.Debug|Win32.fBatchBld=; ActiveCfg= Release|Win3ç%Ò¯##G¶åá}'bm4Élü #Oÿ‡øÏ¤Eexample1éexample2ƒdumalibÓQ ˆC:\Projects\duma-dd-unstable\win32-msvc.2005\dumalib\dumalib.vcprojŒC:\Projects\duma-dd-unstable\win32-msvc.2005\example2\example2.vcprojClassViewContents$ÿÿÿÿþÿÿÿProjExplorerState$ÿÿÿÿ+*UnloadedProjects"ÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿexample2ÿÿÿÿ0lDebug|Win32DebugSettingsô.õ.ö. ø.÷.ù.ú.û.ü.ý. ÿ.,GeneralConfigSettingsVCBscMakeTool(EndConfigPropertiesRelease|Win32DebugSettingsô.õ.ö. ø.÷.ù.ú.û.ü.ý. ÿ.,GeneralConfigSettingsVCBscMakeTool(EndConfigPropertiesDebug|Win32DebugSettingsô.õ.ö. ø.÷.ù.ú.û.ü.ý. ÿ.,GeneralConfigSettingsVCBscMakeTool(EndConfigPropertiesRelease|Win32DebugSettingsdumalibÿÿÿÿÿÿÿÿÿÿÿÿ:lTaskListShortcuts$ÿÿÿÿÿÿÿÿÿÿÿÿDVsToolboxService"ÿÿÿÿÿÿÿÿEObjMgrContentsV8"ÿÿÿÿG‚ô.õ.ö. ø.÷.ù.ú.û.ü.ý. ÿ.,GeneralConfigSettingsVCBscMakeTool(EndConfigPropertiesXÏ 2;S$ ýA+ÁH±ÚªÏ¥WLÉlü #Oÿ‡øÏ¤ELç%Ò¯##G¶åá}'bm4S8fÂþÂL¤d®—ï9LÉlü #Oÿ‡øÏ¤ELç%Ò¯##G¶åá}'bm4$Bookmarks V001.01HiddenSlnFolders"ÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿOutliningStateDir$ÿÿÿÿÿÿÿÿÿÿÿÿJBookmarkStateÿÿÿÿÿÿÿÿÿÿÿÿK(ÿÿÿÿÿÿÿÿÿÿÿÿduma-VERSION_2_5_21/win32-msvc.2005/example2/example2.vcproj000066400000000000000000000102021401225056000230400ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.2005/example3/000077500000000000000000000000001401225056000201045ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.2005/example3/example3.sln000066400000000000000000000034241401225056000223430ustar00rootroot00000000000000Microsoft Visual Studio Solution File, Format Version 9.00 # Visual Studio 2005 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example3", "example3.vcproj", "{7CBF9D5B-88DA-4897-BF8C-6DBB4FCF82CD}" ProjectSection(ProjectDependencies) = postProject {31A93E3A-962A-4769-812A-45A3803B6127} = {31A93E3A-962A-4769-812A-45A3803B6127} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dumalib", "..\dumalib\dumalib.vcproj", "{31A93E3A-962A-4769-812A-45A3803B6127}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Detours|Win32 = Detours|Win32 Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {7CBF9D5B-88DA-4897-BF8C-6DBB4FCF82CD}.Debug|Win32.ActiveCfg = Debug|Win32 {7CBF9D5B-88DA-4897-BF8C-6DBB4FCF82CD}.Debug|Win32.Build.0 = Debug|Win32 {7CBF9D5B-88DA-4897-BF8C-6DBB4FCF82CD}.Detours|Win32.ActiveCfg = Debug|Win32 {7CBF9D5B-88DA-4897-BF8C-6DBB4FCF82CD}.Detours|Win32.Build.0 = Debug|Win32 {7CBF9D5B-88DA-4897-BF8C-6DBB4FCF82CD}.Release|Win32.ActiveCfg = Release|Win32 {7CBF9D5B-88DA-4897-BF8C-6DBB4FCF82CD}.Release|Win32.Build.0 = Release|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Debug|Win32.ActiveCfg = Debug|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Debug|Win32.Build.0 = Debug|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Detours|Win32.ActiveCfg = Detours|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Detours|Win32.Build.0 = Detours|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Release|Win32.ActiveCfg = Release|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal duma-VERSION_2_5_21/win32-msvc.2005/example3/example3.vcproj000066400000000000000000000103421401225056000230470ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.2005/example4/000077500000000000000000000000001401225056000201055ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.2005/example4/example4.sln000066400000000000000000000034241401225056000223450ustar00rootroot00000000000000Microsoft Visual Studio Solution File, Format Version 9.00 # Visual Studio 2005 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example4", "example4.vcproj", "{406A19CF-D684-4989-BE5F-21F9E05FE412}" ProjectSection(ProjectDependencies) = postProject {31A93E3A-962A-4769-812A-45A3803B6127} = {31A93E3A-962A-4769-812A-45A3803B6127} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dumalib", "..\dumalib\dumalib.vcproj", "{31A93E3A-962A-4769-812A-45A3803B6127}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Detours|Win32 = Detours|Win32 Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {406A19CF-D684-4989-BE5F-21F9E05FE412}.Debug|Win32.ActiveCfg = Debug|Win32 {406A19CF-D684-4989-BE5F-21F9E05FE412}.Debug|Win32.Build.0 = Debug|Win32 {406A19CF-D684-4989-BE5F-21F9E05FE412}.Detours|Win32.ActiveCfg = Debug|Win32 {406A19CF-D684-4989-BE5F-21F9E05FE412}.Detours|Win32.Build.0 = Debug|Win32 {406A19CF-D684-4989-BE5F-21F9E05FE412}.Release|Win32.ActiveCfg = Release|Win32 {406A19CF-D684-4989-BE5F-21F9E05FE412}.Release|Win32.Build.0 = Release|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Debug|Win32.ActiveCfg = Debug|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Debug|Win32.Build.0 = Debug|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Detours|Win32.ActiveCfg = Detours|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Detours|Win32.Build.0 = Detours|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Release|Win32.ActiveCfg = Release|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal duma-VERSION_2_5_21/win32-msvc.2005/example4/example4.vcproj000066400000000000000000000102531401225056000230520ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.2005/example5/000077500000000000000000000000001401225056000201065ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.2005/example5/example5.sln000066400000000000000000000026741401225056000223550ustar00rootroot00000000000000Microsoft Visual Studio Solution File, Format Version 8.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example5", "example5.vcproj", "{2899F9C0-A1BA-4D5D-99FE-3146B4A0DA58}" ProjectSection(ProjectDependencies) = postProject {31A93E3A-962A-4769-812A-45A3803B6127} = {31A93E3A-962A-4769-812A-45A3803B6127} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dumalib", "..\dumalib\dumalib.vcproj", "{31A93E3A-962A-4769-812A-45A3803B6127}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug Release = Release EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {2899F9C0-A1BA-4D5D-99FE-3146B4A0DA58}.Debug.ActiveCfg = Debug|Win32 {2899F9C0-A1BA-4D5D-99FE-3146B4A0DA58}.Debug.Build.0 = Debug|Win32 {2899F9C0-A1BA-4D5D-99FE-3146B4A0DA58}.Release.ActiveCfg = Release|Win32 {2899F9C0-A1BA-4D5D-99FE-3146B4A0DA58}.Release.Build.0 = Release|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Debug.ActiveCfg = Debug|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Debug.Build.0 = Debug|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Release.ActiveCfg = Release|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection GlobalSection(ExtensibilityAddIns) = postSolution EndGlobalSection EndGlobal duma-VERSION_2_5_21/win32-msvc.2005/example5/example5.vcproj000066400000000000000000000064201401225056000230550ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.2005/example6/000077500000000000000000000000001401225056000201075ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.2005/example6/example6.sln000066400000000000000000000026741401225056000223570ustar00rootroot00000000000000Microsoft Visual Studio Solution File, Format Version 8.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example6", "example6.vcproj", "{05A63138-1207-479F-A06F-9B90689C5D8D}" ProjectSection(ProjectDependencies) = postProject {31A93E3A-962A-4769-812A-45A3803B6127} = {31A93E3A-962A-4769-812A-45A3803B6127} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dumalib", "..\dumalib\dumalib.vcproj", "{31A93E3A-962A-4769-812A-45A3803B6127}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug Release = Release EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {05A63138-1207-479F-A06F-9B90689C5D8D}.Debug.ActiveCfg = Debug|Win32 {05A63138-1207-479F-A06F-9B90689C5D8D}.Debug.Build.0 = Debug|Win32 {05A63138-1207-479F-A06F-9B90689C5D8D}.Release.ActiveCfg = Release|Win32 {05A63138-1207-479F-A06F-9B90689C5D8D}.Release.Build.0 = Release|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Debug.ActiveCfg = Debug|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Debug.Build.0 = Debug|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Release.ActiveCfg = Release|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection GlobalSection(ExtensibilityAddIns) = postSolution EndGlobalSection EndGlobal duma-VERSION_2_5_21/win32-msvc.2005/example6/example6.vcproj000066400000000000000000000066011401225056000230600ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.2005/quicktest/000077500000000000000000000000001401225056000204025ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.2005/quicktest/quicktest.cpp000066400000000000000000000010721401225056000231220ustar00rootroot00000000000000// quicktest.cpp : Defines the entry point for the console application. // #include #include #include #include #include "duma.h" int _tmain(int argc, _TCHAR* argv[]) { fprintf(stderr, "!!!!starting!!!\n"); for(int i=0; i<100; i++) { fprintf(stderr, "."); char* tmp = (char*) malloc(100); //tmp[110] = 'a'; free(tmp); } #if 1 for(int i=0; i<100; i++) { fprintf(stderr, "."); char* tmp = (char*) malloc(200); //tmp[110] = 'a'; //free(tmp); } #endif fprintf(stderr, "QUICKTEST DONE\n"); return 0; } duma-VERSION_2_5_21/win32-msvc.2005/quicktest/quicktest.vcproj000066400000000000000000000141371401225056000236510ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.2005/stacktrace/000077500000000000000000000000001401225056000205125ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.2005/stacktrace/ReadMe.txt000066400000000000000000000016111401225056000224070ustar00rootroot00000000000000======================================================================== STATIC LIBRARY : stacktrace Project Overview ======================================================================== AppWizard has created this stacktrace library project for you. No source files were created as part of your project. stacktrace.vcproj This is the main project file for VC++ projects generated using an Application Wizard. It contains information about the version of Visual C++ that generated the file, and information about the platforms, configurations, and project features selected with the Application Wizard. ///////////////////////////////////////////////////////////////////////////// Other notes: AppWizard uses "TODO:" comments to indicate parts of the source code you should add to or customize. ///////////////////////////////////////////////////////////////////////////// duma-VERSION_2_5_21/win32-msvc.2005/stacktrace/stacktrace.vcproj000066400000000000000000000156311401225056000240710ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.2005/tstheap/000077500000000000000000000000001401225056000200365ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.2005/tstheap/tstheap.vcproj000066400000000000000000000164531401225056000227440ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.net/000077500000000000000000000000001401225056000165665ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.net/createconf/000077500000000000000000000000001401225056000206775ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.net/createconf/createconf.vcproj000066400000000000000000000230471401225056000242430ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.net/detoursexample1/000077500000000000000000000000001401225056000217105ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.net/detoursexample1/detoursexample1.sln000066400000000000000000000016221401225056000255510ustar00rootroot00000000000000Microsoft Visual Studio Solution File, Format Version 8.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "detoursexample1", "detoursexample1\detoursexample1.vcproj", "{AA0D62FE-91EA-4F4B-A372-687F01F85126}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug Release = Release EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {AA0D62FE-91EA-4F4B-A372-687F01F85126}.Debug.ActiveCfg = Debug|Win32 {AA0D62FE-91EA-4F4B-A372-687F01F85126}.Debug.Build.0 = Debug|Win32 {AA0D62FE-91EA-4F4B-A372-687F01F85126}.Release.ActiveCfg = Release|Win32 {AA0D62FE-91EA-4F4B-A372-687F01F85126}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection GlobalSection(ExtensibilityAddIns) = postSolution EndGlobalSection EndGlobal duma-VERSION_2_5_21/win32-msvc.net/detoursexample1/detoursexample1.suo000066400000000000000000000220001401225056000255540ustar00rootroot00000000000000ÐÏࡱá>þÿ þÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿýÿÿÿþÿÿÿ þÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿRoot Entryÿÿÿÿÿÿÿÿ@ÑÍEÄÇ€ProjInfoExÿÿÿÿÿÿÿÿÿÿÿÿTaskListUserTasks$ÿÿÿÿIToolboxService ÿÿÿÿ¢þÿÿÿþÿÿÿþÿÿÿþÿÿÿ2þÿÿÿ þÿÿÿþÿÿÿþÿÿÿþÿÿÿ6þÿÿÿ þÿÿÿ"þÿÿÿ$%&B()*+,-./0þÿÿÿþÿÿÿ345þÿÿÿ789:;<=>?@AþÿÿÿCDEþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ”U³WækK„v1:+ÚDçðC Daten XML-Schema Dialog-EditorMobile Web Forms Web Forms Komponenten Windows FormsHTMLZwischenablagering AllgemeinGenerale ControlsDat Dialog EditorMobile Web Forms Web nF:\_wincvs\cvs_sf\duma\win32-msvc.net\detoursexample1\ IVSMDPropertyBrowser*ÿÿÿÿ ÿÿÿÿþÿÿÿDebuggerWatches ÿÿÿÿÿÿÿÿDebuggerBreakpoints(ÿÿÿÿ ÿÿÿÿ DebuggerExceptions&ÿÿÿÿ ÿÿÿÿ ‚c:\Projects\dC:\Projects\duma_2_4_26\win3€C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\crt\src\ŽC:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\src\mfc\ŽC:\Program Files\Microsoft Visual Studio .NETDebuggerFindSource&ÿÿÿÿÿÿÿÿÿÿÿÿ ¼DebuggerFindSymbol&ÿÿÿÿDebuggerMemoryWindows,ÿÿÿÿÿÿÿÿTExternalFilesProjectContents:ÿÿÿÿÿÿÿÿ 2003\Vc7\atlmfc\src\atl\Fioft Visual Studio .NETdæŸ ÿÿ'°KÙÈLÙb{AA0Í«4ï¾­ÞÍ«4ï¾­Þ12MultiStartupProj=;4{AA0D6DocumentWindowPositions0ÿÿÿÿÿÿÿÿÿÿÿÿDocumentWindowUserData. ÿÿÿÿ<SolutionConfiguration,ÿÿÿÿÿÿÿÿÿÿÿÿ^ObjMgrContentsÿÿÿÿ!h2FE-91EA-4F4B-A372-687F01F85126}.dwStartupOpt=;StartupProject=&{AA0D62FE-91EA-4F4B-A372-687F01F85126};?{AA0D62FE-91EA-4F4B-A372-687F01F85126}.Release|Win32.fBatchBld=;={AA0D62FE-91EA-4F4B-A372-687F01F85126}.Debug|Win32.fBatchBld=; ActiveCfg=Debug;;StartupProjNSܾï MŠ%˜¿Ÿøç%Ò¯##G¶åá}'bm4Élü #Oÿ‡øÏ¤E detoursexample10D62FE-91EA-Q ºF:\_wincvs\cvs_sf\duma\win32-msvc.net\detoursexample1\detoursexample1\detoursexample1.vcprojºF:\_wincvs\cvs_sf\duma\win32-Debug|Win32DebugSettingsô.õ.ö. ø.÷.ù.ú.û.ü.ý. ÿ.,GeneralConfigSettingsVCBscMakeTool(EndConfigPropertiesRelease|Win32DebugSettingsô.õ.ö. ø.÷.ù.ú.û.ü.ý. ÿ.,GeneralConfigSettingsVCBscMakeToolClassViewContents$ÿÿÿÿþÿÿÿProjExplorerState$ÿÿÿÿÿÿÿÿ#ÈUnloadedProjects"ÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿdetoursexample1 ÿÿÿÿÿÿÿÿÿÿÿÿ'l(EndConfigPropertiesFilesHXÏ Debug|Win32DebugSettingsuma-dd-unstable\detoursexample1\detoursexample1.cpp"·Ð:lÂдB $JÒPropertiesRelD62FE-91EA-4F4B-A372-687F01F85126}|detoursexample1\detoursexample1.vcproj|f:\_wincvs\cvs_sf\duma\detoursexample1\detoursexample1.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}1234æŸ ÿÿ(°KÙÈLÙL{AA0D62FE-91EA-4F4B-A372-687F01F85126}|detoursexample1\detoursexample1.vcproj|f:\_wincvs\cvs_sf\duma\detoursexample1\stdafTaskListShortcuts$ÿÿÿÿÿÿÿÿÿÿÿÿ1ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿx.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}12X{AA0D62FE-91EA-4msvc.net\detoursexample1\detoursexample1\detoursexample1.vcprojSource FilesHeader Filesample1\stdafx.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}123456Í«4ï¾­Þduma-VERSION_2_5_21/win32-msvc.net/detoursexample1/detoursexample1/000077500000000000000000000000001401225056000250325ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.net/detoursexample1/detoursexample1/detoursexample1.vcproj000066400000000000000000000075531401225056000314130ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.net/duma.sln000066400000000000000000000332511401225056000202360ustar00rootroot00000000000000Microsoft Visual Studio Solution File, Format Version 8.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "createconf", "createconf\createconf.vcproj", "{416528B5-9B1B-4DC1-A899-623C8F32ED13}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dumalib", "dumalib\dumalib.vcproj", "{31A93E3A-962A-4769-812A-45A3803B6127}" ProjectSection(ProjectDependencies) = postProject {56ABCE73-B688-4BC4-8D94-8ED6EC9083FB} = {56ABCE73-B688-4BC4-8D94-8ED6EC9083FB} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dumatest", "dumatest\dumatest.vcproj", "{CDD36623-87AF-4CDE-861E-31A9AB1B1D63}" ProjectSection(ProjectDependencies) = postProject {31A93E3A-962A-4769-812A-45A3803B6127} = {31A93E3A-962A-4769-812A-45A3803B6127} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dumatestpp", "dumatestpp\dumatestpp.vcproj", "{C67F03DD-E18F-44D9-8250-78BD411C5F01}" ProjectSection(ProjectDependencies) = postProject {31A93E3A-962A-4769-812A-45A3803B6127} = {31A93E3A-962A-4769-812A-45A3803B6127} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tstheap", "tstheap\tstheap.vcproj", "{5404C919-56FD-41A9-BB75-DB96201E08A1}" ProjectSection(ProjectDependencies) = postProject {31A93E3A-962A-4769-812A-45A3803B6127} = {31A93E3A-962A-4769-812A-45A3803B6127} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dumadetours", "dumadetours\dumadetours.vcproj", "{E6C785A7-4412-485F-AFA0-B4FC69976E05}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dumadetoursdll", "dumadetoursdll\dumadetoursdll.vcproj", "{37A06F53-EBA8-410C-A0BC-DC0A505EA205}" ProjectSection(ProjectDependencies) = postProject {31A93E3A-962A-4769-812A-45A3803B6127} = {31A93E3A-962A-4769-812A-45A3803B6127} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dumadll", "dumadll\dumadll.vcproj", "{B46EFEB6-2148-4FCA-9CEC-40CC261D1840}" ProjectSection(ProjectDependencies) = postProject {31A93E3A-962A-4769-812A-45A3803B6127} = {31A93E3A-962A-4769-812A-45A3803B6127} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stacktrace", "stacktrace\stacktrace.vcproj", "{56ABCE73-B688-4BC4-8D94-8ED6EC9083FB}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "quicktest", "quicktest\quicktest.vcproj", "{51E21787-88AF-4FE4-880D-D3C4E79B8990}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testoperators", "testoperators\testoperators.vcproj", "{9A57EF96-57A6-4E8A-902A-47014FEC068C}" ProjectSection(ProjectDependencies) = postProject {31A93E3A-962A-4769-812A-45A3803B6127} = {31A93E3A-962A-4769-812A-45A3803B6127} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testenv", "testenv\testenv.vcproj", "{34889460-A104-4C1A-B29B-DB7015BB8583}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testmt", "testmt\testmt.vcproj", "{2F1A196C-691F-4D66-883B-7190B89E42CB}" ProjectSection(ProjectDependencies) = postProject {31A93E3A-962A-4769-812A-45A3803B6127} = {31A93E3A-962A-4769-812A-45A3803B6127} EndProjectSection EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug Detours1.5 = Detours1.5 Detours2.1 = Detours2.1 Dll Debug = Dll Debug Dll Release = Dll Release Release = Release EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {416528B5-9B1B-4DC1-A899-623C8F32ED13}.Debug.ActiveCfg = Debug|Win32 {416528B5-9B1B-4DC1-A899-623C8F32ED13}.Debug.Build.0 = Debug|Win32 {416528B5-9B1B-4DC1-A899-623C8F32ED13}.Detours1.5.ActiveCfg = Detours Debug|Win32 {416528B5-9B1B-4DC1-A899-623C8F32ED13}.Detours2.1.ActiveCfg = Detours2.1|Win32 {416528B5-9B1B-4DC1-A899-623C8F32ED13}.Dll Debug.ActiveCfg = Dll Debug|Win32 {416528B5-9B1B-4DC1-A899-623C8F32ED13}.Dll Debug.Build.0 = Dll Debug|Win32 {416528B5-9B1B-4DC1-A899-623C8F32ED13}.Dll Release.ActiveCfg = Dll Release|Win32 {416528B5-9B1B-4DC1-A899-623C8F32ED13}.Dll Release.Build.0 = Dll Release|Win32 {416528B5-9B1B-4DC1-A899-623C8F32ED13}.Release.ActiveCfg = Release|Win32 {416528B5-9B1B-4DC1-A899-623C8F32ED13}.Release.Build.0 = Release|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Debug.ActiveCfg = Debug|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Debug.Build.0 = Debug|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Detours1.5.ActiveCfg = Detours Debug|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Detours1.5.Build.0 = Detours Debug|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Detours2.1.ActiveCfg = Detours2.1|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Detours2.1.Build.0 = Detours2.1|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Dll Debug.ActiveCfg = Dll Debug|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Dll Debug.Build.0 = Dll Debug|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Dll Release.ActiveCfg = Dll Release|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Dll Release.Build.0 = Dll Release|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Release.ActiveCfg = Release|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Release.Build.0 = Release|Win32 {CDD36623-87AF-4CDE-861E-31A9AB1B1D63}.Debug.ActiveCfg = Debug|Win32 {CDD36623-87AF-4CDE-861E-31A9AB1B1D63}.Debug.Build.0 = Debug|Win32 {CDD36623-87AF-4CDE-861E-31A9AB1B1D63}.Detours1.5.ActiveCfg = Detours Debug|Win32 {CDD36623-87AF-4CDE-861E-31A9AB1B1D63}.Detours2.1.ActiveCfg = Detours2.1|Win32 {CDD36623-87AF-4CDE-861E-31A9AB1B1D63}.Dll Debug.ActiveCfg = Dll Debug|Win32 {CDD36623-87AF-4CDE-861E-31A9AB1B1D63}.Dll Release.ActiveCfg = Dll Release|Win32 {CDD36623-87AF-4CDE-861E-31A9AB1B1D63}.Release.ActiveCfg = Release|Win32 {CDD36623-87AF-4CDE-861E-31A9AB1B1D63}.Release.Build.0 = Release|Win32 {C67F03DD-E18F-44D9-8250-78BD411C5F01}.Debug.ActiveCfg = Debug|Win32 {C67F03DD-E18F-44D9-8250-78BD411C5F01}.Debug.Build.0 = Debug|Win32 {C67F03DD-E18F-44D9-8250-78BD411C5F01}.Detours1.5.ActiveCfg = Detours Debug|Win32 {C67F03DD-E18F-44D9-8250-78BD411C5F01}.Detours2.1.ActiveCfg = Detours2.1|Win32 {C67F03DD-E18F-44D9-8250-78BD411C5F01}.Dll Debug.ActiveCfg = Dll Debug|Win32 {C67F03DD-E18F-44D9-8250-78BD411C5F01}.Dll Release.ActiveCfg = Dll Release|Win32 {C67F03DD-E18F-44D9-8250-78BD411C5F01}.Release.ActiveCfg = Release|Win32 {C67F03DD-E18F-44D9-8250-78BD411C5F01}.Release.Build.0 = Release|Win32 {5404C919-56FD-41A9-BB75-DB96201E08A1}.Debug.ActiveCfg = Debug|Win32 {5404C919-56FD-41A9-BB75-DB96201E08A1}.Debug.Build.0 = Debug|Win32 {5404C919-56FD-41A9-BB75-DB96201E08A1}.Detours1.5.ActiveCfg = Detours Debug|Win32 {5404C919-56FD-41A9-BB75-DB96201E08A1}.Detours2.1.ActiveCfg = Detours2.1|Win32 {5404C919-56FD-41A9-BB75-DB96201E08A1}.Dll Debug.ActiveCfg = Dll Debug|Win32 {5404C919-56FD-41A9-BB75-DB96201E08A1}.Dll Release.ActiveCfg = Dll Release|Win32 {5404C919-56FD-41A9-BB75-DB96201E08A1}.Release.ActiveCfg = Release|Win32 {5404C919-56FD-41A9-BB75-DB96201E08A1}.Release.Build.0 = Release|Win32 {E6C785A7-4412-485F-AFA0-B4FC69976E05}.Debug.ActiveCfg = Debug|Win32 {E6C785A7-4412-485F-AFA0-B4FC69976E05}.Detours1.5.ActiveCfg = Detours Debug|Win32 {E6C785A7-4412-485F-AFA0-B4FC69976E05}.Detours1.5.Build.0 = Detours Debug|Win32 {E6C785A7-4412-485F-AFA0-B4FC69976E05}.Detours2.1.ActiveCfg = Detours2.1|Win32 {E6C785A7-4412-485F-AFA0-B4FC69976E05}.Detours2.1.Build.0 = Detours2.1|Win32 {E6C785A7-4412-485F-AFA0-B4FC69976E05}.Dll Debug.ActiveCfg = Dll Debug|Win32 {E6C785A7-4412-485F-AFA0-B4FC69976E05}.Dll Release.ActiveCfg = Dll Release|Win32 {E6C785A7-4412-485F-AFA0-B4FC69976E05}.Release.ActiveCfg = Release|Win32 {37A06F53-EBA8-410C-A0BC-DC0A505EA205}.Debug.ActiveCfg = Debug|Win32 {37A06F53-EBA8-410C-A0BC-DC0A505EA205}.Detours1.5.ActiveCfg = Detours Debug|Win32 {37A06F53-EBA8-410C-A0BC-DC0A505EA205}.Detours1.5.Build.0 = Detours Debug|Win32 {37A06F53-EBA8-410C-A0BC-DC0A505EA205}.Detours2.1.ActiveCfg = Detours2.1|Win32 {37A06F53-EBA8-410C-A0BC-DC0A505EA205}.Detours2.1.Build.0 = Detours2.1|Win32 {37A06F53-EBA8-410C-A0BC-DC0A505EA205}.Dll Debug.ActiveCfg = Dll Debug|Win32 {37A06F53-EBA8-410C-A0BC-DC0A505EA205}.Dll Release.ActiveCfg = Dll Release|Win32 {37A06F53-EBA8-410C-A0BC-DC0A505EA205}.Release.ActiveCfg = Release|Win32 {B46EFEB6-2148-4FCA-9CEC-40CC261D1840}.Debug.ActiveCfg = Debug|Win32 {B46EFEB6-2148-4FCA-9CEC-40CC261D1840}.Detours1.5.ActiveCfg = Detours Debug|Win32 {B46EFEB6-2148-4FCA-9CEC-40CC261D1840}.Detours2.1.ActiveCfg = Detours2.1|Win32 {B46EFEB6-2148-4FCA-9CEC-40CC261D1840}.Dll Debug.ActiveCfg = Dll Debug|Win32 {B46EFEB6-2148-4FCA-9CEC-40CC261D1840}.Dll Debug.Build.0 = Dll Debug|Win32 {B46EFEB6-2148-4FCA-9CEC-40CC261D1840}.Dll Release.ActiveCfg = Dll Release|Win32 {B46EFEB6-2148-4FCA-9CEC-40CC261D1840}.Dll Release.Build.0 = Dll Release|Win32 {B46EFEB6-2148-4FCA-9CEC-40CC261D1840}.Release.ActiveCfg = Release|Win32 {56ABCE73-B688-4BC4-8D94-8ED6EC9083FB}.Debug.ActiveCfg = Debug|Win32 {56ABCE73-B688-4BC4-8D94-8ED6EC9083FB}.Debug.Build.0 = Debug|Win32 {56ABCE73-B688-4BC4-8D94-8ED6EC9083FB}.Detours1.5.ActiveCfg = Detours Debug|Win32 {56ABCE73-B688-4BC4-8D94-8ED6EC9083FB}.Detours1.5.Build.0 = Detours Debug|Win32 {56ABCE73-B688-4BC4-8D94-8ED6EC9083FB}.Detours2.1.ActiveCfg = Detours2.1|Win32 {56ABCE73-B688-4BC4-8D94-8ED6EC9083FB}.Detours2.1.Build.0 = Detours2.1|Win32 {56ABCE73-B688-4BC4-8D94-8ED6EC9083FB}.Dll Debug.ActiveCfg = Dll Debug|Win32 {56ABCE73-B688-4BC4-8D94-8ED6EC9083FB}.Dll Debug.Build.0 = Dll Debug|Win32 {56ABCE73-B688-4BC4-8D94-8ED6EC9083FB}.Dll Release.ActiveCfg = Dll Release|Win32 {56ABCE73-B688-4BC4-8D94-8ED6EC9083FB}.Dll Release.Build.0 = Dll Release|Win32 {56ABCE73-B688-4BC4-8D94-8ED6EC9083FB}.Release.ActiveCfg = Release|Win32 {56ABCE73-B688-4BC4-8D94-8ED6EC9083FB}.Release.Build.0 = Release|Win32 {51E21787-88AF-4FE4-880D-D3C4E79B8990}.Debug.ActiveCfg = Debug|Win32 {51E21787-88AF-4FE4-880D-D3C4E79B8990}.Debug.Build.0 = Debug|Win32 {51E21787-88AF-4FE4-880D-D3C4E79B8990}.Detours1.5.ActiveCfg = Debug|Win32 {51E21787-88AF-4FE4-880D-D3C4E79B8990}.Detours2.1.ActiveCfg = Detours2.1|Win32 {51E21787-88AF-4FE4-880D-D3C4E79B8990}.Dll Debug.ActiveCfg = Debug|Win32 {51E21787-88AF-4FE4-880D-D3C4E79B8990}.Dll Debug.Build.0 = Debug|Win32 {51E21787-88AF-4FE4-880D-D3C4E79B8990}.Dll Release.ActiveCfg = Release|Win32 {51E21787-88AF-4FE4-880D-D3C4E79B8990}.Dll Release.Build.0 = Release|Win32 {51E21787-88AF-4FE4-880D-D3C4E79B8990}.Release.ActiveCfg = Release|Win32 {51E21787-88AF-4FE4-880D-D3C4E79B8990}.Release.Build.0 = Release|Win32 {9A57EF96-57A6-4E8A-902A-47014FEC068C}.Debug.ActiveCfg = Debug|Win32 {9A57EF96-57A6-4E8A-902A-47014FEC068C}.Debug.Build.0 = Debug|Win32 {9A57EF96-57A6-4E8A-902A-47014FEC068C}.Detours1.5.ActiveCfg = Debug|Win32 {9A57EF96-57A6-4E8A-902A-47014FEC068C}.Detours1.5.Build.0 = Debug|Win32 {9A57EF96-57A6-4E8A-902A-47014FEC068C}.Detours2.1.ActiveCfg = Debug|Win32 {9A57EF96-57A6-4E8A-902A-47014FEC068C}.Detours2.1.Build.0 = Debug|Win32 {9A57EF96-57A6-4E8A-902A-47014FEC068C}.Dll Debug.ActiveCfg = Debug|Win32 {9A57EF96-57A6-4E8A-902A-47014FEC068C}.Dll Debug.Build.0 = Debug|Win32 {9A57EF96-57A6-4E8A-902A-47014FEC068C}.Dll Release.ActiveCfg = Release|Win32 {9A57EF96-57A6-4E8A-902A-47014FEC068C}.Dll Release.Build.0 = Release|Win32 {9A57EF96-57A6-4E8A-902A-47014FEC068C}.Release.ActiveCfg = Release|Win32 {9A57EF96-57A6-4E8A-902A-47014FEC068C}.Release.Build.0 = Release|Win32 {34889460-A104-4C1A-B29B-DB7015BB8583}.Debug.ActiveCfg = Debug|Win32 {34889460-A104-4C1A-B29B-DB7015BB8583}.Debug.Build.0 = Debug|Win32 {34889460-A104-4C1A-B29B-DB7015BB8583}.Detours1.5.ActiveCfg = Debug|Win32 {34889460-A104-4C1A-B29B-DB7015BB8583}.Detours1.5.Build.0 = Debug|Win32 {34889460-A104-4C1A-B29B-DB7015BB8583}.Detours2.1.ActiveCfg = Debug|Win32 {34889460-A104-4C1A-B29B-DB7015BB8583}.Detours2.1.Build.0 = Debug|Win32 {34889460-A104-4C1A-B29B-DB7015BB8583}.Dll Debug.ActiveCfg = Debug|Win32 {34889460-A104-4C1A-B29B-DB7015BB8583}.Dll Debug.Build.0 = Debug|Win32 {34889460-A104-4C1A-B29B-DB7015BB8583}.Dll Release.ActiveCfg = Release|Win32 {34889460-A104-4C1A-B29B-DB7015BB8583}.Dll Release.Build.0 = Release|Win32 {34889460-A104-4C1A-B29B-DB7015BB8583}.Release.ActiveCfg = Release|Win32 {34889460-A104-4C1A-B29B-DB7015BB8583}.Release.Build.0 = Release|Win32 {2F1A196C-691F-4D66-883B-7190B89E42CB}.Debug.ActiveCfg = Debug|Win32 {2F1A196C-691F-4D66-883B-7190B89E42CB}.Debug.Build.0 = Debug|Win32 {2F1A196C-691F-4D66-883B-7190B89E42CB}.Detours1.5.ActiveCfg = Debug|Win32 {2F1A196C-691F-4D66-883B-7190B89E42CB}.Detours1.5.Build.0 = Debug|Win32 {2F1A196C-691F-4D66-883B-7190B89E42CB}.Detours2.1.ActiveCfg = Debug|Win32 {2F1A196C-691F-4D66-883B-7190B89E42CB}.Detours2.1.Build.0 = Debug|Win32 {2F1A196C-691F-4D66-883B-7190B89E42CB}.Dll Debug.ActiveCfg = Debug|Win32 {2F1A196C-691F-4D66-883B-7190B89E42CB}.Dll Debug.Build.0 = Debug|Win32 {2F1A196C-691F-4D66-883B-7190B89E42CB}.Dll Release.ActiveCfg = Release|Win32 {2F1A196C-691F-4D66-883B-7190B89E42CB}.Dll Release.Build.0 = Release|Win32 {2F1A196C-691F-4D66-883B-7190B89E42CB}.Release.ActiveCfg = Release|Win32 {2F1A196C-691F-4D66-883B-7190B89E42CB}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection GlobalSection(ExtensibilityAddIns) = postSolution EndGlobalSection EndGlobal duma-VERSION_2_5_21/win32-msvc.net/dumadetours/000077500000000000000000000000001401225056000211225ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.net/dumadetours/dumadetours.vcproj000066400000000000000000000264671401225056000247220ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.net/dumadetoursdll/000077500000000000000000000000001401225056000216165ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.net/dumadetoursdll/dumadetoursdll.vcproj000066400000000000000000000331641401225056000261020ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.net/dumadll/000077500000000000000000000000001401225056000202105ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.net/dumadll/ReadMe.txt000066400000000000000000000032741401225056000221140ustar00rootroot00000000000000======================================================================== DYNAMIC LINK LIBRARY : dumadll Project Overview ======================================================================== AppWizard has created this dumadll DLL for you. This file contains a summary of what you will find in each of the files that make up your dumadll application. dumadll.vcproj This is the main project file for VC++ projects generated using an Application Wizard. It contains information about the version of Visual C++ that generated the file, and information about the platforms, configurations, and project features selected with the Application Wizard. dumadll.cpp This is the main DLL source file. When created, this DLL does not export any symbols. As a result, it will not produce a .lib file when it is built. If you wish this project to be a project dependency of some other project, you will either need to add code to export some symbols from the DLL so that an export library will be produced, or you can set the Ignore Input Library property to Yes on the General propert page of the Linker folder in the project's Property Pages dialog box. ///////////////////////////////////////////////////////////////////////////// Other standard files: StdAfx.h, StdAfx.cpp These files are used to build a precompiled header (PCH) file named dumadll.pch and a precompiled types file named StdAfx.obj. ///////////////////////////////////////////////////////////////////////////// Other notes: AppWizard uses "TODO:" comments to indicate parts of the source code you should add to or customize. ///////////////////////////////////////////////////////////////////////////// duma-VERSION_2_5_21/win32-msvc.net/dumadll/dumadll.aps000066400000000000000000000422341401225056000223440ustar00rootroot00000000000000 ÿÿÿÿ>$HWBÿÿ LCc:\Projects\duma_2_4_26\win32-msvc.net\dumadll\dumadll.rc 4TEXTINCLUDEÿÿ0 resource.h4TEXTINCLUDEÿÿ0 #include "afxres.h" 4TEXTINCLUDEÿÿ0  ?$HWBÿÿÈ0 !!resource.h_APS_NEXT_RESOURCE_VALUE101 _APS_NEXT_COMMAND_VALUE40001 _APS_NEXT_CONTROL_VALUE1001 _APS_NEXT_SYMED_VALUE101 !!afxres.h!winres.hVS_VERSION_INFO1IDC_STATIC(-1))!CBRS_ALIGN_LEFT0x1000L/CBRS_ALIGN_TOP0x2000L0CBRS_ALIGN_RIGHT0x4000L1CBRS_ALIGN_BOTTOM0x8000L2CBRS_ALIGN_ANY0xF000L3CBRS_BORDER_LEFT0x0100L5CBRS_BORDER_TOP0x0200L6CBRS_BORDER_RIGHT0x0400L7CBRS_BORDER_BOTTOM0x0800L8CBRS_BORDER_ANY0x0F00L9CBRS_TOOLTIPS0x0010L;CBRS_FLYBY0x0020L<CBRS_FLOAT_MULTI0x0040L=CBRS_BORDER_3D0x0080L>CBRS_HIDE_INPLACE0x0008L?CBRS_SIZE_DYNAMIC0x0004L@CBRS_SIZE_FIXED0x0002LACBRS_FLOATING0x0001LBCBRS_GRIPPER0x00400000LDCBRS_ORIENT_HORZ(CBRS_ALIGN_TOP|CBRS_ALIGN_BOTTOM)FCBRS_ORIENT_VERT(CBRS_ALIGN_LEFT|CBRS_ALIGN_RIGHT)GCBRS_ORIENT_ANY(CBRS_ORIENT_HORZ|CBRS_ORIENT_VERT)HCBRS_ALL0x0040FFFFLJCBRS_NOALIGN0x00000000LOCBRS_LEFT(CBRS_ALIGN_LEFT|CBRS_BORDER_RIGHT)PCBRS_TOP(CBRS_ALIGN_TOP|CBRS_BORDER_BOTTOM)QCBRS_RIGHT(CBRS_ALIGN_RIGHT|CBRS_BORDER_LEFT)RCBRS_BOTTOM(CBRS_ALIGN_BOTTOM|CBRS_BORDER_TOP)SID_INDICATOR_EXT0xE700YID_INDICATOR_CAPS0xE701ZID_INDICATOR_NUM0xE702[ID_INDICATOR_SCRL0xE703\ID_INDICATOR_OVR0xE704]ID_INDICATOR_REC0xE705^ID_INDICATOR_KANA0xE706_ID_SEPARATOR0aAFX_IDS_APP_TITLE0xE000“AFX_IDS_IDLEMESSAGE0xE001•AFX_IDS_HELPMODEMESSAGE0xE002—AFX_IDS_APP_TITLE_EMBEDDING0xE003™AFX_IDS_COMPANY_NAME0xE004›AFX_IDS_OBJ_TITLE_INPLACE0xE005ID_FILE_NEW0xE100£ID_FILE_OPEN0xE101¤ID_FILE_CLOSE0xE102¥ID_FILE_SAVE0xE103¦ID_FILE_SAVE_AS0xE104§ID_FILE_PAGE_SETUP0xE105¨ID_FILE_PRINT_SETUP0xE106©ID_FILE_PRINT0xE107ªID_FILE_PRINT_DIRECT0xE108«ID_FILE_PRINT_PREVIEW0xE109¬ID_FILE_UPDATE0xE10A­ID_FILE_SAVE_COPY_AS0xE10B®ID_FILE_SEND_MAIL0xE10C¯ID_FILE_NEW_FRAME0xE10D°ID_FILE_MRU_FIRST0xE110²ID_FILE_MRU_FILE10xE110³ID_FILE_MRU_FILE20xE111´ID_FILE_MRU_FILE30xE112µID_FILE_MRU_FILE40xE113¶ID_FILE_MRU_FILE50xE114·ID_FILE_MRU_FILE60xE115¸ID_FILE_MRU_FILE70xE116¹ID_FILE_MRU_FILE80xE117ºID_FILE_MRU_FILE90xE118»ID_FILE_MRU_FILE100xE119¼ID_FILE_MRU_FILE110xE11A½ID_FILE_MRU_FILE120xE11B¾ID_FILE_MRU_FILE130xE11C¿ID_FILE_MRU_FILE140xE11DÀID_FILE_MRU_FILE150xE11EÁID_FILE_MRU_FILE160xE11FÂID_FILE_MRU_LAST0xE11FÃID_EDIT_CLEAR0xE120ÆID_EDIT_CLEAR_ALL0xE121ÇID_EDIT_COPY0xE122ÈID_EDIT_CUT0xE123ÉID_EDIT_FIND0xE124ÊID_EDIT_PASTE0xE125ËID_EDIT_PASTE_LINK0xE126ÌID_EDIT_PASTE_SPECIAL0xE127ÍID_EDIT_REPEAT0xE128ÎID_EDIT_REPLACE0xE129ÏID_EDIT_SELECT_ALL0xE12AÐID_EDIT_UNDO0xE12BÑID_EDIT_REDO0xE12CÒID_WINDOW_NEW0xE130ÕID_WINDOW_ARRANGE0xE131ÖID_WINDOW_CASCADE0xE132×ID_WINDOW_TILE_HORZ0xE133ØID_WINDOW_TILE_VERT0xE134ÙID_WINDOW_SPLIT0xE135ÚID_APP_ABOUT0xE140âID_APP_EXIT0xE141ãID_HELP_INDEX0xE142äID_HELP_FINDER0xE143åID_HELP_USING0xE144æID_CONTEXT_HELP0xE145çID_HELP0xE146éID_DEFAULT_HELP0xE147êID_NEXT_PANE0xE150íID_PREV_PANE0xE151îID_FORMAT_FONT0xE160ñID_OLE_INSERT_NEW0xE200ôID_OLE_EDIT_LINKS0xE201õID_OLE_EDIT_CONVERT0xE202öID_OLE_EDIT_CHANGE_ICON0xE203÷ID_OLE_EDIT_PROPERTIES0xE204øID_OLE_VERB_FIRST0xE210ùAFX_ID_PREVIEW_CLOSE0xE300ÿAFX_ID_PREVIEW_NUMPAGE0xE301AFX_ID_PREVIEW_NEXT0xE302AFX_ID_PREVIEW_PREV0xE303AFX_ID_PREVIEW_PRINT0xE304AFX_ID_PREVIEW_ZOOMIN0xE305AFX_ID_PREVIEW_ZOOMOUT0xE306ID_VIEW_TOOLBAR0xE800ID_VIEW_STATUS_BAR0xE801 ID_VIEW_REBAR0xE804 ID_VIEW_AUTOARRANGE0xE805 ID_VIEW_SMALLICON0xE810 ID_VIEW_LARGEICON0xE811ID_VIEW_LIST0xE812ID_VIEW_DETAILS0xE813ID_VIEW_LINEUP0xE814ID_VIEW_BYNAME0xE815AFX_ID_VIEW_MINIMUMID_VIEW_SMALLICONAFX_ID_VIEW_MAXIMUMID_VIEW_BYNAMEID_RECORD_FIRST0xE900ID_RECORD_LAST0xE901ID_RECORD_NEXT0xE902ID_RECORD_PREV0xE903IDC_STATIC(-1)#AFX_IDS_SCSIZE0xEF00,AFX_IDS_SCMOVE0xEF01-AFX_IDS_SCMINIMIZE0xEF02.AFX_IDS_SCMAXIMIZE0xEF03/AFX_IDS_SCNEXTWINDOW0xEF040AFX_IDS_SCPREVWINDOW0xEF051AFX_IDS_SCCLOSE0xEF062AFX_IDS_SCRESTORE0xEF123AFX_IDS_SCTASKLIST0xEF134AFX_IDS_MDICHILD0xEF1F6AFX_IDS_DESKACCESSORY0xEFDA8AFX_IDS_OPENFILE0xF000;AFX_IDS_SAVEFILE0xF001<AFX_IDS_ALLFILTER0xF002=AFX_IDS_UNTITLED0xF003>AFX_IDS_SAVEFILECOPY0xF004?AFX_IDS_PREVIEW_CLOSE0xF005@AFX_IDS_UNNAMED_FILE0xF006AAFX_IDS_HIDE0xF011BAFX_IDP_NO_ERROR_AVAILABLE0xF020EAFX_IDS_NOT_SUPPORTED_EXCEPTION0xF021FAFX_IDS_RESOURCE_EXCEPTION0xF022GAFX_IDS_MEMORY_EXCEPTION0xF023HAFX_IDS_USER_EXCEPTION0xF024IAFX_IDS_INVALID_ARG_EXCEPTION0xF025JAFX_IDS_PRINTONPORT0xF040MAFX_IDS_ONEPAGE0xF041NAFX_IDS_TWOPAGE0xF042OAFX_IDS_PRINTPAGENUM0xF043PAFX_IDS_PREVIEWPAGEDESC0xF044QAFX_IDS_PRINTDEFAULTEXT0xF045RAFX_IDS_PRINTDEFAULT0xF046SAFX_IDS_PRINTFILTER0xF047TAFX_IDS_PRINTCAPTION0xF048UAFX_IDS_PRINTTOFILE0xF049VAFX_IDS_OBJECT_MENUITEM0xF080ZAFX_IDS_EDIT_VERB0xF081[AFX_IDS_ACTIVATE_VERB0xF082\AFX_IDS_CHANGE_LINK0xF083]AFX_IDS_AUTO0xF084^AFX_IDS_MANUAL0xF085_AFX_IDS_FROZEN0xF086`AFX_IDS_ALL_FILES0xF087aAFX_IDS_SAVE_MENU0xF088cAFX_IDS_UPDATE_MENU0xF089dAFX_IDS_SAVE_AS_MENU0xF08AeAFX_IDS_SAVE_COPY_AS_MENU0xF08BfAFX_IDS_EXIT_MENU0xF08CgAFX_IDS_UPDATING_ITEMS0xF08DhAFX_IDS_METAFILE_FORMAT0xF08EjAFX_IDS_DIB_FORMAT0xF08FkAFX_IDS_BITMAP_FORMAT0xF090lAFX_IDS_LINKSOURCE_FORMAT0xF091mAFX_IDS_EMBED_FORMAT0xF092nAFX_IDS_PASTELINKEDTYPE0xF094pAFX_IDS_UNKNOWNTYPE0xF095qAFX_IDS_RTF_FORMAT0xF096rAFX_IDS_TEXT_FORMAT0xF097sAFX_IDS_INVALID_CURRENCY0xF098uAFX_IDS_INVALID_DATETIME0xF099vAFX_IDS_INVALID_DATETIMESPAN0xF09AwAFX_IDP_INVALID_FILENAME0xF100zAFX_IDP_FAILED_TO_OPEN_DOC0xF101{AFX_IDP_FAILED_TO_SAVE_DOC0xF102|AFX_IDP_ASK_TO_SAVE0xF103}AFX_IDP_FAILED_TO_CREATE_DOC0xF104~AFX_IDP_FILE_TOO_LARGE0xF105AFX_IDP_FAILED_TO_START_PRINT0xF106€AFX_IDP_FAILED_TO_LAUNCH_HELP0xF107AFX_IDP_INTERNAL_FAILURE0xF108‚AFX_IDP_COMMAND_FAILURE0xF109ƒAFX_IDP_FAILED_MEMORY_ALLOC0xF10A„AFX_IDP_UNREG_DONE0xF10B…AFX_IDP_UNREG_FAILURE0xF10C†AFX_IDP_DLL_LOAD_FAILED0xF10D‡AFX_IDP_DLL_BAD_VERSION0xF10EˆAFX_IDP_PARSE_INT0xF110‹AFX_IDP_PARSE_REAL0xF111ŒAFX_IDP_PARSE_INT_RANGE0xF112AFX_IDP_PARSE_REAL_RANGE0xF113ŽAFX_IDP_PARSE_STRING_SIZE0xF114AFX_IDP_PARSE_RADIO_BUTTON0xF115AFX_IDP_PARSE_BYTE0xF116‘AFX_IDP_PARSE_UINT0xF117’AFX_IDP_PARSE_DATETIME0xF118“AFX_IDP_PARSE_CURRENCY0xF119”AFX_IDP_PARSE_GUID0xF11A•AFX_IDP_PARSE_TIME0xF11B–AFX_IDP_PARSE_DATE0xF11C—AFX_IDP_FAILED_INVALID_FORMAT0xF120šAFX_IDP_FAILED_INVALID_PATH0xF121›AFX_IDP_FAILED_DISK_FULL0xF122œAFX_IDP_FAILED_ACCESS_READ0xF123AFX_IDP_FAILED_ACCESS_WRITE0xF124žAFX_IDP_FAILED_IO_ERROR_READ0xF125ŸAFX_IDP_FAILED_IO_ERROR_WRITE0xF126 AFX_IDP_SCRIPT_ERROR0xF130£AFX_IDP_SCRIPT_DISPATCH_EXCEPTION0xF131¤AFX_IDP_STATIC_OBJECT0xF180§AFX_IDP_FAILED_TO_CONNECT0xF181¨AFX_IDP_SERVER_BUSY0xF182©AFX_IDP_BAD_VERB0xF183ªAFX_IDS_NOT_DOCOBJECT0xF184«AFX_IDP_FAILED_TO_NOTIFY0xF185¬AFX_IDP_FAILED_TO_LAUNCH0xF186­AFX_IDP_ASK_TO_UPDATE0xF187®AFX_IDP_FAILED_TO_UPDATE0xF188¯AFX_IDP_FAILED_TO_REGISTER0xF189°AFX_IDP_FAILED_TO_AUTO_REGISTER0xF18A±AFX_IDP_FAILED_TO_CONVERT0xF18B²AFX_IDP_GET_NOT_SUPPORTED0xF18C³AFX_IDP_SET_NOT_SUPPORTED0xF18D´AFX_IDP_ASK_TO_DISCARD0xF18EµAFX_IDP_FAILED_TO_CREATE0xF18F¶AFX_IDP_FAILED_MAPI_LOAD0xF190¹AFX_IDP_INVALID_MAPI_DLL0xF191ºAFX_IDP_FAILED_MAPI_SEND0xF192»AFX_IDP_FILE_NONE0xF1A0½AFX_IDP_FILE_GENERIC0xF1A1¾AFX_IDP_FILE_NOT_FOUND0xF1A2¿AFX_IDP_FILE_BAD_PATH0xF1A3ÀAFX_IDP_FILE_TOO_MANY_OPEN0xF1A4ÁAFX_IDP_FILE_ACCESS_DENIED0xF1A5ÂAFX_IDP_FILE_INVALID_FILE0xF1A6ÃAFX_IDP_FILE_REMOVE_CURRENT0xF1A7ÄAFX_IDP_FILE_DIR_FULL0xF1A8ÅAFX_IDP_FILE_BAD_SEEK0xF1A9ÆAFX_IDP_FILE_HARD_IO0xF1AAÇAFX_IDP_FILE_SHARING0xF1ABÈAFX_IDP_FILE_LOCKING0xF1ACÉAFX_IDP_FILE_DISKFULL0xF1ADÊAFX_IDP_FILE_EOF0xF1AEËAFX_IDP_ARCH_NONE0xF1B0ÍAFX_IDP_ARCH_GENERIC0xF1B1ÎAFX_IDP_ARCH_READONLY0xF1B2ÏAFX_IDP_ARCH_ENDOFFILE0xF1B3ÐAFX_IDP_ARCH_WRITEONLY0xF1B4ÑAFX_IDP_ARCH_BADINDEX0xF1B5ÒAFX_IDP_ARCH_BADCLASS0xF1B6ÓAFX_IDP_ARCH_BADSCHEMA0xF1B7ÔAFX_IDS_OCC_SCALEUNITS_PIXELS0xF1C0ÖAFX_IDS_STATUS_FONT0xF230ÛAFX_IDS_TOOLTIP_FONT0xF231ÜAFX_IDS_UNICODE_FONT0xF232ÝAFX_IDS_MINI_FONT0xF233ÞAFX_IDP_SQL_CONNECT_FAIL0xF281äAFX_IDP_SQL_RECORDSET_FORWARD_ONLY0xF282åAFX_IDP_SQL_EMPTY_COLUMN_LIST0xF283æAFX_IDP_SQL_FIELD_SCHEMA_MISMATCH0xF284çAFX_IDP_SQL_ILLEGAL_MODE0xF285èAFX_IDP_SQL_MULTIPLE_ROWS_AFFECTED0xF286éAFX_IDP_SQL_NO_CURRENT_RECORD0xF287êAFX_IDP_SQL_NO_ROWS_AFFECTED0xF288ëAFX_IDP_SQL_RECORDSET_READONLY0xF289ìAFX_IDP_SQL_SQL_NO_TOTAL0xF28AíAFX_IDP_SQL_ODBC_LOAD_FAILED0xF28BîAFX_IDP_SQL_DYNASET_NOT_SUPPORTED0xF28CïAFX_IDP_SQL_SNAPSHOT_NOT_SUPPORTED0xF28DðAFX_IDP_SQL_API_CONFORMANCE0xF28EñAFX_IDP_SQL_SQL_CONFORMANCE0xF28FòAFX_IDP_SQL_NO_DATA_FOUND0xF290óAFX_IDP_SQL_ROW_UPDATE_NOT_SUPPORTED0xF291ôAFX_IDP_SQL_ODBC_V2_REQUIRED0xF292õAFX_IDP_SQL_NO_POSITIONED_UPDATES0xF293öAFX_IDP_SQL_LOCK_MODE_NOT_SUPPORTED0xF294÷AFX_IDP_SQL_DATA_TRUNCATED0xF295øAFX_IDP_SQL_ROW_FETCH0xF296ùAFX_IDP_SQL_INCORRECT_ODBC0xF297úAFX_IDP_SQL_UPDATE_DELETE_FAILED0xF298ûAFX_IDP_SQL_DYNAMIC_CURSOR_NOT_SUPPORTED0xF299üAFX_IDP_SQL_FIELD_NOT_FOUND0xF29AýAFX_IDP_SQL_BOOKMARKS_NOT_SUPPORTED0xF29BþAFX_IDP_SQL_BOOKMARKS_NOT_ENABLED0xF29CÿAFX_IDS_DELETED0xF29DAFX_IDP_DAO_ENGINE_INITIALIZATION0xF2B0AFX_IDP_DAO_DFX_BIND0xF2B1 AFX_IDP_DAO_OBJECT_NOT_OPEN0xF2B2 AFX_IDP_DAO_ROWTOOSHORT0xF2B3AFX_IDP_DAO_BADBINDINFO0xF2B4AFX_IDP_DAO_COLUMNUNAVAILABLE0xF2B5AFX_IDS_HTTP_TITLE0xF2D1AFX_IDS_HTTP_NO_TEXT0xF2D2AFX_IDS_HTTP_BAD_REQUEST0xF2D3AFX_IDS_HTTP_AUTH_REQUIRED0xF2D4AFX_IDS_HTTP_FORBIDDEN0xF2D5AFX_IDS_HTTP_NOT_FOUND0xF2D6AFX_IDS_HTTP_SERVER_ERROR0xF2D7AFX_IDS_HTTP_NOT_IMPLEMENTED0xF2D8AFX_IDS_CHECKLISTBOX_UNCHECK0xF2E1!AFX_IDS_CHECKLISTBOX_CHECK0xF2E2"AFX_IDS_CHECKLISTBOX_MIXED0xF2E3#AFX_IDC_LISTBOX100)AFX_IDC_CHANGE101*AFX_IDC_BROWSER102+AFX_IDC_PRINT_DOCNAME201.AFX_IDC_PRINT_PRINTERNAME202/AFX_IDC_PRINT_PORTNAME2030AFX_IDC_PRINT_PAGENUM2041ID_APPLY_NOW0x30214ID_WIZBACK0x30235ID_WIZNEXT0x30246ID_WIZFINISH0x30257AFX_IDC_TAB_CONTROL0x30208AFX_IDD_NEWTYPEDLG30721KAFX_IDD_PRINTDLG30722LAFX_IDD_PREVIEW_TOOLBAR30723MAFX_IDD_INSERTOBJECT30724PAFX_IDD_CHANGEICON30725QAFX_IDD_CONVERT30726RAFX_IDD_PASTESPECIAL30727SAFX_IDD_EDITLINKS30728TAFX_IDD_FILEBROWSE30729UAFX_IDD_BUSY30730VAFX_IDD_OBJECTPROPERTIES30732XAFX_IDD_CHANGESOURCE30733YAFX_IDC_CONTEXTHELP30977]AFX_IDC_MAGNIFY30978^AFX_IDC_SMALLARROWS30979_AFX_IDC_HSPLITBAR30980`AFX_IDC_VSPLITBAR30981aAFX_IDC_NODROPCRSR30982bAFX_IDC_TRACKNWSE30983cAFX_IDC_TRACKNESW30984dAFX_IDC_TRACKNS30985eAFX_IDC_TRACKWE30986fAFX_IDC_TRACK4WAY30987gAFX_IDC_MOVE4WAY30988hAFX_IDC_MOUSE_PAN_NW30998lAFX_IDC_MOUSE_PAN_N30999mAFX_IDC_MOUSE_PAN_NE31000nAFX_IDC_MOUSE_PAN_W31001oAFX_IDC_MOUSE_PAN_HV31002pAFX_IDC_MOUSE_PAN_E31003qAFX_IDC_MOUSE_PAN_SW31004rAFX_IDC_MOUSE_PAN_S31005sAFX_IDC_MOUSE_PAN_SE31006tAFX_IDC_MOUSE_PAN_HORZ31007uAFX_IDC_MOUSE_PAN_VERT31008vAFX_IDC_MOUSE_ORG_HORZ31009yAFX_IDC_MOUSE_ORG_VERT31010zAFX_IDC_MOUSE_ORG_HV31011{AFX_IDC_MOUSE_MASK31012|AFX_IDB_MINIFRAME_MENU30994AFX_IDB_CHECKLISTBOX_9530996‚AFX_IDR_PREVIEW_ACCEL30997…AFX_IDI_STD_MDIFRAME31233ˆAFX_IDI_STD_FRAME31234‰AFX_IDC_FONTPROP1000AFX_IDC_FONTNAMES1001AFX_IDC_FONTSTYLES1002‘AFX_IDC_FONTSIZES1003’AFX_IDC_STRIKEOUT1004“AFX_IDC_UNDERLINE1005”AFX_IDC_SAMPLEBOX1006•AFX_IDC_COLOR_BLACK1100˜AFX_IDC_COLOR_WHITE1101™AFX_IDC_COLOR_RED1102šAFX_IDC_COLOR_GREEN1103›AFX_IDC_COLOR_BLUE1104œAFX_IDC_COLOR_YELLOW1105AFX_IDC_COLOR_MAGENTA1106žAFX_IDC_COLOR_CYAN1107ŸAFX_IDC_COLOR_GRAY1108 AFX_IDC_COLOR_LIGHTGRAY1109¡AFX_IDC_COLOR_DARKRED1110¢AFX_IDC_COLOR_DARKGREEN1111£AFX_IDC_COLOR_DARKBLUE1112¤AFX_IDC_COLOR_LIGHTBROWN1113¥AFX_IDC_COLOR_DARKMAGENTA1114¦AFX_IDC_COLOR_DARKCYAN1115§AFX_IDC_COLORPROP1116¨AFX_IDC_SYSTEMCOLORS1117©AFX_IDC_PROPNAME1201¬AFX_IDC_PICTURE1202­AFX_IDC_BROWSE1203®AFX_IDC_CLEAR1204¯AFX_IDD_PROPPAGE_COLOR32257µAFX_IDD_PROPPAGE_FONT32258¶AFX_IDD_PROPPAGE_PICTURE32259·AFX_IDB_TRUETYPE32384¹AFX_IDS_PROPPAGE_UNKNOWN0xFE01¿AFX_IDS_COLOR_DESKTOP0xFE04ÀAFX_IDS_COLOR_APPWORKSPACE0xFE05ÁAFX_IDS_COLOR_WNDBACKGND0xFE06ÂAFX_IDS_COLOR_WNDTEXT0xFE07ÃAFX_IDS_COLOR_MENUBAR0xFE08ÄAFX_IDS_COLOR_MENUTEXT0xFE09ÅAFX_IDS_COLOR_ACTIVEBAR0xFE0AÆAFX_IDS_COLOR_INACTIVEBAR0xFE0BÇAFX_IDS_COLOR_ACTIVETEXT0xFE0CÈAFX_IDS_COLOR_INACTIVETEXT0xFE0DÉAFX_IDS_COLOR_ACTIVEBORDER0xFE0EÊAFX_IDS_COLOR_INACTIVEBORDER0xFE0FËAFX_IDS_COLOR_WNDFRAME0xFE10ÌAFX_IDS_COLOR_SCROLLBARS0xFE11ÍAFX_IDS_COLOR_BTNFACE0xFE12ÎAFX_IDS_COLOR_BTNSHADOW0xFE13ÏAFX_IDS_COLOR_BTNTEXT0xFE14ÐAFX_IDS_COLOR_BTNHIGHLIGHT0xFE15ÑAFX_IDS_COLOR_DISABLEDTEXT0xFE16ÒAFX_IDS_COLOR_HIGHLIGHT0xFE17ÓAFX_IDS_COLOR_HIGHLIGHTTEXT0xFE18ÔAFX_IDS_REGULAR0xFE19ÕAFX_IDS_BOLD0xFE1AÖAFX_IDS_ITALIC0xFE1B×AFX_IDS_BOLDITALIC0xFE1CØAFX_IDS_SAMPLETEXT0xFE1DÙAFX_IDS_DISPLAYSTRING_FONT0xFE1EÚAFX_IDS_DISPLAYSTRING_COLOR0xFE1FÛAFX_IDS_DISPLAYSTRING_PICTURE0xFE20ÜAFX_IDS_PICTUREFILTER0xFE21ÝAFX_IDS_PICTYPE_UNKNOWN0xFE22ÞAFX_IDS_PICTYPE_NONE0xFE23ßAFX_IDS_PICTYPE_BITMAP0xFE24àAFX_IDS_PICTYPE_METAFILE0xFE25áAFX_IDS_PICTYPE_ICON0xFE26âAFX_IDS_COLOR_PPG0xFE28ãAFX_IDS_COLOR_PPG_CAPTION0xFE29äAFX_IDS_FONT_PPG0xFE2AåAFX_IDS_FONT_PPG_CAPTION0xFE2BæAFX_IDS_PICTURE_PPG0xFE2CçAFX_IDS_PICTURE_PPG_CAPTION0xFE2DèAFX_IDS_PICTUREBROWSETITLE0xFE30éAFX_IDS_BORDERSTYLE_00xFE31êAFX_IDS_BORDERSTYLE_10xFE32ëAFX_IDS_VERB_EDIT0xFE40îAFX_IDS_VERB_PROPERTIES0xFE41ïAFX_IDP_PICTURECANTOPEN0xFE83òAFX_IDP_PICTURECANTLOAD0xFE84óAFX_IDP_PICTURETOOLARGE0xFE85ôAFX_IDP_PICTUREREADFAILED0xFE86õAFX_IDP_E_ILLEGALFUNCTIONCALL0xFEA0øAFX_IDP_E_OVERFLOW0xFEA1ùAFX_IDP_E_OUTOFMEMORY0xFEA2úAFX_IDP_E_DIVISIONBYZERO0xFEA3ûAFX_IDP_E_OUTOFSTRINGSPACE0xFEA4üAFX_IDP_E_OUTOFSTACKSPACE0xFEA5ýAFX_IDP_E_BADFILENAMEORNUMBER0xFEA6þAFX_IDP_E_FILENOTFOUND0xFEA7ÿAFX_IDP_E_BADFILEMODE0xFEA8AFX_IDP_E_FILEALREADYOPEN0xFEA9AFX_IDP_E_DEVICEIOERROR0xFEAAAFX_IDP_E_FILEALREADYEXISTS0xFEABAFX_IDP_E_BADRECORDLENGTH0xFEACAFX_IDP_E_DISKFULL0xFEADAFX_IDP_E_BADRECORDNUMBER0xFEAEAFX_IDP_E_BADFILENAME0xFEAFAFX_IDP_E_TOOMANYFILES0xFEB0AFX_IDP_E_DEVICEUNAVAILABLE0xFEB1 AFX_IDP_E_PERMISSIONDENIED0xFEB2 AFX_IDP_E_DISKNOTREADY0xFEB3 AFX_IDP_E_PATHFILEACCESSERROR0xFEB4 AFX_IDP_E_PATHNOTFOUND0xFEB5 AFX_IDP_E_INVALIDPATTERNSTRING0xFEB6AFX_IDP_E_INVALIDUSEOFNULL0xFEB7AFX_IDP_E_INVALIDFILEFORMAT0xFEB8AFX_IDP_E_INVALIDPROPERTYVALUE0xFEB9AFX_IDP_E_INVALIDPROPERTYARRAYINDEX0xFEBAAFX_IDP_E_SETNOTSUPPORTEDATRUNTIME0xFEBBAFX_IDP_E_SETNOTSUPPORTED0xFEBCAFX_IDP_E_NEEDPROPERTYARRAYINDEX0xFEBDAFX_IDP_E_SETNOTPERMITTED0xFEBEAFX_IDP_E_GETNOTSUPPORTEDATRUNTIME0xFEBFAFX_IDP_E_GETNOTSUPPORTED0xFEC0AFX_IDP_E_PROPERTYNOTFOUND0xFEC1AFX_IDP_E_INVALIDCLIPBOARDFORMAT0xFEC2AFX_IDP_E_INVALIDPICTURE0xFEC3AFX_IDP_E_PRINTERERROR0xFEC4AFX_IDP_E_CANTSAVEFILETOTEMP0xFEC5AFX_IDP_E_SEARCHTEXTNOTFOUND0xFEC6AFX_IDP_E_REPLACEMENTSTOOLONG0xFEC7!!ãÿÎ$HWBÿÿÉ0 ÿÿÿÿÿÿÿÿ c:\Projects\duma_2_4_26\win32-msvc.net\dumadll\resource.hÿÿÿÿÿÿÿÿ C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include/afxres.hÿÿÿÿÿÿÿÿ C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include/winres.hF$HWBÿÿÊ0 TEXTINCLUDE1$ÿÿTEXTINCLUDE2$ÿÿTEXTINCLUDE3$ÿÿ$ÿÿ,$HWBÿÿ0 >DHWBÿÿ  ¸TEXTINCLUDEÿÿ0 øTEXTINCLUDEÿÿ0 DTEXTINCLUDEÿÿ0 ?lHWBÿÿÈ0 ÎAHWBÿÿÉ0 FCHWBÿÿÊ0 duma-VERSION_2_5_21/win32-msvc.net/dumadll/dumadll.cpp000066400000000000000000000030131401225056000223330ustar00rootroot00000000000000// dumadll.cpp : Defines the entry point for the DLL application. // #include "stdafx.h" BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { return TRUE; } #include "duma.h" #define DUMA_PARAMS_UK , "unknown file", 0 void * duma_malloc(size_t size) { return _duma_malloc(size DUMA_PARAMS_UK); } void * duma_calloc(size_t nelem, size_t elsize) { return _duma_calloc(nelem, elsize DUMA_PARAMS_UK); } void duma_free(void * address) { _duma_free(address DUMA_PARAMS_UK); } void * duma_memalign(size_t alignment, size_t size) { return _duma_memalign(alignment, size DUMA_PARAMS_UK); } void * duma_realloc(void * oldBuffer, size_t newSize) { return _duma_realloc(oldBuffer, newSize DUMA_PARAMS_UK); } void * duma_valloc(size_t size) { return _duma_valloc(size DUMA_PARAMS_UK); } char * duma_strdup(const char * str) { return _duma_strdup(str DUMA_PARAMS_UK); } void * duma_memcpy(void *dest, const void *src, size_t size) { return _duma_memcpy(dest, src, size DUMA_PARAMS_UK); } char * duma_strcpy(char *dest, const char *src) { return _duma_strcpy(dest, src DUMA_PARAMS_UK); } char * duma_strncpy(char *dest, const char *src, size_t size) { return _duma_strncpy(dest, src, size DUMA_PARAMS_UK); } char * duma_strcat(char *dest, const char *src) { return _duma_strcat(dest, src DUMA_PARAMS_UK); } char * duma_strncat(char *dest, const char *src, size_t size) { return _duma_strncat(dest, src, size DUMA_PARAMS_UK); } // endduma-VERSION_2_5_21/win32-msvc.net/dumadll/dumadll.def000066400000000000000000000003041401225056000223070ustar00rootroot00000000000000LIBRARY dumadll EXPORTS duma_malloc duma_calloc duma_free duma_memalign duma_realloc duma_valloc duma_strdup duma_memcpy duma_strcpy duma_strncpy duma_strcat duma_strncat duma-VERSION_2_5_21/win32-msvc.net/dumadll/dumadll.rc000066400000000000000000000024011401225056000221550ustar00rootroot00000000000000// Microsoft Visual C++ generated resource script. // #include "resource.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 2 resource. // #include "afxres.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // English (U.S.) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) LANGUAGE 9, 1 #pragma code_page(1252) #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // TEXTINCLUDE // 1 TEXTINCLUDE BEGIN "resource.h\0" END 2 TEXTINCLUDE BEGIN "#include ""afxres.h""\r\n" "\0" END 3 TEXTINCLUDE BEGIN "\r\n" "\0" END #endif // APSTUDIO_INVOKED #endif // English (U.S.) resources ///////////////////////////////////////////////////////////////////////////// #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 3 resource. // ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED duma-VERSION_2_5_21/win32-msvc.net/dumadll/dumadll.vcproj000066400000000000000000000315471401225056000230710ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.net/dumadll/resource.h000066400000000000000000000006021401225056000222060ustar00rootroot00000000000000//{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. // Used by dumadll.rc // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 101 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1001 #define _APS_NEXT_SYMED_VALUE 101 #endif #endifduma-VERSION_2_5_21/win32-msvc.net/dumadll/stdafx.cpp000066400000000000000000000004361401225056000222100ustar00rootroot00000000000000// stdafx.cpp : source file that includes just the standard includes // dumadll.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "stdafx.h" // TODO: reference any additional headers you need in STDAFX.H // and not in this fileduma-VERSION_2_5_21/win32-msvc.net/dumadll/stdafx.h000066400000000000000000000005571401225056000216610ustar00rootroot00000000000000// stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, but // are changed infrequently // #pragma once #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers // Windows Header Files: #include // TODO: reference additional headers your program requires hereduma-VERSION_2_5_21/win32-msvc.net/dumalib/000077500000000000000000000000001401225056000202035ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.net/dumalib/dumalib.vcproj000066400000000000000000000227661401225056000230620ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.net/dumatest/000077500000000000000000000000001401225056000204145ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.net/dumatest/dumatest.vcproj000066400000000000000000000233021401225056000234670ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.net/dumatestpp/000077500000000000000000000000001401225056000207545ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.net/dumatestpp/dumatestpp.vcproj000066400000000000000000000235721401225056000244000ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.net/example1/000077500000000000000000000000001401225056000203025ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.net/example1/example1.sln000066400000000000000000000026741401225056000225450ustar00rootroot00000000000000Microsoft Visual Studio Solution File, Format Version 8.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example1", "example1.vcproj", "{7767D2B3-B7AE-4DE7-B6AD-F8BBA268E956}" ProjectSection(ProjectDependencies) = postProject {31A93E3A-962A-4769-812A-45A3803B6127} = {31A93E3A-962A-4769-812A-45A3803B6127} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dumalib", "..\dumalib\dumalib.vcproj", "{31A93E3A-962A-4769-812A-45A3803B6127}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug Release = Release EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {7767D2B3-B7AE-4DE7-B6AD-F8BBA268E956}.Debug.ActiveCfg = Debug|Win32 {7767D2B3-B7AE-4DE7-B6AD-F8BBA268E956}.Debug.Build.0 = Debug|Win32 {7767D2B3-B7AE-4DE7-B6AD-F8BBA268E956}.Release.ActiveCfg = Release|Win32 {7767D2B3-B7AE-4DE7-B6AD-F8BBA268E956}.Release.Build.0 = Release|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Debug.ActiveCfg = Debug|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Debug.Build.0 = Debug|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Release.ActiveCfg = Release|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection GlobalSection(ExtensibilityAddIns) = postSolution EndGlobalSection EndGlobal duma-VERSION_2_5_21/win32-msvc.net/example1/example1.vcproj000066400000000000000000000066171401225056000232550ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.net/example2/000077500000000000000000000000001401225056000203035ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.net/example2/example2.sln000066400000000000000000000026741401225056000225470ustar00rootroot00000000000000Microsoft Visual Studio Solution File, Format Version 8.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example2", "example2.vcproj", "{1757BA1C-E0B4-42AB-A1E0-B9575607732D}" ProjectSection(ProjectDependencies) = postProject {31A93E3A-962A-4769-812A-45A3803B6127} = {31A93E3A-962A-4769-812A-45A3803B6127} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dumalib", "..\dumalib\dumalib.vcproj", "{31A93E3A-962A-4769-812A-45A3803B6127}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug Release = Release EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {1757BA1C-E0B4-42AB-A1E0-B9575607732D}.Debug.ActiveCfg = Debug|Win32 {1757BA1C-E0B4-42AB-A1E0-B9575607732D}.Debug.Build.0 = Debug|Win32 {1757BA1C-E0B4-42AB-A1E0-B9575607732D}.Release.ActiveCfg = Release|Win32 {1757BA1C-E0B4-42AB-A1E0-B9575607732D}.Release.Build.0 = Release|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Debug.ActiveCfg = Debug|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Debug.Build.0 = Debug|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Release.ActiveCfg = Release|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection GlobalSection(ExtensibilityAddIns) = postSolution EndGlobalSection EndGlobal duma-VERSION_2_5_21/win32-msvc.net/example2/example2.vcproj000066400000000000000000000067311401225056000232540ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.net/example3/000077500000000000000000000000001401225056000203045ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.net/example3/example3.sln000066400000000000000000000026741401225056000225510ustar00rootroot00000000000000Microsoft Visual Studio Solution File, Format Version 8.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example3", "example3.vcproj", "{7CBF9D5B-88DA-4897-BF8C-6DBB4FCF82CD}" ProjectSection(ProjectDependencies) = postProject {31A93E3A-962A-4769-812A-45A3803B6127} = {31A93E3A-962A-4769-812A-45A3803B6127} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dumalib", "..\dumalib\dumalib.vcproj", "{31A93E3A-962A-4769-812A-45A3803B6127}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug Release = Release EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {7CBF9D5B-88DA-4897-BF8C-6DBB4FCF82CD}.Debug.ActiveCfg = Debug|Win32 {7CBF9D5B-88DA-4897-BF8C-6DBB4FCF82CD}.Debug.Build.0 = Debug|Win32 {7CBF9D5B-88DA-4897-BF8C-6DBB4FCF82CD}.Release.ActiveCfg = Release|Win32 {7CBF9D5B-88DA-4897-BF8C-6DBB4FCF82CD}.Release.Build.0 = Release|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Debug.ActiveCfg = Debug|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Debug.Build.0 = Debug|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Release.ActiveCfg = Release|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection GlobalSection(ExtensibilityAddIns) = postSolution EndGlobalSection EndGlobal duma-VERSION_2_5_21/win32-msvc.net/example3/example3.vcproj000066400000000000000000000064201401225056000232510ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.net/example4/000077500000000000000000000000001401225056000203055ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.net/example4/example4.sln000066400000000000000000000026741401225056000225530ustar00rootroot00000000000000Microsoft Visual Studio Solution File, Format Version 8.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example4", "example4.vcproj", "{406A19CF-D684-4989-BE5F-21F9E05FE412}" ProjectSection(ProjectDependencies) = postProject {31A93E3A-962A-4769-812A-45A3803B6127} = {31A93E3A-962A-4769-812A-45A3803B6127} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dumalib", "..\dumalib\dumalib.vcproj", "{31A93E3A-962A-4769-812A-45A3803B6127}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug Release = Release EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {406A19CF-D684-4989-BE5F-21F9E05FE412}.Debug.ActiveCfg = Debug|Win32 {406A19CF-D684-4989-BE5F-21F9E05FE412}.Debug.Build.0 = Debug|Win32 {406A19CF-D684-4989-BE5F-21F9E05FE412}.Release.ActiveCfg = Release|Win32 {406A19CF-D684-4989-BE5F-21F9E05FE412}.Release.Build.0 = Release|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Debug.ActiveCfg = Debug|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Debug.Build.0 = Debug|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Release.ActiveCfg = Release|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection GlobalSection(ExtensibilityAddIns) = postSolution EndGlobalSection EndGlobal duma-VERSION_2_5_21/win32-msvc.net/example4/example4.vcproj000066400000000000000000000070731401225056000232600ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.net/example5/000077500000000000000000000000001401225056000203065ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.net/example5/example5.sln000066400000000000000000000026741401225056000225550ustar00rootroot00000000000000Microsoft Visual Studio Solution File, Format Version 8.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example5", "example5.vcproj", "{2899F9C0-A1BA-4D5D-99FE-3146B4A0DA58}" ProjectSection(ProjectDependencies) = postProject {31A93E3A-962A-4769-812A-45A3803B6127} = {31A93E3A-962A-4769-812A-45A3803B6127} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dumalib", "..\dumalib\dumalib.vcproj", "{31A93E3A-962A-4769-812A-45A3803B6127}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug Release = Release EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {2899F9C0-A1BA-4D5D-99FE-3146B4A0DA58}.Debug.ActiveCfg = Debug|Win32 {2899F9C0-A1BA-4D5D-99FE-3146B4A0DA58}.Debug.Build.0 = Debug|Win32 {2899F9C0-A1BA-4D5D-99FE-3146B4A0DA58}.Release.ActiveCfg = Release|Win32 {2899F9C0-A1BA-4D5D-99FE-3146B4A0DA58}.Release.Build.0 = Release|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Debug.ActiveCfg = Debug|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Debug.Build.0 = Debug|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Release.ActiveCfg = Release|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection GlobalSection(ExtensibilityAddIns) = postSolution EndGlobalSection EndGlobal duma-VERSION_2_5_21/win32-msvc.net/example5/example5.vcproj000066400000000000000000000064201401225056000232550ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.net/example6/000077500000000000000000000000001401225056000203075ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.net/example6/example6.sln000066400000000000000000000026741401225056000225570ustar00rootroot00000000000000Microsoft Visual Studio Solution File, Format Version 8.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example6", "example6.vcproj", "{05A63138-1207-479F-A06F-9B90689C5D8D}" ProjectSection(ProjectDependencies) = postProject {31A93E3A-962A-4769-812A-45A3803B6127} = {31A93E3A-962A-4769-812A-45A3803B6127} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dumalib", "..\dumalib\dumalib.vcproj", "{31A93E3A-962A-4769-812A-45A3803B6127}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug Release = Release EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {05A63138-1207-479F-A06F-9B90689C5D8D}.Debug.ActiveCfg = Debug|Win32 {05A63138-1207-479F-A06F-9B90689C5D8D}.Debug.Build.0 = Debug|Win32 {05A63138-1207-479F-A06F-9B90689C5D8D}.Release.ActiveCfg = Release|Win32 {05A63138-1207-479F-A06F-9B90689C5D8D}.Release.Build.0 = Release|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Debug.ActiveCfg = Debug|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Debug.Build.0 = Debug|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Release.ActiveCfg = Release|Win32 {31A93E3A-962A-4769-812A-45A3803B6127}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection GlobalSection(ExtensibilityAddIns) = postSolution EndGlobalSection EndGlobal duma-VERSION_2_5_21/win32-msvc.net/example6/example6.vcproj000066400000000000000000000066011401225056000232600ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.net/quicktest/000077500000000000000000000000001401225056000206025ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.net/quicktest/ReadMe.txt000066400000000000000000000024041401225056000225000ustar00rootroot00000000000000======================================================================== CONSOLE APPLICATION : quicktest Project Overview ======================================================================== AppWizard has created this quicktest application for you. This file contains a summary of what you will find in each of the files that make up your quicktest application. quicktest.vcproj This is the main project file for VC++ projects generated using an Application Wizard. It contains information about the version of Visual C++ that generated the file, and information about the platforms, configurations, and project features selected with the Application Wizard. quicktest.cpp This is the main application source file. ///////////////////////////////////////////////////////////////////////////// Other standard files: StdAfx.h, StdAfx.cpp These files are used to build a precompiled header (PCH) file named quicktest.pch and a precompiled types file named StdAfx.obj. ///////////////////////////////////////////////////////////////////////////// Other notes: AppWizard uses "TODO:" comments to indicate parts of the source code you should add to or customize. ///////////////////////////////////////////////////////////////////////////// duma-VERSION_2_5_21/win32-msvc.net/quicktest/quicktest.cpp000066400000000000000000000010721401225056000233220ustar00rootroot00000000000000// quicktest.cpp : Defines the entry point for the console application. // #include #include #include #include #include "duma.h" int _tmain(int argc, _TCHAR* argv[]) { fprintf(stderr, "!!!!starting!!!\n"); for(int i=0; i<100; i++) { fprintf(stderr, "."); char* tmp = (char*) malloc(100); //tmp[110] = 'a'; free(tmp); } #if 1 for(int i=0; i<100; i++) { fprintf(stderr, "."); char* tmp = (char*) malloc(200); //tmp[110] = 'a'; //free(tmp); } #endif fprintf(stderr, "QUICKTEST DONE\n"); return 0; } duma-VERSION_2_5_21/win32-msvc.net/quicktest/quicktest.vcproj000066400000000000000000000125341401225056000240500ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.net/quicktest/stdafx.cpp000066400000000000000000000004401401225056000225750ustar00rootroot00000000000000// stdafx.cpp : source file that includes just the standard includes // quicktest.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "stdafx.h" // TODO: reference any additional headers you need in STDAFX.H // and not in this fileduma-VERSION_2_5_21/win32-msvc.net/quicktest/stdafx.h000066400000000000000000000003621401225056000222450ustar00rootroot00000000000000// stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, but // are changed infrequently // #pragma once // TODO: reference additional headers your program requires hereduma-VERSION_2_5_21/win32-msvc.net/stacktrace/000077500000000000000000000000001401225056000207125ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.net/stacktrace/stacktrace.vcproj000066400000000000000000000221671401225056000242730ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.net/testenv/000077500000000000000000000000001401225056000202565ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.net/testenv/testenv.vcproj000066400000000000000000000064741401225056000232060ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.net/testmt/000077500000000000000000000000001401225056000201065ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.net/testmt/testmt.vcproj000066400000000000000000000065401401225056000226600ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.net/testoperators/000077500000000000000000000000001401225056000215045ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.net/testoperators/testoperators.vcproj000066400000000000000000000066051401225056000256560ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc.net/tstheap/000077500000000000000000000000001401225056000202365ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc.net/tstheap/tstheap.vcproj000066400000000000000000000240161401225056000231360ustar00rootroot00000000000000 duma-VERSION_2_5_21/win32-msvc/000077500000000000000000000000001401225056000160015ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc/createconf/000077500000000000000000000000001401225056000201125ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc/createconf/createconf.dsp000066400000000000000000000133161401225056000227370ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="createconf" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=createconf - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "createconf.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "createconf.mak" CFG="createconf - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "createconf - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "createconf - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE "createconf - Win32 Detours" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "createconf - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x407 /d "NDEBUG" # ADD RSC /l 0x407 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "createconf - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x407 /d "_DEBUG" # ADD RSC /l 0x407 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ELSEIF "$(CFG)" == "createconf - Win32 Detours" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "createconf___Win32_Detours" # PROP BASE Intermediate_Dir "createconf___Win32_Detours" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "createconf___Win32_Detours" # PROP Intermediate_Dir "createconf___Win32_Detours" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c # SUBTRACT BASE CPP /YX # ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x407 /d "NDEBUG" # ADD RSC /l 0x407 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 !ENDIF # Begin Target # Name "createconf - Win32 Release" # Name "createconf - Win32 Debug" # Name "createconf - Win32 Detours" # Begin Group "Quellcodedateien" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\createconf.c # End Source File # End Group # Begin Group "Header-Dateien" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Ressourcendateien" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project duma-VERSION_2_5_21/win32-msvc/duma.dsw000066400000000000000000000055001401225056000174460ustar00rootroot00000000000000Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "createconf"=".\createconf\createconf.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "dumadetours"=".\dumadetours\dumadetours.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "dumadetoursdll"=".\dumadetoursdll\dumadetoursdll.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name dumalib End Project Dependency }}} ############################################################################### Project: "dumadll"=".\dumadll\dumadll.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name dumalib End Project Dependency }}} ############################################################################### Project: "dumalib"=".\dumalib\dumalib.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name stacktrace End Project Dependency }}} ############################################################################### Project: "dumatest"=".\dumatest\dumatest.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name dumalib End Project Dependency }}} ############################################################################### Project: "dumatestpp"=".\dumatestpp\dumatestpp.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name dumalib End Project Dependency }}} ############################################################################### Project: "stacktrace"=".\stacktrace\stacktrace.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "testoperators"=".\testoperators\testoperators.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name dumalib End Project Dependency }}} ############################################################################### Project: "tstheap"=".\tstheap\tstheap.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name dumalib End Project Dependency }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### duma-VERSION_2_5_21/win32-msvc/dumadetours/000077500000000000000000000000001401225056000203355ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc/dumadetours/dumadetours.dsp000066400000000000000000000055121401225056000234040ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="dumadetours" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=dumadetours - Win32 Detours !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "dumadetours.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "dumadetours.mak" CFG="dumadetours - Win32 Detours" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "dumadetours - Win32 Detours" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Detours" # PROP BASE Intermediate_Dir "Detours" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Detours" # PROP Intermediate_Dir "Detours" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "..\..\detours\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\detours\lib" # Begin Target # Name "dumadetours - Win32 Detours" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\dumadetours\dumadetours.cpp # End Source File # Begin Source File SOURCE=..\..\dumadetours\stdafx.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\dumadetours\stdafx.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project duma-VERSION_2_5_21/win32-msvc/dumadetoursdll/000077500000000000000000000000001401225056000210315ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc/dumadetoursdll/dumadetoursdll.dsp000066400000000000000000000054511401225056000245760ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="dumadetoursdll" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=dumadetoursdll - Win32 Detours !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "dumadetoursdll.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "dumadetoursdll.mak" CFG="dumadetoursdll - Win32 Detours" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "dumadetoursdll - Win32 Detours" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Detours" # PROP BASE Intermediate_Dir "Detours" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Detours" # PROP Intermediate_Dir "Detours" # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DUMADETOURSDLL_EXPORTS" /YX /FD /c # ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\detours\include" /I "..\.." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DUMADETOURSDLL_EXPORTS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /nodefaultlib:"libc.lib" /libpath:"..\..\detours\lib" # Begin Target # Name "dumadetoursdll - Win32 Detours" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\dumadetoursdll\dumadetoursdll.cpp # End Source File # Begin Source File SOURCE=..\..\dumadetoursdll\stdafx.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\dumadetoursdll\stdafx.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project duma-VERSION_2_5_21/win32-msvc/dumadll/000077500000000000000000000000001401225056000174235ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc/dumadll/dumadll.dsp000066400000000000000000000104101401225056000215510ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="dumadll" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=dumadll - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "dumadll.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "dumadll.mak" CFG="dumadll - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "dumadll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "dumadll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "dumadll - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DUMADLL_EXPORTS" /YX /FD /c # ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DUMADLL_EXPORTS" /D "DUMA_DLL_LIBRARY" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 !ELSEIF "$(CFG)" == "dumadll - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DUMADLL_EXPORTS" /YX /FD /GZ /c # ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DUMADLL_EXPORTS" /D "DUMA_DLL_LIBRARY" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "dumadll - Win32 Release" # Name "dumadll - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\dumadll\dumadll.cpp # End Source File # Begin Source File SOURCE=..\..\dumadll\stdafx.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\dumadll\resource.h # End Source File # Begin Source File SOURCE=..\..\dumadll\stdafx.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # Begin Source File SOURCE=..\..\dumadll\dumadll.def # End Source File # Begin Source File SOURCE=..\..\dumadll\dumadll.rc # End Source File # End Group # End Target # End Project duma-VERSION_2_5_21/win32-msvc/dumalib/000077500000000000000000000000001401225056000174165ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc/dumalib/dumalib.dsp000066400000000000000000000112741401225056000215500ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="dumalib" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Static Library" 0x0104 CFG=dumalib - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "dumalib.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "dumalib.mak" CFG="dumalib - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "dumalib - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "dumalib - Win32 Debug" (based on "Win32 (x86) Static Library") !MESSAGE "dumalib - Win32 Detours" (based on "Win32 (x86) Static Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "dumalib - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x407 /d "NDEBUG" # ADD RSC /l 0x407 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo !ELSEIF "$(CFG)" == "dumalib - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FR /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x407 /d "_DEBUG" # ADD RSC /l 0x407 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo !ELSEIF "$(CFG)" == "dumalib - Win32 Detours" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "dumalib___Win32_Detours" # PROP BASE Intermediate_Dir "dumalib___Win32_Detours" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "dumalib___Win32_Detours" # PROP Intermediate_Dir "dumalib___Win32_Detours" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c # SUBTRACT BASE CPP /YX # ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x407 /d "NDEBUG" # ADD RSC /l 0x407 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo !ENDIF # Begin Target # Name "dumalib - Win32 Release" # Name "dumalib - Win32 Debug" # Name "dumalib - Win32 Detours" # Begin Group "Quellcodedateien" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\duma.c # End Source File # Begin Source File SOURCE=..\..\dumapp.cpp # End Source File # Begin Source File SOURCE=..\..\print.c # End Source File # Begin Source File SOURCE=..\..\sem_inc.c # End Source File # End Group # Begin Group "Header-Dateien" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\duma.h # End Source File # Begin Source File SOURCE=..\..\duma_hlp.h # End Source File # Begin Source File SOURCE=..\..\dumapp.h # End Source File # Begin Source File SOURCE=..\..\noduma.h # End Source File # Begin Source File SOURCE=..\..\paging.h # End Source File # Begin Source File SOURCE=..\..\print.h # End Source File # Begin Source File SOURCE=..\..\duma_sem.h # End Source File # End Group # Begin Source File SOURCE=..\..\CHANGELOG # End Source File # Begin Source File SOURCE="..\..\COPYING-GPL" # End Source File # Begin Source File SOURCE="..\..\COPYING-LGPL" # End Source File # Begin Source File SOURCE=..\..\duma.3 # End Source File # Begin Source File SOURCE=..\..\INSTALL # End Source File # Begin Source File SOURCE=..\..\Makefile # End Source File # Begin Source File SOURCE=..\..\README # End Source File # Begin Source File SOURCE=..\..\TODO # End Source File # End Target # End Project duma-VERSION_2_5_21/win32-msvc/dumatest/000077500000000000000000000000001401225056000176275ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc/dumatest/dumatest.dsp000066400000000000000000000104721401225056000221710ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="dumatest" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** NICHT BEARBEITEN ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=dumatest - Win32 Debug !MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE !MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl !MESSAGE !MESSAGE NMAKE /f "dumatest.mak". !MESSAGE !MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben !MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: !MESSAGE !MESSAGE NMAKE /f "dumatest.mak" CFG="dumatest - Win32 Debug" !MESSAGE !MESSAGE Für die Konfiguration stehen zur Auswahl: !MESSAGE !MESSAGE "dumatest - Win32 Release" (basierend auf "Win32 (x86) Console Application") !MESSAGE "dumatest - Win32 Debug" (basierend auf "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "dumatest - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x407 /d "NDEBUG" # ADD RSC /l 0x407 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "dumatest - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x407 /d "_DEBUG" # ADD RSC /l 0x407 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /pdbtype:sept /FORCE:MULTIPLE # SUBTRACT LINK32 /pdb:none !ENDIF # Begin Target # Name "dumatest - Win32 Release" # Name "dumatest - Win32 Debug" # Begin Group "Quellcodedateien" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\dumatest.c # End Source File # End Group # Begin Group "Header-Dateien" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Ressourcendateien" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project duma-VERSION_2_5_21/win32-msvc/dumatestpp/000077500000000000000000000000001401225056000201675ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc/dumatestpp/dumatestpp.dsp000066400000000000000000000105431401225056000230700ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="dumatestpp" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** NICHT BEARBEITEN ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=dumatestpp - Win32 Debug !MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE !MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl !MESSAGE !MESSAGE NMAKE /f "dumatestpp.mak". !MESSAGE !MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben !MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: !MESSAGE !MESSAGE NMAKE /f "dumatestpp.mak" CFG="dumatestpp - Win32 Debug" !MESSAGE !MESSAGE Für die Konfiguration stehen zur Auswahl: !MESSAGE !MESSAGE "dumatestpp - Win32 Release" (basierend auf "Win32 (x86) Console Application") !MESSAGE "dumatestpp - Win32 Debug" (basierend auf "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "dumatestpp - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x407 /d "NDEBUG" # ADD RSC /l 0x407 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "dumatestpp - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "../.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x407 /d "_DEBUG" # ADD RSC /l 0x407 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /pdbtype:sept /FORCE:MULTIPLE # SUBTRACT LINK32 /pdb:none !ENDIF # Begin Target # Name "dumatestpp - Win32 Release" # Name "dumatestpp - Win32 Debug" # Begin Group "Quellcodedateien" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\dumatestpp.cpp # End Source File # End Group # Begin Group "Header-Dateien" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Ressourcendateien" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project duma-VERSION_2_5_21/win32-msvc/example1/000077500000000000000000000000001401225056000175155ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc/example1/example1.dsp000066400000000000000000000105551401225056000217470ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="example1" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** NICHT BEARBEITEN ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=example1 - Win32 Debug !MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE !MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl !MESSAGE !MESSAGE NMAKE /f "example1.mak". !MESSAGE !MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben !MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: !MESSAGE !MESSAGE NMAKE /f "example1.mak" CFG="example1 - Win32 Debug" !MESSAGE !MESSAGE Für die Konfiguration stehen zur Auswahl: !MESSAGE !MESSAGE "example1 - Win32 Release" (basierend auf "Win32 (x86) Console Application") !MESSAGE "example1 - Win32 Debug" (basierend auf "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "example1 - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /Zi /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x407 /d "NDEBUG" # ADD RSC /l 0x407 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /FORCE:MULTIPLE # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "example1 - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE RSC /l 0x407 /d "_DEBUG" # ADD RSC /l 0x407 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /pdbtype:sept /FORCE:MULTIPLE # SUBTRACT LINK32 /pdb:none !ENDIF # Begin Target # Name "example1 - Win32 Release" # Name "example1 - Win32 Debug" # Begin Group "Quellcodedateien" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\example1.cpp # End Source File # End Group # Begin Group "Header-Dateien" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Ressourcendateien" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project duma-VERSION_2_5_21/win32-msvc/example1/example1.dsw000066400000000000000000000014551401225056000217550ustar00rootroot00000000000000Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNUNG: DIESE ARBEITSBEREICHSDATEI DARF NICHT BEARBEITET ODER GELÖSCHT WERDEN! ############################################################################### Project: "dumalib"="..\dumalib\dumalib.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "example1"=".\example1.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name dumalib End Project Dependency }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### duma-VERSION_2_5_21/win32-msvc/example2/000077500000000000000000000000001401225056000175165ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc/example2/example2.dsp000066400000000000000000000105551401225056000217510ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="example2" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** NICHT BEARBEITEN ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=example2 - Win32 Debug !MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE !MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl !MESSAGE !MESSAGE NMAKE /f "example2.mak". !MESSAGE !MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben !MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: !MESSAGE !MESSAGE NMAKE /f "example2.mak" CFG="example2 - Win32 Debug" !MESSAGE !MESSAGE Für die Konfiguration stehen zur Auswahl: !MESSAGE !MESSAGE "example2 - Win32 Release" (basierend auf "Win32 (x86) Console Application") !MESSAGE "example2 - Win32 Debug" (basierend auf "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "example2 - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /Zi /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x407 /d "NDEBUG" # ADD RSC /l 0x407 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /FORCE:MULTIPLE # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "example2 - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE RSC /l 0x407 /d "_DEBUG" # ADD RSC /l 0x407 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /pdbtype:sept /FORCE:MULTIPLE # SUBTRACT LINK32 /pdb:none !ENDIF # Begin Target # Name "example2 - Win32 Release" # Name "example2 - Win32 Debug" # Begin Group "Quellcodedateien" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\example2.cpp # End Source File # End Group # Begin Group "Header-Dateien" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Ressourcendateien" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project duma-VERSION_2_5_21/win32-msvc/example2/example2.dsw000066400000000000000000000014551401225056000217570ustar00rootroot00000000000000Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNUNG: DIESE ARBEITSBEREICHSDATEI DARF NICHT BEARBEITET ODER GELÖSCHT WERDEN! ############################################################################### Project: "dumalib"="..\dumalib\dumalib.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "example2"=".\example2.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name dumalib End Project Dependency }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### duma-VERSION_2_5_21/win32-msvc/example3/000077500000000000000000000000001401225056000175175ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc/example3/example3.dsp000066400000000000000000000105771401225056000217570ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="example3" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** NICHT BEARBEITEN ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=example3 - Win32 Debug !MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE !MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl !MESSAGE !MESSAGE NMAKE /f "example3.mak". !MESSAGE !MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben !MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: !MESSAGE !MESSAGE NMAKE /f "example3.mak" CFG="example3 - Win32 Debug" !MESSAGE !MESSAGE Für die Konfiguration stehen zur Auswahl: !MESSAGE !MESSAGE "example3 - Win32 Release" (basierend auf "Win32 (x86) Console Application") !MESSAGE "example3 - Win32 Debug" (basierend auf "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "example3 - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /Zi /O2 /I "..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x407 /d "NDEBUG" # ADD RSC /l 0x407 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /FORCE:MULTIPLE # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "example3 - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE RSC /l 0x407 /d "_DEBUG" # ADD RSC /l 0x407 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /pdbtype:sept /FORCE:MULTIPLE # SUBTRACT LINK32 /pdb:none !ENDIF # Begin Target # Name "example3 - Win32 Release" # Name "example3 - Win32 Debug" # Begin Group "Quellcodedateien" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\example3.cpp # End Source File # End Group # Begin Group "Header-Dateien" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Ressourcendateien" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project duma-VERSION_2_5_21/win32-msvc/example3/example3.dsw000066400000000000000000000014551401225056000217610ustar00rootroot00000000000000Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNUNG: DIESE ARBEITSBEREICHSDATEI DARF NICHT BEARBEITET ODER GELÖSCHT WERDEN! ############################################################################### Project: "dumalib"="..\dumalib\dumalib.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "example3"=".\example3.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name dumalib End Project Dependency }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### duma-VERSION_2_5_21/win32-msvc/example4/000077500000000000000000000000001401225056000175205ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc/example4/example4.dsp000066400000000000000000000105771401225056000217610ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="example4" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** NICHT BEARBEITEN ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=example4 - Win32 Debug !MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE !MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl !MESSAGE !MESSAGE NMAKE /f "example4.mak". !MESSAGE !MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben !MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: !MESSAGE !MESSAGE NMAKE /f "example4.mak" CFG="example4 - Win32 Debug" !MESSAGE !MESSAGE Für die Konfiguration stehen zur Auswahl: !MESSAGE !MESSAGE "example4 - Win32 Release" (basierend auf "Win32 (x86) Console Application") !MESSAGE "example4 - Win32 Debug" (basierend auf "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "example4 - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /Zi /O2 /I "..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x407 /d "NDEBUG" # ADD RSC /l 0x407 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /FORCE:MULTIPLE # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "example4 - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE RSC /l 0x407 /d "_DEBUG" # ADD RSC /l 0x407 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /pdbtype:sept /FORCE:MULTIPLE # SUBTRACT LINK32 /pdb:none !ENDIF # Begin Target # Name "example4 - Win32 Release" # Name "example4 - Win32 Debug" # Begin Group "Quellcodedateien" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\example4.cpp # End Source File # End Group # Begin Group "Header-Dateien" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Ressourcendateien" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project duma-VERSION_2_5_21/win32-msvc/example4/example4.dsw000066400000000000000000000014551401225056000217630ustar00rootroot00000000000000Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNUNG: DIESE ARBEITSBEREICHSDATEI DARF NICHT BEARBEITET ODER GELÖSCHT WERDEN! ############################################################################### Project: "dumalib"="..\dumalib\dumalib.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "example4"=".\example4.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name dumalib End Project Dependency }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### duma-VERSION_2_5_21/win32-msvc/example5/000077500000000000000000000000001401225056000175215ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc/example5/example5.dsp000066400000000000000000000105771401225056000217630ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="example5" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** NICHT BEARBEITEN ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=example5 - Win32 Debug !MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE !MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl !MESSAGE !MESSAGE NMAKE /f "example5.mak". !MESSAGE !MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben !MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: !MESSAGE !MESSAGE NMAKE /f "example5.mak" CFG="example5 - Win32 Debug" !MESSAGE !MESSAGE Für die Konfiguration stehen zur Auswahl: !MESSAGE !MESSAGE "example5 - Win32 Release" (basierend auf "Win32 (x86) Console Application") !MESSAGE "example5 - Win32 Debug" (basierend auf "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "example5 - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /Zi /O2 /I "..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x407 /d "NDEBUG" # ADD RSC /l 0x407 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /FORCE:MULTIPLE # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "example5 - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE RSC /l 0x407 /d "_DEBUG" # ADD RSC /l 0x407 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /pdbtype:sept /FORCE:MULTIPLE # SUBTRACT LINK32 /pdb:none !ENDIF # Begin Target # Name "example5 - Win32 Release" # Name "example5 - Win32 Debug" # Begin Group "Quellcodedateien" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\example5.cpp # End Source File # End Group # Begin Group "Header-Dateien" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Ressourcendateien" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project duma-VERSION_2_5_21/win32-msvc/example5/example5.dsw000066400000000000000000000014551401225056000217650ustar00rootroot00000000000000Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNUNG: DIESE ARBEITSBEREICHSDATEI DARF NICHT BEARBEITET ODER GELÖSCHT WERDEN! ############################################################################### Project: "dumalib"="..\dumalib\dumalib.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "example5"=".\example5.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name dumalib End Project Dependency }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### duma-VERSION_2_5_21/win32-msvc/example6/000077500000000000000000000000001401225056000175225ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc/example6/example6.dsp000066400000000000000000000107411401225056000217560ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="example6" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** NICHT BEARBEITEN ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=example6 - Win32 Debug !MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE !MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl !MESSAGE !MESSAGE NMAKE /f "example6.mak". !MESSAGE !MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben !MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: !MESSAGE !MESSAGE NMAKE /f "example6.mak" CFG="example6 - Win32 Debug" !MESSAGE !MESSAGE Für die Konfiguration stehen zur Auswahl: !MESSAGE !MESSAGE "example6 - Win32 Release" (basierend auf "Win32 (x86) Console Application") !MESSAGE "example6 - Win32 Debug" (basierend auf "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "example6 - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /Zi /O2 /I "..\.." /FI"malloc.h" /FI"new" /FI"duma.h" /FI"dumapp.h" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x407 /d "NDEBUG" # ADD RSC /l 0x407 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /FORCE:MULTIPLE # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "example6 - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\.." /FI"malloc.h" /FI"new" /FI"duma.h" /FI"dumapp.h" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE RSC /l 0x407 /d "_DEBUG" # ADD RSC /l 0x407 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /pdbtype:sept /FORCE:MULTIPLE # SUBTRACT LINK32 /pdb:none !ENDIF # Begin Target # Name "example6 - Win32 Release" # Name "example6 - Win32 Debug" # Begin Group "Quellcodedateien" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\example6.cpp # End Source File # End Group # Begin Group "Header-Dateien" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Ressourcendateien" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project duma-VERSION_2_5_21/win32-msvc/example6/example6.dsw000066400000000000000000000014551401225056000217670ustar00rootroot00000000000000Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNUNG: DIESE ARBEITSBEREICHSDATEI DARF NICHT BEARBEITET ODER GELÖSCHT WERDEN! ############################################################################### Project: "dumalib"="..\dumalib\dumalib.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "example6"=".\example6.dsp" - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name dumalib End Project Dependency }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### duma-VERSION_2_5_21/win32-msvc/stacktrace/000077500000000000000000000000001401225056000201255ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc/stacktrace/stacktrace.dsp000066400000000000000000000111711401225056000227620ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="stacktrace" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Static Library" 0x0104 CFG=stacktrace - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "stacktrace.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "stacktrace.mak" CFG="stacktrace - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "stacktrace - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "stacktrace - Win32 Debug" (based on "Win32 (x86) Static Library") !MESSAGE "stacktrace - Win32 Detours" (based on "Win32 (x86) Static Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "stacktrace - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "..\.." /I "..\..\stacktrace" /I "..\..\stacktrace\internal" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "DUMA_NO_CPP_SUPPORT" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo !ELSEIF "$(CFG)" == "stacktrace - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\stacktrace" /I "..\..\stacktrace\internal" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "DUMA_NO_CPP_SUPPORT" /YX /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo !ELSEIF "$(CFG)" == "stacktrace - Win32 Detours" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Detours" # PROP BASE Intermediate_Dir "Detours" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Detours" # PROP Intermediate_Dir "Detours" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "..\.." /I "..\..\stacktrace" /I "..\..\stacktrace\internal" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "DUMA_NO_CPP_SUPPORT" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo !ENDIF # Begin Target # Name "stacktrace - Win32 Release" # Name "stacktrace - Win32 Debug" # Name "stacktrace - Win32 Detours" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\stacktrace\internal\MapFile.cpp # End Source File # Begin Source File SOURCE=..\..\stacktrace\internal\MapFileEntry.cpp # End Source File # Begin Source File SOURCE=..\..\stacktrace\printStackTrace.cpp # End Source File # Begin Source File SOURCE=..\..\stacktrace\internal\StackTrace.cpp # End Source File # Begin Source File SOURCE=..\..\stacktrace\internal\TextFile.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=..\..\stacktrace\internal\Array.h # End Source File # Begin Source File SOURCE=..\..\stacktrace\internal\MapFile.h # End Source File # Begin Source File SOURCE=..\..\stacktrace\internal\MapFileEntry.h # End Source File # Begin Source File SOURCE=..\..\stacktrace\printStackTrace.h # End Source File # Begin Source File SOURCE=..\..\stacktrace\internal\StackTrace.h # End Source File # Begin Source File SOURCE=..\..\stacktrace\internal\TextFile.h # End Source File # End Group # End Target # End Project duma-VERSION_2_5_21/win32-msvc/testoperators/000077500000000000000000000000001401225056000207175ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc/testoperators/testoperators.dsp000066400000000000000000000106071401225056000243510ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="testoperators" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** NICHT BEARBEITEN ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=testoperators - Win32 Debug !MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE !MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl !MESSAGE !MESSAGE NMAKE /f "testoperators.mak". !MESSAGE !MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben !MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: !MESSAGE !MESSAGE NMAKE /f "testoperators.mak" CFG="testoperators - Win32 Debug" !MESSAGE !MESSAGE Für die Konfiguration stehen zur Auswahl: !MESSAGE !MESSAGE "testoperators - Win32 Release" (basierend auf "Win32 (x86) Console Application") !MESSAGE "testoperators - Win32 Debug" (basierend auf "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "testoperators - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x407 /d "NDEBUG" # ADD RSC /l 0x407 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "testoperators - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "../.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x407 /d "_DEBUG" # ADD RSC /l 0x407 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /pdbtype:sept /FORCE:MULTIPLE # SUBTRACT LINK32 /pdb:none !ENDIF # Begin Target # Name "testoperators - Win32 Release" # Name "testoperators - Win32 Debug" # Begin Group "Quellcodedateien" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\testoperators.cpp # End Source File # End Group # Begin Group "Header-Dateien" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Ressourcendateien" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project duma-VERSION_2_5_21/win32-msvc/tstheap/000077500000000000000000000000001401225056000174515ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-msvc/tstheap/tstheap.dsp000066400000000000000000000104561401225056000216370ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="tstheap" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** NICHT BEARBEITEN ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=tstheap - Win32 Debug !MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE !MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl !MESSAGE !MESSAGE NMAKE /f "tstheap.mak". !MESSAGE !MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben !MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: !MESSAGE !MESSAGE NMAKE /f "tstheap.mak" CFG="tstheap - Win32 Debug" !MESSAGE !MESSAGE Für die Konfiguration stehen zur Auswahl: !MESSAGE !MESSAGE "tstheap - Win32 Release" (basierend auf "Win32 (x86) Console Application") !MESSAGE "tstheap - Win32 Debug" (basierend auf "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "tstheap - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x407 /d "NDEBUG" # ADD RSC /l 0x407 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "tstheap - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x407 /d "_DEBUG" # ADD RSC /l 0x407 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /pdbtype:sept /FORCE:MULTIPLE # SUBTRACT LINK32 /pdb:none !ENDIF # Begin Target # Name "tstheap - Win32 Release" # Name "tstheap - Win32 Debug" # Begin Group "Quellcodedateien" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\tstheap.c # End Source File # End Group # Begin Group "Header-Dateien" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Ressourcendateien" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project duma-VERSION_2_5_21/win32-vide/000077500000000000000000000000001401225056000157605ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-vide/efencelib/000077500000000000000000000000001401225056000176745ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-vide/efencelib/Makefile.v000066400000000000000000000042531401225056000216040ustar00rootroot00000000000000#======================================================================= #@V@:Note: File automatically generated by VIDE: (21:20:11 22 Nov 2002) (BCC32). # This file regenerated each time you run VIDE, so save under a # new name if you hand edit, or it will be overwritten. #======================================================================= # Standard defines: .AUTODEPEND # Borland C++ tools IMPLIB = $(BCCROOT)\bin\Implib ILINK32 = $(BCCROOT)\bin\ILink32 TLIB = $(BCCROOT)\bin\TLib BRC32 = $(BCCROOT)\bin\Brc32 TASM32 = $(BCROOT)\bin\Tasm32 CC = $(BCCROOT)\bin\BCC32 BCCROOT = C:\borland\bcc55 HOMEV = VPATH = $(HOMEV)\include oDir = . Bin = . Src = . libDirs = -L$(BCCROOT)\lib;$(BCCROOT)\lib\psdk incDirs = -I$(BCCROOT)\include LIBS = -v -Gl C_FLAGS = -q -v\ -D_WINVER=0x0400\ -D_WIN32_WINNT=0x0400\ -DWIN32 SRCS =\ $(Src)\..\..\efence.c\ $(Src)\..\..\efencepp.cpp\ $(Src)\..\..\page.c\ $(Src)\..\..\print.c EXOBJS =\ $(oDir)\efence.obj\ $(oDir)\efencepp.obj\ $(oDir)\page.obj\ $(oDir)\print.obj ALLOBJS = $(EXOBJS) BCCJUNK = *.il* *.csm *.tds ALLBIN = $(Bin)\efencelib.lib ALLTGT = $(Bin)\efencelib.lib # User defines: #@# Targets follow --------------------------------- all: $(ALLTGT) objs: $(ALLOBJS) cleanobjs: rm -f $(ALLOBJS) cleanbin: rm -f $(ALLBIN) $(BCCJUNK) clean: cleanobjs cleanbin cleanall: cleanobjs cleanbin #@# User Targets follow --------------------------------- # BCC32 DEF file: add after = if needed BCC32DEF = # BCC32 RT lib: cw32.lib static BCC32RTLIB = cw32 # BCC32 Startup: c0x32.obj-console, c0w32.obj-winapi #@# Dependency rules follow ----------------------------- $(Bin)\efencelib.lib : $(EXOBJS) rm -f $< $(TLIB) $< @&&| +$(oDir)\efence.obj & +$(oDir)\efencepp.obj & +$(oDir)\page.obj & +$(oDir)\print.obj | $(oDir)\efence.obj : $(Src)\..\..\efence.c $(CC) -c $(C_FLAGS) $(incDirs) -o$@ $(Src)\..\..\efence.c $(oDir)\efencepp.obj : $(Src)\..\..\efencepp.cpp $(CC) -c $(C_FLAGS) $(incDirs) -o$@ $(Src)\..\..\efencepp.cpp $(oDir)\page.obj : $(Src)\..\..\page.c $(CC) -c $(C_FLAGS) $(incDirs) -o$@ $(Src)\..\..\page.c $(oDir)\print.obj : $(Src)\..\..\print.c $(CC) -c $(C_FLAGS) $(incDirs) -o$@ $(Src)\..\..\print.c duma-VERSION_2_5_21/win32-vide/efencelib/dumalib.vpj000066400000000000000000000030731401225056000220350ustar00rootroot00000000000000//======================================================================= //@V@:Note: Project File generated by VIDE: (20:19:26 22 Nov 2002). //CAUTION! Hand edit only if you know what you are doing! //======================================================================= //% Section 1 - PROJECT OPTIONS ctags:* debugSwitches:-jp //%end-proj-opts //% Section 2 - MAKEFILE Makefile.v //% Section 3 - OPTIONS //%end-options //% Section 4 - HOMEV //% Section 5 - TARGET FILE efencelib.lib //% Section 6 - SOURCE FILES ..\..\duma.c ..\..\dumapp.cpp ..\..\page.c ..\..\print.c //%end-srcfiles //% Section 7 - COMPILER NAME BCC32 //% Section 8 - INCLUDE DIRECTORIES $(BCCROOT)\include //%end-include-dirs //% Section 9 - LIBRARY DIRECTORIES $(BCCROOT)\lib $(BCCROOT)\lib\psdk //%end-library-dirs //% Section 10 - DEFINITIONS -D_RTLDLL -D_WINVER=0x0400 -D_WIN32_WINNT=0x0400 -DWIN32 //%end-defs-pool -D_WINVER=0x0400 -D_WIN32_WINNT=0x0400 -DWIN32 //%end-defs //% Section 11 - C FLAGS -q -v //% Section 12 - LIBRARY FLAGS -v -Gl //% Section 13 - SRC DIRECTORY . //% Section 14 - OBJ DIRECTORY . //% Section 15 - BIN DIRECTORY . //% User targets section. Following lines will be //% inserted into Makefile right after the generated cleanall target. //% The Project File editor does not edit these lines - edit the .vpj //% directly. You should know what you are doing. //% Section 16 - USER TARGETS # BCC32 DEF file: add after = if needed BCC32DEF = # BCC32 RT lib: cw32.lib static BCC32RTLIB = cw32 # BCC32 Startup: c0x32.obj-console, c0w32.obj-winapi //%end-user-targets duma-VERSION_2_5_21/win32-vide/eftest/000077500000000000000000000000001401225056000172525ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-vide/eftest/eftest.vpj000066400000000000000000000031361401225056000212700ustar00rootroot00000000000000//======================================================================= //@V@:Note: Project File generated by VIDE: (20:26:12 22 Nov 2002). //CAUTION! Hand edit only if you know what you are doing! //======================================================================= //% Section 1 - PROJECT OPTIONS ctags:* debugSwitches:-jp //%end-proj-opts //% Section 2 - MAKEFILE Makefile.v //% Section 3 - OPTIONS //%end-options //% Section 4 - HOMEV //% Section 5 - TARGET FILE eftest //% Section 6 - SOURCE FILES ..\..\eftest.c //%end-srcfiles //% Section 7 - COMPILER NAME BCC32 //% Section 8 - INCLUDE DIRECTORIES $(BCCROOT)\include //%end-include-dirs //% Section 9 - LIBRARY DIRECTORIES $(BCCROOT)\lib $(BCCROOT)\lib\psdk ..\efencelib //%end-library-dirs //% Section 10 - DEFINITIONS -D_RTLDLL -D_WINVER=0x0400 -D_WIN32_WINNT=0x0400 -DWIN32 //%end-defs-pool -D_WINVER=0x0400 -D_WIN32_WINNT=0x0400 -DWIN32 //%end-defs //% Section 11 - C FLAGS -q -v //% Section 12 - LIBRARY FLAGS -v -Tpe -ap -c -limport32 -l$(BCC32RTLIB) -lefencelib //% Section 13 - SRC DIRECTORY . //% Section 14 - OBJ DIRECTORY . //% Section 15 - BIN DIRECTORY . //% User targets section. Following lines will be //% inserted into Makefile right after the generated cleanall target. //% The Project File editor does not edit these lines - edit the .vpj //% directly. You should know what you are doing. //% Section 16 - USER TARGETS # BCC32 DEF file: add after = if needed BCC32DEF = # BCC32 RT lib: cw32.lib static BCC32RTLIB = cw32 # BCC32 Startup: c0x32.obj-console, c0w32.obj-winapi BCC32STARTUP = c0x32.obj //%end-user-targets duma-VERSION_2_5_21/win32-vide/tstheap/000077500000000000000000000000001401225056000174305ustar00rootroot00000000000000duma-VERSION_2_5_21/win32-vide/tstheap/tstheap.vpj000066400000000000000000000031401401225056000216170ustar00rootroot00000000000000//======================================================================= //@V@:Note: Project File generated by VIDE: (20:26:12 22 Nov 2002). //CAUTION! Hand edit only if you know what you are doing! //======================================================================= //% Section 1 - PROJECT OPTIONS ctags:* debugSwitches:-jp //%end-proj-opts //% Section 2 - MAKEFILE Makefile.v //% Section 3 - OPTIONS //%end-options //% Section 4 - HOMEV //% Section 5 - TARGET FILE tstheap //% Section 6 - SOURCE FILES ..\..\tstheap.c //%end-srcfiles //% Section 7 - COMPILER NAME BCC32 //% Section 8 - INCLUDE DIRECTORIES $(BCCROOT)\include //%end-include-dirs //% Section 9 - LIBRARY DIRECTORIES $(BCCROOT)\lib $(BCCROOT)\lib\psdk ..\efencelib //%end-library-dirs //% Section 10 - DEFINITIONS -D_RTLDLL -D_WINVER=0x0400 -D_WIN32_WINNT=0x0400 -DWIN32 //%end-defs-pool -D_WINVER=0x0400 -D_WIN32_WINNT=0x0400 -DWIN32 //%end-defs //% Section 11 - C FLAGS -q -v //% Section 12 - LIBRARY FLAGS -v -Tpe -ap -c -limport32 -l$(BCC32RTLIB) -lefencelib //% Section 13 - SRC DIRECTORY . //% Section 14 - OBJ DIRECTORY . //% Section 15 - BIN DIRECTORY . //% User targets section. Following lines will be //% inserted into Makefile right after the generated cleanall target. //% The Project File editor does not edit these lines - edit the .vpj //% directly. You should know what you are doing. //% Section 16 - USER TARGETS # BCC32 DEF file: add after = if needed BCC32DEF = # BCC32 RT lib: cw32.lib static BCC32RTLIB = cw32 # BCC32 Startup: c0x32.obj-console, c0w32.obj-winapi BCC32STARTUP = c0x32.obj //%end-user-targets