problems with WPP and C++

I’ve been experimenting with the ‘nonpnp’ WDF sample and would like to
convert it to compile as C++.

The port was easy enough- I changed the filename nonpnp.c to nonpnp.cpp,
added extern “C” around the headers in nonpnp.cpp (including
nonpnp.tmh", updated the SOURCES file to reflect the new filename and
added -dll to RUN_WPP.

Unfortunately, these steps don’t work. I get the following errors:


1>Compiling - nonpnp.cpp for i386
1>errors in directory d:\projects\deleteanytime\nonpnp\sys
1>objchk_wxp_x86\i386\nonpnp.tmh(1630) : error C2220: warning treated as
error - no object file generated
1>objchk_wxp_x86\i386\nonpnp.tmh(1630) : error C4091: ‘’ : ignored on
left of ‘_WPP_TRACE_CONTROL_BLOCK *’ when no variable is declared
1>objchk_wxp_x86\i386\nonpnp.tmh(1630) : error C2143: syntax error :
missing ‘;’ before ‘this’
1>objchk_wxp_x86\i386\nonpnp.tmh(1630) : error C2673: ‘WppTraceCallback’
: global functions do not have ‘this’ pointers
1>objchk_wxp_x86\i386\nonpnp.tmh(1646) : error C2673: ‘WppTraceCallback’
: global functions do not have ‘this’ pointers
1>objchk_wxp_x86\i386\nonpnp.tmh(1648) : error C2673: ‘WppTraceCallback’
: global functions do not have ‘this’ pointers
1>objchk_wxp_x86\i386\nonpnp.tmh(1648) : error C1903: unable to recover

I’ve scoured the web (and OSR Online in particular) and I think I’m
doing everything right. What am I missing?

Thanks,
–Jeremy

Which DDK areyou using? Some of the functions generated from the WPP
templates use a local variable named “this” (unfortunately). This has
been addressed in the WDK.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jeremy Chaney
Sent: Wednesday, August 23, 2006 3:30 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] problems with WPP and C++

I’ve been experimenting with the ‘nonpnp’ WDF sample and would like to
convert it to compile as C++.

The port was easy enough- I changed the filename nonpnp.c to nonpnp.cpp,

added extern “C” around the headers in nonpnp.cpp (including
nonpnp.tmh", updated the SOURCES file to reflect the new filename and
added -dll to RUN_WPP.

Unfortunately, these steps don’t work. I get the following errors:


1>Compiling - nonpnp.cpp for i386
1>errors in directory d:\projects\deleteanytime\nonpnp\sys
1>objchk_wxp_x86\i386\nonpnp.tmh(1630) : error C2220: warning treated as

error - no object file generated
1>objchk_wxp_x86\i386\nonpnp.tmh(1630) : error C4091: ‘’ : ignored on
left of ‘_WPP_TRACE_CONTROL_BLOCK *’ when no variable is declared
1>objchk_wxp_x86\i386\nonpnp.tmh(1630) : error C2143: syntax error :
missing ‘;’ before ‘this’
1>objchk_wxp_x86\i386\nonpnp.tmh(1630) : error C2673: ‘WppTraceCallback’

: global functions do not have ‘this’ pointers
1>objchk_wxp_x86\i386\nonpnp.tmh(1646) : error C2673: ‘WppTraceCallback’

: global functions do not have ‘this’ pointers
1>objchk_wxp_x86\i386\nonpnp.tmh(1648) : error C2673: ‘WppTraceCallback’

: global functions do not have ‘this’ pointers
1>objchk_wxp_x86\i386\nonpnp.tmh(1648) : error C1903: unable to recover

I’ve scoured the web (and OSR Online in particular) and I think I’m
doing everything right. What am I missing?

Thanks,
–Jeremy


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

I’m using 3790.1830. Is there a newer one? I guess I’ll have to go check…
Thanks,
–Jeremy

Doron Holan wrote:

Which DDK areyou using? Some of the functions generated from the WPP
templates use a local variable named “this” (unfortunately). This has
been addressed in the WDK.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jeremy Chaney
Sent: Wednesday, August 23, 2006 3:30 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] problems with WPP and C++

