3 ms·
um/winuser.h has some, although they haven't changed in awhile. WNDCLASSEX gained hIconSm after Windows 3.x. MENUITEMINFO gained hbmpItem in Windows 2000. NO
by MaulingMonkey 5y ago
um/winuser.h has some, although they haven't changed in awhile. WNDCLASSEX gained hIconSm after Windows 3.x. MENUITEMINFO gained hbmpItem in Windows 2000. NONCLIENTMETRICS gained iPaddedBorderWidth in Windows Vista.
https://devblogs.microsoft.com/oldnewthing/20031212-00/?p=41523 https://devblogs.microsoft.com/oldnewthing/20031212-00/?p=41...
um/webauthn.h has a bunch of structures that explicitly document fields added in various dwVersion s. However, no individual structure has changed since being published in the Windows SDK last I checked. e.g.:
//
// The following fields have been added in WEBAUTHN_AUTHENTICATOR_MAKE_CREDENTIAL_OPTIONS_VERSION_2
//
// Cancellation Id - Optional - See WebAuthNGetCancellationId
GUID *pCancellationId;
um/wincrypt.h also has a few structures chopped up with #ifdef ..._HAS_EXTRA_FIELDS s that are presumably differentaited between via cbSize.
um/ShlObj_core.h has COMPONENT, which extends and is differentiated from IE4COMPONENT - presumably by dwSize.
It also wouldn't suprise me if cbSize is also used to differentiate between 32-bit and 64-bit versions of the same structure as well, with WoW64 blindly forwarding said structures.
- orra 5y agoThanks to you, and everybody else, for the examples. I find it interesting upgrading the SDK could make your code invalid, due to uninitialized struct members. Compiler warnings can catch that sort of thing, thankfully—at least these days.
- MaulingMonkey 5y agoThere's a reason examples tend to use ZeroMemory or other mechanism for zero-initializing the entire struct ;) There are other subtle edge cases as well - like needing to make sure all code (including third party libs) is built with the same defines and settings if they might share said structs without painstaking checking cbSize & never passing by value. (Even that might not be enough when statically linking, as it's an ODR violation - and thus undefined behavior - to mix and match different definitions of the same struct...)