String Copy Functions Requires PASSIVE LEVEL

I am not sure if I read it correctly. The ms doc for

RtlStringCchCopyA

rtlstringcchcopya

says that the function requires PASSIVE_LEVEL irql. But I don't understand why such a simple function needs to be at PASSIVE_LEVEL. Are there any alternatives that can be called at DISPATCH_LEVEL?

Of course, every buffer im using is nonpaged memory.

I just checked on my Win11 system and this function is not in a pageable section nor does it access anything but the incoming arguments.

So, seems like a doc bug to me (could also be that it once was in a pageable section).

This could have been overaggressive editing. I know that many of the functions that work with Unicode strings are PASSIVE_LEVEL because the Unicode/ANSI translation tables are pageable, but that wouldn't apply to a ...A function.

If you are worried about it, you can write your own version of this function in something like 10 lines of code.

And since the source is NUL terminated (the length is not known in advance), and reading the very next byte could trigger an access violation, the optimizations that are possible are limited. Probably there will be no significant difference between what the compiler makes for you versus whatever Microsoft has created & optimized

no need to write your own version, copy the source from the header. But as previously said, the annotation is over aggressive and better to ignore/suppress it.