Modern C++ Features in Kernel Mode Drivers

Again some of you have done a great job articulating that dumb people make dumb c++ code. All the while never wanting to remotely discuss the fact that dumb people make dumb C code: eat the stack, spaghetti, buggy, misused, unreadable. So what is your point exactly? And you can see in his quote that even linus understands that substandard programmers are the problem not the c++ language. Maybe here there are those that fit that description. I just don’t know why you would want to advertise that to everyone every chance you get.

I’m not seeing anyone calling C++ programmer dumb, at least here ! Everyone talking about getting to kernel. I don’t see anyone should be that sentimental about it !!!.

If you, direct this to me, let me tell you, I used take an Undergrad class at Duke for C++. I mentioned I worked on OS/2 C++, Microsoft C++, and open sour C++. Currently, just a month ago I came out of another project, where there is a sincere effort to make components sole based on C++. I also mentioned, I’m more into Design Patterns than just lookin at crono and dance around with explicitness, that is just not my cup of tea.

Shared pointer, unique pointer etc., I’ve used on many a times. Did throw away, pthread code, used C++ thread, but inside a design pattern.

I think some of us should look at the deeper problem. Search the internet, pls be self-critical and ask for once - Why dumb programmer are dump. MIT has good articles, search if you are curious :-). I’m not going to point that out.

All we are talking about is how to get the C++ best features into kernel.

I read the article, not thoroughly, as I mentioned earlier, and this are lot of silly examples. I think lot of us better things to do in life !

If you did not point to me, at least you should have the courage to tell who you think is unfairly telling C++ programmers dumb.

-Pro

On Jul 8, 2018, at 5:23 PM, xxxxx@gmail.com wrote:
>
> Again some of you have done a great job articulating that dumb people make dumb c++ code. All the while never wanting to remotely discuss the fact that dumb people make dumb C code: eat the stack, spaghetti, buggy, misused, unreadable. So what is your point exactly? And you can see in his quote that even linus understands that substandard programmers are the problem not the c++ language. Maybe here there are those that fit that description. I just don’t know why you would want to advertise that to everyone every chance you get.
>
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list online at: http:
>
> MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers!
> Details at http:
>
> To unsubscribe, visit the List Server section of OSR Online at http:</http:></http:></http:>

More over, I’m currently on a team to drive the x-platform C++ ( osx, Win10+, Linux ). And I don’t get scared to comment on bad style of C++ ( 11 ) versions, made others to change code at late stage.

-Pro

On Jul 8, 2018, at 6:05 PM, xxxxx@garlic.com wrote:
>
> I’m not seeing anyone calling C++ programmer dumb, at least here ! Everyone talking about getting to kernel. I don’t see anyone should be that sentimental about it !!!.
>
> If you, direct this to me, let me tell you, I used take an Undergrad class at Duke for C++. I mentioned I worked on OS/2 C++, Microsoft C++, and open sour C++. Currently, just a month ago I came out of another project, where there is a sincere effort to make components sole based on C++. I also mentioned, I’m more into Design Patterns than just lookin at crono and dance around with explicitness, that is just not my cup of tea.
>
> Shared pointer, unique pointer etc., I’ve used on many a times. Did throw away, pthread code, used C++ thread, but inside a design pattern.
>
> I think some of us should look at the deeper problem. Search the internet, pls be self-critical and ask for once - Why dumb programmer are dump. MIT has good articles, search if you are curious :-). I’m not going to point that out.
>
> All we are talking about is how to get the C++ best features into kernel.
>
> I read the article, not thoroughly, as I mentioned earlier, and this are lot of silly examples. I think lot of us better things to do in life !
>
> If you did not point to me, at least you should have the courage to tell who you think is unfairly telling C++ programmers dumb.
>
> -Pro
>
>
>
>> On Jul 8, 2018, at 5:23 PM, xxxxx@gmail.com wrote:
>>
>> Again some of you have done a great job articulating that dumb people make dumb c++ code. All the while never wanting to remotely discuss the fact that dumb people make dumb C code: eat the stack, spaghetti, buggy, misused, unreadable. So what is your point exactly? And you can see in his quote that even linus understands that substandard programmers are the problem not the c++ language. Maybe here there are those that fit that description. I just don’t know why you would want to advertise that to everyone every chance you get.
>>
>>
>> —
>> NTDEV is sponsored by OSR
>>
>> Visit the list online at: http:
>>
>> MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers!
>> Details at http:
>>
>> To unsubscribe, visit the List Server section of OSR Online at http:
>
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list online at: http:
>
> MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers!
> Details at http:
>
> To unsubscribe, visit the List Server section of OSR Online at http:</http:></http:></http:></http:></http:></http:>

