Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "src/chronos"]
path = src/chronos
url = https://github.com/datadiode/chronos
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Visual Leak Detector (Support Visual Studio 2019 16.7)
# Visual Leak Detector (Support Visual Studio 2022 17.12)

## Introduction

Expand All @@ -18,6 +18,6 @@ We encourage developers who've added their own features, or fixed bugs they've f

* [Source code](https://github.com/oneiric/vld)

Copyright © 2005-2021 VLD Team
Copyright © 2005-2025 VLD Team

[1]: https://github.com/oneiric/vld/blob/master/COPYING.txt
72 changes: 36 additions & 36 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,53 +11,53 @@ environment:
GTEST_REPEAT: 1

matrix:
- VldStackWalkMethod: safe
Toolset: v90
Solution: vld_vs14_wo_mfc.sln
GTEST_FILTER: -*.Mfc*
- VldStackWalkMethod: safe
Toolset: v100
Solution: vld_vs14_wo_mfc.sln
GTEST_FILTER: -*.Mfc*
- VldStackWalkMethod: safe
Toolset: v110
Solution: vld_vs14_wo_mfc.sln
GTEST_FILTER: -*.Mfc*
- VldStackWalkMethod: safe
Toolset: v120_xp
Solution: vld_vs14.sln
# - VldStackWalkMethod: safe
# Toolset: v90
# Solution: vld_vs14_wo_mfc.sln
# GTEST_FILTER: -*.Mfc*
# - VldStackWalkMethod: safe
# Toolset: v100
# Solution: vld_vs14_wo_mfc.sln
# GTEST_FILTER: -*.Mfc*
# - VldStackWalkMethod: safe
# Toolset: v110
# Solution: vld_vs14_wo_mfc.sln
# GTEST_FILTER: -*.Mfc*
# - VldStackWalkMethod: safe
# Toolset: v120_xp
# Solution: vld_vs14.sln
- VldStackWalkMethod: safe
Toolset: v140_xp
Solution: vld_vs14.sln

- VldStackWalkMethod: fast
Toolset: v90
Solution: vld_vs14_wo_mfc.sln
GTEST_FILTER: -*.Mfc*
- VldStackWalkMethod: fast
Toolset: v100
Solution: vld_vs14_wo_mfc.sln
GTEST_FILTER: -*.Mfc*
- VldStackWalkMethod: fast
Toolset: v110
Solution: vld_vs14_wo_mfc.sln
GTEST_FILTER: -*.Mfc*
- VldStackWalkMethod: fast
Toolset: v120_xp
Solution: vld_vs14.sln
Solution: vld_vs16.sln

# - VldStackWalkMethod: fast
# Toolset: v90
# Solution: vld_vs14_wo_mfc.sln
# GTEST_FILTER: -*.Mfc*
# - VldStackWalkMethod: fast
# Toolset: v100
# Solution: vld_vs14_wo_mfc.sln
# GTEST_FILTER: -*.Mfc*
# - VldStackWalkMethod: fast
# Toolset: v110
# Solution: vld_vs14_wo_mfc.sln
# GTEST_FILTER: -*.Mfc*
# - VldStackWalkMethod: fast
# Toolset: v120_xp
# Solution: vld_vs14.sln
- VldStackWalkMethod: fast
Toolset: v140_xp
Solution: vld_vs14.sln
Solution: vld_vs16.sln

platform:
- Win32
- x64

configuration:
- Debug_VldRelease
- Debug_VldRelease_StaticCrt
# - Debug_VldRelease_StaticCrt
- Release
- Release_StaticCrt
# - Release_StaticCrt

matrix:
fast_finish: false
Expand All @@ -82,7 +82,7 @@ build_script:
return
}
& .\change_toolset.ps1 $env:Toolset
msbuild /v:m /p:"Configuration=$env:CONFIGURATION" /p:Platform="$env:PLATFORM" "$env:Solution" /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
msbuild /v:m /p:"Configuration=$env:CONFIGURATION" /p:Platform="$env:PLATFORM" /p:PlatformToolset=$env:Toolset "$env:Solution" /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"

