I had a conversation on how to debug a Win32/Win64 application, with regards to MaxLoaderThreads, and loader snaps.
First, ensure you have the Windows SDK installed, and that you have cdb.exe and gflags, like this:
To remove MaxLoaderThreads (and hence enable parallel DLL loading), run the following:
reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\bds.exe" /v MaxLoaderThreads /f reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\bds.exe" /v MaxLoaderThreads /f /reg:32
To turn on loader snaps for the application we're debugging (bds.exe). This enables loader snaps for both the 32-bit and 64-bit app.
"C:\Program Files (x86)\Windows Kits\10\Debuggers\x86\gflags.exe" /i bds.exe +sls "C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\gflags.exe" /i bds.exe +sls
To turn off loader snaps for the application we're debugging (bds.exe), use the same command, but with -sls instead. The following disables loader snaps for both the 32-bit and 64-bit app.
"C:\Program Files (x86)\Windows Kits\10\Debuggers\x86\gflags.exe" /i bds.exe -sls "C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\gflags.exe" /i bds.exe -sls
To debug the application we're working on:
"C:\Program Files (x86)\Windows Kits\10\Debuggers\x86\cdb.exe" -g -G -logo C:\temp\snaps-1.log "C:\Program Files (x86)\Embarcadero\Studio\37.0\bin\bds.exe"
To enable parallel DLL loading, by adding MaxLoaderThreads:
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\bds.exe" /v MaxLoaderThreads /t REG_DWORD /d 1 /f reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\bds.exe" /v MaxLoaderThreads /t REG_DWORD /d 1 /f /reg:32
Learn why the map is cool in Go!
A method to design records so that they're allocated on a specific byte boundary, such as 16 bytes, 512 bytes, 4096 bytes, etc.
Learn the command line used to compile System.pas in Delphi
How to free more space on your home drive by redirecting the location for SDKs in RAD Studio