Win32 API 日本語リファレンス
ホームDevices.DeviceAndDriverInstallation › SetupGetTargetPathW

SetupGetTargetPathW

関数
INFセクションのファイルコピー先パスを取得する(Unicode)。
DLLSETUPAPI.dll文字セットUnicode (-W)呼出規約winapiSetLastErrorあり対応OSWindows XP 以降

シグネチャ

// SETUPAPI.dll  (Unicode / -W)
#include <windows.h>

BOOL SetupGetTargetPathW(
    void* InfHandle,
    INFCONTEXT* InfContext,   // optional
    LPCWSTR Section,   // optional
    LPWSTR ReturnBuffer,   // optional
    DWORD ReturnBufferSize,
    DWORD* RequiredSize   // optional
);

パラメーター

名前方向説明
InfHandlevoid*in対象の開いているINFハンドル。
InfContextINFCONTEXT*inoptional対象行を示すINFCONTEXT構造体へのポインタ。NULLでSectionを使う。
SectionLPCWSTRinoptional対象のコピーセクション名(Unicode)。InfContext指定時はNULL可。
ReturnBufferLPWSTRoutoptional解決されたインストール先フルパスを受け取るバッファ(Unicode)。NULLでサイズ取得のみ可。
ReturnBufferSizeDWORDinReturnBufferのサイズ(文字数)。
RequiredSizeDWORD*outoptional必要なバッファサイズを受け取る出力ポインタ。NULL可。

戻り値の型: BOOL

各言語での呼び出し定義

// SETUPAPI.dll  (Unicode / -W)
#include <windows.h>

