The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,860 other subscribers

Archive for the ‘Visual Studio C++’ Category

Windows Data Types (BaseTsd.h) – Win32 apps | Microsoft Learn

Posted by jpluimers on 2025/07/22

A while ago, I had to figure out the field sizes for some Windows API functions. In the distance past, the base data types used to be defined in windows.h, but  over the decades that file has been split into various other files as there are far more than just the BOOL, int, UINT, DWORD, HWND, LPARAM and WPARAM data types. Currently the data types are defined in [Wayback/Wayback] Windows Data Types (BaseTsd.h) – Win32 apps | Microsoft Learn.

Note that C++ allows to specify bit field sizes for fields in struct composite data types, so under some circumstances, fields my have a different number of bits than you might expect from their data type.

Via [Wayback/Archive] c++ dword uint size – Google Search.

–jeroen

Posted in C++, Development, Software Development, Visual Studio C++, Windows Development | Leave a Comment »

Q145994: HOWTO: Calculate Dialog Units When Not Using the System Font | KnowledgeBase Archive

Posted by jpluimers on 2025/07/17

It is odd that Microsoft now verifies to an external party because most of the Microsoft KB articles got deleted: [Wayback/Archive] Q145994: HOWTO: Calculate Dialog Units When Not Using the System Font | KnowledgeBase Archive.

Part of them document aspects from Microsoft Foundation Class Library – Wikipedia which is still supported.

Via: [Wayback/Archive] How does the dialog manager calculate the average width of a character? – The Old New Thing:

Read the rest of this entry »

Posted in C++, Development, Software Development, Visual Studio C++, Windows Development | Leave a Comment »

Windows Installer is transactional, but combined with NTFS and installer processes is not fully: do more C:\Config.msi vulnerabilities exist? (plus a truckload of information on Windows SIDs)

Posted by jpluimers on 2025/04/10

Over the last years a few C:\Windows.msi vulnerabilities have been discovered (and fixed), of which some are linked below.

The core is that the Windows Installer tries to be transactional, and NTFS is, but the combination with installer processes isn’t.

That leads into vulnerabilities where you can insert malicious Roll Back Scripts (.rbs files) and Roll Back Files (.rbf files), and I wonder if by now more have been discovered.

