Win32 API 日本語リファレンス
ホームDevices.PortableDevices › DMProcessConfigXMLFiltered

DMProcessConfigXMLFiltered

関数
許可ノードに限定してデバイス管理構成XMLを処理する。
DLLDMProcessXMLFiltered.dll呼出規約winapi

シグネチャ

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

HRESULT DMProcessConfigXMLFiltered(
    LPCWSTR pszXmlIn,
    LPCWSTR* rgszAllowedCspNodes,
    DWORD dwNumAllowedCspNodes,
    LPWSTR* pbstrXmlOut
);

パラメーター

名前方向
pszXmlInLPCWSTRin
rgszAllowedCspNodesLPCWSTR*in
dwNumAllowedCspNodesDWORDin
pbstrXmlOutLPWSTR*out

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT DMProcessConfigXMLFiltered(
    LPCWSTR pszXmlIn,
    LPCWSTR* rgszAllowedCspNodes,
    DWORD dwNumAllowedCspNodes,
    LPWSTR* pbstrXmlOut
);
[DllImport("DMProcessXMLFiltered.dll", ExactSpelling = true)]
static extern int DMProcessConfigXMLFiltered(
    [MarshalAs(UnmanagedType.LPWStr)] string pszXmlIn,   // LPCWSTR
    IntPtr rgszAllowedCspNodes,   // LPCWSTR*
    uint dwNumAllowedCspNodes,   // DWORD
    IntPtr pbstrXmlOut   // LPWSTR* out
);
<DllImport("DMProcessXMLFiltered.dll", ExactSpelling:=True)>
Public Shared Function DMProcessConfigXMLFiltered(
    <MarshalAs(UnmanagedType.LPWStr)> pszXmlIn As String,   ' LPCWSTR
    rgszAllowedCspNodes As IntPtr,   ' LPCWSTR*
    dwNumAllowedCspNodes As UInteger,   ' DWORD
    pbstrXmlOut As IntPtr   ' LPWSTR* out
) As Integer
End Function
' pszXmlIn : LPCWSTR
' rgszAllowedCspNodes : LPCWSTR*
' dwNumAllowedCspNodes : DWORD
' pbstrXmlOut : LPWSTR* out
Declare PtrSafe Function DMProcessConfigXMLFiltered Lib "dmprocessxmlfiltered" ( _
    ByVal pszXmlIn As LongPtr, _
    ByVal rgszAllowedCspNodes As LongPtr, _
    ByVal dwNumAllowedCspNodes As Long, _
    ByVal pbstrXmlOut As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

DMProcessConfigXMLFiltered = ctypes.windll.dmprocessxmlfiltered.DMProcessConfigXMLFiltered
DMProcessConfigXMLFiltered.restype = ctypes.c_int
DMProcessConfigXMLFiltered.argtypes = [
    wintypes.LPCWSTR,  # pszXmlIn : LPCWSTR
    ctypes.c_void_p,  # rgszAllowedCspNodes : LPCWSTR*
    wintypes.DWORD,  # dwNumAllowedCspNodes : DWORD
    ctypes.c_void_p,  # pbstrXmlOut : LPWSTR* out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	dmprocessxmlfiltered = windows.NewLazySystemDLL("DMProcessXMLFiltered.dll")
	procDMProcessConfigXMLFiltered = dmprocessxmlfiltered.NewProc("DMProcessConfigXMLFiltered")
)

// pszXmlIn (LPCWSTR), rgszAllowedCspNodes (LPCWSTR*), dwNumAllowedCspNodes (DWORD), pbstrXmlOut (LPWSTR* out)
r1, _, err := procDMProcessConfigXMLFiltered.Call(
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(pszXmlIn))),
	uintptr(rgszAllowedCspNodes),
	uintptr(dwNumAllowedCspNodes),
	uintptr(pbstrXmlOut),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function DMProcessConfigXMLFiltered(
  pszXmlIn: PWideChar;   // LPCWSTR
  rgszAllowedCspNodes: PPWideChar;   // LPCWSTR*
  dwNumAllowedCspNodes: DWORD;   // DWORD
  pbstrXmlOut: PPWideChar   // LPWSTR* out
): Integer; stdcall;
  external 'DMProcessXMLFiltered.dll' name 'DMProcessConfigXMLFiltered';
result := DllCall("DMProcessXMLFiltered\DMProcessConfigXMLFiltered"
    , "WStr", pszXmlIn   ; LPCWSTR
    , "Ptr", rgszAllowedCspNodes   ; LPCWSTR*
    , "UInt", dwNumAllowedCspNodes   ; DWORD
    , "Ptr", pbstrXmlOut   ; LPWSTR* out
    , "Int")   ; return: HRESULT
●DMProcessConfigXMLFiltered(pszXmlIn, rgszAllowedCspNodes, dwNumAllowedCspNodes, pbstrXmlOut) = DLL("DMProcessXMLFiltered.dll", "int DMProcessConfigXMLFiltered(char*, void*, dword, void*)")
# 呼び出し: DMProcessConfigXMLFiltered(pszXmlIn, rgszAllowedCspNodes, dwNumAllowedCspNodes, pbstrXmlOut)
# pszXmlIn : LPCWSTR -> "char*"
# rgszAllowedCspNodes : LPCWSTR* -> "void*"
# dwNumAllowedCspNodes : DWORD -> "dword"
# pbstrXmlOut : LPWSTR* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。