Win32 API 日本語リファレンス
ホームSystem.Diagnostics.ProcessSnapshotting › PssWalkMarkerCreate

PssWalkMarkerCreate

関数
スナップショット走査用のウォークマーカーを作成する。
DLLKERNEL32.dll呼出規約winapi対応OSWindows 8.1 以降

シグネチャ

// KERNEL32.dll
#include <windows.h>

DWORD PssWalkMarkerCreate(
    const PSS_ALLOCATOR* Allocator,   // optional
    HPSSWALK* WalkMarkerHandle
);

パラメーター

名前方向
AllocatorPSS_ALLOCATOR*inoptional
WalkMarkerHandleHPSSWALK*out

戻り値の型: DWORD

各言語での呼び出し定義

// KERNEL32.dll
#include <windows.h>

DWORD PssWalkMarkerCreate(
    const PSS_ALLOCATOR* Allocator,   // optional
    HPSSWALK* WalkMarkerHandle
);
[DllImport("KERNEL32.dll", ExactSpelling = true)]
static extern uint PssWalkMarkerCreate(
    IntPtr Allocator,   // PSS_ALLOCATOR* optional
    IntPtr WalkMarkerHandle   // HPSSWALK* out
);
<DllImport("KERNEL32.dll", ExactSpelling:=True)>
Public Shared Function PssWalkMarkerCreate(
    Allocator As IntPtr,   ' PSS_ALLOCATOR* optional
    WalkMarkerHandle As IntPtr   ' HPSSWALK* out
) As UInteger
End Function
' Allocator : PSS_ALLOCATOR* optional
' WalkMarkerHandle : HPSSWALK* out
Declare PtrSafe Function PssWalkMarkerCreate Lib "kernel32" ( _
    ByVal Allocator As LongPtr, _
    ByVal WalkMarkerHandle As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

PssWalkMarkerCreate = ctypes.windll.kernel32.PssWalkMarkerCreate
PssWalkMarkerCreate.restype = wintypes.DWORD
PssWalkMarkerCreate.argtypes = [
    ctypes.c_void_p,  # Allocator : PSS_ALLOCATOR* optional
    ctypes.c_void_p,  # WalkMarkerHandle : HPSSWALK* out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	kernel32 = windows.NewLazySystemDLL("KERNEL32.dll")
	procPssWalkMarkerCreate = kernel32.NewProc("PssWalkMarkerCreate")
)

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