BOOL SetupGetTargetPathW(
    void* InfHandle,
    INFCONTEXT* InfContext,   // optional
    LPCWSTR Section,   // optional
    LPWSTR ReturnBuffer,   // optional
    DWORD ReturnBufferSize,
    DWORD* RequiredSize   // optional
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("SETUPAPI.dll", CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)]
static extern bool SetupGetTargetPathW(
    IntPtr InfHandle,   // void*
    IntPtr InfContext,   // INFCONTEXT* optional
    [MarshalAs(UnmanagedType.LPWStr)] string Section,   // LPCWSTR optional
    [MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder ReturnBuffer,   // LPWSTR optional, out
    uint ReturnBufferSize,   // DWORD
    IntPtr RequiredSize   // DWORD* optional, out
);
<DllImport("SETUPAPI.dll", CharSet:=CharSet.Unicode, SetLastError:=True, ExactSpelling:=True)>
Public Shared Function SetupGetTargetPathW(
    InfHandle As IntPtr,   ' void*
    InfContext As IntPtr,   ' INFCONTEXT* optional
    <MarshalAs(UnmanagedType.LPWStr)> Section As String,   ' LPCWSTR optional
    <MarshalAs(UnmanagedType.LPWStr)> ReturnBuffer As System.Text.StringBuilder,   ' LPWSTR optional, out
    ReturnBufferSize As UInteger,   ' DWORD
    RequiredSize As IntPtr   ' DWORD* optional, out
) As <MarshalAs(UnmanagedType.Bool)> Boolean
End Function
' InfHandle : void*
' InfContext : INFCONTEXT* optional
' Section : LPCWSTR optional
' ReturnBuffer : LPWSTR optional, out
' ReturnBufferSize : DWORD
' RequiredSize : DWORD* optional, out
Declare PtrSafe Function SetupGetTargetPathW Lib "setupapi" ( _
    ByVal InfHandle As LongPtr, _
    ByVal InfContext As LongPtr, _
    ByVal Section As LongPtr, _
    ByVal ReturnBuffer As LongPtr, _
    ByVal ReturnBufferSize As Long, _
    ByVal RequiredSize As LongPtr) As Long
' Unicode(W): 文字列は ByVal As LongPtr とし StrPtr(unicodeStr) を渡す
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

SetupGetTargetPathW = ctypes.windll.setupapi.SetupGetTargetPathW
SetupGetTargetPathW.restype = wintypes.BOOL
SetupGetTargetPathW.argtypes = [
    ctypes.POINTER(None),  # InfHandle : void*
    ctypes.c_void_p,  # InfContext : INFCONTEXT* optional
    wintypes.LPCWSTR,  # Section : LPCWSTR optional
    wintypes.LPWSTR,  # ReturnBuffer : LPWSTR optional, out
    wintypes.DWORD,  # ReturnBufferSize : DWORD
    ctypes.POINTER(wintypes.DWORD),  # RequiredSize : DWORD* optional, out
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('SETUPAPI.dll')
SetupGetTargetPathW = Fiddle::Function.new(
  lib['SetupGetTargetPathW'],
  [
    Fiddle::TYPE_VOIDP,  # InfHandle : void*
    Fiddle::TYPE_VOIDP,  # InfContext : INFCONTEXT* optional
    Fiddle::TYPE_VOIDP,  # Section : LPCWSTR optional
    Fiddle::TYPE_VOIDP,  # ReturnBuffer : LPWSTR optional, out
    -Fiddle::TYPE_INT,  # ReturnBufferSize : DWORD
    Fiddle::TYPE_VOIDP,  # RequiredSize : DWORD* optional, out
  ],
  Fiddle::TYPE_INT)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"
#[link(name = "setupapi")]
extern "system" {
    fn SetupGetTargetPathW(
        InfHandle: *mut (),  // void*
        InfContext: *mut INFCONTEXT,  // INFCONTEXT* optional
        Section: *const u16,  // LPCWSTR optional
        ReturnBuffer: *mut u16,  // LPWSTR optional, out
        ReturnBufferSize: u32,  // DWORD
        RequiredSize: *mut u32  // DWORD* optional, out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("SETUPAPI.dll", CharSet = CharSet.Unicode, SetLastError = true)]
public static extern bool SetupGetTargetPathW(IntPtr InfHandle, IntPtr InfContext, [MarshalAs(UnmanagedType.LPWStr)] string Section, [MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder ReturnBuffer, uint ReturnBufferSize, IntPtr RequiredSize);
"@
$api = Add-Type -MemberDefinition $sig -Name 'SETUPAPI_SetupGetTargetPathW' -Namespace Win32 -PassThru
# $api::SetupGetTargetPathW(InfHandle, InfContext, Section, ReturnBuffer, ReturnBufferSize, RequiredSize)
#uselib "SETUPAPI.dll"
#func global SetupGetTargetPathW "SetupGetTargetPathW" wptr, wptr, wptr, wptr, wptr, wptr
; SetupGetTargetPathW InfHandle, varptr(InfContext), Section, varptr(ReturnBuffer), ReturnBufferSize, varptr(RequiredSize)   ; 戻り値は stat
; InfHandle : void* -> "wptr"
; InfContext : INFCONTEXT* optional -> "wptr"
; Section : LPCWSTR optional -> "wptr"
; ReturnBuffer : LPWSTR optional, out -> "wptr"
; ReturnBufferSize : DWORD -> "wptr"
; RequiredSize : DWORD* optional, out -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "SETUPAPI.dll"
#cfunc global SetupGetTargetPathW "SetupGetTargetPathW" sptr, var, wstr, var, int, var
; res = SetupGetTargetPathW(InfHandle, InfContext, Section, ReturnBuffer, ReturnBufferSize, RequiredSize)
; InfHandle : void* -> "sptr"
; InfContext : INFCONTEXT* optional -> "var"
; Section : LPCWSTR optional -> "wstr"
; ReturnBuffer : LPWSTR optional, out -> "var"
; ReturnBufferSize : DWORD -> "int"
; RequiredSize : DWORD* optional, out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; BOOL SetupGetTargetPathW(void* InfHandle, INFCONTEXT* InfContext, LPCWSTR Section, LPWSTR ReturnBuffer, DWORD ReturnBufferSize, DWORD* RequiredSize)
#uselib "SETUPAPI.dll"
#cfunc global SetupGetTargetPathW "SetupGetTargetPathW" intptr, var, wstr, var, int, var
; res = SetupGetTargetPathW(InfHandle, InfContext, Section, ReturnBuffer, ReturnBufferSize, RequiredSize)
; InfHandle : void* -> "intptr"
; InfContext : INFCONTEXT* optional -> "var"
; Section : LPCWSTR optional -> "wstr"
; ReturnBuffer : LPWSTR optional, out -> "var"
; ReturnBufferSize : DWORD -> "int"
; RequiredSize : DWORD* optional, out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	setupapi = windows.NewLazySystemDLL("SETUPAPI.dll")
	procSetupGetTargetPathW = setupapi.NewProc("SetupGetTargetPathW")
)

// InfHandle (void*), InfContext (INFCONTEXT* optional), Section (LPCWSTR optional), ReturnBuffer (LPWSTR optional, out), ReturnBufferSize (DWORD), RequiredSize (DWORD* optional, out)
r1, _, err := procSetupGetTargetPathW.Call(
	uintptr(InfHandle),
	uintptr(InfContext),
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(Section))),
	uintptr(ReturnBuffer),
	uintptr(ReturnBufferSize),
	uintptr(RequiredSize),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function SetupGetTargetPathW(
  InfHandle: Pointer;   // void*
  InfContext: Pointer;   // INFCONTEXT* optional
  Section: PWideChar;   // LPCWSTR optional
  ReturnBuffer: PWideChar;   // LPWSTR optional, out
  ReturnBufferSize: DWORD;   // DWORD
  RequiredSize: Pointer   // DWORD* optional, out
): BOOL; stdcall;
  external 'SETUPAPI.dll' name 'SetupGetTargetPathW';
result := DllCall("SETUPAPI\SetupGetTargetPathW"
    , "Ptr", InfHandle   ; void*
    , "Ptr", InfContext   ; INFCONTEXT* optional
    , "WStr", Section   ; LPCWSTR optional
    , "Ptr", ReturnBuffer   ; LPWSTR optional, out
    , "UInt", ReturnBufferSize   ; DWORD
    , "Ptr", RequiredSize   ; DWORD* optional, out
    , "Int")   ; return: BOOL
●SetupGetTargetPathW(InfHandle, InfContext, Section, ReturnBuffer, ReturnBufferSize, RequiredSize) = DLL("SETUPAPI.dll", "bool SetupGetTargetPathW(void*, void*, char*, char*, dword, void*)")
# 呼び出し: SetupGetTargetPathW(InfHandle, InfContext, Section, ReturnBuffer, ReturnBufferSize, RequiredSize)
# InfHandle : void* -> "void*"
# InfContext : INFCONTEXT* optional -> "void*"
# Section : LPCWSTR optional -> "char*"
# ReturnBuffer : LPWSTR optional, out -> "char*"
# ReturnBufferSize : DWORD -> "dword"
# RequiredSize : DWORD* optional, out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。
const std = @import("std");

extern "setupapi" fn SetupGetTargetPathW(
    InfHandle: ?*anyopaque, // void*
    InfContext: [*c]INFCONTEXT, // INFCONTEXT* optional
    Section: [*c]const u16, // LPCWSTR optional
    ReturnBuffer: [*c]u16, // LPWSTR optional, out
    ReturnBufferSize: u32, // DWORD
    RequiredSize: [*c]u32 // DWORD* optional, out
) callconv(std.os.windows.WINAPI) i32;
// Unicode(-W): UTF-16LE のヌル終端バッファ([*c]const u16)を渡す。
proc SetupGetTargetPathW(
    InfHandle: pointer,  # void*
    InfContext: ptr INFCONTEXT,  # INFCONTEXT* optional
    Section: WideCString,  # LPCWSTR optional
    ReturnBuffer: ptr uint16,  # LPWSTR optional, out
    ReturnBufferSize: uint32,  # DWORD
    RequiredSize: ptr uint32  # DWORD* optional, out
): int32 {.importc: "SetupGetTargetPathW", stdcall, dynlib: "SETUPAPI.dll".}
# Unicode(-W): WideCString は newWideCString("...") で生成。
pragma(lib, "setupapi");
extern(Windows)
int SetupGetTargetPathW(
    void* InfHandle,   // void*
    INFCONTEXT* InfContext,   // INFCONTEXT* optional
    const(wchar)* Section,   // LPCWSTR optional
    wchar* ReturnBuffer,   // LPWSTR optional, out
    uint ReturnBufferSize,   // DWORD
    uint* RequiredSize   // DWORD* optional, out
);
ccall((:SetupGetTargetPathW, "SETUPAPI.dll"), stdcall, Int32,
      (Ptr{Cvoid}, Ptr{INFCONTEXT}, Cwstring, Ptr{UInt16}, UInt32, Ptr{UInt32}),
      InfHandle, InfContext, Section, ReturnBuffer, ReturnBufferSize, RequiredSize)
# InfHandle : void* -> Ptr{Cvoid}
# InfContext : INFCONTEXT* optional -> Ptr{INFCONTEXT}
# Section : LPCWSTR optional -> Cwstring
# ReturnBuffer : LPWSTR optional, out -> Ptr{UInt16}
# ReturnBufferSize : DWORD -> UInt32
# RequiredSize : DWORD* optional, out -> Ptr{UInt32}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
# Unicode(-W): Cwstring には transcode(UInt16, "...") 等で UTF-16 を渡す。
local ffi = require("ffi")
ffi.cdef[[
int32_t SetupGetTargetPathW(
    void* InfHandle,
    void* InfContext,
    const uint16_t* Section,
    uint16_t* ReturnBuffer,
    uint32_t ReturnBufferSize,
    uint32_t* RequiredSize);
]]
local setupapi = ffi.load("setupapi")
-- setupapi.SetupGetTargetPathW(InfHandle, InfContext, Section, ReturnBuffer, ReturnBufferSize, RequiredSize)
-- InfHandle : void*
-- InfContext : INFCONTEXT* optional
-- Section : LPCWSTR optional
-- ReturnBuffer : LPWSTR optional, out
-- ReturnBufferSize : DWORD
-- RequiredSize : DWORD* optional, out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
-- Unicode(-W): uint16_t* には UTF-16LE のバッファ(ffi.new("uint16_t[?]", ...))を渡す。
const koffi = require('koffi');
const lib = koffi.load('SETUPAPI.dll');
const SetupGetTargetPathW = lib.func('__stdcall', 'SetupGetTargetPathW', 'int32_t', ['void *', 'void *', 'str16', 'uint16_t *', 'uint32_t', 'uint32_t *']);
// SetupGetTargetPathW(InfHandle, InfContext, Section, ReturnBuffer, ReturnBufferSize, RequiredSize)
// InfHandle : void* -> 'void *'
// InfContext : INFCONTEXT* optional -> 'void *'
// Section : LPCWSTR optional -> 'str16'
// ReturnBuffer : LPWSTR optional, out -> 'uint16_t *'
// ReturnBufferSize : DWORD -> 'uint32_t'
// RequiredSize : DWORD* optional, out -> 'uint32_t *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("SETUPAPI.dll", {
  SetupGetTargetPathW: { parameters: ["pointer", "pointer", "buffer", "buffer", "u32", "pointer"], result: "i32" },
});
// lib.symbols.SetupGetTargetPathW(InfHandle, InfContext, Section, ReturnBuffer, ReturnBufferSize, RequiredSize)
// InfHandle : void* -> "pointer"
// InfContext : INFCONTEXT* optional -> "pointer"
// Section : LPCWSTR optional -> "buffer"
// ReturnBuffer : LPWSTR optional, out -> "buffer"
// ReturnBufferSize : DWORD -> "u32"
// RequiredSize : DWORD* optional, out -> "pointer"
// 文字列は "buffer"。Unicode(-W) は new TextEncoder() ではなく UTF-16LE のバイト列(末尾に \x00\x00)を Uint8Array で渡す。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t SetupGetTargetPathW(
    void* InfHandle,
    void* InfContext,
    const uint16_t* Section,
    uint16_t* ReturnBuffer,
    uint32_t ReturnBufferSize,
    uint32_t* RequiredSize);
