none
VS2012.2 v110_xp broken?

    Question

  • Hi,

    After installing Visual Studio 2012 Update 2, our C++ modules that were targeting v110_xp are no longer running on Windows XP/Windows Server 2003.

    When launching the application, the following error now shows up (messagebox):

    "XXXXXX.exe - Entry Point Not Found"

    "The procedure entry point InitializeCriticalSectionEx could not be located in the dynamic link library KERNEL32.dll"

    The exact same code compiled fine with Update 1 worked fine on XP/Server 2003.

    I tried uninstalling Update 2 but now I cannot download Update 1 anymore, all references online have been updated to point to update 2...

    Any ideas?

    Greetings,

    Wouter

    Tuesday, April 09, 2013 2:20 PM

All replies

  • I suffer exactly the same issue!

    Tuesday, April 09, 2013 2:35 PM
  • You are not alone. We have exactly the same problem!!!
    Tuesday, April 09, 2013 2:53 PM
  • same thing here.

    Code that ran perfectly on XP before now fails on startup due to a missing InitializeCriticalSectionEx in Kernel32.dll.

    Since this function is not present in XP, could it be that there is some glitch in the SDK headers for update 2, making it ignore the  _WIN32_WINNT version macro? (which is set to 0x0501 in my case). Or maybe some bug in the C++ runtime libs? I link statically to the CRT libs btw

    Need fix or workaround urgently!


    Tuesday, April 09, 2013 9:04 PM
  • We experienced the same problem. Hope Microsoft can provide a hotfix ASAP.
    Wednesday, April 10, 2013 6:34 AM
  • Hi,

    I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.

    Best regards,


    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, April 10, 2013 8:01 AM
    Moderator
  • After some testing I can confirm, that we have this problem only in statically linked programs.When program or our own DLLs are dynamically linked they don't import InitializeCriticalSectionEx.

    I have found an interesting change in "c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\include\atlwinverapi.h". Old version has function declaration:
    BOOL _AtlInitializeCriticalSectionEx(__out LPCRITICAL_SECTION lpCriticalSection, __in DWORD dwSpinCount, __in DWORD Flags);

    New version contains inline definition:

    	inline BOOL _AtlInitializeCriticalSectionEx(__out LPCRITICAL_SECTION lpCriticalSection, __in DWORD dwSpinCount, __in DWORD Flags)
    	{
    	#if (NTDDI_VERSION >= NTDDI_VISTA) && !defined(_USING_V110_SDK71_)
    		// InitializeCriticalSectionEx is available in Vista or later, desktop or store apps
    		return ::InitializeCriticalSectionEx(lpCriticalSection, dwSpinCount, Flags);
    	#else
    		UNREFERENCED_PARAMETER(Flags);
    
    		// ...otherwise fall back to using InitializeCriticalSectionAndSpinCount.
    		return ::InitializeCriticalSectionAndSpinCount(lpCriticalSection, dwSpinCount);
    	#endif
    	}
    I have restored this file from old backup, but it hasn't solved the problem.

    Wednesday, April 10, 2013 2:00 PM
  • While MS guys think how this unpleasant situation could happed, I found _TEMPORARY_, but working solution. 

    The only changes in headers/src are in atlwinverapi.h and atlwinverapi.cpp (also, in atldbcli.h, but this is not relative to the topic), but this changes are compiled into the static ATL libs (they use, for example, by CImage class), so libs also must be restored.

    You should restore this list of files:

    c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\include\atldbcli.h
    c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\include\atlwinverapi.h
    c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\lib\atls.lib
    c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\lib\arm\atls.lib
    c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\lib\amd64\atls.lib
    c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\lib\atlsd.lib
    c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\lib\arm\atlsd.lib
    c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\lib\amd64\atlsd.lib
    c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\lib\atlsn.lib
    c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\lib\arm\atlsn.lib
    c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\lib\amd64\atlsn.lib
    c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\lib\atlsnd.lib
    c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\lib\arm\atlsnd.lib
    c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\lib\amd64\atlsnd.lib
    c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\lib\atls.pdb
    c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\lib\arm\atls.pdb
    c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\lib\amd64\atls.pdb
    c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\lib\atlsd.pdb
    c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\lib\arm\atlsd.pdb
    c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\lib\amd64\atlsd.pdb
    c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\lib\atlsn.pdb
    c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\lib\arm\atlsn.pdb
    c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\lib\amd64\atlsn.pdb
    c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\lib\atlsnd.pdb
    c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\lib\arm\atlsnd.pdb
    c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\lib\amd64\atlsnd.pdb
    c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\src\atl\atls\atlwinverapi.cpp
    
    c:\Windows\symbols\dll\atl110.amd64.pdb
    c:\Windows\symbols\dll\atl110.arm.pdb
    c:\Windows\symbols\dll\atl110.i386.pdb


     From they Update 1 versions. The easiest way is to get them from Volume Shadow Copy


    • Proposed as answer by VSBs Wednesday, April 10, 2013 8:32 PM
    • Edited by VSBs Wednesday, April 10, 2013 8:59 PM
    Wednesday, April 10, 2013 8:25 PM
  • For now, I ended up re-installing Update 1. 

    - Uninstall VS2012.2 (also removed Update 1)

    - Repair Visual Studio 2012

    - Install VS2012 Update 1 (http://go.microsoft.com/fwlink/?LinkId=272396)

    (this post first linked to http://torrage.com/torrent/CD8319E6D0DA063143CD4DCF599890E83C9C1F58.torrent instead for an Update 1 download, because I couldn't find any official Microsoft references at the time. It's a torrent from an unofficial source... Torrent Link was found here: http://social.msdn.microsoft.com/Forums/en-US/vssetup/thread/06b7f509-567b-4869-81a3-801e4cae883f/#a45d36a0-a858-4c7a-aba3-b932d6a360b1)


    Thursday, April 11, 2013 6:09 AM
  • We have the same problem with dynamic linking of the library. That is, we have always used MFC in a dynamic MT library and this issue appeared after installing update 2 and running on XP SP3. As the redistributable libraries for MFC and CRT etc have not changed for update 2 we are more than somewhat puzzled...

    We do use ATL::CImage...

    • Edited by GP Smith Friday, April 12, 2013 11:52 AM
    Friday, April 12, 2013 11:22 AM
  • We have faced the same problem.

    MS should provide either a hotfix or a link to Update 1.

    We have no option but to compile statically linked MFC apps in VS 2010.


    Sha

    Friday, April 12, 2013 3:53 PM
  • ATL::CImage has internal ATL::Cimage::CInitGDIPlus class, that uses InitializaCriticalSectionEx.

    There is workaround about it in sources to load it dynamically, if available or fallback to InitializeCriticalSectionAndSpinCount, but this sources are compiled to static libs with wrong flags and so, workaround is not used.

    Right now the only way is to use files (posted by me above) from Update 1, because it uses same compiler and CRT (main CRT libs are same for Update 1 and Update 2)

    Friday, April 12, 2013 7:17 PM
  • For now, I ended up re-installing Update 1  ....... Microsoft itself appears to have removed all references to the download. Link was found here: http://social.msdn.microsoft.com/Forums/en-US/vssetup/thread/06b7f509-567b-4869-81a3-801e4cae883f/#a45d36a0-a858-4c7a-aba3-b932d6a360b1)

    I found the link to Update 1 here:

    http://go.microsoft.com/fwlink/?LinkId=272396

    Tuesday, April 16, 2013 2:17 AM
  • Hi there,

    I think you may also put your issue on msconnect: https://connect.microsoft.com/

    BR-

    Jenny

    Tuesday, April 16, 2013 6:54 AM
  • It's nice, then may wait for the feedback .

    BR-

    Jenny

    Tuesday, April 16, 2013 6:58 AM
  • Unfortunately, after removing Update1 and repairing Visual Studio, the ATL is missing. I've tried to uninstall Visual Studio completely and reinstall it but it did not help. The installation log is here:

    https://www.dropbox.com/s/gwg3a8t1e3oduhl/dd_vs_ultimate_20130416230309_91_vc_libraryextended.log

    Installing the Update1 did not help.

    Finally, I've tried to reinstall the Update 2 and the ATL files ("C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\include\atlacc.h" etc.) were restored.

    Tuesday, April 16, 2013 7:33 PM
  • Unfortunately, after removing Update1 and repairing Visual Studio, the ATL is missing. I've tried to uninstall Visual Studio completely and reinstall it but it did not help. The installation log is here:

    https://www.dropbox.com/s/gwg3a8t1e3oduhl/dd_vs_ultimate_20130416230309_91_vc_libraryextended.log

    Installing the Update1 did not help.

    Finally, I've tried to reinstall the Update 2 and the ATL files ("C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\include\atlacc.h" etc.) were restored.

    interestingly, I had this exact same experience during the testing the uninstall of a late CTP of Update 1.  I simply could not restore my machine to a point where I could get a clean Visual Studio with all the files unless I reinstalled the update (Update 1 at the time).  I found out at the time that many more files were missing (including some DLLs in system32 and syswow64)

    I eventually had to ensure that no traces of Visual Studio 2012 were left on my machine (using Windows installer cleanup utility) to get back to a point of a clean RTM Visual Studio.  Was dangerous to use the tool but it was the only way I could fix my machine to "let go" of the knowledge of having installed Update 1 (this was even after uninstalling the entire Visual Studio)

    Tuesday, April 16, 2013 8:03 PM
  • I've tried to run the windows installer cleanup utility after deinstalling the visual studio but haven't found anything to delete.

    The CTPs have never been installed on the machine.

    Wednesday, April 17, 2013 8:52 AM
  • The workaround I used was to change the target from:

    Visual Studio 2012 - Windows XP (v110_xp)

    to

    Visual Studio 2010 (v100)


    Chris Apple Software Consultant http://www.applehome.com

    Wednesday, April 17, 2013 8:16 PM
  • Switching to VC100 will eliminate all new VC110 features, so to me that is not an option.

    The only right thing (for me) is wait for a hotfix from Microsoft, I hope they can provide one very soon, before the next Windows Update cycle (which I suppose will be May 7 2013 :))

    For now I hold back the WinXP rollouts but I cannot keep this up to long..


    Albert van Peppen

    Thursday, April 18, 2013 8:06 AM
  • I've tried to run the windows installer cleanup utility after deinstalling the visual studio but haven't found anything to delete.

    The CTPs have never been installed on the machine.


    Under View installed updates (in control panel - programs and features) nothing shows up under Visual Studio 2012?  try this - reinstall VS2012 - reinstall update 2, see if you have a working environment (no missing files), if yes, then use view installed updates to remove update 2.  Working environment still?  Yes, then install update 1, no, then go directly to windows installer cleanup and remove 2012. then start all over (reinstall 2012 RTM, then Update 1)
    Friday, April 19, 2013 11:22 AM
  • It appears that uninstalling Update 2 and Repairing VS 2012 will delete various ATL files which a re-install will not put back on the machine.

    I have opened a Connect issue for this if anyone would care to upvote I'd appreciate it.

    https://connect.microsoft.com/VisualStudio/feedback/details/785396/uninstalling-vs2012-update-2-and-repair-of-vs-results-in-atl-files-missing#details

    John

    Tuesday, April 23, 2013 3:23 PM
  • I also had the problem with ATL going missing after uninstalling Update 2.  As with others, uninstalling vs2012 and reinstalling did not solve the problem.  I ended up searching through my registry and removing all references to vc11, vs2012, etc.  When I reinstalled vs2012, ATL was back and I could then reintall update 1 and get back to business.  But, obviously, that's appalling and I won't ask my team to do the same.

    I have a pending support issue with MS but no joy there, as yet.

    Has anyone tried skipping the uninstall of update 2 and simply uninstalling and reinstalling vs2012 to see if that gets around the atl problem?

    I may try it myself but can't take the time just now.  For now, we're back to vs2010.

    Thanks, Mary

    This from the Microsoft support tech on 4/25/13:

    Yes, I’ve tried it, and it does work for me. Let me iterate the steps that I performed:

    -          Uninstall VS2012 (not Update 2, rather entire VS2012).

    -          Install VS2012 RTM

    -          Install Update 1 QFE (http://go.microsoft.com/fwlink/?LinkId=272396)

    • Edited by mlaclair Thursday, April 25, 2013 1:15 PM
    Wednesday, April 24, 2013 1:42 PM
  • We took the same approach as you did @mlaclair. Here's what I finally patched together to get building gain:

    Uninstall Update 2

    Repair VS 2012 (warning - this is probably what obliterates ATL)

    Uninstall VS 2012

    Delete regkeys:

    HKCU\Software\Microsoft\VisualStudio\11.0

    HKCU\Software\Microsoft\VisualStudio\11.0_Config

    HKLM\Software\Microsoft\VisualStudio\11.0

    HKLM\Software\Wow6432Node\Microsoft\VisualStudio\11.0

    Install VS2012 (notice ATL content returns. yeah!)

    Install Update 1

    [optional :)] Eagerly await Update 3 with C++/CLI debugger fixes....

    Hope this helps someone..

    Note that after doing this I discovered that the tools do not all return under my Microsoft SDKs\Windows\v8.0A\bin\... directories.  Ex: tlbimp.exe and others are gone so perhaps there are more regkeys I missed.

    Wednesday, April 24, 2013 1:54 PM
  • After some testing I can confirm, that we have this problem only in statically linked programs.When program or our own DLLs are dynamically linked they don't import InitializeCriticalSectionEx.

    I have found an interesting change in "c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\include\atlwinverapi.h". Old version has function declaration:
    BOOL _AtlInitializeCriticalSectionEx(__out LPCRITICAL_SECTION lpCriticalSection, __in DWORD dwSpinCount, __in DWORD Flags);

    New version contains inline definition:

    	inline BOOL _AtlInitializeCriticalSectionEx(__out LPCRITICAL_SECTION lpCriticalSection, __in DWORD dwSpinCount, __in DWORD Flags)
    	{
    	#if (NTDDI_VERSION >= NTDDI_VISTA) && !defined(_USING_V110_SDK71_)
    		// InitializeCriticalSectionEx is available in Vista or later, desktop or store apps
    		return ::InitializeCriticalSectionEx(lpCriticalSection, dwSpinCount, Flags);
    	#else
    		UNREFERENCED_PARAMETER(Flags);
    
    		// ...otherwise fall back to using InitializeCriticalSectionAndSpinCount.
    		return ::InitializeCriticalSectionAndSpinCount(lpCriticalSection, dwSpinCount);
    	#endif
    	}
    I have restored this file from old backup, but it hasn't solved the problem.

    Even if you will fix the import, the other issue that a SubSystem Minor/Major in produced PE header isn't compatble with 5.x systems.
    Wednesday, April 24, 2013 4:17 PM
  • use /OPT:REF link option may solve this problem.

    使用 /OPT:REF 这个 Link 选项[可能]解决这个问题。

    Thursday, April 25, 2013 7:25 AM
  • Microsoft gave me a link to Update 1.  It appears to be the same one I had saved previously:

    http://go.microsoft.com/fwlink/?LinkId=272396

    Thursday, April 25, 2013 1:13 PM
  • Running into this problem as well. Which is too bad.

    Has anyone tried the VS 2012 Update 3 CTP?

    http://support.microsoft.com/kb/2835600?wa=wsignin1.0

    Wednesday, May 01, 2013 5:32 PM
  • I haven't tried Update 3 CTP 1 yet, and as its not a go-live release you will probably be best rolling back to Update 1 (Via a clean install and update)

    It's worth noting that this issue was not present in Update 2 CTP 1 through to 4, and only appeared as a late "breaking" change in the final Update 2 RTM.

    Wednesday, May 01, 2013 6:20 PM
  • This issue is not fixed in Update 3 CTP 1. See the link:

    http://support.microsoft.com/kb/2835600

    Click on C++ under the heading "Fixed issues".

    It seems that it would be fixed in the next version, that is, Update 3 CTP 2.


    Sha

    Monday, May 06, 2013 5:27 AM
  • Wednesday, May 08, 2013 12:58 PM
  • I installed Update 3 RC multiple times, and I still have the same issue.
    Sunday, May 12, 2013 1:08 AM
  • If I directly call InitializeCriticalSectionEx in my code, should it work in XP under Update 3 RC?  Here is my sample code, with static ATL

    // testCrit.cpp : Defines the entry point for the console application.
    //

    #include "stdafx.h"

    int _tmain(int argc, _TCHAR* argv[])
    {
    InitializeCriticalSectionEx(0, 0, 0);
    return 0;
    }

    Sunday, May 12, 2013 1:28 AM
  • Never mind, what i should have been testing was InitializeCriticalSection(0)
    Sunday, May 12, 2013 4:50 AM
  • Hey you gota solution to this problem ? Seems Update 3 hasn't solved this problem 
    Saturday, October 12, 2013 8:01 AM
  • Can reproduce also with Update 4, still no solution ?
    Monday, December 23, 2013 2:02 PM