NO

Author Topic: WIN7: InitializeContext KERNEL32.DLL error  (Read 10157 times)

Offline jurgenve

  • Member
  • *
  • Posts: 3
WIN7: InitializeContext KERNEL32.DLL error
« on: August 09, 2023, 08:36:47 PM »
Got an error "Entry Point Not Found: the procedure entry point InitializeContext could not be located in the dynamic link library KERNEL32.DLL

-have already run  sfc /scannow, no faults detected.
-deinstalled correctly and installed again, same result.
-other software I have has no problem at all.
-computer has pretty clean history regarding software and its use, have MATLAB, AutoCAD running without any issue.
-have no WIN7 update, to be honest, think that is a load of crap.
-used to install previous Pelles C version, without problems, updated one seems to give issues.
-hard disk is SSD, if that is of any issue.
-do not use Internet on these workstation, like I said want to keep system clean as possible.

Possible to get my hands on older Pelles C revision?
Use x86 64 bit OS.

Thanks in advance.

Kind regards.

Offline Vortex

  • Member
  • *
  • Posts: 902
    • http://www.vortex.masmcode.com
Re: WIN7: InitializeContext KERNEL32.DLL error
« Reply #1 on: August 09, 2023, 08:42:54 PM »
Hi jurgenve,

Welcome to Pelles C forum.

Reading your message, I didn't see any information related to the service pack level of your Windows 7 installation :

https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-initializecontext

Code: [Select]
Requirements
 