C, "SETUPAPI.dll");
// $ffi->SetupGetTargetPathW(InfHandle, InfContext, Section, ReturnBuffer, ReturnBufferSize, RequiredSize);
// InfHandle : void*
// InfContext : INFCONTEXT* optional
// Section : LPCWSTR optional
// ReturnBuffer : LPWSTR optional, out
// ReturnBufferSize : DWORD
// RequiredSize : DWORD* optional, out
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;

public interface Setupapi extends StdCallLibrary {
    Setupapi INSTANCE = Native.load("setupapi", Setupapi.class, W32APIOptions.UNICODE_OPTIONS);
    boolean SetupGetTargetPathW(
        Pointer InfHandle,   // void*
        Pointer InfContext,   // INFCONTEXT* optional
        WString Section,   // LPCWSTR optional
        char[] ReturnBuffer,   // LPWSTR optional, out
        int ReturnBufferSize,   // DWORD
        IntByReference RequiredSize   // DWORD* optional, out
    );
}
// Unicode(-W): WString(入力)/char[](出力)で UTF-16 をマーシャリング。
@[Link("setupapi")]
lib LibSETUPAPI
  fun SetupGetTargetPathW = SetupGetTargetPathW(
    InfHandle : Void*,   # void*
    InfContext : INFCONTEXT*,   # INFCONTEXT* optional
    Section : UInt16*,   # LPCWSTR optional
    ReturnBuffer : UInt16*,   # LPWSTR optional, out
    ReturnBufferSize : UInt32,   # DWORD
    RequiredSize : UInt32*   # DWORD* optional, out
  ) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef SetupGetTargetPathWNative = Int32 Function(Pointer<Void>, Pointer<Void>, Pointer<Utf16>, Pointer<Utf16>, Uint32, Pointer<Uint32>);
