<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>potisan</author_name>
  <author_url>https://blog.hatena.ne.jp/potisan/</author_url>
  <blog_title>potisanのプログラミングメモ</blog_title>
  <blog_url>https://potisan-programming-memo.hatenablog.jp/</blog_url>
  <categories>
    <anon>C#</anon>
    <anon>Windows</anon>
  </categories>
  <description>C#ではP/Invokeで使う構造体をいくつかの方法で実装できます。ここでは実用性は別としていくつかの方法を紹介します。ボックス化の回避などは割愛しています。 構造体として扱う 通常の構造体 読み取り専用構造体 絶対サイズ指定の構造体 絶対サイズ指定の読み取り専用構造体 バイト配列（byte[]）として扱う ラッパークラスで扱う classを使う recordを使う 構造体として扱う 通常の構造体 C/C++の構造体を素直に構造体（struct）として扱う方法です。C#構造体の性質（値渡し、スタックへの確保、Objectクラスメソッド呼び出し時のボクシング等）を理解していれば有力な選択肢ですが…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpotisan-programming-memo.hatenablog.jp%2Fentry%2F2020%2F11%2F29%2F202517&quot; title=&quot;C# 9.0 P/Invokeで使う構造体の管理方法いくつか - potisanのプログラミングメモ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2020-11-29 20:25:17</published>
  <title>C# 9.0 P/Invokeで使う構造体の管理方法いくつか</title>
  <type>rich</type>
  <url>https://potisan-programming-memo.hatenablog.jp/entry/2020/11/29/202517</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
