Jump to content

Printing with KernelEx 4.5.1


diamant

Recommended Posts

Thanks for the info Schwups

So sorry that printing no longer works for you. It's strange to me that more files got altered on your system than on mine. I'm not a programmer, so I'll have to wait for some updates to the printing patch. It seems to work well for Sumatra, but I've been unable to get it to work with anything else; Firefox, Softmaker, etc.

Link to comment
Share on other sites


The comdlgex patch corrects a specific problem of some applications requiring a newer, slightly different print dialog than included with W98. The two dialogs are so similar that more or less the data to fill in the dialog fields just needed to be rearranged a bit. The patch fixes the problem of the newer dialog not being recognized on W98 and reformats the data for the old dialog and calls the old dialog instead.

This was the problem with Sumatra, I don't think that FF has that problem, [but I could be wrong], I always get a print dialog from FF even before this patch - unfortunately, I don't get much more than that. But that's all that was fixed here, the dialog not popping up. Programs that call the old W98 dialog don't need this patch and won't benefit from it. Programs that failed to show a print dialog will be helped along by this patch. Before the patch was created, KernelEx would stop the error of the new print dialog function not being found, but it didn't show any dialog. It allowed the application to still load and not crash when Print... was selected but didn' t allow printing to occur. Programs that could put up a print dialog won't be helped by this patch.

If someone with a little more knowledge of this would care to commnet in case I got it wrong....So yeah the title of the thread includes FF, but the solution on here is only for Sumatra afaik. Hope this helps and clears things up a bit. If someone knows of another application that is actually print enabled by this patch ( or you really got it to fix FF) let us know !!

Link to comment
Share on other sites

  • 2 months later...
Could you possibly extend LOADDR to also report the preferred base if different?

Yes. But I think it best to always report the preferred base. It's added to my to-do list.

OK. Here's the new version of LOADDR... It'll detect when the file is a PE file and, if so, provide the preferred load address and the execution and relocation status of the file it's analysing. When the file is not a PE file, however, it'll behave just as the previous version did. AFAIK, only PE files have the preferred load address information.

LOADDRII.7z

Link to comment
Share on other sites

  • 2 months later...

I stupidly had "forgotten" this thread for a long time :blink: , but I can report that the newest(?) COMDLGEX.DLL (from March 25th 2012, 02:32:34) lets appear the print dialog in many SumatraPDF versions :thumbup . That means that now newer SumatraPDF versions are usable :yes: . The print dialog is the same like in SumatraPDF 0.8.1.

The dialog appears not in SumatraPDF versions 1.3 and 1.4.

The dialog appears in SumatraPDF versions 0.9, 1.5, 1.5.1, 1.6, 1.8, 2.1.1.

(I have to mention that I not tested other versions, especially 1.0, 1.1 and 1.2.)

I put the COMDLGEX.DLL into the SumatraPDF program folder and "hacked" the file SumatraPDF.exe with HexEdit by replacing the string COMDLG32.DLL by COMDLGEX.DLL (I hope that this was a useful method?).

It isn't a big problem that those 2 versions (1.3 and 1.4) do not print, because there are enough other versions which could work.

But one small issue I noticed:

It is not possible to use options like e.g.

"print even pages only",

"print odd pages only",

"print pages 2, 5, 7 [or other] only"

and other, which are probably hidden in some advanced features.

I know that the Acrobat Reader 4.0 provided this print features, even in Win98SE. So I suppose that it should theoretically be possible that SumatraPDF provides this options, too. But how?

Link to comment
Share on other sites

>That means that now newer SumatraPDF versions are usable :yes:

2.1.1 work great for me. It's the fastest and best of the line and has become my default PDF viewer. icon12.gif

> The print dialog is the same like in SumatraPDF 0.8.1.

Yes, the visible dialog is still PrintDlg. The data structure is pre- and post- processed to create the PrintDlgEx API.

>The dialog appears in SumatraPDF versions 0.9, 1.5, 1.5.1, 1.6, 1.8, 2.1.1.

Also 1.9. icon13.gif

>I put the COMDLGEX.DLL into the SumatraPDF program folder and "hacked" the file SumatraPDF.exe with HexEdit by replacing the string COMDLG32.DLL by COMDLGEX.DLL (I hope that this was a useful method?).

ImportPatcher could have been used, but two bytes are easy enough to change in a hex editor. Well done. :w00t:

But one small issue I noticed:

It is not possible to use options like e.g.

"print even pages only",

"print odd pages only",

"print pages 2, 5, 7 [or other] only"

and other, which are probably hidden in some advanced features.

I know that the Acrobat Reader 4.0 provided this print features, even in Win98SE. So I suppose that it should theoretically be possible that SumatraPDF provides this options, too. But how?

Write a better dialog box function instead of reusing PrintDlg.

A PrintHookProc could help. Or as a stop-gap measure, I can probably enable the "Selection" radio button: if it's selected upon return of PrintDlg, an additional MessageBox can be displayed that asks if you actually want odds or evens (Yes/No), or the document selection (Cancel). :unsure:

Link to comment
Share on other sites

  • 2 weeks later...

But one small issue I noticed:

It is not possible to use options like e.g.

"print even pages only",

"print odd pages only",

"print pages 2, 5, 7 [or other] only"

and other, which are probably hidden in some advanced features.

Write a better dialog box function instead of reusing PrintDlg.

A PrintHookProc could help. Or as a stop-gap measure, I can probably enable the "Selection" radio button: if it's selected upon return of PrintDlg, an additional MessageBox can be displayed that asks if you actually want odds or evens (Yes/No), or the document selection (Cancel). :unsure:

I opened a the original Win98SE-comdlg32.dll with reshack and discovered the print dialog shown by Sumatrapdf (see attachment comdlg32_98SE.png).

Then I opened a comdlg32.dll from WinXP, found with reshack the same print dialog - and the additional "part" of the print dialog, where I could choose options

"print actual page"

"print pages 2, 5, 7 [or other] only".

See the attached screenshot comdlg32_XP.png (next to the Comdlg32_98S-Screenshot):

post-254155-0-57204600-1347124790_thumb. post-254155-0-99842100-1347124806_thumb.

Some questions for a better understanding:

- Do you think that it would be useful simply to copy the corresponding resource (using reshack) from the XP-comdlg32.dll to the 98SE-comdlg32.dll? (I suppose not.)

- Is it fact that the XP-comdlg32 contains all information about the printdlgex function (or is it not so)? So that it maybe could be possible to "copy" this information anyhow into the 98SE-comdlg32, or into a completely "new" *.dll.

Furthermore I've discovered the advanced print dialog in the sumatrapdf.exe file (with reshack). See attached screenshot SumatraPDF_advanced.png below. So it's a fact that this dialog is a part of SumatraPDF and not of any comdlg32.dll. I suppose that it could be possible to call this dialog in any other way than "wanted" by sumatrapdf.

But I suppose reshack is not enough to realize this (or any of the other ideas)?! :blink:

post-254155-0-01794900-1347124820_thumb.

Link to comment
Share on other sites

2.) Has anybody ever found a solution to solve the printing-problem with Firefox 3 with KernelEx? (Maybe transport the printing-function from Firefox 2.0.0.20 to Firefox 3). Sometimes(!) printing worked with Firefox 3, but it was randomly.

PrintPDF Firefox extension:

Absolute Lifesaver Rated 5 out of 5 stars

by AnotherFred on July 1, 2012 · permalink

Absolute lifesaver. Excellent add-on, does exactly what it says on the tin.

Used with Fx 3.6.28 on Windows 98SE with KernelEx, it overcomes the printing problem and turns an impossible job into a two-step job. On Windows 2000 it produces good quality pdfs every time.

For those who have not yet understood how to use it, either use the menu item under File | Print to PDF ... or customise your Toolbar, and add the icon provided with the extension.

What are the symptoms of the printing problemshelp.png

Link to comment
Share on other sites

2.) Has anybody ever found a solution to solve the printing-problem with Firefox 3 with KernelEx? (Maybe transport the printing-function from Firefox 2.0.0.20 to Firefox 3). Sometimes(!) printing worked with Firefox 3, but it was randomly.

PrintPDF Firefox extension:

Absolute Lifesaver Rated 5 out of 5 stars

by AnotherFred on July 1, 2012 · permalink

Absolute lifesaver. Excellent add-on, does exactly what it says on the tin.

Used with Fx 3.6.28 on Windows 98SE with KernelEx, it overcomes the printing problem and turns an impossible job into a two-step job. On Windows 2000 it produces good quality pdfs every time.

For those who have not yet understood how to use it, either use the menu item under File | Print to PDF ... or customise your Toolbar, and add the icon provided with the extension.

What are the symptoms of the printing problemshelp.png

Hi jumper,

I've recently installed FF 3.5.20pre, partly due to need of Java support on the desktop, partly due to severe performance issues with FF 8 and 9 on my 466MHz Celeron laptop (strange, as FF 8 performed very well on my former 333MHz P2, which had FineSSE 29 installed, in case that's relevant). I first installed FF 3.5.19, then copied the 3.5.20pre files over this.

Initially, any attempt to print would immediately lock-up FF with an hourglass showing.

So I downloaded ComDlgEx from post #27, patched this with Import Patcher so that it called ComDlg00.dll instead of ComDlg32.dll and placed this in the System directory as ComDlg32.dll, having renamed the original as ComDlg00.dll.

Now when I attempt to print, the print dialogue appears (it didn't before), but when I click OK, FF again locks up, this time without an hourglass showing.

Incidentally, other applications including Opera 12.02 continue to print normally. Also note, the version of KernelEx is 4.5.2 and Kstub 822 is also installed.

Joe.

Edit : Corrected reference to post #22, now post #27.

Edited by jds
Link to comment
Share on other sites

>I've recently installed FF 3.5.20pre.... Initially, any attempt to print would immediately lock-up FF with an hourglass showing.

If you had Kstub822 installed, the default definitions would have tried to forward PrintDlgExW to ComDlgKs.dll (from the kstub730 package). If ComDlgKs.dll was missing, the Options message box would have been displayed. Perhaps it popped up under the Firefox window.... There should be a new entry in the log file each time PrintDlgExW is processed--was there one? [note to self: add additional logging of failed forwards in next Kexstubs]


>So I downloaded ComDlgEx from post #22, patched this with Import Patcher so that it called ComDlg00.dll instead of ComDlg32.dll and placed this in the System directory as ComDlg32.dll, having renamed the original as ComDlg00.dll.

Both ComDlgEx and ComDlgEx2 from post #22 already reference ComDlg00.dll. There are no references to ComDlg32.dll. Perhaps you patched ComDlgEx.dll from post #27 instead?

Also, the code for PrintDlgExA and PrintDlgExW in post #22 is obsolete. See posts #27-28 for details. ComDlgEx from post #27 or ComDlgKs from Kstub730 should be used as a starting point for experiments. :yes:


>Now when I attempt to print, the print dialogue appears (it didn't before), but when I click OK, FF again locks up, this time without an hourglass showing.

>

>Incidentally, other applications including Opera 12.02 continue to print normally. Also note, the version of KernelEx is 4.5.2 and Kstub 822 is also installed.

If you could walk FF3 (with dependencies) through IP35, I'd like to see the .ini file (inside a spoiler would be great). Also, check if printing with Opera 12.02 adds anything to the Kexstubs log file--it may not be using PrintDlgEx.

As always, thank you for experimenting and reporting your findings. :thumbup

Link to comment
Share on other sites

Also, the code for PrintDlgExA and PrintDlgExW in post #22 is obsolete. See posts #27-28 for details. ComDlgEx from post #27 or ComDlgKs from Kstub730 should be used as a starting point for experiments. :yes:

Unfortunately I can use only these because with everything that came after that, incl. Kext, I was not able at all to print from SeaMonkey !!!

Link to comment
Share on other sites

>I've recently installed FF 3.5.20pre.... Initially, any attempt to print would immediately lock-up FF with an hourglass showing.

If you had Kstub822 installed, the default definitions would have tried to forward PrintDlgExW to ComDlgKs.dll (from the kstub730 package). If ComDlgKs.dll was missing, the Options message box would have been displayed. Perhaps it popped up under the Firefox window.... There should be a new entry in the log file each time PrintDlgExW is processed--was there one? [note to self: add additional logging of failed forwards in next Kexstubs]

Hi jumper,

I had a look but didn't find 'ComDlgKs.dll'. I had probably uninstalled KernelEx and re-installed it for some reason (I do that sometimes). However, no "Options message box" (I presume that means the "print dialogue"?) had appeared. Neither had there been any new entry added to the KStub822 log file, as far as I could tell.

I added the missing 'ComDlgKs.dll', and now (remember, I have the comdlg32 hack in place at this point) FF once again locks up instantly when I try to print, no "print dialogue". Furthermore, I can confirm that no entry is added to the KStub822 log file.

Next I reversed the comdlg32 hack and the FF printing behaviour didn't seem to change.

>So I downloaded ComDlgEx from post #22, patched this with Import Patcher so that it called ComDlg00.dll instead of ComDlg32.dll and placed this in the System directory as ComDlg32.dll, having renamed the original as ComDlg00.dll.

Both ComDlgEx and ComDlgEx2 from post #22 already reference ComDlg00.dll. There are no references to ComDlg32.dll. Perhaps you patched ComDlgEx.dll from post #27 instead?

Also, the code for PrintDlgExA and PrintDlgExW in post #22 is obsolete. See posts #27-28 for details. ComDlgEx from post #27 or ComDlgKs from Kstub730 should be used as a starting point for experiments. :yes:

Sorry, my mistake. That was the post #27 version. I've corrected the previous posting.

>Now when I attempt to print, the print dialogue appears (it didn't before), but when I click OK, FF again locks up, this time without an hourglass showing.

>

>Incidentally, other applications including Opera 12.02 continue to print normally. Also note, the version of KernelEx is 4.5.2 and Kstub 822 is also installed.

If you could walk FF3 (with dependencies) through IP35, I'd like to see the .ini file (inside a spoiler would be great). Also, check if printing with Opera 12.02 adds anything to the Kexstubs log file--it may not be using PrintDlgEx.

As always, thank you for experimenting and reporting your findings. :thumbup

No worries, here's the IP35 ini file after walking the FF3 dependencies :

[importPatcher.35]

;Edit parameters and replacement strings, then Retry or run again to patch. <=

[Parameters]

Walk dependencies=Y

Link to copies=N

Unbind broken bindings=N

Target OS=4.10

[DLL replacements]

USERENV.dll=

[ole32.dll]

CoWaitForMultipleHandles=

[ntdll.dll]

NtOpenFile=

RtlTimeToTimeFields=

RtlQueryEnvironmentVariable_U=

NtMapViewOfSection=

NtCreateSection=

NtQueryInformationFile=

NtUnmapViewOfSection=

NtProtectVirtualMemory=

NtAllocateVirtualMemory=

NtFreeVirtualMemory=

NtQuerySystemInformation=

NtQueryVirtualMemory=

RtlxAnsiStringToUnicodeSize=

NlsMbCodePageTag=

RtlInitString=

RtlDoesFileExists_U=

RtlGetFullPathName_U=

RtlUnicodeStringToInteger=

NtWriteFile=

NtQueryAttributesFile=

NtQueryInformationProcess=

RtlGetVersion=

NtSetInformationFile=

RtlInitAnsiString=

strpbrk=

strspn=

NtQueryDirectoryFile=

RtlGUIDFromString=

NtEnumerateValueKey=

NtQueryKey=

NtCreateKey=

NtSetValueKey=

NtSetInformationKey=

NtDeleteKey=

NtDeleteValueKey=

_wcsnicmp=

wcspbrk=

_vsnprintf=

sprintf=

wcsspn=

strncpy=

strchr=

atol=

isdigit=

wcscmp=

RtlSecondsSince1970ToTime=

RtlUpcaseUnicodeChar=

toupper=

RtlUpcaseUnicodeString=

RtlCopyUnicodeString=

RtlUpcaseUnicodeToMultiByteN=

LdrAccessResource=

LdrFindResource_U=

wcsncpy=

RtlFormatCurrentUserKeyPath=

RtlAppendUnicodeStringToString=

RtlAppendUnicodeToString=

wcschr=

_alloca_probe=

_chkstk=

_snwprintf=

swprintf=

RtlDuplicateUnicodeString=

LdrGetDllHandle=

RtlDosPathNameToNtPathName_U=

RtlpEnsureBufferSize=

RtlNtPathNameToDosPathName=

wcscpy=

RtlStringFromGUID=

RtlFreeUnicodeString=

RtlExpandEnvironmentStrings_U=

NtOpenKey=

NtQueryValueKey=

NtClose=

_wcsicmp=

wcscat=

wcsrchr=

RtlInitUnicodeString=

RtlFreeAnsiString=

wcslen=

qsort=

memmove=

[KERNEL32.dll]

GetUserDefaultUILanguage=

BaseDumpAppcompatCache=

BaseFlushAppcompatCache=

BaseCheckAppcompatCache=

BaseUpdateAppcompatCache=

GlobalMemoryStatusEx=

[Patches needed]

appHelp.dll=Functions, Unbind

SHLWAPI.dll=DLLs, Functions

[sHELL32.dll]

SHBindToParent=

[uSER32.dll]

UpdateLayeredWindow=

GetLastInputInfo=

[GDI32.dll]

GetTextExtentExPointI=

GetGlyphIndicesA=

AddFontMemResourceEx=

RemoveFontMemResourceEx=

GetGlyphIndicesW=

GetFontUnicodeRanges=

FF doesn't seem to add anything to the Kstub822 log file when printing. Opera 12.02 adds the line :

= Kernel32.dll:GetUserGeoID=t1 =

Incidentally, I should also point out that FF 8 was printing just fine before I removed it. Finally, I should point out that these are my Kstub822 entries in KernelEx's 'core.ini' :

[DCFG1]

contents=Kstub822,std,kexbases,kexbasen

desc=Default mode

[NT2K.names]

ComDlg32.PrintDlgExA=Kstub822.0

ComDlg32.PrintDlgExW=Kstub822.0

Joe.

Edited by jds
Link to comment
Share on other sites

@MiKl: What version of SeaMonkey are you using? See posts #31-33 for SeaMonkey reports.

@Joe: I'm not seeing any indication that FF35 calls PrintDlgEx to print. So the presence of ComDlgKs.dll shouldn't make any difference. :huh:

Please search the FF35 app folder for the text "PrintDlgEx" (else "PrintDlg"). You can also try contents=std,Kstub822,kexbases,kexbasen if "PrintDlgEx" is found.

Edit: I just downloaded and extracted Firefox 3.5.19, SeaMonkey 2.6.1, and Opera USB 12.02. Searching for text, I found that all contain "PrintDlg"; none "PrintDlgEx". My ComDlg?? solutions should have no effect on printing in these apps. :(

Edited by jumper
Link to comment
Share on other sites

@Joe: I'm not seeing any indication that FF35 calls PrintDlgEx to print. So the presence of ComDlgKs.dll shouldn't make any difference. :huh:

Please search the FF35 app folder for the text "PrintDlgEx" (else "PrintDlg"). You can also try contents=std,Kstub822,kexbases,kexbasen if "PrintDlgEx" is found.

Edit: I just downloaded and extracted Firefox 3.5.19, SeaMonkey 2.6.1, and Opera USB 12.02. Searching for text, I found that all contain "PrintDlg"; none "PrintDlgEx". My ComDlg?? solutions should have no effect on printing in these apps. :(

Hi jumper,

Well, as you've found, the string "PrintDlgEx" is not to be found in any file within the FF 3.5 directory. Also, I changed the KernelEx "core.ini" per above and this had no effect (on this issue), which is to be expected.

However, despite all this, the "ComDlg32.dll" hack does have some effect. Without it, FF hangs instantly when printing is attempted (showing an hourglass). With it, the print dialogue appears, and if you cancel at this point, FF appears OK. I've just reconfirmed this.

Joe.

Link to comment
Share on other sites

However, despite all this, the "ComDlg32.dll" hack does have some effect.

Yepp, I have your comdlg32 from 3/21 in the Seamonkey folder and comdlg32 from 3/13 in the KernelEx folder.

Only in this combination I have good results when trying to print from Seamonkey 2.0.14. !!

Of course, sometimes it chrashes - but overall it is quite reliable.

Link to comment
Share on other sites

Joe, please try MiKl's configuration:

  • comdlg32 from 3/21 in the Firefox 3.5 folder
  • and comdlg32 from 3/13 in the KernelEx folder.


"hould have no effect" was carefully worded. My ComDlg export-forwards PrintDlgW to the original ComDlg32.00 DLL which should be fine. However, back in Post #28 I wrote: "KernelEx also can't process ComDlg32 functions unless they are imported (not export-forwarded) from a DLL named ComDlg32.dll!" So, my ComDlg by export-forwarding PrintDlgW is bypassing KernelEx's Unicode processing....

To test this theory, try adding this line in Core.ini instead of using my ComDlg(s):


[NT2K.names]
ComDlg32.PrintDlgW=std

BTW, do OpenFile and SaveFileAs work? They should also be affected by my ComDlg32 implementation.

Perhaps I need to export-forward to Unicows.dll instead of ComDlg32. Unicows exports all the wide ComDlg32 functions. Or perhaps that is what Kex is doing.... I'll continue to research the issue.

Edited by jumper
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...