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

NcFreeNetconProperties

関数
ネットワーク接続プロパティ構造体のメモリを解放する。
DLLNetshell.dll呼出規約winapi対応OSWindows XP 以降

シグネチャ

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

void NcFreeNetconProperties(
    NETCON_PROPERTIES* pProps
);

パラメーター

名前方向説明
pPropsNETCON_PROPERTIES*inoutINetConnection::GetProperties等で得たNETCON_PROPERTIES構造体へのポインタ。本関数で解放する。

戻り値の型: void

各言語での呼び出し定義

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

void NcFreeNetconProperties(
    NETCON_PROPERTIES* pProps
);
[DllImport("Netshell.dll", ExactSpelling = true)]
static extern void NcFreeNetconProperties(
    IntPtr pProps   // NETCON_PROPERTIES* in/out
);
<DllImport("Netshell.dll", ExactSpelling:=True)>
Public Shared Sub NcFreeNetconProperties(
    pProps As IntPtr   ' NETCON_PROPERTIES* in/out
)
End Sub
' pProps : NETCON_PROPERTIES* in/out
Declare PtrSafe Sub NcFreeNetconProperties Lib "netshell" ( _
    ByVal pProps As LongPtr)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

NcFreeNetconProperties = ctypes.windll.netshell.NcFreeNetconProperties
NcFreeNetconProperties.restype = None
NcFreeNetconProperties.argtypes = [
    ctypes.c_void_p,  # pProps : NETCON_PROPERTIES* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('Netshell.dll')
NcFreeNetconProperties = Fiddle::Function.new(
  lib['NcFreeNetconProperties'],
  [
    Fiddle::TYPE_VOIDP,  # pProps : NETCON_PROPERTIES* in/out
  ],
  Fiddle::TYPE_VOID)
#[link(name = "netshell")]
extern "system" {
    fn NcFreeNetconProperties(
        pProps: *mut NETCON_PROPERTIES  // NETCON_PROPERTIES* in/out
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("Netshell.dll")]
public static extern void NcFreeNetconProperties(IntPtr pProps);
"@
$api = Add-Type -MemberDefinition $sig -Name 'Netshell_NcFreeNetconProperties' -Namespace Win32 -PassThru
# $api::NcFreeNetconProperties(pProps)
#uselib "Netshell.dll"
#func global NcFreeNetconProperties "NcFreeNetconProperties" sptr
; NcFreeNetconProperties varptr(pProps)
; pProps : NETCON_PROPERTIES* in/out -> "sptr"
出力引数:
#uselib "Netshell.dll"
#func global NcFreeNetconProperties "NcFreeNetconProperties" var
; NcFreeNetconProperties pProps
; pProps : NETCON_PROPERTIES* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; void NcFreeNetconProperties(NETCON_PROPERTIES* pProps)
#uselib "Netshell.dll"
#func global NcFreeNetconProperties "NcFreeNetconProperties" var
; NcFreeNetconProperties pProps
; pProps : NETCON_PROPERTIES* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	netshell = windows.NewLazySystemDLL("Netshell.dll")
	procNcFreeNetconProperties = netshell.NewProc("NcFreeNetconProperties")
)

// pProps (NETCON_PROPERTIES* in/out)
r1, _, err := procNcFreeNetconProperties.Call(
	uintptr(pProps),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // void
procedure NcFreeNetconProperties(
  pProps: Pointer   // NETCON_PROPERTIES* in/out
); stdcall;
  external 'Netshell.dll' name 'NcFreeNetconProperties';
result := DllCall("Netshell\NcFreeNetconProperties"
    , "Ptr", pProps   ; NETCON_PROPERTIES* in/out
    , "Int")   ; return: void
●NcFreeNetconProperties(pProps) = DLL("Netshell.dll", "int NcFreeNetconProperties(void*)")
# 呼び出し: NcFreeNetconProperties(pProps)
# pProps : NETCON_PROPERTIES* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
const std = @import("std");

extern "netshell" fn NcFreeNetconProperties(
    pProps: [*c]NETCON_PROPERTIES // NETCON_PROPERTIES* in/out
) callconv(std.os.windows.WINAPI) void;
proc NcFreeNetconProperties(
    pProps: ptr NETCON_PROPERTIES  # NETCON_PROPERTIES* in/out
) {.importc: "NcFreeNetconProperties", stdcall, dynlib: "Netshell.dll".}
pragma(lib, "netshell");
extern(Windows)
void NcFreeNetconProperties(
    NETCON_PROPERTIES* pProps   // NETCON_PROPERTIES* in/out
);
ccall((:NcFreeNetconProperties, "Netshell.dll"), stdcall, Cvoid,
      (Ptr{NETCON_PROPERTIES},),
      pProps)
# pProps : NETCON_PROPERTIES* in/out -> Ptr{NETCON_PROPERTIES}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
void NcFreeNetconProperties(
    void* pProps);
]]
local netshell = ffi.load("netshell")
-- netshell.NcFreeNetconProperties(pProps)
-- pProps : NETCON_PROPERTIES* in/out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('Netshell.dll');
const NcFreeNetconProperties = lib.func('__stdcall', 'NcFreeNetconProperties', 'void', ['void *']);
// NcFreeNetconProperties(pProps)
// pProps : NETCON_PROPERTIES* in/out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("Netshell.dll", {
  NcFreeNetconProperties: { parameters: ["pointer"], result: "void" },
});
// lib.symbols.NcFreeNetconProperties(pProps)
// pProps : NETCON_PROPERTIES* in/out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
void NcFreeNetconProperties(
    void* pProps);
