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

NdfCreateGroupingIncident

関数
ピアグループ化に関する診断インシデントを作成する。
DLLNDFAPI.dll呼出規約winapi対応OSWindows 7 以降

シグネチャ

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

HRESULT NdfCreateGroupingIncident(
    LPCWSTR CloudName,   // optional
    LPCWSTR GroupName,   // optional
    LPCWSTR Identity,   // optional
    LPCWSTR Invitation,   // optional
    SOCKET_ADDRESS_LIST* Addresses,   // optional
    LPCWSTR appId,   // optional
    void** handle
);

パラメーター

名前方向
CloudNameLPCWSTRinoptional
GroupNameLPCWSTRinoptional
IdentityLPCWSTRinoptional
InvitationLPCWSTRinoptional
AddressesSOCKET_ADDRESS_LIST*inoptional
appIdLPCWSTRinoptional
handlevoid**out

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT NdfCreateGroupingIncident(
    LPCWSTR CloudName,   // optional
    LPCWSTR GroupName,   // optional
    LPCWSTR Identity,   // optional
    LPCWSTR Invitation,   // optional
    SOCKET_ADDRESS_LIST* Addresses,   // optional
    LPCWSTR appId,   // optional
    void** handle
);
[DllImport("NDFAPI.dll", ExactSpelling = true)]
static extern int NdfCreateGroupingIncident(
    [MarshalAs(UnmanagedType.LPWStr)] string CloudName,   // LPCWSTR optional
    [MarshalAs(UnmanagedType.LPWStr)] string GroupName,   // LPCWSTR optional
    [MarshalAs(UnmanagedType.LPWStr)] string Identity,   // LPCWSTR optional
    [MarshalAs(UnmanagedType.LPWStr)] string Invitation,   // LPCWSTR optional
    IntPtr Addresses,   // SOCKET_ADDRESS_LIST* optional
    [MarshalAs(UnmanagedType.LPWStr)] string appId,   // LPCWSTR optional
    IntPtr handle   // void** out
);
<DllImport("NDFAPI.dll", ExactSpelling:=True)>
Public Shared Function NdfCreateGroupingIncident(
    <MarshalAs(UnmanagedType.LPWStr)> CloudName As String,   ' LPCWSTR optional
    <MarshalAs(UnmanagedType.LPWStr)> GroupName As String,   ' LPCWSTR optional
    <MarshalAs(UnmanagedType.LPWStr)> Identity As String,   ' LPCWSTR optional
    <MarshalAs(UnmanagedType.LPWStr)> Invitation As String,   ' LPCWSTR optional
    Addresses As IntPtr,   ' SOCKET_ADDRESS_LIST* optional
    <MarshalAs(UnmanagedType.LPWStr)> appId As String,   ' LPCWSTR optional
    handle As IntPtr   ' void** out
) As Integer
End Function
' CloudName : LPCWSTR optional
' GroupName : LPCWSTR optional
' Identity : LPCWSTR optional
' Invitation : LPCWSTR optional
' Addresses : SOCKET_ADDRESS_LIST* optional
' appId : LPCWSTR optional
' handle : void** out
Declare PtrSafe Function NdfCreateGroupingIncident Lib "ndfapi" ( _
    ByVal CloudName As LongPtr, _
    ByVal GroupName As LongPtr, _
    ByVal Identity As LongPtr, _
    ByVal Invitation As LongPtr, _
    ByVal Addresses As LongPtr, _
    ByVal appId As LongPtr, _
    ByVal handle As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

NdfCreateGroupingIncident = ctypes.windll.ndfapi.NdfCreateGroupingIncident
NdfCreateGroupingIncident.restype = ctypes.c_int
NdfCreateGroupingIncident.argtypes = [
    wintypes.LPCWSTR,  # CloudName : LPCWSTR optional
    wintypes.LPCWSTR,  # GroupName : LPCWSTR optional
    wintypes.LPCWSTR,  # Identity : LPCWSTR optional
    wintypes.LPCWSTR,  # Invitation : LPCWSTR optional
    ctypes.c_void_p,  # Addresses : SOCKET_ADDRESS_LIST* optional
    wintypes.LPCWSTR,  # appId : LPCWSTR optional
    ctypes.c_void_p,  # handle : void** out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('NDFAPI.dll')
NdfCreateGroupingIncident = Fiddle::Function.new(
  lib['NdfCreateGroupingIncident'],
  [
    Fiddle::TYPE_VOIDP,  # CloudName : LPCWSTR optional
    Fiddle::TYPE_VOIDP,  # GroupName : LPCWSTR optional
    Fiddle::TYPE_VOIDP,  # Identity : LPCWSTR optional
    Fiddle::TYPE_VOIDP,  # Invitation : LPCWSTR optional
    Fiddle::TYPE_VOIDP,  # Addresses : SOCKET_ADDRESS_LIST* optional
    Fiddle::TYPE_VOIDP,  # appId : LPCWSTR optional
    Fiddle::TYPE_VOIDP,  # handle : void** out
  ],
  Fiddle::TYPE_INT)
#[link(name = "ndfapi")]
extern "system" {
    fn NdfCreateGroupingIncident(
        CloudName: *const u16,  // LPCWSTR optional
        GroupName: *const u16,  // LPCWSTR optional
        Identity: *const u16,  // LPCWSTR optional
        Invitation: *const u16,  // LPCWSTR optional
        Addresses: *mut SOCKET_ADDRESS_LIST,  // SOCKET_ADDRESS_LIST* optional
        appId: *const u16,  // LPCWSTR optional
        handle: *mut *mut ()  // void** out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("NDFAPI.dll")]
public static extern int NdfCreateGroupingIncident([MarshalAs(UnmanagedType.LPWStr)] string CloudName, [MarshalAs(UnmanagedType.LPWStr)] string GroupName, [MarshalAs(UnmanagedType.LPWStr)] string Identity, [MarshalAs(UnmanagedType.LPWStr)] string Invitation, IntPtr Addresses, [MarshalAs(UnmanagedType.LPWStr)] string appId, IntPtr handle);
"@
$api = Add-Type -MemberDefinition $sig -Name 'NDFAPI_NdfCreateGroupingIncident' -Namespace Win32 -PassThru
# $api::NdfCreateGroupingIncident(CloudName, GroupName, Identity, Invitation, Addresses, appId, handle)
#uselib "NDFAPI.dll"
#func global NdfCreateGroupingIncident "NdfCreateGroupingIncident" sptr, sptr, sptr, sptr, sptr, sptr, sptr
; NdfCreateGroupingIncident CloudName, GroupName, Identity, Invitation, varptr(Addresses), appId, handle   ; 戻り値は stat
; CloudName : LPCWSTR optional -> "sptr"
; GroupName : LPCWSTR optional -> "sptr"
; Identity : LPCWSTR optional -> "sptr"
; Invitation : LPCWSTR optional -> "sptr"
; Addresses : SOCKET_ADDRESS_LIST* optional -> "sptr"
; appId : LPCWSTR optional -> "sptr"
; handle : void** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "NDFAPI.dll"
#cfunc global NdfCreateGroupingIncident "NdfCreateGroupingIncident" wstr, wstr, wstr, wstr, var, wstr, sptr
; res = NdfCreateGroupingIncident(CloudName, GroupName, Identity, Invitation, Addresses, appId, handle)
; CloudName : LPCWSTR optional -> "wstr"
; GroupName : LPCWSTR optional -> "wstr"
; Identity : LPCWSTR optional -> "wstr"
; Invitation : LPCWSTR optional -> "wstr"
; Addresses : SOCKET_ADDRESS_LIST* optional -> "var"
; appId : LPCWSTR optional -> "wstr"
; handle : void** out -> "sptr"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; HRESULT NdfCreateGroupingIncident(LPCWSTR CloudName, LPCWSTR GroupName, LPCWSTR Identity, LPCWSTR Invitation, SOCKET_ADDRESS_LIST* Addresses, LPCWSTR appId, void** handle)
#uselib "NDFAPI.dll"
#cfunc global NdfCreateGroupingIncident "NdfCreateGroupingIncident" wstr, wstr, wstr, wstr, var, wstr, intptr
; res = NdfCreateGroupingIncident(CloudName, GroupName, Identity, Invitation, Addresses, appId, handle)
; CloudName : LPCWSTR optional -> "wstr"
; GroupName : LPCWSTR optional -> "wstr"
; Identity : LPCWSTR optional -> "wstr"
; Invitation : LPCWSTR optional -> "wstr"
; Addresses : SOCKET_ADDRESS_LIST* optional -> "var"
; appId : LPCWSTR optional -> "wstr"
; handle : void** out -> "intptr"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	ndfapi = windows.NewLazySystemDLL("NDFAPI.dll")
	procNdfCreateGroupingIncident = ndfapi.NewProc("NdfCreateGroupingIncident")
)

// CloudName (LPCWSTR optional), GroupName (LPCWSTR optional), Identity (LPCWSTR optional), Invitation (LPCWSTR optional), Addresses (SOCKET_ADDRESS_LIST* optional), appId (LPCWSTR optional), handle (void** out)
r1, _, err := procNdfCreateGroupingIncident.Call(
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(CloudName))),
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(GroupName))),
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(Identity))),
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(Invitation))),
	uintptr(Addresses),
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(appId))),
	uintptr(handle),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function NdfCreateGroupingIncident(
  CloudName: PWideChar;   // LPCWSTR optional
  GroupName: PWideChar;   // LPCWSTR optional
  Identity: PWideChar;   // LPCWSTR optional
  Invitation: PWideChar;   // LPCWSTR optional
  Addresses: Pointer;   // SOCKET_ADDRESS_LIST* optional
  appId: PWideChar;   // LPCWSTR optional
  handle: Pointer   // void** out
): Integer; stdcall;
  external 'NDFAPI.dll' name 'NdfCreateGroupingIncident';
result := DllCall("NDFAPI\NdfCreateGroupingIncident"
    , "WStr", CloudName   ; LPCWSTR optional
    , "WStr", GroupName   ; LPCWSTR optional
    , "WStr", Identity   ; LPCWSTR optional
    , "WStr", Invitation   ; LPCWSTR optional
    , "Ptr", Addresses   ; SOCKET_ADDRESS_LIST* optional
    , "WStr", appId   ; LPCWSTR optional
    , "Ptr", handle   ; void** out
    , "Int")   ; return: HRESULT
●NdfCreateGroupingIncident(CloudName, GroupName, Identity, Invitation, Addresses, appId, handle) = DLL("NDFAPI.dll", "int NdfCreateGroupingIncident(char*, char*, char*, char*, void*, char*, void*)")
# 呼び出し: NdfCreateGroupingIncident(CloudName, GroupName, Identity, Invitation, Addresses, appId, handle)
# CloudName : LPCWSTR optional -> "char*"
# GroupName : LPCWSTR optional -> "char*"
# Identity : LPCWSTR optional -> "char*"
# Invitation : LPCWSTR optional -> "char*"
# Addresses : SOCKET_ADDRESS_LIST* optional -> "void*"
# appId : LPCWSTR optional -> "char*"
# handle : void** out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。