Chapter 30. Unsafe Code and PInvoke
In This Chapter
Unsafe Code
Platform Invoke
An important consideration in any project is reuse of existing code. The ability to access legacy code containing business logic or low-level system functionality could lead to significant benefits in time and cost. To meet this demand, C# provides a mechanism to access legacy systems, with a feature known as PInvoke, short for Platform Invoke.
Unsafe code permits a block of code to use pointers, low-level types that allow indirect access to memory and other types. This opens new opportunities for optimization and interfaces to operating system or legacy code that requires pointers. The primary reason for unsafe code blocks is to separate safe C# code from pointer-related ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access