Microsoft Windows 1.0 Development Release #5 research thread

Discuss MS-DOS, Windows 1, 2 and 3.
Overdoze
User avatar
FTP Access
Posts: 1711
Joined: Mon Feb 24, 2014 10:28 am
Location: Slovenia

Re: Microsoft Windows 1.0 Development Release #5 research th

Post by Overdoze »

I've updated the ICO converter so you can now convert modern icons to the old format, provided that you stick to the limitations of the latter.
All roads lead to Neptune™

KRNL386 - my site about retro computing | My site about Windows 1.0 | My blog | 86Box Manager | LeakDB - list of PC OS warez leaks

ComputerHunter
FTP Access
Posts: 669
Joined: Sat Oct 20, 2018 11:37 am

Re: Microsoft Windows 1.0 Development Release #5 research th

Post by ComputerHunter »

Sometimes the icon converter works but most of the times it doesn't.

I made an icon out of a 1 bit 64x64 black&white PNG and converted using the converter but the result is completely different from the original icon.

I am sure my icon has only one 64x64 monochrome image and it meets all the criteria but it doesn't work. Maybe there are other limitations for the new icon format that we don't know yet.

Overdoze
User avatar
FTP Access
Posts: 1711
Joined: Mon Feb 24, 2014 10:28 am
Location: Slovenia

Re: Microsoft Windows 1.0 Development Release #5 research th

Post by Overdoze »

Forgot to mention you can't use PNGs, only BMPs for now.
All roads lead to Neptune™

KRNL386 - my site about retro computing | My site about Windows 1.0 | My blog | 86Box Manager | LeakDB - list of PC OS warez leaks

ComputerHunter
FTP Access
Posts: 669
Joined: Sat Oct 20, 2018 11:37 am

Re: Microsoft Windows 1.0 Development Release #5 research th

Post by ComputerHunter »

New findings!

I tried to launch as many instances of Calculator as possible and see what I can find. After launching 17 instances, the taskbar became twice as high.
Image

Afterwards, I tried to launch more Calculators and after launching 36 times, the taskbar became 3 times the height of a normal taskbar.
Image

After launching it 60 times, only 50 windows are shown and the one of the window title became Button! I can see glitches then it was not responding and eventually crashed.
Image

Overdoze
User avatar
FTP Access
Posts: 1711
Joined: Mon Feb 24, 2014 10:28 am
Location: Slovenia

Re: Microsoft Windows 1.0 Development Release #5 research th

Post by Overdoze »

The icon area growing is standard behaviour in all builds. The more windows you open, the more icons you can create by minimizing them, so the icon area grows in size in order to accomodate all potential icons if you would minimize all windows.
All roads lead to Neptune™

KRNL386 - my site about retro computing | My site about Windows 1.0 | My blog | 86Box Manager | LeakDB - list of PC OS warez leaks

ComputerHunter
FTP Access
Posts: 669
Joined: Sat Oct 20, 2018 11:37 am

Re: Microsoft Windows 1.0 Development Release #5 research th

Post by ComputerHunter »

I was looking at Vetusware's DR5 download page and according to johnk624's comment:
johnk624 wrote:Have been looking for this FOREVER! I was working for a distributor of PC's when this came out, and all us salespeople got a copy, in 8 floppy's. Thanks so much for this :)
There are 8 floppies distributed to salespeople!

I know this is not something exciting but wonder what the other floppies could be.

Overdoze
User avatar
FTP Access
Posts: 1711
Joined: Mon Feb 24, 2014 10:28 am
Location: Slovenia

Re: Microsoft Windows 1.0 Development Release #5 research th

Post by Overdoze »

A stranger said it on the internet so it must be true.

Considering he didn't mention the format of the disks in question, there's really only two options to consider: either 180 kB or 360 kB. Microsoft didn't use 180 kB disks much after DOS 2.0 came out in early 1983 I believe, so DR5 on such disks seems very unlikely, unless it was for some specific OEM machine that only supported such disks. Windows could only run on DOS 2.0 anyway, which supported 360 kB disks, as did the original 5150 disk drives. So there was very little reason to use 180 kB disks.