I’ve been experimenting with the ‘nonpnp’ WDF sample and would like to
convert it to compile as C++.

The port was easy enough- I changed the filename nonpnp.c to nonpnp.cpp,

added extern “C” around the headers in nonpnp.cpp (including
nonpnp.tmh", updated the SOURCES file to reflect the new filename and
added -dll to RUN_WPP.

Unfortunately, these steps don’t work. I get the following errors:


1>Compiling - nonpnp.cpp for i386
1>errors in directory d:\projects\deleteanytime\nonpnp\sys
1>objchk_wxp_x86\i386\nonpnp.tmh(1630) : error C2220: warning treated as

error - no object file generated
1>objchk_wxp_x86\i386\nonpnp.tmh(1630) : error C4091: ‘’ : ignored on
left of ‘_WPP_TRACE_CONTROL_BLOCK *’ when no variable is declared
1>objchk_wxp_x86\i386\nonpnp.tmh(1630) : error C2143: syntax error :
missing ‘;’ before ‘this’
1>objchk_wxp_x86\i386\nonpnp.tmh(1630) : error C2673: ‘WppTraceCallback’

: global functions do not have ‘this’ pointers
1>objchk_wxp_x86\i386\nonpnp.tmh(1646) : error C2673: ‘WppTraceCallback’

: global functions do not have ‘this’ pointers
1>objchk_wxp_x86\i386\nonpnp.tmh(1648) : error C2673: ‘WppTraceCallback’

: global functions do not have ‘this’ pointers
1>objchk_wxp_x86\i386\nonpnp.tmh(1648) : error C1903: unable to recover

I’ve scoured the web (and OSR Online in particular) and I think I’m
doing everything right. What am I missing?

Thanks,
–Jeremy


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

The WDK is the only thing newere. What I would do is modify the
template itself.

cd d:\WINDDK\3790.1830\bin\wppconfig\rev1
copy km-wdfinit.tpl km-wdfinit.tpl.bak

then edit km-wdfinit.tpl and replace all instances of “this” with
something else (like “pBlock”) and then clean build your driver

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jeremy Chaney
Sent: Wednesday, August 23, 2006 3:54 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] problems with WPP and C++

I’m using 3790.1830. Is there a newer one? I guess I’ll have to go
check…
Thanks,
–Jeremy

Doron Holan wrote:

Which DDK areyou using? Some of the functions generated from the WPP
templates use a local variable named “this” (unfortunately). This has
been addressed in the WDK.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jeremy Chaney
Sent: Wednesday, August 23, 2006 3:30 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] problems with WPP and C++

I’ve been experimenting with the ‘nonpnp’ WDF sample and would like to

convert it to compile as C++.

The port was easy enough- I changed the filename nonpnp.c to
nonpnp.cpp,

