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

HidP_SetUsages

関数
HIDレポート内の指定したボタン用途をオンに設定する。
DLLHID.dll呼出規約winapi

シグネチャ

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

NTSTATUS HidP_SetUsages(
    HIDP_REPORT_TYPE ReportType,
    WORD UsagePage,
    WORD LinkCollection,   // optional
    WORD* UsageList,
    DWORD* UsageLength,
    PHIDP_PREPARSED_DATA PreparsedData,
    LPSTR Report,
    DWORD ReportLength
);

パラメーター

名前方向説明
ReportTypeHIDP_REPORT_TYPEin対象のレポート種別をHIDP_REPORT_TYPE(Input/Output/Feature)で指定する。
UsagePageWORDin設定するユーセージのユーセージページを指定する。
LinkCollectionWORDinoptional対象のリンクコレクションを指定する。0で限定しない。
UsageListWORD*inoutオン状態に設定するユーセージ(ボタン)の配列へのポインタを指定する。
UsageLengthDWORD*inout入出力でUsageListの要素数を指定し、処理された数を受け取るDWORDへのポインタ。
PreparsedDataPHIDP_PREPARSED_DATAinHidD_GetPreparsedDataで取得した前解析データへのポインタを指定する。
ReportLPSTRin更新するレポートバッファへのポインタを指定する。
ReportLengthDWORDinReportバッファのバイト長を指定する。

戻り値の型: NTSTATUS

各言語での呼び出し定義

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

