Ok, I just spent a long day debugging Protel 99 SE (Service Pack 6) in OllyDbg to solve the problem of not being able to load the library files in Windows 7 ("File not recognized").

The library dialog tries to concatenate the filename and path of the selected library file to obtain a full path to the library file that you want to add. But, a call to the windows function SHGetPathFromIDListA corrupts the memory where the filename is stored (it puts a zero where the string starts, which, in the null-terminated string world, means that the string is now suddenly empty). The dialog gets confused and doesn't succeed in opening the file.

The call to SHGetPathFromIDListA does not do anything noteworthy, so I replaced all instructions related to that call with NOP instructions. This solved the problem.

So: get yourself a hex editor (I use "HxD", it's free) and edit the "Client99SE.exe" file. Change all bytes from offset 2690E to 26917 (= a total of 10 bytes that need to be changed) to 90.

A NOP instruction is 90 in hexadecimal, hence the change.

Save the changes, run Protel 99 SE, try loading a library, should work. I will do some more testing and - if necessary - tinkering if there are still more problems.

Thanks, that worked well, but only fixes the library dialog for the PCB editor.

So I followed your same approach and found where to patch for the schematic library dialog as well (I don't understand why the code is duplicated, as the dialogs are pretty much identical, but anyway...)

GuntherVB and bonybrown,
I performed the modifications to Client99SE.exe with a hex editor, and now the libraries are working correctly under Windows 7!

It's clear that there are at least two variations of the .exe file. I have the service pack 6 version, and the patches suggested here do NOT work in the version I have - and apparently the one Gustavo has, either.

Not only that, I spent some time with a hex editor searching for that sequence of bytes in the exe file I have, on the theory that they're at some other offset. No joy - they were not found anywhere in the file.

I "fixed" this problem in XP with a batch file - I have clean versions of Client99SE.INI and ADVPCB99SE.INI, and my batch file deletes the originals (corrupted by protel) then renames the clean ones, then opens Client99SE.exe.

It occassionally crashes when switching between editing libraries and working on projects, but thats not too annoying.

I am running Win7 Professional 64 bit with Protel 99 SP6. I found the bytes given in the two posts by Gunther VB and BonyBrown and made the changes to 0x90 (NOP).

Previously I had moved copies of the actual libraries to the root directory instead of the "Documents" folder, but only in the PCB library. When I loaded the PCB library, everything worked perfectly. But when loaded the Schematic library, I got a message that said no libraries were present.

So I moved copies of the Schematic libraries into the root directory of the DDB. Now it loaded, but it loaded *both* copies and I had two of each Schematic library. I went back and left the ones in the root directory alone but changed the files extension in the "Documents" folder to .LI$. Now when I loaded the Schematic library, everything worked perfectly.

Bottom line:

1) The byte changes to NOP's worked perfectly for me with Protel 99 SP6.

2) The libraries need to be in the root directory of the library DDB and not in the documents folder.