DVDSample Protection Error

19 views
Skip to first unread message

dbritta1

unread,
Dec 3, 2007, 11:30:34 AM12/3/07
to
When debugging either the DVDSample or PlayDVD sample applications,

I get the infamous message:

Protection Error:

Debugger detected,-please close it down and restart!

I have both Nero and InterVideo decoder filters installed:

// C:\Program Files\InterVideo\Common\Bin\iviaudio.ax

// C:\Program Files\InterVideo\Common\Bin\IVIVIDEO.ax

// C:\Program Files\Common Files\Ahead\DSFilter\NeAudio.ax

// C:\Program Files\Common Files\Ahead\DSFilter\NeVideo.ax

Both the Debug and Release versions of the applications run correctly

with either set of decoder filters outside of the debugger.

The Nero filters appear to generate the "Protection Error".

If the Nero filters are disabled then I get:

hr = m_pIDvdGB->RenderDvdVideoVolume(pszwDiscPath, m_dwRenderFlags,
&buildStatus);

if (FAILED(hr)) // total failure

{

// If there is no DVD decoder, give a user-friendly message

}

When attempting to use the InterVideo filter set!

??? What filter set do I need to run the DVD sample applications
inside the debugger ???

A free download would be nice, as I have already bought the Nero and
InterVideo filters and am a bit frustrated.

Thanks,

Dennis

Alessandro Angeli

unread,
Dec 3, 2007, 12:05:13 PM12/3/07
to
From: "dbritta1"

> If the Nero filters are disabled then I get:

You get what? You posted a code snippet, not an HRESULT or
error message.

> ??? What filter set do I need to run the DVD sample
> applications inside the debugger ???
>
> A free download would be nice, as I have already bought
> the Nero and InterVideo filters and am a bit frustrated.

AFAIK, all the MPEG-2 video decoders the system DVD
navigator likes are commercial decoders that refuse to work
correctly running under a debugger. Which means you need to
run without a debugger and log your actions yourself or do
quite a bit of hacking to prevent the debugger from being
detected (and I don't think this is going to be as easy as
just doing the logging by yourself).


--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm


dbritta1

unread,
Dec 3, 2007, 1:01:30 PM12/3/07
to
On Dec 3, 9:05 am, "Alessandro Angeli" <nob...@nowhere.in.the.net>
wrote:

Dear Alessandro,

Thanks for the reply.

"// If there is no DVD decoder, give a user-friendly message:"
was the section of dvdcore.cpp that generated the InterVideo filter
response that was different from
the Nero filter response. Included to show that different vendors
filters generate different error messages.

