ホーム › UI.Shell.PropertiesSystem › PSGetPropertyDescription
PSGetPropertyDescription
関数プロパティキーから説明情報を取得する。
シグネチャ
// PROPSYS.dll
#include <windows.h>
HRESULT PSGetPropertyDescription(
const PROPERTYKEY* propkey,
const GUID* riid,
void** ppv
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| propkey | PROPERTYKEY* | in |
| riid | GUID* | in |
| ppv | void** | out |
戻り値の型: HRESULT
各言語での呼び出し定義
// PROPSYS.dll
#include <windows.h>
HRESULT PSGetPropertyDescription(
const PROPERTYKEY* propkey,
const GUID* riid,
void** ppv
);[DllImport("PROPSYS.dll", ExactSpelling = true)]
static extern int PSGetPropertyDescription(
IntPtr propkey, // PROPERTYKEY*
ref Guid riid, // GUID*
IntPtr ppv // void** out
);<DllImport("PROPSYS.dll", ExactSpelling:=True)>
Public Shared Function PSGetPropertyDescription(
propkey As IntPtr, ' PROPERTYKEY*
ByRef riid As Guid, ' GUID*
ppv As IntPtr ' void** out
) As Integer
End Function' propkey : PROPERTYKEY*
' riid : GUID*
' ppv : void** out
Declare PtrSafe Function PSGetPropertyDescription Lib "propsys" ( _
ByVal propkey As LongPtr, _
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
PSGetPropertyDescription = ctypes.windll.propsys.PSGetPropertyDescription
PSGetPropertyDescription.restype = ctypes.c_int
PSGetPropertyDescription.argtypes = [
ctypes.c_void_p, # propkey : PROPERTYKEY*
ctypes.c_void_p, # riid : GUID*
ctypes.c_void_p, # ppv : void** out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('PROPSYS.dll')
PSGetPropertyDescription = Fiddle::Function.new(
lib['PSGetPropertyDescription'],
[
Fiddle::TYPE_VOIDP, # propkey : PROPERTYKEY*
Fiddle::TYPE_VOIDP, # riid : GUID*
Fiddle::TYPE_VOIDP, # ppv : void** out
],
Fiddle::TYPE_INT)#[link(name = "propsys")]
extern "system" {
fn PSGetPropertyDescription(
propkey: *const PROPERTYKEY, // PROPERTYKEY*
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 PSGetPropertyDescription(IntPtr propkey, ref Guid riid, IntPtr ppv);
"@
$api = Add-Type -MemberDefinition $sig -Name 'PROPSYS_PSGetPropertyDescription' -Namespace Win32 -PassThru
# $api::PSGetPropertyDescription(propkey, riid, ppv)#uselib "PROPSYS.dll"
#func global PSGetPropertyDescription "PSGetPropertyDescription" sptr, sptr, sptr
; PSGetPropertyDescription varptr(propkey), varptr(riid), ppv ; 戻り値は stat
; propkey : PROPERTYKEY* -> "sptr"
; riid : GUID* -> "sptr"
; ppv : void** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "PROPSYS.dll" #cfunc global PSGetPropertyDescription "PSGetPropertyDescription" var, var, sptr ; res = PSGetPropertyDescription(propkey, riid, ppv) ; propkey : PROPERTYKEY* -> "var" ; riid : GUID* -> "var" ; ppv : void** out -> "sptr" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "PROPSYS.dll" #cfunc global PSGetPropertyDescription "PSGetPropertyDescription" sptr, sptr, sptr ; res = PSGetPropertyDescription(varptr(propkey), varptr(riid), ppv) ; propkey : PROPERTYKEY* -> "sptr" ; riid : GUID* -> "sptr" ; ppv : void** out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; HRESULT PSGetPropertyDescription(PROPERTYKEY* propkey, GUID* riid, void** ppv) #uselib "PROPSYS.dll" #cfunc global PSGetPropertyDescription "PSGetPropertyDescription" var, var, intptr ; res = PSGetPropertyDescription(propkey, riid, ppv) ; propkey : PROPERTYKEY* -> "var" ; riid : GUID* -> "var" ; ppv : void** out -> "intptr" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT PSGetPropertyDescription(PROPERTYKEY* propkey, GUID* riid, void** ppv) #uselib "PROPSYS.dll" #cfunc global PSGetPropertyDescription "PSGetPropertyDescription" intptr, intptr, intptr ; res = PSGetPropertyDescription(varptr(propkey), varptr(riid), ppv) ; propkey : PROPERTYKEY* -> "intptr" ; riid : GUID* -> "intptr" ; ppv : void** out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
propsys = windows.NewLazySystemDLL("PROPSYS.dll")
procPSGetPropertyDescription = propsys.NewProc("PSGetPropertyDescription")
)
// propkey (PROPERTYKEY*), riid (GUID*), ppv (void** out)
r1, _, err := procPSGetPropertyDescription.Call(
uintptr(propkey),
uintptr(riid),
uintptr(ppv),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction PSGetPropertyDescription(
propkey: Pointer; // PROPERTYKEY*
riid: PGUID; // GUID*
ppv: Pointer // void** out
): Integer; stdcall;
external 'PROPSYS.dll' name 'PSGetPropertyDescription';result := DllCall("PROPSYS\PSGetPropertyDescription"
, "Ptr", propkey ; PROPERTYKEY*
, "Ptr", riid ; GUID*
, "Ptr", ppv ; void** out
, "Int") ; return: HRESULT●PSGetPropertyDescription(propkey, riid, ppv) = DLL("PROPSYS.dll", "int PSGetPropertyDescription(void*, void*, void*)")
# 呼び出し: PSGetPropertyDescription(propkey, riid, ppv)
# propkey : PROPERTYKEY* -> "void*"
# riid : GUID* -> "void*"
# ppv : void** out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。