Win32 API 日本語リファレンス
ホームUI.Shell.PropertiesSystem › PSEnumeratePropertyDescriptions

PSEnumeratePropertyDescriptions

関数
登録済みプロパティ説明を列挙する。
DLLPROPSYS.dll呼出規約winapi対応OSWindows XP 以降

シグネチャ

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

HRESULT PSEnumeratePropertyDescriptions(
    PROPDESC_ENUMFILTER filterOn,
    const GUID* riid,
    void** ppv
);

パラメーター

名前方向
filterOnPROPDESC_ENUMFILTERin
riidGUID*in
ppvvoid**out

戻り値の型: HRESULT

各言語での呼び出し定義

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

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

PSEnumeratePropertyDescriptions = ctypes.windll.propsys.PSEnumeratePropertyDescriptions
PSEnumeratePropertyDescriptions.restype = ctypes.c_int
PSEnumeratePropertyDescriptions.argtypes = [
    ctypes.c_int,  # filterOn : PROPDESC_ENUMFILTER
    ctypes.c_void_p,  # riid : GUID*
    ctypes.c_void_p,  # ppv : void** out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	propsys = windows.NewLazySystemDLL("PROPSYS.dll")
	procPSEnumeratePropertyDescriptions = propsys.NewProc("PSEnumeratePropertyDescriptions")
)

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