473,396 Members | 1,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Please help me on LoaderLock ...

I'm trying to call a third party dll routine from C# using pinvoke.
Unfortunately I obtain a LoaderLock exception and my application
stops. I've seen that it must be some uncorrect behaviour of the
called routine, but I can't modify it.

Note that calling this routine from a C++ project does not give off
any error.

How can I do?
Thank you!

May 21 '07 #1
11 2250
Beorne,

Without seeing the declaration of the method to call through P/Invoke,
as well as the original declaration in C++, as well as the call site in C#,
and any needed structures/typedefs, it's impossible to say.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Beorne" <ma*******@gmail.comwrote in message
news:11**********************@y2g2000prf.googlegro ups.com...
I'm trying to call a third party dll routine from C# using pinvoke.
Unfortunately I obtain a LoaderLock exception and my application
stops. I've seen that it must be some uncorrect behaviour of the
called routine, but I can't modify it.

Note that calling this routine from a C++ project does not give off
any error.

How can I do?
Thank you!

May 21 '07 #2
"Beorne" <ma*******@gmail.comwrote in message
news:11**********************@y2g2000prf.googlegro ups.com...
I'm trying to call a third party dll routine from C# using pinvoke.
Unfortunately I obtain a LoaderLock exception and my application
stops. I've seen that it must be some uncorrect behaviour of the
called routine, but I can't modify it.

Note that calling this routine from a C++ project does not give off
any error.

How can I do?
Thank you!

The problem is with the DLL, for one or another reason it calls (directly or
indirectly) into managed code while under the loader lock. If this happens
at the first call into this DLL, it means that call is done from within DLL
main. Anyway, there is very little you can do about this, I would suggest
you to ping that back to the third party and ask for a fix the DLL. Note
that the exception is thrown when running in the debugger only, what happens
with your application when run in release mode?

Willy.

May 21 '07 #3
The loader-lock warning shows up with numerous 3rd-party GUI DLLs as
well as MS's own managed DirectX9 stuff. It's mostly harmless. Shut it
off in the exceptions list under Managed Debugging Assistants.

May 21 '07 #4
On Mon, 21 May 2007 08:37:02 -0700, Willy Denoyette [MVP]
<wi*************@telenet.bewrote:
The problem is with the DLL, for one or another reason it calls
(directly or indirectly) into managed code while under the loader lock.
If this happens at the first call into this DLL, it means that call is
done from within DLL main. Anyway, there is very little you can do about
this, I would suggest you to ping that back to the third party and ask
for a fix the DLL.
For what it's worth, the only time I've seen this MDA is when using the
DirectX.AudioVideoPlayback component. It does seem to work properly, and
I just wind up disabling that MDA exception when using the
AudioVideoPlayback component.

Just who should I "ping that back to" at Microsoft, since it's their
component?

Pete
May 21 '07 #5
"Peter Duniho" <Np*********@nnowslpianmk.comwrote in message
news:op***************@petes-computer.local...
On Mon, 21 May 2007 08:37:02 -0700, Willy Denoyette [MVP]
<wi*************@telenet.bewrote:
>The problem is with the DLL, for one or another reason it calls
(directly or indirectly) into managed code while under the loader lock.
If this happens at the first call into this DLL, it means that call is
done from within DLL main. Anyway, there is very little you can do about
this, I would suggest you to ping that back to the third party and ask
for a fix the DLL.

For what it's worth, the only time I've seen this MDA is when using the
DirectX.AudioVideoPlayback component. It does seem to work properly, and
I just wind up disabling that MDA exception when using the
AudioVideoPlayback component.

Just who should I "ping that back to" at Microsoft, since it's their
component?

Pete

May 21 '07 #6
"Peter Duniho" <Np*********@nnowslpianmk.comwrote in message
news:op***************@petes-computer.local...
On Mon, 21 May 2007 08:37:02 -0700, Willy Denoyette [MVP]
<wi*************@telenet.bewrote:
>The problem is with the DLL, for one or another reason it calls
(directly or indirectly) into managed code while under the loader lock.
If this happens at the first call into this DLL, it means that call is
done from within DLL main. Anyway, there is very little you can do about
this, I would suggest you to ping that back to the third party and ask
for a fix the DLL.

For what it's worth, the only time I've seen this MDA is when using the
DirectX.AudioVideoPlayback component. It does seem to work properly, and
I just wind up disabling that MDA exception when using the
AudioVideoPlayback component.

Just who should I "ping that back to" at Microsoft, since it's their
component?

Pete

True , the MDX dll's are "broken" in this sense, note that the MDA is a
warning that you are actually operating under the loaderlock, if you take
another loader lock while under this lock, you will deadlock. MS apparently
assumes that there is no real danger for this to happen ;-).
MDX components are at v1.1, aren't we supposed to move from MDX to XNA?

Willy.
May 21 '07 #7
On Mon, 21 May 2007 12:34:11 -0700, Willy Denoyette [MVP]
<wi*************@telenet.bewrote:
True , the MDX dll's are "broken" in this sense, note that the MDA is a
warning that you are actually operating under the loaderlock, if you
take another loader lock while under this lock, you will deadlock. MS
apparently assumes that there is no real danger for this to happen ;-).
Well, so far so good. :) I don't know if they're right, but I haven't
deadlocked yet. :)
MDX components are at v1.1, aren't we supposed to move from MDX to XNA?
Are we? I don't even know anything about XNA yet. If it's as easy to get
as the MDX, that's fine with me. If not, I can't imagine why I'd switch.
:)