I believe anyone unable to find one single useful thing in c++ is dumb and/or obstinate. This is because c++ has a treasure chest of goods specifically for system level programming and more are being added all the time. It’s fantastic.

Let’s take one. Today when we express relative time quantities in the kernel it is in negative 100 nanosecond units. So if we want a 10 millisecond timeout the psuedo is like:

LARGE_INTEGER n;

n.QuadPart = -1000000; // programmers reaction: wtf is -100000?

KeWait(n); // programmers reaction: wth didn’t you just pass -100000 directly?

c++ allows adding things like microsecond and millisecond tags on literals. So we can write this instead:

KeWait(10ms); // programmers reaction: got it!

So tell me which way do you prefer, c or c++? and if the former can you articulate why? I’ll try not to fall off my chair laughing.

LARGE_INTEGER n = { .QuadPart = SOME_VALUE_OF_MEANING };
LARGE_INTEGER n = { .QuadPart = SomeOtherVariable.QuadPart };
LARGE_INTEGER n = { .QuadPart = SomeStackParameter.QuadPart };

Counter example:

LARGE_INTEGER to = { .QuadPart = RELATIVE(MILLISECOND(5)) };
KeWait(&to);

/* C programmers reaction: Got it! */

On Sun, Jul 8, 2018 at 10:38 PM xxxxx@gmail.com
wrote:

> I believe anyone unable to find one single useful thing in c++ is dumb
> and/or obstinate. This is because c++ has a treasure chest of goods
> specifically for system level programming and more are being added all the
> time. It’s fantastic.
>
> Let’s take one. Today when we express relative time quantities in the
> kernel it is in negative 100 nanosecond units. So if we want a 10
> millisecond timeout the psuedo is like:
>
> LARGE_INTEGER n;
>
> n.QuadPart = -1000000; // programmers reaction: wtf is -100000?
>
> KeWait(n); // programmers reaction: wth didn’t you just pass -100000
> directly?
>
> c++ allows adding things like microsecond and millisecond tags on
> literals. So we can write this instead:
>
> KeWait(10ms); // programmers reaction: got it!
>
> So tell me which way do you prefer, c or c++? and if the former can you
> articulate why? I’ll try not to fall off my chair laughing.
>
>
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list online at: <
> http://www.osronline.com/showlists.cfm?list=ntdev&gt;
>
> MONTHLY seminars on crash dump analysis, WDF, Windows internals and
> software drivers!
> Details at http:
>
> To unsubscribe, visit the List Server section of OSR Online at <
> http://www.osronline.com/page.cfm?name=ListServer&gt;
>


Jamey Kirby
Disrupting the establishment since 1964

This is a personal email account and as such, emails are not subject to
archiving. Nothing else really matters.
</http:>

Of course, I would love to have C, nothing but C. Sorry just kidding :-). It pops up right there, which one to use. Did I use 2nd one, guess what?
Yes, but not on KeWait ( it was posix platform ). Also need to consider who is/are used to the old style, that it does not make sense to change.

The thing is when I want to marry someone, I want to marry the person ( i.e. financial safety ) as opposed marry the whole package family :slight_smile:

That is the topic here. You know, I would love to write exception safe code, and would not demand for give me the assurance that in case of an exception ( kernel does not get lost ) — we talked about it at our last WAR STORY !

One other thing is to Parse thru all the necessary features, that can be applicable to kernel programming. In the document, that I referred earlier mentioned about never using singleton, and that is exactly I’ve seen in more than one File Filter.

Again, I’ve seen OSR article about how to create new(), delete() so I will have happy life allocating / freeing knowing that my some auxiliary routine would not foul up randomly …. Alternatively there is explicit/direct API to use in C, and it would nag me like my beloved one :-).

My personal choice is to wait for a canonical set that can be used explicitly. I don’t like hiding stuff when in kernel mode, so I spend as less time as possible in kernel debugging.

An example I gave, earlier, the silly example uses ifstream to have function scope, and allow some one to have multiple return point. Most any kernel guys either uses goto ( forward) to soft of FINALIZE section, or as I said do while stuff, and get to FINALIZE point. —- If I allow that example, then dynamic memory allocation has be to based on some vector with function scope. It is not much intuitive to me, sorry …

-Pro

