Win32 API 日本語リファレンス
ホームUI.WindowsAndMessaging › MrmIndexFileAutoQualifiers

MrmIndexFileAutoQualifiers

関数
修飾子を自動判定してファイルをインデックス化する。
DLLMrmSupport.dll呼出規約winapi

シグネチャ

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

HRESULT MrmIndexFileAutoQualifiers(
    MrmResourceIndexerHandle indexer,
    LPCWSTR filePath   // optional
);

パラメーター

名前方向説明
indexerMrmResourceIndexerHandlein使用するリソースインデクサのハンドル。
filePathLPCWSTRinoptionalインデックス登録するファイルのパス。修飾子はパスから自動推論される。

戻り値の型: HRESULT

各言語での呼び出し定義

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

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

MrmIndexFileAutoQualifiers = ctypes.windll.mrmsupport.MrmIndexFileAutoQualifiers
MrmIndexFileAutoQualifiers.restype = ctypes.c_int
MrmIndexFileAutoQualifiers.argtypes = [
    MrmResourceIndexerHandle,  # indexer : MrmResourceIndexerHandle
    wintypes.LPCWSTR,  # filePath : LPCWSTR optional
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('MrmSupport.dll')
MrmIndexFileAutoQualifiers = Fiddle::Function.new(
  lib['MrmIndexFileAutoQualifiers'],
  [
    Fiddle::TYPE_VOIDP,  # indexer : MrmResourceIndexerHandle
    Fiddle::TYPE_VOIDP,  # filePath : LPCWSTR optional
  ],
  Fiddle::TYPE_INT)
#[link(name = "mrmsupport")]
extern "system" {
    fn MrmIndexFileAutoQualifiers(
        indexer: MrmResourceIndexerHandle,  // MrmResourceIndexerHandle
        filePath: *const u16  // LPCWSTR optional
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("MrmSupport.dll")]
public static extern int MrmIndexFileAutoQualifiers(MrmResourceIndexerHandle indexer, [MarshalAs(UnmanagedType.LPWStr)] string filePath);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MrmSupport_MrmIndexFileAutoQualifiers' -Namespace Win32 -PassThru
# $api::MrmIndexFileAutoQualifiers(indexer, filePath)
#uselib "MrmSupport.dll"
#func global MrmIndexFileAutoQualifiers "MrmIndexFileAutoQualifiers" sptr, sptr
; MrmIndexFileAutoQualifiers indexer, filePath   ; 戻り値は stat
; indexer : MrmResourceIndexerHandle -> "sptr"
; filePath : LPCWSTR optional -> "sptr"
; ※値渡し構造体は直接渡せません。intにパック、または var で構造体変数を渡してください。
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "MrmSupport.dll"
#cfunc global MrmIndexFileAutoQualifiers "MrmIndexFileAutoQualifiers" int, wstr
; res = MrmIndexFileAutoQualifiers(indexer, filePath)
; indexer : MrmResourceIndexerHandle -> "int"
; filePath : LPCWSTR optional -> "wstr"
; ※値渡し構造体は直接渡せません。intにパック、または var で構造体変数を渡してください。
; HRESULT MrmIndexFileAutoQualifiers(MrmResourceIndexerHandle indexer, LPCWSTR filePath)
#uselib "MrmSupport.dll"
#cfunc global MrmIndexFileAutoQualifiers "MrmIndexFileAutoQualifiers" int, wstr
; res = MrmIndexFileAutoQualifiers(indexer, filePath)
; indexer : MrmResourceIndexerHandle -> "int"
; filePath : LPCWSTR optional -> "wstr"
; ※値渡し構造体は直接渡せません。intにパック、または var で構造体変数を渡してください。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	mrmsupport = windows.NewLazySystemDLL("MrmSupport.dll")
	procMrmIndexFileAutoQualifiers = mrmsupport.NewProc("MrmIndexFileAutoQualifiers")
)

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

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

typedef MrmIndexFileAutoQualifiersNative = Int32 Function(MrmResourceIndexerHandle, Pointer<Utf16>);
typedef MrmIndexFileAutoQualifiersDart = int Function(int, Pointer<Utf16>);
final MrmIndexFileAutoQualifiers = DynamicLibrary.open('MrmSupport.dll')
    .lookupFunction<MrmIndexFileAutoQualifiersNative, MrmIndexFileAutoQualifiersDart>('MrmIndexFileAutoQualifiers');
// indexer : MrmResourceIndexerHandle -> MrmResourceIndexerHandle
// filePath : LPCWSTR optional -> Pointer<Utf16>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function MrmIndexFileAutoQualifiers(
  indexer: MrmResourceIndexerHandle;   // MrmResourceIndexerHandle
  filePath: PWideChar   // LPCWSTR optional
): Integer; stdcall;
  external 'MrmSupport.dll' name 'MrmIndexFileAutoQualifiers';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "MrmIndexFileAutoQualifiers"
  c_MrmIndexFileAutoQualifiers :: MrmResourceIndexerHandle -> CWString -> IO Int32
-- indexer : MrmResourceIndexerHandle -> MrmResourceIndexerHandle
-- filePath : LPCWSTR optional -> CWString
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
-- ※値渡し構造体は GHC FFI で直接渡せません。Ptr で渡すラッパ(C側)経由にしてください。
open Ctypes
open Foreign

let mrmindexfileautoqualifiers =
  foreign "MrmIndexFileAutoQualifiers"
    (MrmResourceIndexerHandle @-> (ptr uint16_t) @-> returning int32_t)
(* indexer : MrmResourceIndexerHandle -> MrmResourceIndexerHandle *)
(* filePath : LPCWSTR optional -> (ptr uint16_t) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library mrmsupport (t "MrmSupport.dll"))
(cffi:use-foreign-library mrmsupport)

(cffi:defcfun ("MrmIndexFileAutoQualifiers" mrm-index-file-auto-qualifiers :convention :stdcall) :int32
  (indexer (:struct mrm-resource-indexer-handle))   ; MrmResourceIndexerHandle
  (file-path (:string :encoding :utf-16le)))   ; LPCWSTR optional
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $MrmIndexFileAutoQualifiers = Win32::API::More->new('MrmSupport',
    'int MrmIndexFileAutoQualifiers(LPVOID indexer, LPCWSTR filePath)');
# my $ret = $MrmIndexFileAutoQualifiers->Call($indexer, $filePath);
# indexer : MrmResourceIndexerHandle -> LPVOID
# filePath : LPCWSTR optional -> LPCWSTR
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

使用する型