Pete
May 21 '07 #8
"Peter Duniho" <Np*********@nnowslpianmk.comwrote in message
news:op***************@petes-computer.local...
On Mon, 21 May 2007 12:34:11 -0700, Willy Denoyette [MVP]
<wi*************@telenet.bewrote:
>True , the MDX dll's are "broken" in this sense, note that the MDA is a
warning that you are actually operating under the loaderlock, if you
take another loader lock while under this lock, you will deadlock. MS
apparently assumes that there is no real danger for this to happen ;-).

Well, so far so good. :) I don't know if they're right, but I haven't
deadlocked yet. :)
>MDX components are at v1.1, aren't we supposed to move from MDX to XNA?

Are we? I don't even know anything about XNA yet. If it's as easy to get
as the MDX, that's fine with me. If not, I can't imagine why I'd switch.
:)
Could be wrong, but as far as I know XNA was announced to be the successor
of MDX, the latest MDX was built for v1.1 of the framework while the XNA
framework uses .NET v2, note also that MDX 2.0 (since years in beta) is no
longer included in the DX SDK.
This http://msdn2.microsoft.com/en-us/library/bb197956.aspx maybe you will
find some answers about MDX vs. XNA.

Willy.

May 21 '07 #9
On Mon, 21 May 2007 14:34:50 -0700, Willy Denoyette [MVP]
<wi*************@telenet.bewrote:
Could be wrong, but as far as I know XNA was announced to be the
successor of MDX, the latest MDX was built for v1.1 of the framework
while the XNA framework uses .NET v2, note also that MDX 2.0 (since
years in beta) is no longer included in the DX SDK.
This http://msdn2.microsoft.com/en-us/library/bb197956.aspx maybe you
will find some answers about MDX vs. XNA.
Well, as near as I can tell from that page and some nearby ones, XNA
doesn't provide any video support at all. Presumably this is a
consequence of DirectShow being moved out of the DirectX SDK and into the
Platform SDK, or maybe they moved it because they didn't want it in XNA.

Either way, the "Video" part of the AudioVideoPlayback component in MDX
doesn't appear to be supported in XNA. So, at least for that component,
XNA is definitely not a new a better way to access the functionality minus
the Loader Lock MDA exception.

Pete
May 21 '07 #10
"Peter Duniho" <Np*********@nnowslpianmk.comwrote in message
news:op***************@petes-computer.local...
On Mon, 21 May 2007 14:34:50 -0700, Willy Denoyette [MVP]
<wi*************@telenet.bewrote:
>Could be wrong, but as far as I know XNA was announced to be the
successor of MDX, the latest MDX was built for v1.1 of the framework
while the XNA framework uses .NET v2, note also that MDX 2.0 (since
years in beta) is no longer included in the DX SDK.
This http://msdn2.microsoft.com/en-us/library/bb197956.aspx maybe you
will find some answers about MDX vs. XNA.

Well, as near as I can tell from that page and some nearby ones, XNA
doesn't provide any video support at all. Presumably this is a
consequence of DirectShow being moved out of the DirectX SDK and into the
Platform SDK, or maybe they moved it because they didn't want it in XNA.

Either way, the "Video" part of the AudioVideoPlayback component in MDX
doesn't appear to be supported in XNA. So, at least for that component,
XNA is definitely not a new a better way to access the functionality minus
the Loader Lock MDA exception.

Pete

I see, well I guess you could contact Michael Klucher (XNA PM) and ask about
the status of MDX vs. XNA, see if they plan to add this feature to XNA, or
they'll offer an alternative.. All I know is that MDX, which was built
around V1.1 using ME C++ ( hence the Loader Lock issue on V2), is a "dead"
product.

Willy.
May 22 '07 #11

"Beorne" <ma*******@gmail.comwrote in message
news:11**********************@y2g2000prf.googlegro ups.com...
I'm trying to call a third party dll routine from C# using pinvoke.
Unfortunately I obtain a LoaderLock exception and my application
stops. I've seen that it must be some uncorrect behaviour of the
called routine, but I can't modify it.

Note that calling this routine from a C++ project does not give off
any error.
You may be able to get somewhere by forcing the needed DLLs to load, outside
LoaderLock, before calling the buggy component. That is probably what is
happening with C++. Dependency Walker could show you what DLLs are being
used.
>
How can I do?
Thank you!

May 22 '07 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: rked | last post by:
I get nameSPAN1 is undefined when I place cursor in comments box.. <%@ LANGUAGE="VBScript" %> <% DIM ipAddress ipAddress=Request.Servervariables("REMOTE_HOST") %> <html> <head> <meta...
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
4
by: pshindle | last post by:
DB2 Team - I just downloaded and unzipped the new Fixpack 9 for DB2 ESE V8 for Windows (FP9_WR21350_ESE.exe). I then burned the unzipped Fixpack files to a CD. I proceded to install this...
4
by: Madhu Gopinathan | last post by:
Hi All, I am faced with a horrible hang problem. I have a COM exe server that executes some tasks. The task execution manager is a thread that manages the pool of threads, which is 4 per processor....
0
by: jnospamster | last post by:
I am getting a LoaderLock message in an application I have written for ..Net 2.0 in C#. It contains only pure managed assemblies. The application consists of 1 dll and 2 .exe projects which...
3
by: Light | last post by:
I've a few questions on platform invoke and some issues I've seen. 1. Is it possible to avoid LoaderLock exception without simply turning it off? Does it occur in .NET projects with win32 dll or...
3
by: Ron | last post by:
I have two forms. When I click on new entry I hide current form and show form2 as soon as I click on a textbox in form2 I get a loaderlock error. What is this? How can I get rid of this?
3
by: aaron.m.johnson | last post by:
Help me understand this, please. I have an older VC++ COM DLL that I'm using in a C# project. One of the COM objects takes a callback object as a parameter so that it can spin off a thread and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.