Follow

working on the windows program compatibility team must be hell on earth

cc @OCRbot

why on earth would you do this instead of navigating to C:\ directly aaaaAAAAAA

Another example of a program’s reliance on a bug is a shell extension that
relied on a memory leak in Explorer.

no no no no no no no

relying on a memory leak is the most cursed programming decision ive ever heard of

me, being paid $9/hr to find out why Free Card Games Plus crashes if you're running an odd-numbered build of windows during daylight savings in a language with right-to-left text: i love my job

For example, one
useful shim is known as HeapPadAllocation; it is applied to programs that
have heap buffer overrun bugs. The shim intercepts calls to the
HeapAllocate function and adds a specified amount to the requested size.
That way, when the program overruns a buffer, it merely corrupts the padding
rather than corrupting the next heap block.

windows has code that adds an amount of memory "insulation" to a hardcoded list of shitty programs with buffer overflow errors to ensure that when they corrupt memory, the area they corrupt is unused

i do not envy windows programmers

"it merely corrupts the padding", chen calmly states, as my brain disintegrates into fine sand

it's bad for the windows team, sure, but think about the people working on wine, who have to independently discover these decades old bugs for themselves and intentionally reimplement them to get poorly written programs to work properly

this part of memory is supposed to be corrupted, please fix

can you break function x when program y is running? program y relies heavily on a bug in the windows 3.0 version of function x

q. why does windows do [bizarre action]
a. for compatibility. to answer in more detail, we'll need to discuss a flaw in
:brain1: earlier versions of windows NT
:brain2: pre-NT windows versions
:brain3: MS-DOS before networking support had been added
:brain4: CP/M
:brain5: the discovery of electricity

some random guy in the mid seventies: hey how about we do [seemingly good idea with nasty underlying assumptions]
raymond chen, today: and that's why windows reports that it only has 640k of memory if your locale is set to hebrew and the PID of explorer is a prime number during a leap second

this seems like a good time to drop another reminder that a windows registry file is called a hive because someone on the windows team had a fear of bees and the person developing the registry was being a jerk

devblogs.microsoft.com/oldnewt

adding "give raymond chen a hug and personally apologise to him on behalf of the human race" to my bucket list

OCR Output 

@lynnesbian

=~)
Locating items by blind counting

A PROBLEM was reported on a program that tries to be an Explorer clone
with a tree view on the left-hand side showing the folders in the system and a
content viewer on the right-hand side. In the program's toolbar are buttons
that quickly move you to each of the drives in the system. But when you run
the program under Windows 2000, the buttons take you to random folders
instead of to the root of the corresponding drive. What is happening?

Let's say you clicked on the button that says “Go to the C: drive.” The pro-
gram responds by starting at the Desktop folder, navigating to the first item
under the desktop, which it “knows” is the My Computer icon, then navigat-
ing to the third item under My Computer, which it “knows” is your C: drive.

Except that starting in Windows 2000, the order of the icons on the desk-
top changed. My Documents is the first icon on the desktop, and My
Computer moved to the second position. Now, the program goes to the first
item under the Desktop folder and finds My Documents instead of My
Computer. Undaunted, it continues to the third child under My Documents
and concludes that this is your C: drive.

The fix for this was to add an application compatibility flag that forced the
order of items on the Desktop folder to place My Computer first.

@lynnesbian
Why on Earth would you do any of this instead of smooch Lynne directly! :blobheartcat:

@lynnesbian
I will now smooch the Lynne, right on her heckin' adorable face *smooch!*

OCR Output 

@lynnesbian
Image 1:
brevet aiitts CldaosllICU UCLAaAUDSO LALLY UVELEEPOELE LIC VUILICL SIZ,

Another program tried to read the name of the current screen saver from
the system. ini file, but if the screen saver’s name was more than twelve char-
acters long (i.e., longer than 8.3 format), the buffer overflowed. This is why all
the system screen savers in Windows 95 have short filenames.

Another category of problem is reading past the end of a buffer. A crash in

Image 2:

=)
The strangest way of checking for success

I’M Nor Quire sure what the developers were thinking, but there was a multi-
media title that failed to run because of the way the program checked whether
its calls succeeded: Instead of testing the MMRESULT against MMSYSERR_
NOERROR, it asked the multimedia system to convert the error number to a
readable text string and compared the string against “The specified command
complete successfully.” Well, actually, it only checked whether the first sixteen
characters were “The specified co’—I guess somebody doing a code review
decided to do some performance optimization.

Of course, this technique doesn't work very well if the system changes the
precise wording of its error messages or if the end user is running a non-English
version of Windows.

Image 3:

zB
You're always a day away

AFTER YOU INSTALL one particular program, it becomes impossible to
upgrade to Windows XP. Instead, Windows XP Setup keeps reporting that
existing software is not fully installed and that you have to restart the com-
puter to allow it to finish installing. Yet no matter how many times you restart
the computer, the message never goes away.

The reason for the false report is that the program writes itself into the
RunOnce key. Each time it runs, it re-adds itself to the Runonce key. So it
doesn't really run once; rather, it runs all the time, but one run at a time. Since
the RunOnce key is used for programs to finalize their installation, the contin-
uous presence of an entry in the RunOnce key causes Windows XP Setup to
conclude that it was put there by a Setup application that needs to do“one last
thing” to complete the install.

The solution was to teach Windows XP Setup to ignore this particular
program if it appears in the RunOnce key.

Image 4:
—_—=

=<)
Rolling your own version of standard
system functions

WE RECEIVED REPORTS that a popular software development library was failing
to run on Windows 95. Upon closer inspection, we found the reason: The pro-
gram wanted to look at the system configuration file that was responsible for
Windows device drivers, known as system.ini. Instead of using the
Get PrivateProfilestring function to read strings from that file, the pro-
gram opened the file and parsed it manually. Unfortunately, what the authors of
the program failed to take into account was that Get PrivateProfileString
uses a case-insensitive comparison to locate the section. Their version used a
case-sensitive comparison. The result was that the program failed to locate the
[386Enh] section of the configuration file. The fix was to tweak Windows 95
Setup so that it used exactly the capitalization that the library expected.

Thie wacn't the only nracram to try ite hand at narsing the exrateam in: file

@lynnesbian doesn't ONT cover stuff that's at least as bad, if not worse. i.e. relying on internal functions only exported by ordinal, breaking programs when a new version of whatever lib is released

@lynnesbian or relying on deprecated registry keys from beta dev releases of OSes

@lynnesbian don't forget that program which deleted key ini files if they had any lines longer than 80 chars

@lynnesbian nevermind pointer arithmetic, someone break out the pointer algebra

@lynnesbian loading the old windows 3 memory manager for the bits (of programs that use memory they're not supposed to)

@lynnesbian I highly recommend checking out the new old thing blog

@lynnesbian msdn blogs have saved my ass so many times. Really a shame MS deleted most of them recently

@lynnesbian it is my professional opinion as an electrical engineer that the discovery of electricity was itself a mistake

(i would sign and seal a statement to that effect, but my PE stamp still has my retired name on it)

Show newer
@lynnesbian His latest post ends with "Maybe that’s not something you have to deal with, in which case lucky you" and, oomph

@lynnesbian at this point he could just be making these up and who would ever guess

@lynnesbian it is unfortunate that the last point is actually not a joke, and there was in fact a flaw in the discovery of electricity that makes the workings of modern electronics confusing

@lynnesbian and that for legacy reasons the flaw is not going to be corrected

@ky0ko @lynnesbian Do you mean: electrons actually travel *from* ground *to* positive, though most electronics diagrams have arrows pointing the opposite way?

@lynnesbian This reminds me of an article I read about an AI designing audio software, or something of the sort. It eventually came up with something incredibly efficient, but which couldn't be used on any hardware except the exact chip it had been given, because it was dependent on specific faults and features of that one chip to function.

I wish I could find the article so I know I'm not making it up or remembering it wrong...!

@Lexi @lynnesbian It was my favourite example of the weird things evolutionary algorithms can do, back when it was important for me to have a favourite

@petra @Lexi @lynnesbian nowadays we just talk about how they’re ruining our daily lives

@Lexi @lynnesbian that sounds like the evolvable hardware i briefly worked on as an undergrad, and it was _supposed_ to do that: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.50.9691&rep=rep1&type=pdf

we never trusted the simulators if the actual FPTAs were available, because the GAs would definitely come up with circuits where stuff wasn't hooked up to other stuff but substrate side effects made it work anyway…

@lynnesbian

love 2 think about how the rowhammer vulnerability isn't solveable unless we stop using electricity

@lynnesbian a reminder that clocks in ovens, microwaves and various similar appliances were running slow in Europe recently because the ancient political fight between Serbia and Kosovo means Serbia was unwilling to balance its grid for lack of capacity in Kosovo, which rippled out and caused a Europe-wide minor reduction in AC frequency

and many appliances without computer-powered clocks just count a second for every 50 AC alternations

reuters.com/article/serbia-kos

Sign in to participate in the conversation
Lynnestodon

@lynnesbian@fedi.lynnesbian.space's anti-chud pro-skub instance for funtimes