On the other hand, eight 360 kB disks is a lot for Windows 1.0. The entire final 1.01 SDK comes on that many disks (minus the four runtime disks for Windows itself), and that includes some limited digital documentation, code samples, demo apps, and Windows-specific development tools. DR5 is very feature-limited compared to that, so I really don't see what they could fill those five additional disks with. Code samples and tools are already on the three disks we have, and digital documentation was very limited back in the day, because paper copies were cheaper to mass produce and easier to use.

Perhaps if you included the C compiler, assembler, and debugger you'd fill the disks, but I also doubt Microsoft just gave those away for free with a beta. More likely than not it was expected for software developers to already own those products anyway. Which brings me to another point, that is what would sales people do with this exactly? It's not some fancy demo they could tout to customers, it's quite clearly oriented towards software developers who wish to get familiar with application development for Windows. But I don't know Microsoft's distribution practices from back then all that well, so I won't completely rule out this possibility either.
All roads lead to Neptune™

KRNL386 - my site about retro computing | My site about Windows 1.0 | My blog | 86Box Manager | LeakDB - list of PC OS warez leaks

Jerry056
Posts: 6
Joined: Fri Feb 15, 2019 10:36 am

Re: Microsoft Windows 1.0 Development Release #5 research th

Post by Jerry056 »

Has anyone tried to put the trash icon on DR5? I can't seem to get it working using the icon converter.
johnlemon647, can you send me your Windows Hello program? I can't make it myself and trying to change icon using Resource Hacker doesn't work. I really want to see the trash icon in action.

Can somebody please kindly put up the disassembled code of DR5? I can't get the loader to work in IDA. Thanks.

johnlemon647
Posts: 250
Joined: Mon Feb 23, 2015 5:52 pm
Location: State of Georgia USA
Contact:

Re: Microsoft Windows 1.0 Development Release #5 research th

Post by johnlemon647 »

@Jerry I will send you the files now i got find it.

Overdoze
User avatar
FTP Access
Posts: 1711
Joined: Mon Feb 24, 2014 10:28 am
Location: Slovenia

Re: Microsoft Windows 1.0 Development Release #5 research th

Post by Overdoze »

Jerry056 wrote:Has anyone tried to put the trash icon on DR5? I can't seem to get it working using the icon converter.
johnlemon647, can you send me your Windows Hello program? I can't make it myself and trying to change icon using Resource Hacker doesn't work. I really want to see the trash icon in action.

Can somebody please kindly put up the disassembled code of DR5? I can't get the loader to work in IDA. Thanks.
If you tell me what exactly is the problem with conversion, I can try to help.

As far as the loader goes, put the Python file into the loaders folder where IDA is installed. Then when you try do disassemble a DR5 EXE you should get the option to use the DR5 loader.
All roads lead to Neptune™

KRNL386 - my site about retro computing | My site about Windows 1.0 | My blog | 86Box Manager | LeakDB - list of PC OS warez leaks

ComputerHunter
FTP Access
Posts: 669
Joined: Sat Oct 20, 2018 11:37 am

Re: Microsoft Windows 1.0 Development Release #5 research th

Post by ComputerHunter »

Use IDA Pro, make sure you have Python installed. Here are those anyway: https://mega.nz/#!pAUwBSKQ!5TxyYj9SwX1v ... qQOAMyosFM

How the icon look in DR5:
Image

Jerry056
Posts: 6
Joined: Fri Feb 15, 2019 10:36 am

Re: Microsoft Windows 1.0 Development Release #5 research th

Post by Jerry056 »

Actually I am wondering is it is possible to edit resources in DR5. I know resource hacker for 32 and 64 bit executables and resource workshop for Windows 3.0+ 16 bit Windows executables but there is no app to modify DR5 to Windows 2.x resources.

johnlemon647, PM me once you find them please. How did you write a program in Windows 1.x?

Overdoze, I edited the trash icon and when I put it unto your program its output in DR5 looks completely different and random.

