System device enumeration and DevicePath

> Well, they don’t. The property bag stores whatever is necessary to hold

the value. The VARIANT structure tells you how much memory you need to
hold a copy.

Oh yes, people are speaking about avoiding dynamic allocations with OA VARIANTs and BSTRs :slight_smile: this made my day :slight_smile:


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com

On 31-Mar-2015 07:10, Maxim S. Shatskih wrote:

Oh yes, let’s overflow the stack :slight_smile:

Stack-allocated variables are evil, at least in most OS kernels where you have very limited stack space.

Why kernel, isn’t this a usermode service?

On 31-Mar-2015 00:07, Edwards, Jonathan wrote:
> Allocating a big buffer then freeing it a few nanoseconds later
isn’t going to stress memory.

Allocating & freeing can fragment the pool.
This can cause hysteresis if allocation is implemented naively.
But we have well designed mature allocator here.

Regards,
– pa

>> Stack-allocated variables are evil, at least in most OS kernels where you have very limited stack

space.

Why kernel, isn’t this a usermode service?

I said “at least”.

Or do you really think that stack-allocated variables are better then dynamic memory?

Modern allocators do not cause fragmentation.

The idea of banning malloc() and re-implementing the same makeshift malloc() using a static 1M byte array is just plain moronic. In the best case, you will have the same malloc(). In the worst case, you will have a performance disaster.


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com

MISRA rules prohibit wide character and UNICODE strings.

So, if we follow MISRA rules… well… what are we doing in Windows kernel-mode?

Peter
OSR
@OSRDrivers

>MERA and similar rules are about ensuring that code is provably correct. This is importantly when

engineers are personally liable for the failure of life critical or safety critical systems.

…which is surely not anything related to Windows or Linux, and to DirectShow, OA and BSTRs especially.

correctness.fgtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbtbnqweASMH’

Is this the string to trigger a buffer overrun? :slight_smile:


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com