Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account


Photo

Kext: DIY KernelEx extensions

- - - - -

  • Please log in to reply
281 replies to this topic

#26
schwups

schwups

    schwups

  • Member
  • PipPipPip
  • 417 posts
  • Joined 11-November 09
  • OS:ME
  • Country: Country Flag
Yes I can confirm FindActCtxSectionStringW is a culprit. OO starts successfully and runs fine.

But I have a problem with the Foxit Reader 5.x. It refused to start, if I try to start it from the desktop shortcut.

Error starting program 

The IPHLPAPI.dll file canot start. Check the file to determine the problem. 

It starts from the start menu shortcut or from foxit.exe in the program folder.




How to remove advertisement from MSFN

#27
Giant2011

Giant2011

    Member

  • Member
  • PipPip
  • 174 posts
  • Joined 05-June 11
  • OS:98SE
  • Country: Country Flag
I have the portable version off Foxit Reader 5.x running here IPHLPAPI.dll does not give a problem here.
I checked it with dependency walker. Maybe you could also check it.

#28
jds

jds

    -DOS+

  • Member
  • PipPipPipPip
  • 603 posts
  • Joined 03-June 08
  • OS:98SE
  • Country: Country Flag
Another problem child from the update @ post #10 :

;ActivateActCtx=f2e // buggy!

This one prevented Dependency Walker from running (unless I disabled KernelEx for it).

Joe.

#29
Giant2011

Giant2011

    Member

  • Member
  • PipPip
  • 174 posts
  • Joined 05-June 11
  • OS:98SE
  • Country: Country Flag
I have the portable version from foxit reader 5x. running. I checked foxit reader.exe I did not get a problem running it.
I checked it with dependency walker,
Winspool.drv = GetPrinterDataExW seems to be a problem
ole32.dll = CoWaitForMultipleHandles seems to be a problem
and there are more. But how can I use this with stubs.ini

#30
jumper

jumper

    2014 All-American Masters HJ'er

  • Member
  • PipPipPip
  • 477 posts
  • Joined 21-January 11
  • OS:98SE
  • Country: Country Flag

I have the portable version from foxit reader 5x. running. I checked foxit reader.exe I did not get a problem running it.

That's good new. :)

I checked it with dependency walker,
Winspool.drv = GetPrinterDataExW seems to be a problem
ole32.dll = CoWaitForMultipleHandles seems to be a problem
and there are more.

These must be delay-load dependencies that are loaded later, as needed. If the load fails, the operation that triggered it will fail. This appears to include printing.

But how can I use this with stubs.ini

1. Locate or create sections in stubs.ini for each module:
[Winspool.drv]

[ole32.dll]
2. Add blank definition keys for each missing export function:
[Winspool.drv]
GetPrinterDataExW

[ole32.dll]
CoWaitForMultipleHandles
If we stop here, Kexstubs will prompt you at run-time for a return value if the function is ever invoked.

3. Add definition values for each function as per Post #21:
[Winspool.drv]
GetPrinterDataExW=t7

[ole32.dll]
CoWaitForMultipleHandles=t5
4. Restart Windows to apply changes.

Edited by jumper, 17 July 2012 - 07:05 PM.

Design feedback requested:
IHAtool - IpHlpApi tester; call various functions and report results
--status-> framework is solid; 22 api's fully supported; preview release coming soon
ComDlg32 wrapper - ComDlgEx meets IpHlpApi wrapper
--status-> PrintDlgExW working in latest SumatraPDF 8^)
Future projects: ImportPatcher40 - dialog interface; Kexter - IP40+Ktree+Kexstubs

#31
jumper

jumper

    2014 All-American Masters HJ'er

  • Member
  • PipPipPip
  • 477 posts
  • Joined 21-January 11
  • OS:98SE
  • Country: Country Flag
Joe, now that you've found two problems with the Activation Context (ActCtx) family of functions, we're likely to have trouble with the rest:

[Kernel32.dll]
;ActivateActCtx=f2e // buggy!
CreateActCtxA=t1e
CreateActCtxW=t1e
DeactivateActCtx=f2e
FindActCtxSectionStringA=f5e
;FindActCtxSectionStringW=f5e // buggy!
...
ReleaseActCtx=f1
Perhaps we should disable all of them, and then only reenabled them as needed....