// Error message displayed if no DVD decoder is installed
#define MSG_NO_DECODER \
TEXT("The DVD sample could not locate a DVD decoder on your
system.\r\n\r\n") \
TEXT("You must install a third-party DirectShow-compatible
MPEG-2 decoder,\r\n") \
TEXT("either software or hardware-based. Microsoft does not
supply an MPEG2\r\n") \
TEXT("decoder with DirectShow or as an operating system
component.\r\n\r\n") \
TEXT("Please contact your DVD or PC manufacturer for a DVD
decoder.\r\n\r\n") \
TEXT("This sample will now exit.\0")
Was actual error message.

You have stated:

"... all the MPEG-2 video decoders the system DVD


navigator likes are commercial decoders that refuse to work
correctly running under a debugger"

In my prior reply to MarchHare:

"If in fact you are the lead Microsoft developer, and you are stating
that
the DVDSample and PlayDVD sample applications cannot be run under the
Visual
Studio debugger, then this is a very sad state of affairs.

I continue to look for DVD decoder filters that will work with the
debugger..."

I am porting a very complex stereoscopic 3D application to use
standard DVD's for data transfer, developing without a debugger is not
a practical solution.

If I must:
"... do quite a bit of hacking to prevent the debugger from being
detected ...".

Then instructions on how to proceed would be helpful.

Sincerly,
Dennis


matjam

unread,
Dec 3, 2007, 2:34:47 PM12/3/07
to
> Dennis- Hide quoted text -
>
> - Show quoted text -

You could just write a macro that writes debug text to a log file,
this is how I debug a Dvd playback graph.

#define LOG(s,p) \
if(m_fLogging){FILE* fp = fopen("c:\\DVD.log","a"); \
if(fp){ fprintf(fp,s,p); fclose(fp);}}

Just call LOG when you need to log data. It is very helpful in
figuring out what is happening.

e.g. LOG("Log this result %d", hr);

dbritta1

unread,
Dec 3, 2007, 5:35:16 PM12/3/07
to
Dear Matjam,

Thanks for the code sample.

I believe that somewhere on this planet
there is a Visual Studio debugger
compatible MPEG2 DVD decoder filter,
and am hoping that someone
who reads this forum, will let me know
where I can find it.

Someone suggested; "a very old version of a DVD decoder if you can get
it, either WinDVD or PDVD".
Does anyone know if this will work? If so which versions?

Dennis

Alessandro Angeli

unread,
Dec 3, 2007, 6:09:48 PM12/3/07
to
From: "dbritta1"

> I believe that somewhere on this planet
> there is a Visual Studio debugger
> compatible MPEG2 DVD decoder filter,

The issue is not caused by an incompatibility with the VS
debugger but it is caused on purpose by the decoder's
developer by actively checking for the presence of a
debugger and causing all sorts of failure if one is found,
to allegedly prevent you from reverse-engineering his code.

> Someone suggested; "a very old version of a DVD decoder
> if you can get it, either WinDVD or PDVD".
> Does anyone know if this will work? If so which versions?

No, I don't think it will work. AFAIK the DVD navigator does
not accept any MPEG-2 video decoder but only decoders that
support the extensions for WindowsMediaPlayer and/or
MediaCenter which means that old decoders will not work,
since the trend to make decoders debugger-unfriendly started
long before WMP/MCE-compatible ones arrived. If you want to
check whether the DVD navigator accepts arbitrary MPEG-2
video decoders, just use either Elecard's or ffdshow or any
other open source or "professional" decoder for DirectShow.

dbritta1

unread,
Dec 3, 2007, 6:52:46 PM12/3/07
to
Dear Alessandro,

Excellent comments!

I understand the decoder filter developers
desire to prevent reverse engineering,
I have similar concerns with my applications.

There are already DVD products on the market
that require the preinstallation of decoder filters
from other vendors.

Since the end user must purchase and install
the product that contains the decoders,
the decoder developer gets their profit.

Since I must add support for 3D DVDs to
an existing complex system, working without
a debugger is not practical.

I am still hopeful that a debugger friendly
DVDNavigator compatible version of a
MPEG2 DVD filters exists somewhere
(certainly at Ahead and Intervideo),
and someone may help me get a copy.

Meanwhile, you mentioned:


"... do quite a bit of hacking to prevent the debugger from being
detected ...".

How exactly would I do this?

Dennis

Alessandro Angeli

unread,
Dec 3, 2007, 10:18:12 PM12/3/07
to
From: "dbritta1"

> Since I must add support for 3D DVDs to
> an existing complex system, working without
> a debugger is not practical.

I have been debugging my multimedia code without a debugger
for years and it's not that hard: you just need to put a lot
of fprintf() traces in your code.

> I am still hopeful that a debugger friendly
> DVDNavigator compatible version of a
> MPEG2 DVD filters exists somewhere
> (certainly at Ahead and Intervideo),
> and someone may help me get a copy.

Have you tried one of the well-behaved decoders I told you
about?

> Meanwhile, you mentioned:
> "... do quite a bit of hacking to prevent the debugger
> from being detected ...".
> How exactly would I do this?

There is no single recipe because it all depends on how the
specific decoder detects a debugger and how clever the
programmer has been. You need to learn about user-mode API
hooking (and maybe even kernel-mode drivers), the debugging
API, some low-level Win APIs and possibly system interrupts.
Some pointers about this stuff can be found in my FAQ (link
in my signature).

dbritta1

unread,
Dec 4, 2007, 2:52:56 AM12/4/07
to
Dear Alessandro,

"Have you tried one of the well-behaved decoders I told you
about?"

I just tried them, minor quirks, but a workable solution.

Thank you very much for your help!

Sincerly,
Dennis

Barry....@gmail.com

unread,
Dec 4, 2007, 5:17:38 AM12/4/07
to
On Dec 3, 11:09 pm, "Alessandro Angeli" <nob...@nowhere.in.the.net>
wrote:
> From: "dbritta1"
>

> > Someone suggested; "a very old version of a DVD decoder
> > if you can get it, either WinDVD or PDVD".
> > Does anyone know if this will work? If so which versions?
>
> No, I don't think it will work. AFAIK the DVD navigator does
> not accept any MPEG-2videodecoder but only decoders that

> support the extensions for WindowsMediaPlayer and/or
> MediaCenter which means that old decoders will not work,
> since the trend to make decoders debugger-unfriendly started
> long before WMP/MCE-compatible ones arrived. If you want to
> check whether the DVD navigator accepts arbitrary MPEG-2videodecoders, just use either Elecard's or ffdshow or any

> other open source or "professional" decoder for DirectShow.
>

Just a couple of extra thoughts:

I've been building and debugging DVD Navigator graphs for several
years but I haven't come across any MPEG2 decoders that can't be
connected to the DVD Navigator, so I wasn't aware of any
restrictions.

And yes, there are lots of decoders that don't like being loaded under
a debugger. Another good open source decoder to work with is DScaler
(which uses libmpeg2), but if you want a commercial decoder then you
might try contacting the vendor to see if there's debug friendly
version available. We were able to do this with NVidia for PureVideo,
and I think we also obtained some debug friendly versions of the
InterVideo decoders from Hauppauge, though that was only to work with
their TV cards.

BN

Jon E

unread,
Dec 4, 2007, 10:42:02 AM12/4/07
to
Quoting dbritta1:
>
> > If the Nero filters are disabled then I get:
>

If you develop any video software at all - DVD or otherwise - I would
_strongly_ recommend you uninstall Nero. For example, Nero codecs even cause
the error you are getting when you try and play an uncompressed video file
that's nothing to do with them!

> A free download would be nice, as I have already bought the Nero and
> InterVideo filters and am a bit frustrated.

Try uninstalling Nero and then downloading the Elecard codecs. I believe
there is a free trial version so you wont have to fork out money just to find
out if it'll solve your problem or not.

TTFN,
Jon

Barry....@gmail.com

unread,
Dec 4, 2007, 11:39:33 AM12/4/07
to
On Dec 4, 3:42 pm, Jon E <J...@discussions.microsoft.com> wrote:
> Quoting dbritta1:
>
>
>
> > > If the Nero filters are disabled then I get:
>
> If you develop anyvideosoftware at all - DVD or otherwise - I would

> _strongly_ recommend you uninstall Nero. For example, Nero codecs even cause
> the error you are getting when you try and play an uncompressedvideofile
> that's nothing to do with them!
>

That's true. I'd forgotten that early on I hit lots of problems with
code that just used a DirectShow enumeration to list any kind of
codec, not just MPEG codecs - the enumerator loads each codec and
sooner or later something goes bang. I think in the end I just
wrapped the offending code inside a try/catch loop and ignored any
errors. This is probably fine unless you actually want to use one of
the offending codecs. No, actually even that's not quite safe. One
of the NVidia codecs de-registers itself if it sees a debugger, and so
you suddenly wonder why it's stopped working even outside the
debugger.

BN

Alessandro Angeli

unread,
Dec 4, 2007, 12:17:47 PM12/4/07
to
From: "Barry....@gmail.com"

> That's true. I'd forgotten that early on I hit lots of
> problems with code that just used a DirectShow
> enumeration to list any kind of codec, not just MPEG
> codecs - the enumerator loads each codec and sooner or
> later something goes bang. I think in the end I just
> wrapped the offending code inside a try/catch loop and
> ignored any errors.

The Nero decoders are particularly nasty: they seem to freak
out as soon as they are co-created and they terminate the
process, so there is nothing to catch.

However, there is no need to uninstall Nero: you can use
IAMGraphBuilderCallback::FilterSelected() to reject the
filters before they are co-created or just rename Nero's
DSFilter folder.

Alessandro Angeli

unread,
Dec 4, 2007, 12:18:57 PM12/4/07
to
From: "Barry....@gmail.com"

> I've been building and debugging DVD Navigator graphs for
> several years but I haven't come across any MPEG2
> decoders that can't be connected to the DVD Navigator, so
> I wasn't aware of any restrictions.

WMP and MCE don't like any MPEG-2 decoder. Maybe it's just
them and not generically a restriction of the DVD navigator.

dbritta1

unread,
Dec 4, 2007, 1:20:03 PM12/4/07
to
Dear Folks,

After experimentation, decided not to use Elecard due to license and
watermark issues.

Best solution, so far, was found at:
http://sourceforge.net/project/showfiles.php?group_id=173941

I have tested the generic build (stable) July 2, 2007 version.
http://sourceforge.net/project/showfiles.php?group_id=173941&package_id=199421&release_id=469925

Dennis

Alessandro Angeli

unread,
Dec 4, 2007, 1:36:22 PM12/4/07
to
From: "dbritta1"

> After experimentation, decided not to use Elecard due to
> license and watermark issues.
>
> Best solution, so far, was found at:
> http://sourceforge.net/project/showfiles.php?group_id=173941

ffdshow is open source but you still need to comply with its
licensing, which is GPL, hence you are required to open your
application's sources as well (you can read about the GPL
here: http://www.gnu.org/licenses/licenses.html#GPL). You
must also consider that many of the audio and video codecs
implemented in ffdshow require a separate license, including
the MPEG-2 video decoder (see MPEG-LA.org for details) so
you will need licenses for all of them to be allowed to
distribute ffdshow. Commercial implementations like Elecard
are much easier and cheaper.

dbritta1

unread,
Dec 4, 2007, 5:51:46 PM12/4/07
to
Dear Alessandro,

No intention of distributing ffdshow,
just a solution while developing / debugging applications.

My prior comment:


"There are already DVD products on the market
that require the preinstallation of decoder filters
from other vendors."

For example, DDD's TriDef 3D Experience software
suggests / requires preinstallation of WinDVD
or similar package.

Although we are getting off-topic, this brings up an interesting
question:

What prevents an end-user from downloading and installing
ffdshow themselves?

Not exactly an InstallShield solution, but would it be viable?

We already have to do something similar with the nVidia drivers.

Dennis

Alessandro Angeli

unread,
Dec 7, 2007, 10:39:30 AM12/7/07
to
From: "dbritta1"

> Dear Alessandro,
>
> No intention of distributing ffdshow,
> just a solution while developing / debugging applications.

I am not a law enforcer, I don't care :-) I was just
pointing out the licensing issues in case you were not aware
of them.

> What prevents an end-user from downloading and installing
> ffdshow themselves?
>
> Not exactly an InstallShield solution, but would it be
> viable?

I am not a lawyer so I can really answer that. AFAIK the GPL
is tricky in this scenario: it states pretty clearly that
you can not link GPL'ed code, not even at runtime, which
includes loading a third-party DLL, since the license does
not seem to make a distinction regarding who is the owner of
the DLL. On the other hand, how can you be held responsible
for something you did not distribute (well, unless you
encouraged the separate installation)? I am not aware of any
court ruling on this specific issue so making a decision
about which interpretation will prove correct is risky.
AFAIK this is one of the reasons why MS stays as clear as it
can even of LGPL'ed code and most other open-source
licenses.

Reply all
Reply to author
Forward
0 new messages