Skip to content

Analyzer suggestion: Prefer SafeHandle over IntPtr #42404

Description

@Mrnikbobjeff

After working on some Interop analyzers I thought about SafeHandle and how known api's could suggest using the corresponding safehandle, such as SafeFileHandle or SafeWaitHandle. This could also more broadly be applied based on the method name, e.g. methods contains alloc/free could offer a warning when an IntPtr is used instead of a custom safehandle.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions