Oddness in module name qualifier for c++ syntax.

I changed to c++ syntax, and then found out the hard way that:

bp mydriver!driverentry
No longer works. You get:

Type conflict error at ‘’

According the the help:
Under General Symbol Syntax Rules
Symbol Syntax and Symbol Matching

A symbol name may be qualified by a module name. An exclamation mark (!)
separates the module name from the symbol (for instance, mymodule!main).
If no module name is used, the symbol can still be prefixed with an
exclamation mark.

(which implies it should work for both syntax)

The only thing that will work is (other than changing back to masm syntax):

bp @@(mydriver!driverentry)

You would think some think like :: would work, but it doesn’t.

Any one know the trick?

Use the brute force !!

Look at what the decorated symbols using —

kd> x mymodule!*

The * means anything and everything …

-pro

On Tue, Jul 22, 2008 at 1:27 PM, Jim Donelson wrote:

> I changed to c++ syntax, and then found out the hard way that:
> >bp mydriver!driverentry
> No longer works. You get:
>
> Type conflict error at ‘’
>
> According the the help:
> Under General Symbol Syntax Rules
>
> A symbol name may be qualified by a module name. An exclamation mark (!)
> separates the module name from the symbol (for instance, mymodule!main).
> If no module name is used, the symbol can still be prefixed with an
> exclamation mark.
>
> (which implies it should work for both syntax)
>
> The only thing that will work is (other than changing back to masm syntax):
>
> bp @@(mydriver!driverentry)
>
> You would think some think like :: would work, but it doesn’t.
>
> Any one know the trick?
>
>
>
> — You are currently subscribed to windbg as: xxxxx@gmail.com To
> unsubscribe send a blank email to xxxxx@lists.osr.com

Ok, it’s a really odd bug that I am seeing.
If I unload the driver and clear all the breakpoints, then do:
kd> .expr /s c++
kd> bp mydriver!driverentry
Type conflict error at ‘’

But:
kd> bp @@(mydriver!driverentry)
Works.
However, after the driver loads (and one break point has been set)
kd> bp mydriver!somefunction

Works…
Weird.

On Tue, Jul 22, 2008 at 4:36 PM, Prokash Sinha wrote:

> Use the brute force !!
>
> Look at what the decorated symbols using —
>
> kd> x mymodule!
>
>
> The * means anything and everything …
>
> -pro
>
> On Tue, Jul 22, 2008 at 1:27 PM, Jim Donelson wrote:
>
>> I changed to c++ syntax, and then found out the hard way that:
>> >bp mydriver!driverentry
>> No longer works. You get:
>>
>> Type conflict error at ‘’
>>
>> According the the help:
>> Under General Symbol Syntax Rules
>>
>> A symbol name may be qualified by a module name. An exclamation mark (
!*)
>> separates the module name from the symbol (for instance, mymodule!main).
>> If no module name is used, the symbol can still be prefixed with an
>> exclamation mark.
>>
>> (which implies it should work for both syntax)
>>
>> The only thing that will work is (other than changing back to masm
>> syntax):
>>
>> bp @@(mydriver!driverentry)
>>
>> You would think some think like :: would work, but it doesn’t.
>>
>> Any one know the trick?
>>
>>
>>
>> — You are currently subscribed to windbg as: xxxxx@gmail.com To
>> unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
> — You are currently subscribed to windbg as: xxxxx@jimdonelson.com To
> unsubscribe send a blank email to xxxxx@lists.osr.com

Have you read the information about using C++ in drivers on the Microsoft Site? Mark Roddy’s site (www.hollistech.com)? DriverEntry is a required export for drivers and the best way is to declare it as using “C” decoration since you should never have to refer to it in your driver code.
“Jim Donelson” wrote in message news:xxxxx@windbg…
Ok, it’s a really odd bug that I am seeing.
If I unload the driver and clear all the breakpoints, then do:
kd> .expr /s c++
kd> bp mydriver!driverentry
Type conflict error at ‘’

But:
kd> bp @@(mydriver!driverentry)
Works.
However, after the driver loads (and one break point has been set)
kd> bp mydriver!somefunction

Works…
Weird.

On Tue, Jul 22, 2008 at 4:36 PM, Prokash Sinha wrote:

Use the brute force !!

Look at what the decorated symbols using —

kd> x mymodule!*

The * means anything and everything …

-pro

On Tue, Jul 22, 2008 at 1:27 PM, Jim Donelson wrote:

I changed to c++ syntax, and then found out the hard way that:
>bp mydriver!driverentry
No longer works. You get:

Type conflict error at ‘’

According the the help:
Under General Symbol Syntax Rules

A symbol name may be qualified by a module name. An exclamation mark (!) separates the module name from the symbol (for instance, mymodule!main). If no module name is used, the symbol can still be prefixed with an exclamation mark.

(which implies it should work for both syntax)

The only thing that will work is (other than changing back to masm syntax):

bp @@(mydriver!driverentry)

You would think some think like :: would work, but it doesn’t.

Any one know the trick?

— You are currently subscribed to windbg as: xxxxx@gmail.com To unsubscribe send a blank email to xxxxx@lists.osr.com

— You are currently subscribed to windbg as: xxxxx@jimdonelson.com To unsubscribe send a blank email to xxxxx@lists.osr.com

The default syntax you set in WinDbg has nothing what so ever to do with
using c++ in your code.
It it just an alternative syntax for expressions in WinDbg, which I tried
out and is is more to my liking.

Anyway, it turns out the bug is only if it is a deferred break point.

  • If you use masm syntax then:
    bp mydriver!driverentry works fine - if the driver is not loaded, it sets
    a deferred break point . Always has, done it for years.
  • if you switch to c++ syntax, and the driver is NOT loaded, then
    bp mydriver!driverentry fails as shown.

However if the driver is loaded, then it works fine.

It’s just an odd bug, when when you set c++ syntax as the default, windbg
will not set a deferred break point.

On Tue, Jul 22, 2008 at 6:35 PM, David Craig wrote:

> Have you read the information about using C++ in drivers on the Microsoft
> Site? Mark Roddy’s site (www.hollistech.com)? DriverEntry is a required
> export for drivers and the best way is to declare it as using “C” decoration
> since you should never have to refer to it in your driver code.
>
> “Jim Donelson” wrote in message news:xxxxx@windbg…
> Ok, it’s a really odd bug that I am seeing.
> If I unload the driver and clear all the breakpoints, then do:
> kd> .expr /s c++
> kd> bp mydriver!driverentry
> Type conflict error at ‘’
>
> But:
> kd> bp @@(mydriver!driverentry)
> Works.
> However, after the driver loads (and one break point has been set)
> kd> bp mydriver!somefunction
>
> Works…
> Weird.
>
>
>
>
>
>
> On Tue, Jul 22, 2008 at 4:36 PM, Prokash Sinha wrote:
>
>> Use the brute force !!
>>
>> Look at what the decorated symbols using —
>>
>> kd> x mymodule!
>>
>>
>> The * means anything and everything …
>>
>> -pro
>>
>> On Tue, Jul 22, 2008 at 1:27 PM, Jim Donelson
>> wrote:
>>
>>> I changed to c++ syntax, and then found out the hard way that:
>>> >bp mydriver!driverentry
>>> No longer works. You get:
>>>
>>> Type conflict error at ‘’
>>>
>>> According the the help:
>>> Under General Symbol Syntax Rules
>>>
>>> A symbol name may be qualified by a module name. An exclamation mark (
!
>>> *) separates the module name from the symbol (for instance,
>>> mymodule!main
). If no module name is used, the symbol can still be
>>> prefixed with an exclamation mark.
>>>
>>> (which implies it should work for both syntax)
>>>
>>> The only thing that will work is (other than changing back to masm
>>> syntax):
>>>
>>> bp @@(mydriver!driverentry)
>>>
>>> You would think some think like :: would work, but it doesn’t.
>>>
>>> Any one know the trick?
>>>
>>>
>>>
>>> — You are currently subscribed to windbg as: xxxxx@gmail.com To
>>> unsubscribe send a blank email to xxxxx@lists.osr.com
>>
>>
>> — You are currently subscribed to windbg as: xxxxx@jimdonelson.com To
>> unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
> —
> You are currently subscribed to windbg as: unknown lmsubst tag argument: ‘’
>
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>