So this post is a kind of reminder to myself (:

Oh, and I learned much more about whoami on Windows, as there  whoami /groups shows very detailed SID information. From that, I learned more on the internals of SIDs too!

Read the rest of this entry »

Posted in Blue team, C++, Development, Power User, Red team, Security, Software Development, Visual Studio C++, Windows, Windows Development | Tagged: , , , | Leave a Comment »

Some winget packages that will get you x86 or x64 versions of vcredist140

Posted by jpluimers on 2024/10/15

A while ago I downloaded some internal tooling that required vcredist140.dll (and related DLLs).

From the name you cannot see if that is a 32-bit (x86) or 64-bit (x64) dependency so you often have to trial and error to figure out which one you need.

I adopted some winget package install command-lines with package IDs current at the time of writing this blog post; similar should be available at the time of publication:

Read the rest of this entry »

Posted in .NET, C++, Development, Software Development, Visual Studio 2015, Visual Studio 2017, Visual Studio 2019, Visual Studio 2022, Visual Studio and tools, Visual Studio C++ | Leave a Comment »

NTFS Sparse Files For Programmers

Posted by jpluimers on 2024/09/25

Need to check this out some day: cs.exe compiled from [Wayback] sparse.zip which you can download from [Wayback/Archive] NTFS Sparse Files For Programmers

Read the rest of this entry »

Posted in C, C++, Development, NTFS, Power User, RoboCopy, Software Development, Visual Studio C++, Windows, Windows 10, Windows 11 | Leave a Comment »

ladislav-zezula/FileTest: Source code for File Test – Interactive File System Test Tool

Posted by jpluimers on 2024/08/14

Cool tool to peek around in the Windows File System API and fiddle around uncharted territory: [Wayback/Archive] ladislav-zezula/FileTest: Source code for File Test – Interactive File System Test Tool.

It is written in C++ using Visual Studio and has build-instructions in [Wayback/Archive] FileTest/README.md at master · ladislav-zezula/FileTest.

Via [Wayback/Archive] “create reparse point” “query reparse point” – Google Search (which also found [Wayback/Archive] Free File Utilities – Free download and software reviews – CNET Download [Wayback download]) after reading a tweet thread having these highlights:

Read the rest of this entry »

Posted in C, C++, Development, Polyglot, Software Development, Visual Studio C++, Windows Development | Leave a Comment »

When Microsoft download URLs time out: check if it other IP addresses for the same host do work fine (it might be a regional Microsoft CDN issue)

Posted by jpluimers on 2024/03/28

A while back, early in the Wednesday morning after Patch Tuesday I performed regular updates of all the systems noticing some updates failed because timeouts on the Microsoft download servers.

Note I perform the manual steps on Wednesday as Patch Tuesday as it starts at 10:00 AM PST which is in the evening in Amsterdam. The automated steps are automated and kick in when Microsoft tells the Windows machines to update themselves.

See [Wayback/Archive] Security Update Guide FAQs

Microsoft schedules the release of security updates on “Patch Tuesday,” the second Tuesday of each month at 10:00 AM PST.

Depending on time zone(s) in which the organization operates, IT pros should plan their deployment schedules accordingly. Please note that there are some products that do not follow the Patch Tuesday schedule.

I posted a gist and a Tweet, but didn’t immediately thought of a good resolution so I postponed that until Thursday and found it:

Read the rest of this entry »

Posted in C, C++, Development, Power User, Software Development, Visual Studio and tools, Visual Studio C++, vscode Visual Studio Code, Windows, Windows Development | Leave a Comment »

Chocolatey: vcredist 2005/2008/2010 updates failing as Microsoft rebuilt the installers multiple times causing new hashes each time

Posted by jpluimers on 2021/05/14

The Microsoft rebuilt move affects these Chocolatey Microsoft Visual C++ Redistributable packages, usually multiple times:

You get error messages like this:

ERROR: Checksum for 'C:\Users\saroot\AppData\Local\Temp\chocolatey\vcredist2010\10.0.40219.2\vcredist_x86.exe' did not meet '66B797B3B4F99488F53C2B676610DFE9868984C779536891A8D8F73EE214BC4B' for checksum type 'sha256'. Consider passing the actual checksums through with --checksum --checksum64 once you validate the checksums are appropriate. A less secure option is to pass --ignore-checksums if necessary

The cause is [Archive.is] vcredist-all fails to install due to broken checksum of vcredist2005, vcredist2008 and vcredist2010 · Issue #105 · jberezanski/ChocolateyPackages

jberezanskicommented

Great, Microsoft is apparently on an in-place installer update spree.

Actually, this is not a problem with vcredist-all, but rather with those specific packages and should be reported to maintainers of those packages. It so happens, however, that I’m also one of the maintainers of vcredist2008 and vcredist2010 (which live in https://github.com/chocolatey-community/chocolatey-coreteampackages/tree/master/manual). I’ve already prepared a fix for 2010 and I guess I’ll do 2008 tomorrow.

As for 2005, I can see that it has the same maintainer as vcredist2010 had until very recently – when we took over that package because the maintainer did not respond. So we probably should take over 2005, too.

Progress

The vcredist2010 package has been modified two times for this:

Hopefully the vcredist2008 and vcredist2005 packages will follow soon.

–jeroen

Posted in C++, Chocolatey, Development, Power User, Software Development, Visual Studio C++, Windows | Leave a Comment »

OMF, COFF and the 32-bit/64-bit Delphi or C++ compilers

Posted by jpluimers on 2020/01/29

Via [WayBack] As far as I can tell (and documentation on that is reaaaaaaly hard to find), dcc64 can link in .obj files in OMF and COFF format. Bcc64 uses LLVM chain and therefore produces ELF .o files… – Primož Gabrijelčič – Google+:

David Heffernan:
dcc32 does coff and omf, dcc64 only coff

and later he commented:

One of the difficulties with linking objects is the handling of exceptions. The 64 bit exception model is table based, in contrast to the stack based 32 bit model.

I don’t think that the exception tables are written correctly for code linked in objects. If exceptions are raised then this can lead to abnormal process termination. Process just disappears. Poof!

One common way that this happens is floating point exceptions that are by default unmasked by the Delphi RTL. I have found it necessary to mask them when calling into any linked object code to avoid exceptions being raised.

And compiling with cl can be a bit of a game. It’s stack checking options need to be disabled. And there are a few other key switches that help. And then there’s the forward declaration trick to help the one pass compiler cope with C objects that are expected to be linked in a separate step.

Anyway, it can be quite a challenge at times, but I’ve yet to find a plain self contained C library that has defeated me!

–jeroen

Posted in C++, C++ Builder, Delphi, Delphi x64, Development, Software Development, Visual Studio C++ | 2 Comments »

Links to various Visual C++ Redistributable Packages for Visual Studio downloads (arm/x64/x86 when available)

Posted by jpluimers on 2018/01/17

Link archive so I know how to get the 64-bit ARM, 32-bit Win32/x86 and 64-bit Win64/x64 downloads for the Visual C++ Redistributable files.

Note the various names of pages and files Microsoft uses.

–jeroen

Posted in C++, Development, Software Development, Visual Studio C++ | Leave a Comment »