Skip to content

Commit 3099b59

Browse files
committed
Small fixes, fixed compilation
1 parent 2f8b33b commit 3099b59

File tree

5 files changed

+44
-10
lines changed

5 files changed

+44
-10
lines changed

ExplorerPatcher/ExplorerPatcher.rc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ END
5151
//
5252

5353
VS_VERSION_INFO VERSIONINFO
54-
FILEVERSION 22000,258,32,0
55-
PRODUCTVERSION 22000,258,32,0
54+
FILEVERSION 22000,282,32,0
55+
PRODUCTVERSION 22000,282,32,0
5656
FILEFLAGSMASK 0x3fL
5757
#ifdef _DEBUG
5858
FILEFLAGS 0x1L
@@ -69,12 +69,12 @@ BEGIN
6969
BEGIN
7070
VALUE "CompanyName", "VALINET Solutions SRL"
7171
VALUE "FileDescription", "ExplorerPatcher"
72-
VALUE "FileVersion", "22000.258.32.0"
72+
VALUE "FileVersion", "22000.282.32.0"
7373
VALUE "InternalName", "ExplorerPatcher.dll"
7474
VALUE "LegalCopyright", "Copyright (C) 2006-2021 VALINET Solutions SRL. All rights reserved."
7575
VALUE "OriginalFilename", "ExplorerPatcher.dll"
7676
VALUE "ProductName", "ExplorerPatcher"
77-
VALUE "ProductVersion", "22000.258.32.0"
77+
VALUE "ProductVersion", "22000.282.32.0"
7878
END
7979
END
8080
BLOCK "VarFileInfo"

ExplorerPatcher/ExplorerPatcher.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@
183183
<AdditionalIncludeDirectories>$(SolutionDir)libs\funchook\include;$(SolutionDir)libs\libvalinet;$(SolutionDir)libs\funchook\distorm\include;$(SolutionDir)libs\Detours\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
184184
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
185185
<CallingConvention>StdCall</CallingConvention>
186+
<ForcedIncludeFiles>$(SolutionDir)debug.h</ForcedIncludeFiles>
186187
</ClCompile>
187188
<Link>
188189
<SubSystem>Console</SubSystem>

ExplorerPatcher/dllmain.c

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2674,6 +2674,37 @@ void WINAPI LoadSettings(BOOL bIsExplorer)
26742674
&bAllocConsole,
26752675
&dwSize
26762676
);
2677+
DWORD bMemcheck = FALSE;
2678+
dwSize = sizeof(DWORD);
2679+
RegQueryValueExW(
2680+
hKey,
2681+
TEXT("Memcheck"),
2682+
0,
2683+
NULL,
2684+
&bMemcheck,
2685+
&dwSize
2686+
);
2687+
if (bMemcheck)
2688+
{
2689+
#if defined(DEBUG) | defined(_DEBUG)
2690+
_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
2691+
_CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDOUT);
2692+
_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE);
2693+
_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDOUT);
2694+
_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE);
2695+
_CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDOUT);
2696+
_CrtDumpMemoryLeaks();
2697+
#endif
2698+
bMemcheck = FALSE;
2699+
RegSetValueExW(
2700+
hKey,
2701+
TEXT("Memcheck"),
2702+
0,
2703+
REG_DWORD,
2704+
&bMemcheck,
2705+
sizeof(DWORD)
2706+
);
2707+
}
26772708
dwSize = sizeof(DWORD);
26782709
RegQueryValueExW(
26792710
hKey,

ExplorerPatcher/settings.reg

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
"IncludeWallpaper"=dword:00000001
167167
;b Always show on primary monitor
168168
"PrimaryOnly"=dword:00000000
169-
;b Show windows only on current monitor
169+
;b Show windows only from current monitor
170170
"PerMonitor"=dword:00000000
171171
;c 3 Theme
172172
;x 2 Mica (default)
@@ -285,6 +285,8 @@
285285
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ExplorerPatcher]
286286
;b Enable console *
287287
"AllocConsole"=dword:00000000
288+
;b Dump memory leaks
289+
"Memcheck"=dword:00000000
288290
;c 12 Supplimentary delay at logon *
289291
;x 0 None (default)
290292
;x 300 300 ms

ExplorerPatcher/utility.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -423,16 +423,16 @@ void* ReadFromFile(wchar_t* wszFileName, DWORD* dwSize)
423423
HANDLE hImage = CreateFileW(wszFileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
424424
if (hImage)
425425
{
426-
DWORD dwFileSize;
426+
LARGE_INTEGER dwFileSize;
427427
GetFileSizeEx(hImage, &dwFileSize);
428-
if (dwFileSize)
428+
if (dwFileSize.LowPart)
429429
{
430-
void* pImage = malloc(dwFileSize);
430+
void* pImage = malloc(dwFileSize.LowPart);
431431
if (pImage)
432432
{
433433
DWORD dwNumberOfBytesRead = 0;
434-
ReadFile(hImage, pImage, dwFileSize, &dwNumberOfBytesRead, NULL);
435-
if (dwFileSize == dwNumberOfBytesRead)
434+
ReadFile(hImage, pImage, dwFileSize.LowPart, &dwNumberOfBytesRead, NULL);
435+
if (dwFileSize.LowPart == dwNumberOfBytesRead)
436436
{
437437
ok = pImage;
438438
*dwSize = dwNumberOfBytesRead;

0 commit comments

Comments
 (0)