Win32 API 日本語リファレンス
ホームWeb.InternetExplorer › IEGetWriteableFolderPath

IEGetWriteableFolderPath

関数
書き込み可能なフォルダのパスを取得する。
DLLIeframe.dll呼出規約winapi

シグネチャ

// Ieframe.dll
#include <windows.h>

HRESULT IEGetWriteableFolderPath(
    const GUID* clsidFolderID,
    LPWSTR* lppwstrPath
);

パラメーター

名前方向説明
clsidFolderIDGUID*in対象とする既知フォルダのIDを示すGUIDへのポインタ。
lppwstrPathLPWSTR*out保護モードで書き込み可能なフォルダパスを受け取る出力ポインタ。

戻り値の型: HRESULT

各言語での呼び出し定義

// Ieframe.dll
#include <windows.h>

HRESULT IEGetWriteableFolderPath(
    const GUID* clsidFolderID,
    LPWSTR* lppwstrPath
);
[DllImport("Ieframe.dll", ExactSpelling = true)]
static extern int IEGetWriteableFolderPath(
    ref Guid clsidFolderID,   // GUID*
    IntPtr lppwstrPath   // LPWSTR* out
);
<DllImport("Ieframe.dll", ExactSpelling:=True)>
Public Shared Function IEGetWriteableFolderPath(
    ByRef clsidFolderID As Guid,   ' GUID*
    lppwstrPath As IntPtr   ' LPWSTR* out
) As Integer
End Function
' clsidFolderID : GUID*
' lppwstrPath : LPWSTR* out
Declare PtrSafe Function IEGetWriteableFolderPath Lib "ieframe" ( _
    ByVal clsidFolderID As LongPtr, _
    ByVal lppwstrPath As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

IEGetWriteableFolderPath = ctypes.windll.ieframe.IEGetWriteableFolderPath
IEGetWriteableFolderPath.restype = ctypes.c_int
IEGetWriteableFolderPath.argtypes = [
    ctypes.c_void_p,  # clsidFolderID : GUID*
    ctypes.c_void_p,  # lppwstrPath : LPWSTR* out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('Ieframe.dll')
IEGetWriteableFolderPath = Fiddle::Function.new(
  lib['IEGetWriteableFolderPath'],
  [
    Fiddle::TYPE_VOIDP,  # clsidFolderID : GUID*
    Fiddle::TYPE_VOIDP,  # lppwstrPath : LPWSTR* out
  ],
  Fiddle::TYPE_INT)
#[link(name = "ieframe")]
extern "system" {
    fn IEGetWriteableFolderPath(
        clsidFolderID: *const GUID,  // GUID*
        lppwstrPath: *mut *mut u16  // LPWSTR* out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("Ieframe.dll")]
public static extern int IEGetWriteableFolderPath(ref Guid clsidFolderID, IntPtr lppwstrPath);
"@
$api = Add-Type -MemberDefinition $sig -Name 'Ieframe_IEGetWriteableFolderPath' -Namespace Win32 -PassThru
# $api::IEGetWriteableFolderPath(clsidFolderID, lppwstrPath)
#uselib "Ieframe.dll"
#func global IEGetWriteableFolderPath "IEGetWriteableFolderPath" sptr, sptr
; IEGetWriteableFolderPath varptr(clsidFolderID), varptr(lppwstrPath)   ; 戻り値は stat
; clsidFolderID : GUID* -> "sptr"
; lppwstrPath : LPWSTR* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "Ieframe.dll"
#cfunc global IEGetWriteableFolderPath "IEGetWriteableFolderPath" var, var
; res = IEGetWriteableFolderPath(clsidFolderID, lppwstrPath)
; clsidFolderID : GUID* -> "var"
; lppwstrPath : LPWSTR* out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; HRESULT IEGetWriteableFolderPath(GUID* clsidFolderID, LPWSTR* lppwstrPath)
#uselib "Ieframe.dll"
#cfunc global IEGetWriteableFolderPath "IEGetWriteableFolderPath" var, var
; res = IEGetWriteableFolderPath(clsidFolderID, lppwstrPath)
; clsidFolderID : GUID* -> "var"
; lppwstrPath : LPWSTR* out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	ieframe = windows.NewLazySystemDLL("Ieframe.dll")
	procIEGetWriteableFolderPath = ieframe.NewProc("IEGetWriteableFolderPath")
)

// clsidFolderID (GUID*), lppwstrPath (LPWSTR* out)
r1, _, err := procIEGetWriteableFolderPath.Call(
	uintptr(clsidFolderID),
	uintptr(lppwstrPath),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function IEGetWriteableFolderPath(
  clsidFolderID: PGUID;   // GUID*
  lppwstrPath: PPWideChar   // LPWSTR* out
): Integer; stdcall;
  external 'Ieframe.dll' name 'IEGetWriteableFolderPath';
result := DllCall("Ieframe\IEGetWriteableFolderPath"
    , "Ptr", clsidFolderID   ; GUID*
    , "Ptr", lppwstrPath   ; LPWSTR* out
    , "Int")   ; return: HRESULT
●IEGetWriteableFolderPath(clsidFolderID, lppwstrPath) = DLL("Ieframe.dll", "int IEGetWriteableFolderPath(void*, void*)")
# 呼び出し: IEGetWriteableFolderPath(clsidFolderID, lppwstrPath)
# clsidFolderID : GUID* -> "void*"
# lppwstrPath : LPWSTR* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。