NTSTATUS HidP_SetUsages(
    HIDP_REPORT_TYPE ReportType,
    WORD UsagePage,
    WORD LinkCollection,   // optional
    WORD* UsageList,
    DWORD* UsageLength,
    PHIDP_PREPARSED_DATA PreparsedData,
    LPSTR Report,
    DWORD ReportLength
);
[DllImport("HID.dll", ExactSpelling = true)]
static extern int HidP_SetUsages(
    int ReportType,   // HIDP_REPORT_TYPE
    ushort UsagePage,   // WORD
    ushort LinkCollection,   // WORD optional
    ref ushort UsageList,   // WORD* in/out
    ref uint UsageLength,   // DWORD* in/out
    IntPtr PreparsedData,   // PHIDP_PREPARSED_DATA
    [MarshalAs(UnmanagedType.LPStr)] string Report,   // LPSTR
    uint ReportLength   // DWORD
);
<DllImport("HID.dll", ExactSpelling:=True)>
Public Shared Function HidP_SetUsages(
    ReportType As Integer,   ' HIDP_REPORT_TYPE
    UsagePage As UShort,   ' WORD
    LinkCollection As UShort,   ' WORD optional
    ByRef UsageList As UShort,   ' WORD* in/out
    ByRef UsageLength As UInteger,   ' DWORD* in/out
    PreparsedData As IntPtr,   ' PHIDP_PREPARSED_DATA
    <MarshalAs(UnmanagedType.LPStr)> Report As String,   ' LPSTR
    ReportLength As UInteger   ' DWORD
) As Integer
End Function
' ReportType : HIDP_REPORT_TYPE
' UsagePage : WORD
' LinkCollection : WORD optional
' UsageList : WORD* in/out
' UsageLength : DWORD* in/out
' PreparsedData : PHIDP_PREPARSED_DATA
' Report : LPSTR
' ReportLength : DWORD
Declare PtrSafe Function HidP_SetUsages Lib "hid" ( _
    ByVal ReportType As Long, _
    ByVal UsagePage As Integer, _
    ByVal LinkCollection As Integer, _
    ByRef UsageList As Integer, _
    ByRef UsageLength As Long, _
    ByVal PreparsedData As LongPtr, _
    ByVal Report As String, _
    ByVal ReportLength As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

HidP_SetUsages = ctypes.windll.hid.HidP_SetUsages
HidP_SetUsages.restype = ctypes.c_int
HidP_SetUsages.argtypes = [
    ctypes.c_int,  # ReportType : HIDP_REPORT_TYPE
    ctypes.c_ushort,  # UsagePage : WORD
    ctypes.c_ushort,  # LinkCollection : WORD optional
    ctypes.POINTER(ctypes.c_ushort),  # UsageList : WORD* in/out
    ctypes.POINTER(wintypes.DWORD),  # UsageLength : DWORD* in/out
    ctypes.c_ssize_t,  # PreparsedData : PHIDP_PREPARSED_DATA
    wintypes.LPCSTR,  # Report : LPSTR
    wintypes.DWORD,  # ReportLength : DWORD
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('HID.dll')
HidP_SetUsages = Fiddle::Function.new(
  lib['HidP_SetUsages'],
  [
    Fiddle::TYPE_INT,  # ReportType : HIDP_REPORT_TYPE
    -Fiddle::TYPE_SHORT,  # UsagePage : WORD
    -Fiddle::TYPE_SHORT,  # LinkCollection : WORD optional
    Fiddle::TYPE_VOIDP,  # UsageList : WORD* in/out
    Fiddle::TYPE_VOIDP,  # UsageLength : DWORD* in/out
    Fiddle::TYPE_INTPTR_T,  # PreparsedData : PHIDP_PREPARSED_DATA
    Fiddle::TYPE_VOIDP,  # Report : LPSTR
    -Fiddle::TYPE_INT,  # ReportLength : DWORD
  ],
  Fiddle::TYPE_INT)
#[link(name = "hid")]
extern "system" {
    fn HidP_SetUsages(
        ReportType: i32,  // HIDP_REPORT_TYPE
        UsagePage: u16,  // WORD
        LinkCollection: u16,  // WORD optional
        UsageList: *mut u16,  // WORD* in/out
        UsageLength: *mut u32,  // DWORD* in/out
        PreparsedData: isize,  // PHIDP_PREPARSED_DATA
        Report: *mut u8,  // LPSTR
        ReportLength: u32  // DWORD
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("HID.dll")]
public static extern int HidP_SetUsages(int ReportType, ushort UsagePage, ushort LinkCollection, ref ushort UsageList, ref uint UsageLength, IntPtr PreparsedData, [MarshalAs(UnmanagedType.LPStr)] string Report, uint ReportLength);
"@
$api = Add-Type -MemberDefinition $sig -Name 'HID_HidP_SetUsages' -Namespace Win32 -PassThru
# $api::HidP_SetUsages(ReportType, UsagePage, LinkCollection, UsageList, UsageLength, PreparsedData, Report, ReportLength)
#uselib "HID.dll"
#func global HidP_SetUsages "HidP_SetUsages" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; HidP_SetUsages ReportType, UsagePage, LinkCollection, varptr(UsageList), varptr(UsageLength), PreparsedData, Report, ReportLength   ; 戻り値は stat
; ReportType : HIDP_REPORT_TYPE -> "sptr"
; UsagePage : WORD -> "sptr"
; LinkCollection : WORD optional -> "sptr"
; UsageList : WORD* in/out -> "sptr"
; UsageLength : DWORD* in/out -> "sptr"
; PreparsedData : PHIDP_PREPARSED_DATA -> "sptr"
; Report : LPSTR -> "sptr"
; ReportLength : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "HID.dll"
#cfunc global HidP_SetUsages "HidP_SetUsages" int, int, int, var, var, sptr, str, int
; res = HidP_SetUsages(ReportType, UsagePage, LinkCollection, UsageList, UsageLength, PreparsedData, Report, ReportLength)
; ReportType : HIDP_REPORT_TYPE -> "int"
; UsagePage : WORD -> "int"
; LinkCollection : WORD optional -> "int"
; UsageList : WORD* in/out -> "var"
; UsageLength : DWORD* in/out -> "var"
; PreparsedData : PHIDP_PREPARSED_DATA -> "sptr"
; Report : LPSTR -> "str"
; ReportLength : DWORD -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; NTSTATUS HidP_SetUsages(HIDP_REPORT_TYPE ReportType, WORD UsagePage, WORD LinkCollection, WORD* UsageList, DWORD* UsageLength, PHIDP_PREPARSED_DATA PreparsedData, LPSTR Report, DWORD ReportLength)
#uselib "HID.dll"
#cfunc global HidP_SetUsages "HidP_SetUsages" int, int, int, var, var, intptr, str, int
; res = HidP_SetUsages(ReportType, UsagePage, LinkCollection, UsageList, UsageLength, PreparsedData, Report, ReportLength)
; ReportType : HIDP_REPORT_TYPE -> "int"
; UsagePage : WORD -> "int"
; LinkCollection : WORD optional -> "int"
; UsageList : WORD* in/out -> "var"
; UsageLength : DWORD* in/out -> "var"
; PreparsedData : PHIDP_PREPARSED_DATA -> "intptr"
; Report : LPSTR -> "str"
; ReportLength : DWORD -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	hid = windows.NewLazySystemDLL("HID.dll")
	procHidP_SetUsages = hid.NewProc("HidP_SetUsages")
)

// ReportType (HIDP_REPORT_TYPE), UsagePage (WORD), LinkCollection (WORD optional), UsageList (WORD* in/out), UsageLength (DWORD* in/out), PreparsedData (PHIDP_PREPARSED_DATA), Report (LPSTR), ReportLength (DWORD)
r1, _, err := procHidP_SetUsages.Call(
	uintptr(ReportType),
	uintptr(UsagePage),
	uintptr(LinkCollection),
	uintptr(UsageList),
	uintptr(UsageLength),
	uintptr(PreparsedData),
	uintptr(unsafe.Pointer(windows.BytePtrFromString(Report))),
	uintptr(ReportLength),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // NTSTATUS
function HidP_SetUsages(
  ReportType: Integer;   // HIDP_REPORT_TYPE
  UsagePage: Word;   // WORD
  LinkCollection: Word;   // WORD optional
  UsageList: Pointer;   // WORD* in/out
  UsageLength: Pointer;   // DWORD* in/out
  PreparsedData: NativeInt;   // PHIDP_PREPARSED_DATA
  Report: PAnsiChar;   // LPSTR
  ReportLength: DWORD   // DWORD
): Integer; stdcall;
  external 'HID.dll' name 'HidP_SetUsages';
result := DllCall("HID\HidP_SetUsages"
    , "Int", ReportType   ; HIDP_REPORT_TYPE
    , "UShort", UsagePage   ; WORD
    , "UShort", LinkCollection   ; WORD optional
    , "Ptr", UsageList   ; WORD* in/out
    , "Ptr", UsageLength   ; DWORD* in/out
    , "Ptr", PreparsedData   ; PHIDP_PREPARSED_DATA
    , "AStr", Report   ; LPSTR
    , "UInt", ReportLength   ; DWORD
    , "Int")   ; return: NTSTATUS
●HidP_SetUsages(ReportType, UsagePage, LinkCollection, UsageList, UsageLength, PreparsedData, Report, ReportLength) = DLL("HID.dll", "int HidP_SetUsages(int, int, int, void*, void*, int, char*, dword)")
# 呼び出し: HidP_SetUsages(ReportType, UsagePage, LinkCollection, UsageList, UsageLength, PreparsedData, Report, ReportLength)
# ReportType : HIDP_REPORT_TYPE -> "int"
# UsagePage : WORD -> "int"
# LinkCollection : WORD optional -> "int"
# UsageList : WORD* in/out -> "void*"
# UsageLength : DWORD* in/out -> "void*"
# PreparsedData : PHIDP_PREPARSED_DATA -> "int"
# Report : LPSTR -> "char*"
# ReportLength : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
const std = @import("std");

extern "hid" fn HidP_SetUsages(
    ReportType: i32, // HIDP_REPORT_TYPE
    UsagePage: u16, // WORD
    LinkCollection: u16, // WORD optional
    UsageList: [*c]u16, // WORD* in/out
    UsageLength: [*c]u32, // DWORD* in/out
    PreparsedData: isize, // PHIDP_PREPARSED_DATA
    Report: [*c]const u8, // LPSTR
    ReportLength: u32 // DWORD
) callconv(std.os.windows.WINAPI) i32;
proc HidP_SetUsages(
    ReportType: int32,  # HIDP_REPORT_TYPE
    UsagePage: uint16,  # WORD
    LinkCollection: uint16,  # WORD optional
    UsageList: ptr uint16,  # WORD* in/out
    UsageLength: ptr uint32,  # DWORD* in/out
    PreparsedData: int,  # PHIDP_PREPARSED_DATA
    Report: cstring,  # LPSTR
    ReportLength: uint32  # DWORD
): int32 {.importc: "HidP_SetUsages", stdcall, dynlib: "HID.dll".}
pragma(lib, "hid");
extern(Windows)
int HidP_SetUsages(
    int ReportType,   // HIDP_REPORT_TYPE
    ushort UsagePage,   // WORD
    ushort LinkCollection,   // WORD optional
    ushort* UsageList,   // WORD* in/out
    uint* UsageLength,   // DWORD* in/out
    ptrdiff_t PreparsedData,   // PHIDP_PREPARSED_DATA
    const(char)* Report,   // LPSTR
    uint ReportLength   // DWORD
);
ccall((:HidP_SetUsages, "HID.dll"), stdcall, Int32,
      (Int32, UInt16, UInt16, Ptr{UInt16}, Ptr{UInt32}, Int, Cstring, UInt32),
      ReportType, UsagePage, LinkCollection, UsageList, UsageLength, PreparsedData, Report, ReportLength)
# ReportType : HIDP_REPORT_TYPE -> Int32
# UsagePage : WORD -> UInt16
# LinkCollection : WORD optional -> UInt16
# UsageList : WORD* in/out -> Ptr{UInt16}
# UsageLength : DWORD* in/out -> Ptr{UInt32}
# PreparsedData : PHIDP_PREPARSED_DATA -> Int
# Report : LPSTR -> Cstring
# ReportLength : DWORD -> UInt32
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
int32_t HidP_SetUsages(
    int32_t ReportType,
    uint16_t UsagePage,
    uint16_t LinkCollection,
    uint16_t* UsageList,
    uint32_t* UsageLength,
    intptr_t PreparsedData,
    const char* Report,
    uint32_t ReportLength);
]]
local hid = ffi.load("hid")
-- hid.HidP_SetUsages(ReportType, UsagePage, LinkCollection, UsageList, UsageLength, PreparsedData, Report, ReportLength)
-- ReportType : HIDP_REPORT_TYPE
-- UsagePage : WORD
-- LinkCollection : WORD optional
-- UsageList : WORD* in/out
-- UsageLength : DWORD* in/out
-- PreparsedData : PHIDP_PREPARSED_DATA
-- Report : LPSTR
-- ReportLength : DWORD
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('HID.dll');
const HidP_SetUsages = lib.func('__stdcall', 'HidP_SetUsages', 'int32_t', ['int32_t', 'uint16_t', 'uint16_t', 'uint16_t *', 'uint32_t *', 'intptr_t', 'str', 'uint32_t']);
// HidP_SetUsages(ReportType, UsagePage, LinkCollection, UsageList, UsageLength, PreparsedData, Report, ReportLength)
// ReportType : HIDP_REPORT_TYPE -> 'int32_t'
// UsagePage : WORD -> 'uint16_t'
// LinkCollection : WORD optional -> 'uint16_t'
// UsageList : WORD* in/out -> 'uint16_t *'
// UsageLength : DWORD* in/out -> 'uint32_t *'
// PreparsedData : PHIDP_PREPARSED_DATA -> 'intptr_t'
// Report : LPSTR -> 'str'
// ReportLength : DWORD -> 'uint32_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("HID.dll", {
  HidP_SetUsages: { parameters: ["i32", "u16", "u16", "pointer", "pointer", "isize", "buffer", "u32"], result: "i32" },
});
// lib.symbols.HidP_SetUsages(ReportType, UsagePage, LinkCollection, UsageList, UsageLength, PreparsedData, Report, ReportLength)
// ReportType : HIDP_REPORT_TYPE -> "i32"
// UsagePage : WORD -> "u16"
// LinkCollection : WORD optional -> "u16"
// UsageList : WORD* in/out -> "pointer"
// UsageLength : DWORD* in/out -> "pointer"
// PreparsedData : PHIDP_PREPARSED_DATA -> "isize"
// Report : LPSTR -> "buffer"
// ReportLength : DWORD -> "u32"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t HidP_SetUsages(
    int32_t ReportType,
    uint16_t UsagePage,
    uint16_t LinkCollection,
    uint16_t* UsageList,
    uint32_t* UsageLength,
    intptr_t PreparsedData,
    const char* Report,
    uint32_t ReportLength);
