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

SnmpSvcSetLogType

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

シグネチャ

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

void SnmpSvcSetLogType(
    INT nLogType
);

パラメーター

名前方向
nLogTypeINTin

戻り値の型: void

各言語での呼び出し定義

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

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

SnmpSvcSetLogType = ctypes.windll.snmpapi.SnmpSvcSetLogType
SnmpSvcSetLogType.restype = None
SnmpSvcSetLogType.argtypes = [
    ctypes.c_int,  # nLogType : INT
]
require 'fiddle'
require 'fiddle/import'

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

var (
	snmpapi = windows.NewLazySystemDLL("snmpapi.dll")
	procSnmpSvcSetLogType = snmpapi.NewProc("SnmpSvcSetLogType")
)

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