<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>fgshun</author_name>
  <author_url>https://blog.hatena.ne.jp/fgshun/</author_url>
  <blog_title>銀月の符号</blog_title>
  <blog_url>https://fgshun.hatenablog.com/</blog_url>
  <categories>
    <anon>Python</anon>
  </categories>
  <description>Python 2.6 より _winreg モジュールに追加された ExpandEnvironmentStrings 関数。REG_EXPAND_SZ 型のレジストリ値のように % で囲まれた環境変数を展開するというもの。ソースコードを見ると PC/_winreg.c の 1159 行目からの PyExpandEnvironmentStrings 関数で実装されていた。 ExpandEnvironmentStringsW 関数を2度呼んでいる。ひとまず lpDst を NULL ポインタ、 nSize を 0 で呼び出しておいて得られる文字列長を事前確認、その長さ分のメモリ確保、再度実行という…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ffgshun.hatenablog.com%2Fentry%2F20081110%2F1226326541&quot; title=&quot; Python 2.6 の _winreg.ExpandEnvironmentStrings を ctypes で - 銀月の符号&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>2008-11-10 23:15:41</published>
  <title> Python 2.6 の _winreg.ExpandEnvironmentStrings を ctypes で</title>
  <type>rich</type>
  <url>https://fgshun.hatenablog.com/entry/20081110/1226326541</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
