none
Kernel32.dll unable to import InitializeCriticalSectionEx on windows xp embedded

    Question

  • Hi,

    I am migrating my project from from vs2003 to vs2013. I am unable to register one of the newly compiled "dll" (say abc.dll) in target machine - windows xp embedded with sp3 while I can register that same dll in windows 7.

    I used dependency walker to dig out more, In windows XP, that abc.dll is unable to find InitializeCriticalSectionEx() inside kernel32.dll and this same function is available in kernel32 in windows 7. 

    So the problem is, how can I get InitializeCriticalSectionEx() in kernel32.dll for windows XP. Is there any patch ?  Any help would be appreciated.

    Let me if there are any questions for the explanation of issue.

    Thanks

    Thursday, January 12, 2017 8:41 PM

All replies

  • Did you use the right Toolset ? (similar problem in this thread for example)

    With VS 2013, I use "Visual Studio 2013 - Windows XP (v120_xp)"

    (InitializeCriticalSectionEx() has never existed on XP)

    Thursday, January 12, 2017 9:26 PM
  • Hi, thank you for your response.

    I also used toolset as "v120_xp" but it is still taking InitializeCriticalSectionEx() in generated dll.

    

    Friday, January 13, 2017 8:09 AM
  • Hi neophyte,

    According to your description, please refer to the following scenarios:

    1). please update your VS to the latest version,

    Tools->Extensions and Updates->Updates->update option beginning with KB letters.

    2). Please refer to Violet Giraffe’s latest reply from the following thread which has the similar issue as yours:

    http://stackoverflow.com/questions/22709094/c-application-built-with-120-xp-toolset-on-windows-xp-initializecriticalsecti

    Sincerely,

    Oscar


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Friday, January 13, 2017 8:25 AM
    Moderator
  • Hi,

    I followed that post and did change linker-subsystem-windows. but no luck.

    I also check for updates in VS2013 and I think it is full updated. current version 12.0.40629.00 Update 5.

    I clean the whole solution and try to rebuild it again but still my dll depends on same InitializeCriticalSectionEx().

    Friday, January 13, 2017 8:44 AM
  • Or Is there any way that I can get rid of InitializeCriticalSectionEx() in my dll. I search my whole project and none of my files is using this function but still somehow it shows under kernel32.dll in dependency walker.

    Is there any thing I could try, please let me know.

    Thanks   

    Friday, January 13, 2017 10:00 AM
  • Hi neophyte,

    I think you need to install the latest nvidia driver for XP is version 364.72 and make sure your OS version is the latest.

     Please uninstall the old driver 1st, reboot, then install the new one.

    http://www.nvidia.com/download/driverResults.aspx/100865/en-us

    Sincerely,

    Oscar


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, January 16, 2017 6:28 AM
    Moderator