C, "HID.dll");
// $ffi->HidP_SetUsages(ReportType, UsagePage, LinkCollection, UsageList, UsageLength, PreparsedData, Report, ReportLength);
// ReportType : HIDP_REPORT_TYPE
// UsagePage : WORD
// LinkCollection : WORD optional
// UsageList : WORD* in/out
// UsageLength : DWORD* in/out
// PreparsedData : PHIDP_PREPARSED_DATA
// Report : LPSTR
// ReportLength : DWORD
// 構造体/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 Hid extends StdCallLibrary {
    Hid INSTANCE = Native.load("hid", Hid.class);
    int HidP_SetUsages(
        int ReportType,   // HIDP_REPORT_TYPE
        short UsagePage,   // WORD
        short LinkCollection,   // WORD optional
        ShortByReference UsageList,   // WORD* in/out
        IntByReference UsageLength,   // DWORD* in/out
        long PreparsedData,   // PHIDP_PREPARSED_DATA
        String Report,   // LPSTR
        int ReportLength   // DWORD
    );
}
@[Link("hid")]
lib LibHID
  fun HidP_SetUsages = HidP_SetUsages(
    ReportType : Int32,   # HIDP_REPORT_TYPE
    UsagePage : UInt16,   # WORD
    LinkCollection : UInt16,   # WORD optional
    UsageList : UInt16*,   # WORD* in/out
    UsageLength : UInt32*,   # DWORD* in/out
    PreparsedData : LibC::SSizeT,   # PHIDP_PREPARSED_DATA
    Report : UInt8*,   # LPSTR
    ReportLength : UInt32   # DWORD
  ) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef HidP_SetUsagesNative = Int32 Function(Int32, Uint16, Uint16, Pointer<Uint16>, Pointer<Uint32>, IntPtr, Pointer<Utf8>, Uint32);