MSDN - Activation Context Reference
Function		Description
ActivateActCtx 		Activates the specified activation context.
AddRefActCtx 		Increments the reference count of the specified activation context.
CreateActCtx 		Creates an activation context.
DeactivateActCtx 	Deactivates the specified activation context.
FindActCtxSectionGuid 	Returns data contained in the ACTCTX_SECTION_KEYED_DATA structure that corresponds to the specified GUID.
FindActCtxSectionString Returns data contained in the ACTCTX_SECTION_KEYED_DATA structure that corresponds to the specified string.
GetCurrentActCtx 	Returns the current activation context.
IsolationAwareCleanup 	Ensures that memory is freed when a manifest is loaded, unloaded, and reloaded.
QueryActCtxW 		Queries the activation context for information about an assembly or file.
QueryActCtxSettingsW 	Specifies the namespace and attribute name of the attribute that is to be queried.
ReleaseActCtx 		Decrements the reference count of the specified activation context.
ZombifyActCtx 		Deactivates the specified activation context, but does not deallocate it.

Design feedback requested:
IHAtool - IpHlpApi tester; call various functions and report results
--status-> framework is solid; 22 api's fully supported; preview release coming soon
ComDlg32 wrapper - ComDlgEx meets IpHlpApi wrapper
--status-> PrintDlgExW working in latest SumatraPDF 8^)
Future projects: ImportPatcher40 - dialog interface; Kexter - IP40+Ktree+Kexstubs

#32
loblo

loblo

    Oldbie

  • Member
  • PipPipPipPipPip
  • 758 posts
  • Joined 12-January 10
  • OS:ME
  • Country: Country Flag

[ole32.dll]
CoWaitForMultipleHandles=t5

Isn't CoWaitForMultipleHandles already handled by KernelEx, and emulated at that?

Sorry I cannot add more to the discussion as I have yet to install Kext, lazy me...

#33
Giant2011

Giant2011

    Member

  • Member
  • PipPip
  • 174 posts
  • Joined 05-June 11
  • OS:98SE
  • Country: Country Flag
Hey Jumper I had to add


[Winspool.drv]
GetPrinterDataExW=t7

[ole32.dll]
CoWaitForMultipleHandles=t5
to stubs.ini, but what means t7 and how do you know you have to add t7, same question with t7.
Seems to me that each addition can be different for every other person. Because for instance
one program will run for me maybe, but not for everybody else. Otherwise people should use
the same dll's and other system files.

#34
Giant2011

Giant2011

    Member

  • Member
  • PipPip
  • 174 posts
  • Joined 05-June 11
  • OS:98SE
  • Country: Country Flag
I saw I made a mistake: It must be same question with t 5

And different users use different version of dll files or system files. So it will be different for each user.

#35
jumper

jumper

    2014 All-American Masters HJ'er

  • Member
  • PipPipPip
  • 477 posts
  • Joined 21-January 11
  • OS:98SE
  • Country: Country Flag
>Isn't CoWaitForMultipleHandles already handled by KernelEx, and emulated at that?

Good catch, loblo. Indeed, kexbasen contains a robust implementation of CoWaitForMultipleHandles. That is why stubs.ini doesn't already have a definition for it.

This bring up two issues:
1. Dependency Walker doesn't know about KernelEx
2. What happens when a definition is added to stubs.ini that is covered elsewhere

Until there is a DW-like tool that is Kex-aware, it's probably best to only add stubs for missing exports reported by the loader. ImportPatcher was designed to help non-KernelEx users and doesn't currently know about KernelEx, but that can easily be fixed.

The beauty of "contents=Kstub626,std,kexbases,kexbasen" is that if kex already supports a function, the stubs.ini definition will be ignored. Also, if a standard (std) system dll is updated and now includes support for a function (think msvcrt*.dll), it will override any definition in stubs.ini.
Design feedback requested:
IHAtool - IpHlpApi tester; call various functions and report results
--status-> framework is solid; 22 api's fully supported; preview release coming soon
ComDlg32 wrapper - ComDlgEx meets IpHlpApi wrapper
--status-> PrintDlgExW working in latest SumatraPDF 8^)
Future projects: ImportPatcher40 - dialog interface; Kexter - IP40+Ktree+Kexstubs

#36
schwups

schwups

    schwups

  • Member
  • PipPipPip
  • 417 posts
  • Joined 11-November 09
  • OS:ME
  • Country: Country Flag

Another problem child from the update @ post #10 :

;ActivateActCtx=f2e // buggy!

This one prevented Dependency Walker from running (unless I disabled KernelEx for it).

Joe.


Confirmed!

#37
Giant2011

Giant2011

    Member

  • Member
  • PipPip
  • 174 posts
  • Joined 05-June 11
  • OS:98SE
  • Country: Country Flag
Now I understand it how it works

#38
M()zart

M()zart

    Member

  • Member
  • PipPip
  • 277 posts
  • Joined 17-June 08

Until there is a DW-like tool that is Kex-aware, it's probably best to only add stubs for missing exports reported by the loader.

Actually, it seems that fileinfo plugin for Total Commander does the job, and it shows which dependencies are delay-loaded.

#39
jumper

jumper

    2014 All-American Masters HJ'er

  • Member
  • PipPipPip
  • 477 posts
  • Joined 21-January 11
  • OS:98SE
  • Country: Country Flag
FileInfo 2.21 for Total Commander:

DLL dependencies are tested and missing functions are shown.


This does look very promising. The server at physio-a.univ-tours.fr is currently not responding, however, so I can't test it yet.

Remember to set the KernelEx compatibility mode on FileInfo to the same as the module you are testing--KernelEx API support varies by mode!

The ideal KernelEx-aware dependency tester would test against each of the compatibility modes and recommend the best one to use.
Design feedback requested:
IHAtool - IpHlpApi tester; call various functions and report results
--status-> framework is solid; 22 api's fully supported; preview release coming soon
ComDlg32 wrapper - ComDlgEx meets IpHlpApi wrapper
--status-> PrintDlgExW working in latest SumatraPDF 8^)
Future projects: ImportPatcher40 - dialog interface; Kexter - IP40+Ktree+Kexstubs

#40
loblo

loblo

    Oldbie

  • Member
  • PipPipPipPipPip
  • 758 posts
  • Joined 12-January 10
  • OS:ME
  • Country: Country Flag
FileInfo 2.21 is available here but it doesn't seem to work at all. :(

FileInfo 2.10 is included in the proTC pack but it lists all functions as missing. :(

FileInfo 2.07 is included in Total Commander PowerPack 1.7 and works as expected. :D

I don't have Total commander so they have been tested in both Lister and Universal Viewer Free with identical results.

:)

#41
jumper

jumper

    2014 All-American Masters HJ'er

  • Member
  • PipPipPip
  • 477 posts
  • Joined 21-January 11
  • OS:98SE
  • Country: Country Flag


Another problem child from the update @ post #10 :

;ActivateActCtx=f2e // buggy!

This one prevented Dependency Walker from running (unless I disabled KernelEx for it).

Joe.


Confirmed!

According to Wikipedia, the current stable version is 2.2.6000. I run that version and have had no problems.

What version has problems with ActivateActCtx?
Design feedback requested:
IHAtool - IpHlpApi tester; call various functions and report results
--status-> framework is solid; 22 api's fully supported; preview release coming soon
ComDlg32 wrapper - ComDlgEx meets IpHlpApi wrapper
--status-> PrintDlgExW working in latest SumatraPDF 8^)
Future projects: ImportPatcher40 - dialog interface; Kexter - IP40+Ktree+Kexstubs

#42
jds

jds

    -DOS+

  • Member
  • PipPipPipPip
  • 603 posts
  • Joined 03-June 08
  • OS:98SE
  • Country: Country Flag



Another problem child from the update @ post #10 :

;ActivateActCtx=f2e // buggy!

This one prevented Dependency Walker from running (unless I disabled KernelEx for it).

Joe.


Confirmed!

According to Wikipedia, the current stable version is 2.2.6000. I run that version and have had no problems.

What version has problems with ActivateActCtx?

Hi jumper,

Mine says it's 2.2.6000 (MD5 of EXE = b6051fdab7dc811a2d6be64a1579c735, MD5 of DLL = e72eff1b793fe064f068e715efb1b5cd).

Joe.

#43
schwups

schwups

    schwups

  • Member
  • PipPipPip
  • 417 posts
  • Joined 11-November 09
  • OS:ME
  • Country: Country Flag
same version - same checksums

#44
schwups

schwups

    schwups

  • Member
  • PipPipPip
  • 417 posts
  • Joined 11-November 09
  • OS:ME
  • Country: Country Flag
How to install Opera 12.5 alpha for testing.

I added these API's to [Secur32.dll]: Please jumper correct them, I'm not sure. 

LsaEnumerateLogonSessions=z2e
LsaFreeReturnBuffer=z1e
LsaGetLogonSessionData=z2e
InitSecurityInterfaceW=



It doesn't work stable and of course the plugins don't run and I can't add buttons to the toolbars. The comp. mode must be Win2000SP4 for installation and running (the default mode isn't possible anymore). 




[NTDLL.DLL] vsprintf=z3e for latest Sumatra PDF



Edited by schwups, 24 July 2012 - 04:38 PM.


#45
jumper

jumper

    2014 All-American Masters HJ'er

  • Member
  • PipPipPip
  • 477 posts
  • Joined 21-January 11
  • OS:98SE
  • Country: Country Flag

How to install Opera 12.5 alpha for testing.

I added these API's to [Secur32.dll]: Please jumper correct them, I'm not sure.

LsaEnumerateLogonSessions=z2e
LsaFreeReturnBuffer=z1e
LsaGetLogonSessionData=z2e
InitSecurityInterfaceW=

The Lsa functions need to return a negative value to indicate failure, so our only option for now is 'true'. They don't SetLastError, so no 'e'.
InitSecurityInterface[A/W] returns zero on failure, takes no parameters, and doesn't SetLastError.

Sorted and merged:
[Secur32.dll]
GetUserNameExA=z3e
GetUserNameExW=z3e
InitSecurityInterfaceW=z0
LsaEnumerateLogonSessions=t2
LsaFreeReturnBuffer=t1
LsaGetLogonSessionData=t2

It doesn't work stable and of course the plugins don't run and I can't add buttons to the toolbars. The comp. mode must be Win2000SP4 for installation and running (the default mode isn't possible anymore).

What is your default mode set to? It can be enabled or disabled (registry setting); and any compatibility mode (core.ini setting). I highly recommend Disabled or Enabled/Win98se (for the improved heap management). Only use a higher mode when required, or the app might try to take liberties....


[NTDLL.DLL] vsprintf=z3e for latest Sumatra PDF

[NTDLL.DLL] vsprintf=z0
'z' because no characters are outputted (hopefully the buffer is already zero-terminated, because we can't do that!)
'0' because of the "C" calling convention (__cdecl).
No 'e' because this function doesn't SetLastError.

Edit: As of 822, we can use any of these definitions to forward vsprintf to be handled by Msvcrt.dll:
[NTDLL.DLL]
vsprintf=>Msvcrt.dll:vsprintf
vsprintf=>Msvcrt:vsprintf
vsprintf=>Msvcrt.dll:
vsprintf=>Msvcrt:
vsprintf=>

Edited by jumper, 23 August 2012 - 03:05 AM.

Design feedback requested:
IHAtool - IpHlpApi tester; call various functions and report results
--status-> framework is solid; 22 api's fully supported; preview release coming soon
ComDlg32 wrapper - ComDlgEx meets IpHlpApi wrapper
--status-> PrintDlgExW working in latest SumatraPDF 8^)
Future projects: ImportPatcher40 - dialog interface; Kexter - IP40+Ktree+Kexstubs

#46
schwups

schwups

    schwups

  • Member
  • PipPipPip
  • 417 posts
  • Joined 11-November 09
  • OS:ME
  • Country: Country Flag
My default mode: KernelEx is enabled. HKEY_LOCAL_MACHINE\SOFTWARE\KernelEx  "DisableExtensions"=dword:0x00000000 (0). 


Thanks for corrections and explanations. 

#47
jds

jds

    -DOS+

  • Member
  • PipPipPipPip
  • 603 posts
  • Joined 03-June 08
  • OS:98SE
  • Country: Country Flag

My default mode: KernelEx is enabled. HKEY_LOCAL_MACHINE\SOFTWARE\KernelEx  "DisableExtensions"=dword:0x00000000 (0). 


Thanks for corrections and explanations. 

Me too.

That explains why jumper didn't see the Dependency Walker problem ...

Joe.

#48
schwups

schwups

    schwups

  • Member
  • PipPipPip
  • 417 posts
  • Joined 11-November 09
  • OS:ME
  • Country: Country Flag
Kstub730.ini:

[ComDlg32.dll]


PrintDlgExA=>ComDlgKs.dll:PrintDlgExA
PrintDlgExW=>ComDlgKs:PrintDlgExW

I think it should be PrintDlgExW=>ComDlgKs.dll:PrintDlgExW !?




#49
jumper

jumper

    2014 All-American Masters HJ'er

  • Member
  • PipPipPip
  • 477 posts
  • Joined 21-January 11
  • OS:98SE
  • Country: Country Flag
>I think it should be PrintDlgExW=>ComDlgKs.dll:PrintDlgExW !?

Good eye, I hoped it would be noticed. :)
This was an intentional example of how the '.dll' extension is optional:
; =>[[drive:]path]library[.ext]:function
SumatraPDF 2.11 was my test case for this forwarding definition.
Design feedback requested:
IHAtool - IpHlpApi tester; call various functions and report results
--status-> framework is solid; 22 api's fully supported; preview release coming soon
ComDlg32 wrapper - ComDlgEx meets IpHlpApi wrapper
--status-> PrintDlgExW working in latest SumatraPDF 8^)
Future projects: ImportPatcher40 - dialog interface; Kexter - IP40+Ktree+Kexstubs

#50
schwups

schwups

    schwups

  • Member
  • PipPipPip
  • 417 posts
  • Joined 11-November 09
  • OS:ME
  • Country: Country Flag
After updating to 730 an IE script error occured in windows\web\controlp.htt, if I tried open the control panel. This happened on two of three machines.  

Run => regsvr32 webvw.dll doesn't work. Downgrading to 626 fixed the error.

Edited by schwups, 08 August 2012 - 04:20 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users



How to remove advertisement from MSFN