Good morning Grumpy Old Coder. Welcome to Microsoft Newsgroup Support
service. My name is Jialiang Ge [MSFT]. It's my pleasure to work with you
on this thread.
The question is about the error "Failed to delay load library urlmon.dll
(Win32 error: 998)" when you start a C++ app (am I right that this is a
native C++ app, not a managed C++ one?) from a remote computer through the
network shared folder "\\machine\C$\...". The C++ application hosts CLR
(
http://support.microsoft.com/kb/953836) to use a .NET 1.1 assembly.
Although I do not have a direct answer for the question because the problem
may be related to some app/env specific factors, I do have several valuable
suggestions to narrow down the problem and figure out the solution
gradually.
Let's start with the analysis of the error message:
"Failed to delay load library urlmon.dll (Win32 error: 998)"
"delay load library urlmon.dll" should result from the fact that, CLR
hoster implicitly links mscoree.dll (either 1.1 version or 2.0 version
depending on whether the machine is installed with .NET 2.0) that
delay-loads URLMON.dll. You can view this using the tool Dependency Walker
http://www.dependencywalker.com/. URLMON.dll, the OLE32 Extension for
Win32, is a part of Windows located in the folder C:\Windows\System32.
URLMON.dll is not loaded in the load time, and it's loaded only when the
app runs from a remote machine (e.g. from \\machine\C$\...) so as to
perform the internet security checking
(URLMON.dll!CoInternetCreateSecurityManager). This can be the reason for
the symptom that the error is not thrown when the app runs locally.
I'm also reminded about a very similar case that I once handled. In that
case, the customer had an application written in native C++ (CLR support is
off), which calls a WinForm code (written in C#) through a C++ wrapper DLL
that supports CLR. The native C++ application is using implicit linking to
load the C++ wrapper DLL. In some of the deployment machines the
application fails to launch. I analyzed the memory dump from the customer
with the loader snaps, and find that the loader is failing to load modules,
so the process exits without any information. I found that the winmm.dll is
statically linked with the application. After I removed the static linking
to winmm.dll, and used the LoadLibrary API (explicit linking) to call the
winmm.dll function, the issue was resolved. It appears that loading
winmm.dll sometime interferes with delayload. A similar report is here:
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?Feedbac
kID=329819. Grumpy Old Coder, please check whether your app has winmm.dll
linked. The tool Dependency Walker can help.
A very effective and easy trouble-shooting skill for module-loading
problems is to use the function "Profile" in Dependency Walker
(
http://www.dependencywalker.com/). It records the load of the modules and
the function calls when an app runs. Please refer to this article for the
steps to use Depends to get the profiling log
http://support.microsoft.com/kb/256872. You can then either analyze the log
by yourself, or send the log to my mailbox: (e-mail address removed).
The Win32 error 998 means ERROR_NOACCESS (Invalid access to memory
location.), which is the Win32 error code of the Windows status code
STATUS_ACCESS_VIOLATION. In other words, the operating system loader
encounters an access violation while mapping the specified DLL file image
(urlmon.dll in this case) or executing the startup code. To trouble-shoot
this failure, it is also necessary to run the application under a debugger
and enable first chance exception handling for the C0000005 Access
Violation exception. If an access violation occurs when the LoadLibrary()
function is called, the application will break into the debugger. The
debugger's call stack can then be used to trace where the exception
occurred. The stack trace should help you narrow down the actual problem
related to the exception being encountered. Here is an KB article that
provide more info of this:
http://support.microsoft.com/kb/196069. Grumpy
Old Coder, if you are fine with debugging, you may consider setting up
windbg to debug the problem. Otherwise, please capture a memory dump
http://support.microsoft.com/kb/286350 when the error occurs and send the
dump to me. Please note that my previous suggestions (checking winmm.dll,
capturing dependent logs) are easier to do than debugging. I suggest trying
those skills first.
Last but not least, I notice that you have tried a lot of times setting the
no-spam account of our service since Jan. The account is configured
rightly. In future, you may consider contacting this email address:
(e-mail address removed) or reading this article
http://blogs.msdn.com/msdnts/pages/postingAlias.aspx. My managers take
immediate action to guide you to configure the account as soon as they see
the email.
Best Regards,
Jialiang Ge (
[email protected], remove 'online.')
Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.
MSDN Managed Newsgroup support offering is for non-urgent issues where an
initial response from the community or a Microsoft Support Engineer within
2 business day is acceptable. Please note that each follow up response may
take approximately 2 business days as the support professional working with
you may need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations that require urgent,
real-time or phone-based interactions. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.