Powershell : Error code: -1073741502 on windows server 2012 R2 RRS feed

  • Question

  • In PowerShell 
    I am calling an executable file.  Sometimes it returns an error code: -1073741502. some time it completes successfully.

     For this issue, Hotfix is available for window 7 and Windows 2008 server.

    But I got the same error code in Windows 2012 R2 server.

    1) Could you please let me know any hotfix available for Windows 2012 r2 server.
    2) Do I need to change the call method of executable file?

    Powershell Script :

    Log-Message "Run $DdfLogExe $DsiLogFile $Class -c $DdflogSeparator -s $DdflogSummarisation -i $InputDatFile -vi > $DdflogViFile 2>&1" "Out-OVPA" 2
    .$DdfLogExe $DsiLogFile $Class -c $DdflogSeparator -s $DdflogSummarisation -i $InputDatFile -vi 2>&1 | Out-File $DdflogTmpFile
    Log-Message "Return code : $LastExitCode" "Out-OVPA" 3

    Search by Return code in  log file :     
    Out-OVPA :: 3 :: Return code : -1073741502
    Out-OVPA :: 3 :: Return code : -1073741502
    Out-OVPA :: 3 :: Return code : 0
    Out-OVPA :: 3 :: Return code : -1073741502
    Out-OVPA :: 3 :: Return code : 0
    Out-OVPA :: 3 :: Return code : 0

    • Edited by ASHOK P J Thursday, August 2, 2018 10:10 AM
    • Moved by Bill_Stewart Tuesday, December 11, 2018 10:20 PM This is not "research off-topic question for me" forum
    Thursday, August 2, 2018 10:05 AM

All replies

  • This is not a customer service forum.  For issues with your system or with external apps contact MS Support.

    The error you are receiving is NOT a PwoerShell exception as in the KB but is an exception caused by the external program,

    See: https://blogs.msdn.microsoft.com/winsdk/2015/06/03/what-is-up-with-the-application-failed-to-initialize-properly-0xc0000142-error/


    0xc0000142 is "DLL Initialization failed". KERNELBASE.DLL can't initialize itself. Processes that run as services have less of some resources available to them by default. My guess is that you're running out of room in the desktop heap, which is a memory pool from which every process gets some resources. By default, the size of the desktop heap for services is much smaller than it is for interactive processes. There's a tool called DHeapMon which monitors the desktop heap. You could use this tool to see if that's the problem. Here's a page that covers everything you ever wanted to know about the desktop heap:



    Thursday, August 2, 2018 10:38 AM