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

SnmpSvcSetLogLevel

関数
SNMPサービスのログ出力レベルを設定する。
DLLsnmpapi.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

void SnmpSvcSetLogLevel(
    SNMP_LOG nLogLevel
);

パラメーター

名前方向
nLogLevelSNMP_LOGin

戻り値の型: void

各言語での呼び出し定義

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

void SnmpSvcSetLogLevel(
    SNMP_LOG nLogLevel
);
[DllImport("snmpapi.dll", ExactSpelling = true)]
static extern void SnmpSvcSetLogLevel(
    int nLogLevel   // SNMP_LOG
);
<DllImport("snmpapi.dll", ExactSpelling:=True)>
Public Shared Sub SnmpSvcSetLogLevel(
    nLogLevel As Integer   ' SNMP_LOG
)
End Sub
' nLogLevel : SNMP_LOG
Declare PtrSafe Sub SnmpSvcSetLogLevel Lib "snmpapi" ( _
    ByVal nLogLevel As Long)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

SnmpSvcSetLogLevel = ctypes.windll.snmpapi.SnmpSvcSetLogLevel
SnmpSvcSetLogLevel.restype = None
SnmpSvcSetLogLevel.argtypes = [
    ctypes.c_int,  # nLogLevel : SNMP_LOG
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('snmpapi.dll')
SnmpSvcSetLogLevel = Fiddle::Function.new(
  lib['SnmpSvcSetLogLevel'],
  [
    Fiddle::TYPE_INT,  # nLogLevel : SNMP_LOG
  ],
  Fiddle::TYPE_VOID)
#[link(name = "snmpapi")]
extern "system" {
    fn SnmpSvcSetLogLevel(
        nLogLevel: i32  // SNMP_LOG
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("snmpapi.dll")]
public static extern void SnmpSvcSetLogLevel(int nLogLevel);
"@
$api = Add-Type -MemberDefinition $sig -Name 'snmpapi_SnmpSvcSetLogLevel' -Namespace Win32 -PassThru
# $api::SnmpSvcSetLogLevel(nLogLevel)
#uselib "snmpapi.dll"
#func global SnmpSvcSetLogLevel "SnmpSvcSetLogLevel" sptr
; SnmpSvcSetLogLevel nLogLevel
; nLogLevel : SNMP_LOG -> "sptr"
#uselib "snmpapi.dll"
#func global SnmpSvcSetLogLevel "SnmpSvcSetLogLevel" int
; SnmpSvcSetLogLevel nLogLevel
; nLogLevel : SNMP_LOG -> "int"
; void SnmpSvcSetLogLevel(SNMP_LOG nLogLevel)
#uselib "snmpapi.dll"
#func global SnmpSvcSetLogLevel "SnmpSvcSetLogLevel" int
; SnmpSvcSetLogLevel nLogLevel
; nLogLevel : SNMP_LOG -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	snmpapi = windows.NewLazySystemDLL("snmpapi.dll")
	procSnmpSvcSetLogLevel = snmpapi.NewProc("SnmpSvcSetLogLevel")
)

// nLogLevel (SNMP_LOG)
r1, _, err := procSnmpSvcSetLogLevel.Call(
	uintptr(nLogLevel),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // void
procedure SnmpSvcSetLogLevel(
  nLogLevel: Integer   // SNMP_LOG
); stdcall;
  external 'snmpapi.dll' name 'SnmpSvcSetLogLevel';
result := DllCall("snmpapi\SnmpSvcSetLogLevel"
    , "Int", nLogLevel   ; SNMP_LOG
    , "Int")   ; return: void
●SnmpSvcSetLogLevel(nLogLevel) = DLL("snmpapi.dll", "int SnmpSvcSetLogLevel(int)")
# 呼び出し: SnmpSvcSetLogLevel(nLogLevel)
# nLogLevel : SNMP_LOG -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。