test_script:
- ps: |
Expand Down
2 changes: 1 addition & 1 deletion lib/cppformat/format.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<PropertyGroup Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
Expand Down
2 changes: 1 addition & 1 deletion lib/gtest/msvc/gtest.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
Expand Down
12 changes: 4 additions & 8 deletions setup/version.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@

#define VLDVERSION L"2.7.0"
#define VERSION_NUMBER 2,7,0,0
#define VERSION_STRING "2.7.0.0"
#define VERSION_COPYRIGHT "Copyright (C) 2005-2021"

#ifndef __FILE__
!define VLD_VERSION "2.7.0" // NSIS Script
#endif
#define VLDVERSION L"2.8.4"
#define VERSION_NUMBER 2,8,4,0
#define VERSION_STRING "2.8.4.0"
#define VERSION_COPYRIGHT "Copyright (C) 2005-2025"
47 changes: 33 additions & 14 deletions setup/vld-setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Visual Leak Detector"
#define MyAppVersion "2.7.0"
#define MyAppVersion "2.8.4"
#define MyAppPublisher "VLD Team"
#define MyAppURL "http://vld.codeplex.com/"
#define MyAppURL "https://github.com/oneiric/vld"
#define MyAppRegKey "Software\Visual Leak Detector"

[Setup]
Expand All @@ -25,7 +25,7 @@ LicenseFile=license-free.txt
OutputBaseFilename=vld-{#MyAppVersion}-setup
Compression=lzma
SolidCompression=True
MinVersion=0,6.0
MinVersion=0,6.1
; Tell Windows Explorer to reload the environment
ChangesEnvironment=yes
AllowNoIcons=yes
Expand All @@ -41,16 +41,19 @@ Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "{group}\View Documentation"; Filename: "http://vld.codeplex.com/documentation"

[Files]
Source: "..\x64\Release\chronos_x64.exe"; DestDir: "{app}\bin\Win64"; Flags: ignoreversion
Source: "..\Release\chronos_x86.exe"; DestDir: "{app}\bin\Win32"; Flags: ignoreversion
Source: "..\src\chronos\LICENSE"; DestDir: "{app}"; DestName: "LICENSE_chronos.txt"; Flags: ignoreversion
Source: "dbghelp\x64\dbghelp.dll"; DestDir: "{app}\bin\Win64"; Flags: ignoreversion
Source: "dbghelp\x64\Microsoft.DTfW.DHL.manifest"; DestDir: "{app}\bin\Win64"; Flags: ignoreversion
Source: "dbghelp\x86\dbghelp.dll"; DestDir: "{app}\bin\Win32"; Flags: ignoreversion
Source: "dbghelp\x86\Microsoft.DTfW.DHL.manifest"; DestDir: "{app}\bin\Win32"; Flags: ignoreversion
Source: "..\src\bin\Win32\Release-v142\vld.lib"; DestDir: "{app}\lib\Win32"; Flags: ignoreversion
Source: "..\src\bin\Win32\Release-v142\vld_x86.dll"; DestDir: "{app}\bin\Win32"; Flags: ignoreversion
Source: "..\src\bin\Win32\Release-v142\vld_x86.pdb"; DestDir: "{app}\bin\Win32"; Flags: ignoreversion
Source: "..\src\bin\x64\Release-v142\vld.lib"; DestDir: "{app}\lib\Win64"; Flags: ignoreversion
Source: "..\src\bin\x64\Release-v142\vld_x64.dll"; DestDir: "{app}\bin\Win64"; Flags: ignoreversion
Source: "..\src\bin\x64\Release-v142\vld_x64.pdb"; DestDir: "{app}\bin\Win64"; Flags: ignoreversion
Source: "..\src\bin\Win32\Release-v143\vld.lib"; DestDir: "{app}\lib\Win32"; Flags: ignoreversion
Source: "..\src\bin\Win32\Release-v143\vld_x86.dll"; DestDir: "{app}\bin\Win32"; Flags: ignoreversion
Source: "..\src\bin\Win32\Release-v143\vld_x86.pdb"; DestDir: "{app}\bin\Win32"; Flags: ignoreversion
Source: "..\src\bin\x64\Release-v143\vld.lib"; DestDir: "{app}\lib\Win64"; Flags: ignoreversion
Source: "..\src\bin\x64\Release-v143\vld_x64.dll"; DestDir: "{app}\bin\Win64"; Flags: ignoreversion
Source: "..\src\bin\x64\Release-v143\vld_x64.pdb"; DestDir: "{app}\bin\Win64"; Flags: ignoreversion
Source: "..\src\vld.h"; DestDir: "{app}\include"; Flags: ignoreversion
Source: "..\src\vld_def.h"; DestDir: "{app}\include"; Flags: ignoreversion
Source: "..\vld.ini"; DestDir: "{app}"; Flags: ignoreversion
Expand All @@ -61,7 +64,7 @@ Source: "..\COPYING.txt"; DestDir: "{app}"; Flags: ignoreversion
[Tasks]
Name: "modifypath"; Description: "Add VLD directory to your environmental path"
Name: "modifyVS2008Props"; Description: "Add VLD directory to VS 2008"
Name: "modifyVS2010Props"; Description: "Add VLD directory to VS 2010 - VS 2019"
Name: "modifyVS2010Props"; Description: "Add VLD directory to VS 2010 - VS 2022"

[ThirdParty]
UseRelativePaths=True
Expand Down Expand Up @@ -318,12 +321,28 @@ var
StaticLibraryDirectoriesNode: Variant;
AdditionalStaticLibraryDirectories: string;
begin
if not FileExists(filename) then
Exit;
XMLDocument := CreateOleObject('Msxml2.DOMDocument.3.0');
try
XMLDocument.async := False;
XMLDocument.load(filename);
XMLDocument.preserveWhiteSpace := True;
if FileExists(filename) then
XMLDocument.load(filename)
else
XMLDocument.loadXML(
'<?xml version="1.0" encoding="utf-8"?>'#13#10
'<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">'#13#10
' <ItemDefinitionGroup>'#13#10
' <ClCompile>'#13#10
' <AdditionalIncludeDirectories></AdditionalIncludeDirectories>'#13#10
' </ClCompile>'#13#10
' <Link>'#13#10
' <AdditionalLibraryDirectories></AdditionalLibraryDirectories>'#13#10
' </Link>'#13#10
' <Lib>'#13#10
' <AdditionalLibraryDirectories></AdditionalLibraryDirectories>'#13#10
' </Lib>'#13#10
' </ItemDefinitionGroup>'#13#10
'</Project>'#13#10);
if (XMLDocument.parseError.errorCode = 0) then
begin
XMLDocument.setProperty('SelectionLanguage', 'XPath');
Expand Down Expand Up @@ -426,7 +445,7 @@ var
Path: string;
begin
Path := GetEnv('LOCALAPPDATA')+'\Microsoft\MSBuild\v4.0\';
if DirExists(Path) then
if ForceDirectories(Path) then
begin
ModifyProps(Path + 'Microsoft.Cpp.Win32.user.props', 'Win32');
ModifyProps(Path + 'Microsoft.Cpp.x64.user.props', 'Win64');
Expand Down
1 change: 1 addition & 0 deletions src/chronos
Submodule chronos added at c22e8e
23 changes: 23 additions & 0 deletions src/dllspatches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -769,13 +769,30 @@ patchentry_t VisualLeakDetector::m_ntdllPatch [] = {
NULL, NULL, NULL
};

patchentry_t VisualLeakDetector::m_winsockPatch [] = {
"socket", NULL, _socket,
"accept", NULL, _accept,
"connect", NULL, _connect,
"closesocket", NULL, _closesocket,
"WSACreateEvent", NULL, _WSACreateEvent,
"WSACloseEvent", NULL, _WSACloseEvent,
NULL, NULL, NULL
};

patchentry_t VisualLeakDetector::m_ole32Patch [] = {
"CoGetMalloc", NULL, _CoGetMalloc,
"CoTaskMemAlloc", NULL, _CoTaskMemAlloc,
"CoTaskMemRealloc", NULL, _CoTaskMemRealloc,
NULL, NULL, NULL
};

SSL_CTX_new_t VisualLeakDetector::m_SSL_CTX_new = NULL;

patchentry_t VisualLeakDetector::m_opensslPatch [] = {
"SSL_CTX_new", (LPVOID*)&m_SSL_CTX_new, _SSL_CTX_new,
NULL, NULL, NULL
};

moduleentry_t VisualLeakDetector::m_patchTable [] = {
// Win32 heap APIs.
"kernel32.dll", FALSE, 0x0, m_kernelbasePatch, // we patch this record on Win7 and higher
Expand Down Expand Up @@ -842,6 +859,12 @@ moduleentry_t VisualLeakDetector::m_patchTable [] = {
// NT APIs.
"ntdll.dll", FALSE, 0x0, m_ntdllPatch,

// Winsock APIs.
"ws2_32.dll", FALSE, 0x0, m_winsockPatch,

// OpenSSL APIs.
"libssl-3-x64.dll", FALSE, 0x0, m_opensslPatch,

// COM heap APIs.
"ole32.dll", FALSE, 0x0, m_ole32Patch
};
3 changes: 2 additions & 1 deletion src/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
#include <cassert>
#include <cerrno>
#include <cstdio>
#include <windows.h>
#include <winsock2.h>
#include <shlwapi.h>
#if _WIN32_WINNT < 0x0600 // Windows XP or earlier, no GetProcessIdOfThread()
#include <winternl.h>
#endif
Expand Down
12 changes: 2 additions & 10 deletions src/tests/basics/Allocs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,8 @@
#define CRTDLLNAME _T("msvcr110d.dll")
#elif _MSC_VER == 1800 // VS 2013
#define CRTDLLNAME _T("msvcr120d.dll")
#elif _MSC_VER == 1900 // VS 2015
#elif _MSC_VER >= 1900 // VS 2015+
#define CRTDLLNAME _T("ucrtbased.dll")
#elif _MSC_VER == 1924 // VS 2019 16.4
#define CRTDLLNAME _T("ucrtbased.dll")
#elif _MSC_VER == 1927 // VS 2019 16.7
#define CRTDLLNAME _T("ucrtbase.dll")
#else
#error Unsupported compiler
#endif
Expand All @@ -59,11 +55,7 @@
#define CRTDLLNAME _T("msvcr110.dll")
#elif _MSC_VER == 1800 // VS 2013
#define CRTDLLNAME _T("msvcr120.dll")
#elif _MSC_VER == 1900 // VS 2015
#define CRTDLLNAME _T("ucrtbase.dll")
#elif _MSC_VER == 1924 // VS 2019 16.4
#define CRTDLLNAME _T("ucrtbase.dll")
#elif _MSC_VER == 1927 // VS 2019 16.7
#elif _MSC_VER >= 1900 // VS 2015+
#define CRTDLLNAME _T("ucrtbase.dll")
#else
#error Unsupported compiler
Expand Down
2 changes: 1 addition & 1 deletion src/tests/basics/basics.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
Expand Down
2 changes: 1 addition & 1 deletion src/tests/corruption/corruption.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
Expand Down
2 changes: 1 addition & 1 deletion src/tests/dynamic_app/dynamic_app.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
Expand Down
2 changes: 1 addition & 1 deletion src/tests/dynamic_dll/dynamic.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
Expand Down
2 changes: 1 addition & 1 deletion src/tests/mfc/vldmfc.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<UseOfMfc>Dynamic</UseOfMfc>
Expand Down
2 changes: 1 addition & 1 deletion src/tests/mfc_dll/mfc.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
Expand Down
Loading