The project that generated the C++ and WDF question, now raises one with C++
and WPP. It seems the generated TMH file from the WPP compile produces
source using “this” as a local variable name. Now I highly suspect this is a
C++ gotcha since the same struct definition is used in a prior case but
different variable name works. It literally looks like this:
GOOD usage:
PWPP_TRACE_CONTROL_BLOCK cntl;
BAD usage:
PWPP_TRACE_CONTROL_BLOCK this;
I even tried encapsualting filename.tmh in extern “C” {}, but that only
increased the errors. Why on earth was “this” used as a variable name? Or am
I still wondering down the wrong path? Inquiring old geezers want to know
“why”.
I’ve effectively surrendered and renamed my CPP file with a C extension and
removed all the “C” encapsulations.
–
The personal opinion of
Gary G. Little
Question: What percentage of Microsoft’s kernel code is written in C++?
“Gary G. Little” wrote in message news:xxxxx@ntdev…
> The project that generated the C++ and WDF question, now raises one with
> C++ and WPP. It seems the generated TMH file from the WPP compile produces
> source using “this” as a local variable name. Now I highly suspect this is
> a C++ gotcha since the same struct definition is used in a prior case but
> different variable name works. It literally looks like this:
>
> GOOD usage:
> PWPP_TRACE_CONTROL_BLOCK cntl;
>
> BAD usage:
> PWPP_TRACE_CONTROL_BLOCK this;
>
> I even tried encapsualting filename.tmh in extern “C” {}, but that only
> increased the errors. Why on earth was “this” used as a variable name? Or
> am I still wondering down the wrong path? Inquiring old geezers want to
> know “why”.
>
> I’ve effectively surrendered and renamed my CPP file with a C extension
> and removed all the “C” encapsulations.
>
> –
> The personal opinion of
> Gary G. Little
>
>
To use WPP w/C++, you need to do this
Extern “C” {
#include “foo.tmh”
}
In addition, if you have any C files also using WPP mixed with CPP
files, your mileage may vary b/c the tmh files declare a bunch of
globals that it relies on the linker to merge, and if they have
different mangling b/c of C++ and C inclusions, things can get dicey
(although wrapping the #include with an extern “C” usually solves the
problem).
As for the “this” issue, you need to manually edit the TPL file if the
above doesn’t help. For that, goto \bin\wppconfig\rev1 and
edit
km-wdfinit.tpl, changing all instances of the “this” variable to
something else (pBlock is what I changed it to). This will be fixed in
the next KMDF drop
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Gary G. Little
Sent: Tuesday, August 02, 2005 2:34 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] C++ and WPP
The project that generated the C++ and WDF question, now raises one with
C++
and WPP. It seems the generated TMH file from the WPP compile produces
source using “this” as a local variable name. Now I highly suspect this
is a
C++ gotcha since the same struct definition is used in a prior case but
different variable name works. It literally looks like this:
GOOD usage:
PWPP_TRACE_CONTROL_BLOCK cntl;
BAD usage:
PWPP_TRACE_CONTROL_BLOCK this;
I even tried encapsualting filename.tmh in extern “C” {}, but that only
increased the errors. Why on earth was “this” used as a variable name?
Or am
I still wondering down the wrong path? Inquiring old geezers want to
know
“why”.
I’ve effectively surrendered and renamed my CPP file with a C extension
and
removed all the “C” encapsulations.
–
The personal opinion of
Gary G. Little
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
The kernel itself? None of it. The KS related stacks have C++ in them,
KMDF uses C++ for implementation inheritance only.
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Lyndon J Clarke
Sent: Tuesday, August 02, 2005 2:40 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] C++ and WPP
Question: What percentage of Microsoft’s kernel code is written in C++?
“Gary G. Little” wrote in message
news:xxxxx@ntdev…
> The project that generated the C++ and WDF question, now raises one
with
> C++ and WPP. It seems the generated TMH file from the WPP compile
produces
> source using “this” as a local variable name. Now I highly suspect
this is
> a C++ gotcha since the same struct definition is used in a prior case
but
> different variable name works. It literally looks like this:
>
> GOOD usage:
> PWPP_TRACE_CONTROL_BLOCK cntl;
>
> BAD usage:
> PWPP_TRACE_CONTROL_BLOCK this;
>
> I even tried encapsualting filename.tmh in extern “C” {}, but that
only
> increased the errors. Why on earth was “this” used as a variable name?
Or
> am I still wondering down the wrong path? Inquiring old geezers want
to
> know “why”.
>
> I’ve effectively surrendered and renamed my CPP file with a C
extension
> and removed all the “C” encapsulations.
>
> –
> The personal opinion of
> Gary G. Little
>
>
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of Lyndon J Clarke
Question: What percentage of Microsoft’s kernel code is
written in C++?
It is a small percentage. The biggest MS kernel driver written in C++
is win32k.sys .
I may be wrong here but some of COM port drivers are also written in C++.
Dmitriy Budko, VMware
Serial.sys is C. Perhaps some of the 3rd party drivers are in C++, but
that is source code not controlled by MSFT.
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Dmitriy Budko
Sent: Tuesday, August 02, 2005 3:59 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] C++ and WPP
[mailto:xxxxx@lists.osr.com]On Behalf Of Lyndon J Clarke
Question: What percentage of Microsoft’s kernel code is
written in C++?
It is a small percentage. The biggest MS kernel driver written in C++
is win32k.sys .
I may be wrong here but some of COM port drivers are also written in
C++.
Dmitriy Budko, VMware
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
From what I know - only FTDISK and PORTCLS.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: “Lyndon J Clarke”
Newsgroups: ntdev
To: “Windows System Software Devs Interest List”
Sent: Wednesday, August 03, 2005 1:40 AM
Subject: Re:[ntdev] C++ and WPP
> Question: What percentage of Microsoft’s kernel code is written in C++?
I have no idea, really do not care, and have no intention of writing
classes. I’m simply looking to use C++ as a better C.
–
The personal opinion of
Gary G. Little
“Lyndon J Clarke” wrote in message
news:xxxxx@ntdev…
> Question: What percentage of Microsoft’s kernel code is written in C++?
>
> “Gary G. Little” wrote in message news:xxxxx@ntdev…
>> The project that generated the C++ and WDF question, now raises one with
>> C++ and WPP. It seems the generated TMH file from the WPP compile
>> produces source using “this” as a local variable name. Now I highly
>> suspect this is a C++ gotcha since the same struct definition is used in
>> a prior case but different variable name works. It literally looks like
>> this:
>>
>> GOOD usage:
>> PWPP_TRACE_CONTROL_BLOCK cntl;
>>
>> BAD usage:
>> PWPP_TRACE_CONTROL_BLOCK this;
>>
>> I even tried encapsualting filename.tmh in extern “C” {}, but that only
>> increased the errors. Why on earth was “this” used as a variable name? Or
>> am I still wondering down the wrong path? Inquiring old geezers want to
>> know “why”.
>>
>> I’ve effectively surrendered and renamed my CPP file with a C extension
>> and removed all the “C” encapsulations.
>>
>> –
>> The personal opinion of
>> Gary G. Little
>>
>>
>
>
>
Lyndon,
That last post should have had a smiley on it. I was not intending to sound
snide, which it could.
Doran,
Sheet … so I modified the TPL file, AFTER renaming the source file to CPP,
and removing the comments on all of the “C” encapsulation lines, and now I
get a linkage edit error declaring that a CRT section exists; there may be
yada yada … . I think I need to move this over to the WDF forums, but
having moved to Minnesota, changing ISP and replacing computers I have
managed to loose all ability to contact the WDF Beta boys and girls to
update my profile and get my login info. So … if you can kindly give me an
email address I shall remove the respirator (me) and let these threads
expire on their own.
–
The personal opinion of
Gary G. Little
“Gary G. Little” wrote in message news:xxxxx@ntdev…
>I have no idea, really do not care, and have no intention of writing
>classes. I’m simply looking to use C++ as a better C.
>
> –
> The personal opinion of
> Gary G. Little
>
> “Lyndon J Clarke” wrote in message
> news:xxxxx@ntdev…
>> Question: What percentage of Microsoft’s kernel code is written in C++?
>>
>> “Gary G. Little” wrote in message news:xxxxx@ntdev…
>>> The project that generated the C++ and WDF question, now raises one with
>>> C++ and WPP. It seems the generated TMH file from the WPP compile
>>> produces source using “this” as a local variable name. Now I highly
>>> suspect this is a C++ gotcha since the same struct definition is used in
>>> a prior case but different variable name works. It literally looks like
>>> this:
>>>
>>> GOOD usage:
>>> PWPP_TRACE_CONTROL_BLOCK cntl;
>>>
>>> BAD usage:
>>> PWPP_TRACE_CONTROL_BLOCK this;
>>>
>>> I even tried encapsualting filename.tmh in extern “C” {}, but that only
>>> increased the errors. Why on earth was “this” used as a variable name?
>>> Or am I still wondering down the wrong path? Inquiring old geezers want
>>> to know “why”.
>>>
>>> I’ve effectively surrendered and renamed my CPP file with a C extension
>>> and removed all the “C” encapsulations.
>>>
>>> –
>>> The personal opinion of
>>> Gary G. Little
>>>
>>>
>>
>>
>>
>
>
>
Did you specify -dll in RUN_WPP your sources file? That should get rid
of the global constructor problem (which manifests itself as a CRT
section).
Try xxxxx@microsoft.com to get help with the beta info restoration.
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Gary G. Little
Sent: Wednesday, August 03, 2005 8:17 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] C++ and WPP
Lyndon,
That last post should have had a smiley on it. I was not intending to
sound
snide, which it could.
Doran,
Sheet … so I modified the TPL file, AFTER renaming the source file to
CPP,
and removing the comments on all of the “C” encapsulation lines, and now
I
get a linkage edit error declaring that a CRT section exists; there may
be
yada yada … . I think I need to move this over to the WDF forums, but
having moved to Minnesota, changing ISP and replacing computers I have
managed to loose all ability to contact the WDF Beta boys and girls to
update my profile and get my login info. So … if you can kindly give
me an
email address I shall remove the respirator (me) and let these threads
expire on their own.
–
The personal opinion of
Gary G. Little
“Gary G. Little” wrote in message
news:xxxxx@ntdev…
>I have no idea, really do not care, and have no intention of writing
>classes. I’m simply looking to use C++ as a better C.
>
> –
> The personal opinion of
> Gary G. Little
>
> “Lyndon J Clarke” wrote in message
> news:xxxxx@ntdev…
>> Question: What percentage of Microsoft’s kernel code is written in
C++?
>>
>> “Gary G. Little” wrote in message
news:xxxxx@ntdev…
>>> The project that generated the C++ and WDF question, now raises one
with
>>> C++ and WPP. It seems the generated TMH file from the WPP compile
>>> produces source using “this” as a local variable name. Now I highly
>>> suspect this is a C++ gotcha since the same struct definition is
used in
>>> a prior case but different variable name works. It literally looks
like
>>> this:
>>>
>>> GOOD usage:
>>> PWPP_TRACE_CONTROL_BLOCK cntl;
>>>
>>> BAD usage:
>>> PWPP_TRACE_CONTROL_BLOCK this;
>>>
>>> I even tried encapsualting filename.tmh in extern “C” {}, but that
only
>>> increased the errors. Why on earth was “this” used as a variable
name?
>>> Or am I still wondering down the wrong path? Inquiring old geezers
want
>>> to know “why”.
>>>
>>> I’ve effectively surrendered and renamed my CPP file with a C
extension
>>> and removed all the “C” encapsulations.
>>>
>>> –
>>> The personal opinion of
>>> Gary G. Little
>>>
>>>
>>
>>
>>
>
>
>
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
Thanks Doron.
Now this thread may gently pass away.
–
The personal opinion of
Gary G. Little
“Doron Holan” wrote in message
news:xxxxx@ntdev…
Did you specify -dll in RUN_WPP your sources file? That should get rid
of the global constructor problem (which manifests itself as a CRT
section).
Try xxxxx@microsoft.com to get help with the beta info restoration.
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Gary G. Little
Sent: Wednesday, August 03, 2005 8:17 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] C++ and WPP
Lyndon,
That last post should have had a smiley on it. I was not intending to
sound
snide, which it could.
Doran,
Sheet … so I modified the TPL file, AFTER renaming the source file to
CPP,
and removing the comments on all of the “C” encapsulation lines, and now
I
get a linkage edit error declaring that a CRT section exists; there may
be
yada yada … . I think I need to move this over to the WDF forums, but
having moved to Minnesota, changing ISP and replacing computers I have
managed to loose all ability to contact the WDF Beta boys and girls to
update my profile and get my login info. So … if you can kindly give
me an
email address I shall remove the respirator (me) and let these threads
expire on their own.
–
The personal opinion of
Gary G. Little
“Gary G. Little” wrote in message
news:xxxxx@ntdev…
>I have no idea, really do not care, and have no intention of writing
>classes. I’m simply looking to use C++ as a better C.
>
> –
> The personal opinion of
> Gary G. Little
>
> “Lyndon J Clarke” wrote in message
> news:xxxxx@ntdev…
>> Question: What percentage of Microsoft’s kernel code is written in
C++?
>>
>> “Gary G. Little” wrote in message
news:xxxxx@ntdev…
>>> The project that generated the C++ and WDF question, now raises one
with
>>> C++ and WPP. It seems the generated TMH file from the WPP compile
>>> produces source using “this” as a local variable name. Now I highly
>>> suspect this is a C++ gotcha since the same struct definition is
used in
>>> a prior case but different variable name works. It literally looks
like
>>> this:
>>>
>>> GOOD usage:
>>> PWPP_TRACE_CONTROL_BLOCK cntl;
>>>
>>> BAD usage:
>>> PWPP_TRACE_CONTROL_BLOCK this;
>>>
>>> I even tried encapsualting filename.tmh in extern “C” {}, but that
only
>>> increased the errors. Why on earth was “this” used as a variable
name?
>>> Or am I still wondering down the wrong path? Inquiring old geezers
want
>>> to know “why”.
>>>
>>> I’ve effectively surrendered and renamed my CPP file with a C
extension
>>> and removed all the “C” encapsulations.
>>>
>>> –
>>> The personal opinion of
>>> Gary G. Little
>>>
>>>
>>
>>
>>
>
>
>
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
Loverly. Adding -dll to the sources and doing a rebuild did the trick.
Now the thread may die.
–
The personal opinion of
Gary G. Little
“Gary G. Little” wrote in message news:xxxxx@ntdev…
> Thanks Doron.
>
> Now this thread may gently pass away.
>
> –
> The personal opinion of
> Gary G. Little
>
> “Doron Holan” wrote in message
> news:xxxxx@ntdev…
> Did you specify -dll in RUN_WPP your sources file? That should get rid
> of the global constructor problem (which manifests itself as a CRT
> section).
>
> Try xxxxx@microsoft.com to get help with the beta info restoration.
>
> d
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Gary G. Little
> Sent: Wednesday, August 03, 2005 8:17 AM
> To: Windows System Software Devs Interest List
> Subject: Re:[ntdev] C++ and WPP
>
> Lyndon,
>
> That last post should have had a smiley on it. I was not intending to
> sound
> snide, which it could.
>
> Doran,
>
> Sheet … so I modified the TPL file, AFTER renaming the source file to
> CPP,
> and removing the comments on all of the “C” encapsulation lines, and now
> I
> get a linkage edit error declaring that a CRT section exists; there may
> be
> yada yada … . I think I need to move this over to the WDF forums, but
> having moved to Minnesota, changing ISP and replacing computers I have
> managed to loose all ability to contact the WDF Beta boys and girls to
> update my profile and get my login info. So … if you can kindly give
> me an
> email address I shall remove the respirator (me) and let these threads
> expire on their own.
>
> –
> The personal opinion of
> Gary G. Little
>
> “Gary G. Little” wrote in message
> news:xxxxx@ntdev…
>>I have no idea, really do not care, and have no intention of writing
>>classes. I’m simply looking to use C++ as a better C.
>>
>> –
>> The personal opinion of
>> Gary G. Little
>>
>> “Lyndon J Clarke” wrote in message
>> news:xxxxx@ntdev…
>>> Question: What percentage of Microsoft’s kernel code is written in
> C++?
>>>
>>> “Gary G. Little” wrote in message
> news:xxxxx@ntdev…
>>>> The project that generated the C++ and WDF question, now raises one
> with
>>>> C++ and WPP. It seems the generated TMH file from the WPP compile
>>>> produces source using “this” as a local variable name. Now I highly
>>>> suspect this is a C++ gotcha since the same struct definition is
> used in
>>>> a prior case but different variable name works. It literally looks
> like
>>>> this:
>>>>
>>>> GOOD usage:
>>>> PWPP_TRACE_CONTROL_BLOCK cntl;
>>>>
>>>> BAD usage:
>>>> PWPP_TRACE_CONTROL_BLOCK this;
>>>>
>>>> I even tried encapsualting filename.tmh in extern “C” {}, but that
> only
>>>> increased the errors. Why on earth was “this” used as a variable
> name?
>>>> Or am I still wondering down the wrong path? Inquiring old geezers
> want
>>>> to know “why”.
>>>>
>>>> I’ve effectively surrendered and renamed my CPP file with a C
> extension
>>>> and removed all the “C” encapsulations.
>>>>
>>>> –
>>>> The personal opinion of
>>>> Gary G. Little
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>>
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
Gary
No worries. It so happens I do care on the point about the language used for
kernel development in microsoft. If to all intents and purposes all of the
kernel development at microsoft is done in C as opposed to (subset) C++ then
I would assume the tools will work well enough for C and if the tools work
at all for (subset) C++, that might be considered a bonus. This guides me in
the direction of considering C as opposed to (subset) C++ as the appropriate
tool for driver development. I, like others, have was stories which are
quite compatible with this simple minded point of view.
Good luck
Lyndon
“Gary G. Little” wrote in message news:xxxxx@ntdev…
> Lyndon,
>
> That last post should have had a smiley on it. I was not intending to
> sound snide, which it could.
>
> Doran,
>
> Sheet … so I modified the TPL file, AFTER renaming the source file to
> CPP, and removing the comments on all of the “C” encapsulation lines, and
> now I get a linkage edit error declaring that a CRT section exists; there
> may be yada yada … . I think I need to move this over to the WDF forums,
> but having moved to Minnesota, changing ISP and replacing computers I have
> managed to loose all ability to contact the WDF Beta boys and girls to
> update my profile and get my login info. So … if you can kindly give me
> an email address I shall remove the respirator (me) and let these threads
> expire on their own.
>
> –
> The personal opinion of
> Gary G. Little
>
> “Gary G. Little” wrote in message news:xxxxx@ntdev…
>>I have no idea, really do not care, and have no intention of writing
>>classes. I’m simply looking to use C++ as a better C.
>>
>> –
>> The personal opinion of
>> Gary G. Little
>>
>> “Lyndon J Clarke” wrote in message
>> news:xxxxx@ntdev…
>>> Question: What percentage of Microsoft’s kernel code is written in C++?
>>>
>>> “Gary G. Little” wrote in message
>>> news:xxxxx@ntdev…
>>>> The project that generated the C++ and WDF question, now raises one
>>>> with C++ and WPP. It seems the generated TMH file from the WPP compile
>>>> produces source using “this” as a local variable name. Now I highly
>>>> suspect this is a C++ gotcha since the same struct definition is used
>>>> in a prior case but different variable name works. It literally looks
>>>> like this:
>>>>
>>>> GOOD usage:
>>>> PWPP_TRACE_CONTROL_BLOCK cntl;
>>>>
>>>> BAD usage:
>>>> PWPP_TRACE_CONTROL_BLOCK this;
>>>>
>>>> I even tried encapsualting filename.tmh in extern “C” {}, but that only
>>>> increased the errors. Why on earth was “this” used as a variable name?
>>>> Or am I still wondering down the wrong path? Inquiring old geezers want
>>>> to know “why”.
>>>>
>>>> I’ve effectively surrendered and renamed my CPP file with a C extension
>>>> and removed all the “C” encapsulations.
>>>>
>>>> –
>>>> The personal opinion of
>>>> Gary G. Little
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>>
>
>
>