typedef SetupGetTargetPathWDart = int Function(Pointer<Void>, Pointer<Void>, Pointer<Utf16>, Pointer<Utf16>, int, Pointer<Uint32>);
final SetupGetTargetPathW = DynamicLibrary.open('SETUPAPI.dll')
    .lookupFunction<SetupGetTargetPathWNative, SetupGetTargetPathWDart>('SetupGetTargetPathW');
// InfHandle : void* -> Pointer<Void>
// InfContext : INFCONTEXT* optional -> Pointer<Void>
// Section : LPCWSTR optional -> Pointer<Utf16>
// ReturnBuffer : LPWSTR optional, out -> Pointer<Utf16>
// ReturnBufferSize : DWORD -> Uint32
// RequiredSize : DWORD* optional, out -> Pointer<Uint32>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function SetupGetTargetPathW(
  InfHandle: Pointer;   // void*
  InfContext: Pointer;   // INFCONTEXT* optional
  Section: PWideChar;   // LPCWSTR optional
  ReturnBuffer: PWideChar;   // LPWSTR optional, out
  ReturnBufferSize: DWORD;   // DWORD
  RequiredSize: Pointer   // DWORD* optional, out
): BOOL; stdcall;
  external 'SETUPAPI.dll' name 'SetupGetTargetPathW';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "SetupGetTargetPathW"
  c_SetupGetTargetPathW :: Ptr () -> Ptr () -> CWString -> CWString -> Word32 -> Ptr Word32 -> IO CInt
