The random ponderings of a not quite sane, or insane, transwoman. My thoughts on computer programming, justice, politics, and various other topics.
Author: benkey76
I am a self taught software engineer, currently employed by The Paciello Group (TPG), a Vispero™ company. I am very good at what I do and I very much enjoy it. My primary programming language is C++ but I have dabbled in Java, Python, and TCL. Most of the software I have worked on runs only under Microsoft Windows but I have dabbled in programming for GNU/Linux, FreeBSD, Solaris, and Mac OS X. I also have experience in designing accessible applications and websites and accessibility testing.
Many doctor’s offices have moved access to medical records online. For example, my doctor’s office emailed me today to tell me that my COVID-19 test results are available and I should go online to view them.
I need to know for certain what the results are because I have a surgery scheduled for next Monday that I would have to cancel if I have COVID-19. Whoever designed the website seems determined to make it as difficult as possible to obtain test results.
The page is designed so that on the left side of the page there are the following tabs.
Patient Account
Patient Appointments
Documents
Review Medical Record
Message a Provider
Contact Us
So far, so good. The obvious place to search for test results is the Review Medical Record tab and if it is not there, the Documents tab.
So, I clicked on the Review Medical Record and I see it is divided into the following child tabs.
Patient Summary
Allergies
Immunizations
Medical History
Medications
Orders
Problem List
Nothing in that list gives any indication where to find Results.
So, I clicked on the Documents tab. It has one child tab, the Community Resources tab.
Again, no indication where to find Results.
I finally found the Results after I started clicking on every single tab and child tab; there were over 50.
The Results were located in the Orders child tab of the Review Medical Record tab.
If the Orders child tab was named Results I could have found that I do not have COVID-19 in 30 seconds. As it is, it took me 30 minutes!
Just in case you were wondering why the Trump administration ordered hospitals to bypass the Centers for Disease Control and Prevention and send all COVID-19 patient information to a central database in Washington, it was so the they can manipulate the numbers.
They want to deceive us into believing that the United States has the “Lowest Mortality Rate” from COVID-19.
Do not believe his lies; we have the seventh highest mortality rate in the world!
Before you believe bold headlines such as the following, you need to consider the source.
The Media Sabotage of Hydroxychloroquine Use for COVID-19: Doctors Worldwide Protest the Disaster.
Media and Big Pharma are in lockstep to suppress a cheap, life-saving Covid-19 therapy in order to reap pandemic-sized profits
This drivel was published on https://www.globalresearch.ca/ which is “a Canadian conspiracy website” that was founded by Michel Chossudovsky who is currently the President of GlobalResearch and professor emeritus of economics at the University of Ottawa.
Symbols from various world religions. Source: Wikipedia.
I once believed that there are no deities. Then I finally discovered the shocking truth, every deity that has ever been the subject of worship actually exists.
A religion is nothing more or less than a collection of religious texts, a group of priests and priestesses, and a network of places of worship.
These items can be described in non religious terms.
The religious texts are works of philosophy that happen to include tales; some of these tales discuss the history of the philosophy, or at least they claim to discuss the history of the philosophy, and other tales enhance and build upon and explain the philosophy.
The priests and priestesses are teachers that teach the philosophy.
The places of worship are schools that teach the philosophy.
The deity is therefore nothing more or less than the core concept that lies at the heart of the religion.
A religion is not meant to be static. It is meant to be a living, breathing, ever changing organism. It is the duty of all true followers of a religion to try to improve the religion for the betterment of man.
This is what is wrong with Christianity. It is no longer a living, breathing, ever changing organism. It is a putrid corpse.
This article is based on an EMail message I sent to the software development team at Vispero on August 26, 2008. I had just spent hours debugging an odd bug in JAWS®. When focus was in a particular window while JAWS was running I heard constant, rapid fire, beeping. I searched the JAWS source code for calls to the Beep and MessageBeep functions and was not able to determine the cause of the bug. I was at a loss. Then I asked the following question, is there a way I can just set breakpoints in the Beep and MessageBeep functions? This article discusses what I found during my quest for an answer to that question.
I am writing this article now because I encountered this issue again today and just spent five hours retracing my steps.
Note: After I wrote this article I learned that things are much easier in Visual Studio 2017 and Visual Studio 2019. In these versions of Visual Studio all that you need to do is open the “New Function Breakpoint” dialog box using the “Debug/New Breakpoint/Function Breakpoint…” menu item and enter the undecorated name of the function in the dialog box. If you are interested in learning how things used to be, follow me down the rabbit hole.
Falling down the rabbit hole
It turns out that it is possible to set a breakpoint in a Windows API function in Visual Studio. I do not know when this functionality was added to Visual Studio but I do know that it was available in Visual Studio 2005. The question is how.
The Set function breakpoints section of the Use breakpoints in the Visual Studio debugger page provides some relevant information; it provides very limited information on setting a breakpoint on a function with a known name. Simply use the “Debug/New Breakpoint/Function Breakpoint…” menu item to open the “New Function Breakpoint” dialog box and type a magical incantation in the “Function Name” edit.
Unfortunately, the information provided here is infuriating since it reveals that the feature is supported but it does not provide enough information to allow you to actually use the feature. In other words, it does not tell you what magical incantation to use.
This page mentions that you need to use the “decorated form of the function name” and suggests that you refer to the Viewing Decorated Names page for more information. The Viewing Decorated Names page in turn refers you to the Use a listing and Using DUMPBIN to View Decorated Names pages. Unfortunately, it turns out that neither of the techniques mentioned on the Viewing Decorated Names page will allow you to determine the decorated name for a function that is exported from a DLL. The DBH tool is supposed to be able to provide this information via the -d command-line option but in my tests using the following command it only provides undecorated names these days (bad Microsoft!).
Symbol Search Path: srv*C:\SymbolCache*http://msdl.microsoft.com/Download/Symbols
index address name
1 1007760 : CreateWindowExW
Note that this is not the decorated name of the function since there is no @ character.
Unfortunately, I do not know an easy way to determine the “decorated form of the function name” other than to figure it out yourself using the information provided at Using Win32 calling conventions. Most Windows API function use the __stdcall calling convention. The general syntax for the decorated name of a __stdcall function is as follows.
This provides enough information for you to write the part of the magical incantation that comes after the } character, but what about the beginning of the magical incantation? Based on the example provided for the MessageBeep function one could assume that it should simply be the name of the DLL that implements the Windows API function, but is more information available?
Fortunately, the Context Operator in the Visual Studio Debugger (C++) page does provide a more detailed explanation for the first part of the magical incantation. This page reveals part of the syntax for the Context Operator.
{,,[module]} expression
Of course, this very annoyingly leaves a question unanswered. Why does this text between the { character and the } character start with two commas? What are you leaving out?
I have not been able to find official Microsoft documentation that answers that question yet. However, I do have an answer for you from Breaking on System Functions with the Context Operator. This page reveals that the full syntax of the Context Operator is as follows.
{[function],[source],[module]} expression
In most cases you will not need to worry about [function] and , you will only need to worry about the module and the expression.
Thus, the syntax for the magical incantation you will need to set the breakpoint is as follows.
To set a breakpoint in any Windows API function, such as the CreateWindowExW function, do the following.
Look up the Windows API function in the Microsoft documentation. In the Requirements section the DLL the function is implemented in is provided; in this case it is User32.dll.
Determine the size of the function parameters in bytes, as follows.
Parameter
Size in bits on a 32-bit system
Size in bytes on a 32-bit system
Size in bits on a 64-bit system
Size in bytes on a 64-bit system
DWORD dwExStyle
32
4
32
4
LPCWSTR lpClassName
32
4
64
8
LPCWSTR lpWindowName
32
4
64
8
DWORD dwStyle
32
4
32
4
int X
32
4
32
4
int Y
32
4
32
4
int nWidth
32
4
32
4
int nHeight
32
4
32
4
HWND hWndParent
32
4
64
8
HMENU hMenu
32
4
64
8
HINSTANCE hInstance
32
4
64
8
LPVOID lpParam
32
4
64
8
Totals
48
68
Fill in the blanks.
If you are debugging a 32-bit application the magical incantation is as follows.
{,,User32.dll}_CreateWindowExW@48
If you are debugging a 64-bit application the magical incantation is as follows.
{,,User32.dll}_CreateWindowExW@68
Enter the appropriate magical incantation in the “Function Name” edit of the “New Function Breakpoint” dialog box and press the OK button.
Note that in order for this to work you will need to set up Visual Studio to use the Microsoft symbol server. To do this select the “Debug/Options…” menu item to open the Debugging section of the “Options” dialog box. Then select “Debugging/Symbols” in the tree view. Next press tab to move focus to the “Symbol file (.pdb) locations” check list box and check the “Microsoft Symbol Servers” item. Then press the OK button.
Today, the White House sent out an email claiming “President Trump listened to the experts—not the media” today. Evidence suggests that he listened to a single expert who told him exactly what he wanted to hear, that COVID-19 was a non-issue. Specifically he listened to Richard A. Epstein who wrote the paper “Coronavirus Perspective.”
In the first version of this document he claimed that there would be 500 deaths due to COVID-19. A few days later he revised the document saying that he made a mistake and there would be 5,000 deaths. He later revised it again by saying there would be 50,000 deaths.
As of today there have been 80,820 deaths in the United States according to the CDC.
All hail Donald Trump; a.k.a. Donald Drumpf, a.k.a. Lord Dampnut, a.k.a. Dumbnut, a.k.a. Donnie Trumpelstiltskin, a.k.a. Donald tRUMP; our most, or perhaps least, honored (not my) POTUS and our great Bloviator in Chief!
In February Donald Trump made the following comments about COVID-19.
“Looks like by April, you know, in theory, when it gets a little warmer, it miraculously goes away.” (Feb. 10)
“The Coronavirus is very much under control in the USA. … Stock Market starting to look very good to me!” (Feb. 24)
“It’s going to disappear. One day, it’s like a miracle, it will disappear.” (Feb. 27)
At this time the Trump administration and various Republicans were relying on an article titled “Coronavirus Perspective” by Richard A. Epstein. In the first version of this document he claimed that there would be 500 deaths due to COVID-19. A few days later he revised the document saying that he made a mistake and there would be 5,000 deaths. He later revised it again by saying there would be 50,000 deaths.
As of today, there have been 67,456 deaths due to COVID-19 in the United States.
All hail Donald Trump; a.k.a. Donald Drumpf, a.k.a. Lord Dampnut, a.k.a. Dumbnut, a.k.a. Donnie Trumpelstiltskin, a.k.a. Donald tRUMP; our most, or perhaps least, honored (not my) POTUS and our great Bloviator in Chief!
All hail Donald Trump; a.k.a. Donald Drumpf, a.k.a. Lord Dampnut, a.k.a. Dumbnut, a.k.a. Donnie Trumpelstiltskin, a.k.a. Donald tRUMP; our most, or perhaps least, honored (not my) POTUS and our great Bloviator in Chief!
ASCII art image of a skull and crossbones with the text “abandon all hope, all ye who enter here” displayed below the skull and crossbones.
One factor of code quality that does not get enough attention is how easy is it to debug the code. No matter how skilled the team that writes the software, there will be bugs. When these bugs are found some poor soul will need to debug the code to determine the cause of the bug. Unfortunately this can quickly turn into a nightmare because many functions are not debuggable. Sometimes even well designed code is so difficult to debug that it causes the poor soul who has to debug it to abandon all hope.
Non-Debuggable Function
The following function is very simple. At first glance it seems to be a concise and well designed function. However, it is a major contributor to the debugging this application is a nightmare problem.
You may be wondering, how can this innocent, one-line function cause someone to abandon all hope?
When the function works as expected (meaning it returns the value you expect) it cannot. However, when the function returns false when you think it should return true the nightmare begins. The most critical piece of information that might explain why this function is not returning the expected value, the document length, is hidden away within a function call. As a result, there is no way you can look at parameter and variable values in the debugger watch window and know why the function is behaving in the way that it is.
Debuggable Function
The following function does exactly the same thing but it can be debugged in a microsecond.
All you have to do to debug this function is look at the value of the nOffset parameter and the documentLength variable in the watch window and then the reason for the unexpected behavior is immediately obvious.
In the case of today’s nightmare that inspired this article, the problem was that both the nOffset parameter and the documentLength variable happened to be equal to 296.
Additional Comments
I know that some of you are wondering whether I am aware that some debuggers will provide the return value of a function that was just called. The answer is of course I am aware of that. However, as far as I know not all debuggers support this functionality. In addition, this functionality is not as easy to use or as intuitive as the watch variable feature.
To me it just makes sense to make a very small change to make it possible to diagnose problems with the more intuitive and easier to use watch variable feature of the debugger.
On March 6, 2020, President Donald Trump’s top economic adviser, Larry Kudlow, claimed that the coronavirus “is contained” in the United States. There were only 75 confirmed cases in the United States at that time.
Today there are 1,629 confirmed cases.
Now that is what I call contained! The Trump administration is obviously doing an excellent job. We should be grateful that we have such a diligent and hard working POTUS!
All hail Donald Trump; a.k.a. Donald Drumpf, a.k.a. Lord Dampnut, a.k.a. Dumbnut, a.k.a. Donnie Trumpelstiltskin, a.k.a. Donald tRUMP; our most, or perhaps least, honored (not my) POTUS and our great Bloviator in Chief!