Win32 API 日本語リファレンス
ホームNetworkManagement.Snmp › SnmpCleanup

SnmpCleanup

関数
WinSNMP APIを終了しリソースを解放する。
DLLwsnmp32.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

DWORD SnmpCleanup(void);

パラメーターなし。戻り値: DWORD

各言語での呼び出し定義

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

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

SnmpCleanup = ctypes.windll.wsnmp32.SnmpCleanup
SnmpCleanup.restype = wintypes.DWORD
SnmpCleanup.argtypes = []
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('wsnmp32.dll')
SnmpCleanup = Fiddle::Function.new(
  lib['SnmpCleanup'],
  [],
  -Fiddle::TYPE_INT)
#[link(name = "wsnmp32")]
extern "system" {
    fn SnmpCleanup() -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("wsnmp32.dll")]
public static extern uint SnmpCleanup();
"@
$api = Add-Type -MemberDefinition $sig -Name 'wsnmp32_SnmpCleanup' -Namespace Win32 -PassThru
# $api::SnmpCleanup()
#uselib "wsnmp32.dll"
#func global SnmpCleanup "SnmpCleanup"
; SnmpCleanup   ; 戻り値は stat
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "wsnmp32.dll"
#cfunc global SnmpCleanup "SnmpCleanup"
; res = SnmpCleanup()
; DWORD SnmpCleanup()
#uselib "wsnmp32.dll"
#cfunc global SnmpCleanup "SnmpCleanup"
; res = SnmpCleanup()
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	wsnmp32 = windows.NewLazySystemDLL("wsnmp32.dll")
	procSnmpCleanup = wsnmp32.NewProc("SnmpCleanup")
)

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