Minimum supported client Windows 7 with SP1 [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 R2 with SP1 [desktop apps | UWP apps]

Maybe, you need to update your OS as you told : no WIN7 update
Code it... That's all...

Offline John Z

  • Member
  • *
  • Posts: 920
Re: WIN7: InitializeContext KERNEL32.DLL error
« Reply #2 on: August 10, 2023, 03:42:22 AM »
Hi jurgenve,

Welcome to the forum. 

I have a win 7 system that has been running PellesC version 9.
I just installed Pelles C v12.002 - it runs with no problem.
Installed fine, compiled test program, ran test program.
No error messages everything OK.  So it seems you do have
some system issue.

Details of my WIN 7 system:
Windows 7 Home Premium, with service pack 1 (build 7601)
64 bit OS
Intel Core(TM)2 Duo CPU T6600 @2.2Ghz

John Z
« Last Edit: August 10, 2023, 03:46:30 AM by John Z »

Offline Vortex

  • Member
  • *
  • Posts: 902
    • http://www.vortex.masmcode.com
Re: WIN7: InitializeContext KERNEL32.DLL error
« Reply #3 on: August 10, 2023, 10:53:29 AM »
Hi jurgenve,

After executing the command prompt, try to check if your kernel32.dll exports the API function :

Code: [Select]
D:\>cd PellesC\Bin

D:\PellesC\Bin>podump.exe /EXPORTS C:\Windows\System32\kernel32.dll | findstr InitializeContext
            369   368  000000018003BCA0  InitializeContext
            36A   369  000000018003BC80  InitializeContext2

Pelle's podump tool can list the functions exported by a DLL.

Code it... That's all...

Offline Kobold

  • Member
  • *
  • Posts: 13
Re: WIN7: InitializeContext KERNEL32.DLL error
« Reply #4 on: August 11, 2023, 12:06:16 PM »
Possible to get my hands on older Pelles C revision?

I just found out you can download previous versions here:
9.0: http://www.smorgasbordet.com/pellesc/900/setup.exe
10.0: http://www.smorgasbordet.com/pellesc/1000/setup.exe
11.0: http://www.smorgasbordet.com/pellesc/1100/setup.exe

However, I'm still running Win7 Ultimate 64bit, fully updated (and still receiving updates at least for Windows Defender). Never had that problem you have. I think SP1 is mandatory because Win7, like every new Windows version, was a buggy mess when it got released.

Offline jurgenve

  • Member
  • *
  • Posts: 3
Re: WIN7: InitializeContext KERNEL32.DLL error
« Reply #5 on: August 11, 2023, 02:43:07 PM »
Thank you all for quick and relevant reactions.
Is being appreciated.

I will look to apply the different approaches suggested, coming next week.

One little detail, I kind of use a (cracked) WINT 7 64 bit version which I have downloaded long time ago.
Has no service pack updated.
However did come with a toolkit for bypassing the licensing.
Used to be the solution back when I was a poor student, so to speak.

Greetings form Belgium.
Have a nice weekend.

Kind regards.

Offline John Z

  • Member
  • *
  • Posts: 920
Re: WIN7: InitializeContext KERNEL32.DLL error
« Reply #6 on: August 11, 2023, 03:58:56 PM »
[
However, I'm still running Win7 Ultimate 64bit, fully updated (and still receiving updates at least for Windows Defender). Never had that problem you have. I think SP1 is mandatory because Win7, like every new Windows version, was a buggy mess when it got released.

I'm also still getting defender and security update for win 7 home premium  :)

John Z

Offline Vortex

  • Member
  • *
  • Posts: 902
    • http://www.vortex.masmcode.com
Re: WIN7: InitializeContext KERNEL32.DLL error
« Reply #7 on: August 11, 2023, 04:22:53 PM »
Hi jurgenve,

You need to install SP1 and the following updates.
Code it... That's all...

Offline John Z

  • Member
  • *
  • Posts: 920
Re: WIN7: InitializeContext KERNEL32.DLL error
« Reply #8 on: August 11, 2023, 04:23:46 PM »
Seems still possible to download SP1.
See attachment below.

John Z

Offline Vortex

  • Member
  • *
  • Posts: 902
    • http://www.vortex.masmcode.com
Re: WIN7: InitializeContext KERNEL32.DLL error
« Reply #9 on: August 12, 2023, 12:36:17 PM »
Hi jurgenve,

Here is a small command-line tool for you to clarify the situation. VerifyExport32.exe is a console application and you will find the 64-bit version of the application in the attachment, VerifyExport64.exe

The tool reports if a DLL exports a function name \ API or not.

Code: [Select]
Usgae : VerifyExport DLLname FuncName
Testing the tool on my system :

Code: [Select]
VerifyExport32 kernel32.dll InitializeContext
kernel32.dll is exporting InitializeContext

VerifyExport64 kernel32.dll InitializeContext
kernel32.dll is exporting InitializeContext

Let's try a function which is not provided by kernel32 :

Code: [Select]
VerifyExport32.exe kernel32.dll GetMemory
kernel32.dll does not export the function GetMemory

« Last Edit: August 12, 2023, 01:02:31 PM by Vortex »
Code it... That's all...

Offline Vortex

  • Member
  • *
  • Posts: 902
    • http://www.vortex.masmcode.com
Re: WIN7: InitializeContext KERNEL32.DLL error
« Reply #10 on: August 15, 2023, 11:39:19 AM »
Hi jurgenve,

Did you try to update your Windows installation to solve the DLL export issue?
Code it... That's all...

Offline jurgenve

  • Member
  • *
  • Posts: 3
Re: WIN7: InitializeContext KERNEL32.DLL error
« Reply #11 on: August 18, 2023, 08:36:57 PM »
High,

In meantime I did follow up on some advices.
I have only made attention to the first posts, more recent once I will take a closer look during weekend.

Attached a sniping picture form the CMD windowd where I did perform the first commands.
Seems there is indeed a (crucial error), though I have trouble translating / understanding the issue.

Will install one of the previous PellesC version and see the effect.
Regarding de SP1 update, I took a look at it and the software package "WIN7" should already been updated by SP1.
Although I can download the package as separate software and perform an update if needed.


I will post results soon as possible.

Thank you all and have a nice weekend.

Offline Vortex

  • Member
  • *
  • Posts: 902
    • http://www.vortex.masmcode.com
Re: WIN7: InitializeContext KERNEL32.DLL error
« Reply #12 on: August 18, 2023, 08:47:33 PM »
Hi Jurgen,

Your command looks incorrect. After navigating to the folder C:\Program Files\PellesC\Bin, you need to type :

Code: [Select]
podump.exe /EXPORTS C:\Windows\System32\kernel32.dll | findstr InitializeContext
Code it... That's all...

Offline Vortex

  • Member
  • *
  • Posts: 902
    • http://www.vortex.masmcode.com
Re: WIN7: InitializeContext KERNEL32.DLL error
« Reply #13 on: June 01, 2024, 10:07:25 PM »
Another version :

Code: [Select]
#include <stdio.h>
#include <windows.h>

int main(int argc, char *argv[])
{

char *report[] = {"%s is exporting %s","%s does not export the function %s"};

HMODULE hDll;
FARPROC func;
int rv;

if (argc!=3){
printf("Usage : VerifyExport DLLname FuncName\n");
return 2;
}

hDll=LoadLibrary(argv[1]);

if (!hDll) {
printf("%s could not be loaded.",argv[1]);
return 3;
}

func=GetProcAddress(hDll,argv[2]);

rv=!func;

printf(report[rv],argv[1],argv[2]);

FreeLibrary(hDll);

return rv;
}
Code it... That's all...

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2151
Re: WIN7: InitializeContext KERNEL32.DLL error
« Reply #14 on: June 02, 2024, 09:40:55 AM »
Just for fun:
WIN7: InitializeContext KERNEL32.DLL error
So you can get that error with Windows 7 SP1 too  ;)
May the source be with you