Win32 API 日本語リファレンス
ホームManagement.MobileDeviceManagementRegistration › ApplyLocalManagementSyncML

ApplyLocalManagementSyncML

関数
ローカル管理にSyncMLリクエストを適用し結果を取得する。
DLLMDMLocalManagement.dll呼出規約winapi

シグネチャ

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

HRESULT ApplyLocalManagementSyncML(
    LPCWSTR syncMLRequest,
    LPWSTR* syncMLResult   // optional
);

パラメーター

名前方向
syncMLRequestLPCWSTRin
syncMLResultLPWSTR*outoptional

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT ApplyLocalManagementSyncML(
    LPCWSTR syncMLRequest,
    LPWSTR* syncMLResult   // optional
);
[DllImport("MDMLocalManagement.dll", ExactSpelling = true)]
static extern int ApplyLocalManagementSyncML(
    [MarshalAs(UnmanagedType.LPWStr)] string syncMLRequest,   // LPCWSTR
    IntPtr syncMLResult   // LPWSTR* optional, out
);
<DllImport("MDMLocalManagement.dll", ExactSpelling:=True)>
Public Shared Function ApplyLocalManagementSyncML(
    <MarshalAs(UnmanagedType.LPWStr)> syncMLRequest As String,   ' LPCWSTR
    syncMLResult As IntPtr   ' LPWSTR* optional, out
) As Integer
End Function
' syncMLRequest : LPCWSTR
' syncMLResult : LPWSTR* optional, out
Declare PtrSafe Function ApplyLocalManagementSyncML Lib "mdmlocalmanagement" ( _
    ByVal syncMLRequest As LongPtr, _
    ByVal syncMLResult As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ApplyLocalManagementSyncML = ctypes.windll.mdmlocalmanagement.ApplyLocalManagementSyncML
ApplyLocalManagementSyncML.restype = ctypes.c_int
ApplyLocalManagementSyncML.argtypes = [
    wintypes.LPCWSTR,  # syncMLRequest : LPCWSTR
    ctypes.c_void_p,  # syncMLResult : LPWSTR* optional, out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	mdmlocalmanagement = windows.NewLazySystemDLL("MDMLocalManagement.dll")
	procApplyLocalManagementSyncML = mdmlocalmanagement.NewProc("ApplyLocalManagementSyncML")
)

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