Jump to content

Kext: DIY KernelEx extensions


Recommended Posts

  • 1 month later...

@schwups

[ntdll.dll]
IoUnregisterDeviceInterface=

This is already a function in the Win9x Ntdll. You may have been looking at the wrong version of Ntdll.

@jumper

This is about RtlDeleteCriticalSection ; RtlEnterCriticalSection ; RtlInializeCriticalSection ; & RtlLeaveCriticalSection. These functions as a group tested did not work. The test files were LICCPA.CPL ; LLSRPC.DLL ; & CCFAPI32.DLL from Microsoft Windows 2000 (''NT 5.0'' 5.00.1515.1 Professional). For testing I used Radmin32 for all functions that were missing except for ntdll CriticalSection functions. These functions are on their own in the LLSRPC library and they did not work with KernelEx  : - I have tried KEX differing mode settings. In NT Ntdll for CriticalSection functions they are just forwarders to Kernel32 functions without the Rtl preceding the function name. So I linked them directly to Kernel32 without the Rtl in their name and then the control panel Licensing worked. I have included the pictures as evidence of working. The Kernel86 is just ReactOS version 0100 Kernel32 & has nothing to do with the operation but shows some CriticalSection forwarder functions.

Critical2.png

Critical1.png

Edited by Goodmaneuver
Spelling & forwarder instead of follower
Link to comment
Share on other sites

@Jumper, I have mentioned that selecting properties of a Drive from within the My Computer window terminates Explorer if Explorer.exe is set KEX modes beyond DCFG1. Beyond includes NOHEAP & NT40. This is a serious problem since this message box stems from registry settings, there are no extra files loaded. There are no discovered differences in programs' operation with Explorer set to 2K for instance. The context selection of Drive Properties from within the My Computer window should bring up the Drive Check and Defrag message box. NOHEAP on Explorer should be the same as DCFG1 except standard heaps are allocated AFAIK but it isn't as I explained : it does behave the same as DCFG1 if 4.5.2 CORE.ini is used.

Now if I adjust the lines in Core.ini so that for NT40 and above KERNEL32.GetVersion=kexbases.2 ; 2 being the maximum setting applied then all is OK. No Drive Properties problems and Programs are unaffected. This problem may stem from way back, I did not check. What do you think?

I have discovered that the Java save problem makes save folders in the parent directory to that it should with a full stop preceding the save folder name.

Edited by Goodmaneuver
Link to comment
Share on other sites

Explorer.exe doesn't need kex, so set to disabled or Base at most. If extensions need kex, set them directly.

Don't use 4.5.2 core.ini with any kex files for which an updated core.ini has been supplied.

. = current folder

.. = parent folder

 

Link to comment
Share on other sites

The save thing in Java is not manual and happens in all programs using Java so far. They place files in incorrect locations. I see what your getting at with the DOS full stops. Can you emulate the Explorer fault I was talking about? What effect would making KERNEL32.GetVersion=kexbases.2 for NT40 & Win2K create? I made sure that all KEX APPs reg modes for modules were using settings appropriate to the old Core.ini if that matters & everything worked as normal. I only used old Core.ini to make it easier to try and solve the problem. The latest Core.ini was then used with  KERNEL32.GetVersion=kexbases.2 for NT40 & Win2K the only changes. I think DCFG1 is not a bad mode for Explorer, going from DCFG1 to NOHEAP on Vuze makes the text disappear.

Edited by Goodmaneuver
just removed the struck though mistake
Link to comment
Share on other sites

I hope that DCFG1 settings stay though in future or similar to it as BASE does hiccup now on one startup program and I will have to take corrective measures if I have to use BASE. No stubs.ini settings, one reason for this is that I do not know how to use stubs.ini.

UPDATE I have fixed  the startup problem with the program not starting with explorer set to BASE  : - the program had to be set KEX disabled : -  NETWARE driver logon program vs 5.5.8. It would not normally happen to other users though, as I am using some upgraded files using BWC's Msvcrt wrapper for certain files on certain WinME builds. Sometimes mapping all required functions in memory is difficult and setting Dpmw32.exe to KEX disabled fixed this. ( this mapping suggestion is my guess )

