Zombie COM Surrogate (WinInetCacheServer) processes when running MAPI in a 64-bit MFC Application via Task Scheduler
I have a 32-bit C++ MFC Windows application that calls MAPI via the Windows MAPI API. Recently, I compiled the application to 64-bit, and it runs fine when launched manually. However, when I schedule the same 64-bit version to run via Windows Task Scheduler, every time the task runs, a COM Surrogate (dllhost.exe
) process is created and doesn't exist, so I end up with many instances of this process. This doesn't happen under Task Scheduler when running the 32-bit build. It also doesn't happen when the MAPI client (Outlook.exe) is unavailable.
Using Process Explorer, I found that the CLSID responsible is 3EB3C877-1F16-487C-9050-104DBCD66683
:
C:\Windows\system32\DllHost.exe /Processid:{3EB3C877-1F16-487C-9050-104DBCD66683}
This CLSID shows up as WinInetCacheServer
when searching the registry. This seems to indicate that MAPI, via my application, is triggering network or cache-related operations that are being handled by the COM Surrogate and it's not cleaning up after itself.
- Why does running the task under Task Scheduler trigger the
WinInetCacheServer
COM Surrogate, and not when run manually? - Is there a way to prevent Task Scheduler from invoking the COM Surrogate process, or control its behavior?
- Could MAPI or other network-related calls in my application be causing this, and how do I manage it properly in a 64-bit context?
Any advice on how to fix this issue would be greatly appreciated!