Re: [BULK] Re: Modern C++ Features in Kernel Mode Drivers

Likewise, Amen brother :slight_smile:

-Pro

On Jul 8, 2018, at 8:05 PM, xxxxx@gmail.com wrote:
>
> >> 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 mailto:xxxxx > 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 mailto:xxxxx > 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:>
>
>
> —
> 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:>
>
>
> –
> 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.
> — NTDEV is sponsored by OSR Visit the list online at: MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers! Details at To unsubscribe, visit the List Server section of OSR Online at</http:></http:></http:></http:></http:></http:></mailto:xxxxx></mailto:xxxxx>

> James said:

RELATIVE(MILLISECOND(5))

Love your macros; those are good ideas making the best of what we have to work with. But let’s not kid ourselves, saying “5ms” somewhere instead of “RELATIVE(MILLISECOND(5))” is the most natural and easy to read. If timing things went wrong a developer may will feel the need to dig into those macros with a fine toothed comb to make sure it wasn’t a source of the problem. With 5ms, there is never a doubt.

Prokash said:
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:

Haha good one. But with c++ you absolutely do pick and choose. No different than c really. There is no one with a gun to your head forcing you to roll everything into some horrible unwanted OOP just because you use a .cpp extension.

Yeah, for newly minted, not much dependent on other component, is fine. Otherwise that extern C dancing will come in to play :slight_smile:

For windows Network filtering all my files are .cpp.

-Pro

On Jul 8, 2018, at 8:36 PM, xxxxx@gmail.com wrote:
>
>> James said:
>> RELATIVE(MILLISECOND(5))
>
> Love your macros; those are good ideas making the best of what we have to work with. But let’s not kid ourselves, saying “5ms” somewhere instead of “RELATIVE(MILLISECOND(5))” is the most natural and easy to read. If timing things went wrong a developer may will feel the need to dig into those macros with a fine toothed comb to make sure it wasn’t a source of the problem. With 5ms, there is never a doubt.
>
>> Prokash said:
>> 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:
>
> Haha good one. But with c++ you absolutely do pick and choose. No different than c really. There is no one with a gun to your head forcing you to roll everything into some horrible unwanted OOP just because you use a .cpp extension.
>
>
> —
> 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:>

One final thing, OOP is not really horrible. IMO.

`Full scale x-platform coding really showed the difference between language lovers and design lovers. Language lovers coded with a slew of #Ifdef on platform name tags, and code is well littered with #Ifdef … and its cousins.

Abstraction takes these away, as much as possible.

-Pro

On Jul 8, 2018, at 8:36 PM, xxxxx@gmail.com wrote:
>
>> James said:
>> RELATIVE(MILLISECOND(5))
>
> Love your macros; those are good ideas making the best of what we have to work with. But let’s not kid ourselves, saying “5ms” somewhere instead of “RELATIVE(MILLISECOND(5))” is the most natural and easy to read. If timing things went wrong a developer may will feel the need to dig into those macros with a fine toothed comb to make sure it wasn’t a source of the problem. With 5ms, there is never a doubt.
>
>> Prokash said:
>> 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:
>
> Haha good one. But with c++ you absolutely do pick and choose. No different than c really. There is no one with a gun to your head forcing you to roll everything into some horrible unwanted OOP just because you use a .cpp extension.
>
>
> —
> 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:>