ホーム › System.RestartManager › RmRegisterResources
RmRegisterResources
関数ファイル・プロセス・サービスをセッションに登録する。
シグネチャ
// rstrtmgr.dll
#include <windows.h>
WIN32_ERROR RmRegisterResources(
DWORD dwSessionHandle,
DWORD nFiles,
LPCWSTR* rgsFileNames, // optional
DWORD nApplications,
RM_UNIQUE_PROCESS* rgApplications, // optional
DWORD nServices,
LPCWSTR* rgsServiceNames // optional
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| dwSessionHandle | DWORD | in | リソースを登録する対象のセッションハンドル。 |
| nFiles | DWORD | in | rgsFileNames 配列に含まれるファイル数。 |
| rgsFileNames | LPCWSTR* | inoptional | 登録するファイルのフルパス文字列の配列。NULL 可。 |
| nApplications | DWORD | in | rgApplications 配列に含まれるアプリケーション数。 |
| rgApplications | RM_UNIQUE_PROCESS* | inoptional | 登録するアプリケーションを識別する RM_UNIQUE_PROCESS 構造体の配列。NULL 可。 |
| nServices | DWORD | in | rgsServiceNames 配列に含まれるサービス数。 |
| rgsServiceNames | LPCWSTR* | inoptional | 登録するサービスの短い名前の文字列配列。NULL 可。 |
戻り値の型: WIN32_ERROR
各言語での呼び出し定義
// rstrtmgr.dll
#include <windows.h>
WIN32_ERROR RmRegisterResources(
DWORD dwSessionHandle,
DWORD nFiles,
LPCWSTR* rgsFileNames, // optional
DWORD nApplications,
RM_UNIQUE_PROCESS* rgApplications, // optional
DWORD nServices,
LPCWSTR* rgsServiceNames // optional
);[DllImport("rstrtmgr.dll", ExactSpelling = true)]
static extern uint RmRegisterResources(
uint dwSessionHandle, // DWORD
uint nFiles, // DWORD
IntPtr rgsFileNames, // LPCWSTR* optional
uint nApplications, // DWORD
IntPtr rgApplications, // RM_UNIQUE_PROCESS* optional
uint nServices, // DWORD
IntPtr rgsServiceNames // LPCWSTR* optional
);<DllImport("rstrtmgr.dll", ExactSpelling:=True)>
Public Shared Function RmRegisterResources(
dwSessionHandle As UInteger, ' DWORD
nFiles As UInteger, ' DWORD
rgsFileNames As IntPtr, ' LPCWSTR* optional
nApplications As UInteger, ' DWORD
rgApplications As IntPtr, ' RM_UNIQUE_PROCESS* optional
nServices As UInteger, ' DWORD
rgsServiceNames As IntPtr ' LPCWSTR* optional
) As UInteger
End Function' dwSessionHandle : DWORD
' nFiles : DWORD
' rgsFileNames : LPCWSTR* optional
' nApplications : DWORD
' rgApplications : RM_UNIQUE_PROCESS* optional
' nServices : DWORD
' rgsServiceNames : LPCWSTR* optional
Declare PtrSafe Function RmRegisterResources Lib "rstrtmgr" ( _
ByVal dwSessionHandle As Long, _
ByVal nFiles As Long, _
ByVal rgsFileNames As LongPtr, _
ByVal nApplications As Long, _
ByVal rgApplications As LongPtr, _
ByVal nServices As Long, _
ByVal rgsServiceNames As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
RmRegisterResources = ctypes.windll.rstrtmgr.RmRegisterResources
RmRegisterResources.restype = wintypes.DWORD
RmRegisterResources.argtypes = [
wintypes.DWORD, # dwSessionHandle : DWORD
wintypes.DWORD, # nFiles : DWORD
ctypes.c_void_p, # rgsFileNames : LPCWSTR* optional
wintypes.DWORD, # nApplications : DWORD
ctypes.c_void_p, # rgApplications : RM_UNIQUE_PROCESS* optional
wintypes.DWORD, # nServices : DWORD
ctypes.c_void_p, # rgsServiceNames : LPCWSTR* optional
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('rstrtmgr.dll')
RmRegisterResources = Fiddle::Function.new(
lib['RmRegisterResources'],
[
-Fiddle::TYPE_INT, # dwSessionHandle : DWORD
-Fiddle::TYPE_INT, # nFiles : DWORD
Fiddle::TYPE_VOIDP, # rgsFileNames : LPCWSTR* optional
-Fiddle::TYPE_INT, # nApplications : DWORD
Fiddle::TYPE_VOIDP, # rgApplications : RM_UNIQUE_PROCESS* optional
-Fiddle::TYPE_INT, # nServices : DWORD
Fiddle::TYPE_VOIDP, # rgsServiceNames : LPCWSTR* optional
],
-Fiddle::TYPE_INT)#[link(name = "rstrtmgr")]
extern "system" {
fn RmRegisterResources(
dwSessionHandle: u32, // DWORD
nFiles: u32, // DWORD
rgsFileNames: *const *const u16, // LPCWSTR* optional
nApplications: u32, // DWORD
rgApplications: *mut RM_UNIQUE_PROCESS, // RM_UNIQUE_PROCESS* optional
nServices: u32, // DWORD
rgsServiceNames: *const *const u16 // LPCWSTR* optional
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("rstrtmgr.dll")]
public static extern uint RmRegisterResources(uint dwSessionHandle, uint nFiles, IntPtr rgsFileNames, uint nApplications, IntPtr rgApplications, uint nServices, IntPtr rgsServiceNames);
"@
$api = Add-Type -MemberDefinition $sig -Name 'rstrtmgr_RmRegisterResources' -Namespace Win32 -PassThru
# $api::RmRegisterResources(dwSessionHandle, nFiles, rgsFileNames, nApplications, rgApplications, nServices, rgsServiceNames)#uselib "rstrtmgr.dll"
#func global RmRegisterResources "RmRegisterResources" sptr, sptr, sptr, sptr, sptr, sptr, sptr
; RmRegisterResources dwSessionHandle, nFiles, varptr(rgsFileNames), nApplications, varptr(rgApplications), nServices, varptr(rgsServiceNames) ; 戻り値は stat
; dwSessionHandle : DWORD -> "sptr"
; nFiles : DWORD -> "sptr"
; rgsFileNames : LPCWSTR* optional -> "sptr"
; nApplications : DWORD -> "sptr"
; rgApplications : RM_UNIQUE_PROCESS* optional -> "sptr"
; nServices : DWORD -> "sptr"
; rgsServiceNames : LPCWSTR* optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "rstrtmgr.dll" #cfunc global RmRegisterResources "RmRegisterResources" int, int, var, int, var, int, var ; res = RmRegisterResources(dwSessionHandle, nFiles, rgsFileNames, nApplications, rgApplications, nServices, rgsServiceNames) ; dwSessionHandle : DWORD -> "int" ; nFiles : DWORD -> "int" ; rgsFileNames : LPCWSTR* optional -> "var" ; nApplications : DWORD -> "int" ; rgApplications : RM_UNIQUE_PROCESS* optional -> "var" ; nServices : DWORD -> "int" ; rgsServiceNames : LPCWSTR* optional -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "rstrtmgr.dll" #cfunc global RmRegisterResources "RmRegisterResources" int, int, sptr, int, sptr, int, sptr ; res = RmRegisterResources(dwSessionHandle, nFiles, varptr(rgsFileNames), nApplications, varptr(rgApplications), nServices, varptr(rgsServiceNames)) ; dwSessionHandle : DWORD -> "int" ; nFiles : DWORD -> "int" ; rgsFileNames : LPCWSTR* optional -> "sptr" ; nApplications : DWORD -> "int" ; rgApplications : RM_UNIQUE_PROCESS* optional -> "sptr" ; nServices : DWORD -> "int" ; rgsServiceNames : LPCWSTR* optional -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; WIN32_ERROR RmRegisterResources(DWORD dwSessionHandle, DWORD nFiles, LPCWSTR* rgsFileNames, DWORD nApplications, RM_UNIQUE_PROCESS* rgApplications, DWORD nServices, LPCWSTR* rgsServiceNames) #uselib "rstrtmgr.dll" #cfunc global RmRegisterResources "RmRegisterResources" int, int, var, int, var, int, var ; res = RmRegisterResources(dwSessionHandle, nFiles, rgsFileNames, nApplications, rgApplications, nServices, rgsServiceNames) ; dwSessionHandle : DWORD -> "int" ; nFiles : DWORD -> "int" ; rgsFileNames : LPCWSTR* optional -> "var" ; nApplications : DWORD -> "int" ; rgApplications : RM_UNIQUE_PROCESS* optional -> "var" ; nServices : DWORD -> "int" ; rgsServiceNames : LPCWSTR* optional -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; WIN32_ERROR RmRegisterResources(DWORD dwSessionHandle, DWORD nFiles, LPCWSTR* rgsFileNames, DWORD nApplications, RM_UNIQUE_PROCESS* rgApplications, DWORD nServices, LPCWSTR* rgsServiceNames) #uselib "rstrtmgr.dll" #cfunc global RmRegisterResources "RmRegisterResources" int, int, intptr, int, intptr, int, intptr ; res = RmRegisterResources(dwSessionHandle, nFiles, varptr(rgsFileNames), nApplications, varptr(rgApplications), nServices, varptr(rgsServiceNames)) ; dwSessionHandle : DWORD -> "int" ; nFiles : DWORD -> "int" ; rgsFileNames : LPCWSTR* optional -> "intptr" ; nApplications : DWORD -> "int" ; rgApplications : RM_UNIQUE_PROCESS* optional -> "intptr" ; nServices : DWORD -> "int" ; rgsServiceNames : LPCWSTR* optional -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
rstrtmgr = windows.NewLazySystemDLL("rstrtmgr.dll")
procRmRegisterResources = rstrtmgr.NewProc("RmRegisterResources")
)
// dwSessionHandle (DWORD), nFiles (DWORD), rgsFileNames (LPCWSTR* optional), nApplications (DWORD), rgApplications (RM_UNIQUE_PROCESS* optional), nServices (DWORD), rgsServiceNames (LPCWSTR* optional)
r1, _, err := procRmRegisterResources.Call(
uintptr(dwSessionHandle),
uintptr(nFiles),
uintptr(rgsFileNames),
uintptr(nApplications),
uintptr(rgApplications),
uintptr(nServices),
uintptr(rgsServiceNames),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // WIN32_ERRORfunction RmRegisterResources(
dwSessionHandle: DWORD; // DWORD
nFiles: DWORD; // DWORD
rgsFileNames: PPWideChar; // LPCWSTR* optional
nApplications: DWORD; // DWORD
rgApplications: Pointer; // RM_UNIQUE_PROCESS* optional
nServices: DWORD; // DWORD
rgsServiceNames: PPWideChar // LPCWSTR* optional
): DWORD; stdcall;
external 'rstrtmgr.dll' name 'RmRegisterResources';result := DllCall("rstrtmgr\RmRegisterResources"
, "UInt", dwSessionHandle ; DWORD
, "UInt", nFiles ; DWORD
, "Ptr", rgsFileNames ; LPCWSTR* optional
, "UInt", nApplications ; DWORD
, "Ptr", rgApplications ; RM_UNIQUE_PROCESS* optional
, "UInt", nServices ; DWORD
, "Ptr", rgsServiceNames ; LPCWSTR* optional
, "UInt") ; return: WIN32_ERROR●RmRegisterResources(dwSessionHandle, nFiles, rgsFileNames, nApplications, rgApplications, nServices, rgsServiceNames) = DLL("rstrtmgr.dll", "dword RmRegisterResources(dword, dword, void*, dword, void*, dword, void*)")
# 呼び出し: RmRegisterResources(dwSessionHandle, nFiles, rgsFileNames, nApplications, rgApplications, nServices, rgsServiceNames)
# dwSessionHandle : DWORD -> "dword"
# nFiles : DWORD -> "dword"
# rgsFileNames : LPCWSTR* optional -> "void*"
# nApplications : DWORD -> "dword"
# rgApplications : RM_UNIQUE_PROCESS* optional -> "void*"
# nServices : DWORD -> "dword"
# rgsServiceNames : LPCWSTR* optional -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "rstrtmgr" fn RmRegisterResources(
dwSessionHandle: u32, // DWORD
nFiles: u32, // DWORD
rgsFileNames: [*c][*c]u16, // LPCWSTR* optional
nApplications: u32, // DWORD
rgApplications: [*c]RM_UNIQUE_PROCESS, // RM_UNIQUE_PROCESS* optional
nServices: u32, // DWORD
rgsServiceNames: [*c][*c]u16 // LPCWSTR* optional
) callconv(std.os.windows.WINAPI) u32;proc RmRegisterResources(
dwSessionHandle: uint32, # DWORD
nFiles: uint32, # DWORD
rgsFileNames: ptr WideCString, # LPCWSTR* optional
nApplications: uint32, # DWORD
rgApplications: ptr RM_UNIQUE_PROCESS, # RM_UNIQUE_PROCESS* optional
nServices: uint32, # DWORD
rgsServiceNames: ptr WideCString # LPCWSTR* optional
): uint32 {.importc: "RmRegisterResources", stdcall, dynlib: "rstrtmgr.dll".}pragma(lib, "rstrtmgr");
extern(Windows)
uint RmRegisterResources(
uint dwSessionHandle, // DWORD
uint nFiles, // DWORD
wchar** rgsFileNames, // LPCWSTR* optional
uint nApplications, // DWORD
RM_UNIQUE_PROCESS* rgApplications, // RM_UNIQUE_PROCESS* optional
uint nServices, // DWORD
wchar** rgsServiceNames // LPCWSTR* optional
);ccall((:RmRegisterResources, "rstrtmgr.dll"), stdcall, UInt32,
(UInt32, UInt32, Ptr{Ptr{UInt16}}, UInt32, Ptr{RM_UNIQUE_PROCESS}, UInt32, Ptr{Ptr{UInt16}}),
dwSessionHandle, nFiles, rgsFileNames, nApplications, rgApplications, nServices, rgsServiceNames)
# dwSessionHandle : DWORD -> UInt32
# nFiles : DWORD -> UInt32
# rgsFileNames : LPCWSTR* optional -> Ptr{Ptr{UInt16}}
# nApplications : DWORD -> UInt32
# rgApplications : RM_UNIQUE_PROCESS* optional -> Ptr{RM_UNIQUE_PROCESS}
# nServices : DWORD -> UInt32
# rgsServiceNames : LPCWSTR* optional -> Ptr{Ptr{UInt16}}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
uint32_t RmRegisterResources(
uint32_t dwSessionHandle,
uint32_t nFiles,
uint16_t** rgsFileNames,
uint32_t nApplications,
void* rgApplications,
uint32_t nServices,
uint16_t** rgsServiceNames);
]]
local rstrtmgr = ffi.load("rstrtmgr")
-- rstrtmgr.RmRegisterResources(dwSessionHandle, nFiles, rgsFileNames, nApplications, rgApplications, nServices, rgsServiceNames)
-- dwSessionHandle : DWORD
-- nFiles : DWORD
-- rgsFileNames : LPCWSTR* optional
-- nApplications : DWORD
-- rgApplications : RM_UNIQUE_PROCESS* optional
-- nServices : DWORD
-- rgsServiceNames : LPCWSTR* optional
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('rstrtmgr.dll');
const RmRegisterResources = lib.func('__stdcall', 'RmRegisterResources', 'uint32_t', ['uint32_t', 'uint32_t', 'void *', 'uint32_t', 'void *', 'uint32_t', 'void *']);
// RmRegisterResources(dwSessionHandle, nFiles, rgsFileNames, nApplications, rgApplications, nServices, rgsServiceNames)
// dwSessionHandle : DWORD -> 'uint32_t'
// nFiles : DWORD -> 'uint32_t'
// rgsFileNames : LPCWSTR* optional -> 'void *'
// nApplications : DWORD -> 'uint32_t'
// rgApplications : RM_UNIQUE_PROCESS* optional -> 'void *'
// nServices : DWORD -> 'uint32_t'
// rgsServiceNames : LPCWSTR* optional -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("rstrtmgr.dll", {
RmRegisterResources: { parameters: ["u32", "u32", "pointer", "u32", "pointer", "u32", "pointer"], result: "u32" },
});
// lib.symbols.RmRegisterResources(dwSessionHandle, nFiles, rgsFileNames, nApplications, rgApplications, nServices, rgsServiceNames)
// dwSessionHandle : DWORD -> "u32"
// nFiles : DWORD -> "u32"
// rgsFileNames : LPCWSTR* optional -> "pointer"
// nApplications : DWORD -> "u32"
// rgApplications : RM_UNIQUE_PROCESS* optional -> "pointer"
// nServices : DWORD -> "u32"
// rgsServiceNames : LPCWSTR* optional -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
uint32_t RmRegisterResources(
uint32_t dwSessionHandle,
uint32_t nFiles,
uint16_t** rgsFileNames,
uint32_t nApplications,
void* rgApplications,
uint32_t nServices,
uint16_t** rgsServiceNames);
C, "rstrtmgr.dll");
// $ffi->RmRegisterResources(dwSessionHandle, nFiles, rgsFileNames, nApplications, rgApplications, nServices, rgsServiceNames);
// dwSessionHandle : DWORD
// nFiles : DWORD
// rgsFileNames : LPCWSTR* optional
// nApplications : DWORD
// rgApplications : RM_UNIQUE_PROCESS* optional
// nServices : DWORD
// rgsServiceNames : LPCWSTR* optional
// 構造体/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 Rstrtmgr extends StdCallLibrary {
Rstrtmgr INSTANCE = Native.load("rstrtmgr", Rstrtmgr.class);
int RmRegisterResources(
int dwSessionHandle, // DWORD
int nFiles, // DWORD
PointerByReference rgsFileNames, // LPCWSTR* optional
int nApplications, // DWORD
Pointer rgApplications, // RM_UNIQUE_PROCESS* optional
int nServices, // DWORD
PointerByReference rgsServiceNames // LPCWSTR* optional
);
}@[Link("rstrtmgr")]
lib Librstrtmgr
fun RmRegisterResources = RmRegisterResources(
dwSessionHandle : UInt32, # DWORD
nFiles : UInt32, # DWORD
rgsFileNames : UInt16**, # LPCWSTR* optional
nApplications : UInt32, # DWORD
rgApplications : RM_UNIQUE_PROCESS*, # RM_UNIQUE_PROCESS* optional
nServices : UInt32, # DWORD
rgsServiceNames : UInt16** # LPCWSTR* optional
) : UInt32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef RmRegisterResourcesNative = Uint32 Function(Uint32, Uint32, Pointer<Pointer<Utf16>>, Uint32, Pointer<Void>, Uint32, Pointer<Pointer<Utf16>>);
typedef RmRegisterResourcesDart = int Function(int, int, Pointer<Pointer<Utf16>>, int, Pointer<Void>, int, Pointer<Pointer<Utf16>>);
final RmRegisterResources = DynamicLibrary.open('rstrtmgr.dll')
.lookupFunction<RmRegisterResourcesNative, RmRegisterResourcesDart>('RmRegisterResources');
// dwSessionHandle : DWORD -> Uint32
// nFiles : DWORD -> Uint32
// rgsFileNames : LPCWSTR* optional -> Pointer<Pointer<Utf16>>
// nApplications : DWORD -> Uint32
// rgApplications : RM_UNIQUE_PROCESS* optional -> Pointer<Void>
// nServices : DWORD -> Uint32
// rgsServiceNames : LPCWSTR* optional -> Pointer<Pointer<Utf16>>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function RmRegisterResources(
dwSessionHandle: DWORD; // DWORD
nFiles: DWORD; // DWORD
rgsFileNames: PPWideChar; // LPCWSTR* optional
nApplications: DWORD; // DWORD
rgApplications: Pointer; // RM_UNIQUE_PROCESS* optional
nServices: DWORD; // DWORD
rgsServiceNames: PPWideChar // LPCWSTR* optional
): DWORD; stdcall;
external 'rstrtmgr.dll' name 'RmRegisterResources';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "RmRegisterResources"
c_RmRegisterResources :: Word32 -> Word32 -> Ptr CWString -> Word32 -> Ptr () -> Word32 -> Ptr CWString -> IO Word32
-- dwSessionHandle : DWORD -> Word32
-- nFiles : DWORD -> Word32
-- rgsFileNames : LPCWSTR* optional -> Ptr CWString
-- nApplications : DWORD -> Word32
-- rgApplications : RM_UNIQUE_PROCESS* optional -> Ptr ()
-- nServices : DWORD -> Word32
-- rgsServiceNames : LPCWSTR* optional -> Ptr CWString
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let rmregisterresources =
foreign "RmRegisterResources"
(uint32_t @-> uint32_t @-> (ptr (ptr uint16_t)) @-> uint32_t @-> (ptr void) @-> uint32_t @-> (ptr (ptr uint16_t)) @-> returning uint32_t)
(* dwSessionHandle : DWORD -> uint32_t *)
(* nFiles : DWORD -> uint32_t *)
(* rgsFileNames : LPCWSTR* optional -> (ptr (ptr uint16_t)) *)
(* nApplications : DWORD -> uint32_t *)
(* rgApplications : RM_UNIQUE_PROCESS* optional -> (ptr void) *)
(* nServices : DWORD -> uint32_t *)
(* rgsServiceNames : LPCWSTR* optional -> (ptr (ptr uint16_t)) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library rstrtmgr (t "rstrtmgr.dll"))
(cffi:use-foreign-library rstrtmgr)
(cffi:defcfun ("RmRegisterResources" rm-register-resources :convention :stdcall) :uint32
(dw-session-handle :uint32) ; DWORD
(n-files :uint32) ; DWORD
(rgs-file-names :pointer) ; LPCWSTR* optional
(n-applications :uint32) ; DWORD
(rg-applications :pointer) ; RM_UNIQUE_PROCESS* optional
(n-services :uint32) ; DWORD
(rgs-service-names :pointer)) ; LPCWSTR* optional
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $RmRegisterResources = Win32::API::More->new('rstrtmgr',
'DWORD RmRegisterResources(DWORD dwSessionHandle, DWORD nFiles, LPVOID rgsFileNames, DWORD nApplications, LPVOID rgApplications, DWORD nServices, LPVOID rgsServiceNames)');
# my $ret = $RmRegisterResources->Call($dwSessionHandle, $nFiles, $rgsFileNames, $nApplications, $rgApplications, $nServices, $rgsServiceNames);
# dwSessionHandle : DWORD -> DWORD
# nFiles : DWORD -> DWORD
# rgsFileNames : LPCWSTR* optional -> LPVOID
# nApplications : DWORD -> DWORD
# rgApplications : RM_UNIQUE_PROCESS* optional -> LPVOID
# nServices : DWORD -> DWORD
# rgsServiceNames : LPCWSTR* optional -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。