On Jul 8, 2018, at 7:37 PM, xxxxx@gmail.com wrote:
>
> I believe anyone unable to find one single useful thing in c++ is dumb and/or obstinate. This is because c++ has a treasure chest of goods specifically for system level programming and more are being added all the time. It’s fantastic.
>
> Let’s take one. Today when we express relative time quantities in the kernel it is in negative 100 nanosecond units. So if we want a 10 millisecond timeout the psuedo is like:
>
> LARGE_INTEGER n;
>
> n.QuadPart = -1000000; // programmers reaction: wtf is -100000?
>
> KeWait(n); // programmers reaction: wth didn’t you just pass -100000 directly?
>
> c++ allows adding things like microsecond and millisecond tags on literals. So we can write this instead:
>
> KeWait(10ms); // programmers reaction: got it!
>
> So tell me which way do you prefer, c or c++? and if the former can you articulate why? I’ll try not to fall off my chair laughing.
>
>
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list online at: http:
>
> MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers!
> Details at http:
>
> To unsubscribe, visit the List Server section of OSR Online at http:</http:></http:></http:>

>> My personal choice is to wait for a canonical set that can be used
explicitly. I don’t like hiding stuff when in kernel mode, so I spend as
less time as possible in kernel debugging.

Amen brother!

On Sun, Jul 8, 2018 at 11:01 PM xxxxx@gmail.com
wrote:

> Of course, I would love to have C, nothing but C. Sorry just kidding :-).
> It pops up right there, which one to use. Did I use 2nd one, guess what?
> Yes, but not on KeWait ( it was posix platform ). Also need to consider
> who is/are used to the old style, that it does not make sense to change.
>
> The thing is when I want to marry someone, I want to marry the person (
> i.e. financial safety ) as opposed marry the whole package family :slight_smile:
>
> That is the topic here. You know, I would love to write exception safe
> code, and would not demand for give me the assurance that in case of an
> exception ( kernel does not get lost ) — we talked about it at our last WAR
> STORY !
>
> One other thing is to Parse thru all the necessary features, that can be
> applicable to kernel programming. In the document, that I referred earlier
> mentioned about never using singleton, and that is exactly I’ve seen in
> more than one File Filter.
>
> Again, I’ve seen OSR article about how to create new(), delete() so I will
> have happy life allocating / freeing knowing that my some auxiliary routine
> would not foul up randomly …. Alternatively there is explicit/direct API to
> use in C, and it would nag me like my beloved one :-).
>
> My personal choice is to wait for a canonical set that can be used
> explicitly. I don’t like hiding stuff when in kernel mode, so I spend as
> less time as possible in kernel debugging.
>
> An example I gave, earlier, the silly example uses ifstream to have
> function scope, and allow some one to have multiple return point. Most any
> kernel guys either uses goto ( forward) to soft of FINALIZE section, or as
> I said do while stuff, and get to FINALIZE point. —- If I allow that
> example, then dynamic memory allocation has be to based on some vector with
> function scope. It is not much intuitive to me, sorry …
>
> -Pro
>
> > On Jul 8, 2018, at 7:37 PM, xxxxx@gmail.com
> wrote:
> >
> > I believe anyone unable to find one single useful thing in c++ is dumb
> and/or obstinate. This is because c++ has a treasure chest of goods
> specifically for system level programming and more are being added all the
> time. It’s fantastic.
> >
> > Let’s take one. Today when we express relative time quantities in the
> kernel it is in negative 100 nanosecond units. So if we want a 10
> millisecond timeout the psuedo is like:
> >
> > LARGE_INTEGER n;
> >
> > n.QuadPart = -1000000; // programmers reaction: wtf is -100000?
> >
> > KeWait(n); // programmers reaction: wth didn’t you just pass -100000
> directly?
> >
> > c++ allows adding things like microsecond and millisecond tags on
> literals. So we can write this instead:
> >
> > KeWait(10ms); // programmers reaction: got it!
> >
> > So tell me which way do you prefer, c or c++? and if the former can you
> articulate why? I’ll try not to fall off my chair laughing.
> >
> >
> >
> > —
> > NTDEV is sponsored by OSR
> >
> > Visit the list online at: <
> http://www.osronline.com/showlists.cfm?list=ntdev&gt;
> >
> > MONTHLY seminars on crash dump analysis, WDF, Windows internals and
> software drivers!
> > Details at http:
> >
> > To unsubscribe, visit the List Server section of OSR Online at <
> http://www.osronline.com/page.cfm?name=ListServer&gt;
>
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list online at: <
> http://www.osronline.com/showlists.cfm?list=ntdev&gt;
>
> MONTHLY seminars on crash dump analysis, WDF, Windows internals and
> software drivers!
> Details at http:
>
> To unsubscribe, visit the List Server section of OSR Online at <
> http://www.osronline.com/page.cfm?name=ListServer&gt;
>


Jamey Kirby
Disrupting the establishment since 1964

This is a personal email account and as such, emails are not subject to
archiving. Nothing else really matters.
</http:></http:>