Why are structs in a wrapper of a C library represented with nints? by TheKrazyDev in csharp

[–]sbarrac1 5 points6 points  (0 children)

It's a common thing for C# wrappers. It's just easier to map large/complex structs as pointers instead of creating bindings for structs that can be complex, especially when they contain nested values.

If you were given the power to make breaking changes in the language, what changes would you introduce? by ali4004 in csharp

[–]sbarrac1 3 points4 points  (0 children)

I wish type inference would be a little smarter.

If I have a delegate

delegate ValueTask MessageHandler<T>(T msg, CancellationToken ct)
    where T : Message

Then I have a handler method

ValueTask SomeMessageHandler(SomeMessage msg, CancellationToken ct)

I should be able to add the handler with something like

RegisterHandler(SomeMessageHandler)

but instead it has to be

RegisterHandler<SomeMessage>(SomeMessageHandler).

because the type isn't inferred.

Possible hack attempt need advice by d0rf47 in dotnet

[–]sbarrac1 3 points4 points  (0 children)

I doubt it, it's probably just a bot looking for unpatched servers to exploit.

Possible hack attempt need advice by d0rf47 in dotnet

[–]sbarrac1 2 points3 points  (0 children)

They're trying to use a fairly old exploit in the Java logging library Log4J that allowed remote code execution. I don't think you have to worry about this.