typedef HidP_SetUsagesDart = int Function(int, int, int, Pointer<Uint16>, Pointer<Uint32>, int, Pointer<Utf8>, int);
final HidP_SetUsages = DynamicLibrary.open('HID.dll')
    .lookupFunction<HidP_SetUsagesNative, HidP_SetUsagesDart>('HidP_SetUsages');
// ReportType : HIDP_REPORT_TYPE -> Int32
// UsagePage : WORD -> Uint16
// LinkCollection : WORD optional -> Uint16
// UsageList : WORD* in/out -> Pointer<Uint16>
// UsageLength : DWORD* in/out -> Pointer<Uint32>
// PreparsedData : PHIDP_PREPARSED_DATA -> IntPtr
// Report : LPSTR -> Pointer<Utf8>
// ReportLength : DWORD -> Uint32
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function HidP_SetUsages(
  ReportType: Integer;   // HIDP_REPORT_TYPE
  UsagePage: Word;   // WORD
  LinkCollection: Word;   // WORD optional
  UsageList: Pointer;   // WORD* in/out
  UsageLength: Pointer;   // DWORD* in/out
  PreparsedData: NativeInt;   // PHIDP_PREPARSED_DATA
  Report: PAnsiChar;   // LPSTR
  ReportLength: DWORD   // DWORD
): Integer; stdcall;
  external 'HID.dll' name 'HidP_SetUsages';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "HidP_SetUsages"
  c_HidP_SetUsages :: Int32 -> Word16 -> Word16 -> Ptr Word16 -> Ptr Word32 -> CIntPtr -> CString -> Word32 -> IO Int32
