Crowbarring Windows 95 into Windows NT with CAPITALS • The Register
Posted by jpluimers on 2026/02/04
Via [Wayback/Archive] Crowbarring Windows 95 into Windows NT with CAPITALS • The Register refers a nice trick that I have used in various case-codebases as well.
On case sensitive environments the casing method is easy no matter if you use macros or just regular identifiers.
On case insensitive environments, prepending or appending soemthing like an underscore (_) works just as well.
The trick referred to is in a section of [Wayback/Archive] How did the Windows 95 user interface code get brought to the Windows NT code base? – The Old New Thing:
Protecting the changes was done in a variety of ways.
One was to enclose all the new code inside
#ifdef WINNTdirectives so that they weren’t compiled by Windows 95, or#ifdef…#else…#endifblocks if the Windows NT version had to diverge from the Windows 95 version. Another was to use macros and typedefs likeTCHARandLPCTSTRso that the same code could compile both as Windows 95 and Windows NT, but using different base characters.In the case of
sizeofdirectives, a change fromsizeof(stringBuffer)tosizeof(stringBuffer) / sizeof(stringBuffer[0])has no effect on Windows 95 because thesizeof(stringBuffer[0])is 1, and dividing by 1 has no effect, so that change could be left without protection. But the Windows NT team had another problem: How would they know whether a particularsizeofwas one that had already been vetted for Windows NT compatibility, as opposed to one that came from fresh code changes to Windows 95 that need to be inspected? Their solution was to define a synonym macro#define SIZEOF sizeofWhen the Windows NT team verified that a
sizeofwas correct, or when they fixed it to be correct, they changed thesizeoftoSIZEOF. That way, they could search the code for lowercasesizeofto see what still had yet to be inspected. (The Windows 95 team were told to continue usingsizeofin new code, so as not to mess up this convention.)
--jeroen






Attila Kovacs said
Hey Jeroen, I just wanted to say hi! I was happy to see there are new posts!