Win32 API 日本語リファレンス
ホームWeb.InternetExplorer › GetMaxMIMEIDBytes

GetMaxMIMEIDBytes

関数
MIMEタイプ識別に必要な最大バイト数を取得する。
DLLImgUtil.dll呼出規約winapi

シグネチャ

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

HRESULT GetMaxMIMEIDBytes(
    DWORD* pnMaxBytes
);

パラメーター

名前方向
pnMaxBytesDWORD*inout

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT GetMaxMIMEIDBytes(
    DWORD* pnMaxBytes
);
[DllImport("ImgUtil.dll", ExactSpelling = true)]
static extern int GetMaxMIMEIDBytes(
    ref uint pnMaxBytes   // DWORD* in/out
);
<DllImport("ImgUtil.dll", ExactSpelling:=True)>
Public Shared Function GetMaxMIMEIDBytes(
    ByRef pnMaxBytes As UInteger   ' DWORD* in/out
) As Integer
End Function
' pnMaxBytes : DWORD* in/out
Declare PtrSafe Function GetMaxMIMEIDBytes Lib "imgutil" ( _
    ByRef pnMaxBytes As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

GetMaxMIMEIDBytes = ctypes.windll.imgutil.GetMaxMIMEIDBytes
GetMaxMIMEIDBytes.restype = ctypes.c_int
GetMaxMIMEIDBytes.argtypes = [
    ctypes.POINTER(wintypes.DWORD),  # pnMaxBytes : DWORD* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	imgutil = windows.NewLazySystemDLL("ImgUtil.dll")
	procGetMaxMIMEIDBytes = imgutil.NewProc("GetMaxMIMEIDBytes")
)

// pnMaxBytes (DWORD* in/out)
r1, _, err := procGetMaxMIMEIDBytes.Call(
	uintptr(pnMaxBytes),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function GetMaxMIMEIDBytes(
  pnMaxBytes: Pointer   // DWORD* in/out
): Integer; stdcall;
  external 'ImgUtil.dll' name 'GetMaxMIMEIDBytes';
result := DllCall("ImgUtil\GetMaxMIMEIDBytes"
    , "Ptr", pnMaxBytes   ; DWORD* in/out
    , "Int")   ; return: HRESULT
●GetMaxMIMEIDBytes(pnMaxBytes) = DLL("ImgUtil.dll", "int GetMaxMIMEIDBytes(void*)")
# 呼び出し: GetMaxMIMEIDBytes(pnMaxBytes)
# pnMaxBytes : DWORD* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。