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

MprInfoBlockRemove

関数
情報ヘッダーから指定種別の情報ブロックを削除する。
DLLMPRAPI.dll呼出規約winapi対応OSwindowsserver2000

シグネチャ

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

DWORD MprInfoBlockRemove(
    void* lpHeader,
    DWORD dwInfoType,
    void** lplpNewHeader
);

パラメーター

名前方向
lpHeadervoid*in
dwInfoTypeDWORDin
lplpNewHeadervoid**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   // DWORD
function 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)。