-- ReportType : HIDP_REPORT_TYPE -> Int32
-- UsagePage : WORD -> Word16
-- LinkCollection : WORD optional -> Word16
-- UsageList : WORD* in/out -> Ptr Word16
-- UsageLength : DWORD* in/out -> Ptr Word32
-- PreparsedData : PHIDP_PREPARSED_DATA -> CIntPtr
-- Report : LPSTR -> CString
-- ReportLength : DWORD -> Word32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let hidp_setusages =
  foreign "HidP_SetUsages"
    (int32_t @-> uint16_t @-> uint16_t @-> (ptr uint16_t) @-> (ptr uint32_t) @-> intptr_t @-> string @-> uint32_t @-> returning int32_t)
(* ReportType : HIDP_REPORT_TYPE -> int32_t *)
(* UsagePage : WORD -> uint16_t *)
(* LinkCollection : WORD optional -> uint16_t *)
(* UsageList : WORD* in/out -> (ptr uint16_t) *)
(* UsageLength : DWORD* in/out -> (ptr uint32_t) *)
(* PreparsedData : PHIDP_PREPARSED_DATA -> intptr_t *)
(* Report : LPSTR -> string *)
(* ReportLength : DWORD -> uint32_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library hid (t "HID.dll"))
(cffi:use-foreign-library hid)

(cffi:defcfun ("HidP_SetUsages" hid-p-set-usages :convention :stdcall) :int32
  (report-type :int32)   ; HIDP_REPORT_TYPE
  (usage-page :uint16)   ; WORD
  (link-collection :uint16)   ; WORD optional
  (usage-list :pointer)   ; WORD* in/out
  (usage-length :pointer)   ; DWORD* in/out
  (preparsed-data :int64)   ; PHIDP_PREPARSED_DATA
  (report :string)   ; LPSTR
  (report-length :uint32))   ; DWORD
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $HidP_SetUsages = Win32::API::More->new('HID',
    'int HidP_SetUsages(int ReportType, WORD UsagePage, WORD LinkCollection, LPVOID UsageList, LPVOID UsageLength, LPARAM PreparsedData, LPCSTR Report, DWORD ReportLength)');
# my $ret = $HidP_SetUsages->Call($ReportType, $UsagePage, $LinkCollection, $UsageList, $UsageLength, $PreparsedData, $Report, $ReportLength);
# ReportType : HIDP_REPORT_TYPE -> int
# UsagePage : WORD -> WORD
# LinkCollection : WORD optional -> WORD
# UsageList : WORD* in/out -> LPVOID
# UsageLength : DWORD* in/out -> LPVOID
# PreparsedData : PHIDP_PREPARSED_DATA -> LPARAM
# Report : LPSTR -> LPCSTR
# ReportLength : DWORD -> DWORD
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

使用する型