Win32 API 日本語リファレンス
ホームSystem.Performance › PdhBrowseCountersHA

PdhBrowseCountersHA

関数
ハンドル指定でカウンター選択ダイアログを表示する(ANSI版)。
DLLpdh.dll文字セットANSI (-A)呼出規約winapi対応OSWindows XP 以降

シグネチャ

// pdh.dll  (ANSI / -A)
#include <windows.h>

DWORD PdhBrowseCountersHA(
    PDH_BROWSE_DLG_CONFIG_HA* pBrowseDlgData
);

パラメーター

名前方向
pBrowseDlgDataPDH_BROWSE_DLG_CONFIG_HA*in

戻り値の型: DWORD

各言語での呼び出し定義

// pdh.dll  (ANSI / -A)
#include <windows.h>

DWORD PdhBrowseCountersHA(
    PDH_BROWSE_DLG_CONFIG_HA* pBrowseDlgData
);
[DllImport("pdh.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern uint PdhBrowseCountersHA(
    IntPtr pBrowseDlgData   // PDH_BROWSE_DLG_CONFIG_HA*
);
<DllImport("pdh.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function PdhBrowseCountersHA(
    pBrowseDlgData As IntPtr   ' PDH_BROWSE_DLG_CONFIG_HA*
) As UInteger
End Function
' pBrowseDlgData : PDH_BROWSE_DLG_CONFIG_HA*
Declare PtrSafe Function PdhBrowseCountersHA Lib "pdh" ( _
    ByVal pBrowseDlgData As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

PdhBrowseCountersHA = ctypes.windll.pdh.PdhBrowseCountersHA
PdhBrowseCountersHA.restype = wintypes.DWORD
PdhBrowseCountersHA.argtypes = [
    ctypes.c_void_p,  # pBrowseDlgData : PDH_BROWSE_DLG_CONFIG_HA*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	pdh = windows.NewLazySystemDLL("pdh.dll")
	procPdhBrowseCountersHA = pdh.NewProc("PdhBrowseCountersHA")
)

// pBrowseDlgData (PDH_BROWSE_DLG_CONFIG_HA*)
r1, _, err := procPdhBrowseCountersHA.Call(
	uintptr(pBrowseDlgData),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function PdhBrowseCountersHA(
  pBrowseDlgData: Pointer   // PDH_BROWSE_DLG_CONFIG_HA*
): DWORD; stdcall;
  external 'pdh.dll' name 'PdhBrowseCountersHA';
result := DllCall("pdh\PdhBrowseCountersHA"
    , "Ptr", pBrowseDlgData   ; PDH_BROWSE_DLG_CONFIG_HA*
    , "UInt")   ; return: DWORD
●PdhBrowseCountersHA(pBrowseDlgData) = DLL("pdh.dll", "dword PdhBrowseCountersHA(void*)")
# 呼び出し: PdhBrowseCountersHA(pBrowseDlgData)
# pBrowseDlgData : PDH_BROWSE_DLG_CONFIG_HA* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。