PathQualify
関数相対パスを完全修飾パスに正規化する。
シグネチャ
// SHELL32.dll
#include <windows.h>
void PathQualify(
LPWSTR psz
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| psz | LPWSTR | inout |
戻り値の型: void
各言語での呼び出し定義
// SHELL32.dll
#include <windows.h>
void PathQualify(
LPWSTR psz
);[DllImport("SHELL32.dll", ExactSpelling = true)]
static extern void PathQualify(
[MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder psz // LPWSTR in/out
);<DllImport("SHELL32.dll", ExactSpelling:=True)>
Public Shared Sub PathQualify(
<MarshalAs(UnmanagedType.LPWStr)> psz As System.Text.StringBuilder ' LPWSTR in/out
)
End Sub' psz : LPWSTR in/out
Declare PtrSafe Sub PathQualify Lib "shell32" ( _
ByVal psz As LongPtr)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
PathQualify = ctypes.windll.shell32.PathQualify
PathQualify.restype = None
PathQualify.argtypes = [
wintypes.LPWSTR, # psz : LPWSTR in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('SHELL32.dll')
PathQualify = Fiddle::Function.new(
lib['PathQualify'],
[
Fiddle::TYPE_VOIDP, # psz : LPWSTR in/out
],
Fiddle::TYPE_VOID)#[link(name = "shell32")]
extern "system" {
fn PathQualify(
psz: *mut u16 // LPWSTR in/out
);
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("SHELL32.dll")]
public static extern void PathQualify([MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder psz);
"@
$api = Add-Type -MemberDefinition $sig -Name 'SHELL32_PathQualify' -Namespace Win32 -PassThru
# $api::PathQualify(psz)#uselib "SHELL32.dll"
#func global PathQualify "PathQualify" sptr
; PathQualify varptr(psz)
; psz : LPWSTR in/out -> "sptr"出力引数:
#uselib "SHELL32.dll" #func global PathQualify "PathQualify" var ; PathQualify psz ; psz : LPWSTR in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "SHELL32.dll" #func global PathQualify "PathQualify" sptr ; PathQualify varptr(psz) ; psz : LPWSTR in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; void PathQualify(LPWSTR psz) #uselib "SHELL32.dll" #func global PathQualify "PathQualify" var ; PathQualify psz ; psz : LPWSTR in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; void PathQualify(LPWSTR psz) #uselib "SHELL32.dll" #func global PathQualify "PathQualify" intptr ; PathQualify varptr(psz) ; psz : LPWSTR in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
shell32 = windows.NewLazySystemDLL("SHELL32.dll")
procPathQualify = shell32.NewProc("PathQualify")
)
// psz (LPWSTR in/out)
r1, _, err := procPathQualify.Call(
uintptr(psz),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // voidprocedure PathQualify(
psz: PWideChar // LPWSTR in/out
); stdcall;
external 'SHELL32.dll' name 'PathQualify';result := DllCall("SHELL32\PathQualify"
, "Ptr", psz ; LPWSTR in/out
, "Int") ; return: void●PathQualify(psz) = DLL("SHELL32.dll", "int PathQualify(char*)")
# 呼び出し: PathQualify(psz)
# psz : LPWSTR in/out -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。