C, "Netshell.dll");
// $ffi->NcFreeNetconProperties(pProps);
// pProps : NETCON_PROPERTIES* in/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 Netshell extends StdCallLibrary {
    Netshell INSTANCE = Native.load("netshell", Netshell.class);
    void NcFreeNetconProperties(
        Pointer pProps   // NETCON_PROPERTIES* in/out
    );
}
@[Link("netshell")]
lib LibNetshell
  fun NcFreeNetconProperties = NcFreeNetconProperties(
    pProps : NETCON_PROPERTIES*   # NETCON_PROPERTIES* in/out
  ) : Void
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef NcFreeNetconPropertiesNative = Void Function(Pointer<Void>);
typedef NcFreeNetconPropertiesDart = void Function(Pointer<Void>);
final NcFreeNetconProperties = DynamicLibrary.open('Netshell.dll')
    .lookupFunction<NcFreeNetconPropertiesNative, NcFreeNetconPropertiesDart>('NcFreeNetconProperties');
// pProps : NETCON_PROPERTIES* in/out -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
procedure NcFreeNetconProperties(
  pProps: Pointer   // NETCON_PROPERTIES* in/out
); stdcall;
  external 'Netshell.dll' name 'NcFreeNetconProperties';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "NcFreeNetconProperties"
  c_NcFreeNetconProperties :: Ptr () -> IO ()
-- pProps : NETCON_PROPERTIES* in/out -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let ncfreenetconproperties =
  foreign "NcFreeNetconProperties"
    ((ptr void) @-> returning void)
(* pProps : NETCON_PROPERTIES* in/out -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library netshell (t "Netshell.dll"))
(cffi:use-foreign-library netshell)

(cffi:defcfun ("NcFreeNetconProperties" nc-free-netcon-properties :convention :stdcall) :void
  (p-props :pointer))   ; NETCON_PROPERTIES* in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $NcFreeNetconProperties = Win32::API::More->new('Netshell',
    'void NcFreeNetconProperties(LPVOID pProps)');
# my $ret = $NcFreeNetconProperties->Call($pProps);
# pProps : NETCON_PROPERTIES* in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

使用する型