added extern “C” around the headers in nonpnp.cpp (including
nonpnp.tmh", updated the SOURCES file to reflect the new filename and
added -dll to RUN_WPP.

Unfortunately, these steps don’t work. I get the following errors:


1>Compiling - nonpnp.cpp for i386
1>errors in directory d:\projects\deleteanytime\nonpnp\sys
1>objchk_wxp_x86\i386\nonpnp.tmh(1630) : error C2220: warning treated
as

error - no object file generated
1>objchk_wxp_x86\i386\nonpnp.tmh(1630) : error C4091: ‘’ : ignored on
left of ‘_WPP_TRACE_CONTROL_BLOCK *’ when no variable is declared
1>objchk_wxp_x86\i386\nonpnp.tmh(1630) : error C2143: syntax error :
missing ‘;’ before ‘this’
1>objchk_wxp_x86\i386\nonpnp.tmh(1630) : error C2673:
‘WppTraceCallback’

: global functions do not have ‘this’ pointers
1>objchk_wxp_x86\i386\nonpnp.tmh(1646) : error C2673:
‘WppTraceCallback’

: global functions do not have ‘this’ pointers
1>objchk_wxp_x86\i386\nonpnp.tmh(1648) : error C2673:
‘WppTraceCallback’

: global functions do not have ‘this’ pointers
1>objchk_wxp_x86\i386\nonpnp.tmh(1648) : error C1903: unable to
recover

I’ve scoured the web (and OSR Online in particular) and I think I’m
doing everything right. What am I missing?

Thanks,
–Jeremy


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Doron Holan wrote:

Which DDK areyou using? Some of the functions generated from the WPP
templates use a local variable named “this” (unfortunately). This has
been addressed in the WDK.

Fortunately, “this” is easy to fix. It’s in
3790.1830\bin\wppconfig\rev1\km-wdfinit.tpl, at about line 416. Just
replace 9 occurrances of “this” with another variable name. I used “cntl”.

There are three occurrances of the word “this” in comments that do not
need to be changed.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

OK, I’ll give that a go. Thanks for the advice.
–Jeremy

Doron Holan wrote:

The WDK is the only thing newere. What I would do is modify the
template itself.

cd d:\WINDDK\3790.1830\bin\wppconfig\rev1
copy km-wdfinit.tpl km-wdfinit.tpl.bak

then edit km-wdfinit.tpl and replace all instances of “this” with
something else (like “pBlock”) and then clean build your driver

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jeremy Chaney
Sent: Wednesday, August 23, 2006 3:54 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] problems with WPP and C++

I’m using 3790.1830. Is there a newer one? I guess I’ll have to go
check…
Thanks,
–Jeremy

Doron Holan wrote:
> Which DDK areyou using? Some of the functions generated from the WPP
> templates use a local variable named “this” (unfortunately). This has
> been addressed in the WDK.
>
> d
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Jeremy Chaney
> Sent: Wednesday, August 23, 2006 3:30 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] problems with WPP and C++
>
> I’ve been experimenting with the ‘nonpnp’ WDF sample and would like to

> convert it to compile as C++.
>
> The port was easy enough- I changed the filename nonpnp.c to
nonpnp.cpp,
> added extern “C” around the headers in nonpnp.cpp (including
> nonpnp.tmh", updated the SOURCES file to reflect the new filename and
> added -dll to RUN_WPP.
>
> Unfortunately, these steps don’t work. I get the following errors:
>
> ---------
> 1>Compiling - nonpnp.cpp for i386
> 1>errors in directory d:\projects\deleteanytime\nonpnp\sys
> 1>objchk_wxp_x86\i386\nonpnp.tmh(1630) : error C2220: warning treated
as
> error - no object file generated
> 1>objchk_wxp_x86\i386\nonpnp.tmh(1630) : error C4091: ‘’ : ignored on
> left of ‘_WPP_TRACE_CONTROL_BLOCK *’ when no variable is declared
> 1>objchk_wxp_x86\i386\nonpnp.tmh(1630) : error C2143: syntax error :
> missing ‘;’ before ‘this’
> 1>objchk_wxp_x86\i386\nonpnp.tmh(1630) : error C2673:
‘WppTraceCallback’
> : global functions do not have ‘this’ pointers
> 1>objchk_wxp_x86\i386\nonpnp.tmh(1646) : error C2673:
‘WppTraceCallback’
> : global functions do not have ‘this’ pointers
> 1>objchk_wxp_x86\i386\nonpnp.tmh(1648) : error C2673:
‘WppTraceCallback’
> : global functions do not have ‘this’ pointers
> 1>objchk_wxp_x86\i386\nonpnp.tmh(1648) : error C1903: unable to
recover
> -----------------
>
>
> I’ve scoured the web (and OSR Online in particular) and I think I’m
> doing everything right. What am I missing?
>
> Thanks,
> --Jeremy
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer