ホーム › System.Performance › PdhGetCounterInfoW
PdhGetCounterInfoW
関数カウンターの構成情報と説明文を取得する。
シグネチャ
// pdh.dll (Unicode / -W)
#include <windows.h>
DWORD PdhGetCounterInfoW(
PDH_HCOUNTER hCounter,
BOOLEAN bRetrieveExplainText,
DWORD* pdwBufferSize,
PDH_COUNTER_INFO_W* lpBuffer // optional
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| hCounter | PDH_HCOUNTER | in | 情報を取得する対象のカウンターのハンドル。このハンドルは PdhAddCounter 関数から返されます。 |
| bRetrieveExplainText | BOOLEAN | in | 説明テキストを取得するかどうかを指定します。このパラメーターを TRUE に設定すると、カウンターの説明テキストが取得されます。FALSE に設定すると、返されるバッファー内の該当フィールドは NULL になります。 |
| pdwBufferSize | DWORD* | inout | lpBuffer バッファーのサイズ(バイト単位)。入力時に 0 の場合、関数は PDH_MORE_DATA を返し、このパラメーターに必要なバッファーサイズを設定します。バッファーが必要なサイズより大きい場合、関数は実際に使用されたバッファーのサイズをこのパラメーターに設定します。入力時に指定したサイズが 0 より大きく、かつ必要なサイズより小さい場合は、返されたサイズを基にバッファーを再割り当てしないでください。 |
| lpBuffer | PDH_COUNTER_INFO_W* | outoptional | PDH_COUNTER_INFO 構造体を受け取る、呼び出し側が割り当てたバッファー。この構造体は可変長です。文字列データが構造体の固定形式部分の末尾に追加されるためです。これにより、すべてのデータが呼び出し側の割り当てた単一のバッファーで返されます。pdwBufferSize が 0 の場合は NULL に設定します。 |
戻り値の型: DWORD
公式ドキュメント
データサイズ、カウンターの種類、パス、ユーザー指定のデータ値など、カウンターに関する情報を取得します。(Unicode)
戻り値
関数が成功した場合は、ERROR_SUCCESS を返します。
関数が失敗した場合、戻り値は システムエラーコード または PDH エラーコード です。次の値が返される可能性があります。
| 戻り値 | 説明 |
|---|---|
| パラメーターが無効であるか、形式が正しくありません。たとえば、一部のリリースでは、入力時に指定したサイズが 0 より大きく、かつ必要なサイズより小さい場合にこのエラーを受け取ることがあります。 | |
| カウンターハンドルが無効です。 | |
| lpBuffer バッファーが小さすぎて、カウンター情報を格納できません。この戻り値は、入力時に pdwBufferSize が 0 の場合に想定されるものです。入力時に指定したサイズが 0 より大きく、かつ必要なサイズより小さい場合は、返されたサイズを基にバッファーを再割り当てしないでください。 |
解説(Remarks)
この関数は 2 回呼び出してください。1 回目は必要なバッファーサイズを取得するため(lpBuffer を NULL、pdwBufferSize を 0 に設定)、2 回目はデータを取得するためです。
メモ
pdh.h ヘッダーは、UNICODE プリプロセッサ定数の定義に基づいて、この関数の ANSI 版または Unicode 版を自動的に選択するエイリアスとして PdhGetCounterInfo を定義します。エンコーディング非依存のエイリアスを、エンコーディング非依存ではないコードと混在させて使用すると、不一致が生じ、コンパイルエラーや実行時エラーの原因となることがあります。詳細については、関数プロトタイプの規則を参照してください。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での呼び出し定義
// pdh.dll (Unicode / -W)
#include <windows.h>
DWORD PdhGetCounterInfoW(
PDH_HCOUNTER hCounter,
BOOLEAN bRetrieveExplainText,
DWORD* pdwBufferSize,
PDH_COUNTER_INFO_W* lpBuffer // optional
);[DllImport("pdh.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern uint PdhGetCounterInfoW(
IntPtr hCounter, // PDH_HCOUNTER
[MarshalAs(UnmanagedType.U1)] bool bRetrieveExplainText, // BOOLEAN
ref uint pdwBufferSize, // DWORD* in/out
IntPtr lpBuffer // PDH_COUNTER_INFO_W* optional, out
);<DllImport("pdh.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function PdhGetCounterInfoW(
hCounter As IntPtr, ' PDH_HCOUNTER
<MarshalAs(UnmanagedType.U1)> bRetrieveExplainText As Boolean, ' BOOLEAN
ByRef pdwBufferSize As UInteger, ' DWORD* in/out
lpBuffer As IntPtr ' PDH_COUNTER_INFO_W* optional, out
) As UInteger
End Function' hCounter : PDH_HCOUNTER
' bRetrieveExplainText : BOOLEAN
' pdwBufferSize : DWORD* in/out
' lpBuffer : PDH_COUNTER_INFO_W* optional, out
Declare PtrSafe Function PdhGetCounterInfoW Lib "pdh" ( _
ByVal hCounter As LongPtr, _
ByVal bRetrieveExplainText As Byte, _
ByRef pdwBufferSize As Long, _
ByVal lpBuffer As LongPtr) As Long
' Unicode(W): 文字列は ByVal As LongPtr とし StrPtr(unicodeStr) を渡す
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
PdhGetCounterInfoW = ctypes.windll.pdh.PdhGetCounterInfoW
PdhGetCounterInfoW.restype = wintypes.DWORD
PdhGetCounterInfoW.argtypes = [
wintypes.HANDLE, # hCounter : PDH_HCOUNTER
wintypes.BOOLEAN, # bRetrieveExplainText : BOOLEAN
ctypes.POINTER(wintypes.DWORD), # pdwBufferSize : DWORD* in/out
ctypes.c_void_p, # lpBuffer : PDH_COUNTER_INFO_W* optional, out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('pdh.dll')
PdhGetCounterInfoW = Fiddle::Function.new(
lib['PdhGetCounterInfoW'],
[
Fiddle::TYPE_VOIDP, # hCounter : PDH_HCOUNTER
Fiddle::TYPE_CHAR, # bRetrieveExplainText : BOOLEAN
Fiddle::TYPE_VOIDP, # pdwBufferSize : DWORD* in/out
Fiddle::TYPE_VOIDP, # lpBuffer : PDH_COUNTER_INFO_W* optional, out
],
-Fiddle::TYPE_INT)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"#[link(name = "pdh")]
extern "system" {
fn PdhGetCounterInfoW(
hCounter: *mut core::ffi::c_void, // PDH_HCOUNTER
bRetrieveExplainText: u8, // BOOLEAN
pdwBufferSize: *mut u32, // DWORD* in/out
lpBuffer: *mut PDH_COUNTER_INFO_W // PDH_COUNTER_INFO_W* optional, out
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("pdh.dll", CharSet = CharSet.Unicode)]
public static extern uint PdhGetCounterInfoW(IntPtr hCounter, [MarshalAs(UnmanagedType.U1)] bool bRetrieveExplainText, ref uint pdwBufferSize, IntPtr lpBuffer);
"@
$api = Add-Type -MemberDefinition $sig -Name 'pdh_PdhGetCounterInfoW' -Namespace Win32 -PassThru
# $api::PdhGetCounterInfoW(hCounter, bRetrieveExplainText, pdwBufferSize, lpBuffer)#uselib "pdh.dll"
#func global PdhGetCounterInfoW "PdhGetCounterInfoW" wptr, wptr, wptr, wptr
; PdhGetCounterInfoW hCounter, bRetrieveExplainText, varptr(pdwBufferSize), varptr(lpBuffer) ; 戻り値は stat
; hCounter : PDH_HCOUNTER -> "wptr"
; bRetrieveExplainText : BOOLEAN -> "wptr"
; pdwBufferSize : DWORD* in/out -> "wptr"
; lpBuffer : PDH_COUNTER_INFO_W* optional, out -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "pdh.dll" #cfunc global PdhGetCounterInfoW "PdhGetCounterInfoW" sptr, int, var, var ; res = PdhGetCounterInfoW(hCounter, bRetrieveExplainText, pdwBufferSize, lpBuffer) ; hCounter : PDH_HCOUNTER -> "sptr" ; bRetrieveExplainText : BOOLEAN -> "int" ; pdwBufferSize : DWORD* in/out -> "var" ; lpBuffer : PDH_COUNTER_INFO_W* optional, out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "pdh.dll" #cfunc global PdhGetCounterInfoW "PdhGetCounterInfoW" sptr, int, sptr, sptr ; res = PdhGetCounterInfoW(hCounter, bRetrieveExplainText, varptr(pdwBufferSize), varptr(lpBuffer)) ; hCounter : PDH_HCOUNTER -> "sptr" ; bRetrieveExplainText : BOOLEAN -> "int" ; pdwBufferSize : DWORD* in/out -> "sptr" ; lpBuffer : PDH_COUNTER_INFO_W* optional, out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; DWORD PdhGetCounterInfoW(PDH_HCOUNTER hCounter, BOOLEAN bRetrieveExplainText, DWORD* pdwBufferSize, PDH_COUNTER_INFO_W* lpBuffer) #uselib "pdh.dll" #cfunc global PdhGetCounterInfoW "PdhGetCounterInfoW" intptr, int, var, var ; res = PdhGetCounterInfoW(hCounter, bRetrieveExplainText, pdwBufferSize, lpBuffer) ; hCounter : PDH_HCOUNTER -> "intptr" ; bRetrieveExplainText : BOOLEAN -> "int" ; pdwBufferSize : DWORD* in/out -> "var" ; lpBuffer : PDH_COUNTER_INFO_W* optional, out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; DWORD PdhGetCounterInfoW(PDH_HCOUNTER hCounter, BOOLEAN bRetrieveExplainText, DWORD* pdwBufferSize, PDH_COUNTER_INFO_W* lpBuffer) #uselib "pdh.dll" #cfunc global PdhGetCounterInfoW "PdhGetCounterInfoW" intptr, int, intptr, intptr ; res = PdhGetCounterInfoW(hCounter, bRetrieveExplainText, varptr(pdwBufferSize), varptr(lpBuffer)) ; hCounter : PDH_HCOUNTER -> "intptr" ; bRetrieveExplainText : BOOLEAN -> "int" ; pdwBufferSize : DWORD* in/out -> "intptr" ; lpBuffer : PDH_COUNTER_INFO_W* optional, out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
pdh = windows.NewLazySystemDLL("pdh.dll")
procPdhGetCounterInfoW = pdh.NewProc("PdhGetCounterInfoW")
)
// hCounter (PDH_HCOUNTER), bRetrieveExplainText (BOOLEAN), pdwBufferSize (DWORD* in/out), lpBuffer (PDH_COUNTER_INFO_W* optional, out)
r1, _, err := procPdhGetCounterInfoW.Call(
uintptr(hCounter),
uintptr(bRetrieveExplainText),
uintptr(pdwBufferSize),
uintptr(lpBuffer),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction PdhGetCounterInfoW(
hCounter: THandle; // PDH_HCOUNTER
bRetrieveExplainText: ByteBool; // BOOLEAN
pdwBufferSize: Pointer; // DWORD* in/out
lpBuffer: Pointer // PDH_COUNTER_INFO_W* optional, out
): DWORD; stdcall;
external 'pdh.dll' name 'PdhGetCounterInfoW';result := DllCall("pdh\PdhGetCounterInfoW"
, "Ptr", hCounter ; PDH_HCOUNTER
, "Char", bRetrieveExplainText ; BOOLEAN
, "Ptr", pdwBufferSize ; DWORD* in/out
, "Ptr", lpBuffer ; PDH_COUNTER_INFO_W* optional, out
, "UInt") ; return: DWORD●PdhGetCounterInfoW(hCounter, bRetrieveExplainText, pdwBufferSize, lpBuffer) = DLL("pdh.dll", "dword PdhGetCounterInfoW(void*, byte, void*, void*)")
# 呼び出し: PdhGetCounterInfoW(hCounter, bRetrieveExplainText, pdwBufferSize, lpBuffer)
# hCounter : PDH_HCOUNTER -> "void*"
# bRetrieveExplainText : BOOLEAN -> "byte"
# pdwBufferSize : DWORD* in/out -> "void*"
# lpBuffer : PDH_COUNTER_INFO_W* optional, out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。const std = @import("std");
extern "pdh" fn PdhGetCounterInfoW(
hCounter: ?*anyopaque, // PDH_HCOUNTER
bRetrieveExplainText: u8, // BOOLEAN
pdwBufferSize: [*c]u32, // DWORD* in/out
lpBuffer: [*c]PDH_COUNTER_INFO_W // PDH_COUNTER_INFO_W* optional, out
) callconv(std.os.windows.WINAPI) u32;
// Unicode(-W): UTF-16LE のヌル終端バッファ([*c]const u16)を渡す。proc PdhGetCounterInfoW(
hCounter: pointer, # PDH_HCOUNTER
bRetrieveExplainText: uint8, # BOOLEAN
pdwBufferSize: ptr uint32, # DWORD* in/out
lpBuffer: ptr PDH_COUNTER_INFO_W # PDH_COUNTER_INFO_W* optional, out
): uint32 {.importc: "PdhGetCounterInfoW", stdcall, dynlib: "pdh.dll".}
# Unicode(-W): WideCString は newWideCString("...") で生成。pragma(lib, "pdh");
extern(Windows)
uint PdhGetCounterInfoW(
void* hCounter, // PDH_HCOUNTER
ubyte bRetrieveExplainText, // BOOLEAN
uint* pdwBufferSize, // DWORD* in/out
PDH_COUNTER_INFO_W* lpBuffer // PDH_COUNTER_INFO_W* optional, out
);ccall((:PdhGetCounterInfoW, "pdh.dll"), stdcall, UInt32,
(Ptr{Cvoid}, UInt8, Ptr{UInt32}, Ptr{PDH_COUNTER_INFO_W}),
hCounter, bRetrieveExplainText, pdwBufferSize, lpBuffer)
# hCounter : PDH_HCOUNTER -> Ptr{Cvoid}
# bRetrieveExplainText : BOOLEAN -> UInt8
# pdwBufferSize : DWORD* in/out -> Ptr{UInt32}
# lpBuffer : PDH_COUNTER_INFO_W* optional, out -> Ptr{PDH_COUNTER_INFO_W}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
# Unicode(-W): Cwstring には transcode(UInt16, "...") 等で UTF-16 を渡す。local ffi = require("ffi")
ffi.cdef[[
uint32_t PdhGetCounterInfoW(
void* hCounter,
uint8_t bRetrieveExplainText,
uint32_t* pdwBufferSize,
void* lpBuffer);
]]
local pdh = ffi.load("pdh")
-- pdh.PdhGetCounterInfoW(hCounter, bRetrieveExplainText, pdwBufferSize, lpBuffer)
-- hCounter : PDH_HCOUNTER
-- bRetrieveExplainText : BOOLEAN
-- pdwBufferSize : DWORD* in/out
-- lpBuffer : PDH_COUNTER_INFO_W* optional, out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
-- Unicode(-W): uint16_t* には UTF-16LE のバッファ(ffi.new("uint16_t[?]", ...))を渡す。const koffi = require('koffi');
const lib = koffi.load('pdh.dll');
const PdhGetCounterInfoW = lib.func('__stdcall', 'PdhGetCounterInfoW', 'uint32_t', ['void *', 'uint8_t', 'uint32_t *', 'void *']);
// PdhGetCounterInfoW(hCounter, bRetrieveExplainText, pdwBufferSize, lpBuffer)
// hCounter : PDH_HCOUNTER -> 'void *'
// bRetrieveExplainText : BOOLEAN -> 'uint8_t'
// pdwBufferSize : DWORD* in/out -> 'uint32_t *'
// lpBuffer : PDH_COUNTER_INFO_W* optional, out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("pdh.dll", {
PdhGetCounterInfoW: { parameters: ["pointer", "u8", "pointer", "pointer"], result: "u32" },
});
// lib.symbols.PdhGetCounterInfoW(hCounter, bRetrieveExplainText, pdwBufferSize, lpBuffer)
// hCounter : PDH_HCOUNTER -> "pointer"
// bRetrieveExplainText : BOOLEAN -> "u8"
// pdwBufferSize : DWORD* in/out -> "pointer"
// lpBuffer : PDH_COUNTER_INFO_W* optional, out -> "pointer"
// 文字列は "buffer"。Unicode(-W) は new TextEncoder() ではなく UTF-16LE のバイト列(末尾に \x00\x00)を Uint8Array で渡す。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
uint32_t PdhGetCounterInfoW(
void* hCounter,
uint8_t bRetrieveExplainText,
uint32_t* pdwBufferSize,
void* lpBuffer);
C, "pdh.dll");
// $ffi->PdhGetCounterInfoW(hCounter, bRetrieveExplainText, pdwBufferSize, lpBuffer);
// hCounter : PDH_HCOUNTER
// bRetrieveExplainText : BOOLEAN
// pdwBufferSize : DWORD* in/out
// lpBuffer : PDH_COUNTER_INFO_W* optional, 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 Pdh extends StdCallLibrary {
Pdh INSTANCE = Native.load("pdh", Pdh.class, W32APIOptions.UNICODE_OPTIONS);
int PdhGetCounterInfoW(
Pointer hCounter, // PDH_HCOUNTER
byte bRetrieveExplainText, // BOOLEAN
IntByReference pdwBufferSize, // DWORD* in/out
Pointer lpBuffer // PDH_COUNTER_INFO_W* optional, out
);
}
// Unicode(-W): WString(入力)/char[](出力)で UTF-16 をマーシャリング。@[Link("pdh")]
lib Libpdh
fun PdhGetCounterInfoW = PdhGetCounterInfoW(
hCounter : Void*, # PDH_HCOUNTER
bRetrieveExplainText : UInt8, # BOOLEAN
pdwBufferSize : UInt32*, # DWORD* in/out
lpBuffer : PDH_COUNTER_INFO_W* # PDH_COUNTER_INFO_W* optional, out
) : UInt32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef PdhGetCounterInfoWNative = Uint32 Function(Pointer<Void>, Uint8, Pointer<Uint32>, Pointer<Void>);
typedef PdhGetCounterInfoWDart = int Function(Pointer<Void>, int, Pointer<Uint32>, Pointer<Void>);
final PdhGetCounterInfoW = DynamicLibrary.open('pdh.dll')
.lookupFunction<PdhGetCounterInfoWNative, PdhGetCounterInfoWDart>('PdhGetCounterInfoW');
// hCounter : PDH_HCOUNTER -> Pointer<Void>
// bRetrieveExplainText : BOOLEAN -> Uint8
// pdwBufferSize : DWORD* in/out -> Pointer<Uint32>
// lpBuffer : PDH_COUNTER_INFO_W* optional, out -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function PdhGetCounterInfoW(
hCounter: THandle; // PDH_HCOUNTER
bRetrieveExplainText: ByteBool; // BOOLEAN
pdwBufferSize: Pointer; // DWORD* in/out
lpBuffer: Pointer // PDH_COUNTER_INFO_W* optional, out
): DWORD; stdcall;
external 'pdh.dll' name 'PdhGetCounterInfoW';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "PdhGetCounterInfoW"
c_PdhGetCounterInfoW :: Ptr () -> Word8 -> Ptr Word32 -> Ptr () -> IO Word32
-- hCounter : PDH_HCOUNTER -> Ptr ()
-- bRetrieveExplainText : BOOLEAN -> Word8
-- pdwBufferSize : DWORD* in/out -> Ptr Word32
-- lpBuffer : PDH_COUNTER_INFO_W* optional, out -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let pdhgetcounterinfow =
foreign "PdhGetCounterInfoW"
((ptr void) @-> uint8_t @-> (ptr uint32_t) @-> (ptr void) @-> returning uint32_t)
(* hCounter : PDH_HCOUNTER -> (ptr void) *)
(* bRetrieveExplainText : BOOLEAN -> uint8_t *)
(* pdwBufferSize : DWORD* in/out -> (ptr uint32_t) *)
(* lpBuffer : PDH_COUNTER_INFO_W* optional, out -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library pdh (t "pdh.dll"))
(cffi:use-foreign-library pdh)
(cffi:defcfun ("PdhGetCounterInfoW" pdh-get-counter-info-w :convention :stdcall) :uint32
(h-counter :pointer) ; PDH_HCOUNTER
(b-retrieve-explain-text :uint8) ; BOOLEAN
(pdw-buffer-size :pointer) ; DWORD* in/out
(lp-buffer :pointer)) ; PDH_COUNTER_INFO_W* optional, out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $PdhGetCounterInfoW = Win32::API::More->new('pdh',
'DWORD PdhGetCounterInfoW(HANDLE hCounter, BYTE bRetrieveExplainText, LPVOID pdwBufferSize, LPVOID lpBuffer)');
# my $ret = $PdhGetCounterInfoW->Call($hCounter, $bRetrieveExplainText, $pdwBufferSize, $lpBuffer);
# hCounter : PDH_HCOUNTER -> HANDLE
# bRetrieveExplainText : BOOLEAN -> BYTE
# pdwBufferSize : DWORD* in/out -> LPVOID
# lpBuffer : PDH_COUNTER_INFO_W* optional, out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。
# Unicode(-W): LPCWSTR/LPWSTR は Win32::API が UTF-16 変換を行う。関連項目
文字セット違い
- f PdhGetCounterInfoA (ANSI版) — カウンターの構成情報と説明文を取得する(ANSI版)。
使用する型