Thursday, December 29, 2005

Take a peek into the Microsoft Source Code

Today, I did something illegal. I took and recieved the source code to the 'Solitare' game in Microsoft Windows. Now, it won't compile (missing headers), but I can tell you that there is more than meets the eye.

For example, there is 2 different '3 of spades' images in the bmp/ directory. The second design was obviously never used (does the fact the Microsoft named it 'foo.dib' have anything to do with it?)

I have come forward to comment on this blunder.

Let's take a look in cards.c, ok...

While there isn't anything really intresting in the code (although this seems to be the basis of CARDS.DLL), there is this one function which seems a bit odd:

void SaveCorners(HDC hdc, LONG FAR *rgRGB, INT x, INT y, INT dx, INT dy)
{
if(dx != dxCard || dy != dyCard)
return;

/* Upper Left */
rgRGB[0] = GetPixel(hdc, x, y);
rgRGB[1] = GetPixel(hdc, x+1, y);
rgRGB[2] = GetPixel(hdc, x, y+1);

/* Upper Right */
x += dx -1;
rgRGB[3] = GetPixel(hdc, x, y);
rgRGB[4] = GetPixel(hdc, x-1, y);
rgRGB[5] = GetPixel(hdc, x, y+1);

/* Lower Right */
y += dy-1;
rgRGB[6] = GetPixel(hdc, x, y);
rgRGB[7] = GetPixel(hdc, x, y-1);
rgRGB[8] = GetPixel(hdc, x-1, y);

/* Lower Left */
x -= dx-1;
rgRGB[9] = GetPixel(hdc, x, y);
rgRGB[10] = GetPixel(hdc, x+1, y);
rgRGB[11] = GetPixel(hdc, x, y-1);

}

Now, if you are a programmer, you can obvioulsy tell that Microsoft does shit the same as everybody else. They ain't God, they ain't special. Their shit stinks too.

Here's a better one:

BOOL APIENTRY cdtDraw(HDC hdc, INT x, INT y, INT cd, INT mode, DWORD rgbBgnd)
/*
* Parameters:
* hdc HDC to window to draw cards on
* x, y Where you'd like them
* cd Card to be drawn
* mode Way you want it drawn
*
* Returns:
* True if card successfully drawn, False otherwise
*/
{
return cdtDrawExt(hdc, x, y, dxCard, dyCard, cd, mode, rgbBgnd);
}

The irony of this is that Microsoft has to write one completely pointless function to save programmers a few keystrokes down the line... jeesh no wonder they're bloated! pointless functions for pointless code!

Here's another bloated fnction we could have lived without:

VOID MyDeleteHbm(HBITMAP hbm)
{
if(hbm != NULL)
DeleteObject(hbm);
}

If the Microsoft programmers actually took tiem to go through their code, this would not be nessessrary. Damn Microsoft idiots!

That is my view.

Wednesday, December 28, 2005

Roland Bouman's blog: Linux for Human Beings - AND Roland too!

Roland Bouman's blog: Linux for Human Beings - AND Roland too!

Microsoft Sucks!

Microsoft is possibly THE shittiest company around.

I have recently tried installing their operating system, Microsoft Windows 2000. The first two times, it failed to put the bootloader anyplace useful. After the third time, it was up and running. Now, I have to make a comment on it here: People bitch and while like little girls cause Linux doesn't automatically come with a magical driver for their video card and hey get VGA mode. Guess what? Neither does Microsoft Windows! It booted right into a 640x480 mode with just 16 colors! hell, it even did this when I upgraded my mom's machine to 2000! People say that "Windows is great cause it comes with al the drivers." Wrong people. Windows DOES NOT come with all of the drivers. Your OEM and computer retailer installed them for you. I didn't even have sound or a Ethernet card after the install. Luckly I had prepared for this by downloading the drivers and saving them to my FreeDOS partition (Windows is D:, FreeDOS is C:). Once I had a argument on a private IRC network with a person named Joe Everett. He made the argument that Linux drivers SUCK. Well, let's contrast and compare: If you install a new graphics driver in Windows, you have to reboot THE ENTIRE OPERATING SYSTEM. In Linux, it's as simple as restating X11. Usually restating X11 takes about 15 seconds, maybe more if you use KDE or GNOME. I use Fluxbox so it takes me a whole 10 seconds. I would rather wait 10 seconds to restart X than 10 minutes to restart Microsoft bloatware.

Joe also made the argument that Linux is completely unsupported by ISVs and any companies. He also made the argument that there is NO (as in 0, zero) commercially produced programs for Linux. This is laughable as I am using Opera right now *ON LINUX*. Opera is made by a company. It is NOT open source. And for ISVs? I guess he doesn't consider Intel, or IBM, or even Red Hat, Inc. to be ISVs. Even Google, which has almost the highest stock price (at over $420 (NOT A TYPO!) a share, Microsoft is just $35/share) has produced Linux software. Google themselves run on nothing but Linux. If Linux is such SHIT like everyone claims it is, why does Google have a stock price which is one of the highest on the ENTIRE FACE OF THE PLANET??? If Microsoft even hopes to exist in the future, Bill Gates better learn to suck a lot of dick at the Google Campus.

But I digress, and really need to get back on topic. After installing Windows, rebooting, upgrading, rebooting again, etc. I decided I wanted to play a game. Well, that game didn't work too well with DirectX, so I had to use software rendering, which isn't bad cause the game doesn't do much 3D anyways. I wanted to play StarCraft, another game, and I had to edit the hell out of the registry for it to work. I cannot find a decent graphical debugger, there isn't even a decent development system! Windows is full of incompatabilities. I say, just delete it and use Linux.

That is my view.