ホーム › NetworkManagement.Rras › MprInfoBlockRemove
MprInfoBlockRemove
関数情報ヘッダーから指定種別の情報ブロックを削除する。
シグネチャ
// MPRAPI.dll
#include <windows.h>
DWORD MprInfoBlockRemove(
void* lpHeader,
DWORD dwInfoType,
void** lplpNewHeader
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| lpHeader | void* | in | ブロックを削除する元の情報ヘッダーへのポインタ。 |
| dwInfoType | DWORD | in | 削除する情報ブロックの種類を示す型識別子。 |
| lplpNewHeader | void** | out | ブロック削除後の新しいヘッダーへのポインタを受け取る。 |
戻り値の型: DWORD
各言語での呼び出し定義
// MPRAPI.dll
#include <windows.h>
DWORD MprInfoBlockRemove(
void* lpHeader,
DWORD dwInfoType,
void** lplpNewHeader
);[DllImport("MPRAPI.dll", ExactSpelling = true)]
static extern uint MprInfoBlockRemove(
IntPtr lpHeader, // void*
uint dwInfoType, // DWORD
IntPtr lplpNewHeader // void** out
);<DllImport("MPRAPI.dll", ExactSpelling:=True)>
Public Shared Function MprInfoBlockRemove(
lpHeader As IntPtr, ' void*
dwInfoType As UInteger, ' DWORD
lplpNewHeader As IntPtr ' void** out
) As UInteger
End Function' lpHeader : void*
' dwInfoType : DWORD
' lplpNewHeader : void** out
Declare PtrSafe Function MprInfoBlockRemove Lib "mprapi" ( _
ByVal lpHeader As LongPtr, _
ByVal dwInfoType As Long, _
ByVal lplpNewHeader As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
MprInfoBlockRemove = ctypes.windll.mprapi.MprInfoBlockRemove
MprInfoBlockRemove.restype = wintypes.DWORD
MprInfoBlockRemove.argtypes = [
ctypes.POINTER(None), # lpHeader : void*
wintypes.DWORD, # dwInfoType : DWORD
ctypes.c_void_p, # lplpNewHeader : void** out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('MPRAPI.dll')
MprInfoBlockRemove = Fiddle::Function.new(
lib['MprInfoBlockRemove'],
[
Fiddle::TYPE_VOIDP, # lpHeader : void*
-Fiddle::TYPE_INT, # dwInfoType : DWORD
Fiddle::TYPE_VOIDP, # lplpNewHeader : void** out
],
-Fiddle::TYPE_INT)#[link(name = "mprapi")]
extern "system" {
fn MprInfoBlockRemove(
lpHeader: *mut (), // void*
dwInfoType: u32, // DWORD
lplpNewHeader: *mut *mut () // void** out
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("MPRAPI.dll")]
public static extern uint MprInfoBlockRemove(IntPtr lpHeader, uint dwInfoType, IntPtr lplpNewHeader);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MPRAPI_MprInfoBlockRemove' -Namespace Win32 -PassThru
# $api::MprInfoBlockRemove(lpHeader, dwInfoType, lplpNewHeader)#uselib "MPRAPI.dll"
#func global MprInfoBlockRemove "MprInfoBlockRemove" sptr, sptr, sptr
; MprInfoBlockRemove lpHeader, dwInfoType, lplpNewHeader ; 戻り値は stat
; lpHeader : void* -> "sptr"
; dwInfoType : DWORD -> "sptr"
; lplpNewHeader : void** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "MPRAPI.dll"
#cfunc global MprInfoBlockRemove "MprInfoBlockRemove" sptr, int, sptr
; res = MprInfoBlockRemove(lpHeader, dwInfoType, lplpNewHeader)
; lpHeader : void* -> "sptr"
; dwInfoType : DWORD -> "int"
; lplpNewHeader : void** out -> "sptr"; DWORD MprInfoBlockRemove(void* lpHeader, DWORD dwInfoType, void** lplpNewHeader)
#uselib "MPRAPI.dll"
#cfunc global MprInfoBlockRemove "MprInfoBlockRemove" intptr, int, intptr
; res = MprInfoBlockRemove(lpHeader, dwInfoType, lplpNewHeader)
; lpHeader : void* -> "intptr"
; dwInfoType : DWORD -> "int"
; lplpNewHeader : void** out -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
mprapi = windows.NewLazySystemDLL("MPRAPI.dll")
procMprInfoBlockRemove = mprapi.NewProc("MprInfoBlockRemove")
)
// lpHeader (void*), dwInfoType (DWORD), lplpNewHeader (void** out)
r1, _, err := procMprInfoBlockRemove.Call(
uintptr(lpHeader),
uintptr(dwInfoType),
uintptr(lplpNewHeader),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction MprInfoBlockRemove(
lpHeader: Pointer; // void*
dwInfoType: DWORD; // DWORD
lplpNewHeader: Pointer // void** out
): DWORD; stdcall;
external 'MPRAPI.dll' name 'MprInfoBlockRemove';result := DllCall("MPRAPI\MprInfoBlockRemove"
, "Ptr", lpHeader ; void*
, "UInt", dwInfoType ; DWORD
, "Ptr", lplpNewHeader ; void** out
, "UInt") ; return: DWORD●MprInfoBlockRemove(lpHeader, dwInfoType, lplpNewHeader) = DLL("MPRAPI.dll", "dword MprInfoBlockRemove(void*, dword, void*)")
# 呼び出し: MprInfoBlockRemove(lpHeader, dwInfoType, lplpNewHeader)
# lpHeader : void* -> "void*"
# dwInfoType : DWORD -> "dword"
# lplpNewHeader : void** out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "mprapi" fn MprInfoBlockRemove(
lpHeader: ?*anyopaque, // void*
dwInfoType: u32, // DWORD
lplpNewHeader: ?*anyopaque // void** out
) callconv(std.os.windows.WINAPI) u32;proc MprInfoBlockRemove(
lpHeader: pointer, # void*
dwInfoType: uint32, # DWORD
lplpNewHeader: pointer # void** out
): uint32 {.importc: "MprInfoBlockRemove", stdcall, dynlib: "MPRAPI.dll".}pragma(lib, "mprapi");
extern(Windows)
uint MprInfoBlockRemove(
void* lpHeader, // void*
uint dwInfoType, // DWORD
void** lplpNewHeader // void** out
);ccall((:MprInfoBlockRemove, "MPRAPI.dll"), stdcall, UInt32,
(Ptr{Cvoid}, UInt32, Ptr{Cvoid}),
lpHeader, dwInfoType, lplpNewHeader)
# lpHeader : void* -> Ptr{Cvoid}
# dwInfoType : DWORD -> UInt32
# lplpNewHeader : void** out -> Ptr{Cvoid}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
uint32_t MprInfoBlockRemove(
void* lpHeader,
uint32_t dwInfoType,
void** lplpNewHeader);
]]
local mprapi = ffi.load("mprapi")
-- mprapi.MprInfoBlockRemove(lpHeader, dwInfoType, lplpNewHeader)
-- lpHeader : void*
-- dwInfoType : DWORD
-- lplpNewHeader : void** out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('MPRAPI.dll');
const MprInfoBlockRemove = lib.func('__stdcall', 'MprInfoBlockRemove', 'uint32_t', ['void *', 'uint32_t', 'void *']);
// MprInfoBlockRemove(lpHeader, dwInfoType, lplpNewHeader)
// lpHeader : void* -> 'void *'
// dwInfoType : DWORD -> 'uint32_t'
// lplpNewHeader : void** out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("MPRAPI.dll", {
MprInfoBlockRemove: { parameters: ["pointer", "u32", "pointer"], result: "u32" },
});
// lib.symbols.MprInfoBlockRemove(lpHeader, dwInfoType, lplpNewHeader)
// lpHeader : void* -> "pointer"
// dwInfoType : DWORD -> "u32"
// lplpNewHeader : void** out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
uint32_t MprInfoBlockRemove(
void* lpHeader,
uint32_t dwInfoType,
void** lplpNewHeader);
C, "MPRAPI.dll");
// $ffi->MprInfoBlockRemove(lpHeader, dwInfoType, lplpNewHeader);
// lpHeader : void*
// dwInfoType : DWORD
// lplpNewHeader : void** 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 Mprapi extends StdCallLibrary {
Mprapi INSTANCE = Native.load("mprapi", Mprapi.class);
int MprInfoBlockRemove(
Pointer lpHeader, // void*
int dwInfoType, // DWORD
Pointer lplpNewHeader // void** out
);
}@[Link("mprapi")]
lib LibMPRAPI
fun MprInfoBlockRemove = MprInfoBlockRemove(
lpHeader : Void*, # void*
dwInfoType : UInt32, # DWORD
lplpNewHeader : Void** # void** out
) : UInt32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef MprInfoBlockRemoveNative = Uint32 Function(Pointer<Void>, Uint32, Pointer<Void>);
typedef MprInfoBlockRemoveDart = int Function(Pointer<Void>, int, Pointer<Void>);
final MprInfoBlockRemove = DynamicLibrary.open('MPRAPI.dll')
.lookupFunction<MprInfoBlockRemoveNative, MprInfoBlockRemoveDart>('MprInfoBlockRemove');
// lpHeader : void* -> Pointer<Void>
// dwInfoType : DWORD -> Uint32
// lplpNewHeader : void** out -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function MprInfoBlockRemove(
lpHeader: Pointer; // void*
dwInfoType: DWORD; // DWORD
lplpNewHeader: Pointer // void** out
): DWORD; stdcall;
external 'MPRAPI.dll' name 'MprInfoBlockRemove';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "MprInfoBlockRemove"
c_MprInfoBlockRemove :: Ptr () -> Word32 -> Ptr () -> IO Word32
-- lpHeader : void* -> Ptr ()
-- dwInfoType : DWORD -> Word32
-- lplpNewHeader : void** out -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let mprinfoblockremove =
foreign "MprInfoBlockRemove"
((ptr void) @-> uint32_t @-> (ptr void) @-> returning uint32_t)
(* lpHeader : void* -> (ptr void) *)
(* dwInfoType : DWORD -> uint32_t *)
(* lplpNewHeader : void** out -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library mprapi (t "MPRAPI.dll"))
(cffi:use-foreign-library mprapi)
(cffi:defcfun ("MprInfoBlockRemove" mpr-info-block-remove :convention :stdcall) :uint32
(lp-header :pointer) ; void*
(dw-info-type :uint32) ; DWORD
(lplp-new-header :pointer)) ; void** out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $MprInfoBlockRemove = Win32::API::More->new('MPRAPI',
'DWORD MprInfoBlockRemove(LPVOID lpHeader, DWORD dwInfoType, LPVOID lplpNewHeader)');
# my $ret = $MprInfoBlockRemove->Call($lpHeader, $dwInfoType, $lplpNewHeader);
# lpHeader : void* -> LPVOID
# dwInfoType : DWORD -> DWORD
# lplpNewHeader : void** out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。