-- InfHandle : void* -> Ptr ()
-- InfContext : INFCONTEXT* optional -> Ptr ()
-- Section : LPCWSTR optional -> CWString
-- ReturnBuffer : LPWSTR optional, out -> CWString
-- ReturnBufferSize : DWORD -> Word32
-- RequiredSize : DWORD* optional, out -> Ptr Word32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let setupgettargetpathw =
  foreign "SetupGetTargetPathW"
    ((ptr void) @-> (ptr void) @-> (ptr uint16_t) @-> (ptr uint16_t) @-> uint32_t @-> (ptr uint32_t) @-> returning int32_t)
(* InfHandle : void* -> (ptr void) *)
(* InfContext : INFCONTEXT* optional -> (ptr void) *)
(* Section : LPCWSTR optional -> (ptr uint16_t) *)
(* ReturnBuffer : LPWSTR optional, out -> (ptr uint16_t) *)
(* ReturnBufferSize : DWORD -> uint32_t *)
(* RequiredSize : DWORD* optional, out -> (ptr uint32_t) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library setupapi (t "SETUPAPI.dll"))
(cffi:use-foreign-library setupapi)

(cffi:defcfun ("SetupGetTargetPathW" setup-get-target-path-w :convention :stdcall) :int32
  (inf-handle :pointer)   ; void*
  (inf-context :pointer)   ; INFCONTEXT* optional
  (section (:string :encoding :utf-16le))   ; LPCWSTR optional
  (return-buffer :pointer)   ; LPWSTR optional, out
  (return-buffer-size :uint32)   ; DWORD
  (required-size :pointer))   ; DWORD* optional, out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $SetupGetTargetPathW = Win32::API::More->new('SETUPAPI',
    'BOOL SetupGetTargetPathW(LPVOID InfHandle, LPVOID InfContext, LPCWSTR Section, LPWSTR ReturnBuffer, DWORD ReturnBufferSize, LPVOID RequiredSize)');
# my $ret = $SetupGetTargetPathW->Call($InfHandle, $InfContext, $Section, $ReturnBuffer, $ReturnBufferSize, $RequiredSize);
# InfHandle : void* -> LPVOID
# InfContext : INFCONTEXT* optional -> LPVOID
# Section : LPCWSTR optional -> LPCWSTR
# ReturnBuffer : LPWSTR optional, out -> LPWSTR
# ReturnBufferSize : DWORD -> DWORD
# RequiredSize : DWORD* optional, out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。
# Unicode(-W): LPCWSTR/LPWSTR は Win32::API が UTF-16 変換を行う。

関連項目

文字セット違い
使用する型