unsafe
Determine if method is unsafe via reflection
I\'m looking for a way to filter out methods which have the unsafe modifier via reflection. It doesn\'t seem to be a method attribute.[详细]
2023-01-03 07:13 分类:问答Calling AuditQuerySystemPolicy() (advapi32.dll) from C# returns "The parameter is incorrect"
The sequence is like follows: Open a policy handle with LsaOpenPolicy() (not shown) Call LsaQueryInformationPolicy() to get the number of categories;[详细]
2023-01-02 20:42 分类:问答Null reference for first memory address between 0 - 65535
I would like to understand a bit more about memory and I was unable to find it from Google, please forgive me if this is silly question.[详细]
2022-12-31 17:03 分类:问答Why is a fixed size buffers (arrays) must be unsafe?
Let\'s say I want to have a value type of 7 bytes (or 3 or 777). I can define it like that: public struct Buffer71[详细]
2022-12-30 22:34 分类:问答How do I change the address of a New struct in a loop?
I\'m writing a simple program which is about polynomials using linked lists in C#. The problem I have is that whenever it creates a new struct (node) in the for loop it gives it the same address as th[详细]
2022-12-30 05:18 分类:问答Is there any difference between null and 0 when assigning to pointers in unsafe code?
This 开发者_如何学JAVAmay seem odd, but in C (size_t)(void*)0 == 0 is not guaranteed by the language spec. Compilers are allowed to use any value they want for null (although they almost always use 0.[详细]
2022-12-29 08:32 分类:问答Why is my unsafe code block slower than my safe code?
I am attempting to write some code that will expediently process video frames.I am receiving the frames as a System.Windows.Media.Imaging.WriteableBitmap.For testing purposes, I am just applying a sim[详细]
2022-12-28 19:50 分类:问答What is the underlying reason for not being able to put arrays of pointers in unsafe structs in C#?
If one could put an array of pointers to child structs inside unsafe structs in C# like one could in C, constructing complex data structures without the overhead of having one object per node would be[详细]
2022-12-28 18:24 分类:问答How close can I get C# to the performance of C++ for small intensive tasks?
I was thinking about the speed difference of C++ to C# being mostly about C# compiling to byte-code that is taken in by the JIT compiler (is that correct?) and all the checks C# does.[详细]
2022-12-27 06:45 分类:问答How do I use unsafe values in an enum?
I need to use this enum in my C# application, but it won\'t let me use these values. When I specify the type as uint I can use the -1 value, and when I specify int I can\'t use the last 2 values. Is t[详细]
2022-12-26 07:09 分类:问答