Edited by Goodmaneuver
Added more relevant info
Link to comment
Share on other sites

  • 1 month later...

In response to 

Do you not think NtClose should work if loading MSVCRT of BWC's version? I do not believe that it is because of another reason and it has been in use for a long time. MSVCRT loads very early and BWC's version of MCVCRT is a great test for NTClose as it is the only imported function. Users use differing versions of MSVCRT for example MSCVR70. I know your opinion that you do not want testers to use other versions but you stated it would not make any difference as far as KernelEx is concerned.

Link to comment
Share on other sites

VLC 4.0 nightly needs more API`s:

[IPHLPAPI.DLL]
if_nametoindex=

[KERNEL32.dll]
IdnToAscii=
InitializeConditionVariable=
QueryUnbiasedInterruptTime=
SetThreadErrorMode=
SleepConditionVariableCS=
WakeAllConditionVariable=

Link to comment
Share on other sites

  • 4 weeks later...

Is there a reason why GlobalMemoryStatusEx >> GlobalMemoryStatus can not be made a common KernelEx function redirect? Is it because it does not work when GlobalMemoryStatusEx and GlobalMemoryStatus are both imported by the module, or does it need a differing approach when both are called? The reason I ask is that Titan Quest the game refused to accept virtual memory was enabled until I changed GlobalMemoryStatusEx >> GlobalMemoryStatus manually in TQ.exe. I have the original DVD which did not require Steam.
 

Edited by Goodmaneuver
Link to comment
Share on other sites

It wouldn't make sense because MEMORYSTATUSEX struct isn't backwards compatible with MEMORYSTATUS. The former uses 64-bit integers for most variables, the latter 32-bit. Your game works with the mentioned hack because it's picking up on garbage data because the memory for MEMORYSTATUSEX wasn't zeroed before the call. There's no reason to zero it because it's expected to be fully filled by GlobalMemoryStatusEx and none of the values in the struct besides the member representing the size of the struct are input values.

Link to comment
Share on other sites

The newer function call of GlobalMemoryStatusEx has the extended ullAvailExtendedVirtual but this value is reserved and always 0 according to GlobalMemoryStatusEx Microsoft document. GlobalMemoryStatusEx is required if the physical RAM is larger than 2GB which WinME does not use for me. 32bit 4GB tunning can be read about here https://docs.microsoft.com/en-us/windows/win32/memory/4-gigabyte-tuning . By directing the call of GlobalMemoryStatusEx to GlobalMemoryStatus the function is not interfered within the Kernel and both deliver the same results in KB. GlobalMemoryStatus if using SIZE_T will match the CPU's memory addressing whether it be a 16 bit processor, to a 64 bit processor.

MEMORYSTATUSEX structure - "This structure is identical to the original MEMORYSTATUS structure except that all the size members are 64 bits wide, allowing for values greater than 4 GB. The member at the end, ullAvailExtendedVirtual, indicates the size of unreserved memory in the very large memory (VLM) portion of the virtual address space of the calling process. This VLM portion applies only to certain CPU architectures in certain configurations." Quoted from https://flylib.com/books/en/4.419.1.101/1/

There are several games that I have had to change GlobalMemoryStatusEx >> GlobalMemoryStatus to get them to work and I thought that Jumper had made changes in Kexbases so that  Broken Sword - Legends of the Ark would work without having to change the GlobalMemoryStatusEx string to GlobalMemoryStatus ( but checking now it still does not work ) and newly discovered Titan Quest when coping over game files from XP installation, Kexbases - GlobalMemoryStatusEx function did not work either. This is why I asked whether GlobalMemoryStatusEx can be made a common KernelEx function or not. Kexbasen is supposed to be KernelEx's common functioning library.

Edited by Goodmaneuver
Edited part in brackets + last sentence
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...