ホーム › 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 | 要求するインターフェイスの識別子GUIDへのポインタ。通常はIID_IPropertyDescription。 |
| 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)。const std = @import("std");
extern "propsys" fn PSGetPropertyDescription(
propkey: [*c]PROPERTYKEY, // PROPERTYKEY*
riid: [*c]GUID, // GUID*
ppv: ?*anyopaque // void** out
) callconv(std.os.windows.WINAPI) i32;proc PSGetPropertyDescription(
propkey: ptr PROPERTYKEY, # PROPERTYKEY*
riid: ptr GUID, # GUID*
ppv: pointer # void** out
): int32 {.importc: "PSGetPropertyDescription", stdcall, dynlib: "PROPSYS.dll".}pragma(lib, "propsys");
extern(Windows)
int PSGetPropertyDescription(
PROPERTYKEY* propkey, // PROPERTYKEY*
GUID* riid, // GUID*
void** ppv // void** out
);ccall((:PSGetPropertyDescription, "PROPSYS.dll"), stdcall, Int32,
(Ptr{PROPERTYKEY}, Ptr{GUID}, Ptr{Cvoid}),
propkey, riid, ppv)
# propkey : PROPERTYKEY* -> Ptr{PROPERTYKEY}
# riid : GUID* -> Ptr{GUID}
# ppv : void** out -> Ptr{Cvoid}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t PSGetPropertyDescription(
void* propkey,
void* riid,
void** ppv);
]]
local propsys = ffi.load("propsys")
-- propsys.PSGetPropertyDescription(propkey, riid, ppv)
-- propkey : PROPERTYKEY*
-- riid : GUID*
-- ppv : void** out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('PROPSYS.dll');
const PSGetPropertyDescription = lib.func('__stdcall', 'PSGetPropertyDescription', 'int32_t', ['void *', 'void *', 'void *']);
// PSGetPropertyDescription(propkey, riid, ppv)
// propkey : PROPERTYKEY* -> 'void *'
// riid : GUID* -> 'void *'
// ppv : void** out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("PROPSYS.dll", {
PSGetPropertyDescription: { parameters: ["pointer", "pointer", "pointer"], result: "i32" },
});
// lib.symbols.PSGetPropertyDescription(propkey, riid, ppv)
// propkey : PROPERTYKEY* -> "pointer"
// riid : GUID* -> "pointer"
// ppv : void** out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t PSGetPropertyDescription(
void* propkey,
void* riid,
void** ppv);
C, "PROPSYS.dll");
// $ffi->PSGetPropertyDescription(propkey, riid, ppv);
// propkey : PROPERTYKEY*
// riid : GUID*
// ppv : void** 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 Propsys extends StdCallLibrary {
Propsys INSTANCE = Native.load("propsys", Propsys.class);
int PSGetPropertyDescription(
Pointer propkey, // PROPERTYKEY*
Pointer riid, // GUID*
Pointer ppv // void** out
);
}@[Link("propsys")]
lib LibPROPSYS
fun PSGetPropertyDescription = PSGetPropertyDescription(
propkey : PROPERTYKEY*, # PROPERTYKEY*
riid : GUID*, # GUID*
ppv : Void** # void** out
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef PSGetPropertyDescriptionNative = Int32 Function(Pointer<Void>, Pointer<Void>, Pointer<Void>);
typedef PSGetPropertyDescriptionDart = int Function(Pointer<Void>, Pointer<Void>, Pointer<Void>);
final PSGetPropertyDescription = DynamicLibrary.open('PROPSYS.dll')
.lookupFunction<PSGetPropertyDescriptionNative, PSGetPropertyDescriptionDart>('PSGetPropertyDescription');
// propkey : PROPERTYKEY* -> Pointer<Void>
// riid : GUID* -> Pointer<Void>
// ppv : void** out -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function PSGetPropertyDescription(
propkey: Pointer; // PROPERTYKEY*
riid: PGUID; // GUID*
ppv: Pointer // void** out
): Integer; stdcall;
external 'PROPSYS.dll' name 'PSGetPropertyDescription';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "PSGetPropertyDescription"
c_PSGetPropertyDescription :: Ptr () -> Ptr () -> Ptr () -> IO Int32
-- propkey : PROPERTYKEY* -> Ptr ()
-- riid : GUID* -> Ptr ()
-- ppv : void** out -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let psgetpropertydescription =
foreign "PSGetPropertyDescription"
((ptr void) @-> (ptr void) @-> (ptr void) @-> returning int32_t)
(* propkey : PROPERTYKEY* -> (ptr void) *)
(* riid : GUID* -> (ptr void) *)
(* ppv : void** out -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library propsys (t "PROPSYS.dll"))
(cffi:use-foreign-library propsys)
(cffi:defcfun ("PSGetPropertyDescription" psget-property-description :convention :stdcall) :int32
(propkey :pointer) ; PROPERTYKEY*
(riid :pointer) ; GUID*
(ppv :pointer)) ; void** out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $PSGetPropertyDescription = Win32::API::More->new('PROPSYS',
'int PSGetPropertyDescription(LPVOID propkey, LPVOID riid, LPVOID ppv)');
# my $ret = $PSGetPropertyDescription->Call($propkey, $riid, $ppv);
# propkey : PROPERTYKEY* -> LPVOID
# riid : GUID* -> LPVOID
# ppv : void** out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。関連項目
使用する型