ComputerHunter, thanks for your files. I looked and the strings are sometimes hard to find as each character is on a different line. Do you mind making a string table for me? I only need msdos.exe, windows.exe, gdi.exe and kernel.exe.

ComputerHunter
FTP Access
Posts: 669
Joined: Sat Oct 20, 2018 11:37 am

Re: Microsoft Windows 1.0 Development Release #5 research th

Post by ComputerHunter »

If you look at the last few strings, they are completely random and I have no idea why. You can actually find some unused strings in my string table below.

KERNEL.EXE: https://pastebin.com/N2T7ceSr
WINDOWS.EXE: https://pastebin.com/bjsFmY2d
GDI.EXE: https://pastebin.com/zXNZdU70
MSDOS.EXE: https://pastebin.com/Jqqw3jDw

Overdoze
User avatar
FTP Access
Posts: 1711
Joined: Mon Feb 24, 2014 10:28 am
Location: Slovenia

Re: Microsoft Windows 1.0 Development Release #5 research th

Post by Overdoze »

Jerry056 wrote:Overdoze, I edited the trash icon and when I put it unto your program its output in DR5 looks completely different and random.
I hope you read about the limitations of the old icon format in the readme on github. Aside from this, I wouldn't mind if you provided this particular icon so I can test things.
All roads lead to Neptune™

KRNL386 - my site about retro computing | My site about Windows 1.0 | My blog | 86Box Manager | LeakDB - list of PC OS warez leaks

jagotu
User avatar
FTP Access
Posts: 517
Joined: Mon Feb 04, 2013 5:03 pm
Location: Czechia
Contact:

Re: Microsoft Windows 1.0 Development Release #5 research th

Post by jagotu »

Jerry056 wrote:ComputerHunter, thanks for your files. I looked and the strings are sometimes hard to find as each character is on a different line. Do you mind making a string table for me? I only need msdos.exe, windows.exe, gdi.exe and kernel.exe.
It will not give you any more strings than just running GNU strings would.
Windows TEN - Totally Erroneous Numbering
Always watching you...

johnlemon647
Posts: 250
Joined: Mon Feb 23, 2015 5:52 pm
Location: State of Georgia USA
Contact:

Re: Microsoft Windows 1.0 Development Release #5 research th

Post by johnlemon647 »

@Jerry056 I put TRASH.ICO in Windows 1.01 SDK Hello World Program, i replace old Hello World Program Icon with TRASH.ICO renamed to HELLO.ICO. Now i lost the Hello World Program with TRASH.ICO file.

ComputerHunter
FTP Access
Posts: 669
Joined: Sat Oct 20, 2018 11:37 am

Re: Microsoft Windows 1.0 Development Release #5 research th

Post by ComputerHunter »

I am not sure if anybody is aware of the %1 %2 %3 in MSWIN.BAT. I wonder what they mean...
My explanation would be KERNEL.EXE support 3 arguments (passed on from MSWIN.BAT).

I tested my hypothesis with the command

Code: Select all

MSWIN CLOCK
and it opened Clock after booting into Windows. I then tested with 2 more arguments but it only open the first app. Same goes for 2 arguments...

I am not sure if anybody else know this but are there anything else ready to be discovered?

Edit: It look like all apps except for CLIP and CONTROL works. If two were used, it will open them like this:
Image

Note the height of the two windows. Only MSDOS can get snapped like this and by having 3 MSDOSs, two will open and the other one will be minimized.

Image

You can also have

Code: Select all

KERNEL MSDOS MSDOS MSDOS MSDOS
and that will open 3 MS-DOS Executive windows and the last one will be minimized.

Having 20 MSDOSs will give you:
Image

johnlemon647
Posts: 250
Joined: Mon Feb 23, 2015 5:52 pm
Location: State of Georgia USA
Contact:

Re: Microsoft Windows 1.0 Development Release #5 research th

Post by johnlemon647 »

I wish we know these make application for Windows 1.0 Pre-DR5 but make Pre-DR5 application for Windows 1.0 DR5.

ComputerHunter
FTP Access
Posts: 669
Joined: Sat Oct 20, 2018 11:37 am

Re: Microsoft Windows 1.0 Development Release #5 research thread

Post by ComputerHunter »

Sorry for the bump...

Everyone already know what the "Windows is about to crash" message looks like and how reproduce it with PostError but what you have seen on BetaWiki might not be the actual crash message. Below is the picture on BetaWiki.

Image

While it does look similar, the actual message is created by PostMessage, not PostError. While it is almost impossible to trigger the message, a simple patch enables us to see what the real message looks like:

Image

The easiest way to achieve this is to patch MS-DOS Executive to display the crash message instead of the end session message. Another way would be to patch the end session message to jump to the crash message. Since we don't want the message to display every time we want to exit Windows and we rarely use Menu → Special → End Session, it is a better idea to just patch that. Once that is patched, we can rename it to Crash Exit and closing MS-DOS Executive will still bring up the normal end session message while Menu → Special → Crash Exit brings up the crash message. One down side is once that is clicked, there is no way to cancel so your only option is to click on OK which ends your Windows session as intended.

Image

This is probably not the best patch but it works at the very least. Download here: https://mega.nz/file/td1BgJDZ#ZeM1PxiXJ ... fnqYNsYZKo
Offtopic Comment
Windows 1.0 Alpha Release did improve a lot, even the crash message got upgraded to an error!

Image

https://mega.nz/file/RF8X1bYL#mhbbWos98 ... 0XbF6NUY6Y

Ohh no... my computer is crashing!!! No worries, just cancel the crash by clicking on "Cancel"!

jb881122
FTP Access
Posts: 16
Joined: Sat May 09, 2020 5:57 am

Re: Microsoft Windows 1.0 Development Release #5 research thread

Post by jb881122 »

Offtopic Comment
I made the same patch to Beta Release's MSDOS.EXE:
https://mega.nz/file/yI5A3AoS#YDheA2-rt ... 9fgz5ATTAU

Image

EDIT: You will never see the crash message in Beta Release without patching it, as nothing calls the function that displays it (neither does Preliminary Version 0.5). That code and the "Windows is about to crash" string were removed completely between Beta Release and Premiere Edition.

ComputerHunter
FTP Access
Posts: 669
Joined: Sat Oct 20, 2018 11:37 am

Re: Microsoft Windows 1.0 Development Release #5 research thread

Post by ComputerHunter »

The details of DR5's CONFIG.BIN

For sure some people here knows about CONFIG.BIN and its functionalities but I would say the majority of you have no idea about what it does other than being used by WINDOWS.EXE. I don't think CONFIG.BIN was ever documented by Microsoft so I decided to reverse the format to see what it does. People who have developed display drivers for Windows 1.x should all know the 2 OEMBIN resources in DISPLAY.EXE (CONFIG and FONTS) and CONFIG.BIN functions similarly to those 2 resources. The key differences between the OEMBIN resources and CONFIG.BIN are:
  1. It does not configure icon/cursor compression factor
  2. It does not configure default colors
  3. Bitmaps later stored in DISPLAY.EXE are stored in CONFIG.BIN
It appears to be different to those .RES files I have just reversed not long ago and all fields in the header are hard coded. There are 12 2-byte fields in the header (making it 24-bytes long) and each contains an offset. The first offset points to the font configuration file and others points to various bitmaps while I am unsure about the last one.

So what can you do with CONFIG.BIN? Well you can customize fonts and bitmaps...

Bold font:
Image

Large font:
Image

Large Greek font:
Image

Large italicized underlined strikethrough font:
Image

Regular italicized Greek font:
Image

No title mode by removing the close and size buttons:
Image

No vertical scroll bar by removing the up and down arrows:
Image

No horizontal scroll bar by removing the left and right arrows:
Image

System font can be customized in lots of ways and there are more combinations that you can try yourselves. The large font looks better on high resolution display adapters but the icon area appears to be vertically squashed for some reason. It is also worth mentioning that the first 2 bitmaps appears to be unused and could possibly be leftovers from previous builds that had the status bar:
Image

I did publish this on Discord yesterday but I wasn't able to figure out the font weight part so maybe someone else can. Just use 00h for bold, 08h for regular and FFh for large bold. I have absolute no idea about the last 2 bytes so I am leaving it to those who are more experienced than me.

Code: Select all

Name             Offset   Description
-------------------------------------
CfgFonts         00h-01h  The offset of fntConfig
BmpMenu          02h-03h  The offset of MENU.BMP
BmpHelp          04h-05h  The offset of HELP.BMP
BmpClose         06h-07h  The offset of CLOSE.BMP
BmpSize          08h-09h  The offset of SIZE.BMP
BmpUpAreow       0Ah-0Bh  The offset of UPARROW.BMP
BmpDnArrow       0Ch-0Dh  The offset of DNARROW.BMP
BmpRgArrow       0Eh-0Fh  The offset of RGARROW.BMP
BmpLfArrow       10h-11h  The offset of LFARROW.BMP
BmpBtSize        12h-13h  The offset of BTSIZE.BMP
BmpCheck         14h-15h  The offset of CHECK.BMP
Unk0001          16h-17h  The offset of Unk0001 (2 bytes, 02h 04h)

fntConfig                
  fntWeight      18h-19h  Bold (0000h), Normal (0001h-000Ah), Large bold (0010h-7FFFh)  <-- this is wrong but sometimes gives the desired result
  Unk0002        1Ah-21h  Unknown (maybe fntOrientation, fntEscapement, fntHeight and fntWidth)
  fntItalic      22h-22h  Regular (00h), Italic (01h-FFh)
  fntUnderline   23h-23h  Regular (00h), Underline (01h-FFh)
  fntStrike      24h-24h  Regular (00h), Strikethrough (01h-FFh)
  fntCharSet     25h-25h  English (00h), Greek (01h-FFh)
  Unk0003        26h-26h  Unknown (maybe fntOutPrecision)
  Unk0004        27h-27h  Unknown (maybe fntClipPrecision)
  Unk0005        28h-28h  Unknown (maybe fntQuality)
  fntForceEng    29h-2Ah  English (01h), otherwise use 25h  <-- probably something else but assume it forces the font to use English characters
Offtopic Comment
Of course Alpha Release can be customized as well with more options (yes, font size) but the format appears to be slightly more complex and still no default color support. I don't think I still have any motivation left for documenting Alpha Release's configuration files so I'll leave that to you.
Image

xelloss
User avatar
Donator
Posts: 323
Joined: Sun Aug 18, 2013 7:26 pm
Location: Edinburgh, Scotland

Re: Microsoft Windows 1.0 Development Release #5 research thread

Post by xelloss »

I conjectured that the status bar at the top of the screen seen in previous DR builds of Windows could be the caption bar of the "root window" (also called the "desktop window", i.e. the window that occupies the whole screen and is parent to all of the other windows) and started a disassembly effort of WINDOWS.EXE (the UI component of Windows DR5, which would later become USER.EXE) to see if DR5 still has any code for the Windows status bar, perhaps allowing us to enable it by patching the binary.

This effort didn't quite meet its goal, as my current understanding is that DR5 doesn't even have a desktop window in the same sense as it is currently understood (this may be true of all of the Windows 1.0x releases, and probably changed in Windows 2.0). However, by disassembling WINDOWS.EXE, I got a better understanding of the window creation API in DR5 and I can share some info about it with you.

For starters, many of you will already know that DR5 windows work a bit differently from later builds. One difference is that, when registering a window class, you don't provide a single window procedure, but as many as ten, because Windows will invoke a different callback for window creation, painting, resizing, etc. This is all reasonably well known, but more may come when (if) I start disassembling RegisterClass...

Another difference is that while in later releases there is a single CreateWindow API that is used to construct pretty much every graphical object that can be displayed on the screen, DR5 provides the following:

CreateWindow: to create a TILED window, which normally shares the screen with the other tiled windows and the icon bar at the bottom of the screen but never overlaps with them; it can also be maximized (zoomed) to occupy the whole screen or minimized to an icon in the icon bar.

CreatePopup: to create a POPUP window, which can overlap any other window (including tileds), can potentially be resized by the user (untested on DR5 as of now), but I believe that it can't be maximized or minimized.

CreateChild: to create a CHILD window, which is displayed within another window (its parent) and clipped to its client area, and is commonly used to implement window controls or MDI interfaces (although I don't think I have seen any MDI in DR5, so it remains to be seen whether children can display e.g. a caption bar of their own).

These three functions must all internally allocate a WND structure, which is pointed to by a "window handle" HWND, thus they share a significant amount of code which is factorized into a different internal procedure (not accessible as an API) which I call CreateWindowStructure. By merging this function with the other three that call into it, you basically get what is known as CreateWindow in the present day.

I said "three functions", but disassembling the code made it clear that there is an extra function calling into CreateWindowStructure that follows the same pattern as the other three. It's an internal function that is not exposed as an API, and during the whole life of a Windows session it is used to create a single window that it isn't exactly a tiled, popup, or child. We can see a design problem here: the three DR5 window creation functions are too specialized, and they couldn't be used for this special window. I was hoping that this window would be the desktop, and in a certain sense it is, because it's responsible for displaying the icons of minimized windows; however it is not a parent to all of the windows, and it only occupies the bottom of the screen. Let's call this window "icon bar" (though it was probably called "icon window" internally, I want to make it clear that it's not built by CreateWindow) and name its creation function CreateIconBar.

Image


Let me stop here for now. I will follow up with documentation of all these functions, as well as the WND structure as I currently understand it.

jagotu
User avatar
FTP Access
Posts: 517
Joined: Mon Feb 04, 2013 5:03 pm
Location: Czechia
Contact:

Re: Microsoft Windows 1.0 Development Release #5 research thread

Post by jagotu »

@xelloss DR5 has symbol names in WINDOWS.MAP

The function you called CreateWindowStructure (sub_16CF) is "01A7:03CF WINCrtInit", the function you called createiconbar (sub_18CA) is "01A7:05CA WINSysCreate".
Windows TEN - Totally Erroneous Numbering
Always watching you...

xelloss
User avatar
Donator
Posts: 323
Joined: Sun Aug 18, 2013 7:26 pm
Location: Edinburgh, Scotland

Re: Microsoft Windows 1.0 Development Release #5 research thread

Post by xelloss »

jagotu wrote:
Thu Jul 23, 2020 11:40 am
@xelloss DR5 has symbol names in WINDOWS.MAP

The function you called CreateWindowStructure (sub_16CF) is "01A7:03CF WINCrtInit", the function you called createiconbar (sub_18CA) is "01A7:05CA WINSysCreate".
Ah, thanks! Strange names though. I presume the icon bar should then be considered the "system" window, and "WINCrtInit" stands for initialization of the creation of a WIN structure....

jagotu
User avatar
FTP Access
Posts: 517
Joined: Mon Feb 04, 2013 5:03 pm
Location: Czechia
Contact:

Re: Microsoft Windows 1.0 Development Release #5 research thread

Post by jagotu »

xelloss wrote:
Thu Jul 23, 2020 12:41 pm
jagotu wrote:
Thu Jul 23, 2020 11:40 am
@xelloss DR5 has symbol names in WINDOWS.MAP

The function you called CreateWindowStructure (sub_16CF) is "01A7:03CF WINCrtInit", the function you called createiconbar (sub_18CA) is "01A7:05CA WINSysCreate".
Ah, thanks! Strange names though. I presume the icon bar should then be considered the "system" window, and "WINCrtInit" stands for initialization of the creation of a WIN structure....
For easier reversing I added a MAP loader to my dr5_loader repo: https://github.com/jagotu/dr5_loader/bl ... oad_map.py

Use File -> Script file... (Alt+F7)

Image
Windows TEN - Totally Erroneous Numbering
Always watching you...

Post Reply